/* Generated by Cython 3.2.5 */

/* BEGIN: Cython Metadata
{
    "distutils": {
        "define_macros": [
            [
                "_FORCE_INLINES",
                "1"
            ],
            [
                "CYTHON_EXTERN_C",
                "extern \"C\""
            ],
            [
                "NPY_TARGET_VERSION",
                "NPY_2_0_API_VERSION"
            ],
            [
                "CUPY_CACHE_KEY",
                "28a6d0d64fe089c15e4ff802c7b0f8edb50d2a99"
            ],
            [
                "CUPY_CUB_VERSION_CODE",
                300102
            ],
            [
                "CUPY_JITIFY_VERSION_CODE",
                "1a0ca0e"
            ]
        ],
        "depends": [
            "cupy_backends/cupy_complex.h",
            "cupy_backends/cupy_sparse.h"
        ],
        "extra_compile_args": [
            "-std=c++17"
        ],
        "extra_link_args": [
            "-Wl,--disable-new-dtags,-rpath,/opt/cuda/lib64,-rpath,/opt/cuda/lib"
        ],
        "extra_objects": [
            "/opt/cuda/lib64/libcudart_static.a"
        ],
        "include_dirs": [
            "cupy_backends/cuda/libs",
            "/build/python-cupy/src/python-cupy/cupy/_core/include/cupy/_cccl/libcudacxx",
            "/build/python-cupy/src/python-cupy/cupy/_core/include/cupy/_cccl/thrust",
            "/build/python-cupy/src/python-cupy/cupy/_core/include/cupy/_cccl/cub",
            "/build/python-cupy/src/python-cupy/cupy/_core/include",
            "/opt/cuda/include",
            "/usr/lib/python3.14/site-packages/numpy/_core/include"
        ],
        "language": "c++",
        "libraries": [
            "pthread",
            "rt",
            "dl",
            "cublas",
            "cufft",
            "curand",
            "cusparse"
        ],
        "library_dirs": [
            "/opt/cuda/lib64",
            "/opt/cuda/lib"
        ],
        "name": "cupy_backends.cuda.libs.cusparse",
        "sources": [
            "cupy_backends/cuda/libs/cusparse.pyx"
        ]
    },
    "module_name": "cupy_backends.cuda.libs.cusparse"
}
END: Cython Metadata */

#ifndef PY_SSIZE_T_CLEAN
#define PY_SSIZE_T_CLEAN
#endif /* PY_SSIZE_T_CLEAN */
/* InitLimitedAPI */
#if defined(Py_LIMITED_API)
  #if !defined(CYTHON_LIMITED_API)
  #define CYTHON_LIMITED_API 1
  #endif
#elif defined(CYTHON_LIMITED_API)
  #ifdef _MSC_VER
  #pragma message ("Limited API usage is enabled with 'CYTHON_LIMITED_API' but 'Py_LIMITED_API' does not define a Python target version. Consider setting 'Py_LIMITED_API' instead.")
  #else
  #warning Limited API usage is enabled with 'CYTHON_LIMITED_API' but 'Py_LIMITED_API' does not define a Python target version. Consider setting 'Py_LIMITED_API' instead.
  #endif
#endif

#include "Python.h"
#ifndef Py_PYTHON_H
    #error Python headers needed to compile C extensions, please install development version of Python.
#elif PY_VERSION_HEX < 0x03080000
    #error Cython requires Python 3.8+.
#else
#define __PYX_ABI_VERSION "3_2_5"
#define CYTHON_HEX_VERSION 0x030205F0
#define CYTHON_FUTURE_DIVISION 1
/* CModulePreamble */
#include <stddef.h>
#ifndef offsetof
  #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
#endif
#if !defined(_WIN32) && !defined(WIN32) && !defined(MS_WINDOWS)
  #ifndef __stdcall
    #define __stdcall
  #endif
  #ifndef __cdecl
    #define __cdecl
  #endif
  #ifndef __fastcall
    #define __fastcall
  #endif
#endif
#ifndef DL_IMPORT
  #define DL_IMPORT(t) t
#endif
#ifndef DL_EXPORT
  #define DL_EXPORT(t) t
#endif
#define __PYX_COMMA ,
#ifndef PY_LONG_LONG
  #define PY_LONG_LONG LONG_LONG
#endif
#ifndef Py_HUGE_VAL
  #define Py_HUGE_VAL HUGE_VAL
#endif
#define __PYX_LIMITED_VERSION_HEX PY_VERSION_HEX
#if defined(GRAALVM_PYTHON)
  /* For very preliminary testing purposes. Most variables are set the same as PyPy.
     The existence of this section does not imply that anything works or is even tested */
  #define CYTHON_COMPILING_IN_PYPY 0
  #define CYTHON_COMPILING_IN_CPYTHON 0
  #define CYTHON_COMPILING_IN_LIMITED_API 0
  #define CYTHON_COMPILING_IN_GRAAL 1
  #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0
  #undef CYTHON_USE_TYPE_SLOTS
  #define CYTHON_USE_TYPE_SLOTS 0
  #undef CYTHON_USE_TYPE_SPECS
  #define CYTHON_USE_TYPE_SPECS 0
  #undef CYTHON_USE_PYTYPE_LOOKUP
  #define CYTHON_USE_PYTYPE_LOOKUP 0
  #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_AVOID_THREAD_UNSAFE_BORROWED_REFS
  #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 0
  #undef CYTHON_ASSUME_SAFE_MACROS
  #define CYTHON_ASSUME_SAFE_MACROS 0
  #undef CYTHON_ASSUME_SAFE_SIZE
  #define CYTHON_ASSUME_SAFE_SIZE 0
  #undef CYTHON_UNPACK_METHODS
  #define CYTHON_UNPACK_METHODS 0
  #undef CYTHON_FAST_THREAD_STATE
  #define CYTHON_FAST_THREAD_STATE 0
  #undef CYTHON_FAST_GIL
  #define CYTHON_FAST_GIL 0
  #undef CYTHON_METH_FASTCALL
  #define CYTHON_METH_FASTCALL 0
  #undef CYTHON_FAST_PYCALL
  #define CYTHON_FAST_PYCALL 0
  #ifndef CYTHON_PEP487_INIT_SUBCLASS
    #define CYTHON_PEP487_INIT_SUBCLASS 1
  #endif
  #undef CYTHON_PEP489_MULTI_PHASE_INIT
  #define CYTHON_PEP489_MULTI_PHASE_INIT 1
  #undef CYTHON_USE_MODULE_STATE
  #define CYTHON_USE_MODULE_STATE 0
  #undef CYTHON_USE_SYS_MONITORING
  #define CYTHON_USE_SYS_MONITORING 0
  #undef CYTHON_USE_TP_FINALIZE
  #define CYTHON_USE_TP_FINALIZE 0
  #undef CYTHON_USE_AM_SEND
  #define CYTHON_USE_AM_SEND 0
  #undef CYTHON_USE_DICT_VERSIONS
  #define CYTHON_USE_DICT_VERSIONS 0
  #undef CYTHON_USE_EXC_INFO_STACK
  #define CYTHON_USE_EXC_INFO_STACK 1
  #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
    #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
  #endif
  #undef CYTHON_USE_FREELISTS
  #define CYTHON_USE_FREELISTS 0
  #undef CYTHON_IMMORTAL_CONSTANTS
  #define CYTHON_IMMORTAL_CONSTANTS 0
#elif defined(PYPY_VERSION)
  #define CYTHON_COMPILING_IN_PYPY 1
  #define CYTHON_COMPILING_IN_CPYTHON 0
  #define CYTHON_COMPILING_IN_LIMITED_API 0
  #define CYTHON_COMPILING_IN_GRAAL 0
  #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0
  #undef CYTHON_USE_TYPE_SLOTS
  #define CYTHON_USE_TYPE_SLOTS 1
  #ifndef CYTHON_USE_TYPE_SPECS
    #define CYTHON_USE_TYPE_SPECS 0
  #endif
  #undef CYTHON_USE_PYTYPE_LOOKUP
  #define CYTHON_USE_PYTYPE_LOOKUP 0
  #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_AVOID_THREAD_UNSAFE_BORROWED_REFS
  #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 1
  #undef CYTHON_ASSUME_SAFE_MACROS
  #define CYTHON_ASSUME_SAFE_MACROS 0
  #ifndef CYTHON_ASSUME_SAFE_SIZE
    #define CYTHON_ASSUME_SAFE_SIZE 1
  #endif
  #undef CYTHON_UNPACK_METHODS
  #define CYTHON_UNPACK_METHODS 0
  #undef CYTHON_FAST_THREAD_STATE
  #define CYTHON_FAST_THREAD_STATE 0
  #undef CYTHON_FAST_GIL
  #define CYTHON_FAST_GIL 0
  #undef CYTHON_METH_FASTCALL
  #define CYTHON_METH_FASTCALL 0
  #undef CYTHON_FAST_PYCALL
  #define CYTHON_FAST_PYCALL 0
  #ifndef CYTHON_PEP487_INIT_SUBCLASS
    #define CYTHON_PEP487_INIT_SUBCLASS 1
  #endif
  #if PY_VERSION_HEX < 0x03090000
    #undef CYTHON_PEP489_MULTI_PHASE_INIT
    #define CYTHON_PEP489_MULTI_PHASE_INIT 0
  #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT)
    #define CYTHON_PEP489_MULTI_PHASE_INIT 1
  #endif
  #undef CYTHON_USE_MODULE_STATE
  #define CYTHON_USE_MODULE_STATE 0
  #undef CYTHON_USE_SYS_MONITORING
  #define CYTHON_USE_SYS_MONITORING 0
  #ifndef CYTHON_USE_TP_FINALIZE
    #define CYTHON_USE_TP_FINALIZE (PYPY_VERSION_NUM >= 0x07030C00)
  #endif
  #undef CYTHON_USE_AM_SEND
  #define CYTHON_USE_AM_SEND 0
  #undef CYTHON_USE_DICT_VERSIONS
  #define CYTHON_USE_DICT_VERSIONS 0
  #undef CYTHON_USE_EXC_INFO_STACK
  #define CYTHON_USE_EXC_INFO_STACK 0
  #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
    #define CYTHON_UPDATE_DESCRIPTOR_DOC (PYPY_VERSION_NUM >= 0x07031100)
  #endif
  #undef CYTHON_USE_FREELISTS
  #define CYTHON_USE_FREELISTS 0
  #undef CYTHON_IMMORTAL_CONSTANTS
  #define CYTHON_IMMORTAL_CONSTANTS 0
#elif defined(CYTHON_LIMITED_API)
  #ifdef Py_LIMITED_API
    #undef __PYX_LIMITED_VERSION_HEX
    #define __PYX_LIMITED_VERSION_HEX Py_LIMITED_API
  #endif
  #define CYTHON_COMPILING_IN_PYPY 0
  #define CYTHON_COMPILING_IN_CPYTHON 0
  #define CYTHON_COMPILING_IN_LIMITED_API 1
  #define CYTHON_COMPILING_IN_GRAAL 0
  #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0
  #undef CYTHON_USE_TYPE_SLOTS
  #define CYTHON_USE_TYPE_SLOTS 0
  #undef CYTHON_USE_TYPE_SPECS
  #define CYTHON_USE_TYPE_SPECS 1
  #undef CYTHON_USE_PYTYPE_LOOKUP
  #define CYTHON_USE_PYTYPE_LOOKUP 0
  #undef CYTHON_USE_PYLIST_INTERNALS
  #define CYTHON_USE_PYLIST_INTERNALS 0
  #undef CYTHON_USE_UNICODE_INTERNALS
  #define CYTHON_USE_UNICODE_INTERNALS 0
  #ifndef CYTHON_USE_UNICODE_WRITER
    #define CYTHON_USE_UNICODE_WRITER 0
  #endif
  #undef CYTHON_USE_PYLONG_INTERNALS
  #define CYTHON_USE_PYLONG_INTERNALS 0
  #ifndef CYTHON_AVOID_BORROWED_REFS
    #define CYTHON_AVOID_BORROWED_REFS 0
  #endif
  #ifndef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
    #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 0
  #endif
  #undef CYTHON_ASSUME_SAFE_MACROS
  #define CYTHON_ASSUME_SAFE_MACROS 0
  #undef CYTHON_ASSUME_SAFE_SIZE
  #define CYTHON_ASSUME_SAFE_SIZE 0
  #undef CYTHON_UNPACK_METHODS
  #define CYTHON_UNPACK_METHODS 0
  #undef CYTHON_FAST_THREAD_STATE
  #define CYTHON_FAST_THREAD_STATE 0
  #undef CYTHON_FAST_GIL
  #define CYTHON_FAST_GIL 0
  #undef CYTHON_METH_FASTCALL
  #define CYTHON_METH_FASTCALL (__PYX_LIMITED_VERSION_HEX >= 0x030C0000)
  #undef CYTHON_FAST_PYCALL
  #define CYTHON_FAST_PYCALL 0
  #ifndef CYTHON_PEP487_INIT_SUBCLASS
    #define CYTHON_PEP487_INIT_SUBCLASS 1
  #endif
  #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
    #define CYTHON_PEP489_MULTI_PHASE_INIT 1
  #endif
  #ifndef CYTHON_USE_MODULE_STATE
    #define CYTHON_USE_MODULE_STATE 0
  #endif
  #undef CYTHON_USE_SYS_MONITORING
  #define CYTHON_USE_SYS_MONITORING 0
  #ifndef CYTHON_USE_TP_FINALIZE
    #define CYTHON_USE_TP_FINALIZE 0
  #endif
  #ifndef CYTHON_USE_AM_SEND
    #define CYTHON_USE_AM_SEND (__PYX_LIMITED_VERSION_HEX >= 0x030A0000)
  #endif
  #undef CYTHON_USE_DICT_VERSIONS
  #define CYTHON_USE_DICT_VERSIONS 0
  #undef CYTHON_USE_EXC_INFO_STACK
  #define CYTHON_USE_EXC_INFO_STACK 0
  #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
    #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
  #endif
  #ifndef CYTHON_USE_FREELISTS
  #define CYTHON_USE_FREELISTS 1
  #endif
  #undef CYTHON_IMMORTAL_CONSTANTS
  #define CYTHON_IMMORTAL_CONSTANTS 0
#else
  #define CYTHON_COMPILING_IN_PYPY 0
  #define CYTHON_COMPILING_IN_CPYTHON 1
  #define CYTHON_COMPILING_IN_LIMITED_API 0
  #define CYTHON_COMPILING_IN_GRAAL 0
  #ifdef Py_GIL_DISABLED
    #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 1
  #else
    #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0
  #endif
  #if PY_VERSION_HEX < 0x030A0000
    #undef CYTHON_USE_TYPE_SLOTS
    #define CYTHON_USE_TYPE_SLOTS 1
  #elif !defined(CYTHON_USE_TYPE_SLOTS)
    #define CYTHON_USE_TYPE_SLOTS 1
  #endif
  #ifndef CYTHON_USE_TYPE_SPECS
    #define CYTHON_USE_TYPE_SPECS 0
  #endif
  #ifndef CYTHON_USE_PYTYPE_LOOKUP
    #define CYTHON_USE_PYTYPE_LOOKUP 1
  #endif
  #ifndef CYTHON_USE_PYLONG_INTERNALS
    #define CYTHON_USE_PYLONG_INTERNALS 1
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    #undef CYTHON_USE_PYLIST_INTERNALS
    #define CYTHON_USE_PYLIST_INTERNALS 0
  #elif !defined(CYTHON_USE_PYLIST_INTERNALS)
    #define CYTHON_USE_PYLIST_INTERNALS 1
  #endif
  #ifndef CYTHON_USE_UNICODE_INTERNALS
    #define CYTHON_USE_UNICODE_INTERNALS 1
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING || PY_VERSION_HEX >= 0x030B00A2
    #undef CYTHON_USE_UNICODE_WRITER
    #define CYTHON_USE_UNICODE_WRITER 0
  #elif !defined(CYTHON_USE_UNICODE_WRITER)
    #define CYTHON_USE_UNICODE_WRITER 1
  #endif
  #ifndef CYTHON_AVOID_BORROWED_REFS
    #define CYTHON_AVOID_BORROWED_REFS 0
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    #undef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
    #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 1
  #elif !defined(CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS)
    #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 0
  #endif
  #ifndef CYTHON_ASSUME_SAFE_MACROS
    #define CYTHON_ASSUME_SAFE_MACROS 1
  #endif
  #ifndef CYTHON_ASSUME_SAFE_SIZE
    #define CYTHON_ASSUME_SAFE_SIZE 1
  #endif
  #ifndef CYTHON_UNPACK_METHODS
    #define CYTHON_UNPACK_METHODS 1
  #endif
  #ifndef CYTHON_FAST_THREAD_STATE
    #define CYTHON_FAST_THREAD_STATE 1
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    #undef CYTHON_FAST_GIL
    #define CYTHON_FAST_GIL 0
  #elif !defined(CYTHON_FAST_GIL)
    #define CYTHON_FAST_GIL (PY_VERSION_HEX < 0x030C00A6)
  #endif
  #ifndef CYTHON_METH_FASTCALL
    #define CYTHON_METH_FASTCALL 1
  #endif
  #ifndef CYTHON_FAST_PYCALL
    #define CYTHON_FAST_PYCALL 1
  #endif
  #ifndef CYTHON_PEP487_INIT_SUBCLASS
    #define CYTHON_PEP487_INIT_SUBCLASS 1
  #endif
  #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
    #define CYTHON_PEP489_MULTI_PHASE_INIT 1
  #endif
  #ifndef CYTHON_USE_MODULE_STATE
    #define CYTHON_USE_MODULE_STATE 0
  #endif
  #ifndef CYTHON_USE_SYS_MONITORING
    #define CYTHON_USE_SYS_MONITORING (PY_VERSION_HEX >= 0x030d00B1)
  #endif
  #ifndef CYTHON_USE_TP_FINALIZE
    #define CYTHON_USE_TP_FINALIZE 1
  #endif
  #ifndef CYTHON_USE_AM_SEND
    #define CYTHON_USE_AM_SEND 1
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    #undef CYTHON_USE_DICT_VERSIONS
    #define CYTHON_USE_DICT_VERSIONS 0
  #elif !defined(CYTHON_USE_DICT_VERSIONS)
    #define CYTHON_USE_DICT_VERSIONS  (PY_VERSION_HEX < 0x030C00A5 && !CYTHON_USE_MODULE_STATE)
  #endif
  #ifndef CYTHON_USE_EXC_INFO_STACK
    #define CYTHON_USE_EXC_INFO_STACK 1
  #endif
  #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
    #define CYTHON_UPDATE_DESCRIPTOR_DOC 1
  #endif
  #ifndef CYTHON_USE_FREELISTS
    #define CYTHON_USE_FREELISTS (!CYTHON_COMPILING_IN_CPYTHON_FREETHREADING)
  #endif
  #if defined(CYTHON_IMMORTAL_CONSTANTS) && PY_VERSION_HEX < 0x030C0000
    #undef CYTHON_IMMORTAL_CONSTANTS
    #define CYTHON_IMMORTAL_CONSTANTS 0  // definitely won't work
  #elif !defined(CYTHON_IMMORTAL_CONSTANTS)
    #define CYTHON_IMMORTAL_CONSTANTS (PY_VERSION_HEX >= 0x030C0000 && !CYTHON_USE_MODULE_STATE && CYTHON_COMPILING_IN_CPYTHON_FREETHREADING)
  #endif
#endif
#ifndef CYTHON_COMPRESS_STRINGS
  #define CYTHON_COMPRESS_STRINGS 1
#endif
#ifndef CYTHON_FAST_PYCCALL
#define CYTHON_FAST_PYCCALL  CYTHON_FAST_PYCALL
#endif
#ifndef CYTHON_VECTORCALL
#if CYTHON_COMPILING_IN_LIMITED_API
#define CYTHON_VECTORCALL  (__PYX_LIMITED_VERSION_HEX >= 0x030C0000)
#else
#define CYTHON_VECTORCALL  (CYTHON_FAST_PYCCALL)
#endif
#endif
#if CYTHON_USE_PYLONG_INTERNALS
  #undef SHIFT
  #undef BASE
  #undef MASK
  #ifdef SIZEOF_VOID_P
    enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };
  #endif
#endif
#ifndef __has_attribute
  #define __has_attribute(x) 0
#endif
#ifndef __has_cpp_attribute
  #define __has_cpp_attribute(x) 0
#endif
#ifndef CYTHON_RESTRICT
  #if defined(__GNUC__)
    #define CYTHON_RESTRICT __restrict__
  #elif defined(_MSC_VER) && _MSC_VER >= 1400
    #define CYTHON_RESTRICT __restrict
  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
    #define CYTHON_RESTRICT restrict
  #else
    #define CYTHON_RESTRICT
  #endif
#endif
#ifndef CYTHON_UNUSED
  #if defined(__cplusplus)
    /* for clang __has_cpp_attribute(maybe_unused) is true even before C++17
     * but leads to warnings with -pedantic, since it is a C++17 feature */
    #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L)
      #if __has_cpp_attribute(maybe_unused)
        #define CYTHON_UNUSED [[maybe_unused]]
      #endif
    #endif
  #endif
#endif
#ifndef CYTHON_UNUSED
# if defined(__GNUC__)
#   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
#     define CYTHON_UNUSED __attribute__ ((__unused__))
#   else
#     define CYTHON_UNUSED
#   endif
# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
#   define CYTHON_UNUSED __attribute__ ((__unused__))
# else
#   define CYTHON_UNUSED
# endif
#endif
#ifndef CYTHON_UNUSED_VAR
#  if defined(__cplusplus)
     template<class T> void CYTHON_UNUSED_VAR( const T& ) { }
#  else
#    define CYTHON_UNUSED_VAR(x) (void)(x)
#  endif
#endif
#ifndef CYTHON_MAYBE_UNUSED_VAR
  #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x)
#endif
#ifndef CYTHON_NCP_UNUSED
# if CYTHON_COMPILING_IN_CPYTHON && !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
#  define CYTHON_NCP_UNUSED
# else
#  define CYTHON_NCP_UNUSED CYTHON_UNUSED
# endif
#endif
#ifndef CYTHON_USE_CPP_STD_MOVE
  #if defined(__cplusplus) && (\
    __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600))
    #define CYTHON_USE_CPP_STD_MOVE 1
  #else
    #define CYTHON_USE_CPP_STD_MOVE 0
  #endif
#endif
#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
#include <stdint.h>
typedef uintptr_t  __pyx_uintptr_t;
#ifndef CYTHON_FALLTHROUGH
  #if defined(__cplusplus)
    /* for clang __has_cpp_attribute(fallthrough) is true even before C++17
     * but leads to warnings with -pedantic, since it is a C++17 feature */
    #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L)
      #if __has_cpp_attribute(fallthrough)
        #define CYTHON_FALLTHROUGH [[fallthrough]]
      #endif
    #endif
    #ifndef CYTHON_FALLTHROUGH
      #if __has_cpp_attribute(clang::fallthrough)
        #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
      #elif __has_cpp_attribute(gnu::fallthrough)
        #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
      #endif
    #endif
  #endif
  #ifndef CYTHON_FALLTHROUGH
    #if __has_attribute(fallthrough)
      #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
    #else
      #define CYTHON_FALLTHROUGH
    #endif
  #endif
  #if defined(__clang__) && defined(__apple_build_version__)
    #if __apple_build_version__ < 7000000
      #undef  CYTHON_FALLTHROUGH
      #define CYTHON_FALLTHROUGH
    #endif
  #endif
#endif
#ifndef Py_UNREACHABLE
  #define Py_UNREACHABLE()  assert(0); abort()
#endif
#ifdef __cplusplus
  template <typename T>
  struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);};
  #define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL<type>::value)
#else
  #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0)
#endif
#if CYTHON_COMPILING_IN_PYPY == 1
  #define __PYX_NEED_TP_PRINT_SLOT  (PY_VERSION_HEX < 0x030A0000)
#else
  #define __PYX_NEED_TP_PRINT_SLOT  (PY_VERSION_HEX < 0x03090000)
#endif
#define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer))

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

/* PythonCompatibility */
#define __PYX_BUILD_PY_SSIZE_T "n"
#define CYTHON_FORMAT_SSIZE_T "z"
#define __Pyx_BUILTIN_MODULE_NAME "builtins"
#define __Pyx_DefaultClassType PyType_Type
#if CYTHON_COMPILING_IN_LIMITED_API
    #ifndef CO_OPTIMIZED
    static int CO_OPTIMIZED;
    #endif
    #ifndef CO_NEWLOCALS
    static int CO_NEWLOCALS;
    #endif
    #ifndef CO_VARARGS
    static int CO_VARARGS;
    #endif
    #ifndef CO_VARKEYWORDS
    static int CO_VARKEYWORDS;
    #endif
    #ifndef CO_ASYNC_GENERATOR
    static int CO_ASYNC_GENERATOR;
    #endif
    #ifndef CO_GENERATOR
    static int CO_GENERATOR;
    #endif
    #ifndef CO_COROUTINE
    static int CO_COROUTINE;
    #endif
#else
    #ifndef CO_COROUTINE
      #define CO_COROUTINE 0x80
    #endif
    #ifndef CO_ASYNC_GENERATOR
      #define CO_ASYNC_GENERATOR 0x200
    #endif
#endif
static int __Pyx_init_co_variables(void);
#if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE)
  #define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type)
#else
  #define __Pyx_IS_TYPE(ob, type) (((const PyObject*)ob)->ob_type == (type))
#endif
#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is)
  #define __Pyx_Py_Is(x, y)  Py_Is(x, y)
#else
  #define __Pyx_Py_Is(x, y) ((x) == (y))
#endif
#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone)
  #define __Pyx_Py_IsNone(ob) Py_IsNone(ob)
#else
  #define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None)
#endif
#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue)
  #define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob)
#else
  #define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True)
#endif
#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse)
  #define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob)
#else
  #define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False)
#endif
#define __Pyx_NoneAsNull(obj)  (__Pyx_Py_IsNone(obj) ? NULL : (obj))
#if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY
  #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o)
#else
  #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o)
#endif
#ifndef Py_TPFLAGS_CHECKTYPES
  #define Py_TPFLAGS_CHECKTYPES 0
#endif
#ifndef Py_TPFLAGS_HAVE_INDEX
  #define Py_TPFLAGS_HAVE_INDEX 0
#endif
#ifndef Py_TPFLAGS_HAVE_NEWBUFFER
  #define Py_TPFLAGS_HAVE_NEWBUFFER 0
#endif
#ifndef Py_TPFLAGS_HAVE_FINALIZE
  #define Py_TPFLAGS_HAVE_FINALIZE 0
#endif
#ifndef Py_TPFLAGS_SEQUENCE
  #define Py_TPFLAGS_SEQUENCE 0
#endif
#ifndef Py_TPFLAGS_MAPPING
  #define Py_TPFLAGS_MAPPING 0
#endif
#ifndef Py_TPFLAGS_IMMUTABLETYPE
  #define Py_TPFLAGS_IMMUTABLETYPE (1UL << 8)
#endif
#ifndef Py_TPFLAGS_DISALLOW_INSTANTIATION
  #define Py_TPFLAGS_DISALLOW_INSTANTIATION (1UL << 7)
#endif
#ifndef METH_STACKLESS
  #define METH_STACKLESS 0
#endif
#ifndef 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
  #if PY_VERSION_HEX >= 0x030d00A4
  #  define __Pyx_PyCFunctionFast PyCFunctionFast
  #  define __Pyx_PyCFunctionFastWithKeywords PyCFunctionFastWithKeywords
  #else
  #  define __Pyx_PyCFunctionFast _PyCFunctionFast
  #  define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
  #endif
#endif
#if CYTHON_METH_FASTCALL
  #define __Pyx_METH_FASTCALL METH_FASTCALL
  #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast
  #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords
#else
  #define __Pyx_METH_FASTCALL METH_VARARGS
  #define __Pyx_PyCFunction_FastCall PyCFunction
  #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords
#endif
#if CYTHON_VECTORCALL
  #define __pyx_vectorcallfunc vectorcallfunc
  #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET  PY_VECTORCALL_ARGUMENTS_OFFSET
  #define __Pyx_PyVectorcall_NARGS(n)  PyVectorcall_NARGS((size_t)(n))
#else
  #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET  0
  #define __Pyx_PyVectorcall_NARGS(n)  ((Py_ssize_t)(n))
#endif
#if PY_VERSION_HEX >= 0x030900B1
#define __Pyx_PyCFunction_CheckExact(func)  PyCFunction_CheckExact(func)
#else
#define __Pyx_PyCFunction_CheckExact(func)  PyCFunction_Check(func)
#endif
#define __Pyx_CyOrPyCFunction_Check(func)  PyCFunction_Check(func)
#if CYTHON_COMPILING_IN_CPYTHON
#define __Pyx_CyOrPyCFunction_GET_FUNCTION(func)  (((PyCFunctionObject*)(func))->m_ml->ml_meth)
#elif !CYTHON_COMPILING_IN_LIMITED_API
#define __Pyx_CyOrPyCFunction_GET_FUNCTION(func)  PyCFunction_GET_FUNCTION(func)
#endif
#if CYTHON_COMPILING_IN_CPYTHON
#define __Pyx_CyOrPyCFunction_GET_FLAGS(func)  (((PyCFunctionObject*)(func))->m_ml->ml_flags)
static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) {
    return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self;
}
#endif
static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void (*cfunc)(void)) {
#if CYTHON_COMPILING_IN_LIMITED_API
    return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc;
#else
    return PyCFunction_Check(func) && PyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc;
#endif
}
#define __Pyx_IsSameCFunction(func, cfunc)   __Pyx__IsSameCFunction(func, cfunc)
#if PY_VERSION_HEX < 0x03090000 || (CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000)
  #define __Pyx_PyType_FromModuleAndSpec(m, s, b)  ((void)m, PyType_FromSpecWithBases(s, b))
  typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *);
#else
  #define __Pyx_PyType_FromModuleAndSpec(m, s, b)  PyType_FromModuleAndSpec(m, s, b)
  #define __Pyx_PyCMethod  PyCMethod
#endif
#ifndef METH_METHOD
  #define METH_METHOD 0x200
#endif
#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
  #define PyObject_Malloc(s)   PyMem_Malloc(s)
  #define PyObject_Free(p)     PyMem_Free(p)
  #define PyObject_Realloc(p)  PyMem_Realloc(p)
#endif
#if CYTHON_COMPILING_IN_LIMITED_API
  #define __Pyx_PyFrame_SetLineNumber(frame, lineno)
#elif CYTHON_COMPILING_IN_GRAAL && defined(GRAALPY_VERSION_NUM) && GRAALPY_VERSION_NUM > 0x19000000
  #define __Pyx_PyCode_HasFreeVars(co)  (PyCode_GetNumFree(co) > 0)
  #define __Pyx_PyFrame_SetLineNumber(frame, lineno) GraalPyFrame_SetLineNumber((frame), (lineno))
#elif CYTHON_COMPILING_IN_GRAAL
  #define __Pyx_PyCode_HasFreeVars(co)  (PyCode_GetNumFree(co) > 0)
  #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_COMPILING_IN_LIMITED_API
  #define __Pyx_PyThreadState_Current PyThreadState_Get()
#elif !CYTHON_FAST_THREAD_STATE
  #define __Pyx_PyThreadState_Current PyThreadState_GET()
#elif PY_VERSION_HEX >= 0x030d00A1
  #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked()
#else
  #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
#endif
#if CYTHON_USE_MODULE_STATE
static CYTHON_INLINE void *__Pyx__PyModule_GetState(PyObject *op)
{
    void *result;
    result = PyModule_GetState(op);
    if (!result)
        Py_FatalError("Couldn't find the module state");
    return result;
}
#define __Pyx_PyModule_GetState(o) (__pyx_mstatetype *)__Pyx__PyModule_GetState(o)
#else
#define __Pyx_PyModule_GetState(op) ((void)op,__pyx_mstate_global)
#endif
#define __Pyx_PyObject_GetSlot(obj, name, func_ctype)  __Pyx_PyType_GetSlot(Py_TYPE((PyObject *) obj), name, func_ctype)
#define __Pyx_PyObject_TryGetSlot(obj, name, func_ctype) __Pyx_PyType_TryGetSlot(Py_TYPE(obj), name, func_ctype)
#define __Pyx_PyObject_GetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_GetSubSlot(Py_TYPE(obj), sub, name, func_ctype)
#define __Pyx_PyObject_TryGetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_TryGetSubSlot(Py_TYPE(obj), sub, name, func_ctype)
#if CYTHON_USE_TYPE_SLOTS
  #define __Pyx_PyType_GetSlot(type, name, func_ctype)  ((type)->name)
  #define __Pyx_PyType_TryGetSlot(type, name, func_ctype) __Pyx_PyType_GetSlot(type, name, func_ctype)
  #define __Pyx_PyType_GetSubSlot(type, sub, name, func_ctype) (((type)->sub) ? ((type)->sub->name) : NULL)
  #define __Pyx_PyType_TryGetSubSlot(type, sub, name, func_ctype) __Pyx_PyType_GetSubSlot(type, sub, name, func_ctype)
#else
  #define __Pyx_PyType_GetSlot(type, name, func_ctype)  ((func_ctype) PyType_GetSlot((type), Py_##name))
  #define __Pyx_PyType_TryGetSlot(type, name, func_ctype)\
    ((__PYX_LIMITED_VERSION_HEX >= 0x030A0000 ||\
     (PyType_GetFlags(type) & Py_TPFLAGS_HEAPTYPE) || __Pyx_get_runtime_version() >= 0x030A0000) ?\
     __Pyx_PyType_GetSlot(type, name, func_ctype) : NULL)
  #define __Pyx_PyType_GetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_GetSlot(obj, name, func_ctype)
  #define __Pyx_PyType_TryGetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_TryGetSlot(obj, name, func_ctype)
#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
#define __Pyx_PyNumber_Divide(x,y)         PyNumber_TrueDivide(x,y)
#define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceTrueDivide(x,y)
#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_UNICODE_INTERNALS
#define __Pyx_PyDict_GetItemStrWithError(dict, name)  _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) {
    PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name);
    if (res == NULL) PyErr_Clear();
    return res;
}
#elif !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000
#define __Pyx_PyDict_GetItemStrWithError  PyDict_GetItemWithError
#define __Pyx_PyDict_GetItemStr           PyDict_GetItem
#else
static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) {
#if CYTHON_COMPILING_IN_PYPY
    return PyDict_GetItem(dict, name);
#else
    PyDictEntry *ep;
    PyDictObject *mp = (PyDictObject*) dict;
    long hash = ((PyStringObject *) name)->ob_shash;
    assert(hash != -1);
    ep = (mp->ma_lookup)(mp, name, hash);
    if (ep == NULL) {
        return NULL;
    }
    return ep->me_value;
#endif
}
#define __Pyx_PyDict_GetItemStr           PyDict_GetItem
#endif
#if CYTHON_USE_TYPE_SLOTS
  #define __Pyx_PyType_GetFlags(tp)   (((PyTypeObject *)tp)->tp_flags)
  #define __Pyx_PyType_HasFeature(type, feature)  ((__Pyx_PyType_GetFlags(type) & (feature)) != 0)
#else
  #define __Pyx_PyType_GetFlags(tp)   (PyType_GetFlags((PyTypeObject *)tp))
  #define __Pyx_PyType_HasFeature(type, feature)  PyType_HasFeature(type, feature)
#endif
#define __Pyx_PyObject_GetIterNextFunc(iterator)  __Pyx_PyObject_GetSlot(iterator, tp_iternext, iternextfunc)
#if CYTHON_USE_TYPE_SPECS
#define __Pyx_PyHeapTypeObject_GC_Del(obj)  {\
    PyTypeObject *type = Py_TYPE((PyObject*)obj);\
    assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\
    PyObject_GC_Del(obj);\
    Py_DECREF(type);\
}
#else
#define __Pyx_PyHeapTypeObject_GC_Del(obj)  PyObject_GC_Del(obj)
#endif
#if CYTHON_COMPILING_IN_LIMITED_API
  #define __Pyx_PyUnicode_READY(op)       (0)
  #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i)
  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u)   ((void)u, 1114111U)
  #define __Pyx_PyUnicode_KIND(u)         ((void)u, (0))
  #define __Pyx_PyUnicode_DATA(u)         ((void*)u)
  #define __Pyx_PyUnicode_READ(k, d, i)   ((void)k, PyUnicode_ReadChar((PyObject*)(d), i))
  #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != PyUnicode_GetLength(u))
#else
  #if PY_VERSION_HEX >= 0x030C0000
    #define __Pyx_PyUnicode_READY(op)       (0)
  #else
    #define __Pyx_PyUnicode_READY(op)       (likely(PyUnicode_IS_READY(op)) ?\
                                                0 : _PyUnicode_Ready((PyObject *)(op)))
  #endif
  #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u)   PyUnicode_MAX_CHAR_VALUE(u)
  #define __Pyx_PyUnicode_KIND(u)         ((int)PyUnicode_KIND(u))
  #define __Pyx_PyUnicode_DATA(u)         PyUnicode_DATA(u)
  #define __Pyx_PyUnicode_READ(k, d, i)   PyUnicode_READ(k, d, i)
  #define __Pyx_PyUnicode_WRITE(k, d, i, ch)  PyUnicode_WRITE(k, d, i, (Py_UCS4) ch)
  #if PY_VERSION_HEX >= 0x030C0000
    #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != PyUnicode_GET_LENGTH(u))
  #else
    #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000
    #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length))
    #else
    #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
    #endif
  #endif
#endif
#if CYTHON_COMPILING_IN_PYPY
  #define __Pyx_PyUnicode_Concat(a, b)      PyNumber_Add(a, b)
  #define __Pyx_PyUnicode_ConcatSafe(a, b)  PyNumber_Add(a, b)
#else
  #define __Pyx_PyUnicode_Concat(a, b)      PyUnicode_Concat(a, b)
  #define __Pyx_PyUnicode_ConcatSafe(a, b)  ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
      PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
#endif
#if CYTHON_COMPILING_IN_PYPY
  #if !defined(PyUnicode_DecodeUnicodeEscape)
    #define PyUnicode_DecodeUnicodeEscape(s, size, errors)  PyUnicode_Decode(s, size, "unicode_escape", errors)
  #endif
  #if !defined(PyUnicode_Contains)
    #define PyUnicode_Contains(u, s)  PySequence_Contains(u, s)
  #endif
  #if !defined(PyByteArray_Check)
    #define PyByteArray_Check(obj)  PyObject_TypeCheck(obj, &PyByteArray_Type)
  #endif
  #if !defined(PyObject_Format)
    #define PyObject_Format(obj, fmt)  PyObject_CallMethod(obj, "__format__", "O", fmt)
  #endif
#endif
#define __Pyx_PyUnicode_FormatSafe(a, b)  ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  #define __Pyx_PySequence_ListKeepNew(obj)\
    (likely(PyList_CheckExact(obj) && PyUnstable_Object_IsUniquelyReferenced(obj)) ? __Pyx_NewRef(obj) : PySequence_List(obj))
#elif CYTHON_COMPILING_IN_CPYTHON
  #define __Pyx_PySequence_ListKeepNew(obj)\
    (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj))
#else
  #define __Pyx_PySequence_ListKeepNew(obj)  PySequence_List(obj)
#endif
#ifndef PySet_CheckExact
  #define PySet_CheckExact(obj)        __Pyx_IS_TYPE(obj, &PySet_Type)
#endif
#if PY_VERSION_HEX >= 0x030900A4
  #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt)
  #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size)
#else
  #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt)
  #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size)
#endif
enum __Pyx_ReferenceSharing {
  __Pyx_ReferenceSharing_DefinitelyUnique, // We created it so we know it's unshared - no need to check
  __Pyx_ReferenceSharing_OwnStrongReference,
  __Pyx_ReferenceSharing_FunctionArgument,
  __Pyx_ReferenceSharing_SharedReference, // Never trust it to be unshared because it's a global or similar
};
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && PY_VERSION_HEX >= 0x030E0000
#define __Pyx_IS_UNIQUELY_REFERENCED(o, sharing)\
    (sharing == __Pyx_ReferenceSharing_DefinitelyUnique ? 1 :\
      (sharing == __Pyx_ReferenceSharing_FunctionArgument ? PyUnstable_Object_IsUniqueReferencedTemporary(o) :\
      (sharing == __Pyx_ReferenceSharing_OwnStrongReference ? PyUnstable_Object_IsUniquelyReferenced(o) : 0)))
#elif (CYTHON_COMPILING_IN_CPYTHON && !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING) || CYTHON_COMPILING_IN_LIMITED_API
#define __Pyx_IS_UNIQUELY_REFERENCED(o, sharing) (((void)sharing), Py_REFCNT(o) == 1)
#else
#define __Pyx_IS_UNIQUELY_REFERENCED(o, sharing) (((void)o), ((void)sharing), 0)
#endif
#if CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
  #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
    #define __Pyx_PyList_GetItemRef(o, i) PyList_GetItemRef(o, i)
  #elif CYTHON_COMPILING_IN_LIMITED_API || !CYTHON_ASSUME_SAFE_MACROS
    #define __Pyx_PyList_GetItemRef(o, i) (likely((i) >= 0) ? PySequence_GetItem(o, i) : (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
  #else
    #define __Pyx_PyList_GetItemRef(o, i) PySequence_ITEM(o, i)
  #endif
#elif CYTHON_COMPILING_IN_LIMITED_API || !CYTHON_ASSUME_SAFE_MACROS
  #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
    #define __Pyx_PyList_GetItemRef(o, i) PyList_GetItemRef(o, i)
  #else
    #define __Pyx_PyList_GetItemRef(o, i) __Pyx_XNewRef(PyList_GetItem(o, i))
  #endif
#else
  #define __Pyx_PyList_GetItemRef(o, i) __Pyx_NewRef(PyList_GET_ITEM(o, i))
#endif
#if CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS && !CYTHON_COMPILING_IN_LIMITED_API && CYTHON_ASSUME_SAFE_MACROS
  #define __Pyx_PyList_GetItemRefFast(o, i, unsafe_shared) (__Pyx_IS_UNIQUELY_REFERENCED(o, unsafe_shared) ?\
    __Pyx_NewRef(PyList_GET_ITEM(o, i)) : __Pyx_PyList_GetItemRef(o, i))
#else
  #define __Pyx_PyList_GetItemRefFast(o, i, unsafe_shared) __Pyx_PyList_GetItemRef(o, i)
#endif
#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
#define __Pyx_PyDict_GetItemRef(dict, key, result) PyDict_GetItemRef(dict, key, result)
#elif CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
static CYTHON_INLINE int __Pyx_PyDict_GetItemRef(PyObject *dict, PyObject *key, PyObject **result) {
  *result = PyObject_GetItem(dict, key);
  if (*result == NULL) {
    if (PyErr_ExceptionMatches(PyExc_KeyError)) {
      PyErr_Clear();
      return 0;
    }
    return -1;
  }
  return 1;
}
#else
static CYTHON_INLINE int __Pyx_PyDict_GetItemRef(PyObject *dict, PyObject *key, PyObject **result) {
  *result = PyDict_GetItemWithError(dict, key);
  if (*result == NULL) {
    return PyErr_Occurred() ? -1 : 0;
  }
  Py_INCREF(*result);
  return 1;
}
#endif
#if defined(CYTHON_DEBUG_VISIT_CONST) && CYTHON_DEBUG_VISIT_CONST
  #define __Pyx_VISIT_CONST(obj)  Py_VISIT(obj)
#else
  #define __Pyx_VISIT_CONST(obj)
#endif
#if CYTHON_ASSUME_SAFE_MACROS
  #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i)
  #define __Pyx_PySequence_SIZE(seq)  Py_SIZE(seq)
  #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0))
  #define __Pyx_PyTuple_GET_ITEM(o, i) PyTuple_GET_ITEM(o, i)
  #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0))
  #define __Pyx_PyList_GET_ITEM(o, i) PyList_GET_ITEM(o, i)
#else
  #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i)
  #define __Pyx_PySequence_SIZE(seq)  PySequence_Size(seq)
  #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v)
  #define __Pyx_PyTuple_GET_ITEM(o, i) PyTuple_GetItem(o, i)
  #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v)
  #define __Pyx_PyList_GET_ITEM(o, i) PyList_GetItem(o, i)
#endif
#if CYTHON_ASSUME_SAFE_SIZE
  #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o)
  #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o)
  #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o)
  #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o)
  #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o)
  #define __Pyx_PyUnicode_GET_LENGTH(o) PyUnicode_GET_LENGTH(o)
#else
  #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o)
  #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o)
  #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o)
  #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o)
  #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o)
  #define __Pyx_PyUnicode_GET_LENGTH(o) PyUnicode_GetLength(o)
#endif
#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_InternFromString)
  #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
#endif
#define __Pyx_PyLong_FromHash_t PyLong_FromSsize_t
#define __Pyx_PyLong_AsHash_t   __Pyx_PyIndex_AsSsize_t
#if __PYX_LIMITED_VERSION_HEX >= 0x030A0000
    #define __Pyx_PySendResult PySendResult
#else
    typedef enum {
        PYGEN_RETURN = 0,
        PYGEN_ERROR = -1,
        PYGEN_NEXT = 1,
    } __Pyx_PySendResult;
#endif
#if CYTHON_COMPILING_IN_LIMITED_API || PY_VERSION_HEX < 0x030A00A3
  typedef __Pyx_PySendResult (*__Pyx_pyiter_sendfunc)(PyObject *iter, PyObject *value, PyObject **result);
#else
  #define __Pyx_pyiter_sendfunc sendfunc
#endif
#if !CYTHON_USE_AM_SEND
#define __PYX_HAS_PY_AM_SEND 0
#elif __PYX_LIMITED_VERSION_HEX >= 0x030A0000
#define __PYX_HAS_PY_AM_SEND 1
#else
#define __PYX_HAS_PY_AM_SEND 2  // our own backported implementation
#endif
#if __PYX_HAS_PY_AM_SEND < 2
    #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
#else
    typedef struct {
        unaryfunc am_await;
        unaryfunc am_aiter;
        unaryfunc am_anext;
        __Pyx_pyiter_sendfunc am_send;
    } __Pyx_PyAsyncMethodsStruct;
    #define __Pyx_SlotTpAsAsync(s) ((PyAsyncMethods*)(s))
#endif
#if CYTHON_USE_AM_SEND && PY_VERSION_HEX < 0x030A00F0
    #define __Pyx_TPFLAGS_HAVE_AM_SEND (1UL << 21)
#else
    #define __Pyx_TPFLAGS_HAVE_AM_SEND (0)
#endif
#if PY_VERSION_HEX >= 0x03090000
#define __Pyx_PyInterpreterState_Get() PyInterpreterState_Get()
#else
#define __Pyx_PyInterpreterState_Get() PyThreadState_Get()->interp
#endif
#if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030A0000
#ifdef __cplusplus
extern "C"
#endif
PyAPI_FUNC(void *) PyMem_Calloc(size_t nelem, size_t elsize);
#endif
#if CYTHON_COMPILING_IN_LIMITED_API
static int __Pyx_init_co_variable(PyObject *inspect, const char* name, int *write_to) {
    int value;
    PyObject *py_value = PyObject_GetAttrString(inspect, name);
    if (!py_value) return 0;
    value = (int) PyLong_AsLong(py_value);
    Py_DECREF(py_value);
    *write_to = value;
    return value != -1 || !PyErr_Occurred();
}
static int __Pyx_init_co_variables(void) {
    PyObject *inspect;
    int result;
    inspect = PyImport_ImportModule("inspect");
    result =
#if !defined(CO_OPTIMIZED)
        __Pyx_init_co_variable(inspect, "CO_OPTIMIZED", &CO_OPTIMIZED) &&
#endif
#if !defined(CO_NEWLOCALS)
        __Pyx_init_co_variable(inspect, "CO_NEWLOCALS", &CO_NEWLOCALS) &&
#endif
#if !defined(CO_VARARGS)
        __Pyx_init_co_variable(inspect, "CO_VARARGS", &CO_VARARGS) &&
#endif
#if !defined(CO_VARKEYWORDS)
        __Pyx_init_co_variable(inspect, "CO_VARKEYWORDS", &CO_VARKEYWORDS) &&
#endif
#if !defined(CO_ASYNC_GENERATOR)
        __Pyx_init_co_variable(inspect, "CO_ASYNC_GENERATOR", &CO_ASYNC_GENERATOR) &&
#endif
#if !defined(CO_GENERATOR)
        __Pyx_init_co_variable(inspect, "CO_GENERATOR", &CO_GENERATOR) &&
#endif
#if !defined(CO_COROUTINE)
        __Pyx_init_co_variable(inspect, "CO_COROUTINE", &CO_COROUTINE) &&
#endif
        1;
    Py_DECREF(inspect);
    return result ? 0 : -1;
}
#else
static int __Pyx_init_co_variables(void) {
    return 0;  // It's a limited API-only feature
}
#endif

/* MathInitCode */
#if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)
  #ifndef _USE_MATH_DEFINES
    #define _USE_MATH_DEFINES
  #endif
#endif
#include <math.h>
#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
#define __Pyx_truncl trunc
#else
#define __Pyx_truncl truncl
#endif

#ifndef CYTHON_CLINE_IN_TRACEBACK_RUNTIME
#define CYTHON_CLINE_IN_TRACEBACK_RUNTIME 0
#endif
#ifndef CYTHON_CLINE_IN_TRACEBACK
#define CYTHON_CLINE_IN_TRACEBACK CYTHON_CLINE_IN_TRACEBACK_RUNTIME
#endif
#if CYTHON_CLINE_IN_TRACEBACK
#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; }
#else
#define __PYX_MARK_ERR_POS(f_index, lineno)  { __pyx_filename = __pyx_f[f_index]; (void) __pyx_filename; __pyx_lineno = lineno; (void) __pyx_lineno; (void) __pyx_clineno; }
#endif
#define __PYX_ERR(f_index, lineno, Ln_error) \
    { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }

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

#define __PYX_HAVE__cupy_backends__cuda__libs__cusparse
#define __PYX_HAVE_API__cupy_backends__cuda__libs__cusparse
/* Early includes */
#include <stdint.h>

    #ifndef CUSPARSE_SPGEAM_ALG_DEFAULT
    /* SpGEAM not in this cuSPARSE; provide opaque forward decls. */
    typedef void* cusparseSpGEAMDescr_t;
    typedef int cusparseSpGEAMAlg_t;
    #define CUSPARSE_SPGEAM_ALG_DEFAULT 0
    #define CUSPARSE_SPGEAM_ALG1 1
    #endif
    
#include "ios"
#include "new"
#include "stdexcept"
#include "typeinfo"
#include <vector>
#include "../../cupy_complex.h"
#include "../../cupy_sparse.h"
#ifdef _OPENMP
#include <omp.h>
#endif /* _OPENMP */

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

#ifdef CYTHON_FREETHREADING_COMPATIBLE
#if CYTHON_FREETHREADING_COMPATIBLE
#define __Pyx_FREETHREADING_COMPATIBLE Py_MOD_GIL_NOT_USED
#else
#define __Pyx_FREETHREADING_COMPATIBLE Py_MOD_GIL_USED
#endif
#else
#define __Pyx_FREETHREADING_COMPATIBLE Py_MOD_GIL_NOT_USED
#endif
#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
#define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
#define __PYX_DEFAULT_STRING_ENCODING ""
#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
#define __Pyx_uchar_cast(c) ((unsigned char)c)
#define __Pyx_long_cast(x) ((long)x)
#define __Pyx_fits_Py_ssize_t(v, type, is_signed)  (\
    (sizeof(type) < sizeof(Py_ssize_t))  ||\
    (sizeof(type) > sizeof(Py_ssize_t) &&\
          likely(v < (type)PY_SSIZE_T_MAX ||\
                 v == (type)PY_SSIZE_T_MAX)  &&\
          (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
                                v == (type)PY_SSIZE_T_MIN)))  ||\
    (sizeof(type) == sizeof(Py_ssize_t) &&\
          (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
                               v == (type)PY_SSIZE_T_MAX)))  )
static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
    return (size_t) i < (size_t) limit;
}
#if defined (__cplusplus) && __cplusplus >= 201103L
    #include <cstdlib>
    #define __Pyx_sst_abs(value) std::abs(value)
#elif SIZEOF_INT >= SIZEOF_SIZE_T
    #define __Pyx_sst_abs(value) abs(value)
#elif SIZEOF_LONG >= SIZEOF_SIZE_T
    #define __Pyx_sst_abs(value) labs(value)
#elif defined (_MSC_VER)
    #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
    #define __Pyx_sst_abs(value) llabs(value)
#elif defined (__GNUC__)
    #define __Pyx_sst_abs(value) __builtin_llabs(value)
#else
    #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
#endif
static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s);
static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char*);
#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
#define __Pyx_PyBytes_FromString        PyBytes_FromString
#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
#if CYTHON_ASSUME_SAFE_MACROS
    #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_PyByteArray_AsString(s) PyByteArray_AS_STRING(s)
#else
    #define __Pyx_PyBytes_AsWritableString(s)     ((char*) PyBytes_AsString(s))
    #define __Pyx_PyBytes_AsWritableSString(s)    ((signed char*) PyBytes_AsString(s))
    #define __Pyx_PyBytes_AsWritableUString(s)    ((unsigned char*) PyBytes_AsString(s))
    #define __Pyx_PyBytes_AsString(s)     ((const char*) PyBytes_AsString(s))
    #define __Pyx_PyBytes_AsSString(s)    ((const signed char*) PyBytes_AsString(s))
    #define __Pyx_PyBytes_AsUString(s)    ((const unsigned char*) PyBytes_AsString(s))
    #define __Pyx_PyByteArray_AsString(s) PyByteArray_AsString(s)
#endif
#define __Pyx_PyObject_AsWritableString(s)    ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsWritableSString(s)    ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsWritableUString(s)    ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsSString(s)    ((const signed char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsUString(s)    ((const unsigned char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_FromCString(s)  __Pyx_PyObject_FromString((const char*)s)
#define __Pyx_PyBytes_FromCString(s)   __Pyx_PyBytes_FromString((const char*)s)
#define __Pyx_PyByteArray_FromCString(s)   __Pyx_PyByteArray_FromString((const char*)s)
#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
#define __Pyx_PyUnicode_FromOrdinal(o)       PyUnicode_FromOrdinal((int)o)
#define __Pyx_PyUnicode_AsUnicode            PyUnicode_AsUnicode
static CYTHON_INLINE PyObject *__Pyx_NewRef(PyObject *obj) {
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030a0000 || defined(Py_NewRef)
    return Py_NewRef(obj);
#else
    Py_INCREF(obj);
    return obj;
#endif
}
static CYTHON_INLINE PyObject *__Pyx_XNewRef(PyObject *obj) {
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030a0000 || defined(Py_XNewRef)
    return Py_XNewRef(obj);
#else
    Py_XINCREF(obj);
    return obj;
#endif
}
static CYTHON_INLINE PyObject *__Pyx_Owned_Py_None(int b);
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_Long(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_PyLong_FromSize_t(size_t);
static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*);
#if CYTHON_ASSUME_SAFE_MACROS
#define __Pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
#define __Pyx_PyFloat_AS_DOUBLE(x) PyFloat_AS_DOUBLE(x)
#else
#define __Pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
#define __Pyx_PyFloat_AS_DOUBLE(x) PyFloat_AsDouble(x)
#endif
#define __Pyx_PyFloat_AsFloat(x) ((float) __Pyx_PyFloat_AsDouble(x))
#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
#if CYTHON_USE_PYLONG_INTERNALS
  #if PY_VERSION_HEX >= 0x030C00A7
  #ifndef _PyLong_SIGN_MASK
    #define _PyLong_SIGN_MASK 3
  #endif
  #ifndef _PyLong_NON_SIZE_BITS
    #define _PyLong_NON_SIZE_BITS 3
  #endif
  #define __Pyx_PyLong_Sign(x)  (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK)
  #define __Pyx_PyLong_IsNeg(x)  ((__Pyx_PyLong_Sign(x) & 2) != 0)
  #define __Pyx_PyLong_IsNonNeg(x)  (!__Pyx_PyLong_IsNeg(x))
  #define __Pyx_PyLong_IsZero(x)  (__Pyx_PyLong_Sign(x) & 1)
  #define __Pyx_PyLong_IsPos(x)  (__Pyx_PyLong_Sign(x) == 0)
  #define __Pyx_PyLong_CompactValueUnsigned(x)  (__Pyx_PyLong_Digits(x)[0])
  #define __Pyx_PyLong_DigitCount(x)  ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS))
  #define __Pyx_PyLong_SignedDigitCount(x)\
        ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x))
  #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue)
    #define __Pyx_PyLong_IsCompact(x)     PyUnstable_Long_IsCompact((PyLongObject*) x)
    #define __Pyx_PyLong_CompactValue(x)  PyUnstable_Long_CompactValue((PyLongObject*) x)
  #else
    #define __Pyx_PyLong_IsCompact(x)     (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS))
    #define __Pyx_PyLong_CompactValue(x)  ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0])
  #endif
  typedef Py_ssize_t  __Pyx_compact_pylong;
  typedef size_t  __Pyx_compact_upylong;
  #else
  #define __Pyx_PyLong_IsNeg(x)  (Py_SIZE(x) < 0)
  #define __Pyx_PyLong_IsNonNeg(x)  (Py_SIZE(x) >= 0)
  #define __Pyx_PyLong_IsZero(x)  (Py_SIZE(x) == 0)
  #define __Pyx_PyLong_IsPos(x)  (Py_SIZE(x) > 0)
  #define __Pyx_PyLong_CompactValueUnsigned(x)  ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0])
  #define __Pyx_PyLong_DigitCount(x)  __Pyx_sst_abs(Py_SIZE(x))
  #define __Pyx_PyLong_SignedDigitCount(x)  Py_SIZE(x)
  #define __Pyx_PyLong_IsCompact(x)  (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1)
  #define __Pyx_PyLong_CompactValue(x)\
        ((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0]))
  typedef sdigit  __Pyx_compact_pylong;
  typedef digit  __Pyx_compact_upylong;
  #endif
  #if PY_VERSION_HEX >= 0x030C00A5
  #define __Pyx_PyLong_Digits(x)  (((PyLongObject*)x)->long_value.ob_digit)
  #else
  #define __Pyx_PyLong_Digits(x)  (((PyLongObject*)x)->ob_digit)
  #endif
#endif
#if __PYX_DEFAULT_STRING_ENCODING_IS_UTF8
  #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
#elif __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
  #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeASCII(c_str, size, NULL)
#else
  #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
#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__ */
/* PretendToInitialize */
#ifdef __cplusplus
#if __cplusplus > 201103L
#include <type_traits>
#endif
template <typename T>
static void __Pyx_pretend_to_initialize(T* ptr) {
#if __cplusplus > 201103L
    if ((std::is_trivially_default_constructible<T>::value))
#endif
        *ptr = T();
    (void)ptr;
}
#else
static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
#endif


#if !CYTHON_USE_MODULE_STATE
static PyObject *__pyx_m = NULL;
#endif
static int __pyx_lineno;
static int __pyx_clineno = 0;
static const char * const __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) && !defined(_MSC_VER)) || ((defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) && !defined(__STDC_NO_COMPLEX__) && !defined(_MSC_VER))
    #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

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

static const char* const __pyx_f[] = {
  "cupy_backends/cuda/libs/cusparse.pyx",
  "cupy_backends/cuda/libs/cusparse.pxd",
  "(tree fragment)",
  "cupy_backends/cuda/api/runtime.pxd",
  "cupy_backends/cuda/_softlink.pxd",
};
/* #### Code section: utility_code_proto_before_types ### */
/* Atomics.proto (used by UnpackUnboundCMethod) */
#include <pythread.h>
#ifndef CYTHON_ATOMICS
    #define CYTHON_ATOMICS 1
#endif
#define __PYX_CYTHON_ATOMICS_ENABLED() CYTHON_ATOMICS
#define __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING() CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
#define __pyx_atomic_int_type int
#define __pyx_nonatomic_int_type int
#if CYTHON_ATOMICS && (defined(__STDC_VERSION__) &&\
                        (__STDC_VERSION__ >= 201112L) &&\
                        !defined(__STDC_NO_ATOMICS__))
    #include <stdatomic.h>
#elif CYTHON_ATOMICS && (defined(__cplusplus) && (\
                    (__cplusplus >= 201103L) ||\
                    (defined(_MSC_VER) && _MSC_VER >= 1700)))
    #include <atomic>
#endif
#if CYTHON_ATOMICS && (defined(__STDC_VERSION__) &&\
                        (__STDC_VERSION__ >= 201112L) &&\
                        !defined(__STDC_NO_ATOMICS__) &&\
                       ATOMIC_INT_LOCK_FREE == 2)
    #undef __pyx_atomic_int_type
    #define __pyx_atomic_int_type atomic_int
    #define __pyx_atomic_ptr_type atomic_uintptr_t
    #define __pyx_nonatomic_ptr_type uintptr_t
    #define __pyx_atomic_incr_relaxed(value) atomic_fetch_add_explicit(value, 1, memory_order_relaxed)
    #define __pyx_atomic_incr_acq_rel(value) atomic_fetch_add_explicit(value, 1, memory_order_acq_rel)
    #define __pyx_atomic_decr_acq_rel(value) atomic_fetch_sub_explicit(value, 1, memory_order_acq_rel)
    #define __pyx_atomic_sub(value, arg) atomic_fetch_sub(value, arg)
    #define __pyx_atomic_int_cmp_exchange(value, expected, desired) atomic_compare_exchange_strong(value, expected, desired)
    #define __pyx_atomic_load(value) atomic_load(value)
    #define __pyx_atomic_store(value, new_value) atomic_store(value, new_value)
    #define __pyx_atomic_pointer_load_relaxed(value) atomic_load_explicit(value, memory_order_relaxed)
    #define __pyx_atomic_pointer_load_acquire(value) atomic_load_explicit(value, memory_order_acquire)
    #define __pyx_atomic_pointer_exchange(value, new_value) atomic_exchange(value, (__pyx_nonatomic_ptr_type)new_value)
    #define __pyx_atomic_pointer_cmp_exchange(value, expected, desired) atomic_compare_exchange_strong(value, expected, desired)
    #if defined(__PYX_DEBUG_ATOMICS) && defined(_MSC_VER)
        #pragma message ("Using standard C atomics")
    #elif defined(__PYX_DEBUG_ATOMICS)
        #warning "Using standard C atomics"
    #endif
#elif CYTHON_ATOMICS && (defined(__cplusplus) && (\
                    (__cplusplus >= 201103L) ||\
\
                    (defined(_MSC_VER) && _MSC_VER >= 1700)) &&\
                    ATOMIC_INT_LOCK_FREE == 2)
    #undef __pyx_atomic_int_type
    #define __pyx_atomic_int_type std::atomic_int
    #define __pyx_atomic_ptr_type std::atomic_uintptr_t
    #define __pyx_nonatomic_ptr_type uintptr_t
    #define __pyx_atomic_incr_relaxed(value) std::atomic_fetch_add_explicit(value, 1, std::memory_order_relaxed)
    #define __pyx_atomic_incr_acq_rel(value) std::atomic_fetch_add_explicit(value, 1, std::memory_order_acq_rel)
    #define __pyx_atomic_decr_acq_rel(value) std::atomic_fetch_sub_explicit(value, 1, std::memory_order_acq_rel)
    #define __pyx_atomic_sub(value, arg) std::atomic_fetch_sub(value, arg)
    #define __pyx_atomic_int_cmp_exchange(value, expected, desired) std::atomic_compare_exchange_strong(value, expected, desired)
    #define __pyx_atomic_load(value) std::atomic_load(value)
    #define __pyx_atomic_store(value, new_value) std::atomic_store(value, new_value)
    #define __pyx_atomic_pointer_load_relaxed(value) std::atomic_load_explicit(value, std::memory_order_relaxed)
    #define __pyx_atomic_pointer_load_acquire(value) std::atomic_load_explicit(value, std::memory_order_acquire)
    #define __pyx_atomic_pointer_exchange(value, new_value) std::atomic_exchange(value, (__pyx_nonatomic_ptr_type)new_value)
    #define __pyx_atomic_pointer_cmp_exchange(value, expected, desired) std::atomic_compare_exchange_strong(value, expected, desired)
    #if defined(__PYX_DEBUG_ATOMICS) && defined(_MSC_VER)
        #pragma message ("Using standard C++ atomics")
    #elif defined(__PYX_DEBUG_ATOMICS)
        #warning "Using standard C++ atomics"
    #endif
#elif CYTHON_ATOMICS && (__GNUC__ >= 5 || (__GNUC__ == 4 &&\
                    (__GNUC_MINOR__ > 1 ||\
                    (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL__ >= 2))))
    #define __pyx_atomic_ptr_type void*
    #define __pyx_nonatomic_ptr_type void*
    #define __pyx_atomic_incr_relaxed(value) __sync_fetch_and_add(value, 1)
    #define __pyx_atomic_incr_acq_rel(value) __sync_fetch_and_add(value, 1)
    #define __pyx_atomic_decr_acq_rel(value) __sync_fetch_and_sub(value, 1)
    #define __pyx_atomic_sub(value, arg) __sync_fetch_and_sub(value, arg)
    static CYTHON_INLINE int __pyx_atomic_int_cmp_exchange(__pyx_atomic_int_type* value, __pyx_nonatomic_int_type* expected, __pyx_nonatomic_int_type desired) {
        __pyx_nonatomic_int_type old = __sync_val_compare_and_swap(value, *expected, desired);
        int result = old == *expected;
        *expected = old;
        return result;
    }
    #define __pyx_atomic_load(value) __sync_fetch_and_add(value, 0)
    #define __pyx_atomic_store(value, new_value) __sync_lock_test_and_set(value, new_value)
    #define __pyx_atomic_pointer_load_relaxed(value) __sync_fetch_and_add(value, 0)
    #define __pyx_atomic_pointer_load_acquire(value) __sync_fetch_and_add(value, 0)
    #define __pyx_atomic_pointer_exchange(value, new_value) __sync_lock_test_and_set(value, (__pyx_atomic_ptr_type)new_value)
    static CYTHON_INLINE int __pyx_atomic_pointer_cmp_exchange(__pyx_atomic_ptr_type* value, __pyx_nonatomic_ptr_type* expected, __pyx_nonatomic_ptr_type desired) {
        __pyx_nonatomic_ptr_type old = __sync_val_compare_and_swap(value, *expected, desired);
        int result = old == *expected;
        *expected = old;
        return result;
    }
    #ifdef __PYX_DEBUG_ATOMICS
        #warning "Using GNU atomics"
    #endif
#elif CYTHON_ATOMICS && defined(_MSC_VER)
    #include <intrin.h>
    #undef __pyx_atomic_int_type
    #define __pyx_atomic_int_type long
    #define __pyx_atomic_ptr_type void*
    #undef __pyx_nonatomic_int_type
    #define __pyx_nonatomic_int_type long
    #define __pyx_nonatomic_ptr_type void*
    #pragma intrinsic (_InterlockedExchangeAdd, _InterlockedExchange, _InterlockedCompareExchange, _InterlockedCompareExchangePointer, _InterlockedExchangePointer)
    #define __pyx_atomic_incr_relaxed(value) _InterlockedExchangeAdd(value, 1)
    #define __pyx_atomic_incr_acq_rel(value) _InterlockedExchangeAdd(value, 1)
    #define __pyx_atomic_decr_acq_rel(value) _InterlockedExchangeAdd(value, -1)
    #define __pyx_atomic_sub(value, arg) _InterlockedExchangeAdd(value, -arg)
    static CYTHON_INLINE int __pyx_atomic_int_cmp_exchange(__pyx_atomic_int_type* value, __pyx_nonatomic_int_type* expected, __pyx_nonatomic_int_type desired) {
        __pyx_nonatomic_int_type old = _InterlockedCompareExchange(value, desired, *expected);
        int result = old == *expected;
        *expected = old;
        return result;
    }
    #define __pyx_atomic_load(value) _InterlockedExchangeAdd(value, 0)
    #define __pyx_atomic_store(value, new_value) _InterlockedExchange(value, new_value)
    #define __pyx_atomic_pointer_load_relaxed(value) *(void * volatile *)value
    #define __pyx_atomic_pointer_load_acquire(value) _InterlockedCompareExchangePointer(value, 0, 0)
    #define __pyx_atomic_pointer_exchange(value, new_value) _InterlockedExchangePointer(value, (__pyx_atomic_ptr_type)new_value)
    static CYTHON_INLINE int __pyx_atomic_pointer_cmp_exchange(__pyx_atomic_ptr_type* value, __pyx_nonatomic_ptr_type* expected, __pyx_nonatomic_ptr_type desired) {
        __pyx_atomic_ptr_type old = _InterlockedCompareExchangePointer(value, desired, *expected);
        int result = old == *expected;
        *expected = old;
        return result;
    }
    #ifdef __PYX_DEBUG_ATOMICS
        #pragma message ("Using MSVC atomics")
    #endif
#else
    #undef CYTHON_ATOMICS
    #define CYTHON_ATOMICS 0
    #ifdef __PYX_DEBUG_ATOMICS
        #warning "Not using atomics"
    #endif
#endif

/* CriticalSectionsDefinition.proto (used by CriticalSections) */
#if !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
#define __Pyx_PyCriticalSection void*
#define __Pyx_PyCriticalSection2 void*
#define __Pyx_PyCriticalSection_End(cs)
#define __Pyx_PyCriticalSection2_End(cs)
#else
#define __Pyx_PyCriticalSection PyCriticalSection
#define __Pyx_PyCriticalSection2 PyCriticalSection2
#define __Pyx_PyCriticalSection_End PyCriticalSection_End
#define __Pyx_PyCriticalSection2_End PyCriticalSection2_End
#endif

/* CriticalSections.proto (used by ParseKeywordsImpl) */
#if !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
#define __Pyx_PyCriticalSection_Begin(cs, arg) (void)(cs)
#define __Pyx_PyCriticalSection2_Begin(cs, arg1, arg2) (void)(cs)
#else
#define __Pyx_PyCriticalSection_Begin PyCriticalSection_Begin
#define __Pyx_PyCriticalSection2_Begin PyCriticalSection2_Begin
#endif
#if PY_VERSION_HEX < 0x030d0000 || CYTHON_COMPILING_IN_LIMITED_API
#define __Pyx_BEGIN_CRITICAL_SECTION(o) {
#define __Pyx_END_CRITICAL_SECTION() }
#else
#define __Pyx_BEGIN_CRITICAL_SECTION Py_BEGIN_CRITICAL_SECTION
#define __Pyx_END_CRITICAL_SECTION Py_END_CRITICAL_SECTION
#endif

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

/* IncludeStructmemberH.proto (used by FixUpExtensionType) */
#include <structmember.h>

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

/* #### Code section: numeric_typedefs ### */
/* #### Code section: complex_type_declarations ### */
/* Declarations.proto */
#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
  #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);

/* #### Code section: type_declarations ### */

/*--- Type declarations ---*/
struct __pyx_obj_13cupy_backends_4cuda_3api_7runtime_PointerAttributes;
struct __pyx_obj_13cupy_backends_4cuda_3api_7runtime_MemPoolProps;
struct __pyx_obj_13cupy_backends_4cuda_9_softlink_SoftLink;
struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_SpVecAttributes;
struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CooAttributes;
struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CooAoSAttributes;
struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CsrAttributes;
struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_DnVecAttributes;
struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_DnMatAttributes;
struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_DnMatBatchAttributes;

/* "cupy_backends/cuda/api/_driver_enum.pxd":1
 * cpdef enum:             # <<<<<<<<<<<<<<
 *     # CUjitInputType
 *     CU_JIT_INPUT_CUBIN = 0
*/
enum  {
  __pyx_e_13cupy_backends_4cuda_3api_12_driver_enum_CU_JIT_INPUT_CUBIN = 0,
  __pyx_e_13cupy_backends_4cuda_3api_12_driver_enum_CU_JIT_INPUT_PTX = 1,
  __pyx_e_13cupy_backends_4cuda_3api_12_driver_enum_CU_JIT_INPUT_FATBINARY = 2,
  __pyx_e_13cupy_backends_4cuda_3api_12_driver_enum_CU_JIT_INPUT_OBJECT = 3,
  __pyx_e_13cupy_backends_4cuda_3api_12_driver_enum_CU_JIT_INPUT_LIBRARY = 4,
  __pyx_e_13cupy_backends_4cuda_3api_12_driver_enum_CU_JIT_INPUT_NVVM = 5,
  __pyx_e_13cupy_backends_4cuda_3api_12_driver_enum_CU_JIT_MAX_REGISTERS = 0,
  __pyx_e_13cupy_backends_4cuda_3api_12_driver_enum_CU_JIT_THREADS_PER_BLOCK = 1,
  __pyx_e_13cupy_backends_4cuda_3api_12_driver_enum_CU_JIT_WALL_TIME = 2,
  __pyx_e_13cupy_backends_4cuda_3api_12_driver_enum_CU_JIT_INFO_LOG_BUFFER = 3,
  __pyx_e_13cupy_backends_4cuda_3api_12_driver_enum_CU_JIT_INFO_LOG_BUFFER_SIZE_BYTES = 4,
  __pyx_e_13cupy_backends_4cuda_3api_12_driver_enum_CU_JIT_ERROR_LOG_BUFFER = 5,
  __pyx_e_13cupy_backends_4cuda_3api_12_driver_enum_CU_JIT_ERROR_LOG_BUFFER_SIZE_BYTES = 6,
  __pyx_e_13cupy_backends_4cuda_3api_12_driver_enum_CU_JIT_OPTIMIZATION_LEVEL = 7,
  __pyx_e_13cupy_backends_4cuda_3api_12_driver_enum_CU_JIT_TARGET_FROM_CUCONTEXT = 8,
  __pyx_e_13cupy_backends_4cuda_3api_12_driver_enum_CU_JIT_TARGET = 9,
  __pyx_e_13cupy_backends_4cuda_3api_12_driver_enum_CU_JIT_FALLBACK_STRATEGY = 10,
  __pyx_e_13cupy_backends_4cuda_3api_12_driver_enum_CU_JIT_GENERATE_DEBUG_INFO = 11,
  __pyx_e_13cupy_backends_4cuda_3api_12_driver_enum_CU_JIT_LOG_VERBOSE = 12,
  __pyx_e_13cupy_backends_4cuda_3api_12_driver_enum_CU_JIT_GENERATE_LINE_INFO = 13,
  __pyx_e_13cupy_backends_4cuda_3api_12_driver_enum_CU_JIT_CACHE_MODE = 14,
  __pyx_e_13cupy_backends_4cuda_3api_12_driver_enum_CU_JIT_NEW_SM3X_OPT = 15,
  __pyx_e_13cupy_backends_4cuda_3api_12_driver_enum_CU_JIT_FAST_COMPILE = 16,
  __pyx_e_13cupy_backends_4cuda_3api_12_driver_enum_CU_JIT_GLOBAL_SYMBOL_NAMES = 17,
  __pyx_e_13cupy_backends_4cuda_3api_12_driver_enum_CU_JIT_GLOBAL_SYMBOL_ADDRESSES = 18,
  __pyx_e_13cupy_backends_4cuda_3api_12_driver_enum_CU_JIT_GLOBAL_SYMBOL_COUNT = 19,
  __pyx_e_13cupy_backends_4cuda_3api_12_driver_enum_CU_JIT_LTO = 20,
  __pyx_e_13cupy_backends_4cuda_3api_12_driver_enum_CU_JIT_FTZ = 21,
  __pyx_e_13cupy_backends_4cuda_3api_12_driver_enum_CU_JIT_PREC_DIV = 22,
  __pyx_e_13cupy_backends_4cuda_3api_12_driver_enum_CU_JIT_PREC_SQRT = 23,
  __pyx_e_13cupy_backends_4cuda_3api_12_driver_enum_CU_JIT_FMA = 24,
  __pyx_e_13cupy_backends_4cuda_3api_12_driver_enum_CU_JIT_NUM_OPTIONS = 25,
  __pyx_e_13cupy_backends_4cuda_3api_12_driver_enum_CU_FUNC_ATTRIBUTE_MAX_THREADS_PER_BLOCK = 0,
  __pyx_e_13cupy_backends_4cuda_3api_12_driver_enum_CU_FUNC_ATTRIBUTE_SHARED_SIZE_BYTES = 1,
  __pyx_e_13cupy_backends_4cuda_3api_12_driver_enum_CU_FUNC_ATTRIBUTE_CONST_SIZE_BYTES = 2,
  __pyx_e_13cupy_backends_4cuda_3api_12_driver_enum_CU_FUNC_ATTRIBUTE_LOCAL_SIZE_BYTES = 3,
  __pyx_e_13cupy_backends_4cuda_3api_12_driver_enum_CU_FUNC_ATTRIBUTE_NUM_REGS = 4,
  __pyx_e_13cupy_backends_4cuda_3api_12_driver_enum_CU_FUNC_ATTRIBUTE_PTX_VERSION = 5,
  __pyx_e_13cupy_backends_4cuda_3api_12_driver_enum_CU_FUNC_ATTRIBUTE_BINARY_VERSION = 6,
  __pyx_e_13cupy_backends_4cuda_3api_12_driver_enum_CU_FUNC_ATTRIBUTE_CACHE_MODE_CA = 7,
  __pyx_e_13cupy_backends_4cuda_3api_12_driver_enum_CU_FUNC_ATTRIBUTE_MAX_DYNAMIC_SHARED_SIZE_BYTES = 8,
  __pyx_e_13cupy_backends_4cuda_3api_12_driver_enum_CU_FUNC_ATTRIBUTE_PREFERRED_SHARED_MEMORY_CARVEOUT = 9,
  __pyx_e_13cupy_backends_4cuda_3api_12_driver_enum_CUDA_ERROR_INVALID_VALUE = 1,
  __pyx_e_13cupy_backends_4cuda_3api_12_driver_enum_CU_AD_FORMAT_UNSIGNED_INT8 = 0x01,
  __pyx_e_13cupy_backends_4cuda_3api_12_driver_enum_CU_AD_FORMAT_UNSIGNED_INT16 = 0x02,
  __pyx_e_13cupy_backends_4cuda_3api_12_driver_enum_CU_AD_FORMAT_UNSIGNED_INT32 = 0x03,
  __pyx_e_13cupy_backends_4cuda_3api_12_driver_enum_CU_AD_FORMAT_SIGNED_INT8 = 0x08,
  __pyx_e_13cupy_backends_4cuda_3api_12_driver_enum_CU_AD_FORMAT_SIGNED_INT16 = 0x09,
  __pyx_e_13cupy_backends_4cuda_3api_12_driver_enum_CU_AD_FORMAT_SIGNED_INT32 = 0x0a,
  __pyx_e_13cupy_backends_4cuda_3api_12_driver_enum_CU_AD_FORMAT_HALF = 0x10,
  __pyx_e_13cupy_backends_4cuda_3api_12_driver_enum_CU_AD_FORMAT_FLOAT = 0x20,
  __pyx_e_13cupy_backends_4cuda_3api_12_driver_enum_CU_TR_ADDRESS_MODE_WRAP = 0,
  __pyx_e_13cupy_backends_4cuda_3api_12_driver_enum_CU_TR_ADDRESS_MODE_CLAMP = 1,
  __pyx_e_13cupy_backends_4cuda_3api_12_driver_enum_CU_TR_ADDRESS_MODE_MIRROR = 2,
  __pyx_e_13cupy_backends_4cuda_3api_12_driver_enum_CU_TR_ADDRESS_MODE_BORDER = 3,
  __pyx_e_13cupy_backends_4cuda_3api_12_driver_enum_CU_TR_FILTER_MODE_POINT = 0,
  __pyx_e_13cupy_backends_4cuda_3api_12_driver_enum_CU_TR_FILTER_MODE_LINEAR = 1,
  __pyx_e_13cupy_backends_4cuda_3api_12_driver_enum_CU_TRSA_OVERRIDE_FORMAT = 0x01,
  __pyx_e_13cupy_backends_4cuda_3api_12_driver_enum_CU_TRSF_READ_AS_INTEGER = 0x01,
  __pyx_e_13cupy_backends_4cuda_3api_12_driver_enum_CU_TRSF_NORMALIZED_COORDINATES = 0x02,
  __pyx_e_13cupy_backends_4cuda_3api_12_driver_enum_CU_TRSF_SRGB = 0x10
};

/* "cupy_backends/cuda/api/_runtime_enum.pxd":1
 * cpdef enum:             # <<<<<<<<<<<<<<
 *     # need to revisit this when cython supports C++ enums (in 3.0)
 *     # https://stackoverflow.com/a/67138945
*/
enum  {

  /* "cupy_backends/cuda/api/_runtime_enum.pxd":116
 *     cudaGraphDebugDotFlagsKernelNodeAttributes = 1<<9
 *     cudaGraphDebugDotFlagsHandles = 1<<10
 *     cudaGraphDebugDotFlagsConditionalNodeParams = 1<<15             # <<<<<<<<<<<<<<
 * 
 * # This was a legacy mistake: the prefix "cuda" should have been removed
*/
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaMemoryTypeHost = 1,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaMemoryTypeDevice = 2,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaIpcMemLazyEnablePeerAccess = 1,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaMemAttachGlobal = 1,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaMemAttachHost = 2,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaMemAttachSingle = 4,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaCpuDeviceId = -1L,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaInvalidDeviceId = -2L,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaMemAdviseSetReadMostly = 1,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaMemAdviseUnsetReadMostly = 2,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaMemAdviseSetPreferredLocation = 3,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaMemAdviseUnsetPreferredLocation = 4,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaMemAdviseSetAccessedBy = 5,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaMemAdviseUnsetAccessedBy = 6,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_CUDA_R_32F = 0,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_CUDA_R_64F = 1,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_CUDA_R_16F = 2,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_CUDA_R_8I = 3,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_CUDA_C_32F = 4,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_CUDA_C_64F = 5,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_CUDA_C_16F = 6,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_CUDA_C_8I = 7,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_CUDA_R_8U = 8,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_CUDA_C_8U = 9,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_CUDA_R_16BF = 14,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaLimitStackSize = 0x00,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaLimitPrintfFifoSize = 0x01,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaLimitMallocHeapSize = 0x02,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaLimitDevRuntimeSyncDepth = 0x03,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaLimitDevRuntimePendingLaunchCount = 0x04,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaLimitMaxL2FetchGranularity = 0x05,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaChannelFormatKindSigned = 0,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaChannelFormatKindUnsigned = 1,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaChannelFormatKindFloat = 2,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaChannelFormatKindNone = 3,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaArrayDefault = 0,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaArraySurfaceLoadStore = 2,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaResourceTypeArray = 0,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaResourceTypeMipmappedArray = 1,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaResourceTypeLinear = 2,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaResourceTypePitch2D = 3,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaAddressModeWrap = 0,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaAddressModeClamp = 1,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaAddressModeMirror = 2,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaAddressModeBorder = 3,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaFilterModePoint = 0,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaFilterModeLinear = 1,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaReadModeElementType = 0,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaReadModeNormalizedFloat = 1,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaMemPoolReuseFollowEventDependencies = 0x1,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaMemPoolReuseAllowOpportunistic = 0x2,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaMemPoolReuseAllowInternalDependencies = 0x3,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaMemPoolAttrReleaseThreshold = 0x4,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaMemPoolAttrReservedMemCurrent = 0x5,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaMemPoolAttrReservedMemHigh = 0x6,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaMemPoolAttrUsedMemCurrent = 0x7,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaMemPoolAttrUsedMemHigh = 0x8,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaMemAllocationTypePinned = 0x1,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaMemHandleTypeNone = 0x0,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaMemHandleTypePosixFileDescriptor = 0x1,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaMemLocationTypeInvalid = 0,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaMemLocationTypeDevice = 1,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaMemLocationTypeHost = 2,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaMemLocationTypeHostNuma = 3,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaMemLocationTypeHostNumaCurrent = 4,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaGraphDebugDotFlagsVerbose = (1 << 0),
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaGraphDebugDotFlagsKernelNodeParams = (1 << 2),
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaGraphDebugDotFlagsMemcpyNodeParams = (1 << 3),
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaGraphDebugDotFlagsMemsetNodeParams = (1 << 4),
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaGraphDebugDotFlagsHostNodeParams = (1 << 5),
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaGraphDebugDotFlagsEventNodeParams = (1 << 6),
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaGraphDebugDotFlagsExtSemasSignalNodeParams = (1 << 7),
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaGraphDebugDotFlagsExtSemasWaitNodeParams = (1 << 8),
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaGraphDebugDotFlagsKernelNodeAttributes = (1 << 9),
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaGraphDebugDotFlagsHandles = (1 << 10),
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaGraphDebugDotFlagsConditionalNodeParams = (1 << 15)
};

/* "cupy_backends/cuda/api/_runtime_enum.pxd":250
 * ELSE:
 *     # For CUDA/RTD
 *     cpdef enum:             # <<<<<<<<<<<<<<
 *         cudaDevAttrMaxThreadsPerBlock = 1
 *         cudaDevAttrMaxBlockDimX
*/
enum  {
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaDevAttrMaxThreadsPerBlock = 1,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaDevAttrMaxBlockDimX,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaDevAttrMaxBlockDimY,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaDevAttrMaxBlockDimZ,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaDevAttrMaxGridDimX,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaDevAttrMaxGridDimY,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaDevAttrMaxGridDimZ,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaDevAttrMaxSharedMemoryPerBlock,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaDevAttrTotalConstantMemory,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaDevAttrWarpSize,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaDevAttrMaxPitch,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaDevAttrMaxRegistersPerBlock,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaDevAttrClockRate,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaDevAttrTextureAlignment,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaDevAttrGpuOverlap,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaDevAttrMultiProcessorCount,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaDevAttrKernelExecTimeout,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaDevAttrIntegrated,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaDevAttrCanMapHostMemory,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaDevAttrComputeMode,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaDevAttrMaxTexture1DWidth,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaDevAttrMaxTexture2DWidth,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaDevAttrMaxTexture2DHeight,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaDevAttrMaxTexture3DWidth,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaDevAttrMaxTexture3DHeight,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaDevAttrMaxTexture3DDepth,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaDevAttrMaxTexture2DLayeredWidth,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaDevAttrMaxTexture2DLayeredHeight,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaDevAttrMaxTexture2DLayeredLayers,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaDevAttrSurfaceAlignment,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaDevAttrConcurrentKernels,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaDevAttrEccEnabled,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaDevAttrPciBusId,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaDevAttrPciDeviceId,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaDevAttrTccDriver,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaDevAttrMemoryClockRate,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaDevAttrGlobalMemoryBusWidth,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaDevAttrL2CacheSize,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaDevAttrMaxThreadsPerMultiProcessor,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaDevAttrAsyncEngineCount,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaDevAttrUnifiedAddressing,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaDevAttrMaxTexture1DLayeredWidth,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaDevAttrMaxTexture1DLayeredLayers,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaDevAttrMaxTexture2DGatherWidth = 45,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaDevAttrMaxTexture2DGatherHeight,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaDevAttrMaxTexture3DWidthAlt,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaDevAttrMaxTexture3DHeightAlt,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaDevAttrMaxTexture3DDepthAlt,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaDevAttrPciDomainId,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaDevAttrTexturePitchAlignment,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaDevAttrMaxTextureCubemapWidth,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaDevAttrMaxTextureCubemapLayeredWidth,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaDevAttrMaxTextureCubemapLayeredLayers,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaDevAttrMaxSurface1DWidth,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaDevAttrMaxSurface2DWidth,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaDevAttrMaxSurface2DHeight,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaDevAttrMaxSurface3DWidth,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaDevAttrMaxSurface3DHeight,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaDevAttrMaxSurface3DDepth,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaDevAttrMaxSurface1DLayeredWidth,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaDevAttrMaxSurface1DLayeredLayers,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaDevAttrMaxSurface2DLayeredWidth,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaDevAttrMaxSurface2DLayeredHeight,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaDevAttrMaxSurface2DLayeredLayers,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaDevAttrMaxSurfaceCubemapWidth,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaDevAttrMaxSurfaceCubemapLayeredWidth,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaDevAttrMaxSurfaceCubemapLayeredLayers,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaDevAttrMaxTexture1DLinearWidth,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaDevAttrMaxTexture2DLinearWidth,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaDevAttrMaxTexture2DLinearHeight,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaDevAttrMaxTexture2DLinearPitch,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaDevAttrMaxTexture2DMipmappedWidth,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaDevAttrMaxTexture2DMipmappedHeight,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaDevAttrMaxTexture1DMipmappedWidth = 77,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaDevAttrStreamPrioritiesSupported,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaDevAttrGlobalL1CacheSupported,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaDevAttrLocalL1CacheSupported,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaDevAttrMaxSharedMemoryPerMultiprocessor,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaDevAttrMaxRegistersPerMultiprocessor,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaDevAttrManagedMemory,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaDevAttrIsMultiGpuBoard,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaDevAttrMultiGpuBoardGroupID,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaDevAttrHostNativeAtomicSupported,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaDevAttrSingleToDoublePrecisionPerfRatio,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaDevAttrPageableMemoryAccess,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaDevAttrConcurrentManagedAccess,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaDevAttrComputePreemptionSupported,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaDevAttrCanUseHostPointerForRegisteredMem,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaDevAttrReserved92,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaDevAttrReserved93,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaDevAttrReserved94,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaDevAttrCooperativeLaunch,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaDevAttrCooperativeMultiDeviceLaunch,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaDevAttrMaxSharedMemoryPerBlockOptin,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaDevAttrCanFlushRemoteWrites,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaDevAttrHostRegisterSupported,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaDevAttrPageableMemoryAccessUsesHostPageTables,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaDevAttrDirectManagedMemAccessFromHost,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaDevAttrMaxBlocksPerMultiprocessor = 0x6A,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaDevAttrReservedSharedMemoryPerBlock = 0x6F,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaDevAttrSparseCudaArraySupported = 0x70,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaDevAttrHostRegisterReadOnlySupported = 0x71,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaDevAttrMaxTimelineSemaphoreInteropSupported = 0x72,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaDevAttrMemoryPoolsSupported = 0x73,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaDevAttrGPUDirectRDMASupported,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaDevAttrGPUDirectRDMAFlushWritesOptions,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaDevAttrGPUDirectRDMAWritesOrdering,
  __pyx_e_13cupy_backends_4cuda_3api_13_runtime_enum_cudaDevAttrMemoryPoolSupportedHandleTypes
};
struct __pyx_opt_args_13cupy_backends_4cuda_3api_7runtime_mallocManaged;
struct __pyx_opt_args_13cupy_backends_4cuda_3api_7runtime_malloc3DArray;
struct __pyx_opt_args_13cupy_backends_4cuda_3api_7runtime_mallocArray;
struct __pyx_opt_args_13cupy_backends_4cuda_3api_7runtime_streamAddCallback;
struct __pyx_opt_args_13cupy_backends_4cuda_3api_7runtime_streamWaitEvent;
struct __pyx_opt_args_13cupy_backends_4cuda_3api_7runtime_streamBeginCapture;

/* "runtime.pxd":99
 * 
 * # For backward compatibility, keep APIs not prefixed with "cuda".
 * cpdef enum:             # <<<<<<<<<<<<<<
 *     memcpyHostToHost = 0
 *     memcpyHostToDevice = 1
*/
enum  {
  __pyx_e_13cupy_backends_4cuda_3api_7runtime_memcpyHostToHost = 0,
  __pyx_e_13cupy_backends_4cuda_3api_7runtime_memcpyHostToDevice = 1,
  __pyx_e_13cupy_backends_4cuda_3api_7runtime_memcpyDeviceToHost = 2,
  __pyx_e_13cupy_backends_4cuda_3api_7runtime_memcpyDeviceToDevice = 3,
  __pyx_e_13cupy_backends_4cuda_3api_7runtime_memcpyDefault = 4,
  __pyx_e_13cupy_backends_4cuda_3api_7runtime_hostAllocDefault = 0,
  __pyx_e_13cupy_backends_4cuda_3api_7runtime_hostAllocPortable = 1,
  __pyx_e_13cupy_backends_4cuda_3api_7runtime_hostAllocMapped = 2,
  __pyx_e_13cupy_backends_4cuda_3api_7runtime_hostAllocWriteCombined = 4,
  __pyx_e_13cupy_backends_4cuda_3api_7runtime_streamDefault = 0,
  __pyx_e_13cupy_backends_4cuda_3api_7runtime_streamNonBlocking = 1,
  __pyx_e_13cupy_backends_4cuda_3api_7runtime_streamLegacy = 1,
  __pyx_e_13cupy_backends_4cuda_3api_7runtime_streamPerThread = 2,
  __pyx_e_13cupy_backends_4cuda_3api_7runtime_eventDefault = 0,
  __pyx_e_13cupy_backends_4cuda_3api_7runtime_eventBlockingSync = 1,
  __pyx_e_13cupy_backends_4cuda_3api_7runtime_eventDisableTiming = 2,
  __pyx_e_13cupy_backends_4cuda_3api_7runtime_eventInterprocess = 4,
  __pyx_e_13cupy_backends_4cuda_3api_7runtime_streamCaptureModeGlobal = 0,
  __pyx_e_13cupy_backends_4cuda_3api_7runtime_streamCaptureModeThreadLocal = 1,
  __pyx_e_13cupy_backends_4cuda_3api_7runtime_streamCaptureModeRelaxed = 2,
  __pyx_e_13cupy_backends_4cuda_3api_7runtime_streamCaptureStatusNone = 0,
  __pyx_e_13cupy_backends_4cuda_3api_7runtime_streamCaptureStatusActive = 1,
  __pyx_e_13cupy_backends_4cuda_3api_7runtime_streamCaptureStatusInvalidated = 2,
  __pyx_e_13cupy_backends_4cuda_3api_7runtime_memoryTypeUnregistered = 0,
  __pyx_e_13cupy_backends_4cuda_3api_7runtime_memoryTypeHost = 1,
  __pyx_e_13cupy_backends_4cuda_3api_7runtime_memoryTypeDevice = 2,
  __pyx_e_13cupy_backends_4cuda_3api_7runtime_memoryTypeManaged = 3
};

/* "runtime.pxd":205
 * 
 * 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_13cupy_backends_4cuda_3api_7runtime_mallocManaged {
  int __pyx_n;
  unsigned int flags;
};

/* "runtime.pxd":206
 * 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_13cupy_backends_4cuda_3api_7runtime_malloc3DArray {
  int __pyx_n;
  unsigned int flags;
};

/* "runtime.pxd":208
 * 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 mallocAsync(size_t size, intptr_t stream) except? 0
*/
struct __pyx_opt_args_13cupy_backends_4cuda_3api_7runtime_mallocArray {
  int __pyx_n;
  unsigned int flags;
};

/* "runtime.pxd":275
 * cpdef streamDestroy(intptr_t stream)
 * cpdef streamSynchronize(intptr_t stream)
 * cpdef streamAddCallback(intptr_t stream, callback, intptr_t arg,             # <<<<<<<<<<<<<<
 *                         unsigned int flags=*)
 * cpdef launchHostFunc(intptr_t stream, callback, intptr_t arg)
*/
struct __pyx_opt_args_13cupy_backends_4cuda_3api_7runtime_streamAddCallback {
  int __pyx_n;
  unsigned int flags;
};

/* "runtime.pxd":280
 * cpdef _launchHostFuncUnmanaged(intptr_t stream, tuple func_arg)
 * cpdef streamQuery(intptr_t stream)
 * cpdef streamWaitEvent(intptr_t stream, intptr_t event, unsigned int flags=*)             # <<<<<<<<<<<<<<
 * cpdef streamBeginCapture(intptr_t stream, int mode=*)
 * cpdef intptr_t streamEndCapture(intptr_t stream) except? 0
*/
struct __pyx_opt_args_13cupy_backends_4cuda_3api_7runtime_streamWaitEvent {
  int __pyx_n;
  unsigned int flags;
};

/* "runtime.pxd":281
 * cpdef streamQuery(intptr_t stream)
 * cpdef streamWaitEvent(intptr_t stream, intptr_t event, unsigned int flags=*)
 * cpdef streamBeginCapture(intptr_t stream, int mode=*)             # <<<<<<<<<<<<<<
 * cpdef intptr_t streamEndCapture(intptr_t stream) except? 0
 * cpdef bint streamIsCapturing(intptr_t stream) except*
*/
struct __pyx_opt_args_13cupy_backends_4cuda_3api_7runtime_streamBeginCapture {
  int __pyx_n;
  int mode;
};
struct __pyx_opt_args_13cupy_backends_4cuda_6stream_set_current_stream_ptr;

/* "stream.pxd":5
 * cdef intptr_t get_current_stream_ptr()
 * cdef intptr_t get_stream_ptr(int device_id)
 * cdef set_current_stream_ptr(intptr_t ptr, int device_id=*)             # <<<<<<<<<<<<<<
 * cpdef intptr_t get_default_stream_ptr() noexcept
 * cdef bint is_ptds_enabled() noexcept
*/
struct __pyx_opt_args_13cupy_backends_4cuda_6stream_set_current_stream_ptr {
  int __pyx_n;
  int device_id;
};

/* "cupy_backends/cuda/_softlink.pxd":1
 * ctypedef int (*func_ptr)(...) noexcept nogil  # NOQA             # <<<<<<<<<<<<<<
 * 
 * cdef class SoftLink:
*/
typedef int (*__pyx_t_13cupy_backends_4cuda_9_softlink_func_ptr)(...);
struct __pyx_opt_args_13cupy_backends_4cuda_4libs_8cusparse_spSM_solve;

/* "cupy_backends/cuda/libs/cusparse.pxd":87
 *     ctypedef int SpGEAMAlg 'cusparseSpGEAMAlg_t'
 * 
 * cpdef enum:             # <<<<<<<<<<<<<<
 *     CUSPARSE_POINTER_MODE_HOST = 0
 *     CUSPARSE_POINTER_MODE_DEVICE = 1
*/
enum  {
  __pyx_e_13cupy_backends_4cuda_4libs_8cusparse_CUSPARSE_POINTER_MODE_HOST = 0,
  __pyx_e_13cupy_backends_4cuda_4libs_8cusparse_CUSPARSE_POINTER_MODE_DEVICE = 1,
  __pyx_e_13cupy_backends_4cuda_4libs_8cusparse_CUSPARSE_ACTION_SYMBOLIC = 0,
  __pyx_e_13cupy_backends_4cuda_4libs_8cusparse_CUSPARSE_ACTION_NUMERIC = 1,
  __pyx_e_13cupy_backends_4cuda_4libs_8cusparse_CUSPARSE_INDEX_BASE_ZERO = 0,
  __pyx_e_13cupy_backends_4cuda_4libs_8cusparse_CUSPARSE_INDEX_BASE_ONE = 1,
  __pyx_e_13cupy_backends_4cuda_4libs_8cusparse_CUSPARSE_MATRIX_TYPE_GENERAL = 0,
  __pyx_e_13cupy_backends_4cuda_4libs_8cusparse_CUSPARSE_MATRIX_TYPE_SYMMETRIC = 1,
  __pyx_e_13cupy_backends_4cuda_4libs_8cusparse_CUSPARSE_MATRIX_TYPE_HERMITIAN = 2,
  __pyx_e_13cupy_backends_4cuda_4libs_8cusparse_CUSPARSE_MATRIX_TYPE_TRIANGULAR = 3,
  __pyx_e_13cupy_backends_4cuda_4libs_8cusparse_CUSPARSE_FILL_MODE_LOWER = 0,
  __pyx_e_13cupy_backends_4cuda_4libs_8cusparse_CUSPARSE_FILL_MODE_UPPER = 1,
  __pyx_e_13cupy_backends_4cuda_4libs_8cusparse_CUSPARSE_DIAG_TYPE_NON_UNIT = 0,
  __pyx_e_13cupy_backends_4cuda_4libs_8cusparse_CUSPARSE_DIAG_TYPE_UNIT = 1,
  __pyx_e_13cupy_backends_4cuda_4libs_8cusparse_CUSPARSE_OPERATION_NON_TRANSPOSE = 0,
  __pyx_e_13cupy_backends_4cuda_4libs_8cusparse_CUSPARSE_OPERATION_TRANSPOSE = 1,
  __pyx_e_13cupy_backends_4cuda_4libs_8cusparse_CUSPARSE_OPERATION_CONJUGATE_TRANSPOSE = 2,
  __pyx_e_13cupy_backends_4cuda_4libs_8cusparse_CUSPARSE_DIRECTION_ROW = 0,
  __pyx_e_13cupy_backends_4cuda_4libs_8cusparse_CUSPARSE_DIRECTION_COLUMN = 1,
  __pyx_e_13cupy_backends_4cuda_4libs_8cusparse_CUSPARSE_SOLVE_POLICY_NO_LEVEL = 0,
  __pyx_e_13cupy_backends_4cuda_4libs_8cusparse_CUSPARSE_SOLVE_POLICY_USE_LEVEL = 1,
  __pyx_e_13cupy_backends_4cuda_4libs_8cusparse_CUSPARSE_ALG_NAIVE = 0,
  __pyx_e_13cupy_backends_4cuda_4libs_8cusparse_CUSPARSE_ALG_MERGE_PATH = 1,
  __pyx_e_13cupy_backends_4cuda_4libs_8cusparse_CUSPARSE_FORMAT_CSR = 1,
  __pyx_e_13cupy_backends_4cuda_4libs_8cusparse_CUSPARSE_FORMAT_CSC = 2,
  __pyx_e_13cupy_backends_4cuda_4libs_8cusparse_CUSPARSE_FORMAT_COO = 3,
  __pyx_e_13cupy_backends_4cuda_4libs_8cusparse_CUSPARSE_FORMAT_COO_AOS = 4,
  __pyx_e_13cupy_backends_4cuda_4libs_8cusparse_CUSPARSE_ORDER_COL = 1,
  __pyx_e_13cupy_backends_4cuda_4libs_8cusparse_CUSPARSE_ORDER_ROW = 2,
  __pyx_e_13cupy_backends_4cuda_4libs_8cusparse_CUSPARSE_MV_ALG_DEFAULT = 0,
  __pyx_e_13cupy_backends_4cuda_4libs_8cusparse_CUSPARSE_COOMV_ALG = 1,
  __pyx_e_13cupy_backends_4cuda_4libs_8cusparse_CUSPARSE_CSRMV_ALG1 = 2,
  __pyx_e_13cupy_backends_4cuda_4libs_8cusparse_CUSPARSE_CSRMV_ALG2 = 3,
  __pyx_e_13cupy_backends_4cuda_4libs_8cusparse_CUSPARSE_MM_ALG_DEFAULT = 0,
  __pyx_e_13cupy_backends_4cuda_4libs_8cusparse_CUSPARSE_COOMM_ALG1 = 1,
  __pyx_e_13cupy_backends_4cuda_4libs_8cusparse_CUSPARSE_COOMM_ALG2 = 2,
  __pyx_e_13cupy_backends_4cuda_4libs_8cusparse_CUSPARSE_COOMM_ALG3 = 3,
  __pyx_e_13cupy_backends_4cuda_4libs_8cusparse_CUSPARSE_CSRMM_ALG1 = 4,
  __pyx_e_13cupy_backends_4cuda_4libs_8cusparse_CUSPARSE_INDEX_16U = 1,
  __pyx_e_13cupy_backends_4cuda_4libs_8cusparse_CUSPARSE_INDEX_32I = 2,
  __pyx_e_13cupy_backends_4cuda_4libs_8cusparse_CUSPARSE_INDEX_64I = 3,
  __pyx_e_13cupy_backends_4cuda_4libs_8cusparse_CUSPARSE_SPMAT_FILL_MODE = 0,
  __pyx_e_13cupy_backends_4cuda_4libs_8cusparse_CUSPARSE_SPMAT_DIAG_TYPE = 1,
  __pyx_e_13cupy_backends_4cuda_4libs_8cusparse_CUSPARSE_CSR2CSC_ALG1 = 1,
  __pyx_e_13cupy_backends_4cuda_4libs_8cusparse_CUSPARSE_CSR2CSC_ALG2 = 2,
  __pyx_e_13cupy_backends_4cuda_4libs_8cusparse_CUSPARSE_SPSM_ALG_DEFAULT = 0,
  __pyx_e_13cupy_backends_4cuda_4libs_8cusparse_CUSPARSE_SPGEMM_DEFAULT = 0,
  __pyx_e_13cupy_backends_4cuda_4libs_8cusparse_CUSPARSE_SPGEMM_CSR_ALG_DETERMINITIC = 1,
  __pyx_e_13cupy_backends_4cuda_4libs_8cusparse_CUSPARSE_SPGEMM_CSR_ALG_NONDETERMINITIC = 2,
  __pyx_e_13cupy_backends_4cuda_4libs_8cusparse_CUSPARSE_SPGEMM_ALG1 = 3,
  __pyx_e_13cupy_backends_4cuda_4libs_8cusparse_CUSPARSE_SPGEMM_ALG2 = 4,
  __pyx_e_13cupy_backends_4cuda_4libs_8cusparse_CUSPARSE_SPGEMM_ALG3 = 5,
  __pyx_e_13cupy_backends_4cuda_4libs_8cusparse_CUSPARSE_SPGEAM_ALG_DEFAULT = 0,
  __pyx_e_13cupy_backends_4cuda_4libs_8cusparse_CUSPARSE_SPGEAM_ALG1 = 1,
  __pyx_e_13cupy_backends_4cuda_4libs_8cusparse_CUSPARSE_SPARSETODENSE_ALG_DEFAULT = 0,
  __pyx_e_13cupy_backends_4cuda_4libs_8cusparse_CUSPARSE_DENSETOSPARSE_ALG_DEFAULT = 0
};

/* "cupy_backends/cuda/libs/cusparse.pyx":1373
 *     int CUSPARSE_VERSION
 * 
 * ctypedef Status (*f_type)(...) noexcept nogil  # NOQA             # <<<<<<<<<<<<<<
 * 
 * # TODO(leofang): Since we already require CUDA 12.0+, these code can probably
*/
typedef cusparseStatus_t (*__pyx_t_13cupy_backends_4cuda_4libs_8cusparse_f_type)(...);

/* "cupy_backends/cuda/libs/cusparse.pyx":4991
 *     check_status(status)
 * 
 * cpdef void spSM_solve(             # <<<<<<<<<<<<<<
 *         intptr_t handle, Operation opA, Operation opB, intptr_t alpha,
 *         size_t matA, size_t matB, size_t matC, DataType computeType,
*/
struct __pyx_opt_args_13cupy_backends_4cuda_4libs_8cusparse_spSM_solve {
  int __pyx_n;
  intptr_t externalBuffer;
};

/* "runtime.pxd":8
 * ###############################################################################
 * 
 * cdef class PointerAttributes:             # <<<<<<<<<<<<<<
 *     cdef:
 *         readonly int device
*/
struct __pyx_obj_13cupy_backends_4cuda_3api_7runtime_PointerAttributes {
  PyObject_HEAD
  int device;
  intptr_t devicePointer;
  intptr_t hostPointer;
  int type;
};


/* "runtime.pxd":15
 *         readonly int type
 * 
 * cdef class MemPoolProps:             # <<<<<<<<<<<<<<
 *     # flatten the struct & list meaningful members
 *     cdef:
*/
struct __pyx_obj_13cupy_backends_4cuda_3api_7runtime_MemPoolProps {
  PyObject_HEAD
  int allocType;
  int handleType;
  int locationType;
  int devId;
};


/* "cupy_backends/cuda/_softlink.pxd":3
 * ctypedef int (*func_ptr)(...) noexcept nogil  # NOQA
 * 
 * cdef class SoftLink:             # <<<<<<<<<<<<<<
 *     cdef:
 *         object error
*/
struct __pyx_obj_13cupy_backends_4cuda_9_softlink_SoftLink {
  PyObject_HEAD
  struct __pyx_vtabstruct_13cupy_backends_4cuda_9_softlink_SoftLink *__pyx_vtab;
  PyObject *error;
  PyObject *prefix;
  PyObject *_libname;
  PyObject *_cdll;
};


/* "cupy_backends/cuda/libs/cusparse.pxd":177
 *     CUSPARSE_DENSETOSPARSE_ALG_DEFAULT = 0
 * 
 * cdef class SpVecAttributes:             # <<<<<<<<<<<<<<
 *     cdef:
 *         public int64_t size
*/
struct __pyx_obj_13cupy_backends_4cuda_4libs_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_backends/cuda/libs/cusparse.pxd":187
 *         public DataType valueType
 * 
 * cdef class CooAttributes:             # <<<<<<<<<<<<<<
 *     cdef:
 *         public int64_t rows
*/
struct __pyx_obj_13cupy_backends_4cuda_4libs_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_backends/cuda/libs/cusparse.pxd":199
 *         public DataType valueType
 * 
 * cdef class CooAoSAttributes:             # <<<<<<<<<<<<<<
 *     cdef:
 *         public int64_t rows
*/
struct __pyx_obj_13cupy_backends_4cuda_4libs_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_backends/cuda/libs/cusparse.pxd":210
 *         public DataType valueType
 * 
 * cdef class CsrAttributes:             # <<<<<<<<<<<<<<
 *     cdef:
 *         public int64_t rows
*/
struct __pyx_obj_13cupy_backends_4cuda_4libs_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_backends/cuda/libs/cusparse.pxd":223
 *         public DataType valueType
 * 
 * cdef class DnVecAttributes:             # <<<<<<<<<<<<<<
 *     cdef:
 *         public int64_t size
*/
struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_DnVecAttributes {
  PyObject_HEAD
  int64_t size;
  intptr_t values;
  cudaDataType valueType;
};


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


/* "cupy_backends/cuda/libs/cusparse.pxd":238
 *         public Order order
 * 
 * cdef class DnMatBatchAttributes:             # <<<<<<<<<<<<<<
 *     cdef:
 *         public int count
*/
struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_DnMatBatchAttributes {
  PyObject_HEAD
  int count;
  int64_t stride;
};



/* "cupy_backends/cuda/_softlink.pxd":3
 * ctypedef int (*func_ptr)(...) noexcept nogil  # NOQA
 * 
 * cdef class SoftLink:             # <<<<<<<<<<<<<<
 *     cdef:
 *         object error
*/

struct __pyx_vtabstruct_13cupy_backends_4cuda_9_softlink_SoftLink {
  __pyx_t_13cupy_backends_4cuda_9_softlink_func_ptr (*get)(struct __pyx_obj_13cupy_backends_4cuda_9_softlink_SoftLink *, PyObject *);
};
static struct __pyx_vtabstruct_13cupy_backends_4cuda_9_softlink_SoftLink *__pyx_vtabptr_13cupy_backends_4cuda_9_softlink_SoftLink;
/* #### Code section: utility_code_proto ### */

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

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

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

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

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

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

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

/* IncludeStringH.proto (used by BytesEquals) */
#include <string.h>

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

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

/* fastcall.proto */
#if CYTHON_AVOID_BORROWED_REFS
    #define __Pyx_ArgRef_VARARGS(args, i) __Pyx_PySequence_ITEM(args, i)
#elif CYTHON_ASSUME_SAFE_MACROS
    #define __Pyx_ArgRef_VARARGS(args, i) __Pyx_NewRef(__Pyx_PyTuple_GET_ITEM(args, i))
#else
    #define __Pyx_ArgRef_VARARGS(args, i) __Pyx_XNewRef(PyTuple_GetItem(args, i))
#endif
#define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds)
#define __Pyx_KwValues_VARARGS(args, nargs) NULL
#define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s)
#define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw)
#if CYTHON_METH_FASTCALL
    #define __Pyx_ArgRef_FASTCALL(args, i) __Pyx_NewRef(args[i])
    #define __Pyx_NumKwargs_FASTCALL(kwds) __Pyx_PyTuple_GET_SIZE(kwds)
    #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs))
    static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 || CYTHON_COMPILING_IN_LIMITED_API
    CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues);
  #else
    #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw)
  #endif
#else
    #define __Pyx_ArgRef_FASTCALL __Pyx_ArgRef_VARARGS
    #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS
    #define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS
    #define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS
    #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS
#endif
#define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop)
#if CYTHON_METH_FASTCALL || (CYTHON_COMPILING_IN_CPYTHON && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
#define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(args + start, stop - start)
#else
#define __Pyx_ArgsSlice_FASTCALL(args, start, stop) PyTuple_GetSlice(args, start, stop)
#endif

/* py_dict_items.proto (used by OwnedDictNext) */
static CYTHON_INLINE PyObject* __Pyx_PyDict_Items(PyObject* d);

/* CallCFunction.proto (used by CallUnboundCMethod0) */
#define __Pyx_CallCFunction(cfunc, self, args)\
    ((PyCFunction)(void(*)(void))(cfunc)->func)(self, args)
#define __Pyx_CallCFunctionWithKeywords(cfunc, self, args, kwargs)\
    ((PyCFunctionWithKeywords)(void(*)(void))(cfunc)->func)(self, args, kwargs)
#define __Pyx_CallCFunctionFast(cfunc, self, args, nargs)\
    ((__Pyx_PyCFunctionFast)(void(*)(void))(PyCFunction)(cfunc)->func)(self, args, nargs)
#define __Pyx_CallCFunctionFastWithKeywords(cfunc, self, args, nargs, kwnames)\
    ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))(PyCFunction)(cfunc)->func)(self, args, nargs, kwnames)

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

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

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

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

/* UnpackUnboundCMethod.proto (used by CallUnboundCMethod0) */
typedef struct {
    PyObject *type;
    PyObject **method_name;
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && CYTHON_ATOMICS
    __pyx_atomic_int_type initialized;
#endif
    PyCFunction func;
    PyObject *method;
    int flag;
} __Pyx_CachedCFunction;
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
static CYTHON_INLINE int __Pyx_CachedCFunction_GetAndSetInitializing(__Pyx_CachedCFunction *cfunc) {
#if !CYTHON_ATOMICS
    return 1;
#else
    __pyx_nonatomic_int_type expected = 0;
    if (__pyx_atomic_int_cmp_exchange(&cfunc->initialized, &expected, 1)) {
        return 0;
    }
    return expected;
#endif
}
static CYTHON_INLINE void __Pyx_CachedCFunction_SetFinishedInitializing(__Pyx_CachedCFunction *cfunc) {
#if CYTHON_ATOMICS
    __pyx_atomic_store(&cfunc->initialized, 2);
#endif
}
#else
#define __Pyx_CachedCFunction_GetAndSetInitializing(cfunc) 2
#define __Pyx_CachedCFunction_SetFinishedInitializing(cfunc)
#endif

/* CallUnboundCMethod0.proto */
CYTHON_UNUSED
static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self);
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self);
#else
#define __Pyx_CallUnboundCMethod0(cfunc, self)  __Pyx__CallUnboundCMethod0(cfunc, self)
#endif

/* py_dict_values.proto (used by OwnedDictNext) */
static CYTHON_INLINE PyObject* __Pyx_PyDict_Values(PyObject* d);

/* OwnedDictNext.proto (used by ParseKeywordsImpl) */
#if CYTHON_AVOID_BORROWED_REFS
static int __Pyx_PyDict_NextRef(PyObject *p, PyObject **ppos, PyObject **pkey, PyObject **pvalue);
#else
CYTHON_INLINE
static int __Pyx_PyDict_NextRef(PyObject *p, Py_ssize_t *ppos, PyObject **pkey, PyObject **pvalue);
#endif

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

/* ParseKeywordsImpl.export */
static int __Pyx_ParseKeywordsTuple(
    PyObject *kwds,
    PyObject * const *kwvalues,
    PyObject ** const argnames[],
    PyObject *kwds2,
    PyObject *values[],
    Py_ssize_t num_pos_args,
    Py_ssize_t num_kwargs,
    const char* function_name,
    int ignore_unknown_kwargs
);
static int __Pyx_ParseKeywordDictToDict(
    PyObject *kwds,
    PyObject ** const argnames[],
    PyObject *kwds2,
    PyObject *values[],
    Py_ssize_t num_pos_args,
    const char* function_name
);
static int __Pyx_ParseKeywordDict(
    PyObject *kwds,
    PyObject ** const argnames[],
    PyObject *values[],
    Py_ssize_t num_pos_args,
    Py_ssize_t num_kwargs,
    const char* function_name,
    int ignore_unknown_kwargs
);

/* CallUnboundCMethod2.proto */
CYTHON_UNUSED
static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2);
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2);
#else
#define __Pyx_CallUnboundCMethod2(cfunc, self, arg1, arg2)  __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2)
#endif

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

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

/* RejectKeywords.export */
static void __Pyx_RejectKeywords(const char* function_name, PyObject *kwds);

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

/* PyDictVersioning.proto (used by GetModuleGlobalName) */
#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_XNewRef(__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)  do {\
    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_mstate_global->__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);\
} while(0)
#define __Pyx_GetModuleGlobalNameUncached(var, name)  do {\
    PY_UINT64_T __pyx_dict_version;\
    PyObject *__pyx_dict_cached_value;\
    (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
} while(0)
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

/* RaiseUnexpectedTypeError.proto */
static int __Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj);

/* PyObjectDelAttr.proto (used by PyObjectSetAttrStr) */
#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
#define __Pyx_PyObject_DelAttr(o, n) PyObject_SetAttr(o, n, NULL)
#else
#define __Pyx_PyObject_DelAttr(o, n) PyObject_DelAttr(o, n)
#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)   __Pyx_PyObject_DelAttr(o,n)
#define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v)
#endif

/* DictGetItem.proto */
#if !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

/* decode_c_string_utf16.proto (used by decode_c_bytes) */
static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16(const char *s, Py_ssize_t size, const char *errors) {
    int byteorder = 0;
    return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
}
static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16LE(const char *s, Py_ssize_t size, const char *errors) {
    int byteorder = -1;
    return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
}
static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16BE(const char *s, Py_ssize_t size, const char *errors) {
    int byteorder = 1;
    return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
}

/* decode_c_bytes.proto (used by decode_bytes) */
static CYTHON_INLINE PyObject* __Pyx_decode_c_bytes(
         const char* cstring, Py_ssize_t length, Py_ssize_t start, Py_ssize_t stop,
         const char* encoding, const char* errors,
         PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors));

/* decode_bytes.proto */
static CYTHON_INLINE PyObject* __Pyx_decode_bytes(
         PyObject* string, Py_ssize_t start, Py_ssize_t stop,
         const char* encoding, const char* errors,
         PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) {
    char* as_c_string;
    Py_ssize_t size;
#if CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE
    as_c_string = PyBytes_AS_STRING(string);
    size = PyBytes_GET_SIZE(string);
#else
    if (PyBytes_AsStringAndSize(string, &as_c_string, &size) < 0) {
        return NULL;
    }
#endif
    return __Pyx_decode_c_bytes(
        as_c_string, size,
        start, stop, encoding, errors, decode_func);
}

/* JoinPyUnicode.export */
static PyObject* __Pyx_PyUnicode_Join(PyObject** values, Py_ssize_t value_count, Py_ssize_t result_ulength,
                                      Py_UCS4 max_char);

/* PyObjectFastCallMethod.proto */
#if CYTHON_VECTORCALL && PY_VERSION_HEX >= 0x03090000
#define __Pyx_PyObject_FastCallMethod(name, args, nargsf) PyObject_VectorcallMethod(name, args, nargsf, NULL)
#else
static PyObject *__Pyx_PyObject_FastCallMethod(PyObject *name, PyObject *const *args, size_t nargsf);
#endif

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

/* PyNotImplementedError_Check.proto */
#define __Pyx_PyExc_NotImplementedError_Check(obj)  __Pyx_TypeCheck(obj, PyExc_NotImplementedError)

/* ArgTypeTestFunc.export */
static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact);

/* ArgTypeTest.proto */
#define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
    ((likely(__Pyx_IS_TYPE(obj, type) | (none_allowed && (obj == Py_None)))) ? 1 :\
        __Pyx__ArgTypeTest(obj, type, name, exact))

/* GetItemInt.proto */
#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck, has_gil, unsafe_shared)\
    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
    __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck, unsafe_shared) :\
    (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, has_gil, unsafe_shared)\
    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
    __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck, unsafe_shared) :\
    (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, int unsafe_shared);
#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck, has_gil, unsafe_shared)\
    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
    __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck, unsafe_shared) :\
    (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, int unsafe_shared);
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, int unsafe_shared);

/* AllocateExtensionType.proto */
static PyObject *__Pyx_AllocateExtensionType(PyTypeObject *t, int is_final);

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

/* GetApiDict.proto */
static PyObject *__Pyx_ApiExport_GetApiDict(void);

/* LimitedApiGetTypeDict.proto (used by SetItemOnTypeDict) */
#if CYTHON_COMPILING_IN_LIMITED_API
static PyObject *__Pyx_GetTypeDict(PyTypeObject *tp);
#endif

/* SetItemOnTypeDict.proto (used by FixUpExtensionType) */
static int __Pyx__SetItemOnTypeDict(PyTypeObject *tp, PyObject *k, PyObject *v);
#define __Pyx_SetItemOnTypeDict(tp, k, v) __Pyx__SetItemOnTypeDict((PyTypeObject*)tp, k, v)

/* FixUpExtensionType.proto */
static CYTHON_INLINE int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type);

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

/* PyObjectGetMethod.proto (used by PyObjectCallMethod0) */
#if !(CYTHON_VECTORCALL && (__PYX_LIMITED_VERSION_HEX >= 0x030C0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x03090000)))
static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method);
#endif

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

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

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

/* DelItemOnTypeDict.proto (used by SetupReduce) */
static int __Pyx__DelItemOnTypeDict(PyTypeObject *tp, PyObject *k);
#define __Pyx_DelItemOnTypeDict(tp, k) __Pyx__DelItemOnTypeDict((PyTypeObject*)tp, k)

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

/* TypeImport.proto */
#ifndef __PYX_HAVE_RT_ImportType_proto_3_2_5
#define __PYX_HAVE_RT_ImportType_proto_3_2_5
#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
#include <stdalign.h>
#endif
#if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || __cplusplus >= 201103L
#define __PYX_GET_STRUCT_ALIGNMENT_3_2_5(s) alignof(s)
#else
#define __PYX_GET_STRUCT_ALIGNMENT_3_2_5(s) sizeof(void*)
#endif
enum __Pyx_ImportType_CheckSize_3_2_5 {
   __Pyx_ImportType_CheckSize_Error_3_2_5 = 0,
   __Pyx_ImportType_CheckSize_Warn_3_2_5 = 1,
   __Pyx_ImportType_CheckSize_Ignore_3_2_5 = 2
};
static PyTypeObject *__Pyx_ImportType_3_2_5(PyObject* module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_2_5 check_size);
#endif

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

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

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

/* HasAttr.proto (used by ImportImpl) */
#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
#define __Pyx_HasAttr(o, n)  PyObject_HasAttrWithError(o, n)
#else
static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *);
#endif

/* ImportImpl.export */
static PyObject *__Pyx__Import(PyObject *name, PyObject *const *imported_names, Py_ssize_t len_imported_names, PyObject *qualname, PyObject *moddict, int level);

/* Import.proto */
static CYTHON_INLINE PyObject *__Pyx_Import(PyObject *name, PyObject *const *imported_names, Py_ssize_t len_imported_names, PyObject *qualname, int level);

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

/* PyObjectVectorCallKwBuilder.proto */
CYTHON_UNUSED static int __Pyx_VectorcallBuilder_AddArg_Check(PyObject *key, PyObject *value, PyObject *builder, PyObject **args, int n);
#if CYTHON_VECTORCALL
#if PY_VERSION_HEX >= 0x03090000
#define __Pyx_Object_Vectorcall_CallFromBuilder PyObject_Vectorcall
#else
#define __Pyx_Object_Vectorcall_CallFromBuilder _PyObject_Vectorcall
#endif
#define __Pyx_MakeVectorcallBuilderKwds(n) PyTuple_New(n)
static int __Pyx_VectorcallBuilder_AddArg(PyObject *key, PyObject *value, PyObject *builder, PyObject **args, int n);
static int __Pyx_VectorcallBuilder_AddArgStr(const char *key, PyObject *value, PyObject *builder, PyObject **args, int n);
#else
#define __Pyx_Object_Vectorcall_CallFromBuilder __Pyx_PyObject_FastCallDict
#define __Pyx_MakeVectorcallBuilderKwds(n) __Pyx_PyDict_NewPresized(n)
#define __Pyx_VectorcallBuilder_AddArg(key, value, builder, args, n) PyDict_SetItem(builder, key, value)
#define __Pyx_VectorcallBuilder_AddArgStr(key, value, builder, args, n) PyDict_SetItemString(builder, key, value)
#endif

/* PyRuntimeError_Check.proto */
#define __Pyx_PyExc_RuntimeError_Check(obj)  __Pyx_TypeCheck(obj, PyExc_RuntimeError)

/* Py3UpdateBases.proto */
static PyObject* __Pyx_PEP560_update_bases(PyObject *bases);

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

/* dict_setdefault.proto (used by FetchCommonType) */
static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *key, PyObject *default_value);

/* AddModuleRef.proto (used by FetchSharedCythonModule) */
#if ((CYTHON_COMPILING_IN_CPYTHON_FREETHREADING ) ||\
     __PYX_LIMITED_VERSION_HEX < 0x030d0000)
  static PyObject *__Pyx_PyImport_AddModuleRef(const char *name);
#else
  #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name)
#endif

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

/* FetchCommonType.proto (used by CommonTypesMetaclass) */
static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyTypeObject *metaclass, PyObject *module, PyType_Spec *spec, PyObject *bases);

/* CommonTypesMetaclass.proto (used by CythonFunctionShared) */
static int __pyx_CommonTypesMetaclass_init(PyObject *module);
#define __Pyx_CommonTypesMetaclass_USED

/* CallTypeTraverse.proto (used by CythonFunctionShared) */
#if !CYTHON_USE_TYPE_SPECS || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x03090000)
#define __Pyx_call_type_traverse(o, always_call, visit, arg) 0
#else
static int __Pyx_call_type_traverse(PyObject *o, int always_call, visitproc visit, void *arg);
#endif

/* PyMethodNew.proto (used by CythonFunctionShared) */
static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ);

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

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

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

/* SetNameInClass.proto */
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000
#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

/* PyObjectCall2Args.proto (used by Py3ClassCreate) */
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2);

/* PyObjectLookupSpecial.proto (used by Py3ClassCreate) */
#if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
#define __Pyx_PyObject_LookupSpecialNoError(obj, attr_name)  __Pyx__PyObject_LookupSpecial(obj, attr_name, 0)
#define __Pyx_PyObject_LookupSpecial(obj, attr_name)  __Pyx__PyObject_LookupSpecial(obj, attr_name, 1)
static CYTHON_INLINE PyObject* __Pyx__PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name, int with_error);
#else
#define __Pyx_PyObject_LookupSpecialNoError(o,n) __Pyx_PyObject_GetAttrStrNoError(o,n)
#define __Pyx_PyObject_LookupSpecial(o,n) __Pyx_PyObject_GetAttrStr(o,n)
#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);

/* CyFunctionClassCell.proto */
static int __Pyx_CyFunction_InitClassCell(PyObject *cyfunctions, PyObject *classobj);

/* CLineInTraceback.proto (used by AddTraceback) */
#if CYTHON_CLINE_IN_TRACEBACK && CYTHON_CLINE_IN_TRACEBACK_RUNTIME
static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
#else
#define __Pyx_CLineForTraceback(tstate, c_line)  (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
#endif

/* CodeObjectCache.proto (used by AddTraceback) */
#if CYTHON_COMPILING_IN_LIMITED_API
typedef PyObject __Pyx_CachedCodeObjectType;
#else
typedef PyCodeObject __Pyx_CachedCodeObjectType;
#endif
typedef struct {
    __Pyx_CachedCodeObjectType* code_object;
    int code_line;
} __Pyx_CodeObjectCacheEntry;
struct __Pyx_CodeObjectCache {
    int count;
    int max_count;
    __Pyx_CodeObjectCacheEntry* entries;
  #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    __pyx_atomic_int_type accessor_count;
  #endif
};
static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
static __Pyx_CachedCodeObjectType *__pyx_find_code_object(int code_line);
static void __pyx_insert_code_object(int code_line, __Pyx_CachedCodeObjectType* 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 && (1) && (!0 || __cplusplus)
    #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

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

/* CheckUnpickleChecksum.proto */
static CYTHON_INLINE int __Pyx_CheckUnpickleChecksum(long checksum, long checksum1, long checksum2, long checksum3, const char *members);

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

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

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

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

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

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

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

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

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

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

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

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

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

/* CIntFromPy.proto */
static CYTHON_INLINE cusparseStatus_t __Pyx_PyLong_As_cusparseStatus_t(PyObject *);

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

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

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

/* CIntFromPy.proto */
static CYTHON_INLINE cusparseSpSMAlg_t __Pyx_PyLong_As_cusparseSpSMAlg_t(PyObject *);

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

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

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

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

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_cusparseStatus_t(cusparseStatus_t value);

/* CIntFromPy.proto */
static CYTHON_INLINE cusparseMatrixType_t __Pyx_PyLong_As_cusparseMatrixType_t(PyObject *);

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

/* PyObjectCallMethod1.proto */
static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg);

/* UpdateUnpickledDict.proto */
static int __Pyx_UpdateUnpickledDict(PyObject *obj, PyObject *state, Py_ssize_t index);

/* FormatTypeName.proto */
#if CYTHON_COMPILING_IN_LIMITED_API
typedef PyObject *__Pyx_TypeName;
#define __Pyx_FMT_TYPENAME "%U"
#define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj)
#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
#define __Pyx_PyType_GetFullyQualifiedName PyType_GetFullyQualifiedName
#else
static __Pyx_TypeName __Pyx_PyType_GetFullyQualifiedName(PyTypeObject* tp);
#endif
#else  // !LIMITED_API
typedef const char *__Pyx_TypeName;
#define __Pyx_FMT_TYPENAME "%.200s"
#define __Pyx_PyType_GetFullyQualifiedName(tp) ((tp)->tp_name)
#define __Pyx_DECREF_TypeName(obj)
#endif

/* FastTypeChecks.proto */
#if CYTHON_COMPILING_IN_CPYTHON
#define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
#define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2)
static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b);
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
#else
#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
#define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2))
#define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2) {
    return PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2);
}
#endif
#define __Pyx_PyErr_ExceptionMatches2(err1, err2)  __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2)
#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
#ifdef PyExceptionInstance_Check
  #define __Pyx_PyBaseException_Check(obj) PyExceptionInstance_Check(obj)
#else
  #define __Pyx_PyBaseException_Check(obj) __Pyx_TypeCheck(obj, PyExc_BaseException)
#endif

/* GetRuntimeVersion.proto */
#if __PYX_LIMITED_VERSION_HEX < 0x030b0000
static unsigned long __Pyx_cached_runtime_version = 0;
static void __Pyx_init_runtime_version(void);
#else
#define __Pyx_init_runtime_version()
#endif
static unsigned long __Pyx_get_runtime_version(void);

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

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

/* DecompressString.proto */
static PyObject *__Pyx_DecompressString(const char *s, Py_ssize_t length, int algo);

/* MultiPhaseInitModuleState.proto */
#if CYTHON_PEP489_MULTI_PHASE_INIT && CYTHON_USE_MODULE_STATE
static PyObject *__Pyx_State_FindModule(void*);
static int __Pyx_State_AddModule(PyObject* module, void*);
static int __Pyx_State_RemoveModule(void*);
#elif CYTHON_USE_MODULE_STATE
#define __Pyx_State_FindModule PyState_FindModule
#define __Pyx_State_AddModule PyState_AddModule
#define __Pyx_State_RemoveModule PyState_RemoveModule
#endif

/* #### Code section: module_declarations ### */
/* CythonABIVersion.proto */
#if CYTHON_COMPILING_IN_LIMITED_API
    #if CYTHON_METH_FASTCALL
        #define __PYX_FASTCALL_ABI_SUFFIX  "_fastcall"
    #else
        #define __PYX_FASTCALL_ABI_SUFFIX
    #endif
    #define __PYX_LIMITED_ABI_SUFFIX "limited" __PYX_FASTCALL_ABI_SUFFIX __PYX_AM_SEND_ABI_SUFFIX
#else
    #define __PYX_LIMITED_ABI_SUFFIX
#endif
#if __PYX_HAS_PY_AM_SEND == 1
    #define __PYX_AM_SEND_ABI_SUFFIX
#elif __PYX_HAS_PY_AM_SEND == 2
    #define __PYX_AM_SEND_ABI_SUFFIX "amsendbackport"
#else
    #define __PYX_AM_SEND_ABI_SUFFIX "noamsend"
#endif
#ifndef __PYX_MONITORING_ABI_SUFFIX
    #define __PYX_MONITORING_ABI_SUFFIX
#endif
#if CYTHON_USE_TP_FINALIZE
    #define __PYX_TP_FINALIZE_ABI_SUFFIX
#else
    #define __PYX_TP_FINALIZE_ABI_SUFFIX "nofinalize"
#endif
#if CYTHON_USE_FREELISTS || !defined(__Pyx_AsyncGen_USED)
    #define __PYX_FREELISTS_ABI_SUFFIX
#else
    #define __PYX_FREELISTS_ABI_SUFFIX "nofreelists"
#endif
#define CYTHON_ABI  __PYX_ABI_VERSION __PYX_LIMITED_ABI_SUFFIX __PYX_MONITORING_ABI_SUFFIX __PYX_TP_FINALIZE_ABI_SUFFIX __PYX_FREELISTS_ABI_SUFFIX __PYX_AM_SEND_ABI_SUFFIX
#define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI
#define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "."


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

/* Module declarations from "cython" */

/* Module declarations from "cupy_backends.cuda.api" */

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

/* Module declarations from "cupy_backends.cuda.api._driver_enum" */

/* Module declarations from "cupy_backends.cuda.api.driver" */

/* Module declarations from "cupy_backends.cuda.api._runtime_enum" */

/* Module declarations from "cupy_backends.cuda.api.runtime" */
static int *__pyx_vp_13cupy_backends_4cuda_3api_7runtime_errorMemoryAllocation = 0;
#define __pyx_v_13cupy_backends_4cuda_3api_7runtime_errorMemoryAllocation (*__pyx_vp_13cupy_backends_4cuda_3api_7runtime_errorMemoryAllocation)
static int *__pyx_vp_13cupy_backends_4cuda_3api_7runtime_errorInvalidValue = 0;
#define __pyx_v_13cupy_backends_4cuda_3api_7runtime_errorInvalidValue (*__pyx_vp_13cupy_backends_4cuda_3api_7runtime_errorInvalidValue)
static int *__pyx_vp_13cupy_backends_4cuda_3api_7runtime_errorPeerAccessAlreadyEnabled = 0;
#define __pyx_v_13cupy_backends_4cuda_3api_7runtime_errorPeerAccessAlreadyEnabled (*__pyx_vp_13cupy_backends_4cuda_3api_7runtime_errorPeerAccessAlreadyEnabled)
static int *__pyx_vp_13cupy_backends_4cuda_3api_7runtime_errorContextIsDestroyed = 0;
#define __pyx_v_13cupy_backends_4cuda_3api_7runtime_errorContextIsDestroyed (*__pyx_vp_13cupy_backends_4cuda_3api_7runtime_errorContextIsDestroyed)
static int *__pyx_vp_13cupy_backends_4cuda_3api_7runtime_errorInvalidResourceHandle = 0;
#define __pyx_v_13cupy_backends_4cuda_3api_7runtime_errorInvalidResourceHandle (*__pyx_vp_13cupy_backends_4cuda_3api_7runtime_errorInvalidResourceHandle)
static int *__pyx_vp_13cupy_backends_4cuda_3api_7runtime_deviceAttributeComputeCapabilityMajor = 0;
#define __pyx_v_13cupy_backends_4cuda_3api_7runtime_deviceAttributeComputeCapabilityMajor (*__pyx_vp_13cupy_backends_4cuda_3api_7runtime_deviceAttributeComputeCapabilityMajor)
static int *__pyx_vp_13cupy_backends_4cuda_3api_7runtime_deviceAttributeComputeCapabilityMinor = 0;
#define __pyx_v_13cupy_backends_4cuda_3api_7runtime_deviceAttributeComputeCapabilityMinor (*__pyx_vp_13cupy_backends_4cuda_3api_7runtime_deviceAttributeComputeCapabilityMinor)
static int *__pyx_vp_13cupy_backends_4cuda_3api_7runtime__is_hip_environment = 0;
#define __pyx_v_13cupy_backends_4cuda_3api_7runtime__is_hip_environment (*__pyx_vp_13cupy_backends_4cuda_3api_7runtime__is_hip_environment)
static int (*__pyx_f_13cupy_backends_4cuda_3api_7runtime_streamIsCapturing)(intptr_t, int __pyx_skip_dispatch); /*proto*/

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

/* Module declarations from "cupy_backends.cuda.stream" */
static intptr_t (*__pyx_f_13cupy_backends_4cuda_6stream_get_current_stream_ptr)(void); /*proto*/

/* Module declarations from "cupy_backends.cuda._softlink" */

/* Module declarations from "cupy_backends.cuda.libs.cusparse" */
static PyObject *__pyx_v_13cupy_backends_4cuda_4libs_8cusparse__libname = 0;
static PyObject *__pyx_v_13cupy_backends_4cuda_4libs_8cusparse__handle = 0;
static struct __pyx_obj_13cupy_backends_4cuda_9_softlink_SoftLink *__pyx_v_13cupy_backends_4cuda_4libs_8cusparse__lib = 0;
static __pyx_t_13cupy_backends_4cuda_4libs_8cusparse_f_type __pyx_v_13cupy_backends_4cuda_4libs_8cusparse_cusparseSpSM_createDescr;
static __pyx_t_13cupy_backends_4cuda_4libs_8cusparse_f_type __pyx_v_13cupy_backends_4cuda_4libs_8cusparse_cusparseSpSM_destroyDescr;
static __pyx_t_13cupy_backends_4cuda_4libs_8cusparse_f_type __pyx_v_13cupy_backends_4cuda_4libs_8cusparse_cusparseSpSM_bufferSize;
static __pyx_t_13cupy_backends_4cuda_4libs_8cusparse_f_type __pyx_v_13cupy_backends_4cuda_4libs_8cusparse_cusparseSpSM_analysis;
static __pyx_t_13cupy_backends_4cuda_4libs_8cusparse_f_type __pyx_v_13cupy_backends_4cuda_4libs_8cusparse_cusparseSpSM_solve;
static __pyx_t_13cupy_backends_4cuda_4libs_8cusparse_f_type __pyx_v_13cupy_backends_4cuda_4libs_8cusparse_cusparseSpMatSetAttribute;
static __pyx_t_13cupy_backends_4cuda_4libs_8cusparse_f_type __pyx_v_13cupy_backends_4cuda_4libs_8cusparse_cusparseCreateCsc;
static __pyx_t_13cupy_backends_4cuda_4libs_8cusparse_f_type __pyx_v_13cupy_backends_4cuda_4libs_8cusparse_cusparseSparseToDense_bufferSize;
static __pyx_t_13cupy_backends_4cuda_4libs_8cusparse_f_type __pyx_v_13cupy_backends_4cuda_4libs_8cusparse_cusparseSparseToDense;
static __pyx_t_13cupy_backends_4cuda_4libs_8cusparse_f_type __pyx_v_13cupy_backends_4cuda_4libs_8cusparse_cusparseDenseToSparse_bufferSize;
static __pyx_t_13cupy_backends_4cuda_4libs_8cusparse_f_type __pyx_v_13cupy_backends_4cuda_4libs_8cusparse_cusparseDenseToSparse_analysis;
static __pyx_t_13cupy_backends_4cuda_4libs_8cusparse_f_type __pyx_v_13cupy_backends_4cuda_4libs_8cusparse_cusparseDenseToSparse_convert;
static __pyx_t_13cupy_backends_4cuda_4libs_8cusparse_f_type __pyx_v_13cupy_backends_4cuda_4libs_8cusparse_cusparseSpGEAM_createDescr;
static __pyx_t_13cupy_backends_4cuda_4libs_8cusparse_f_type __pyx_v_13cupy_backends_4cuda_4libs_8cusparse_cusparseSpGEAM_destroyDescr;
static __pyx_t_13cupy_backends_4cuda_4libs_8cusparse_f_type __pyx_v_13cupy_backends_4cuda_4libs_8cusparse_cusparseSpGEAM_bufferSize;
static __pyx_t_13cupy_backends_4cuda_4libs_8cusparse_f_type __pyx_v_13cupy_backends_4cuda_4libs_8cusparse_cusparseSpGEAM_nnz;
static __pyx_t_13cupy_backends_4cuda_4libs_8cusparse_f_type __pyx_v_13cupy_backends_4cuda_4libs_8cusparse_cusparseSpGEAM_fn;
static PyObject *__pyx_v_13cupy_backends_4cuda_4libs_8cusparse_HIP_STATUS = 0;
static intptr_t __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_create(int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_destroy(intptr_t, int __pyx_skip_dispatch); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(int, int __pyx_skip_dispatch); /*proto*/
static CYTHON_INLINE cuComplex __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_complex_to_cuda(__pyx_t_double_complex); /*proto*/
static CYTHON_INLINE cuDoubleComplex __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_double_complex_to_cuda(__pyx_t_double_complex); /*proto*/
static int __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_getVersion(intptr_t, int __pyx_skip_dispatch); /*proto*/
static size_t __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_createMatDescr(int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_destroyMatDescr(size_t, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_setMatIndexBase(size_t, PyObject *, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_setMatType(size_t, PyObject *, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_setMatFillMode(size_t, int, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_setMatDiagType(size_t, int, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_setPointerMode(intptr_t, int, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_spMatSetAttribute(size_t, int, int, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_setStream(intptr_t, size_t, int __pyx_skip_dispatch); /*proto*/
static size_t __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_getStream(intptr_t, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(intptr_t); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_sgthr(intptr_t, int, size_t, size_t, size_t, int, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_dgthr(intptr_t, int, size_t, size_t, size_t, int, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_cgthr(intptr_t, int, size_t, size_t, size_t, int, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_zgthr(intptr_t, int, size_t, size_t, size_t, int, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_scsrmv(intptr_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 void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_dcsrmv(intptr_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 void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_ccsrmv(intptr_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 void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_zcsrmv(intptr_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_13cupy_backends_4cuda_4libs_8cusparse_csrmvEx_bufferSize(intptr_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 void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_csrmvEx(intptr_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 size_t __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_createCsrsv2Info(int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_destroyCsrsv2Info(size_t, int __pyx_skip_dispatch); /*proto*/
static int __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_scsrsv2_bufferSize(intptr_t, int, int, int, size_t, size_t, size_t, size_t, size_t, int __pyx_skip_dispatch); /*proto*/
static int __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_dcsrsv2_bufferSize(intptr_t, int, int, int, size_t, size_t, size_t, size_t, size_t, int __pyx_skip_dispatch); /*proto*/
static int __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_ccsrsv2_bufferSize(intptr_t, int, int, int, size_t, size_t, size_t, size_t, size_t, int __pyx_skip_dispatch); /*proto*/
static int __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_zcsrsv2_bufferSize(intptr_t, int, int, int, size_t, size_t, size_t, size_t, size_t, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_scsrsv2_analysis(intptr_t, int, int, int, size_t, size_t, size_t, size_t, size_t, int, size_t, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_dcsrsv2_analysis(intptr_t, int, int, int, size_t, size_t, size_t, size_t, size_t, int, size_t, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_ccsrsv2_analysis(intptr_t, int, int, int, size_t, size_t, size_t, size_t, size_t, int, size_t, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_zcsrsv2_analysis(intptr_t, int, int, int, size_t, size_t, size_t, size_t, size_t, int, size_t, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_scsrsv2_solve(intptr_t, int, int, int, size_t, size_t, size_t, size_t, size_t, size_t, size_t, size_t, int, size_t, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_dcsrsv2_solve(intptr_t, int, int, int, size_t, size_t, size_t, size_t, size_t, size_t, size_t, size_t, int, size_t, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_ccsrsv2_solve(intptr_t, int, int, int, size_t, size_t, size_t, size_t, size_t, size_t, size_t, size_t, int, size_t, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_zcsrsv2_solve(intptr_t, int, int, int, size_t, size_t, size_t, size_t, size_t, size_t, size_t, size_t, int, size_t, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_xcsrsv2_zeroPivot(intptr_t, size_t, size_t, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_scsrmm(intptr_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 void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_dcsrmm(intptr_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 void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_ccsrmm(intptr_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 void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_zcsrmm(intptr_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 void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_scsrmm2(intptr_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 void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_dcsrmm2(intptr_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 void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_ccsrmm2(intptr_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 void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_zcsrmm2(intptr_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 size_t __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_createCsrsm2Info(int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_destroyCsrsm2Info(size_t, int __pyx_skip_dispatch); /*proto*/
static size_t __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_scsrsm2_bufferSizeExt(intptr_t, int, int, int, int, int, int, size_t, size_t, size_t, size_t, size_t, size_t, int, size_t, int, int __pyx_skip_dispatch); /*proto*/
static size_t __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_dcsrsm2_bufferSizeExt(intptr_t, int, int, int, int, int, int, size_t, size_t, size_t, size_t, size_t, size_t, int, size_t, int, int __pyx_skip_dispatch); /*proto*/
static size_t __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_ccsrsm2_bufferSizeExt(intptr_t, int, int, int, int, int, int, size_t, size_t, size_t, size_t, size_t, size_t, int, size_t, int, int __pyx_skip_dispatch); /*proto*/
static size_t __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_zcsrsm2_bufferSizeExt(intptr_t, int, int, int, int, int, int, size_t, size_t, size_t, size_t, size_t, size_t, int, size_t, int, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_scsrsm2_analysis(intptr_t, int, int, int, int, int, int, size_t, size_t, size_t, size_t, size_t, size_t, int, size_t, int, size_t, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_dcsrsm2_analysis(intptr_t, int, int, int, int, int, int, size_t, size_t, size_t, size_t, size_t, size_t, int, size_t, int, size_t, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_ccsrsm2_analysis(intptr_t, int, int, int, int, int, int, size_t, size_t, size_t, size_t, size_t, size_t, int, size_t, int, size_t, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_zcsrsm2_analysis(intptr_t, int, int, int, int, int, int, size_t, size_t, size_t, size_t, size_t, size_t, int, size_t, int, size_t, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_scsrsm2_solve(intptr_t, int, int, int, int, int, int, size_t, size_t, size_t, size_t, size_t, size_t, int, size_t, int, size_t, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_dcsrsm2_solve(intptr_t, int, int, int, int, int, int, size_t, size_t, size_t, size_t, size_t, size_t, int, size_t, int, size_t, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_ccsrsm2_solve(intptr_t, int, int, int, int, int, int, size_t, size_t, size_t, size_t, size_t, size_t, int, size_t, int, size_t, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_zcsrsm2_solve(intptr_t, int, int, int, int, int, int, size_t, size_t, size_t, size_t, size_t, size_t, int, size_t, int, size_t, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_xcsrsm2_zeroPivot(intptr_t, size_t, size_t, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_xcsrgeamNnz(intptr_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 void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_scsrgeam(intptr_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 void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_dcsrgeam(intptr_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 void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_ccsrgeam(intptr_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 void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_zcsrgeam(intptr_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_13cupy_backends_4cuda_4libs_8cusparse_scsrgeam2_bufferSizeExt(intptr_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_13cupy_backends_4cuda_4libs_8cusparse_dcsrgeam2_bufferSizeExt(intptr_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_13cupy_backends_4cuda_4libs_8cusparse_ccsrgeam2_bufferSizeExt(intptr_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_13cupy_backends_4cuda_4libs_8cusparse_zcsrgeam2_bufferSizeExt(intptr_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 void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_xcsrgeam2Nnz(intptr_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 void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_scsrgeam2(intptr_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 void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_dcsrgeam2(intptr_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 void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_ccsrgeam2(intptr_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 void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_zcsrgeam2(intptr_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 void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_xcsrgemmNnz(intptr_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 void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_scsrgemm(intptr_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 void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_dcsrgemm(intptr_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 void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_ccsrgemm(intptr_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 void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_zcsrgemm(intptr_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_13cupy_backends_4cuda_4libs_8cusparse_createCsrgemm2Info(int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_destroyCsrgemm2Info(size_t, int __pyx_skip_dispatch); /*proto*/
static size_t __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_scsrgemm2_bufferSizeExt(intptr_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_13cupy_backends_4cuda_4libs_8cusparse_dcsrgemm2_bufferSizeExt(intptr_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_13cupy_backends_4cuda_4libs_8cusparse_ccsrgemm2_bufferSizeExt(intptr_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_13cupy_backends_4cuda_4libs_8cusparse_zcsrgemm2_bufferSizeExt(intptr_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 void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_xcsrgemm2Nnz(intptr_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, intptr_t, size_t, intptr_t, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_scsrgemm2(intptr_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, intptr_t, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_dcsrgemm2(intptr_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, intptr_t, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_ccsrgemm2(intptr_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, intptr_t, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_zcsrgemm2(intptr_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, intptr_t, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_xcoo2csr(intptr_t, size_t, int, int, size_t, int, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_scsc2dense(intptr_t, int, int, size_t, size_t, size_t, size_t, size_t, int, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_dcsc2dense(intptr_t, int, int, size_t, size_t, size_t, size_t, size_t, int, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_ccsc2dense(intptr_t, int, int, size_t, size_t, size_t, size_t, size_t, int, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_zcsc2dense(intptr_t, int, int, size_t, size_t, size_t, size_t, size_t, int, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_xcsr2coo(intptr_t, size_t, int, int, size_t, int, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_scsr2csc(intptr_t, int, int, int, size_t, size_t, size_t, size_t, size_t, size_t, int, int, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_dcsr2csc(intptr_t, int, int, int, size_t, size_t, size_t, size_t, size_t, size_t, int, int, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_ccsr2csc(intptr_t, int, int, int, size_t, size_t, size_t, size_t, size_t, size_t, int, int, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_zcsr2csc(intptr_t, int, int, int, size_t, size_t, size_t, size_t, size_t, size_t, int, int, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_scsr2dense(intptr_t, int, int, size_t, size_t, size_t, size_t, size_t, int, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_dcsr2dense(intptr_t, int, int, size_t, size_t, size_t, size_t, size_t, int, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_ccsr2dense(intptr_t, int, int, size_t, size_t, size_t, size_t, size_t, int, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_zcsr2dense(intptr_t, int, int, size_t, size_t, size_t, size_t, size_t, int, int __pyx_skip_dispatch); /*proto*/
static int __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_snnz_compress(intptr_t, int, size_t, size_t, size_t, size_t, float, int __pyx_skip_dispatch); /*proto*/
static int __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_dnnz_compress(intptr_t, int, size_t, size_t, size_t, size_t, double, int __pyx_skip_dispatch); /*proto*/
static int __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_cnnz_compress(intptr_t, int, size_t, size_t, size_t, size_t, __pyx_t_double_complex, int __pyx_skip_dispatch); /*proto*/
static int __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_znnz_compress(intptr_t, int, size_t, size_t, size_t, size_t, __pyx_t_double_complex, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_scsr2csr_compress(intptr_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 void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_dcsr2csr_compress(intptr_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 void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_ccsr2csr_compress(intptr_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 void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_zcsr2csr_compress(intptr_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 void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_sdense2csc(intptr_t, int, int, size_t, size_t, int, size_t, size_t, size_t, size_t, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_ddense2csc(intptr_t, int, int, size_t, size_t, int, size_t, size_t, size_t, size_t, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_cdense2csc(intptr_t, int, int, size_t, size_t, int, size_t, size_t, size_t, size_t, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_zdense2csc(intptr_t, int, int, size_t, size_t, int, size_t, size_t, size_t, size_t, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_sdense2csr(intptr_t, int, int, size_t, size_t, int, size_t, size_t, size_t, size_t, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_ddense2csr(intptr_t, int, int, size_t, size_t, int, size_t, size_t, size_t, size_t, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_cdense2csr(intptr_t, int, int, size_t, size_t, int, size_t, size_t, size_t, size_t, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_zdense2csr(intptr_t, int, int, size_t, size_t, int, size_t, size_t, size_t, size_t, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_snnz(intptr_t, int, int, int, size_t, size_t, int, size_t, size_t, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_dnnz(intptr_t, int, int, int, size_t, size_t, int, size_t, size_t, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_cnnz(intptr_t, int, int, int, size_t, size_t, int, size_t, size_t, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_znnz(intptr_t, int, int, int, size_t, size_t, int, size_t, size_t, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_createIdentityPermutation(intptr_t, int, size_t, int __pyx_skip_dispatch); /*proto*/
static size_t __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_xcoosort_bufferSizeExt(intptr_t, int, int, int, size_t, size_t, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_xcoosortByRow(intptr_t, int, int, int, size_t, size_t, size_t, size_t, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_xcoosortByColumn(intptr_t, int, int, int, size_t, size_t, size_t, size_t, int __pyx_skip_dispatch); /*proto*/
static size_t __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_xcsrsort_bufferSizeExt(intptr_t, int, int, int, size_t, size_t, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_xcsrsort(intptr_t, int, int, int, size_t, size_t, size_t, size_t, size_t, int __pyx_skip_dispatch); /*proto*/
static size_t __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_xcscsort_bufferSizeExt(intptr_t, int, int, int, size_t, size_t, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_xcscsort(intptr_t, int, int, int, size_t, size_t, size_t, size_t, size_t, int __pyx_skip_dispatch); /*proto*/
static size_t __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_createCsrilu02Info(int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_destroyCsrilu02Info(size_t, int __pyx_skip_dispatch); /*proto*/
static size_t __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_createBsrilu02Info(int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_destroyBsrilu02Info(size_t, int __pyx_skip_dispatch); /*proto*/
static size_t __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_createCsric02Info(int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_destroyCsric02Info(size_t, int __pyx_skip_dispatch); /*proto*/
static size_t __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_createBsric02Info(int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_destroyBsric02Info(size_t, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_scsrilu02_numericBoost(intptr_t, size_t, int, size_t, size_t, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_dcsrilu02_numericBoost(intptr_t, size_t, int, size_t, size_t, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_ccsrilu02_numericBoost(intptr_t, size_t, int, size_t, size_t, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_zcsrilu02_numericBoost(intptr_t, size_t, int, size_t, size_t, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_xcsrilu02_zeroPivot(intptr_t, size_t, size_t, int __pyx_skip_dispatch); /*proto*/
static int __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_scsrilu02_bufferSize(intptr_t, int, int, size_t, size_t, size_t, size_t, size_t, int __pyx_skip_dispatch); /*proto*/
static int __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_dcsrilu02_bufferSize(intptr_t, int, int, size_t, size_t, size_t, size_t, size_t, int __pyx_skip_dispatch); /*proto*/
static int __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_ccsrilu02_bufferSize(intptr_t, int, int, size_t, size_t, size_t, size_t, size_t, int __pyx_skip_dispatch); /*proto*/
static int __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_zcsrilu02_bufferSize(intptr_t, int, int, size_t, size_t, size_t, size_t, size_t, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_scsrilu02_analysis(intptr_t, int, int, size_t, size_t, size_t, size_t, size_t, int, size_t, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_dcsrilu02_analysis(intptr_t, int, int, size_t, size_t, size_t, size_t, size_t, int, size_t, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_ccsrilu02_analysis(intptr_t, int, int, size_t, size_t, size_t, size_t, size_t, int, size_t, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_zcsrilu02_analysis(intptr_t, int, int, size_t, size_t, size_t, size_t, size_t, int, size_t, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_scsrilu02(intptr_t, int, int, size_t, size_t, size_t, size_t, size_t, int, size_t, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_dcsrilu02(intptr_t, int, int, size_t, size_t, size_t, size_t, size_t, int, size_t, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_ccsrilu02(intptr_t, int, int, size_t, size_t, size_t, size_t, size_t, int, size_t, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_zcsrilu02(intptr_t, int, int, size_t, size_t, size_t, size_t, size_t, int, size_t, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_sbsrilu02_numericBoost(intptr_t, size_t, int, size_t, size_t, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_dbsrilu02_numericBoost(intptr_t, size_t, int, size_t, size_t, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_cbsrilu02_numericBoost(intptr_t, size_t, int, size_t, size_t, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_zbsrilu02_numericBoost(intptr_t, size_t, int, size_t, size_t, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_xbsrilu02_zeroPivot(intptr_t, size_t, size_t, int __pyx_skip_dispatch); /*proto*/
static int __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_sbsrilu02_bufferSize(intptr_t, int, int, int, size_t, size_t, size_t, size_t, int, size_t, int __pyx_skip_dispatch); /*proto*/
static int __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_dbsrilu02_bufferSize(intptr_t, int, int, int, size_t, size_t, size_t, size_t, int, size_t, int __pyx_skip_dispatch); /*proto*/
static int __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_cbsrilu02_bufferSize(intptr_t, int, int, int, size_t, size_t, size_t, size_t, int, size_t, int __pyx_skip_dispatch); /*proto*/
static int __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_zbsrilu02_bufferSize(intptr_t, int, int, int, size_t, size_t, size_t, size_t, int, size_t, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_sbsrilu02_analysis(intptr_t, int, int, int, size_t, size_t, size_t, size_t, int, size_t, int, size_t, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_dbsrilu02_analysis(intptr_t, int, int, int, size_t, size_t, size_t, size_t, int, size_t, int, size_t, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_cbsrilu02_analysis(intptr_t, int, int, int, size_t, size_t, size_t, size_t, int, size_t, int, size_t, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_zbsrilu02_analysis(intptr_t, int, int, int, size_t, size_t, size_t, size_t, int, size_t, int, size_t, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_sbsrilu02(intptr_t, int, int, int, size_t, size_t, size_t, size_t, int, size_t, int, size_t, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_dbsrilu02(intptr_t, int, int, int, size_t, size_t, size_t, size_t, int, size_t, int, size_t, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_cbsrilu02(intptr_t, int, int, int, size_t, size_t, size_t, size_t, int, size_t, int, size_t, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_zbsrilu02(intptr_t, int, int, int, size_t, size_t, size_t, size_t, int, size_t, int, size_t, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_xcsric02_zeroPivot(intptr_t, size_t, size_t, int __pyx_skip_dispatch); /*proto*/
static int __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_scsric02_bufferSize(intptr_t, int, int, size_t, size_t, size_t, size_t, size_t, int __pyx_skip_dispatch); /*proto*/
static int __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_dcsric02_bufferSize(intptr_t, int, int, size_t, size_t, size_t, size_t, size_t, int __pyx_skip_dispatch); /*proto*/
static int __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_ccsric02_bufferSize(intptr_t, int, int, size_t, size_t, size_t, size_t, size_t, int __pyx_skip_dispatch); /*proto*/
static int __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_zcsric02_bufferSize(intptr_t, int, int, size_t, size_t, size_t, size_t, size_t, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_scsric02_analysis(intptr_t, int, int, size_t, size_t, size_t, size_t, size_t, int, size_t, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_dcsric02_analysis(intptr_t, int, int, size_t, size_t, size_t, size_t, size_t, int, size_t, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_ccsric02_analysis(intptr_t, int, int, size_t, size_t, size_t, size_t, size_t, int, size_t, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_zcsric02_analysis(intptr_t, int, int, size_t, size_t, size_t, size_t, size_t, int, size_t, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_scsric02(intptr_t, int, int, size_t, size_t, size_t, size_t, size_t, int, size_t, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_dcsric02(intptr_t, int, int, size_t, size_t, size_t, size_t, size_t, int, size_t, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_ccsric02(intptr_t, int, int, size_t, size_t, size_t, size_t, size_t, int, size_t, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_zcsric02(intptr_t, int, int, size_t, size_t, size_t, size_t, size_t, int, size_t, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_xbsric02_zeroPivot(intptr_t, size_t, size_t, int __pyx_skip_dispatch); /*proto*/
static int __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_sbsric02_bufferSize(intptr_t, int, int, int, size_t, size_t, size_t, size_t, int, size_t, int __pyx_skip_dispatch); /*proto*/
static int __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_dbsric02_bufferSize(intptr_t, int, int, int, size_t, size_t, size_t, size_t, int, size_t, int __pyx_skip_dispatch); /*proto*/
static int __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_cbsric02_bufferSize(intptr_t, int, int, int, size_t, size_t, size_t, size_t, int, size_t, int __pyx_skip_dispatch); /*proto*/
static int __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_zbsric02_bufferSize(intptr_t, int, int, int, size_t, size_t, size_t, size_t, int, size_t, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_sbsric02_analysis(intptr_t, int, int, int, size_t, size_t, size_t, size_t, int, size_t, int, size_t, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_dbsric02_analysis(intptr_t, int, int, int, size_t, size_t, size_t, size_t, int, size_t, int, size_t, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_cbsric02_analysis(intptr_t, int, int, int, size_t, size_t, size_t, size_t, int, size_t, int, size_t, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_zbsric02_analysis(intptr_t, int, int, int, size_t, size_t, size_t, size_t, int, size_t, int, size_t, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_sbsric02(intptr_t, int, int, int, size_t, size_t, size_t, size_t, int, size_t, int, size_t, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_dbsric02(intptr_t, int, int, int, size_t, size_t, size_t, size_t, int, size_t, int, size_t, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_cbsric02(intptr_t, int, int, int, size_t, size_t, size_t, size_t, int, size_t, int, size_t, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_zbsric02(intptr_t, int, int, int, size_t, size_t, size_t, size_t, int, size_t, int, size_t, int __pyx_skip_dispatch); /*proto*/
static size_t __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_sgtsv2_bufferSizeExt(intptr_t, int, int, size_t, size_t, size_t, size_t, int, int __pyx_skip_dispatch); /*proto*/
static size_t __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_dgtsv2_bufferSizeExt(intptr_t, int, int, size_t, size_t, size_t, size_t, int, int __pyx_skip_dispatch); /*proto*/
static size_t __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_cgtsv2_bufferSizeExt(intptr_t, int, int, size_t, size_t, size_t, size_t, int, int __pyx_skip_dispatch); /*proto*/
static size_t __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_zgtsv2_bufferSizeExt(intptr_t, int, int, size_t, size_t, size_t, size_t, int, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_sgtsv2(intptr_t, int, int, size_t, size_t, size_t, size_t, int, size_t, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_dgtsv2(intptr_t, int, int, size_t, size_t, size_t, size_t, int, size_t, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_cgtsv2(intptr_t, int, int, size_t, size_t, size_t, size_t, int, size_t, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_zgtsv2(intptr_t, int, int, size_t, size_t, size_t, size_t, int, size_t, int __pyx_skip_dispatch); /*proto*/
static size_t __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_sgtsv2_nopivot_bufferSizeExt(intptr_t, int, int, size_t, size_t, size_t, size_t, int, int __pyx_skip_dispatch); /*proto*/
static size_t __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_dgtsv2_nopivot_bufferSizeExt(intptr_t, int, int, size_t, size_t, size_t, size_t, int, int __pyx_skip_dispatch); /*proto*/
static size_t __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_cgtsv2_nopivot_bufferSizeExt(intptr_t, int, int, size_t, size_t, size_t, size_t, int, int __pyx_skip_dispatch); /*proto*/
static size_t __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_zgtsv2_nopivot_bufferSizeExt(intptr_t, int, int, size_t, size_t, size_t, size_t, int, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_sgtsv2_nopivot(intptr_t, int, int, size_t, size_t, size_t, size_t, int, size_t, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_dgtsv2_nopivot(intptr_t, int, int, size_t, size_t, size_t, size_t, int, size_t, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_cgtsv2_nopivot(intptr_t, int, int, size_t, size_t, size_t, size_t, int, size_t, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_zgtsv2_nopivot(intptr_t, int, int, size_t, size_t, size_t, size_t, int, size_t, int __pyx_skip_dispatch); /*proto*/
static size_t __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_sgtsv2StridedBatch_bufferSizeExt(intptr_t, int, size_t, size_t, size_t, size_t, int, int, int __pyx_skip_dispatch); /*proto*/
static size_t __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_dgtsv2StridedBatch_bufferSizeExt(intptr_t, int, size_t, size_t, size_t, size_t, int, int, int __pyx_skip_dispatch); /*proto*/
static size_t __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_cgtsv2StridedBatch_bufferSizeExt(intptr_t, int, size_t, size_t, size_t, size_t, int, int, int __pyx_skip_dispatch); /*proto*/
static size_t __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_zgtsv2StridedBatch_bufferSizeExt(intptr_t, int, size_t, size_t, size_t, size_t, int, int, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_sgtsv2StridedBatch(intptr_t, int, size_t, size_t, size_t, size_t, int, int, size_t, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_dgtsv2StridedBatch(intptr_t, int, size_t, size_t, size_t, size_t, int, int, size_t, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_cgtsv2StridedBatch(intptr_t, int, size_t, size_t, size_t, size_t, int, int, size_t, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_zgtsv2StridedBatch(intptr_t, int, size_t, size_t, size_t, size_t, int, int, size_t, int __pyx_skip_dispatch); /*proto*/
static size_t __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_sgtsvInterleavedBatch_bufferSizeExt(intptr_t, int, int, size_t, size_t, size_t, size_t, int, int __pyx_skip_dispatch); /*proto*/
static size_t __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_dgtsvInterleavedBatch_bufferSizeExt(intptr_t, int, int, size_t, size_t, size_t, size_t, int, int __pyx_skip_dispatch); /*proto*/
static size_t __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_cgtsvInterleavedBatch_bufferSizeExt(intptr_t, int, int, size_t, size_t, size_t, size_t, int, int __pyx_skip_dispatch); /*proto*/
static size_t __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_zgtsvInterleavedBatch_bufferSizeExt(intptr_t, int, int, size_t, size_t, size_t, size_t, int, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_sgtsvInterleavedBatch(intptr_t, int, int, size_t, size_t, size_t, size_t, int, size_t, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_dgtsvInterleavedBatch(intptr_t, int, int, size_t, size_t, size_t, size_t, int, size_t, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_cgtsvInterleavedBatch(intptr_t, int, int, size_t, size_t, size_t, size_t, int, size_t, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_zgtsvInterleavedBatch(intptr_t, int, int, size_t, size_t, size_t, size_t, int, size_t, int __pyx_skip_dispatch); /*proto*/
static size_t __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_sgpsvInterleavedBatch_bufferSizeExt(intptr_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_13cupy_backends_4cuda_4libs_8cusparse_dgpsvInterleavedBatch_bufferSizeExt(intptr_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_13cupy_backends_4cuda_4libs_8cusparse_cgpsvInterleavedBatch_bufferSizeExt(intptr_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_13cupy_backends_4cuda_4libs_8cusparse_zgpsvInterleavedBatch_bufferSizeExt(intptr_t, int, int, size_t, size_t, size_t, size_t, size_t, size_t, int, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_sgpsvInterleavedBatch(intptr_t, int, int, size_t, size_t, size_t, size_t, size_t, size_t, int, size_t, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_dgpsvInterleavedBatch(intptr_t, int, int, size_t, size_t, size_t, size_t, size_t, size_t, int, size_t, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_cgpsvInterleavedBatch(intptr_t, int, int, size_t, size_t, size_t, size_t, size_t, size_t, int, size_t, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_zgpsvInterleavedBatch(intptr_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_13cupy_backends_4cuda_4libs_8cusparse_createSpVec(int64_t, int64_t, intptr_t, intptr_t, cusparseIndexType_t, cusparseIndexBase_t, cudaDataType, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_destroySpVec(size_t, int __pyx_skip_dispatch); /*proto*/
static struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_SpVecAttributes *__pyx_f_13cupy_backends_4cuda_4libs_8cusparse_spVecGet(size_t, int __pyx_skip_dispatch); /*proto*/
static int __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_spVecGetIndexBase(size_t, int __pyx_skip_dispatch); /*proto*/
static intptr_t __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_spVecGetValues(size_t, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_spVecSetValues(size_t, intptr_t, int __pyx_skip_dispatch); /*proto*/
static size_t __pyx_f_13cupy_backends_4cuda_4libs_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_13cupy_backends_4cuda_4libs_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_13cupy_backends_4cuda_4libs_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 size_t __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_createCsc(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 void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_destroySpMat(size_t, int __pyx_skip_dispatch); /*proto*/
static struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CooAttributes *__pyx_f_13cupy_backends_4cuda_4libs_8cusparse_cooGet(size_t, int __pyx_skip_dispatch); /*proto*/
static struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CooAoSAttributes *__pyx_f_13cupy_backends_4cuda_4libs_8cusparse_cooAoSGet(size_t, int __pyx_skip_dispatch); /*proto*/
static struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CsrAttributes *__pyx_f_13cupy_backends_4cuda_4libs_8cusparse_csrGet(size_t, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_csrSetPointers(size_t, size_t, size_t, size_t, int __pyx_skip_dispatch); /*proto*/
static int __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_spMatGetFormat(size_t, int __pyx_skip_dispatch); /*proto*/
static int __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_spMatGetIndexBase(size_t, int __pyx_skip_dispatch); /*proto*/
static intptr_t __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_spMatGetValues(size_t, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_spMatSetValues(size_t, intptr_t, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_spMatGetSize(size_t, size_t, size_t, size_t, int __pyx_skip_dispatch); /*proto*/
static int __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_spMatGetStridedBatch(size_t, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_spMatSetStridedBatch(size_t, int, int __pyx_skip_dispatch); /*proto*/
static size_t __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_createDnVec(int64_t, intptr_t, cudaDataType, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_destroyDnVec(size_t, int __pyx_skip_dispatch); /*proto*/
static struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_DnVecAttributes *__pyx_f_13cupy_backends_4cuda_4libs_8cusparse_dnVecGet(size_t, int __pyx_skip_dispatch); /*proto*/
static intptr_t __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_dnVecGetValues(size_t, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_dnVecSetValues(size_t, intptr_t, int __pyx_skip_dispatch); /*proto*/
static size_t __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_createDnMat(int64_t, int64_t, int64_t, intptr_t, cudaDataType, cusparseOrder_t, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_destroyDnMat(size_t, int __pyx_skip_dispatch); /*proto*/
static struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_DnMatAttributes *__pyx_f_13cupy_backends_4cuda_4libs_8cusparse_dnMatGet(size_t, int __pyx_skip_dispatch); /*proto*/
static intptr_t __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_dnMatGetValues(size_t, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_dnMatSetValues(size_t, intptr_t, int __pyx_skip_dispatch); /*proto*/
static struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_DnMatBatchAttributes *__pyx_f_13cupy_backends_4cuda_4libs_8cusparse_dnMatGetStridedBatch(size_t, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_dnMatSetStridedBatch(size_t, int, int64_t, int __pyx_skip_dispatch); /*proto*/
static size_t __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_spVV_bufferSize(intptr_t, cusparseOperation_t, size_t, size_t, intptr_t, cudaDataType, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_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_13cupy_backends_4cuda_4libs_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 void __pyx_f_13cupy_backends_4cuda_4libs_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_13cupy_backends_4cuda_4libs_8cusparse_spSM_createDescr(int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_spSM_destroyDescr(size_t, int __pyx_skip_dispatch); /*proto*/
static size_t __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_spSM_bufferSize(intptr_t, cusparseOperation_t, cusparseOperation_t, intptr_t, size_t, size_t, size_t, cudaDataType, cusparseSpSMAlg_t, size_t, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_spSM_analysis(intptr_t, cusparseOperation_t, cusparseOperation_t, intptr_t, size_t, size_t, size_t, cudaDataType, cusparseSpSMAlg_t, size_t, intptr_t, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_spSM_solve(intptr_t, cusparseOperation_t, cusparseOperation_t, intptr_t, size_t, size_t, size_t, cudaDataType, cusparseSpSMAlg_t, size_t, int __pyx_skip_dispatch, struct __pyx_opt_args_13cupy_backends_4cuda_4libs_8cusparse_spSM_solve *__pyx_optional_args); /*proto*/
static size_t __pyx_f_13cupy_backends_4cuda_4libs_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 void __pyx_f_13cupy_backends_4cuda_4libs_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_13cupy_backends_4cuda_4libs_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 void __pyx_f_13cupy_backends_4cuda_4libs_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_13cupy_backends_4cuda_4libs_8cusparse_spGEMM_createDescr(int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_spGEMM_destroyDescr(size_t, int __pyx_skip_dispatch); /*proto*/
static size_t __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_spGEMM_workEstimation(intptr_t, cusparseOperation_t, cusparseOperation_t, intptr_t, size_t, size_t, intptr_t, size_t, cudaDataType, int, size_t, size_t, intptr_t, int __pyx_skip_dispatch); /*proto*/
static size_t __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_spGEMM_compute(intptr_t, cusparseOperation_t, cusparseOperation_t, intptr_t, size_t, size_t, intptr_t, size_t, cudaDataType, int, size_t, size_t, intptr_t, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_spGEMM_copy(intptr_t, cusparseOperation_t, cusparseOperation_t, intptr_t, size_t, size_t, intptr_t, size_t, cudaDataType, int, size_t, int __pyx_skip_dispatch); /*proto*/
static size_t __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_spGEAM_createDescr(int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_spGEAM_destroyDescr(size_t, int __pyx_skip_dispatch); /*proto*/
static size_t __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_spGEAM_bufferSize(intptr_t, int, int, intptr_t, size_t, intptr_t, size_t, size_t, cudaDataType, int, size_t, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_spGEAM_nnz(intptr_t, int, int, intptr_t, size_t, intptr_t, size_t, size_t, cudaDataType, int, size_t, intptr_t, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_spGEAM(intptr_t, int, int, intptr_t, size_t, intptr_t, size_t, size_t, cudaDataType, int, size_t, intptr_t, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_gather(intptr_t, size_t, size_t, int __pyx_skip_dispatch); /*proto*/
static size_t __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_sparseToDense_bufferSize(intptr_t, size_t, size_t, int, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_sparseToDense(intptr_t, size_t, size_t, int, intptr_t, int __pyx_skip_dispatch); /*proto*/
static size_t __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_denseToSparse_bufferSize(intptr_t, size_t, size_t, int, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_denseToSparse_analysis(intptr_t, size_t, size_t, int, intptr_t, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_denseToSparse_convert(intptr_t, size_t, size_t, int, intptr_t, int __pyx_skip_dispatch); /*proto*/
static size_t __pyx_f_13cupy_backends_4cuda_4libs_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 void __pyx_f_13cupy_backends_4cuda_4libs_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_13cupy_backends_4cuda_4libs_8cusparse___pyx_unpickle_SpVecAttributes__set_state(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_SpVecAttributes *, PyObject *); /*proto*/
static PyObject *__pyx_f_13cupy_backends_4cuda_4libs_8cusparse___pyx_unpickle_CooAttributes__set_state(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CooAttributes *, PyObject *); /*proto*/
static PyObject *__pyx_f_13cupy_backends_4cuda_4libs_8cusparse___pyx_unpickle_CooAoSAttributes__set_state(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CooAoSAttributes *, PyObject *); /*proto*/
static PyObject *__pyx_f_13cupy_backends_4cuda_4libs_8cusparse___pyx_unpickle_CsrAttributes__set_state(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CsrAttributes *, PyObject *); /*proto*/
static PyObject *__pyx_f_13cupy_backends_4cuda_4libs_8cusparse___pyx_unpickle_DnVecAttributes__set_state(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_DnVecAttributes *, PyObject *); /*proto*/
static PyObject *__pyx_f_13cupy_backends_4cuda_4libs_8cusparse___pyx_unpickle_DnMatAttributes__set_state(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_DnMatAttributes *, PyObject *); /*proto*/
static PyObject *__pyx_f_13cupy_backends_4cuda_4libs_8cusparse___pyx_unpickle_DnMatBatchAttributes__set_state(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_DnMatBatchAttributes *, PyObject *); /*proto*/
/* #### Code section: typeinfo ### */
/* #### Code section: before_global_var ### */
#define __Pyx_MODULE_NAME "cupy_backends.cuda.libs.cusparse"
extern int __pyx_module_is_main_cupy_backends__cuda__libs__cusparse;
int __pyx_module_is_main_cupy_backends__cuda__libs__cusparse = 0;

/* Implementation of "cupy_backends.cuda.libs.cusparse" */
/* #### Code section: global_var ### */
static PyObject *__pyx_builtin_super;
/* #### Code section: string_decls ### */
static const char __pyx_k_count_stride[] = "count, stride";
static const char __pyx_k_size_valueType_values[] = "size, valueType, values";
static const char __pyx_k_colIdx_cols_idxBase_idxType_nnz[] = "colIdx, cols, idxBase, idxType, nnz, rowIdx, rows, valueType, values";
static const char __pyx_k_colIdx_colIdxType_cols_idxBase_n[] = "colIdx, colIdxType, cols, idxBase, nnz, rowOffsetType, rowOffsets, rows, valueType, values";
static const char __pyx_k_cols_idxBase_idxType_ind_nnz_row[] = "cols, idxBase, idxType, ind, nnz, rows, valueType, values";
static const char __pyx_k_cols_ld_order_rows_valueType_val[] = "cols, ld, order, rows, valueType, values";
static const char __pyx_k_idx_idxBase_idxType_nnz_size_val[] = "idx, idxBase, idxType, nnz, size, valueType, values";
/* #### Code section: decls ### */
static int __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_15SpVecAttributes___init__(struct __pyx_obj_13cupy_backends_4cuda_4libs_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_13cupy_backends_4cuda_4libs_8cusparse_15SpVecAttributes_4size___get__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_SpVecAttributes *__pyx_v_self); /* proto */
static int __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_15SpVecAttributes_4size_2__set__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_SpVecAttributes *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_15SpVecAttributes_3nnz___get__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_SpVecAttributes *__pyx_v_self); /* proto */
static int __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_15SpVecAttributes_3nnz_2__set__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_SpVecAttributes *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_15SpVecAttributes_3idx___get__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_SpVecAttributes *__pyx_v_self); /* proto */
static int __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_15SpVecAttributes_3idx_2__set__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_SpVecAttributes *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_15SpVecAttributes_6values___get__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_SpVecAttributes *__pyx_v_self); /* proto */
static int __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_15SpVecAttributes_6values_2__set__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_SpVecAttributes *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_15SpVecAttributes_7idxType___get__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_SpVecAttributes *__pyx_v_self); /* proto */
static int __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_15SpVecAttributes_7idxType_2__set__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_SpVecAttributes *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_15SpVecAttributes_7idxBase___get__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_SpVecAttributes *__pyx_v_self); /* proto */
static int __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_15SpVecAttributes_7idxBase_2__set__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_SpVecAttributes *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_15SpVecAttributes_9valueType___get__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_SpVecAttributes *__pyx_v_self); /* proto */
static int __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_15SpVecAttributes_9valueType_2__set__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_SpVecAttributes *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_15SpVecAttributes_2__reduce_cython__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_SpVecAttributes *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_15SpVecAttributes_4__setstate_cython__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_SpVecAttributes *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes___init__(struct __pyx_obj_13cupy_backends_4cuda_4libs_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_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_4rows___get__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CooAttributes *__pyx_v_self); /* proto */
static int __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_4rows_2__set__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CooAttributes *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_4cols___get__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CooAttributes *__pyx_v_self); /* proto */
static int __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_4cols_2__set__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CooAttributes *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_3nnz___get__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CooAttributes *__pyx_v_self); /* proto */
static int __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_3nnz_2__set__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CooAttributes *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_6rowIdx___get__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CooAttributes *__pyx_v_self); /* proto */
static int __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_6rowIdx_2__set__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CooAttributes *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_6colIdx___get__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CooAttributes *__pyx_v_self); /* proto */
static int __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_6colIdx_2__set__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CooAttributes *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_6values___get__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CooAttributes *__pyx_v_self); /* proto */
static int __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_6values_2__set__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CooAttributes *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_7idxType___get__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CooAttributes *__pyx_v_self); /* proto */
static int __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_7idxType_2__set__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CooAttributes *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_7idxBase___get__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CooAttributes *__pyx_v_self); /* proto */
static int __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_7idxBase_2__set__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CooAttributes *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_9valueType___get__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CooAttributes *__pyx_v_self); /* proto */
static int __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_9valueType_2__set__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CooAttributes *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_2__reduce_cython__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CooAttributes *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_4__setstate_cython__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CooAttributes *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes___init__(struct __pyx_obj_13cupy_backends_4cuda_4libs_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_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_4rows___get__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CooAoSAttributes *__pyx_v_self); /* proto */
static int __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_4rows_2__set__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CooAoSAttributes *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_4cols___get__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CooAoSAttributes *__pyx_v_self); /* proto */
static int __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_4cols_2__set__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CooAoSAttributes *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_3nnz___get__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CooAoSAttributes *__pyx_v_self); /* proto */
static int __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_3nnz_2__set__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CooAoSAttributes *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_3ind___get__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CooAoSAttributes *__pyx_v_self); /* proto */
static int __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_3ind_2__set__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CooAoSAttributes *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_6values___get__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CooAoSAttributes *__pyx_v_self); /* proto */
static int __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_6values_2__set__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CooAoSAttributes *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_7idxType___get__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CooAoSAttributes *__pyx_v_self); /* proto */
static int __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_7idxType_2__set__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CooAoSAttributes *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_7idxBase___get__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CooAoSAttributes *__pyx_v_self); /* proto */
static int __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_7idxBase_2__set__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CooAoSAttributes *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_9valueType___get__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CooAoSAttributes *__pyx_v_self); /* proto */
static int __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_9valueType_2__set__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CooAoSAttributes *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_2__reduce_cython__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CooAoSAttributes *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_4__setstate_cython__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CooAoSAttributes *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes___init__(struct __pyx_obj_13cupy_backends_4cuda_4libs_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_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_4rows___get__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CsrAttributes *__pyx_v_self); /* proto */
static int __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_4rows_2__set__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CsrAttributes *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_4cols___get__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CsrAttributes *__pyx_v_self); /* proto */
static int __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_4cols_2__set__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CsrAttributes *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_3nnz___get__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CsrAttributes *__pyx_v_self); /* proto */
static int __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_3nnz_2__set__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CsrAttributes *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_10rowOffsets___get__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CsrAttributes *__pyx_v_self); /* proto */
static int __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_10rowOffsets_2__set__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CsrAttributes *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_6colIdx___get__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CsrAttributes *__pyx_v_self); /* proto */
static int __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_6colIdx_2__set__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CsrAttributes *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_6values___get__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CsrAttributes *__pyx_v_self); /* proto */
static int __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_6values_2__set__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CsrAttributes *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_13rowOffsetType___get__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CsrAttributes *__pyx_v_self); /* proto */
static int __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_13rowOffsetType_2__set__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CsrAttributes *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_10colIdxType___get__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CsrAttributes *__pyx_v_self); /* proto */
static int __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_10colIdxType_2__set__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CsrAttributes *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_7idxBase___get__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CsrAttributes *__pyx_v_self); /* proto */
static int __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_7idxBase_2__set__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CsrAttributes *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_9valueType___get__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CsrAttributes *__pyx_v_self); /* proto */
static int __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_9valueType_2__set__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CsrAttributes *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_2__reduce_cython__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CsrAttributes *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_4__setstate_cython__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CsrAttributes *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_15DnVecAttributes___init__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_DnVecAttributes *__pyx_v_self, int64_t __pyx_v_size, intptr_t __pyx_v_values, cudaDataType __pyx_v_valueType); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_15DnVecAttributes_4size___get__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_DnVecAttributes *__pyx_v_self); /* proto */
static int __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_15DnVecAttributes_4size_2__set__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_DnVecAttributes *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_15DnVecAttributes_6values___get__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_DnVecAttributes *__pyx_v_self); /* proto */
static int __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_15DnVecAttributes_6values_2__set__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_DnVecAttributes *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_15DnVecAttributes_9valueType___get__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_DnVecAttributes *__pyx_v_self); /* proto */
static int __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_15DnVecAttributes_9valueType_2__set__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_DnVecAttributes *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_15DnVecAttributes_2__reduce_cython__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_DnVecAttributes *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_15DnVecAttributes_4__setstate_cython__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_DnVecAttributes *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_15DnMatAttributes___init__(struct __pyx_obj_13cupy_backends_4cuda_4libs_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_13cupy_backends_4cuda_4libs_8cusparse_15DnMatAttributes_4rows___get__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_DnMatAttributes *__pyx_v_self); /* proto */
static int __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_15DnMatAttributes_4rows_2__set__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_DnMatAttributes *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_15DnMatAttributes_4cols___get__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_DnMatAttributes *__pyx_v_self); /* proto */
static int __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_15DnMatAttributes_4cols_2__set__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_DnMatAttributes *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_15DnMatAttributes_2ld___get__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_DnMatAttributes *__pyx_v_self); /* proto */
static int __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_15DnMatAttributes_2ld_2__set__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_DnMatAttributes *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_15DnMatAttributes_6values___get__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_DnMatAttributes *__pyx_v_self); /* proto */
static int __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_15DnMatAttributes_6values_2__set__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_DnMatAttributes *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_15DnMatAttributes_9valueType___get__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_DnMatAttributes *__pyx_v_self); /* proto */
static int __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_15DnMatAttributes_9valueType_2__set__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_DnMatAttributes *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_15DnMatAttributes_5order___get__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_DnMatAttributes *__pyx_v_self); /* proto */
static int __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_15DnMatAttributes_5order_2__set__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_DnMatAttributes *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_15DnMatAttributes_2__reduce_cython__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_DnMatAttributes *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_15DnMatAttributes_4__setstate_cython__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_DnMatAttributes *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_20DnMatBatchAttributes___init__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_DnMatBatchAttributes *__pyx_v_self, int __pyx_v_count, int64_t __pyx_v_stride); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_20DnMatBatchAttributes_5count___get__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_DnMatBatchAttributes *__pyx_v_self); /* proto */
static int __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_20DnMatBatchAttributes_5count_2__set__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_DnMatBatchAttributes *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_20DnMatBatchAttributes_6stride___get__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_DnMatBatchAttributes *__pyx_v_self); /* proto */
static int __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_20DnMatBatchAttributes_6stride_2__set__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_DnMatBatchAttributes *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_20DnMatBatchAttributes_2__reduce_cython__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_DnMatBatchAttributes *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_20DnMatBatchAttributes_4__setstate_cython__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_DnMatBatchAttributes *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_13CuSparseError___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, cusparseStatus_t __pyx_v_status); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_13CuSparseError_2__reduce__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_check_status(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_status); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_2getVersion(CYTHON_UNUSED PyObject *__pyx_self, intptr_t __pyx_v_handle); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_4get_build_version(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_6create(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_8createMatDescr(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_10destroy(CYTHON_UNUSED PyObject *__pyx_self, intptr_t __pyx_v_handle); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_12destroyMatDescr(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_descr); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_14setMatIndexBase(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_descr, PyObject *__pyx_v_base); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_16setMatType(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_descr, PyObject *__pyx_v_typ); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_18setMatFillMode(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_descrA, int __pyx_v_fillMode); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_20setMatDiagType(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_descrA, int __pyx_v_diagType); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_22setPointerMode(CYTHON_UNUSED PyObject *__pyx_self, intptr_t __pyx_v_handle, int __pyx_v_mode); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_24spMatSetAttribute(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_spMatDescr, int __pyx_v_attribute, int __pyx_v_data); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_26setStream(CYTHON_UNUSED PyObject *__pyx_self, intptr_t __pyx_v_handle, size_t __pyx_v_stream); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_28getStream(CYTHON_UNUSED PyObject *__pyx_self, intptr_t __pyx_v_handle); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_30sgthr(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_32dgthr(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_34cgthr(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_36zgthr(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_38scsrmv(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_40dcsrmv(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_42ccsrmv(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_44zcsrmv(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_46csrmvEx_bufferSize(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_48csrmvEx(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_50createCsrsv2Info(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_52destroyCsrsv2Info(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_info); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_54scsrsv2_bufferSize(CYTHON_UNUSED PyObject *__pyx_self, intptr_t __pyx_v_handle, int __pyx_v_transA, 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_13cupy_backends_4cuda_4libs_8cusparse_56dcsrsv2_bufferSize(CYTHON_UNUSED PyObject *__pyx_self, intptr_t __pyx_v_handle, int __pyx_v_transA, 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_13cupy_backends_4cuda_4libs_8cusparse_58ccsrsv2_bufferSize(CYTHON_UNUSED PyObject *__pyx_self, intptr_t __pyx_v_handle, int __pyx_v_transA, 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_13cupy_backends_4cuda_4libs_8cusparse_60zcsrsv2_bufferSize(CYTHON_UNUSED PyObject *__pyx_self, intptr_t __pyx_v_handle, int __pyx_v_transA, 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_13cupy_backends_4cuda_4libs_8cusparse_62scsrsv2_analysis(CYTHON_UNUSED PyObject *__pyx_self, intptr_t __pyx_v_handle, int __pyx_v_transA, 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_13cupy_backends_4cuda_4libs_8cusparse_64dcsrsv2_analysis(CYTHON_UNUSED PyObject *__pyx_self, intptr_t __pyx_v_handle, int __pyx_v_transA, 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_13cupy_backends_4cuda_4libs_8cusparse_66ccsrsv2_analysis(CYTHON_UNUSED PyObject *__pyx_self, intptr_t __pyx_v_handle, int __pyx_v_transA, 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_13cupy_backends_4cuda_4libs_8cusparse_68zcsrsv2_analysis(CYTHON_UNUSED PyObject *__pyx_self, intptr_t __pyx_v_handle, int __pyx_v_transA, 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_13cupy_backends_4cuda_4libs_8cusparse_70scsrsv2_solve(CYTHON_UNUSED PyObject *__pyx_self, intptr_t __pyx_v_handle, int __pyx_v_transA, int __pyx_v_m, 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_info, size_t __pyx_v_x, size_t __pyx_v_y, int __pyx_v_policy, size_t __pyx_v_pBuffer); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_72dcsrsv2_solve(CYTHON_UNUSED PyObject *__pyx_self, intptr_t __pyx_v_handle, int __pyx_v_transA, int __pyx_v_m, 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_info, size_t __pyx_v_x, size_t __pyx_v_y, int __pyx_v_policy, size_t __pyx_v_pBuffer); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_74ccsrsv2_solve(CYTHON_UNUSED PyObject *__pyx_self, intptr_t __pyx_v_handle, int __pyx_v_transA, int __pyx_v_m, 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_info, size_t __pyx_v_x, size_t __pyx_v_y, int __pyx_v_policy, size_t __pyx_v_pBuffer); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_76zcsrsv2_solve(CYTHON_UNUSED PyObject *__pyx_self, intptr_t __pyx_v_handle, int __pyx_v_transA, int __pyx_v_m, 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_info, size_t __pyx_v_x, size_t __pyx_v_y, int __pyx_v_policy, size_t __pyx_v_pBuffer); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_78xcsrsv2_zeroPivot(CYTHON_UNUSED PyObject *__pyx_self, intptr_t __pyx_v_handle, size_t __pyx_v_info, size_t __pyx_v_position); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_80scsrmm(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_82dcsrmm(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_84ccsrmm(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_86zcsrmm(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_88scsrmm2(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_90dcsrmm2(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_92ccsrmm2(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_94zcsrmm2(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_96createCsrsm2Info(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_98destroyCsrsm2Info(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_info); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_100scsrsm2_bufferSizeExt(CYTHON_UNUSED PyObject *__pyx_self, intptr_t __pyx_v_handle, int __pyx_v_algo, int __pyx_v_transA, int __pyx_v_transB, int __pyx_v_m, int __pyx_v_nrhs, 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_info, int __pyx_v_policy); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_102dcsrsm2_bufferSizeExt(CYTHON_UNUSED PyObject *__pyx_self, intptr_t __pyx_v_handle, int __pyx_v_algo, int __pyx_v_transA, int __pyx_v_transB, int __pyx_v_m, int __pyx_v_nrhs, 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_info, int __pyx_v_policy); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_104ccsrsm2_bufferSizeExt(CYTHON_UNUSED PyObject *__pyx_self, intptr_t __pyx_v_handle, int __pyx_v_algo, int __pyx_v_transA, int __pyx_v_transB, int __pyx_v_m, int __pyx_v_nrhs, 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_info, int __pyx_v_policy); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_106zcsrsm2_bufferSizeExt(CYTHON_UNUSED PyObject *__pyx_self, intptr_t __pyx_v_handle, int __pyx_v_algo, int __pyx_v_transA, int __pyx_v_transB, int __pyx_v_m, int __pyx_v_nrhs, 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_info, int __pyx_v_policy); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_108scsrsm2_analysis(CYTHON_UNUSED PyObject *__pyx_self, intptr_t __pyx_v_handle, int __pyx_v_algo, int __pyx_v_transA, int __pyx_v_transB, int __pyx_v_m, int __pyx_v_nrhs, 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_info, int __pyx_v_policy, size_t __pyx_v_pBuffer); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_110dcsrsm2_analysis(CYTHON_UNUSED PyObject *__pyx_self, intptr_t __pyx_v_handle, int __pyx_v_algo, int __pyx_v_transA, int __pyx_v_transB, int __pyx_v_m, int __pyx_v_nrhs, 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_info, int __pyx_v_policy, size_t __pyx_v_pBuffer); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_112ccsrsm2_analysis(CYTHON_UNUSED PyObject *__pyx_self, intptr_t __pyx_v_handle, int __pyx_v_algo, int __pyx_v_transA, int __pyx_v_transB, int __pyx_v_m, int __pyx_v_nrhs, 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_info, int __pyx_v_policy, size_t __pyx_v_pBuffer); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_114zcsrsm2_analysis(CYTHON_UNUSED PyObject *__pyx_self, intptr_t __pyx_v_handle, int __pyx_v_algo, int __pyx_v_transA, int __pyx_v_transB, int __pyx_v_m, int __pyx_v_nrhs, 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_info, int __pyx_v_policy, size_t __pyx_v_pBuffer); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_116scsrsm2_solve(CYTHON_UNUSED PyObject *__pyx_self, intptr_t __pyx_v_handle, int __pyx_v_algo, int __pyx_v_transA, int __pyx_v_transB, int __pyx_v_m, int __pyx_v_nrhs, 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_info, int __pyx_v_policy, size_t __pyx_v_pBuffer); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_118dcsrsm2_solve(CYTHON_UNUSED PyObject *__pyx_self, intptr_t __pyx_v_handle, int __pyx_v_algo, int __pyx_v_transA, int __pyx_v_transB, int __pyx_v_m, int __pyx_v_nrhs, 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_info, int __pyx_v_policy, size_t __pyx_v_pBuffer); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_120ccsrsm2_solve(CYTHON_UNUSED PyObject *__pyx_self, intptr_t __pyx_v_handle, int __pyx_v_algo, int __pyx_v_transA, int __pyx_v_transB, int __pyx_v_m, int __pyx_v_nrhs, 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_info, int __pyx_v_policy, size_t __pyx_v_pBuffer); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_122zcsrsm2_solve(CYTHON_UNUSED PyObject *__pyx_self, intptr_t __pyx_v_handle, int __pyx_v_algo, int __pyx_v_transA, int __pyx_v_transB, int __pyx_v_m, int __pyx_v_nrhs, 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_info, int __pyx_v_policy, size_t __pyx_v_pBuffer); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_124xcsrsm2_zeroPivot(CYTHON_UNUSED PyObject *__pyx_self, intptr_t __pyx_v_handle, size_t __pyx_v_info, size_t __pyx_v_position); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_126xcsrgeamNnz(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_128scsrgeam(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_130dcsrgeam(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_132ccsrgeam(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_134zcsrgeam(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_136scsrgeam2_bufferSizeExt(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_138dcsrgeam2_bufferSizeExt(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_140ccsrgeam2_bufferSizeExt(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_142zcsrgeam2_bufferSizeExt(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_144xcsrgeam2Nnz(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_146scsrgeam2(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_148dcsrgeam2(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_150ccsrgeam2(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_152zcsrgeam2(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_154xcsrgemmNnz(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_156scsrgemm(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_158dcsrgemm(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_160ccsrgemm(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_162zcsrgemm(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_164createCsrgemm2Info(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_166destroyCsrgemm2Info(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_info); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_168scsrgemm2_bufferSizeExt(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_170dcsrgemm2_bufferSizeExt(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_172ccsrgemm2_bufferSizeExt(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_174zcsrgemm2_bufferSizeExt(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_176xcsrgemm2Nnz(CYTHON_UNUSED PyObject *__pyx_self, intptr_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, intptr_t __pyx_v_nnzTotalDevHostPtr, size_t __pyx_v_info, intptr_t __pyx_v_pBuffer); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_178scsrgemm2(CYTHON_UNUSED PyObject *__pyx_self, intptr_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, intptr_t __pyx_v_pBuffer); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_180dcsrgemm2(CYTHON_UNUSED PyObject *__pyx_self, intptr_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, intptr_t __pyx_v_pBuffer); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_182ccsrgemm2(CYTHON_UNUSED PyObject *__pyx_self, intptr_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, intptr_t __pyx_v_pBuffer); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_184zcsrgemm2(CYTHON_UNUSED PyObject *__pyx_self, intptr_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, intptr_t __pyx_v_pBuffer); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_186xcoo2csr(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_188scsc2dense(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_190dcsc2dense(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_192ccsc2dense(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_194zcsc2dense(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_196xcsr2coo(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_198scsr2csc(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_200dcsr2csc(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_202ccsr2csc(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_204zcsr2csc(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_206scsr2dense(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_208dcsr2dense(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_210ccsr2dense(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_212zcsr2dense(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_214snnz_compress(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_216dnnz_compress(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_218cnnz_compress(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_220znnz_compress(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_222scsr2csr_compress(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_224dcsr2csr_compress(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_226ccsr2csr_compress(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_228zcsr2csr_compress(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_230sdense2csc(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_232ddense2csc(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_234cdense2csc(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_236zdense2csc(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_238sdense2csr(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_240ddense2csr(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_242cdense2csr(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_244zdense2csr(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_246snnz(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_248dnnz(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_250cnnz(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_252znnz(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_254createIdentityPermutation(CYTHON_UNUSED PyObject *__pyx_self, intptr_t __pyx_v_handle, int __pyx_v_n, size_t __pyx_v_p); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_256xcoosort_bufferSizeExt(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_258xcoosortByRow(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_260xcoosortByColumn(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_262xcsrsort_bufferSizeExt(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_264xcsrsort(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_266xcscsort_bufferSizeExt(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_268xcscsort(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_270createCsrilu02Info(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_272destroyCsrilu02Info(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_info); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_274createBsrilu02Info(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_276destroyBsrilu02Info(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_info); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_278createCsric02Info(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_280destroyCsric02Info(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_info); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_282createBsric02Info(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_284destroyBsric02Info(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_info); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_286scsrilu02_numericBoost(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_288dcsrilu02_numericBoost(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_290ccsrilu02_numericBoost(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_292zcsrilu02_numericBoost(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_294xcsrilu02_zeroPivot(CYTHON_UNUSED PyObject *__pyx_self, intptr_t __pyx_v_handle, size_t __pyx_v_info, size_t __pyx_v_position); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_296scsrilu02_bufferSize(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_298dcsrilu02_bufferSize(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_300ccsrilu02_bufferSize(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_302zcsrilu02_bufferSize(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_304scsrilu02_analysis(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_306dcsrilu02_analysis(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_308ccsrilu02_analysis(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_310zcsrilu02_analysis(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_312scsrilu02(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_314dcsrilu02(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_316ccsrilu02(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_318zcsrilu02(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_320sbsrilu02_numericBoost(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_322dbsrilu02_numericBoost(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_324cbsrilu02_numericBoost(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_326zbsrilu02_numericBoost(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_328xbsrilu02_zeroPivot(CYTHON_UNUSED PyObject *__pyx_self, intptr_t __pyx_v_handle, size_t __pyx_v_info, size_t __pyx_v_position); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_330sbsrilu02_bufferSize(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_332dbsrilu02_bufferSize(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_334cbsrilu02_bufferSize(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_336zbsrilu02_bufferSize(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_338sbsrilu02_analysis(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_340dbsrilu02_analysis(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_342cbsrilu02_analysis(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_344zbsrilu02_analysis(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_346sbsrilu02(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_348dbsrilu02(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_350cbsrilu02(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_352zbsrilu02(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_354xcsric02_zeroPivot(CYTHON_UNUSED PyObject *__pyx_self, intptr_t __pyx_v_handle, size_t __pyx_v_info, size_t __pyx_v_position); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_356scsric02_bufferSize(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_358dcsric02_bufferSize(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_360ccsric02_bufferSize(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_362zcsric02_bufferSize(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_364scsric02_analysis(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_366dcsric02_analysis(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_368ccsric02_analysis(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_370zcsric02_analysis(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_372scsric02(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_374dcsric02(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_376ccsric02(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_378zcsric02(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_380xbsric02_zeroPivot(CYTHON_UNUSED PyObject *__pyx_self, intptr_t __pyx_v_handle, size_t __pyx_v_info, size_t __pyx_v_position); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_382sbsric02_bufferSize(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_384dbsric02_bufferSize(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_386cbsric02_bufferSize(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_388zbsric02_bufferSize(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_390sbsric02_analysis(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_392dbsric02_analysis(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_394cbsric02_analysis(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_396zbsric02_analysis(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_398sbsric02(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_400dbsric02(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_402cbsric02(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_404zbsric02(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_406sgtsv2_bufferSizeExt(CYTHON_UNUSED PyObject *__pyx_self, intptr_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); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_408dgtsv2_bufferSizeExt(CYTHON_UNUSED PyObject *__pyx_self, intptr_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); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_410cgtsv2_bufferSizeExt(CYTHON_UNUSED PyObject *__pyx_self, intptr_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); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_412zgtsv2_bufferSizeExt(CYTHON_UNUSED PyObject *__pyx_self, intptr_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); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_414sgtsv2(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_416dgtsv2(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_418cgtsv2(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_420zgtsv2(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_422sgtsv2_nopivot_bufferSizeExt(CYTHON_UNUSED PyObject *__pyx_self, intptr_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); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_424dgtsv2_nopivot_bufferSizeExt(CYTHON_UNUSED PyObject *__pyx_self, intptr_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); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_426cgtsv2_nopivot_bufferSizeExt(CYTHON_UNUSED PyObject *__pyx_self, intptr_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); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_428zgtsv2_nopivot_bufferSizeExt(CYTHON_UNUSED PyObject *__pyx_self, intptr_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); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_430sgtsv2_nopivot(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_432dgtsv2_nopivot(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_434cgtsv2_nopivot(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_436zgtsv2_nopivot(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_438sgtsv2StridedBatch_bufferSizeExt(CYTHON_UNUSED PyObject *__pyx_self, intptr_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); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_440dgtsv2StridedBatch_bufferSizeExt(CYTHON_UNUSED PyObject *__pyx_self, intptr_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); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_442cgtsv2StridedBatch_bufferSizeExt(CYTHON_UNUSED PyObject *__pyx_self, intptr_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); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_444zgtsv2StridedBatch_bufferSizeExt(CYTHON_UNUSED PyObject *__pyx_self, intptr_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); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_446sgtsv2StridedBatch(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_448dgtsv2StridedBatch(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_450cgtsv2StridedBatch(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_452zgtsv2StridedBatch(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_454sgtsvInterleavedBatch_bufferSizeExt(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_456dgtsvInterleavedBatch_bufferSizeExt(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_458cgtsvInterleavedBatch_bufferSizeExt(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_460zgtsvInterleavedBatch_bufferSizeExt(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_462sgtsvInterleavedBatch(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_464dgtsvInterleavedBatch(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_466cgtsvInterleavedBatch(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_468zgtsvInterleavedBatch(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_470sgpsvInterleavedBatch_bufferSizeExt(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_472dgpsvInterleavedBatch_bufferSizeExt(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_474cgpsvInterleavedBatch_bufferSizeExt(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_476zgpsvInterleavedBatch_bufferSizeExt(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_478sgpsvInterleavedBatch(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_480dgpsvInterleavedBatch(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_482cgpsvInterleavedBatch(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_484zgpsvInterleavedBatch(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_486createSpVec(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_13cupy_backends_4cuda_4libs_8cusparse_488destroySpVec(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_desc); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_490spVecGet(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_desc); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_492spVecGetIndexBase(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_desc); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_494spVecGetValues(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_desc); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_496spVecSetValues(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_desc, intptr_t __pyx_v_values); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_498createCoo(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_13cupy_backends_4cuda_4libs_8cusparse_500createCooAoS(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_13cupy_backends_4cuda_4libs_8cusparse_502createCsr(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_13cupy_backends_4cuda_4libs_8cusparse_504createCsc(CYTHON_UNUSED PyObject *__pyx_self, int64_t __pyx_v_rows, int64_t __pyx_v_cols, int64_t __pyx_v_nnz, intptr_t __pyx_v_cscColOffsets, intptr_t __pyx_v_cscRowInd, intptr_t __pyx_v_cscValues, cusparseIndexType_t __pyx_v_cscColOffsetsType, cusparseIndexType_t __pyx_v_cscRowIndType, cusparseIndexBase_t __pyx_v_idxBase, cudaDataType __pyx_v_valueType); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_506destroySpMat(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_desc); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_508cooGet(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_desc); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_510cooAoSGet(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_desc); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_512csrGet(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_desc); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_514csrSetPointers(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_desc, size_t __pyx_v_csrRowOffsets, size_t __pyx_v_csrColInd, size_t __pyx_v_csrValues); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_516spMatGetFormat(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_desc); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_518spMatGetIndexBase(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_desc); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_520spMatGetValues(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_desc); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_522spMatSetValues(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_desc, intptr_t __pyx_v_values); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_524spMatGetSize(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_desc, size_t __pyx_v_rows, size_t __pyx_v_cols, size_t __pyx_v_nnz); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_526spMatGetStridedBatch(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_desc); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_528spMatSetStridedBatch(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_desc, int __pyx_v_batchCount); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_530createDnVec(CYTHON_UNUSED PyObject *__pyx_self, int64_t __pyx_v_size, intptr_t __pyx_v_values, cudaDataType __pyx_v_valueType); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_532destroyDnVec(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_desc); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_534dnVecGet(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_desc); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_536dnVecGetValues(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_desc); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_538dnVecSetValues(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_desc, intptr_t __pyx_v_values); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_540createDnMat(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_13cupy_backends_4cuda_4libs_8cusparse_542destroyDnMat(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_desc); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_544dnMatGet(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_desc); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_546dnMatGetValues(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_desc); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_548dnMatSetValues(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_desc, intptr_t __pyx_v_values); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_550dnMatGetStridedBatch(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_desc); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_552dnMatSetStridedBatch(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_desc, int __pyx_v_batchCount, int64_t __pyx_v_batchStride); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_554spVV_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_13cupy_backends_4cuda_4libs_8cusparse_556spVV(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_13cupy_backends_4cuda_4libs_8cusparse_558spMV_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_13cupy_backends_4cuda_4libs_8cusparse_560spMV(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_13cupy_backends_4cuda_4libs_8cusparse_562spSM_createDescr(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_564spSM_destroyDescr(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_descr); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_566spSM_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, size_t __pyx_v_matC, cudaDataType __pyx_v_computeType, cusparseSpSMAlg_t __pyx_v_alg, size_t __pyx_v_spsmDescr); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_568spSM_analysis(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, size_t __pyx_v_matC, cudaDataType __pyx_v_computeType, cusparseSpSMAlg_t __pyx_v_alg, size_t __pyx_v_spsmDescr, intptr_t __pyx_v_externalBuffer); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_570spSM_solve(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, size_t __pyx_v_matC, cudaDataType __pyx_v_computeType, cusparseSpSMAlg_t __pyx_v_alg, size_t __pyx_v_spsmDescr, intptr_t __pyx_v_externalBuffer); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_572spMM_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_13cupy_backends_4cuda_4libs_8cusparse_574spMM(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_13cupy_backends_4cuda_4libs_8cusparse_576constrainedGeMM_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_13cupy_backends_4cuda_4libs_8cusparse_578constrainedGeMM(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_13cupy_backends_4cuda_4libs_8cusparse_580spGEMM_createDescr(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_582spGEMM_destroyDescr(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_descr); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_584spGEMM_workEstimation(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, int __pyx_v_alg, size_t __pyx_v_spgemmDescr, size_t __pyx_v_bufferSize, intptr_t __pyx_v_externalBuffer1); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_586spGEMM_compute(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, int __pyx_v_alg, size_t __pyx_v_spgemmDescr, size_t __pyx_v_bufferSize, intptr_t __pyx_v_externalBuffer2); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_588spGEMM_copy(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, int __pyx_v_alg, size_t __pyx_v_spgemmDescr); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_590spGEAM_createDescr(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_592spGEAM_destroyDescr(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_descr); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_594spGEAM_bufferSize(CYTHON_UNUSED PyObject *__pyx_self, intptr_t __pyx_v_handle, int __pyx_v_opA, int __pyx_v_opB, intptr_t __pyx_v_alpha, size_t __pyx_v_matA, intptr_t __pyx_v_beta, size_t __pyx_v_matB, size_t __pyx_v_matC, cudaDataType __pyx_v_computeType, int __pyx_v_alg, size_t __pyx_v_spgeamDescr); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_596spGEAM_nnz(CYTHON_UNUSED PyObject *__pyx_self, intptr_t __pyx_v_handle, int __pyx_v_opA, int __pyx_v_opB, intptr_t __pyx_v_alpha, size_t __pyx_v_matA, intptr_t __pyx_v_beta, size_t __pyx_v_matB, size_t __pyx_v_matC, cudaDataType __pyx_v_computeType, int __pyx_v_alg, size_t __pyx_v_spgeamDescr, intptr_t __pyx_v_externalBuffer); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_598spGEAM(CYTHON_UNUSED PyObject *__pyx_self, intptr_t __pyx_v_handle, int __pyx_v_opA, int __pyx_v_opB, intptr_t __pyx_v_alpha, size_t __pyx_v_matA, intptr_t __pyx_v_beta, size_t __pyx_v_matB, size_t __pyx_v_matC, cudaDataType __pyx_v_computeType, int __pyx_v_alg, size_t __pyx_v_spgeamDescr, intptr_t __pyx_v_externalBuffer); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_600gather(CYTHON_UNUSED PyObject *__pyx_self, intptr_t __pyx_v_handle, size_t __pyx_v_vecY, size_t __pyx_v_vecX); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_602sparseToDense_bufferSize(CYTHON_UNUSED PyObject *__pyx_self, intptr_t __pyx_v_handle, size_t __pyx_v_matA, size_t __pyx_v_matB, int __pyx_v_alg); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_604sparseToDense(CYTHON_UNUSED PyObject *__pyx_self, intptr_t __pyx_v_handle, size_t __pyx_v_matA, size_t __pyx_v_matB, int __pyx_v_alg, intptr_t __pyx_v_buffer); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_606denseToSparse_bufferSize(CYTHON_UNUSED PyObject *__pyx_self, intptr_t __pyx_v_handle, size_t __pyx_v_matA, size_t __pyx_v_matB, int __pyx_v_alg); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_608denseToSparse_analysis(CYTHON_UNUSED PyObject *__pyx_self, intptr_t __pyx_v_handle, size_t __pyx_v_matA, size_t __pyx_v_matB, int __pyx_v_alg, intptr_t __pyx_v_buffer); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_610denseToSparse_convert(CYTHON_UNUSED PyObject *__pyx_self, intptr_t __pyx_v_handle, size_t __pyx_v_matA, size_t __pyx_v_matB, int __pyx_v_alg, intptr_t __pyx_v_buffer); /* proto */
static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_612csr2cscEx2_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_13cupy_backends_4cuda_4libs_8cusparse_614csr2cscEx2(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_13cupy_backends_4cuda_4libs_8cusparse_616__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_13cupy_backends_4cuda_4libs_8cusparse_618__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_13cupy_backends_4cuda_4libs_8cusparse_620__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_13cupy_backends_4cuda_4libs_8cusparse_622__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_13cupy_backends_4cuda_4libs_8cusparse_624__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_13cupy_backends_4cuda_4libs_8cusparse_626__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_13cupy_backends_4cuda_4libs_8cusparse_628__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_13cupy_backends_4cuda_4libs_8cusparse_SpVecAttributes(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_13cupy_backends_4cuda_4libs_8cusparse_CooAttributes(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_13cupy_backends_4cuda_4libs_8cusparse_CooAoSAttributes(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_13cupy_backends_4cuda_4libs_8cusparse_CsrAttributes(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_13cupy_backends_4cuda_4libs_8cusparse_DnVecAttributes(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_13cupy_backends_4cuda_4libs_8cusparse_DnMatAttributes(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_13cupy_backends_4cuda_4libs_8cusparse_DnMatBatchAttributes(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
/* #### Code section: late_includes ### */
/* #### Code section: module_state ### */
/* SmallCodeConfig */
#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

typedef struct {
  PyObject *__pyx_d;
  PyObject *__pyx_b;
  PyObject *__pyx_cython_runtime;
  PyObject *__pyx_empty_tuple;
  PyObject *__pyx_empty_bytes;
  PyObject *__pyx_empty_unicode;
  PyTypeObject *__pyx_ptype_13cupy_backends_4cuda_3api_7runtime_PointerAttributes;
  PyTypeObject *__pyx_ptype_13cupy_backends_4cuda_3api_7runtime_MemPoolProps;
  PyTypeObject *__pyx_ptype_13cupy_backends_4cuda_9_softlink_SoftLink;
  PyObject *__pyx_type_13cupy_backends_4cuda_4libs_8cusparse_SpVecAttributes;
  PyObject *__pyx_type_13cupy_backends_4cuda_4libs_8cusparse_CooAttributes;
  PyObject *__pyx_type_13cupy_backends_4cuda_4libs_8cusparse_CooAoSAttributes;
  PyObject *__pyx_type_13cupy_backends_4cuda_4libs_8cusparse_CsrAttributes;
  PyObject *__pyx_type_13cupy_backends_4cuda_4libs_8cusparse_DnVecAttributes;
  PyObject *__pyx_type_13cupy_backends_4cuda_4libs_8cusparse_DnMatAttributes;
  PyObject *__pyx_type_13cupy_backends_4cuda_4libs_8cusparse_DnMatBatchAttributes;
  PyTypeObject *__pyx_ptype_13cupy_backends_4cuda_4libs_8cusparse_SpVecAttributes;
  PyTypeObject *__pyx_ptype_13cupy_backends_4cuda_4libs_8cusparse_CooAttributes;
  PyTypeObject *__pyx_ptype_13cupy_backends_4cuda_4libs_8cusparse_CooAoSAttributes;
  PyTypeObject *__pyx_ptype_13cupy_backends_4cuda_4libs_8cusparse_CsrAttributes;
  PyTypeObject *__pyx_ptype_13cupy_backends_4cuda_4libs_8cusparse_DnVecAttributes;
  PyTypeObject *__pyx_ptype_13cupy_backends_4cuda_4libs_8cusparse_DnMatAttributes;
  PyTypeObject *__pyx_ptype_13cupy_backends_4cuda_4libs_8cusparse_DnMatBatchAttributes;
  __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_items;
  __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_pop;
  __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_values;
  PyObject *__pyx_codeobj_tab[2];
  PyObject *__pyx_string_tab[277];
  PyObject *__pyx_number_tab[19];
/* #### Code section: module_state_contents ### */
/* CommonTypesMetaclass.module_state_decls */
PyTypeObject *__pyx_CommonTypesMetaclassType;

/* CachedMethodType.module_state_decls */
#if CYTHON_COMPILING_IN_LIMITED_API
PyObject *__Pyx_CachedMethodType;
#endif

/* CythonFunctionShared.module_state_decls */
PyTypeObject *__pyx_CyFunctionType;

/* CodeObjectCache.module_state_decls */
struct __Pyx_CodeObjectCache __pyx_code_cache;

/* #### Code section: module_state_end ### */
} __pyx_mstatetype;

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

#define __pyx_mstate_global (__Pyx_PyModule_GetState(__Pyx_State_FindModule(&__pyx_moduledef)))

#define __pyx_m (__Pyx_State_FindModule(&__pyx_moduledef))
#else
static __pyx_mstatetype __pyx_mstate_global_static =
#ifdef __cplusplus
    {};
#else
    {0};
#endif
static __pyx_mstatetype * const __pyx_mstate_global = &__pyx_mstate_global_static;
#endif
/* #### Code section: constant_name_defines ### */
#define __pyx_kp_u_ __pyx_string_tab[0]
#define __pyx_kp_u_Note_that_Cython_is_deliberately __pyx_string_tab[1]
#define __pyx_kp_u__2 __pyx_string_tab[2]
#define __pyx_kp_u__3 __pyx_string_tab[3]
#define __pyx_kp_u_add_note __pyx_string_tab[4]
#define __pyx_kp_u_calling_cuSPARSE_API_during_stre __pyx_string_tab[5]
#define __pyx_kp_u_cupy_backends_cuda_libs_cusparse_2 __pyx_string_tab[6]
#define __pyx_kp_u_disable __pyx_string_tab[7]
#define __pyx_kp_u_enable __pyx_string_tab[8]
#define __pyx_kp_u_gc __pyx_string_tab[9]
#define __pyx_kp_u_isenabled __pyx_string_tab[10]
#define __pyx_n_u_A __pyx_string_tab[11]
#define __pyx_n_u_B __pyx_string_tab[12]
#define __pyx_n_u_C __pyx_string_tab[13]
#define __pyx_n_u_CooAoSAttributes __pyx_string_tab[14]
#define __pyx_n_u_CooAttributes __pyx_string_tab[15]
#define __pyx_n_u_CreateCsc __pyx_string_tab[16]
#define __pyx_n_u_CsrAttributes __pyx_string_tab[17]
#define __pyx_n_u_CuSparseError __pyx_string_tab[18]
#define __pyx_n_u_CuSparseError___init __pyx_string_tab[19]
#define __pyx_n_u_CuSparseError___reduce __pyx_string_tab[20]
#define __pyx_n_u_DenseToSparse_analysis __pyx_string_tab[21]
#define __pyx_n_u_DenseToSparse_bufferSize __pyx_string_tab[22]
#define __pyx_n_u_DenseToSparse_convert __pyx_string_tab[23]
#define __pyx_n_u_DnMatAttributes __pyx_string_tab[24]
#define __pyx_n_u_DnMatBatchAttributes __pyx_string_tab[25]
#define __pyx_n_u_DnVecAttributes __pyx_string_tab[26]
#define __pyx_n_u_P __pyx_string_tab[27]
#define __pyx_n_u_Pyx_PyDict_NextRef __pyx_string_tab[28]
#define __pyx_n_u_SpGEAM __pyx_string_tab[29]
#define __pyx_n_u_SpGEAM_bufferSize __pyx_string_tab[30]
#define __pyx_n_u_SpGEAM_createDescr __pyx_string_tab[31]
#define __pyx_n_u_SpGEAM_destroyDescr __pyx_string_tab[32]
#define __pyx_n_u_SpGEAM_nnz __pyx_string_tab[33]
#define __pyx_n_u_SpMatSetAttribute __pyx_string_tab[34]
#define __pyx_n_u_SpSM_analysis __pyx_string_tab[35]
#define __pyx_n_u_SpSM_bufferSize __pyx_string_tab[36]
#define __pyx_n_u_SpSM_createDescr __pyx_string_tab[37]
#define __pyx_n_u_SpSM_destroyDescr __pyx_string_tab[38]
#define __pyx_n_u_SpSM_solve __pyx_string_tab[39]
#define __pyx_n_u_SpVecAttributes __pyx_string_tab[40]
#define __pyx_n_u_SparseToDense __pyx_string_tab[41]
#define __pyx_n_u_SparseToDense_bufferSize __pyx_string_tab[42]
#define __pyx_n_u_alg __pyx_string_tab[43]
#define __pyx_n_u_algo __pyx_string_tab[44]
#define __pyx_n_u_alpha __pyx_string_tab[45]
#define __pyx_n_u_alphatype __pyx_string_tab[46]
#define __pyx_n_u_asyncio_coroutines __pyx_string_tab[47]
#define __pyx_n_u_attribute __pyx_string_tab[48]
#define __pyx_n_u_base __pyx_string_tab[49]
#define __pyx_n_u_batchCount __pyx_string_tab[50]
#define __pyx_n_u_batchStride __pyx_string_tab[51]
#define __pyx_n_u_beta __pyx_string_tab[52]
#define __pyx_n_u_betatype __pyx_string_tab[53]
#define __pyx_n_u_blockDim __pyx_string_tab[54]
#define __pyx_n_u_boost_val __pyx_string_tab[55]
#define __pyx_n_u_bsrSortedColInd __pyx_string_tab[56]
#define __pyx_n_u_bsrSortedRowPtr __pyx_string_tab[57]
#define __pyx_n_u_bsrSortedVal __pyx_string_tab[58]
#define __pyx_n_u_buffer __pyx_string_tab[59]
#define __pyx_n_u_bufferSize __pyx_string_tab[60]
#define __pyx_n_u_cline_in_traceback __pyx_string_tab[61]
#define __pyx_n_u_colIdx __pyx_string_tab[62]
#define __pyx_n_u_colIdxType __pyx_string_tab[63]
#define __pyx_n_u_cols __pyx_string_tab[64]
#define __pyx_n_u_computeType __pyx_string_tab[65]
#define __pyx_n_u_cooColInd __pyx_string_tab[66]
#define __pyx_n_u_cooCols __pyx_string_tab[67]
#define __pyx_n_u_cooIdxType __pyx_string_tab[68]
#define __pyx_n_u_cooInd __pyx_string_tab[69]
#define __pyx_n_u_cooRowInd __pyx_string_tab[70]
#define __pyx_n_u_cooRows __pyx_string_tab[71]
#define __pyx_n_u_cooValues __pyx_string_tab[72]
#define __pyx_n_u_copyValues __pyx_string_tab[73]
#define __pyx_n_u_count __pyx_string_tab[74]
#define __pyx_n_u_cscColOffsets __pyx_string_tab[75]
#define __pyx_n_u_cscColOffsetsType __pyx_string_tab[76]
#define __pyx_n_u_cscColPtr __pyx_string_tab[77]
#define __pyx_n_u_cscColPtrA __pyx_string_tab[78]
#define __pyx_n_u_cscRowInd __pyx_string_tab[79]
#define __pyx_n_u_cscRowIndA __pyx_string_tab[80]
#define __pyx_n_u_cscRowIndType __pyx_string_tab[81]
#define __pyx_n_u_cscSortedColPtrA __pyx_string_tab[82]
#define __pyx_n_u_cscSortedRowIndA __pyx_string_tab[83]
#define __pyx_n_u_cscSortedValA __pyx_string_tab[84]
#define __pyx_n_u_cscVal __pyx_string_tab[85]
#define __pyx_n_u_cscValA __pyx_string_tab[86]
#define __pyx_n_u_cscValues __pyx_string_tab[87]
#define __pyx_n_u_csrColInd __pyx_string_tab[88]
#define __pyx_n_u_csrColIndA __pyx_string_tab[89]
#define __pyx_n_u_csrColIndB __pyx_string_tab[90]
#define __pyx_n_u_csrColIndC __pyx_string_tab[91]
#define __pyx_n_u_csrColIndD __pyx_string_tab[92]
#define __pyx_n_u_csrColIndType __pyx_string_tab[93]
#define __pyx_n_u_csrColind __pyx_string_tab[94]
#define __pyx_n_u_csrRowOffsets __pyx_string_tab[95]
#define __pyx_n_u_csrRowOffsetsType __pyx_string_tab[96]
#define __pyx_n_u_csrRowPtr __pyx_string_tab[97]
#define __pyx_n_u_csrRowPtrA __pyx_string_tab[98]
#define __pyx_n_u_csrRowPtrB __pyx_string_tab[99]
#define __pyx_n_u_csrRowPtrC __pyx_string_tab[100]
#define __pyx_n_u_csrRowPtrD __pyx_string_tab[101]
#define __pyx_n_u_csrSortedColIndA __pyx_string_tab[102]
#define __pyx_n_u_csrSortedRowPtrA __pyx_string_tab[103]
#define __pyx_n_u_csrSortedValA __pyx_string_tab[104]
#define __pyx_n_u_csrSortedValA_valM __pyx_string_tab[105]
#define __pyx_n_u_csrVal __pyx_string_tab[106]
#define __pyx_n_u_csrValA __pyx_string_tab[107]
#define __pyx_n_u_csrValAtype __pyx_string_tab[108]
#define __pyx_n_u_csrValB __pyx_string_tab[109]
#define __pyx_n_u_csrValC __pyx_string_tab[110]
#define __pyx_n_u_csrValD __pyx_string_tab[111]
#define __pyx_n_u_csrValues __pyx_string_tab[112]
#define __pyx_n_u_cuda __pyx_string_tab[113]
#define __pyx_n_u_cupy_backends_cuda_libs_cusparse __pyx_string_tab[114]
#define __pyx_n_u_cusparse __pyx_string_tab[115]
#define __pyx_n_u_d __pyx_string_tab[116]
#define __pyx_n_u_data __pyx_string_tab[117]
#define __pyx_n_u_desc __pyx_string_tab[118]
#define __pyx_n_u_descr __pyx_string_tab[119]
#define __pyx_n_u_descrA __pyx_string_tab[120]
#define __pyx_n_u_descrB __pyx_string_tab[121]
#define __pyx_n_u_descrC __pyx_string_tab[122]
#define __pyx_n_u_descrD __pyx_string_tab[123]
#define __pyx_n_u_diagType __pyx_string_tab[124]
#define __pyx_n_u_dict __pyx_string_tab[125]
#define __pyx_n_u_dirA __pyx_string_tab[126]
#define __pyx_n_u_dl __pyx_string_tab[127]
#define __pyx_n_u_doc __pyx_string_tab[128]
#define __pyx_n_u_ds __pyx_string_tab[129]
#define __pyx_n_u_du __pyx_string_tab[130]
#define __pyx_n_u_dw __pyx_string_tab[131]
#define __pyx_n_u_enable_boost __pyx_string_tab[132]
#define __pyx_n_u_executiontype __pyx_string_tab[133]
#define __pyx_n_u_externalBuffer __pyx_string_tab[134]
#define __pyx_n_u_externalBuffer1 __pyx_string_tab[135]
#define __pyx_n_u_externalBuffer2 __pyx_string_tab[136]
#define __pyx_n_u_fillMode __pyx_string_tab[137]
#define __pyx_n_u_func __pyx_string_tab[138]
#define __pyx_n_u_get_build_version __pyx_string_tab[139]
#define __pyx_n_u_getstate __pyx_string_tab[140]
#define __pyx_n_u_handle __pyx_string_tab[141]
#define __pyx_n_u_handle_uint __pyx_string_tab[142]
#define __pyx_n_u_idx __pyx_string_tab[143]
#define __pyx_n_u_idxBase __pyx_string_tab[144]
#define __pyx_n_u_idxType __pyx_string_tab[145]
#define __pyx_n_u_inColInd __pyx_string_tab[146]
#define __pyx_n_u_inNnz __pyx_string_tab[147]
#define __pyx_n_u_inRowPtr __pyx_string_tab[148]
#define __pyx_n_u_inVal __pyx_string_tab[149]
#define __pyx_n_u_ind __pyx_string_tab[150]
#define __pyx_n_u_indices __pyx_string_tab[151]
#define __pyx_n_u_info __pyx_string_tab[152]
#define __pyx_n_u_init __pyx_string_tab[153]
#define __pyx_n_u_is_coroutine __pyx_string_tab[154]
#define __pyx_n_u_items __pyx_string_tab[155]
#define __pyx_n_u_k __pyx_string_tab[156]
#define __pyx_n_u_ld __pyx_string_tab[157]
#define __pyx_n_u_lda __pyx_string_tab[158]
#define __pyx_n_u_ldb __pyx_string_tab[159]
#define __pyx_n_u_ldc __pyx_string_tab[160]
#define __pyx_n_u_load_nvidia_dynamic_lib __pyx_string_tab[161]
#define __pyx_n_u_loaded_dl __pyx_string_tab[162]
#define __pyx_n_u_m __pyx_string_tab[163]
#define __pyx_n_u_main __pyx_string_tab[164]
#define __pyx_n_u_matA __pyx_string_tab[165]
#define __pyx_n_u_matB __pyx_string_tab[166]
#define __pyx_n_u_matC __pyx_string_tab[167]
#define __pyx_n_u_mb __pyx_string_tab[168]
#define __pyx_n_u_metaclass __pyx_string_tab[169]
#define __pyx_n_u_mode __pyx_string_tab[170]
#define __pyx_n_u_module __pyx_string_tab[171]
#define __pyx_n_u_mro_entries __pyx_string_tab[172]
#define __pyx_n_u_msg __pyx_string_tab[173]
#define __pyx_n_u_n __pyx_string_tab[174]
#define __pyx_n_u_name __pyx_string_tab[175]
#define __pyx_n_u_name_2 __pyx_string_tab[176]
#define __pyx_n_u_new __pyx_string_tab[177]
#define __pyx_n_u_nnz __pyx_string_tab[178]
#define __pyx_n_u_nnzA __pyx_string_tab[179]
#define __pyx_n_u_nnzB __pyx_string_tab[180]
#define __pyx_n_u_nnzD __pyx_string_tab[181]
#define __pyx_n_u_nnzPerCol __pyx_string_tab[182]
#define __pyx_n_u_nnzPerRow __pyx_string_tab[183]
#define __pyx_n_u_nnzPerRowColumn __pyx_string_tab[184]
#define __pyx_n_u_nnzTotalDevHostPtr __pyx_string_tab[185]
#define __pyx_n_u_nnzb __pyx_string_tab[186]
#define __pyx_n_u_nrhs __pyx_string_tab[187]
#define __pyx_n_u_opA __pyx_string_tab[188]
#define __pyx_n_u_opB __pyx_string_tab[189]
#define __pyx_n_u_opX __pyx_string_tab[190]
#define __pyx_n_u_order __pyx_string_tab[191]
#define __pyx_n_u_outColInd __pyx_string_tab[192]
#define __pyx_n_u_outRowPtr __pyx_string_tab[193]
#define __pyx_n_u_outVal __pyx_string_tab[194]
#define __pyx_n_u_p __pyx_string_tab[195]
#define __pyx_n_u_pBuffer __pyx_string_tab[196]
#define __pyx_n_u_pInputBuffer __pyx_string_tab[197]
#define __pyx_n_u_pathfinder __pyx_string_tab[198]
#define __pyx_n_u_policy __pyx_string_tab[199]
#define __pyx_n_u_pop __pyx_string_tab[200]
#define __pyx_n_u_position __pyx_string_tab[201]
#define __pyx_n_u_prepare __pyx_string_tab[202]
#define __pyx_n_u_pyx_capi __pyx_string_tab[203]
#define __pyx_n_u_pyx_checksum __pyx_string_tab[204]
#define __pyx_n_u_pyx_state __pyx_string_tab[205]
#define __pyx_n_u_pyx_type __pyx_string_tab[206]
#define __pyx_n_u_pyx_unpickle_CooAoSAttributes __pyx_string_tab[207]
#define __pyx_n_u_pyx_unpickle_CooAttributes __pyx_string_tab[208]
#define __pyx_n_u_pyx_unpickle_CsrAttributes __pyx_string_tab[209]
#define __pyx_n_u_pyx_unpickle_DnMatAttributes __pyx_string_tab[210]
#define __pyx_n_u_pyx_unpickle_DnMatBatchAttribu __pyx_string_tab[211]
#define __pyx_n_u_pyx_unpickle_DnVecAttributes __pyx_string_tab[212]
#define __pyx_n_u_pyx_unpickle_SpVecAttributes __pyx_string_tab[213]
#define __pyx_n_u_pyx_vtable __pyx_string_tab[214]
#define __pyx_n_u_qualname __pyx_string_tab[215]
#define __pyx_n_u_reduce __pyx_string_tab[216]
#define __pyx_n_u_reduce_cython __pyx_string_tab[217]
#define __pyx_n_u_reduce_ex __pyx_string_tab[218]
#define __pyx_n_u_result __pyx_string_tab[219]
#define __pyx_n_u_rowIdx __pyx_string_tab[220]
#define __pyx_n_u_rowOffsetType __pyx_string_tab[221]
#define __pyx_n_u_rowOffsets __pyx_string_tab[222]
#define __pyx_n_u_rowPtr __pyx_string_tab[223]
#define __pyx_n_u_rows __pyx_string_tab[224]
#define __pyx_n_u_self __pyx_string_tab[225]
#define __pyx_n_u_set_name __pyx_string_tab[226]
#define __pyx_n_u_setdefault __pyx_string_tab[227]
#define __pyx_n_u_setstate __pyx_string_tab[228]
#define __pyx_n_u_setstate_cython __pyx_string_tab[229]
#define __pyx_n_u_size __pyx_string_tab[230]
#define __pyx_n_u_spMatDescr __pyx_string_tab[231]
#define __pyx_n_u_spgeamDescr __pyx_string_tab[232]
#define __pyx_n_u_spgemmDescr __pyx_string_tab[233]
#define __pyx_n_u_spsmDescr __pyx_string_tab[234]
#define __pyx_n_u_status __pyx_string_tab[235]
#define __pyx_n_u_stream __pyx_string_tab[236]
#define __pyx_n_u_stride __pyx_string_tab[237]
#define __pyx_n_u_super __pyx_string_tab[238]
#define __pyx_n_u_sys __pyx_string_tab[239]
#define __pyx_n_u_sys_2 __pyx_string_tab[240]
#define __pyx_n_u_test __pyx_string_tab[241]
#define __pyx_n_u_tol __pyx_string_tab[242]
#define __pyx_n_u_transA __pyx_string_tab[243]
#define __pyx_n_u_transB __pyx_string_tab[244]
#define __pyx_n_u_typ __pyx_string_tab[245]
#define __pyx_n_u_update __pyx_string_tab[246]
#define __pyx_n_u_valType __pyx_string_tab[247]
#define __pyx_n_u_valueType __pyx_string_tab[248]
#define __pyx_n_u_values __pyx_string_tab[249]
#define __pyx_n_u_vecX __pyx_string_tab[250]
#define __pyx_n_u_vecY __pyx_string_tab[251]
#define __pyx_n_u_workspace __pyx_string_tab[252]
#define __pyx_n_u_x __pyx_string_tab[253]
#define __pyx_n_u_xInd __pyx_string_tab[254]
#define __pyx_n_u_xVal __pyx_string_tab[255]
#define __pyx_n_u_xtype __pyx_string_tab[256]
#define __pyx_n_u_y __pyx_string_tab[257]
#define __pyx_n_u_ytype __pyx_string_tab[258]
#define __pyx_kp_b_int__is_hip_environment_deviceAt __pyx_string_tab[259]
#define __pyx_kp_b_int_intptr_t_int___pyx_skip_disp __pyx_string_tab[260]
#define __pyx_kp_b_intptr_t_int___pyx_skip_dispatch __pyx_string_tab[261]
#define __pyx_kp_b_intptr_t_void_get_current_stream __pyx_string_tab[262]
#define __pyx_kp_b_iso88591_A_AXT __pyx_string_tab[263]
#define __pyx_kp_b_iso88591_A_Ja_1_Qa_q_Ry_D_vS_q __pyx_string_tab[264]
#define __pyx_n_b_HIPSPARSE_STATUS_ALLOC_FAILED __pyx_string_tab[265]
#define __pyx_n_b_HIPSPARSE_STATUS_ARCH_MISMATCH __pyx_string_tab[266]
#define __pyx_n_b_HIPSPARSE_STATUS_EXECUTION_FAILE __pyx_string_tab[267]
#define __pyx_n_b_HIPSPARSE_STATUS_INSUFFICIENT_RE __pyx_string_tab[268]
#define __pyx_n_b_HIPSPARSE_STATUS_INTERNAL_ERROR __pyx_string_tab[269]
#define __pyx_n_b_HIPSPARSE_STATUS_INVALID_VALUE __pyx_string_tab[270]
#define __pyx_n_b_HIPSPARSE_STATUS_MAPPING_ERROR __pyx_string_tab[271]
#define __pyx_n_b_HIPSPARSE_STATUS_MATRIX_TYPE_NOT __pyx_string_tab[272]
#define __pyx_n_b_HIPSPARSE_STATUS_NOT_INITIALIZED __pyx_string_tab[273]
#define __pyx_n_b_HIPSPARSE_STATUS_NOT_SUPPORTED __pyx_string_tab[274]
#define __pyx_n_b_HIPSPARSE_STATUS_SUCCESS __pyx_string_tab[275]
#define __pyx_n_b_HIPSPARSE_STATUS_ZERO_PIVOT __pyx_string_tab[276]
#define __pyx_int_0 __pyx_number_tab[0]
#define __pyx_int_1 __pyx_number_tab[1]
#define __pyx_int_2 __pyx_number_tab[2]
#define __pyx_int_3 __pyx_number_tab[3]
#define __pyx_int_4 __pyx_number_tab[4]
#define __pyx_int_5 __pyx_number_tab[5]
#define __pyx_int_6 __pyx_number_tab[6]
#define __pyx_int_7 __pyx_number_tab[7]
#define __pyx_int_8 __pyx_number_tab[8]
#define __pyx_int_9 __pyx_number_tab[9]
#define __pyx_int_10 __pyx_number_tab[10]
#define __pyx_int_11 __pyx_number_tab[11]
#define __pyx_int_38849453 __pyx_number_tab[12]
#define __pyx_int_43729802 __pyx_number_tab[13]
#define __pyx_int_78664458 __pyx_number_tab[14]
#define __pyx_int_82484563 __pyx_number_tab[15]
#define __pyx_int_95034960 __pyx_number_tab[16]
#define __pyx_int_185334054 __pyx_number_tab[17]
#define __pyx_int_243297874 __pyx_number_tab[18]
/* #### Code section: module_state_clear ### */
#if CYTHON_USE_MODULE_STATE
static CYTHON_SMALL_CODE int __pyx_m_clear(PyObject *m) {
  __pyx_mstatetype *clear_module_state = __Pyx_PyModule_GetState(m);
  if (!clear_module_state) return 0;
  Py_CLEAR(clear_module_state->__pyx_d);
  Py_CLEAR(clear_module_state->__pyx_b);
  Py_CLEAR(clear_module_state->__pyx_cython_runtime);
  Py_CLEAR(clear_module_state->__pyx_empty_tuple);
  Py_CLEAR(clear_module_state->__pyx_empty_bytes);
  Py_CLEAR(clear_module_state->__pyx_empty_unicode);
  #if CYTHON_PEP489_MULTI_PHASE_INIT
  __Pyx_State_RemoveModule(NULL);
  #endif
  Py_CLEAR(clear_module_state->__pyx_ptype_13cupy_backends_4cuda_3api_7runtime_PointerAttributes);
  Py_CLEAR(clear_module_state->__pyx_ptype_13cupy_backends_4cuda_3api_7runtime_MemPoolProps);
  Py_CLEAR(clear_module_state->__pyx_ptype_13cupy_backends_4cuda_9_softlink_SoftLink);
  Py_CLEAR(clear_module_state->__pyx_ptype_13cupy_backends_4cuda_4libs_8cusparse_SpVecAttributes);
  Py_CLEAR(clear_module_state->__pyx_type_13cupy_backends_4cuda_4libs_8cusparse_SpVecAttributes);
  Py_CLEAR(clear_module_state->__pyx_ptype_13cupy_backends_4cuda_4libs_8cusparse_CooAttributes);
  Py_CLEAR(clear_module_state->__pyx_type_13cupy_backends_4cuda_4libs_8cusparse_CooAttributes);
  Py_CLEAR(clear_module_state->__pyx_ptype_13cupy_backends_4cuda_4libs_8cusparse_CooAoSAttributes);
  Py_CLEAR(clear_module_state->__pyx_type_13cupy_backends_4cuda_4libs_8cusparse_CooAoSAttributes);
  Py_CLEAR(clear_module_state->__pyx_ptype_13cupy_backends_4cuda_4libs_8cusparse_CsrAttributes);
  Py_CLEAR(clear_module_state->__pyx_type_13cupy_backends_4cuda_4libs_8cusparse_CsrAttributes);
  Py_CLEAR(clear_module_state->__pyx_ptype_13cupy_backends_4cuda_4libs_8cusparse_DnVecAttributes);
  Py_CLEAR(clear_module_state->__pyx_type_13cupy_backends_4cuda_4libs_8cusparse_DnVecAttributes);
  Py_CLEAR(clear_module_state->__pyx_ptype_13cupy_backends_4cuda_4libs_8cusparse_DnMatAttributes);
  Py_CLEAR(clear_module_state->__pyx_type_13cupy_backends_4cuda_4libs_8cusparse_DnMatAttributes);
  Py_CLEAR(clear_module_state->__pyx_ptype_13cupy_backends_4cuda_4libs_8cusparse_DnMatBatchAttributes);
  Py_CLEAR(clear_module_state->__pyx_type_13cupy_backends_4cuda_4libs_8cusparse_DnMatBatchAttributes);
  for (int i=0; i<2; ++i) { Py_CLEAR(clear_module_state->__pyx_codeobj_tab[i]); }
  for (int i=0; i<277; ++i) { Py_CLEAR(clear_module_state->__pyx_string_tab[i]); }
  for (int i=0; i<19; ++i) { Py_CLEAR(clear_module_state->__pyx_number_tab[i]); }
/* #### Code section: module_state_clear_contents ### */
/* CommonTypesMetaclass.module_state_clear */
Py_CLEAR(clear_module_state->__pyx_CommonTypesMetaclassType);

/* CythonFunctionShared.module_state_clear */
Py_CLEAR(clear_module_state->__pyx_CyFunctionType);

/* #### Code section: module_state_clear_end ### */
return 0;
}
#endif
/* #### Code section: module_state_traverse ### */
#if CYTHON_USE_MODULE_STATE
static CYTHON_SMALL_CODE int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) {
  __pyx_mstatetype *traverse_module_state = __Pyx_PyModule_GetState(m);
  if (!traverse_module_state) return 0;
  Py_VISIT(traverse_module_state->__pyx_d);
  Py_VISIT(traverse_module_state->__pyx_b);
  Py_VISIT(traverse_module_state->__pyx_cython_runtime);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_tuple);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_bytes);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_unicode);
  Py_VISIT(traverse_module_state->__pyx_ptype_13cupy_backends_4cuda_3api_7runtime_PointerAttributes);
  Py_VISIT(traverse_module_state->__pyx_ptype_13cupy_backends_4cuda_3api_7runtime_MemPoolProps);
  Py_VISIT(traverse_module_state->__pyx_ptype_13cupy_backends_4cuda_9_softlink_SoftLink);
  Py_VISIT(traverse_module_state->__pyx_ptype_13cupy_backends_4cuda_4libs_8cusparse_SpVecAttributes);
  Py_VISIT(traverse_module_state->__pyx_type_13cupy_backends_4cuda_4libs_8cusparse_SpVecAttributes);
  Py_VISIT(traverse_module_state->__pyx_ptype_13cupy_backends_4cuda_4libs_8cusparse_CooAttributes);
  Py_VISIT(traverse_module_state->__pyx_type_13cupy_backends_4cuda_4libs_8cusparse_CooAttributes);
  Py_VISIT(traverse_module_state->__pyx_ptype_13cupy_backends_4cuda_4libs_8cusparse_CooAoSAttributes);
  Py_VISIT(traverse_module_state->__pyx_type_13cupy_backends_4cuda_4libs_8cusparse_CooAoSAttributes);
  Py_VISIT(traverse_module_state->__pyx_ptype_13cupy_backends_4cuda_4libs_8cusparse_CsrAttributes);
  Py_VISIT(traverse_module_state->__pyx_type_13cupy_backends_4cuda_4libs_8cusparse_CsrAttributes);
  Py_VISIT(traverse_module_state->__pyx_ptype_13cupy_backends_4cuda_4libs_8cusparse_DnVecAttributes);
  Py_VISIT(traverse_module_state->__pyx_type_13cupy_backends_4cuda_4libs_8cusparse_DnVecAttributes);
  Py_VISIT(traverse_module_state->__pyx_ptype_13cupy_backends_4cuda_4libs_8cusparse_DnMatAttributes);
  Py_VISIT(traverse_module_state->__pyx_type_13cupy_backends_4cuda_4libs_8cusparse_DnMatAttributes);
  Py_VISIT(traverse_module_state->__pyx_ptype_13cupy_backends_4cuda_4libs_8cusparse_DnMatBatchAttributes);
  Py_VISIT(traverse_module_state->__pyx_type_13cupy_backends_4cuda_4libs_8cusparse_DnMatBatchAttributes);
  for (int i=0; i<2; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_codeobj_tab[i]); }
  for (int i=0; i<277; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_string_tab[i]); }
  for (int i=0; i<19; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_number_tab[i]); }
/* #### Code section: module_state_traverse_contents ### */
/* CommonTypesMetaclass.module_state_traverse */
Py_VISIT(traverse_module_state->__pyx_CommonTypesMetaclassType);

/* CythonFunctionShared.module_state_traverse */
Py_VISIT(traverse_module_state->__pyx_CyFunctionType);

/* #### Code section: module_state_traverse_end ### */
return 0;
}
#endif
/* #### Code section: module_code ### */

/* "cupy_backends/cuda/libs/cusparse.pyx":1433
 * 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_13cupy_backends_4cuda_4libs_8cusparse_15SpVecAttributes_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_13cupy_backends_4cuda_4libs_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;
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[7] = {0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_size,&__pyx_mstate_global->__pyx_n_u_nnz,&__pyx_mstate_global->__pyx_n_u_idx,&__pyx_mstate_global->__pyx_n_u_values,&__pyx_mstate_global->__pyx_n_u_idxType,&__pyx_mstate_global->__pyx_n_u_idxBase,&__pyx_mstate_global->__pyx_n_u_valueType,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 1433, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  7:
        values[6] = __Pyx_ArgRef_VARARGS(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 1433, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_VARARGS(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 1433, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_VARARGS(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1433, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_VARARGS(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1433, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_VARARGS(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1433, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1433, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1433, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < (0)) __PYX_ERR(0, 1433, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 7; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 7, 7, i); __PYX_ERR(0, 1433, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 7)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1433, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1433, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_VARARGS(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1433, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_VARARGS(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1433, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_VARARGS(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1433, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_VARARGS(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 1433, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_VARARGS(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 1433, __pyx_L3_error)
    }
    __pyx_v_size = __Pyx_PyLong_As_int64_t(values[0]); if (unlikely((__pyx_v_size == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1433, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyLong_As_int64_t(values[1]); if (unlikely((__pyx_v_nnz == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1433, __pyx_L3_error)
    __pyx_v_idx = PyLong_AsSsize_t(values[2]); if (unlikely((__pyx_v_idx == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1434, __pyx_L3_error)
    __pyx_v_values = PyLong_AsSsize_t(values[3]); if (unlikely((__pyx_v_values == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1434, __pyx_L3_error)
    __pyx_v_idxType = __Pyx_PyLong_As_cusparseIndexType_t(values[4]); if (unlikely((__pyx_v_idxType == ((cusparseIndexType_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1435, __pyx_L3_error)
    __pyx_v_idxBase = __Pyx_PyLong_As_cusparseIndexBase_t(values[5]); if (unlikely((__pyx_v_idxBase == ((cusparseIndexBase_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1435, __pyx_L3_error)
    __pyx_v_valueType = __Pyx_PyLong_As_cudaDataType(values[6]); if (unlikely((__pyx_v_valueType == ((cudaDataType)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1435, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 7, 7, __pyx_nargs); __PYX_ERR(0, 1433, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.SpVecAttributes.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_15SpVecAttributes___init__(((struct __pyx_obj_13cupy_backends_4cuda_4libs_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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_15SpVecAttributes___init__(struct __pyx_obj_13cupy_backends_4cuda_4libs_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;

  /* "cupy_backends/cuda/libs/cusparse.pyx":1436
 *                  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_backends/cuda/libs/cusparse.pyx":1437
 *                  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_backends/cuda/libs/cusparse.pyx":1438
 *         self.size = size
 *         self.nnz = nnz
 *         self.idx = idx             # <<<<<<<<<<<<<<
 *         self.values = values
 *         self.idxType = idxType
*/
  __pyx_v_self->idx = __pyx_v_idx;

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

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

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

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

  /* "cupy_backends/cuda/libs/cusparse.pyx":1433
 * 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;
  return __pyx_r;
}

/* "cupy_backends/cuda/libs/cusparse.pxd":179
 * cdef class SpVecAttributes:
 *     cdef:
 *         public int64_t size             # <<<<<<<<<<<<<<
 *         public int64_t nnz
 *         public intptr_t idx
*/

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_15SpVecAttributes_4size_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_15SpVecAttributes_4size_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_15SpVecAttributes_4size___get__(((struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_SpVecAttributes *)__pyx_v_self));

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_15SpVecAttributes_4size___get__(struct __pyx_obj_13cupy_backends_4cuda_4libs_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_PyLong_From_int64_t(__pyx_v_self->size); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 179, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.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_13cupy_backends_4cuda_4libs_8cusparse_15SpVecAttributes_4size_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_15SpVecAttributes_4size_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_15SpVecAttributes_4size_2__set__(((struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_SpVecAttributes *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_15SpVecAttributes_4size_2__set__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_SpVecAttributes *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  int64_t __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __pyx_t_1 = __Pyx_PyLong_As_int64_t(__pyx_v_value); if (unlikely((__pyx_t_1 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 179, __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_backends.cuda.libs.cusparse.SpVecAttributes.size.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "cupy_backends/cuda/libs/cusparse.pxd":180
 *     cdef:
 *         public int64_t size
 *         public int64_t nnz             # <<<<<<<<<<<<<<
 *         public intptr_t idx
 *         public intptr_t values
*/

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_15SpVecAttributes_3nnz_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_15SpVecAttributes_3nnz_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_15SpVecAttributes_3nnz___get__(((struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_SpVecAttributes *)__pyx_v_self));

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_15SpVecAttributes_3nnz___get__(struct __pyx_obj_13cupy_backends_4cuda_4libs_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_PyLong_From_int64_t(__pyx_v_self->nnz); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 180, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.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_13cupy_backends_4cuda_4libs_8cusparse_15SpVecAttributes_3nnz_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_15SpVecAttributes_3nnz_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_15SpVecAttributes_3nnz_2__set__(((struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_SpVecAttributes *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_15SpVecAttributes_3nnz_2__set__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_SpVecAttributes *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  int64_t __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __pyx_t_1 = __Pyx_PyLong_As_int64_t(__pyx_v_value); if (unlikely((__pyx_t_1 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 180, __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_backends.cuda.libs.cusparse.SpVecAttributes.nnz.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "cupy_backends/cuda/libs/cusparse.pxd":181
 *         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_13cupy_backends_4cuda_4libs_8cusparse_15SpVecAttributes_3idx_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_15SpVecAttributes_3idx_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_15SpVecAttributes_3idx___get__(((struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_SpVecAttributes *)__pyx_v_self));

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_15SpVecAttributes_3idx___get__(struct __pyx_obj_13cupy_backends_4cuda_4libs_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 = PyLong_FromSsize_t(__pyx_v_self->idx); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 181, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.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_13cupy_backends_4cuda_4libs_8cusparse_15SpVecAttributes_3idx_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_15SpVecAttributes_3idx_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_15SpVecAttributes_3idx_2__set__(((struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_SpVecAttributes *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_15SpVecAttributes_3idx_2__set__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_SpVecAttributes *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  intptr_t __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __pyx_t_1 = PyLong_AsSsize_t(__pyx_v_value); if (unlikely((__pyx_t_1 == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 181, __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_backends.cuda.libs.cusparse.SpVecAttributes.idx.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

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

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_15SpVecAttributes_6values_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_15SpVecAttributes_6values_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_15SpVecAttributes_6values___get__(((struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_SpVecAttributes *)__pyx_v_self));

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_15SpVecAttributes_6values___get__(struct __pyx_obj_13cupy_backends_4cuda_4libs_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 = PyLong_FromSsize_t(__pyx_v_self->values); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 182, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.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_13cupy_backends_4cuda_4libs_8cusparse_15SpVecAttributes_6values_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_15SpVecAttributes_6values_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_15SpVecAttributes_6values_2__set__(((struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_SpVecAttributes *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_15SpVecAttributes_6values_2__set__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_SpVecAttributes *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  intptr_t __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __pyx_t_1 = PyLong_AsSsize_t(__pyx_v_value); if (unlikely((__pyx_t_1 == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 182, __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_backends.cuda.libs.cusparse.SpVecAttributes.values.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

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

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_15SpVecAttributes_7idxType_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_15SpVecAttributes_7idxType_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_15SpVecAttributes_7idxType___get__(((struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_SpVecAttributes *)__pyx_v_self));

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_15SpVecAttributes_7idxType___get__(struct __pyx_obj_13cupy_backends_4cuda_4libs_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_PyLong_From_cusparseIndexType_t(__pyx_v_self->idxType); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 183, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.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_13cupy_backends_4cuda_4libs_8cusparse_15SpVecAttributes_7idxType_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_15SpVecAttributes_7idxType_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_15SpVecAttributes_7idxType_2__set__(((struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_SpVecAttributes *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_15SpVecAttributes_7idxType_2__set__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_SpVecAttributes *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  cusparseIndexType_t __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __pyx_t_1 = __Pyx_PyLong_As_cusparseIndexType_t(__pyx_v_value); if (unlikely((__pyx_t_1 == ((cusparseIndexType_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 183, __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_backends.cuda.libs.cusparse.SpVecAttributes.idxType.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "cupy_backends/cuda/libs/cusparse.pxd":184
 *         public intptr_t values
 *         public IndexType idxType
 *         public IndexBase idxBase             # <<<<<<<<<<<<<<
 *         public DataType valueType
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_15SpVecAttributes_7idxBase_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_15SpVecAttributes_7idxBase_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_15SpVecAttributes_7idxBase___get__(((struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_SpVecAttributes *)__pyx_v_self));

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_15SpVecAttributes_7idxBase___get__(struct __pyx_obj_13cupy_backends_4cuda_4libs_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_PyLong_From_cusparseIndexBase_t(__pyx_v_self->idxBase); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 184, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.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_13cupy_backends_4cuda_4libs_8cusparse_15SpVecAttributes_7idxBase_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_15SpVecAttributes_7idxBase_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_15SpVecAttributes_7idxBase_2__set__(((struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_SpVecAttributes *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_15SpVecAttributes_7idxBase_2__set__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_SpVecAttributes *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  cusparseIndexBase_t __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __pyx_t_1 = __Pyx_PyLong_As_cusparseIndexBase_t(__pyx_v_value); if (unlikely((__pyx_t_1 == ((cusparseIndexBase_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 184, __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_backends.cuda.libs.cusparse.SpVecAttributes.idxBase.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

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

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_15SpVecAttributes_9valueType_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_15SpVecAttributes_9valueType_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_15SpVecAttributes_9valueType___get__(((struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_SpVecAttributes *)__pyx_v_self));

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_15SpVecAttributes_9valueType___get__(struct __pyx_obj_13cupy_backends_4cuda_4libs_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_PyLong_From_cudaDataType(__pyx_v_self->valueType); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 185, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.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_13cupy_backends_4cuda_4libs_8cusparse_15SpVecAttributes_9valueType_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_15SpVecAttributes_9valueType_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_15SpVecAttributes_9valueType_2__set__(((struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_SpVecAttributes *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_15SpVecAttributes_9valueType_2__set__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_SpVecAttributes *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  cudaDataType __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __pyx_t_1 = __Pyx_PyLong_As_cudaDataType(__pyx_v_value); if (unlikely((__pyx_t_1 == ((cudaDataType)-1)) && PyErr_Occurred())) __PYX_ERR(1, 185, __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_backends.cuda.libs.cusparse.SpVecAttributes.valueType.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

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

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_15SpVecAttributes_3__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_15SpVecAttributes_2__reduce_cython__, "SpVecAttributes.__reduce_cython__(self)");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_15SpVecAttributes_3__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce_cython__", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_15SpVecAttributes_2__reduce_cython__(((struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_SpVecAttributes *)__pyx_v_self));

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_15SpVecAttributes_2__reduce_cython__(struct __pyx_obj_13cupy_backends_4cuda_4libs_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 and _dict:
*/
  __pyx_t_1 = PyLong_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_PyLong_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_PyLong_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_PyLong_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_PyLong_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_PyLong_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 = PyLong_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);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_1) != (0)) __PYX_ERR(2, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_2) != (0)) __PYX_ERR(2, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_3) != (0)) __PYX_ERR(2, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 3, __pyx_t_4) != (0)) __PYX_ERR(2, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_5);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 4, __pyx_t_5) != (0)) __PYX_ERR(2, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_6);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 5, __pyx_t_6) != (0)) __PYX_ERR(2, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_7);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 6, __pyx_t_7) != (0)) __PYX_ERR(2, 5, __pyx_L1_error);
  __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 and _dict:
 *         state += (_dict,)
*/
  __pyx_t_8 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_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 and _dict:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
*/
  __pyx_t_10 = (__pyx_v__dict != Py_None);
  if (__pyx_t_10) {
  } else {
    __pyx_t_9 = __pyx_t_10;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v__dict); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(2, 7, __pyx_L1_error)
  __pyx_t_9 = __pyx_t_10;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_9) {

    /* "(tree fragment)":8
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None and _dict:
 *         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);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v__dict) != (0)) __PYX_ERR(2, 8, __pyx_L1_error);
    __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 and _dict:
 *         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 and _dict:             # <<<<<<<<<<<<<<
 *         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), 0xb0bf926, 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), 0xb0bf926, None), state
 *     else:
*/
  if (__pyx_v_use_setstate) {

    /* "(tree fragment)":13
 *         use_setstate = False
 *     if use_setstate:
 *         return __pyx_unpickle_SpVecAttributes, (type(self), 0xb0bf926, None), state             # <<<<<<<<<<<<<<
 *     else:
 *         return __pyx_unpickle_SpVecAttributes, (type(self), 0xb0bf926, state)
*/
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_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))));
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))) != (0)) __PYX_ERR(2, 13, __pyx_L1_error);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_int_185334054);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_185334054);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_mstate_global->__pyx_int_185334054) != (0)) __PYX_ERR(2, 13, __pyx_L1_error);
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 2, Py_None) != (0)) __PYX_ERR(2, 13, __pyx_L1_error);
    __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);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_7) != (0)) __PYX_ERR(2, 13, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_8);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_8) != (0)) __PYX_ERR(2, 13, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_v_state) != (0)) __PYX_ERR(2, 13, __pyx_L1_error);
    __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), 0xb0bf926, None), state
 *     else:
*/
  }

  /* "(tree fragment)":15
 *         return __pyx_unpickle_SpVecAttributes, (type(self), 0xb0bf926, None), state
 *     else:
 *         return __pyx_unpickle_SpVecAttributes, (type(self), 0xb0bf926, 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_mstate_global->__pyx_n_u_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))));
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))) != (0)) __PYX_ERR(2, 15, __pyx_L1_error);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_int_185334054);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_185334054);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_mstate_global->__pyx_int_185334054) != (0)) __PYX_ERR(2, 15, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_v_state) != (0)) __PYX_ERR(2, 15, __pyx_L1_error);
    __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);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6) != (0)) __PYX_ERR(2, 15, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_8);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_8) != (0)) __PYX_ERR(2, 15, __pyx_L1_error);
    __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_backends.cuda.libs.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), 0xb0bf926, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_SpVecAttributes__set_state(self, __pyx_state)
*/

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_15SpVecAttributes_5__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_15SpVecAttributes_4__setstate_cython__, "SpVecAttributes.__setstate_cython__(self, __pyx_state)");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_15SpVecAttributes_5__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(2, 16, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(2, 16, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__setstate_cython__", 0) < (0)) __PYX_ERR(2, 16, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, i); __PYX_ERR(2, 16, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(2, 16, __pyx_L3_error)
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(2, 16, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.SpVecAttributes.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_15SpVecAttributes_4__setstate_cython__(((struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_SpVecAttributes *)__pyx_v_self), __pyx_v___pyx_state);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_15SpVecAttributes_4__setstate_cython__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_SpVecAttributes *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  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("__setstate_cython__", 0);

  /* "(tree fragment)":17
 *         return __pyx_unpickle_SpVecAttributes, (type(self), 0xb0bf926, state)
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_SpVecAttributes__set_state(self, __pyx_state)             # <<<<<<<<<<<<<<
*/
  __pyx_t_1 = __pyx_v___pyx_state;
  __Pyx_INCREF(__pyx_t_1);
  if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(2, 17, __pyx_L1_error)
  if (unlikely(__pyx_t_1 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "cannot pass None into a C function argument that is declared 'not None'");
    __PYX_ERR(2, 17, __pyx_L1_error)
  }
  __pyx_t_2 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse___pyx_unpickle_SpVecAttributes__set_state(__pyx_v_self, ((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_SpVecAttributes, (type(self), 0xb0bf926, 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_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.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_backends/cuda/libs/cusparse.pyx":1447
 * 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_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_13cupy_backends_4cuda_4libs_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;
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_rows,&__pyx_mstate_global->__pyx_n_u_cols,&__pyx_mstate_global->__pyx_n_u_nnz,&__pyx_mstate_global->__pyx_n_u_rowIdx,&__pyx_mstate_global->__pyx_n_u_colIdx,&__pyx_mstate_global->__pyx_n_u_values,&__pyx_mstate_global->__pyx_n_u_idxType,&__pyx_mstate_global->__pyx_n_u_idxBase,&__pyx_mstate_global->__pyx_n_u_valueType,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 1447, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  9:
        values[8] = __Pyx_ArgRef_VARARGS(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 1447, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_VARARGS(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 1447, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_VARARGS(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 1447, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_VARARGS(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 1447, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_VARARGS(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1447, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_VARARGS(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1447, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_VARARGS(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1447, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1447, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1447, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < (0)) __PYX_ERR(0, 1447, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 9; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 9, 9, i); __PYX_ERR(0, 1447, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 9)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1447, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1447, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_VARARGS(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1447, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_VARARGS(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1447, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_VARARGS(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1447, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_VARARGS(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 1447, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_VARARGS(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 1447, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_VARARGS(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 1447, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_VARARGS(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 1447, __pyx_L3_error)
    }
    __pyx_v_rows = __Pyx_PyLong_As_int64_t(values[0]); if (unlikely((__pyx_v_rows == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1447, __pyx_L3_error)
    __pyx_v_cols = __Pyx_PyLong_As_int64_t(values[1]); if (unlikely((__pyx_v_cols == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1447, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyLong_As_int64_t(values[2]); if (unlikely((__pyx_v_nnz == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1447, __pyx_L3_error)
    __pyx_v_rowIdx = PyLong_AsSsize_t(values[3]); if (unlikely((__pyx_v_rowIdx == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1448, __pyx_L3_error)
    __pyx_v_colIdx = PyLong_AsSsize_t(values[4]); if (unlikely((__pyx_v_colIdx == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1448, __pyx_L3_error)
    __pyx_v_values = PyLong_AsSsize_t(values[5]); if (unlikely((__pyx_v_values == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1448, __pyx_L3_error)
    __pyx_v_idxType = __Pyx_PyLong_As_cusparseIndexType_t(values[6]); if (unlikely((__pyx_v_idxType == ((cusparseIndexType_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1449, __pyx_L3_error)
    __pyx_v_idxBase = __Pyx_PyLong_As_cusparseIndexBase_t(values[7]); if (unlikely((__pyx_v_idxBase == ((cusparseIndexBase_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1449, __pyx_L3_error)
    __pyx_v_valueType = __Pyx_PyLong_As_cudaDataType(values[8]); if (unlikely((__pyx_v_valueType == ((cudaDataType)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1449, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 9, 9, __pyx_nargs); __PYX_ERR(0, 1447, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.CooAttributes.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes___init__(((struct __pyx_obj_13cupy_backends_4cuda_4libs_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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes___init__(struct __pyx_obj_13cupy_backends_4cuda_4libs_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;

  /* "cupy_backends/cuda/libs/cusparse.pyx":1450
 *                  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_backends/cuda/libs/cusparse.pyx":1451
 *                  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_backends/cuda/libs/cusparse.pyx":1452
 *         self.rows = rows
 *         self.cols = cols
 *         self.nnz = nnz             # <<<<<<<<<<<<<<
 *         self.rowIdx = rowIdx
 *         self.colIdx = colIdx
*/
  __pyx_v_self->nnz = __pyx_v_nnz;

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

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

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

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

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

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

  /* "cupy_backends/cuda/libs/cusparse.pyx":1447
 * 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;
  return __pyx_r;
}

/* "cupy_backends/cuda/libs/cusparse.pxd":189
 * cdef class CooAttributes:
 *     cdef:
 *         public int64_t rows             # <<<<<<<<<<<<<<
 *         public int64_t cols
 *         public int64_t nnz
*/

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_4rows_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_4rows_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_4rows___get__(((struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CooAttributes *)__pyx_v_self));

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_4rows___get__(struct __pyx_obj_13cupy_backends_4cuda_4libs_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_PyLong_From_int64_t(__pyx_v_self->rows); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 189, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.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_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_4rows_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_4rows_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_4rows_2__set__(((struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CooAttributes *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_4rows_2__set__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CooAttributes *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  int64_t __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __pyx_t_1 = __Pyx_PyLong_As_int64_t(__pyx_v_value); if (unlikely((__pyx_t_1 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 189, __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_backends.cuda.libs.cusparse.CooAttributes.rows.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "cupy_backends/cuda/libs/cusparse.pxd":190
 *     cdef:
 *         public int64_t rows
 *         public int64_t cols             # <<<<<<<<<<<<<<
 *         public int64_t nnz
 *         public intptr_t rowIdx
*/

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_4cols_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_4cols_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_4cols___get__(((struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CooAttributes *)__pyx_v_self));

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_4cols___get__(struct __pyx_obj_13cupy_backends_4cuda_4libs_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_PyLong_From_int64_t(__pyx_v_self->cols); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 190, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.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_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_4cols_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_4cols_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_4cols_2__set__(((struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CooAttributes *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_4cols_2__set__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CooAttributes *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  int64_t __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __pyx_t_1 = __Pyx_PyLong_As_int64_t(__pyx_v_value); if (unlikely((__pyx_t_1 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 190, __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_backends.cuda.libs.cusparse.CooAttributes.cols.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "cupy_backends/cuda/libs/cusparse.pxd":191
 *         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_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_3nnz_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_3nnz_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_3nnz___get__(((struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CooAttributes *)__pyx_v_self));

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_3nnz___get__(struct __pyx_obj_13cupy_backends_4cuda_4libs_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_PyLong_From_int64_t(__pyx_v_self->nnz); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 191, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.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_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_3nnz_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_3nnz_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_3nnz_2__set__(((struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CooAttributes *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_3nnz_2__set__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CooAttributes *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  int64_t __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __pyx_t_1 = __Pyx_PyLong_As_int64_t(__pyx_v_value); if (unlikely((__pyx_t_1 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 191, __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_backends.cuda.libs.cusparse.CooAttributes.nnz.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "cupy_backends/cuda/libs/cusparse.pxd":192
 *         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_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_6rowIdx_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_6rowIdx_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_6rowIdx___get__(((struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CooAttributes *)__pyx_v_self));

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_6rowIdx___get__(struct __pyx_obj_13cupy_backends_4cuda_4libs_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 = PyLong_FromSsize_t(__pyx_v_self->rowIdx); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 192, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.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_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_6rowIdx_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_6rowIdx_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_6rowIdx_2__set__(((struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CooAttributes *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_6rowIdx_2__set__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CooAttributes *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  intptr_t __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __pyx_t_1 = PyLong_AsSsize_t(__pyx_v_value); if (unlikely((__pyx_t_1 == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 192, __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_backends.cuda.libs.cusparse.CooAttributes.rowIdx.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "cupy_backends/cuda/libs/cusparse.pxd":193
 *         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_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_6colIdx_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_6colIdx_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_6colIdx___get__(((struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CooAttributes *)__pyx_v_self));

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_6colIdx___get__(struct __pyx_obj_13cupy_backends_4cuda_4libs_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 = PyLong_FromSsize_t(__pyx_v_self->colIdx); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 193, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.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_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_6colIdx_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_6colIdx_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_6colIdx_2__set__(((struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CooAttributes *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_6colIdx_2__set__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CooAttributes *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  intptr_t __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __pyx_t_1 = PyLong_AsSsize_t(__pyx_v_value); if (unlikely((__pyx_t_1 == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 193, __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_backends.cuda.libs.cusparse.CooAttributes.colIdx.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "cupy_backends/cuda/libs/cusparse.pxd":194
 *         public intptr_t rowIdx
 *         public intptr_t colIdx
 *         public intptr_t values             # <<<<<<<<<<<<<<
 *         public IndexType idxType
 *         public IndexBase idxBase
*/

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_6values_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_6values_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_6values___get__(((struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CooAttributes *)__pyx_v_self));

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_6values___get__(struct __pyx_obj_13cupy_backends_4cuda_4libs_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 = PyLong_FromSsize_t(__pyx_v_self->values); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 194, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.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_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_6values_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_6values_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_6values_2__set__(((struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CooAttributes *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_6values_2__set__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CooAttributes *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  intptr_t __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __pyx_t_1 = PyLong_AsSsize_t(__pyx_v_value); if (unlikely((__pyx_t_1 == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 194, __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_backends.cuda.libs.cusparse.CooAttributes.values.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

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

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_7idxType_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_7idxType_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_7idxType___get__(((struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CooAttributes *)__pyx_v_self));

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_7idxType___get__(struct __pyx_obj_13cupy_backends_4cuda_4libs_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_PyLong_From_cusparseIndexType_t(__pyx_v_self->idxType); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 195, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.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_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_7idxType_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_7idxType_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_7idxType_2__set__(((struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CooAttributes *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_7idxType_2__set__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CooAttributes *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  cusparseIndexType_t __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __pyx_t_1 = __Pyx_PyLong_As_cusparseIndexType_t(__pyx_v_value); if (unlikely((__pyx_t_1 == ((cusparseIndexType_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 195, __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_backends.cuda.libs.cusparse.CooAttributes.idxType.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "cupy_backends/cuda/libs/cusparse.pxd":196
 *         public intptr_t values
 *         public IndexType idxType
 *         public IndexBase idxBase             # <<<<<<<<<<<<<<
 *         public DataType valueType
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_7idxBase_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_7idxBase_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_7idxBase___get__(((struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CooAttributes *)__pyx_v_self));

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_7idxBase___get__(struct __pyx_obj_13cupy_backends_4cuda_4libs_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_PyLong_From_cusparseIndexBase_t(__pyx_v_self->idxBase); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 196, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.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_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_7idxBase_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_7idxBase_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_7idxBase_2__set__(((struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CooAttributes *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_7idxBase_2__set__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CooAttributes *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  cusparseIndexBase_t __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __pyx_t_1 = __Pyx_PyLong_As_cusparseIndexBase_t(__pyx_v_value); if (unlikely((__pyx_t_1 == ((cusparseIndexBase_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 196, __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_backends.cuda.libs.cusparse.CooAttributes.idxBase.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

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

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_9valueType_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_9valueType_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_9valueType___get__(((struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CooAttributes *)__pyx_v_self));

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_9valueType___get__(struct __pyx_obj_13cupy_backends_4cuda_4libs_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_PyLong_From_cudaDataType(__pyx_v_self->valueType); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 197, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.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_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_9valueType_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_9valueType_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_9valueType_2__set__(((struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CooAttributes *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_9valueType_2__set__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CooAttributes *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  cudaDataType __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __pyx_t_1 = __Pyx_PyLong_As_cudaDataType(__pyx_v_value); if (unlikely((__pyx_t_1 == ((cudaDataType)-1)) && PyErr_Occurred())) __PYX_ERR(1, 197, __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_backends.cuda.libs.cusparse.CooAttributes.valueType.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

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

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_3__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_2__reduce_cython__, "CooAttributes.__reduce_cython__(self)");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_3__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce_cython__", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_2__reduce_cython__(((struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CooAttributes *)__pyx_v_self));

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_2__reduce_cython__(struct __pyx_obj_13cupy_backends_4cuda_4libs_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 and _dict:
*/
  __pyx_t_1 = PyLong_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_PyLong_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_PyLong_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_PyLong_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_PyLong_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 = PyLong_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_PyLong_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_PyLong_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 = PyLong_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);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_1) != (0)) __PYX_ERR(2, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_2) != (0)) __PYX_ERR(2, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_t_3) != (0)) __PYX_ERR(2, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 3, __pyx_t_4) != (0)) __PYX_ERR(2, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_5);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 4, __pyx_t_5) != (0)) __PYX_ERR(2, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_6);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 5, __pyx_t_6) != (0)) __PYX_ERR(2, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_7);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 6, __pyx_t_7) != (0)) __PYX_ERR(2, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_8);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 7, __pyx_t_8) != (0)) __PYX_ERR(2, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_9);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 8, __pyx_t_9) != (0)) __PYX_ERR(2, 5, __pyx_L1_error);
  __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 and _dict:
 *         state += (_dict,)
*/
  __pyx_t_10 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_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 and _dict:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
*/
  __pyx_t_12 = (__pyx_v__dict != Py_None);
  if (__pyx_t_12) {
  } else {
    __pyx_t_11 = __pyx_t_12;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_v__dict); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(2, 7, __pyx_L1_error)
  __pyx_t_11 = __pyx_t_12;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_11) {

    /* "(tree fragment)":8
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None and _dict:
 *         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);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v__dict) != (0)) __PYX_ERR(2, 8, __pyx_L1_error);
    __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 and _dict:
 *         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 and _dict:             # <<<<<<<<<<<<<<
 *         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), 0xe806e52, 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), 0xe806e52, None), state
 *     else:
*/
  if (__pyx_v_use_setstate) {

    /* "(tree fragment)":13
 *         use_setstate = False
 *     if use_setstate:
 *         return __pyx_unpickle_CooAttributes, (type(self), 0xe806e52, None), state             # <<<<<<<<<<<<<<
 *     else:
 *         return __pyx_unpickle_CooAttributes, (type(self), 0xe806e52, state)
*/
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_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))));
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))) != (0)) __PYX_ERR(2, 13, __pyx_L1_error);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_int_243297874);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_243297874);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_mstate_global->__pyx_int_243297874) != (0)) __PYX_ERR(2, 13, __pyx_L1_error);
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 2, Py_None) != (0)) __PYX_ERR(2, 13, __pyx_L1_error);
    __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);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_9) != (0)) __PYX_ERR(2, 13, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_10);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_10) != (0)) __PYX_ERR(2, 13, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_v_state) != (0)) __PYX_ERR(2, 13, __pyx_L1_error);
    __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), 0xe806e52, None), state
 *     else:
*/
  }

  /* "(tree fragment)":15
 *         return __pyx_unpickle_CooAttributes, (type(self), 0xe806e52, None), state
 *     else:
 *         return __pyx_unpickle_CooAttributes, (type(self), 0xe806e52, 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_mstate_global->__pyx_n_u_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))));
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))) != (0)) __PYX_ERR(2, 15, __pyx_L1_error);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_int_243297874);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_243297874);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_mstate_global->__pyx_int_243297874) != (0)) __PYX_ERR(2, 15, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_v_state) != (0)) __PYX_ERR(2, 15, __pyx_L1_error);
    __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);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8) != (0)) __PYX_ERR(2, 15, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_10);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_10) != (0)) __PYX_ERR(2, 15, __pyx_L1_error);
    __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_backends.cuda.libs.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), 0xe806e52, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_CooAttributes__set_state(self, __pyx_state)
*/

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_5__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_4__setstate_cython__, "CooAttributes.__setstate_cython__(self, __pyx_state)");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_5__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(2, 16, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(2, 16, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__setstate_cython__", 0) < (0)) __PYX_ERR(2, 16, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, i); __PYX_ERR(2, 16, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(2, 16, __pyx_L3_error)
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(2, 16, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.CooAttributes.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_4__setstate_cython__(((struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CooAttributes *)__pyx_v_self), __pyx_v___pyx_state);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_4__setstate_cython__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CooAttributes *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  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("__setstate_cython__", 0);

  /* "(tree fragment)":17
 *         return __pyx_unpickle_CooAttributes, (type(self), 0xe806e52, state)
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_CooAttributes__set_state(self, __pyx_state)             # <<<<<<<<<<<<<<
*/
  __pyx_t_1 = __pyx_v___pyx_state;
  __Pyx_INCREF(__pyx_t_1);
  if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(2, 17, __pyx_L1_error)
  if (unlikely(__pyx_t_1 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "cannot pass None into a C function argument that is declared 'not None'");
    __PYX_ERR(2, 17, __pyx_L1_error)
  }
  __pyx_t_2 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse___pyx_unpickle_CooAttributes__set_state(__pyx_v_self, ((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_CooAttributes, (type(self), 0xe806e52, 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_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.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_backends/cuda/libs/cusparse.pyx":1463
 * 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_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_13cupy_backends_4cuda_4libs_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;
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[8] = {0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_rows,&__pyx_mstate_global->__pyx_n_u_cols,&__pyx_mstate_global->__pyx_n_u_nnz,&__pyx_mstate_global->__pyx_n_u_ind,&__pyx_mstate_global->__pyx_n_u_values,&__pyx_mstate_global->__pyx_n_u_idxType,&__pyx_mstate_global->__pyx_n_u_idxBase,&__pyx_mstate_global->__pyx_n_u_valueType,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 1463, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  8:
        values[7] = __Pyx_ArgRef_VARARGS(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 1463, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_VARARGS(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 1463, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_VARARGS(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 1463, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_VARARGS(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1463, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_VARARGS(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1463, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_VARARGS(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1463, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1463, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1463, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < (0)) __PYX_ERR(0, 1463, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 8; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 8, 8, i); __PYX_ERR(0, 1463, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 8)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1463, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1463, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_VARARGS(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1463, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_VARARGS(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1463, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_VARARGS(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1463, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_VARARGS(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 1463, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_VARARGS(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 1463, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_VARARGS(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 1463, __pyx_L3_error)
    }
    __pyx_v_rows = __Pyx_PyLong_As_int64_t(values[0]); if (unlikely((__pyx_v_rows == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1463, __pyx_L3_error)
    __pyx_v_cols = __Pyx_PyLong_As_int64_t(values[1]); if (unlikely((__pyx_v_cols == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1463, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyLong_As_int64_t(values[2]); if (unlikely((__pyx_v_nnz == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1463, __pyx_L3_error)
    __pyx_v_ind = PyLong_AsSsize_t(values[3]); if (unlikely((__pyx_v_ind == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1464, __pyx_L3_error)
    __pyx_v_values = PyLong_AsSsize_t(values[4]); if (unlikely((__pyx_v_values == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1464, __pyx_L3_error)
    __pyx_v_idxType = __Pyx_PyLong_As_cusparseIndexType_t(values[5]); if (unlikely((__pyx_v_idxType == ((cusparseIndexType_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1465, __pyx_L3_error)
    __pyx_v_idxBase = __Pyx_PyLong_As_cusparseIndexBase_t(values[6]); if (unlikely((__pyx_v_idxBase == ((cusparseIndexBase_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1465, __pyx_L3_error)
    __pyx_v_valueType = __Pyx_PyLong_As_cudaDataType(values[7]); if (unlikely((__pyx_v_valueType == ((cudaDataType)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1465, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 8, 8, __pyx_nargs); __PYX_ERR(0, 1463, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.CooAoSAttributes.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes___init__(((struct __pyx_obj_13cupy_backends_4cuda_4libs_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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes___init__(struct __pyx_obj_13cupy_backends_4cuda_4libs_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;

  /* "cupy_backends/cuda/libs/cusparse.pyx":1466
 *                  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_backends/cuda/libs/cusparse.pyx":1467
 *                  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_backends/cuda/libs/cusparse.pyx":1468
 *         self.rows = rows
 *         self.cols = cols
 *         self.nnz = nnz             # <<<<<<<<<<<<<<
 *         self.ind = ind
 *         self.values = values
*/
  __pyx_v_self->nnz = __pyx_v_nnz;

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

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

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

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

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

  /* "cupy_backends/cuda/libs/cusparse.pyx":1463
 * 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;
  return __pyx_r;
}

/* "cupy_backends/cuda/libs/cusparse.pxd":201
 * cdef class CooAoSAttributes:
 *     cdef:
 *         public int64_t rows             # <<<<<<<<<<<<<<
 *         public int64_t cols
 *         public int64_t nnz
*/

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_4rows_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_4rows_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_4rows___get__(((struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CooAoSAttributes *)__pyx_v_self));

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_4rows___get__(struct __pyx_obj_13cupy_backends_4cuda_4libs_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_PyLong_From_int64_t(__pyx_v_self->rows); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 201, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.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_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_4rows_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_4rows_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_4rows_2__set__(((struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CooAoSAttributes *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_4rows_2__set__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CooAoSAttributes *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  int64_t __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __pyx_t_1 = __Pyx_PyLong_As_int64_t(__pyx_v_value); if (unlikely((__pyx_t_1 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 201, __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_backends.cuda.libs.cusparse.CooAoSAttributes.rows.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "cupy_backends/cuda/libs/cusparse.pxd":202
 *     cdef:
 *         public int64_t rows
 *         public int64_t cols             # <<<<<<<<<<<<<<
 *         public int64_t nnz
 *         public intptr_t ind
*/

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_4cols_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_4cols_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_4cols___get__(((struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CooAoSAttributes *)__pyx_v_self));

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_4cols___get__(struct __pyx_obj_13cupy_backends_4cuda_4libs_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_PyLong_From_int64_t(__pyx_v_self->cols); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 202, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.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_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_4cols_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_4cols_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_4cols_2__set__(((struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CooAoSAttributes *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_4cols_2__set__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CooAoSAttributes *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  int64_t __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __pyx_t_1 = __Pyx_PyLong_As_int64_t(__pyx_v_value); if (unlikely((__pyx_t_1 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 202, __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_backends.cuda.libs.cusparse.CooAoSAttributes.cols.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "cupy_backends/cuda/libs/cusparse.pxd":203
 *         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_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_3nnz_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_3nnz_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_3nnz___get__(((struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CooAoSAttributes *)__pyx_v_self));

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_3nnz___get__(struct __pyx_obj_13cupy_backends_4cuda_4libs_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_PyLong_From_int64_t(__pyx_v_self->nnz); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 203, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.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_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_3nnz_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_3nnz_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_3nnz_2__set__(((struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CooAoSAttributes *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_3nnz_2__set__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CooAoSAttributes *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  int64_t __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __pyx_t_1 = __Pyx_PyLong_As_int64_t(__pyx_v_value); if (unlikely((__pyx_t_1 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 203, __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_backends.cuda.libs.cusparse.CooAoSAttributes.nnz.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "cupy_backends/cuda/libs/cusparse.pxd":204
 *         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_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_3ind_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_3ind_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_3ind___get__(((struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CooAoSAttributes *)__pyx_v_self));

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_3ind___get__(struct __pyx_obj_13cupy_backends_4cuda_4libs_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 = PyLong_FromSsize_t(__pyx_v_self->ind); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 204, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.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_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_3ind_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_3ind_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_3ind_2__set__(((struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CooAoSAttributes *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_3ind_2__set__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CooAoSAttributes *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  intptr_t __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __pyx_t_1 = PyLong_AsSsize_t(__pyx_v_value); if (unlikely((__pyx_t_1 == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 204, __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_backends.cuda.libs.cusparse.CooAoSAttributes.ind.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

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

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_6values_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_6values_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_6values___get__(((struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CooAoSAttributes *)__pyx_v_self));

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_6values___get__(struct __pyx_obj_13cupy_backends_4cuda_4libs_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 = PyLong_FromSsize_t(__pyx_v_self->values); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 205, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.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_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_6values_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_6values_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_6values_2__set__(((struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CooAoSAttributes *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_6values_2__set__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CooAoSAttributes *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  intptr_t __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __pyx_t_1 = PyLong_AsSsize_t(__pyx_v_value); if (unlikely((__pyx_t_1 == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 205, __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_backends.cuda.libs.cusparse.CooAoSAttributes.values.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

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

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_7idxType_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_7idxType_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_7idxType___get__(((struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CooAoSAttributes *)__pyx_v_self));

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_7idxType___get__(struct __pyx_obj_13cupy_backends_4cuda_4libs_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_PyLong_From_cusparseIndexType_t(__pyx_v_self->idxType); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 206, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.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_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_7idxType_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_7idxType_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_7idxType_2__set__(((struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CooAoSAttributes *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_7idxType_2__set__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CooAoSAttributes *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  cusparseIndexType_t __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __pyx_t_1 = __Pyx_PyLong_As_cusparseIndexType_t(__pyx_v_value); if (unlikely((__pyx_t_1 == ((cusparseIndexType_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 206, __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_backends.cuda.libs.cusparse.CooAoSAttributes.idxType.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "cupy_backends/cuda/libs/cusparse.pxd":207
 *         public intptr_t values
 *         public IndexType idxType
 *         public IndexBase idxBase             # <<<<<<<<<<<<<<
 *         public DataType valueType
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_7idxBase_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_7idxBase_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_7idxBase___get__(((struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CooAoSAttributes *)__pyx_v_self));

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_7idxBase___get__(struct __pyx_obj_13cupy_backends_4cuda_4libs_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_PyLong_From_cusparseIndexBase_t(__pyx_v_self->idxBase); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 207, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.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_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_7idxBase_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_7idxBase_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_7idxBase_2__set__(((struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CooAoSAttributes *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_7idxBase_2__set__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CooAoSAttributes *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  cusparseIndexBase_t __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __pyx_t_1 = __Pyx_PyLong_As_cusparseIndexBase_t(__pyx_v_value); if (unlikely((__pyx_t_1 == ((cusparseIndexBase_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 207, __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_backends.cuda.libs.cusparse.CooAoSAttributes.idxBase.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

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

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_9valueType_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_9valueType_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_9valueType___get__(((struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CooAoSAttributes *)__pyx_v_self));

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_9valueType___get__(struct __pyx_obj_13cupy_backends_4cuda_4libs_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_PyLong_From_cudaDataType(__pyx_v_self->valueType); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 208, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.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_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_9valueType_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_9valueType_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_9valueType_2__set__(((struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CooAoSAttributes *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_9valueType_2__set__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CooAoSAttributes *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  cudaDataType __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __pyx_t_1 = __Pyx_PyLong_As_cudaDataType(__pyx_v_value); if (unlikely((__pyx_t_1 == ((cudaDataType)-1)) && PyErr_Occurred())) __PYX_ERR(1, 208, __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_backends.cuda.libs.cusparse.CooAoSAttributes.valueType.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

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

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_3__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_2__reduce_cython__, "CooAoSAttributes.__reduce_cython__(self)");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_3__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce_cython__", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_2__reduce_cython__(((struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CooAoSAttributes *)__pyx_v_self));

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_2__reduce_cython__(struct __pyx_obj_13cupy_backends_4cuda_4libs_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 and _dict:
*/
  __pyx_t_1 = __Pyx_PyLong_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_PyLong_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_PyLong_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 = PyLong_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_PyLong_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_PyLong_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_PyLong_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 = PyLong_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);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_1) != (0)) __PYX_ERR(2, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_2) != (0)) __PYX_ERR(2, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_t_3) != (0)) __PYX_ERR(2, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 3, __pyx_t_4) != (0)) __PYX_ERR(2, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_5);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 4, __pyx_t_5) != (0)) __PYX_ERR(2, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_6);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 5, __pyx_t_6) != (0)) __PYX_ERR(2, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_7);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 6, __pyx_t_7) != (0)) __PYX_ERR(2, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_8);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 7, __pyx_t_8) != (0)) __PYX_ERR(2, 5, __pyx_L1_error);
  __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 and _dict:
 *         state += (_dict,)
*/
  __pyx_t_9 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_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 and _dict:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
*/
  __pyx_t_11 = (__pyx_v__dict != Py_None);
  if (__pyx_t_11) {
  } else {
    __pyx_t_10 = __pyx_t_11;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_v__dict); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(2, 7, __pyx_L1_error)
  __pyx_t_10 = __pyx_t_11;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_10) {

    /* "(tree fragment)":8
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None and _dict:
 *         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);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v__dict) != (0)) __PYX_ERR(2, 8, __pyx_L1_error);
    __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 and _dict:
 *         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 and _dict:             # <<<<<<<<<<<<<<
 *         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), 0x5aa1e50, 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), 0x5aa1e50, None), state
 *     else:
*/
  if (__pyx_v_use_setstate) {

    /* "(tree fragment)":13
 *         use_setstate = False
 *     if use_setstate:
 *         return __pyx_unpickle_CooAoSAttributes, (type(self), 0x5aa1e50, None), state             # <<<<<<<<<<<<<<
 *     else:
 *         return __pyx_unpickle_CooAoSAttributes, (type(self), 0x5aa1e50, state)
*/
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_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))));
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))) != (0)) __PYX_ERR(2, 13, __pyx_L1_error);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_int_95034960);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_95034960);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_mstate_global->__pyx_int_95034960) != (0)) __PYX_ERR(2, 13, __pyx_L1_error);
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 2, Py_None) != (0)) __PYX_ERR(2, 13, __pyx_L1_error);
    __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);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_8) != (0)) __PYX_ERR(2, 13, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_9);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_9) != (0)) __PYX_ERR(2, 13, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_v_state) != (0)) __PYX_ERR(2, 13, __pyx_L1_error);
    __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), 0x5aa1e50, None), state
 *     else:
*/
  }

  /* "(tree fragment)":15
 *         return __pyx_unpickle_CooAoSAttributes, (type(self), 0x5aa1e50, None), state
 *     else:
 *         return __pyx_unpickle_CooAoSAttributes, (type(self), 0x5aa1e50, 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_mstate_global->__pyx_n_u_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))));
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))) != (0)) __PYX_ERR(2, 15, __pyx_L1_error);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_int_95034960);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_95034960);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_mstate_global->__pyx_int_95034960) != (0)) __PYX_ERR(2, 15, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_v_state) != (0)) __PYX_ERR(2, 15, __pyx_L1_error);
    __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);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7) != (0)) __PYX_ERR(2, 15, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_9);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_9) != (0)) __PYX_ERR(2, 15, __pyx_L1_error);
    __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_backends.cuda.libs.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), 0x5aa1e50, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_CooAoSAttributes__set_state(self, __pyx_state)
*/

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_5__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_4__setstate_cython__, "CooAoSAttributes.__setstate_cython__(self, __pyx_state)");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_5__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(2, 16, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(2, 16, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__setstate_cython__", 0) < (0)) __PYX_ERR(2, 16, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, i); __PYX_ERR(2, 16, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(2, 16, __pyx_L3_error)
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(2, 16, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.CooAoSAttributes.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_4__setstate_cython__(((struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CooAoSAttributes *)__pyx_v_self), __pyx_v___pyx_state);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_4__setstate_cython__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CooAoSAttributes *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  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("__setstate_cython__", 0);

  /* "(tree fragment)":17
 *         return __pyx_unpickle_CooAoSAttributes, (type(self), 0x5aa1e50, state)
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_CooAoSAttributes__set_state(self, __pyx_state)             # <<<<<<<<<<<<<<
*/
  __pyx_t_1 = __pyx_v___pyx_state;
  __Pyx_INCREF(__pyx_t_1);
  if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(2, 17, __pyx_L1_error)
  if (unlikely(__pyx_t_1 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "cannot pass None into a C function argument that is declared 'not None'");
    __PYX_ERR(2, 17, __pyx_L1_error)
  }
  __pyx_t_2 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse___pyx_unpickle_CooAoSAttributes__set_state(__pyx_v_self, ((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_CooAoSAttributes, (type(self), 0x5aa1e50, 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_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.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_backends/cuda/libs/cusparse.pyx":1478
 * 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_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_13cupy_backends_4cuda_4libs_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;
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_rows,&__pyx_mstate_global->__pyx_n_u_cols,&__pyx_mstate_global->__pyx_n_u_nnz,&__pyx_mstate_global->__pyx_n_u_rowOffsets,&__pyx_mstate_global->__pyx_n_u_colIdx,&__pyx_mstate_global->__pyx_n_u_values,&__pyx_mstate_global->__pyx_n_u_rowOffsetType,&__pyx_mstate_global->__pyx_n_u_colIdxType,&__pyx_mstate_global->__pyx_n_u_idxBase,&__pyx_mstate_global->__pyx_n_u_valueType,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 1478, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 10:
        values[9] = __Pyx_ArgRef_VARARGS(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 1478, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_VARARGS(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 1478, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_VARARGS(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 1478, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_VARARGS(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 1478, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_VARARGS(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 1478, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_VARARGS(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1478, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_VARARGS(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1478, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_VARARGS(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1478, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1478, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1478, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < (0)) __PYX_ERR(0, 1478, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 10; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 10, 10, i); __PYX_ERR(0, 1478, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 10)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1478, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1478, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_VARARGS(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1478, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_VARARGS(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1478, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_VARARGS(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1478, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_VARARGS(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 1478, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_VARARGS(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 1478, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_VARARGS(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 1478, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_VARARGS(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 1478, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_VARARGS(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 1478, __pyx_L3_error)
    }
    __pyx_v_rows = __Pyx_PyLong_As_int64_t(values[0]); if (unlikely((__pyx_v_rows == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1478, __pyx_L3_error)
    __pyx_v_cols = __Pyx_PyLong_As_int64_t(values[1]); if (unlikely((__pyx_v_cols == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1478, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyLong_As_int64_t(values[2]); if (unlikely((__pyx_v_nnz == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1478, __pyx_L3_error)
    __pyx_v_rowOffsets = PyLong_AsSsize_t(values[3]); if (unlikely((__pyx_v_rowOffsets == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1479, __pyx_L3_error)
    __pyx_v_colIdx = PyLong_AsSsize_t(values[4]); if (unlikely((__pyx_v_colIdx == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1479, __pyx_L3_error)
    __pyx_v_values = PyLong_AsSsize_t(values[5]); if (unlikely((__pyx_v_values == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1479, __pyx_L3_error)
    __pyx_v_rowOffsetType = __Pyx_PyLong_As_cusparseIndexType_t(values[6]); if (unlikely((__pyx_v_rowOffsetType == ((cusparseIndexType_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1480, __pyx_L3_error)
    __pyx_v_colIdxType = __Pyx_PyLong_As_cusparseIndexType_t(values[7]); if (unlikely((__pyx_v_colIdxType == ((cusparseIndexType_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1480, __pyx_L3_error)
    __pyx_v_idxBase = __Pyx_PyLong_As_cusparseIndexBase_t(values[8]); if (unlikely((__pyx_v_idxBase == ((cusparseIndexBase_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1481, __pyx_L3_error)
    __pyx_v_valueType = __Pyx_PyLong_As_cudaDataType(values[9]); if (unlikely((__pyx_v_valueType == ((cudaDataType)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1481, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 10, 10, __pyx_nargs); __PYX_ERR(0, 1478, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.CsrAttributes.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes___init__(((struct __pyx_obj_13cupy_backends_4cuda_4libs_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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes___init__(struct __pyx_obj_13cupy_backends_4cuda_4libs_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;

  /* "cupy_backends/cuda/libs/cusparse.pyx":1482
 *                  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_backends/cuda/libs/cusparse.pyx":1483
 *                  IndexBase idxBase, DataType valueType):
 *         self.rows = rows
 *         self.cols = cols             # <<<<<<<<<<<<<<
 *         self.nnz = nnz
 *         self.rowOffsets = rowOffsets
*/
  __pyx_v_self->cols = __pyx_v_cols;

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

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

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

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

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

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

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

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

  /* "cupy_backends/cuda/libs/cusparse.pyx":1478
 * 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;
  return __pyx_r;
}

/* "cupy_backends/cuda/libs/cusparse.pxd":212
 * cdef class CsrAttributes:
 *     cdef:
 *         public int64_t rows             # <<<<<<<<<<<<<<
 *         public int64_t cols
 *         public int64_t nnz
*/

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_4rows_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_4rows_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_4rows___get__(((struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CsrAttributes *)__pyx_v_self));

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_4rows___get__(struct __pyx_obj_13cupy_backends_4cuda_4libs_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_PyLong_From_int64_t(__pyx_v_self->rows); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 212, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.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_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_4rows_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_4rows_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_4rows_2__set__(((struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CsrAttributes *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_4rows_2__set__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CsrAttributes *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  int64_t __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __pyx_t_1 = __Pyx_PyLong_As_int64_t(__pyx_v_value); if (unlikely((__pyx_t_1 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 212, __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_backends.cuda.libs.cusparse.CsrAttributes.rows.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "cupy_backends/cuda/libs/cusparse.pxd":213
 *     cdef:
 *         public int64_t rows
 *         public int64_t cols             # <<<<<<<<<<<<<<
 *         public int64_t nnz
 *         public intptr_t rowOffsets
*/

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_4cols_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_4cols_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_4cols___get__(((struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CsrAttributes *)__pyx_v_self));

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_4cols___get__(struct __pyx_obj_13cupy_backends_4cuda_4libs_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_PyLong_From_int64_t(__pyx_v_self->cols); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 213, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.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_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_4cols_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_4cols_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_4cols_2__set__(((struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CsrAttributes *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_4cols_2__set__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CsrAttributes *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  int64_t __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __pyx_t_1 = __Pyx_PyLong_As_int64_t(__pyx_v_value); if (unlikely((__pyx_t_1 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 213, __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_backends.cuda.libs.cusparse.CsrAttributes.cols.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "cupy_backends/cuda/libs/cusparse.pxd":214
 *         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_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_3nnz_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_3nnz_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_3nnz___get__(((struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CsrAttributes *)__pyx_v_self));

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_3nnz___get__(struct __pyx_obj_13cupy_backends_4cuda_4libs_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_PyLong_From_int64_t(__pyx_v_self->nnz); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 214, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.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_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_3nnz_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_3nnz_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_3nnz_2__set__(((struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CsrAttributes *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_3nnz_2__set__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CsrAttributes *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  int64_t __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __pyx_t_1 = __Pyx_PyLong_As_int64_t(__pyx_v_value); if (unlikely((__pyx_t_1 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 214, __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_backends.cuda.libs.cusparse.CsrAttributes.nnz.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "cupy_backends/cuda/libs/cusparse.pxd":215
 *         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_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_10rowOffsets_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_10rowOffsets_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_10rowOffsets___get__(((struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CsrAttributes *)__pyx_v_self));

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_10rowOffsets___get__(struct __pyx_obj_13cupy_backends_4cuda_4libs_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 = PyLong_FromSsize_t(__pyx_v_self->rowOffsets); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 215, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.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_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_10rowOffsets_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_10rowOffsets_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_10rowOffsets_2__set__(((struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CsrAttributes *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_10rowOffsets_2__set__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CsrAttributes *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  intptr_t __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __pyx_t_1 = PyLong_AsSsize_t(__pyx_v_value); if (unlikely((__pyx_t_1 == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 215, __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_backends.cuda.libs.cusparse.CsrAttributes.rowOffsets.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "cupy_backends/cuda/libs/cusparse.pxd":216
 *         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_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_6colIdx_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_6colIdx_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_6colIdx___get__(((struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CsrAttributes *)__pyx_v_self));

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_6colIdx___get__(struct __pyx_obj_13cupy_backends_4cuda_4libs_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 = PyLong_FromSsize_t(__pyx_v_self->colIdx); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 216, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.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_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_6colIdx_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_6colIdx_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_6colIdx_2__set__(((struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CsrAttributes *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_6colIdx_2__set__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CsrAttributes *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  intptr_t __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __pyx_t_1 = PyLong_AsSsize_t(__pyx_v_value); if (unlikely((__pyx_t_1 == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 216, __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_backends.cuda.libs.cusparse.CsrAttributes.colIdx.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "cupy_backends/cuda/libs/cusparse.pxd":217
 *         public intptr_t rowOffsets
 *         public intptr_t colIdx
 *         public intptr_t values             # <<<<<<<<<<<<<<
 *         public IndexType rowOffsetType
 *         public IndexType colIdxType
*/

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_6values_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_6values_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_6values___get__(((struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CsrAttributes *)__pyx_v_self));

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_6values___get__(struct __pyx_obj_13cupy_backends_4cuda_4libs_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 = PyLong_FromSsize_t(__pyx_v_self->values); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 217, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.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_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_6values_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_6values_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_6values_2__set__(((struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CsrAttributes *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_6values_2__set__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CsrAttributes *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  intptr_t __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __pyx_t_1 = PyLong_AsSsize_t(__pyx_v_value); if (unlikely((__pyx_t_1 == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 217, __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_backends.cuda.libs.cusparse.CsrAttributes.values.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "cupy_backends/cuda/libs/cusparse.pxd":218
 *         public intptr_t colIdx
 *         public intptr_t values
 *         public IndexType rowOffsetType             # <<<<<<<<<<<<<<
 *         public IndexType colIdxType
 *         public IndexBase idxBase
*/

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_13rowOffsetType_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_13rowOffsetType_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_13rowOffsetType___get__(((struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CsrAttributes *)__pyx_v_self));

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_13rowOffsetType___get__(struct __pyx_obj_13cupy_backends_4cuda_4libs_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_PyLong_From_cusparseIndexType_t(__pyx_v_self->rowOffsetType); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 218, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.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_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_13rowOffsetType_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_13rowOffsetType_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_13rowOffsetType_2__set__(((struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CsrAttributes *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_13rowOffsetType_2__set__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CsrAttributes *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  cusparseIndexType_t __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __pyx_t_1 = __Pyx_PyLong_As_cusparseIndexType_t(__pyx_v_value); if (unlikely((__pyx_t_1 == ((cusparseIndexType_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 218, __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_backends.cuda.libs.cusparse.CsrAttributes.rowOffsetType.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

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

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_10colIdxType_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_10colIdxType_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_10colIdxType___get__(((struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CsrAttributes *)__pyx_v_self));

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_10colIdxType___get__(struct __pyx_obj_13cupy_backends_4cuda_4libs_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_PyLong_From_cusparseIndexType_t(__pyx_v_self->colIdxType); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 219, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.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_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_10colIdxType_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_10colIdxType_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_10colIdxType_2__set__(((struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CsrAttributes *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_10colIdxType_2__set__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CsrAttributes *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  cusparseIndexType_t __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __pyx_t_1 = __Pyx_PyLong_As_cusparseIndexType_t(__pyx_v_value); if (unlikely((__pyx_t_1 == ((cusparseIndexType_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 219, __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_backends.cuda.libs.cusparse.CsrAttributes.colIdxType.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "cupy_backends/cuda/libs/cusparse.pxd":220
 *         public IndexType rowOffsetType
 *         public IndexType colIdxType
 *         public IndexBase idxBase             # <<<<<<<<<<<<<<
 *         public DataType valueType
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_7idxBase_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_7idxBase_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_7idxBase___get__(((struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CsrAttributes *)__pyx_v_self));

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_7idxBase___get__(struct __pyx_obj_13cupy_backends_4cuda_4libs_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_PyLong_From_cusparseIndexBase_t(__pyx_v_self->idxBase); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 220, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.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_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_7idxBase_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_7idxBase_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_7idxBase_2__set__(((struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CsrAttributes *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_7idxBase_2__set__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CsrAttributes *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  cusparseIndexBase_t __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __pyx_t_1 = __Pyx_PyLong_As_cusparseIndexBase_t(__pyx_v_value); if (unlikely((__pyx_t_1 == ((cusparseIndexBase_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 220, __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_backends.cuda.libs.cusparse.CsrAttributes.idxBase.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

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

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_9valueType_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_9valueType_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_9valueType___get__(((struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CsrAttributes *)__pyx_v_self));

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_9valueType___get__(struct __pyx_obj_13cupy_backends_4cuda_4libs_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_PyLong_From_cudaDataType(__pyx_v_self->valueType); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 221, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.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_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_9valueType_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_9valueType_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_9valueType_2__set__(((struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CsrAttributes *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_9valueType_2__set__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CsrAttributes *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  cudaDataType __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __pyx_t_1 = __Pyx_PyLong_As_cudaDataType(__pyx_v_value); if (unlikely((__pyx_t_1 == ((cudaDataType)-1)) && PyErr_Occurred())) __PYX_ERR(1, 221, __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_backends.cuda.libs.cusparse.CsrAttributes.valueType.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

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

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_3__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_2__reduce_cython__, "CsrAttributes.__reduce_cython__(self)");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_3__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce_cython__", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_2__reduce_cython__(((struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CsrAttributes *)__pyx_v_self));

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_2__reduce_cython__(struct __pyx_obj_13cupy_backends_4cuda_4libs_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 and _dict:
*/
  __pyx_t_1 = PyLong_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_PyLong_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_PyLong_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_PyLong_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_PyLong_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_PyLong_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 = PyLong_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_PyLong_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_PyLong_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 = PyLong_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);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_1) != (0)) __PYX_ERR(2, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_2) != (0)) __PYX_ERR(2, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 2, __pyx_t_3) != (0)) __PYX_ERR(2, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 3, __pyx_t_4) != (0)) __PYX_ERR(2, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_5);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 4, __pyx_t_5) != (0)) __PYX_ERR(2, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_6);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 5, __pyx_t_6) != (0)) __PYX_ERR(2, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_7);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 6, __pyx_t_7) != (0)) __PYX_ERR(2, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_8);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 7, __pyx_t_8) != (0)) __PYX_ERR(2, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_9);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 8, __pyx_t_9) != (0)) __PYX_ERR(2, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_10);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 9, __pyx_t_10) != (0)) __PYX_ERR(2, 5, __pyx_L1_error);
  __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 and _dict:
 *         state += (_dict,)
*/
  __pyx_t_11 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_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 and _dict:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
*/
  __pyx_t_13 = (__pyx_v__dict != Py_None);
  if (__pyx_t_13) {
  } else {
    __pyx_t_12 = __pyx_t_13;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_v__dict); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(2, 7, __pyx_L1_error)
  __pyx_t_12 = __pyx_t_13;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_12) {

    /* "(tree fragment)":8
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None and _dict:
 *         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);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_v__dict) != (0)) __PYX_ERR(2, 8, __pyx_L1_error);
    __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 and _dict:
 *         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 and _dict:             # <<<<<<<<<<<<<<
 *         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), 0x29b438a, 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), 0x29b438a, None), state
 *     else:
*/
  if (__pyx_v_use_setstate) {

    /* "(tree fragment)":13
 *         use_setstate = False
 *     if use_setstate:
 *         return __pyx_unpickle_CsrAttributes, (type(self), 0x29b438a, None), state             # <<<<<<<<<<<<<<
 *     else:
 *         return __pyx_unpickle_CsrAttributes, (type(self), 0x29b438a, state)
*/
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_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))));
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))) != (0)) __PYX_ERR(2, 13, __pyx_L1_error);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_int_43729802);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_43729802);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_mstate_global->__pyx_int_43729802) != (0)) __PYX_ERR(2, 13, __pyx_L1_error);
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 2, Py_None) != (0)) __PYX_ERR(2, 13, __pyx_L1_error);
    __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);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_10) != (0)) __PYX_ERR(2, 13, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_11);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_11) != (0)) __PYX_ERR(2, 13, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_v_state) != (0)) __PYX_ERR(2, 13, __pyx_L1_error);
    __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), 0x29b438a, None), state
 *     else:
*/
  }

  /* "(tree fragment)":15
 *         return __pyx_unpickle_CsrAttributes, (type(self), 0x29b438a, None), state
 *     else:
 *         return __pyx_unpickle_CsrAttributes, (type(self), 0x29b438a, 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_mstate_global->__pyx_n_u_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))));
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))) != (0)) __PYX_ERR(2, 15, __pyx_L1_error);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_int_43729802);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_43729802);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_mstate_global->__pyx_int_43729802) != (0)) __PYX_ERR(2, 15, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 2, __pyx_v_state) != (0)) __PYX_ERR(2, 15, __pyx_L1_error);
    __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);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9) != (0)) __PYX_ERR(2, 15, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_11);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_11) != (0)) __PYX_ERR(2, 15, __pyx_L1_error);
    __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_backends.cuda.libs.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), 0x29b438a, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_CsrAttributes__set_state(self, __pyx_state)
*/

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_5__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_4__setstate_cython__, "CsrAttributes.__setstate_cython__(self, __pyx_state)");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_5__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(2, 16, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(2, 16, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__setstate_cython__", 0) < (0)) __PYX_ERR(2, 16, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, i); __PYX_ERR(2, 16, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(2, 16, __pyx_L3_error)
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(2, 16, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.CsrAttributes.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_4__setstate_cython__(((struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CsrAttributes *)__pyx_v_self), __pyx_v___pyx_state);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_4__setstate_cython__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CsrAttributes *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  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("__setstate_cython__", 0);

  /* "(tree fragment)":17
 *         return __pyx_unpickle_CsrAttributes, (type(self), 0x29b438a, state)
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_CsrAttributes__set_state(self, __pyx_state)             # <<<<<<<<<<<<<<
*/
  __pyx_t_1 = __pyx_v___pyx_state;
  __Pyx_INCREF(__pyx_t_1);
  if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(2, 17, __pyx_L1_error)
  if (unlikely(__pyx_t_1 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "cannot pass None into a C function argument that is declared 'not None'");
    __PYX_ERR(2, 17, __pyx_L1_error)
  }
  __pyx_t_2 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse___pyx_unpickle_CsrAttributes__set_state(__pyx_v_self, ((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_CsrAttributes, (type(self), 0x29b438a, 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_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.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_backends/cuda/libs/cusparse.pyx":1496
 * 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_13cupy_backends_4cuda_4libs_8cusparse_15DnVecAttributes_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_13cupy_backends_4cuda_4libs_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;
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_size,&__pyx_mstate_global->__pyx_n_u_values,&__pyx_mstate_global->__pyx_n_u_valueType,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 1496, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_VARARGS(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1496, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1496, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1496, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < (0)) __PYX_ERR(0, 1496, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, i); __PYX_ERR(0, 1496, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1496, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1496, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_VARARGS(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1496, __pyx_L3_error)
    }
    __pyx_v_size = __Pyx_PyLong_As_int64_t(values[0]); if (unlikely((__pyx_v_size == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1496, __pyx_L3_error)
    __pyx_v_values = PyLong_AsSsize_t(values[1]); if (unlikely((__pyx_v_values == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1496, __pyx_L3_error)
    __pyx_v_valueType = __Pyx_PyLong_As_cudaDataType(values[2]); if (unlikely((__pyx_v_valueType == ((cudaDataType)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1496, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 1496, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.DnVecAttributes.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_15DnVecAttributes___init__(((struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_DnVecAttributes *)__pyx_v_self), __pyx_v_size, __pyx_v_values, __pyx_v_valueType);

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

static int __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_15DnVecAttributes___init__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_DnVecAttributes *__pyx_v_self, int64_t __pyx_v_size, intptr_t __pyx_v_values, cudaDataType __pyx_v_valueType) {
  int __pyx_r;

  /* "cupy_backends/cuda/libs/cusparse.pyx":1497
 * 
 *     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_backends/cuda/libs/cusparse.pyx":1498
 *     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_backends/cuda/libs/cusparse.pyx":1499
 *         self.size = size
 *         self.values = values
 *         self.valueType = valueType             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_v_self->valueType = __pyx_v_valueType;

  /* "cupy_backends/cuda/libs/cusparse.pyx":1496
 * 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;
  return __pyx_r;
}

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

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_15DnVecAttributes_4size_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_15DnVecAttributes_4size_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_15DnVecAttributes_4size___get__(((struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_DnVecAttributes *)__pyx_v_self));

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_15DnVecAttributes_4size___get__(struct __pyx_obj_13cupy_backends_4cuda_4libs_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_PyLong_From_int64_t(__pyx_v_self->size); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 225, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.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_13cupy_backends_4cuda_4libs_8cusparse_15DnVecAttributes_4size_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_15DnVecAttributes_4size_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_15DnVecAttributes_4size_2__set__(((struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_DnVecAttributes *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_15DnVecAttributes_4size_2__set__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_DnVecAttributes *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  int64_t __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __pyx_t_1 = __Pyx_PyLong_As_int64_t(__pyx_v_value); if (unlikely((__pyx_t_1 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 225, __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_backends.cuda.libs.cusparse.DnVecAttributes.size.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "cupy_backends/cuda/libs/cusparse.pxd":226
 *     cdef:
 *         public int64_t size
 *         public intptr_t values             # <<<<<<<<<<<<<<
 *         public DataType valueType
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_15DnVecAttributes_6values_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_15DnVecAttributes_6values_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_15DnVecAttributes_6values___get__(((struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_DnVecAttributes *)__pyx_v_self));

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_15DnVecAttributes_6values___get__(struct __pyx_obj_13cupy_backends_4cuda_4libs_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 = PyLong_FromSsize_t(__pyx_v_self->values); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 226, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.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_13cupy_backends_4cuda_4libs_8cusparse_15DnVecAttributes_6values_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_15DnVecAttributes_6values_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_15DnVecAttributes_6values_2__set__(((struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_DnVecAttributes *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_15DnVecAttributes_6values_2__set__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_DnVecAttributes *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  intptr_t __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __pyx_t_1 = PyLong_AsSsize_t(__pyx_v_value); if (unlikely((__pyx_t_1 == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 226, __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_backends.cuda.libs.cusparse.DnVecAttributes.values.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

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

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_15DnVecAttributes_9valueType_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_15DnVecAttributes_9valueType_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_15DnVecAttributes_9valueType___get__(((struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_DnVecAttributes *)__pyx_v_self));

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_15DnVecAttributes_9valueType___get__(struct __pyx_obj_13cupy_backends_4cuda_4libs_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_PyLong_From_cudaDataType(__pyx_v_self->valueType); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 227, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.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_13cupy_backends_4cuda_4libs_8cusparse_15DnVecAttributes_9valueType_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_15DnVecAttributes_9valueType_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_15DnVecAttributes_9valueType_2__set__(((struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_DnVecAttributes *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_15DnVecAttributes_9valueType_2__set__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_DnVecAttributes *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  cudaDataType __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __pyx_t_1 = __Pyx_PyLong_As_cudaDataType(__pyx_v_value); if (unlikely((__pyx_t_1 == ((cudaDataType)-1)) && PyErr_Occurred())) __PYX_ERR(1, 227, __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_backends.cuda.libs.cusparse.DnVecAttributes.valueType.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

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

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_15DnVecAttributes_3__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_15DnVecAttributes_2__reduce_cython__, "DnVecAttributes.__reduce_cython__(self)");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_15DnVecAttributes_3__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce_cython__", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_15DnVecAttributes_2__reduce_cython__(((struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_DnVecAttributes *)__pyx_v_self));

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_15DnVecAttributes_2__reduce_cython__(struct __pyx_obj_13cupy_backends_4cuda_4libs_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 and _dict:
*/
  __pyx_t_1 = __Pyx_PyLong_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_PyLong_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 = PyLong_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);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1) != (0)) __PYX_ERR(2, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2) != (0)) __PYX_ERR(2, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3) != (0)) __PYX_ERR(2, 5, __pyx_L1_error);
  __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 and _dict:
 *         state += (_dict,)
*/
  __pyx_t_4 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_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 and _dict:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
*/
  __pyx_t_6 = (__pyx_v__dict != Py_None);
  if (__pyx_t_6) {
  } else {
    __pyx_t_5 = __pyx_t_6;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v__dict); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(2, 7, __pyx_L1_error)
  __pyx_t_5 = __pyx_t_6;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_5) {

    /* "(tree fragment)":8
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None and _dict:
 *         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);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v__dict) != (0)) __PYX_ERR(2, 8, __pyx_L1_error);
    __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 and _dict:
 *         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 and _dict:             # <<<<<<<<<<<<<<
 *         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), 0x4ea9d53, 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), 0x4ea9d53, None), state
 *     else:
*/
  if (__pyx_v_use_setstate) {

    /* "(tree fragment)":13
 *         use_setstate = False
 *     if use_setstate:
 *         return __pyx_unpickle_DnVecAttributes, (type(self), 0x4ea9d53, None), state             # <<<<<<<<<<<<<<
 *     else:
 *         return __pyx_unpickle_DnVecAttributes, (type(self), 0x4ea9d53, state)
*/
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_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))));
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))) != (0)) __PYX_ERR(2, 13, __pyx_L1_error);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_int_82484563);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_82484563);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_mstate_global->__pyx_int_82484563) != (0)) __PYX_ERR(2, 13, __pyx_L1_error);
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, Py_None) != (0)) __PYX_ERR(2, 13, __pyx_L1_error);
    __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);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3) != (0)) __PYX_ERR(2, 13, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_4);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4) != (0)) __PYX_ERR(2, 13, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_state) != (0)) __PYX_ERR(2, 13, __pyx_L1_error);
    __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), 0x4ea9d53, None), state
 *     else:
*/
  }

  /* "(tree fragment)":15
 *         return __pyx_unpickle_DnVecAttributes, (type(self), 0x4ea9d53, None), state
 *     else:
 *         return __pyx_unpickle_DnVecAttributes, (type(self), 0x4ea9d53, 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_mstate_global->__pyx_n_u_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))));
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))) != (0)) __PYX_ERR(2, 15, __pyx_L1_error);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_int_82484563);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_82484563);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_mstate_global->__pyx_int_82484563) != (0)) __PYX_ERR(2, 15, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_state) != (0)) __PYX_ERR(2, 15, __pyx_L1_error);
    __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);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2) != (0)) __PYX_ERR(2, 15, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_4);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4) != (0)) __PYX_ERR(2, 15, __pyx_L1_error);
    __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_backends.cuda.libs.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), 0x4ea9d53, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_DnVecAttributes__set_state(self, __pyx_state)
*/

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_15DnVecAttributes_5__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_15DnVecAttributes_4__setstate_cython__, "DnVecAttributes.__setstate_cython__(self, __pyx_state)");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_15DnVecAttributes_5__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(2, 16, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(2, 16, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__setstate_cython__", 0) < (0)) __PYX_ERR(2, 16, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, i); __PYX_ERR(2, 16, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(2, 16, __pyx_L3_error)
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(2, 16, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.DnVecAttributes.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_15DnVecAttributes_4__setstate_cython__(((struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_DnVecAttributes *)__pyx_v_self), __pyx_v___pyx_state);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_15DnVecAttributes_4__setstate_cython__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_DnVecAttributes *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  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("__setstate_cython__", 0);

  /* "(tree fragment)":17
 *         return __pyx_unpickle_DnVecAttributes, (type(self), 0x4ea9d53, state)
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_DnVecAttributes__set_state(self, __pyx_state)             # <<<<<<<<<<<<<<
*/
  __pyx_t_1 = __pyx_v___pyx_state;
  __Pyx_INCREF(__pyx_t_1);
  if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(2, 17, __pyx_L1_error)
  if (unlikely(__pyx_t_1 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "cannot pass None into a C function argument that is declared 'not None'");
    __PYX_ERR(2, 17, __pyx_L1_error)
  }
  __pyx_t_2 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse___pyx_unpickle_DnVecAttributes__set_state(__pyx_v_self, ((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_DnVecAttributes, (type(self), 0x4ea9d53, 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_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.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_backends/cuda/libs/cusparse.pyx":1504
 * 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_13cupy_backends_4cuda_4libs_8cusparse_15DnMatAttributes_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_13cupy_backends_4cuda_4libs_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;
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[6] = {0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_rows,&__pyx_mstate_global->__pyx_n_u_cols,&__pyx_mstate_global->__pyx_n_u_ld,&__pyx_mstate_global->__pyx_n_u_values,&__pyx_mstate_global->__pyx_n_u_valueType,&__pyx_mstate_global->__pyx_n_u_order,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 1504, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  6:
        values[5] = __Pyx_ArgRef_VARARGS(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 1504, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_VARARGS(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1504, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_VARARGS(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1504, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_VARARGS(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1504, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1504, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1504, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < (0)) __PYX_ERR(0, 1504, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 6; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 6, 6, i); __PYX_ERR(0, 1504, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 6)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1504, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1504, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_VARARGS(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1504, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_VARARGS(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1504, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_VARARGS(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1504, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_VARARGS(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 1504, __pyx_L3_error)
    }
    __pyx_v_rows = __Pyx_PyLong_As_int64_t(values[0]); if (unlikely((__pyx_v_rows == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1504, __pyx_L3_error)
    __pyx_v_cols = __Pyx_PyLong_As_int64_t(values[1]); if (unlikely((__pyx_v_cols == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1504, __pyx_L3_error)
    __pyx_v_ld = __Pyx_PyLong_As_int64_t(values[2]); if (unlikely((__pyx_v_ld == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1504, __pyx_L3_error)
    __pyx_v_values = PyLong_AsSsize_t(values[3]); if (unlikely((__pyx_v_values == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1505, __pyx_L3_error)
    __pyx_v_valueType = __Pyx_PyLong_As_cudaDataType(values[4]); if (unlikely((__pyx_v_valueType == ((cudaDataType)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1505, __pyx_L3_error)
    __pyx_v_order = __Pyx_PyLong_As_cusparseOrder_t(values[5]); if (unlikely((__pyx_v_order == ((cusparseOrder_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1505, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 6, 6, __pyx_nargs); __PYX_ERR(0, 1504, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.DnMatAttributes.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_15DnMatAttributes___init__(((struct __pyx_obj_13cupy_backends_4cuda_4libs_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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_15DnMatAttributes___init__(struct __pyx_obj_13cupy_backends_4cuda_4libs_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;

  /* "cupy_backends/cuda/libs/cusparse.pyx":1506
 *     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_backends/cuda/libs/cusparse.pyx":1507
 *                  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_backends/cuda/libs/cusparse.pyx":1508
 *         self.rows = rows
 *         self.cols = cols
 *         self.ld = ld             # <<<<<<<<<<<<<<
 *         self.values = values
 *         self.valueType = valueType
*/
  __pyx_v_self->ld = __pyx_v_ld;

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

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

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

  /* "cupy_backends/cuda/libs/cusparse.pyx":1504
 * 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;
  return __pyx_r;
}

/* "cupy_backends/cuda/libs/cusparse.pxd":231
 * cdef class DnMatAttributes:
 *     cdef:
 *         public int64_t rows             # <<<<<<<<<<<<<<
 *         public int64_t cols
 *         public int64_t ld
*/

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_15DnMatAttributes_4rows_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_15DnMatAttributes_4rows_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_15DnMatAttributes_4rows___get__(((struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_DnMatAttributes *)__pyx_v_self));

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_15DnMatAttributes_4rows___get__(struct __pyx_obj_13cupy_backends_4cuda_4libs_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_PyLong_From_int64_t(__pyx_v_self->rows); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 231, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.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_13cupy_backends_4cuda_4libs_8cusparse_15DnMatAttributes_4rows_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_15DnMatAttributes_4rows_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_15DnMatAttributes_4rows_2__set__(((struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_DnMatAttributes *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_15DnMatAttributes_4rows_2__set__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_DnMatAttributes *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  int64_t __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __pyx_t_1 = __Pyx_PyLong_As_int64_t(__pyx_v_value); if (unlikely((__pyx_t_1 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 231, __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_backends.cuda.libs.cusparse.DnMatAttributes.rows.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "cupy_backends/cuda/libs/cusparse.pxd":232
 *     cdef:
 *         public int64_t rows
 *         public int64_t cols             # <<<<<<<<<<<<<<
 *         public int64_t ld
 *         public intptr_t values
*/

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_15DnMatAttributes_4cols_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_15DnMatAttributes_4cols_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_15DnMatAttributes_4cols___get__(((struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_DnMatAttributes *)__pyx_v_self));

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_15DnMatAttributes_4cols___get__(struct __pyx_obj_13cupy_backends_4cuda_4libs_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_PyLong_From_int64_t(__pyx_v_self->cols); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 232, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.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_13cupy_backends_4cuda_4libs_8cusparse_15DnMatAttributes_4cols_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_15DnMatAttributes_4cols_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_15DnMatAttributes_4cols_2__set__(((struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_DnMatAttributes *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_15DnMatAttributes_4cols_2__set__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_DnMatAttributes *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  int64_t __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __pyx_t_1 = __Pyx_PyLong_As_int64_t(__pyx_v_value); if (unlikely((__pyx_t_1 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 232, __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_backends.cuda.libs.cusparse.DnMatAttributes.cols.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "cupy_backends/cuda/libs/cusparse.pxd":233
 *         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_13cupy_backends_4cuda_4libs_8cusparse_15DnMatAttributes_2ld_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_15DnMatAttributes_2ld_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_15DnMatAttributes_2ld___get__(((struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_DnMatAttributes *)__pyx_v_self));

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_15DnMatAttributes_2ld___get__(struct __pyx_obj_13cupy_backends_4cuda_4libs_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_PyLong_From_int64_t(__pyx_v_self->ld); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 233, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.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_13cupy_backends_4cuda_4libs_8cusparse_15DnMatAttributes_2ld_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_15DnMatAttributes_2ld_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_15DnMatAttributes_2ld_2__set__(((struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_DnMatAttributes *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_15DnMatAttributes_2ld_2__set__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_DnMatAttributes *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  int64_t __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __pyx_t_1 = __Pyx_PyLong_As_int64_t(__pyx_v_value); if (unlikely((__pyx_t_1 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 233, __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_backends.cuda.libs.cusparse.DnMatAttributes.ld.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

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

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_15DnMatAttributes_6values_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_15DnMatAttributes_6values_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_15DnMatAttributes_6values___get__(((struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_DnMatAttributes *)__pyx_v_self));

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_15DnMatAttributes_6values___get__(struct __pyx_obj_13cupy_backends_4cuda_4libs_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 = PyLong_FromSsize_t(__pyx_v_self->values); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 234, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.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_13cupy_backends_4cuda_4libs_8cusparse_15DnMatAttributes_6values_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_15DnMatAttributes_6values_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_15DnMatAttributes_6values_2__set__(((struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_DnMatAttributes *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_15DnMatAttributes_6values_2__set__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_DnMatAttributes *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  intptr_t __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __pyx_t_1 = PyLong_AsSsize_t(__pyx_v_value); if (unlikely((__pyx_t_1 == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 234, __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_backends.cuda.libs.cusparse.DnMatAttributes.values.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "cupy_backends/cuda/libs/cusparse.pxd":235
 *         public int64_t ld
 *         public intptr_t values
 *         public DataType valueType             # <<<<<<<<<<<<<<
 *         public Order order
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_15DnMatAttributes_9valueType_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_15DnMatAttributes_9valueType_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_15DnMatAttributes_9valueType___get__(((struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_DnMatAttributes *)__pyx_v_self));

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_15DnMatAttributes_9valueType___get__(struct __pyx_obj_13cupy_backends_4cuda_4libs_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_PyLong_From_cudaDataType(__pyx_v_self->valueType); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 235, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.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_13cupy_backends_4cuda_4libs_8cusparse_15DnMatAttributes_9valueType_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_15DnMatAttributes_9valueType_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_15DnMatAttributes_9valueType_2__set__(((struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_DnMatAttributes *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_15DnMatAttributes_9valueType_2__set__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_DnMatAttributes *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  cudaDataType __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __pyx_t_1 = __Pyx_PyLong_As_cudaDataType(__pyx_v_value); if (unlikely((__pyx_t_1 == ((cudaDataType)-1)) && PyErr_Occurred())) __PYX_ERR(1, 235, __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_backends.cuda.libs.cusparse.DnMatAttributes.valueType.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

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

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_15DnMatAttributes_5order_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_15DnMatAttributes_5order_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_15DnMatAttributes_5order___get__(((struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_DnMatAttributes *)__pyx_v_self));

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_15DnMatAttributes_5order___get__(struct __pyx_obj_13cupy_backends_4cuda_4libs_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_PyLong_From_cusparseOrder_t(__pyx_v_self->order); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 236, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.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_13cupy_backends_4cuda_4libs_8cusparse_15DnMatAttributes_5order_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_15DnMatAttributes_5order_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_15DnMatAttributes_5order_2__set__(((struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_DnMatAttributes *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_15DnMatAttributes_5order_2__set__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_DnMatAttributes *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  cusparseOrder_t __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __pyx_t_1 = __Pyx_PyLong_As_cusparseOrder_t(__pyx_v_value); if (unlikely((__pyx_t_1 == ((cusparseOrder_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 236, __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_backends.cuda.libs.cusparse.DnMatAttributes.order.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

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

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_15DnMatAttributes_3__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_15DnMatAttributes_2__reduce_cython__, "DnMatAttributes.__reduce_cython__(self)");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_15DnMatAttributes_3__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce_cython__", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_15DnMatAttributes_2__reduce_cython__(((struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_DnMatAttributes *)__pyx_v_self));

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_15DnMatAttributes_2__reduce_cython__(struct __pyx_obj_13cupy_backends_4cuda_4libs_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 and _dict:
*/
  __pyx_t_1 = __Pyx_PyLong_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_PyLong_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_PyLong_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_PyLong_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_PyLong_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 = PyLong_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);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1) != (0)) __PYX_ERR(2, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_2) != (0)) __PYX_ERR(2, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_3) != (0)) __PYX_ERR(2, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 3, __pyx_t_4) != (0)) __PYX_ERR(2, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_5);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 4, __pyx_t_5) != (0)) __PYX_ERR(2, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_6);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 5, __pyx_t_6) != (0)) __PYX_ERR(2, 5, __pyx_L1_error);
  __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 and _dict:
 *         state += (_dict,)
*/
  __pyx_t_7 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_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 and _dict:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
*/
  __pyx_t_9 = (__pyx_v__dict != Py_None);
  if (__pyx_t_9) {
  } else {
    __pyx_t_8 = __pyx_t_9;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v__dict); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(2, 7, __pyx_L1_error)
  __pyx_t_8 = __pyx_t_9;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_8) {

    /* "(tree fragment)":8
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None and _dict:
 *         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);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v__dict) != (0)) __PYX_ERR(2, 8, __pyx_L1_error);
    __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 and _dict:
 *         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 and _dict:             # <<<<<<<<<<<<<<
 *         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), 0x4b0530a, 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), 0x4b0530a, None), state
 *     else:
*/
  if (__pyx_v_use_setstate) {

    /* "(tree fragment)":13
 *         use_setstate = False
 *     if use_setstate:
 *         return __pyx_unpickle_DnMatAttributes, (type(self), 0x4b0530a, None), state             # <<<<<<<<<<<<<<
 *     else:
 *         return __pyx_unpickle_DnMatAttributes, (type(self), 0x4b0530a, state)
*/
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_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))));
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))) != (0)) __PYX_ERR(2, 13, __pyx_L1_error);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_int_78664458);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_78664458);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_mstate_global->__pyx_int_78664458) != (0)) __PYX_ERR(2, 13, __pyx_L1_error);
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 2, Py_None) != (0)) __PYX_ERR(2, 13, __pyx_L1_error);
    __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);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6) != (0)) __PYX_ERR(2, 13, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_7);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_7) != (0)) __PYX_ERR(2, 13, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state) != (0)) __PYX_ERR(2, 13, __pyx_L1_error);
    __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), 0x4b0530a, None), state
 *     else:
*/
  }

  /* "(tree fragment)":15
 *         return __pyx_unpickle_DnMatAttributes, (type(self), 0x4b0530a, None), state
 *     else:
 *         return __pyx_unpickle_DnMatAttributes, (type(self), 0x4b0530a, 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_mstate_global->__pyx_n_u_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))));
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))) != (0)) __PYX_ERR(2, 15, __pyx_L1_error);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_int_78664458);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_78664458);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_mstate_global->__pyx_int_78664458) != (0)) __PYX_ERR(2, 15, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_v_state) != (0)) __PYX_ERR(2, 15, __pyx_L1_error);
    __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);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5) != (0)) __PYX_ERR(2, 15, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_7);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_7) != (0)) __PYX_ERR(2, 15, __pyx_L1_error);
    __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_backends.cuda.libs.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), 0x4b0530a, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_DnMatAttributes__set_state(self, __pyx_state)
*/

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_15DnMatAttributes_5__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_15DnMatAttributes_4__setstate_cython__, "DnMatAttributes.__setstate_cython__(self, __pyx_state)");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_15DnMatAttributes_5__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(2, 16, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(2, 16, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__setstate_cython__", 0) < (0)) __PYX_ERR(2, 16, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, i); __PYX_ERR(2, 16, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(2, 16, __pyx_L3_error)
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(2, 16, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.DnMatAttributes.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_15DnMatAttributes_4__setstate_cython__(((struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_DnMatAttributes *)__pyx_v_self), __pyx_v___pyx_state);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_15DnMatAttributes_4__setstate_cython__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_DnMatAttributes *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  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("__setstate_cython__", 0);

  /* "(tree fragment)":17
 *         return __pyx_unpickle_DnMatAttributes, (type(self), 0x4b0530a, state)
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_DnMatAttributes__set_state(self, __pyx_state)             # <<<<<<<<<<<<<<
*/
  __pyx_t_1 = __pyx_v___pyx_state;
  __Pyx_INCREF(__pyx_t_1);
  if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(2, 17, __pyx_L1_error)
  if (unlikely(__pyx_t_1 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "cannot pass None into a C function argument that is declared 'not None'");
    __PYX_ERR(2, 17, __pyx_L1_error)
  }
  __pyx_t_2 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse___pyx_unpickle_DnMatAttributes__set_state(__pyx_v_self, ((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_DnMatAttributes, (type(self), 0x4b0530a, 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_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.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_backends/cuda/libs/cusparse.pyx":1516
 * cdef class DnMatBatchAttributes:
 * 
 *     def __init__(self, int count, int64_t stride):             # <<<<<<<<<<<<<<
 *         self.count = count
 *         self.stride = stride
*/

/* Python wrapper */
static int __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_20DnMatBatchAttributes_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_20DnMatBatchAttributes_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_count;
  int64_t __pyx_v_stride;
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_count,&__pyx_mstate_global->__pyx_n_u_stride,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 1516, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1516, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1516, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < (0)) __PYX_ERR(0, 1516, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, i); __PYX_ERR(0, 1516, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1516, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1516, __pyx_L3_error)
    }
    __pyx_v_count = __Pyx_PyLong_As_int(values[0]); if (unlikely((__pyx_v_count == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1516, __pyx_L3_error)
    __pyx_v_stride = __Pyx_PyLong_As_int64_t(values[1]); if (unlikely((__pyx_v_stride == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1516, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1516, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.DnMatBatchAttributes.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_20DnMatBatchAttributes___init__(((struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_DnMatBatchAttributes *)__pyx_v_self), __pyx_v_count, __pyx_v_stride);

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

static int __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_20DnMatBatchAttributes___init__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_DnMatBatchAttributes *__pyx_v_self, int __pyx_v_count, int64_t __pyx_v_stride) {
  int __pyx_r;

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

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

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

  /* function exit code */
  __pyx_r = 0;
  return __pyx_r;
}

/* "cupy_backends/cuda/libs/cusparse.pxd":240
 * cdef class DnMatBatchAttributes:
 *     cdef:
 *         public int count             # <<<<<<<<<<<<<<
 *         public int64_t stride
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_20DnMatBatchAttributes_5count_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_20DnMatBatchAttributes_5count_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_20DnMatBatchAttributes_5count___get__(((struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_DnMatBatchAttributes *)__pyx_v_self));

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_20DnMatBatchAttributes_5count___get__(struct __pyx_obj_13cupy_backends_4cuda_4libs_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_PyLong_From_int(__pyx_v_self->count); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 240, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.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_13cupy_backends_4cuda_4libs_8cusparse_20DnMatBatchAttributes_5count_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_20DnMatBatchAttributes_5count_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_20DnMatBatchAttributes_5count_2__set__(((struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_DnMatBatchAttributes *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_20DnMatBatchAttributes_5count_2__set__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_DnMatBatchAttributes *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __pyx_t_1 = __Pyx_PyLong_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 240, __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_backends.cuda.libs.cusparse.DnMatBatchAttributes.count.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "cupy_backends/cuda/libs/cusparse.pxd":241
 *     cdef:
 *         public int count
 *         public int64_t stride             # <<<<<<<<<<<<<<
 * 
 * cpdef intptr_t create() except? 0
*/

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_20DnMatBatchAttributes_6stride_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_20DnMatBatchAttributes_6stride_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_20DnMatBatchAttributes_6stride___get__(((struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_DnMatBatchAttributes *)__pyx_v_self));

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_20DnMatBatchAttributes_6stride___get__(struct __pyx_obj_13cupy_backends_4cuda_4libs_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_PyLong_From_int64_t(__pyx_v_self->stride); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 241, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.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_13cupy_backends_4cuda_4libs_8cusparse_20DnMatBatchAttributes_6stride_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_20DnMatBatchAttributes_6stride_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_20DnMatBatchAttributes_6stride_2__set__(((struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_DnMatBatchAttributes *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_20DnMatBatchAttributes_6stride_2__set__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_DnMatBatchAttributes *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  int64_t __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __pyx_t_1 = __Pyx_PyLong_As_int64_t(__pyx_v_value); if (unlikely((__pyx_t_1 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 241, __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_backends.cuda.libs.cusparse.DnMatBatchAttributes.stride.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

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

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_20DnMatBatchAttributes_3__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_20DnMatBatchAttributes_2__reduce_cython__, "DnMatBatchAttributes.__reduce_cython__(self)");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_20DnMatBatchAttributes_3__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce_cython__", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_20DnMatBatchAttributes_2__reduce_cython__(((struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_DnMatBatchAttributes *)__pyx_v_self));

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_20DnMatBatchAttributes_2__reduce_cython__(struct __pyx_obj_13cupy_backends_4cuda_4libs_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 and _dict:
*/
  __pyx_t_1 = __Pyx_PyLong_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_PyLong_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);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1) != (0)) __PYX_ERR(2, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2) != (0)) __PYX_ERR(2, 5, __pyx_L1_error);
  __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 and _dict:
 *         state += (_dict,)
*/
  __pyx_t_3 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_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 and _dict:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
*/
  __pyx_t_5 = (__pyx_v__dict != Py_None);
  if (__pyx_t_5) {
  } else {
    __pyx_t_4 = __pyx_t_5;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v__dict); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(2, 7, __pyx_L1_error)
  __pyx_t_4 = __pyx_t_5;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_4) {

    /* "(tree fragment)":8
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None and _dict:
 *         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);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v__dict) != (0)) __PYX_ERR(2, 8, __pyx_L1_error);
    __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 and _dict:
 *         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 and _dict:             # <<<<<<<<<<<<<<
 *         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), 0x250cbad, 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), 0x250cbad, None), state
 *     else:
*/
  if (__pyx_v_use_setstate) {

    /* "(tree fragment)":13
 *         use_setstate = False
 *     if use_setstate:
 *         return __pyx_unpickle_DnMatBatchAttributes, (type(self), 0x250cbad, None), state             # <<<<<<<<<<<<<<
 *     else:
 *         return __pyx_unpickle_DnMatBatchAttributes, (type(self), 0x250cbad, state)
*/
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_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))));
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))) != (0)) __PYX_ERR(2, 13, __pyx_L1_error);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_int_38849453);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_38849453);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_mstate_global->__pyx_int_38849453) != (0)) __PYX_ERR(2, 13, __pyx_L1_error);
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, Py_None) != (0)) __PYX_ERR(2, 13, __pyx_L1_error);
    __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);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2) != (0)) __PYX_ERR(2, 13, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_3);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3) != (0)) __PYX_ERR(2, 13, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state) != (0)) __PYX_ERR(2, 13, __pyx_L1_error);
    __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), 0x250cbad, None), state
 *     else:
*/
  }

  /* "(tree fragment)":15
 *         return __pyx_unpickle_DnMatBatchAttributes, (type(self), 0x250cbad, None), state
 *     else:
 *         return __pyx_unpickle_DnMatBatchAttributes, (type(self), 0x250cbad, 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_mstate_global->__pyx_n_u_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))));
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))) != (0)) __PYX_ERR(2, 15, __pyx_L1_error);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_int_38849453);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_38849453);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_mstate_global->__pyx_int_38849453) != (0)) __PYX_ERR(2, 15, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_state) != (0)) __PYX_ERR(2, 15, __pyx_L1_error);
    __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);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1) != (0)) __PYX_ERR(2, 15, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_3);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3) != (0)) __PYX_ERR(2, 15, __pyx_L1_error);
    __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_backends.cuda.libs.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), 0x250cbad, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_DnMatBatchAttributes__set_state(self, __pyx_state)
*/

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_20DnMatBatchAttributes_5__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_20DnMatBatchAttributes_4__setstate_cython__, "DnMatBatchAttributes.__setstate_cython__(self, __pyx_state)");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_20DnMatBatchAttributes_5__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(2, 16, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(2, 16, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__setstate_cython__", 0) < (0)) __PYX_ERR(2, 16, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, i); __PYX_ERR(2, 16, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(2, 16, __pyx_L3_error)
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(2, 16, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.DnMatBatchAttributes.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_20DnMatBatchAttributes_4__setstate_cython__(((struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_DnMatBatchAttributes *)__pyx_v_self), __pyx_v___pyx_state);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_20DnMatBatchAttributes_4__setstate_cython__(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_DnMatBatchAttributes *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  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("__setstate_cython__", 0);

  /* "(tree fragment)":17
 *         return __pyx_unpickle_DnMatBatchAttributes, (type(self), 0x250cbad, state)
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_DnMatBatchAttributes__set_state(self, __pyx_state)             # <<<<<<<<<<<<<<
*/
  __pyx_t_1 = __pyx_v___pyx_state;
  __Pyx_INCREF(__pyx_t_1);
  if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(2, 17, __pyx_L1_error)
  if (unlikely(__pyx_t_1 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "cannot pass None into a C function argument that is declared 'not None'");
    __PYX_ERR(2, 17, __pyx_L1_error)
  }
  __pyx_t_2 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse___pyx_unpickle_DnMatBatchAttributes__set_state(__pyx_v_self, ((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_DnMatBatchAttributes, (type(self), 0x250cbad, 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_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.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_backends/cuda/libs/cusparse.pyx":1523
 * class CuSparseError(RuntimeError):
 * 
 *     def __init__(self, Status status):             # <<<<<<<<<<<<<<
 *         self.status = status
 *         cdef bytes name
*/

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_13CuSparseError_1__init__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_13CuSparseError___init__, "CuSparseError.__init__(self, Status status)");
static PyMethodDef __pyx_mdef_13cupy_backends_4cuda_4libs_8cusparse_13CuSparseError_1__init__ = {"__init__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_13CuSparseError_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_13CuSparseError___init__};
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_13CuSparseError_1__init__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  cusparseStatus_t __pyx_v_status;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_status,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 1523, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1523, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1523, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < (0)) __PYX_ERR(0, 1523, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, i); __PYX_ERR(0, 1523, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1523, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1523, __pyx_L3_error)
    }
    __pyx_v_self = values[0];
    __pyx_v_status = __Pyx_PyLong_As_cusparseStatus_t(values[1]); if (unlikely((__pyx_v_status == ((cusparseStatus_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1523, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1523, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.CuSparseError.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_13CuSparseError___init__(__pyx_self, __pyx_v_self, __pyx_v_status);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_13CuSparseError___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, cusparseStatus_t __pyx_v_status) {
  PyObject *__pyx_v_name = 0;
  PyObject *__pyx_v_msg = 0;
  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;
  size_t __pyx_t_6;
  PyObject *__pyx_t_7[3];
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "cupy_backends/cuda/libs/cusparse.pyx":1524
 * 
 *     def __init__(self, Status status):
 *         self.status = status             # <<<<<<<<<<<<<<
 *         cdef bytes name
 *         cdef bytes msg
*/
  __pyx_t_1 = __Pyx_PyLong_From_cusparseStatus_t(__pyx_v_status); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1524, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_status, __pyx_t_1) < (0)) __PYX_ERR(0, 1524, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":1527
 *         cdef bytes name
 *         cdef bytes msg
 *         if _is_hip_environment:             # <<<<<<<<<<<<<<
 *             name = HIP_STATUS[status]
 *             msg = name
*/
  if (__pyx_v_13cupy_backends_4cuda_3api_7runtime__is_hip_environment) {

    /* "cupy_backends/cuda/libs/cusparse.pyx":1528
 *         cdef bytes msg
 *         if _is_hip_environment:
 *             name = HIP_STATUS[status]             # <<<<<<<<<<<<<<
 *             msg = name
 *         else:
*/
    if (unlikely(__pyx_v_13cupy_backends_4cuda_4libs_8cusparse_HIP_STATUS == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(0, 1528, __pyx_L1_error)
    }
    __pyx_t_1 = __Pyx_PyLong_From_cusparseStatus_t(__pyx_v_status); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1528, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyDict_GetItem(__pyx_v_13cupy_backends_4cuda_4libs_8cusparse_HIP_STATUS, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1528, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (!(likely(PyBytes_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_2))) __PYX_ERR(0, 1528, __pyx_L1_error)
    __pyx_v_name = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "cupy_backends/cuda/libs/cusparse.pyx":1529
 *         if _is_hip_environment:
 *             name = HIP_STATUS[status]
 *             msg = name             # <<<<<<<<<<<<<<
 *         else:
 *             name = cusparseGetErrorName(status)
*/
    __Pyx_INCREF(__pyx_v_name);
    __pyx_v_msg = __pyx_v_name;

    /* "cupy_backends/cuda/libs/cusparse.pyx":1527
 *         cdef bytes name
 *         cdef bytes msg
 *         if _is_hip_environment:             # <<<<<<<<<<<<<<
 *             name = HIP_STATUS[status]
 *             msg = name
*/
    goto __pyx_L3;
  }

  /* "cupy_backends/cuda/libs/cusparse.pyx":1531
 *             msg = name
 *         else:
 *             name = cusparseGetErrorName(status)             # <<<<<<<<<<<<<<
 *             msg = cusparseGetErrorString(status)
 *         super().__init__(f'{name.decode()}: {msg.decode()}')
*/
  /*else*/ {
    __pyx_t_2 = __Pyx_PyBytes_FromString(cusparseGetErrorName(__pyx_v_status)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1531, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_name = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "cupy_backends/cuda/libs/cusparse.pyx":1532
 *         else:
 *             name = cusparseGetErrorName(status)
 *             msg = cusparseGetErrorString(status)             # <<<<<<<<<<<<<<
 *         super().__init__(f'{name.decode()}: {msg.decode()}')
 * 
*/
    __pyx_t_2 = __Pyx_PyBytes_FromString(cusparseGetErrorString(__pyx_v_status)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1532, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_msg = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;
  }
  __pyx_L3:;

  /* "cupy_backends/cuda/libs/cusparse.pyx":1533
 *             name = cusparseGetErrorName(status)
 *             msg = cusparseGetErrorString(status)
 *         super().__init__(f'{name.decode()}: {msg.decode()}')             # <<<<<<<<<<<<<<
 * 
 *     def __reduce__(self):
*/
  __pyx_t_4 = NULL;
  __pyx_t_5 = __Pyx_CyFunction_GetClassObj(__pyx_self);
  if (!__pyx_t_5) { PyErr_SetString(PyExc_RuntimeError, "super(): empty __class__ cell"); __PYX_ERR(0, 1533, __pyx_L1_error) }
  __Pyx_INCREF(__pyx_t_5);
  __pyx_t_6 = 1;
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_t_5, __pyx_v_self};
    __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_super, __pyx_callargs+__pyx_t_6, (3-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1533, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_t_1 = __pyx_t_3;
  __Pyx_INCREF(__pyx_t_1);
  if (unlikely(__pyx_v_name == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "decode");
    __PYX_ERR(0, 1533, __pyx_L1_error)
  }
  __pyx_t_5 = __Pyx_decode_bytes(__pyx_v_name, 0, PY_SSIZE_T_MAX, NULL, NULL, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1533, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (unlikely(__pyx_v_msg == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "decode");
    __PYX_ERR(0, 1533, __pyx_L1_error)
  }
  __pyx_t_4 = __Pyx_decode_bytes(__pyx_v_msg, 0, PY_SSIZE_T_MAX, NULL, NULL, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1533, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_7[0] = __pyx_t_5;
  __pyx_t_7[1] = __pyx_mstate_global->__pyx_kp_u_;
  __pyx_t_7[2] = __pyx_t_4;
  __pyx_t_8 = __Pyx_PyUnicode_Join(__pyx_t_7, 3, __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5) + 2 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4));
  if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1533, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_6 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_8};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_init, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1533, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":1523
 * class CuSparseError(RuntimeError):
 * 
 *     def __init__(self, Status status):             # <<<<<<<<<<<<<<
 *         self.status = status
 *         cdef bytes name
*/

  /* 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_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.CuSparseError.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_name);
  __Pyx_XDECREF(__pyx_v_msg);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy_backends/cuda/libs/cusparse.pyx":1535
 *         super().__init__(f'{name.decode()}: {msg.decode()}')
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         return (type(self), (self.status,))
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_13CuSparseError_3__reduce__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_13CuSparseError_2__reduce__, "CuSparseError.__reduce__(self)");
static PyMethodDef __pyx_mdef_13cupy_backends_4cuda_4libs_8cusparse_13CuSparseError_3__reduce__ = {"__reduce__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_13CuSparseError_3__reduce__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_13CuSparseError_2__reduce__};
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_13CuSparseError_3__reduce__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 1535, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1535, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__reduce__", 0) < (0)) __PYX_ERR(0, 1535, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__reduce__", 1, 1, 1, i); __PYX_ERR(0, 1535, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1535, __pyx_L3_error)
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__reduce__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1535, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.CuSparseError.__reduce__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_13CuSparseError_2__reduce__(__pyx_self, __pyx_v_self);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_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_backends/cuda/libs/cusparse.pyx":1536
 * 
 *     def __reduce__(self):
 *         return (type(self), (self.status,))             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_status); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1536, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1536, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 1536, __pyx_L1_error);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1536, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_self)));
  __Pyx_GIVEREF(((PyObject *)Py_TYPE(__pyx_v_self)));
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(__pyx_v_self))) != (0)) __PYX_ERR(0, 1536, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2) != (0)) __PYX_ERR(0, 1536, __pyx_L1_error);
  __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":1535
 *         super().__init__(f'{name.decode()}: {msg.decode()}')
 * 
 *     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_backends.cuda.libs.cusparse.CuSparseError.__reduce__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy_backends/cuda/libs/cusparse.pyx":1539
 * 
 * 
 * @cython.profile(False)             # <<<<<<<<<<<<<<
 * cpdef inline check_status(int status):
 *     if status != 0:
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_1check_status(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_13cupy_backends_4cuda_4libs_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;
  size_t __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("check_status", 0);

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

    /* "cupy_backends/cuda/libs/cusparse.pyx":1542
 * cpdef inline check_status(int status):
 *     if status != 0:
 *         raise CuSparseError(status)             # <<<<<<<<<<<<<<
 * 
 * 
*/
    __pyx_t_3 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_CuSparseError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1542, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyLong_From_int(__pyx_v_status); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1542, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
      assert(__pyx_t_3);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
      __pyx_t_6 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_5};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1542, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 1542, __pyx_L1_error)

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

  /* "cupy_backends/cuda/libs/cusparse.pyx":1539
 * 
 * 
 * @cython.profile(False)             # <<<<<<<<<<<<<<
 * cpdef inline check_status(int status):
 *     if status != 0:
*/

  /* 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_backends.cuda.libs.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_13cupy_backends_4cuda_4libs_8cusparse_1check_status(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_check_status, "check_status(int status)");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_1check_status(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  int __pyx_v_status;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("check_status (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_status,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 1539, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1539, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "check_status", 0) < (0)) __PYX_ERR(0, 1539, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("check_status", 1, 1, 1, i); __PYX_ERR(0, 1539, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1539, __pyx_L3_error)
    }
    __pyx_v_status = __Pyx_PyLong_As_int(values[0]); if (unlikely((__pyx_v_status == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1540, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("check_status", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1539, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.check_status", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_self, __pyx_v_status);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_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_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1539, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":1545
 * 
 * 
 * @cython.profile(False)             # <<<<<<<<<<<<<<
 * cdef inline cuComplex complex_to_cuda(complex value) noexcept:
 *     cdef cuComplex value_cuda
*/

static CYTHON_INLINE cuComplex __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_complex_to_cuda(__pyx_t_double_complex __pyx_v_value) {
  cuComplex __pyx_v_value_cuda;
  cuComplex __pyx_r;
  double __pyx_t_1;

  /* "cupy_backends/cuda/libs/cusparse.pyx":1548
 * cdef inline cuComplex complex_to_cuda(complex value) noexcept:
 *     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_backends/cuda/libs/cusparse.pyx":1549
 *     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_backends/cuda/libs/cusparse.pyx":1550
 *     value_cuda.x = value.real
 *     value_cuda.y = value.imag
 *     return value_cuda             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_r = __pyx_v_value_cuda;
  goto __pyx_L0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":1545
 * 
 * 
 * @cython.profile(False)             # <<<<<<<<<<<<<<
 * cdef inline cuComplex complex_to_cuda(complex value) noexcept:
 *     cdef cuComplex value_cuda
*/

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "cupy_backends/cuda/libs/cusparse.pyx":1553
 * 
 * 
 * @cython.profile(False)             # <<<<<<<<<<<<<<
 * cdef inline cuDoubleComplex double_complex_to_cuda(
 *         double complex value) noexcept:
*/

static CYTHON_INLINE cuDoubleComplex __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_double_complex_to_cuda(__pyx_t_double_complex __pyx_v_value) {
  cuDoubleComplex __pyx_v_value_cuda;
  cuDoubleComplex __pyx_r;
  double __pyx_t_1;

  /* "cupy_backends/cuda/libs/cusparse.pyx":1557
 *         double complex value) noexcept:
 *     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_backends/cuda/libs/cusparse.pyx":1558
 *     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_backends/cuda/libs/cusparse.pyx":1559
 *     value_cuda.x = value.real
 *     value_cuda.y = value.imag
 *     return value_cuda             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_r = __pyx_v_value_cuda;
  goto __pyx_L0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":1553
 * 
 * 
 * @cython.profile(False)             # <<<<<<<<<<<<<<
 * cdef inline cuDoubleComplex double_complex_to_cuda(
 *         double complex value) noexcept:
*/

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

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

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_3getVersion(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static int __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_getVersion(intptr_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_backends/cuda/libs/cusparse.pyx":1564
 * cpdef int getVersion(intptr_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_backends/cuda/libs/cusparse.pyx":1565
 *     cdef int version
 *     status = cusparseGetVersion(<Handle>handle, &version)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return version
 * 
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1565, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":1566
 *     status = cusparseGetVersion(<Handle>handle, &version)
 *     check_status(status)
 *     return version             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_r = __pyx_v_version;
  goto __pyx_L0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":1562
 * 
 * 
 * cpdef int getVersion(intptr_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_backends.cuda.libs.cusparse.getVersion", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_3getVersion(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_2getVersion, "getVersion(intptr_t handle) -> int");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_3getVersion(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_t __pyx_v_handle;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("getVersion (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 1562, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1562, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getVersion", 0) < (0)) __PYX_ERR(0, 1562, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getVersion", 1, 1, 1, i); __PYX_ERR(0, 1562, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1562, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1562, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("getVersion", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1562, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.getVersion", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_2getVersion(__pyx_self, __pyx_v_handle);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_2getVersion(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_getVersion(__pyx_v_handle, 1); if (unlikely(__pyx_t_1 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1562, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1562, __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_backends.cuda.libs.cusparse.getVersion", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy_backends/cuda/libs/cusparse.pyx":1569
 * 
 * 
 * def get_build_version():             # <<<<<<<<<<<<<<
 *     return CUSPARSE_VERSION
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_5get_build_version(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_4get_build_version, "get_build_version()");
static PyMethodDef __pyx_mdef_13cupy_backends_4cuda_4libs_8cusparse_5get_build_version = {"get_build_version", (PyCFunction)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_5get_build_version, METH_NOARGS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_4get_build_version};
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_5get_build_version(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_build_version (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_4get_build_version(__pyx_self);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_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_backends/cuda/libs/cusparse.pyx":1570
 * 
 * def get_build_version():
 *     return CUSPARSE_VERSION             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyLong_From_int(CUSPARSE_VERSION); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1570, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":1569
 * 
 * 
 * def get_build_version():             # <<<<<<<<<<<<<<
 *     return CUSPARSE_VERSION
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.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_backends/cuda/libs/cusparse.pyx":1576
 * # cuSPARSE Helper Function
 * 
 * cpdef intptr_t create() except? 0:             # <<<<<<<<<<<<<<
 *     cdef Handle handle
 *     status = cusparseCreate(& handle)
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_7create(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static intptr_t __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_create(CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseHandle_t __pyx_v_handle;
  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("create", 0);

  /* "cupy_backends/cuda/libs/cusparse.pyx":1578
 * cpdef intptr_t create() except? 0:
 *     cdef Handle handle
 *     status = cusparseCreate(& handle)             # <<<<<<<<<<<<<<
 *     check_status(status)
 *     return <intptr_t>handle
*/
  __pyx_v_status = cusparseCreate((&__pyx_v_handle));

  /* "cupy_backends/cuda/libs/cusparse.pyx":1579
 *     cdef Handle handle
 *     status = cusparseCreate(& handle)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return <intptr_t>handle
 * 
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 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_backends/cuda/libs/cusparse.pyx":1580
 *     status = cusparseCreate(& handle)
 *     check_status(status)
 *     return <intptr_t>handle             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_r = ((intptr_t)__pyx_v_handle);
  goto __pyx_L0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":1576
 * # cuSPARSE Helper Function
 * 
 * cpdef intptr_t create() except? 0:             # <<<<<<<<<<<<<<
 *     cdef Handle handle
 *     status = cusparseCreate(& handle)
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.create", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_7create(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_6create, "create() -> intptr_t");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_7create(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("create (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_6create(__pyx_self);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_6create(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  intptr_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_13cupy_backends_4cuda_4libs_8cusparse_create(1); if (unlikely(__pyx_t_1 == ((intptr_t)0) && PyErr_Occurred())) __PYX_ERR(0, 1576, __pyx_L1_error)
  __pyx_t_2 = PyLong_FromSsize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1576, __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_backends.cuda.libs.cusparse.create", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy_backends/cuda/libs/cusparse.pyx":1583
 * 
 * 
 * cpdef size_t createMatDescr() except? -1:             # <<<<<<<<<<<<<<
 *     cdef MatDescr desc
 *     status = cusparseCreateMatDescr(& desc)
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_9createMatDescr(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static size_t __pyx_f_13cupy_backends_4cuda_4libs_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_backends/cuda/libs/cusparse.pyx":1585
 * cpdef size_t createMatDescr() except? -1:
 *     cdef MatDescr desc
 *     status = cusparseCreateMatDescr(& desc)             # <<<<<<<<<<<<<<
 *     check_status(status)
 *     return <size_t>desc
*/
  __pyx_v_status = cusparseCreateMatDescr((&__pyx_v_desc));

  /* "cupy_backends/cuda/libs/cusparse.pyx":1586
 *     cdef MatDescr desc
 *     status = cusparseCreateMatDescr(& desc)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return <size_t>desc
 * 
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1586, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":1587
 *     status = cusparseCreateMatDescr(& desc)
 *     check_status(status)
 *     return <size_t>desc             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_r = ((size_t)__pyx_v_desc);
  goto __pyx_L0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":1583
 * 
 * 
 * cpdef size_t createMatDescr() except? -1:             # <<<<<<<<<<<<<<
 *     cdef MatDescr desc
 *     status = cusparseCreateMatDescr(& desc)
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.createMatDescr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1L;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_9createMatDescr(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_8createMatDescr, "createMatDescr() -> size_t");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_9createMatDescr(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("createMatDescr (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_8createMatDescr(__pyx_self);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_8createMatDescr(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("createMatDescr", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_createMatDescr(1); if (unlikely(__pyx_t_1 == ((size_t)-1L) && PyErr_Occurred())) __PYX_ERR(0, 1583, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyLong_FromSize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1583, __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_backends.cuda.libs.cusparse.createMatDescr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy_backends/cuda/libs/cusparse.pyx":1590
 * 
 * 
 * cpdef void destroy(intptr_t handle) except *:             # <<<<<<<<<<<<<<
 *     status = cusparseDestroy(<Handle >handle)
 *     check_status(status)
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_11destroy(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_destroy(intptr_t __pyx_v_handle, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  __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_backends/cuda/libs/cusparse.pyx":1591
 * 
 * cpdef void destroy(intptr_t handle) except *:
 *     status = cusparseDestroy(<Handle >handle)             # <<<<<<<<<<<<<<
 *     check_status(status)
 * 
*/
  __pyx_v_status = cusparseDestroy(((cusparseHandle_t)__pyx_v_handle));

  /* "cupy_backends/cuda/libs/cusparse.pyx":1592
 * cpdef void destroy(intptr_t handle) except *:
 *     status = cusparseDestroy(<Handle >handle)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 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_backends/cuda/libs/cusparse.pyx":1590
 * 
 * 
 * cpdef void destroy(intptr_t handle) except *:             # <<<<<<<<<<<<<<
 *     status = cusparseDestroy(<Handle >handle)
 *     check_status(status)
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.destroy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_11destroy(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_10destroy, "destroy(intptr_t handle) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_11destroy(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_t __pyx_v_handle;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("destroy (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 1590, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1590, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "destroy", 0) < (0)) __PYX_ERR(0, 1590, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("destroy", 1, 1, 1, i); __PYX_ERR(0, 1590, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1590, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1590, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("destroy", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1590, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.destroy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_10destroy(__pyx_self, __pyx_v_handle);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_10destroy(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_f_13cupy_backends_4cuda_4libs_8cusparse_destroy(__pyx_v_handle, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1590, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1590, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":1595
 * 
 * 
 * cpdef void destroyMatDescr(size_t descr) except *:             # <<<<<<<<<<<<<<
 *     status = cusparseDestroyMatDescr(<MatDescr>descr)
 *     check_status(status)
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_13destroyMatDescr(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_destroyMatDescr(size_t __pyx_v_descr, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  __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_backends/cuda/libs/cusparse.pyx":1596
 * 
 * cpdef void destroyMatDescr(size_t descr) except *:
 *     status = cusparseDestroyMatDescr(<MatDescr>descr)             # <<<<<<<<<<<<<<
 *     check_status(status)
 * 
*/
  __pyx_v_status = cusparseDestroyMatDescr(((cusparseMatDescr_t)__pyx_v_descr));

  /* "cupy_backends/cuda/libs/cusparse.pyx":1597
 * cpdef void destroyMatDescr(size_t descr) except *:
 *     status = cusparseDestroyMatDescr(<MatDescr>descr)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1597, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":1595
 * 
 * 
 * cpdef void destroyMatDescr(size_t descr) except *:             # <<<<<<<<<<<<<<
 *     status = cusparseDestroyMatDescr(<MatDescr>descr)
 *     check_status(status)
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.destroyMatDescr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_13destroyMatDescr(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_12destroyMatDescr, "destroyMatDescr(size_t descr) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_13destroyMatDescr(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  size_t __pyx_v_descr;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("destroyMatDescr (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_descr,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 1595, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1595, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "destroyMatDescr", 0) < (0)) __PYX_ERR(0, 1595, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("destroyMatDescr", 1, 1, 1, i); __PYX_ERR(0, 1595, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1595, __pyx_L3_error)
    }
    __pyx_v_descr = __Pyx_PyLong_As_size_t(values[0]); if (unlikely((__pyx_v_descr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1595, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("destroyMatDescr", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1595, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.destroyMatDescr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_12destroyMatDescr(__pyx_self, __pyx_v_descr);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_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_f_13cupy_backends_4cuda_4libs_8cusparse_destroyMatDescr(__pyx_v_descr, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1595, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1595, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":1600
 * 
 * 
 * cpdef void setMatIndexBase(size_t descr, base) except *:             # <<<<<<<<<<<<<<
 *     status = cusparseSetMatIndexBase(<MatDescr>descr, base)
 *     check_status(status)
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_15setMatIndexBase(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_setMatIndexBase(size_t __pyx_v_descr, PyObject *__pyx_v_base, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  __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_backends/cuda/libs/cusparse.pyx":1601
 * 
 * cpdef void setMatIndexBase(size_t descr, base) except *:
 *     status = cusparseSetMatIndexBase(<MatDescr>descr, base)             # <<<<<<<<<<<<<<
 *     check_status(status)
 * 
*/
  __pyx_t_1 = __Pyx_PyLong_As_cusparseIndexBase_t(__pyx_v_base); if (unlikely((__pyx_t_1 == ((cusparseIndexBase_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1601, __pyx_L1_error)
  __pyx_v_status = cusparseSetMatIndexBase(((cusparseMatDescr_t)__pyx_v_descr), __pyx_t_1);

  /* "cupy_backends/cuda/libs/cusparse.pyx":1602
 * cpdef void setMatIndexBase(size_t descr, base) except *:
 *     status = cusparseSetMatIndexBase(<MatDescr>descr, base)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_2 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1602, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":1600
 * 
 * 
 * cpdef void setMatIndexBase(size_t descr, base) except *:             # <<<<<<<<<<<<<<
 *     status = cusparseSetMatIndexBase(<MatDescr>descr, base)
 *     check_status(status)
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.setMatIndexBase", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_15setMatIndexBase(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_14setMatIndexBase, "setMatIndexBase(size_t descr, base) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_15setMatIndexBase(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  size_t __pyx_v_descr;
  PyObject *__pyx_v_base = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,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);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_descr,&__pyx_mstate_global->__pyx_n_u_base,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 1600, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1600, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1600, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setMatIndexBase", 0) < (0)) __PYX_ERR(0, 1600, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setMatIndexBase", 1, 2, 2, i); __PYX_ERR(0, 1600, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1600, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1600, __pyx_L3_error)
    }
    __pyx_v_descr = __Pyx_PyLong_As_size_t(values[0]); if (unlikely((__pyx_v_descr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1600, __pyx_L3_error)
    __pyx_v_base = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setMatIndexBase", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1600, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.setMatIndexBase", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_14setMatIndexBase(__pyx_self, __pyx_v_descr, __pyx_v_base);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_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_f_13cupy_backends_4cuda_4libs_8cusparse_setMatIndexBase(__pyx_v_descr, __pyx_v_base, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1600, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1600, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":1605
 * 
 * 
 * cpdef void setMatType(size_t descr, typ) except *:             # <<<<<<<<<<<<<<
 *     status = cusparseSetMatType(<MatDescr>descr, typ)
 *     check_status(status)
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_17setMatType(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_setMatType(size_t __pyx_v_descr, PyObject *__pyx_v_typ, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  __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_backends/cuda/libs/cusparse.pyx":1606
 * 
 * cpdef void setMatType(size_t descr, typ) except *:
 *     status = cusparseSetMatType(<MatDescr>descr, typ)             # <<<<<<<<<<<<<<
 *     check_status(status)
 * 
*/
  __pyx_t_1 = __Pyx_PyLong_As_cusparseMatrixType_t(__pyx_v_typ); if (unlikely((__pyx_t_1 == ((cusparseMatrixType_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1606, __pyx_L1_error)
  __pyx_v_status = cusparseSetMatType(((cusparseMatDescr_t)__pyx_v_descr), __pyx_t_1);

  /* "cupy_backends/cuda/libs/cusparse.pyx":1607
 * cpdef void setMatType(size_t descr, typ) except *:
 *     status = cusparseSetMatType(<MatDescr>descr, typ)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef void setMatFillMode(size_t descrA, int fillMode) except *:
*/
  __pyx_t_2 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1607, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":1605
 * 
 * 
 * cpdef void setMatType(size_t descr, typ) except *:             # <<<<<<<<<<<<<<
 *     status = cusparseSetMatType(<MatDescr>descr, typ)
 *     check_status(status)
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.setMatType", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_17setMatType(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_16setMatType, "setMatType(size_t descr, typ) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_17setMatType(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  size_t __pyx_v_descr;
  PyObject *__pyx_v_typ = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,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);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_descr,&__pyx_mstate_global->__pyx_n_u_typ,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 1605, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1605, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1605, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setMatType", 0) < (0)) __PYX_ERR(0, 1605, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setMatType", 1, 2, 2, i); __PYX_ERR(0, 1605, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1605, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1605, __pyx_L3_error)
    }
    __pyx_v_descr = __Pyx_PyLong_As_size_t(values[0]); if (unlikely((__pyx_v_descr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1605, __pyx_L3_error)
    __pyx_v_typ = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setMatType", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1605, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.setMatType", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_16setMatType(__pyx_self, __pyx_v_descr, __pyx_v_typ);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_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_f_13cupy_backends_4cuda_4libs_8cusparse_setMatType(__pyx_v_descr, __pyx_v_typ, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1605, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1605, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":1609
 *     check_status(status)
 * 
 * cpdef void setMatFillMode(size_t descrA, int fillMode) except *:             # <<<<<<<<<<<<<<
 *     status = cusparseSetMatFillMode(<MatDescr>descrA, <FillMode>fillMode)
 *     check_status(status)
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_19setMatFillMode(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_setMatFillMode(size_t __pyx_v_descrA, int __pyx_v_fillMode, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("setMatFillMode", 0);

  /* "cupy_backends/cuda/libs/cusparse.pyx":1610
 * 
 * cpdef void setMatFillMode(size_t descrA, int fillMode) except *:
 *     status = cusparseSetMatFillMode(<MatDescr>descrA, <FillMode>fillMode)             # <<<<<<<<<<<<<<
 *     check_status(status)
 * 
*/
  __pyx_v_status = cusparseSetMatFillMode(((cusparseMatDescr_t)__pyx_v_descrA), ((cusparseFillMode_t)__pyx_v_fillMode));

  /* "cupy_backends/cuda/libs/cusparse.pyx":1611
 * cpdef void setMatFillMode(size_t descrA, int fillMode) except *:
 *     status = cusparseSetMatFillMode(<MatDescr>descrA, <FillMode>fillMode)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef void setMatDiagType(size_t descrA, int diagType) except *:
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1611, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":1609
 *     check_status(status)
 * 
 * cpdef void setMatFillMode(size_t descrA, int fillMode) except *:             # <<<<<<<<<<<<<<
 *     status = cusparseSetMatFillMode(<MatDescr>descrA, <FillMode>fillMode)
 *     check_status(status)
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.setMatFillMode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_19setMatFillMode(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_18setMatFillMode, "setMatFillMode(size_t descrA, int fillMode) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_19setMatFillMode(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  size_t __pyx_v_descrA;
  int __pyx_v_fillMode;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("setMatFillMode (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_fillMode,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 1609, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1609, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1609, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setMatFillMode", 0) < (0)) __PYX_ERR(0, 1609, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setMatFillMode", 1, 2, 2, i); __PYX_ERR(0, 1609, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1609, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1609, __pyx_L3_error)
    }
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[0]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1609, __pyx_L3_error)
    __pyx_v_fillMode = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_fillMode == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1609, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setMatFillMode", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1609, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.setMatFillMode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_18setMatFillMode(__pyx_self, __pyx_v_descrA, __pyx_v_fillMode);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_18setMatFillMode(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_descrA, int __pyx_v_fillMode) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("setMatFillMode", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_setMatFillMode(__pyx_v_descrA, __pyx_v_fillMode, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1609, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1609, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":1613
 *     check_status(status)
 * 
 * cpdef void setMatDiagType(size_t descrA, int diagType) except *:             # <<<<<<<<<<<<<<
 *     status = cusparseSetMatDiagType(<MatDescr>descrA, <DiagType>diagType)
 *     check_status(status)
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_21setMatDiagType(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_setMatDiagType(size_t __pyx_v_descrA, int __pyx_v_diagType, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("setMatDiagType", 0);

  /* "cupy_backends/cuda/libs/cusparse.pyx":1614
 * 
 * cpdef void setMatDiagType(size_t descrA, int diagType) except *:
 *     status = cusparseSetMatDiagType(<MatDescr>descrA, <DiagType>diagType)             # <<<<<<<<<<<<<<
 *     check_status(status)
 * 
*/
  __pyx_v_status = cusparseSetMatDiagType(((cusparseMatDescr_t)__pyx_v_descrA), ((cusparseDiagType_t)__pyx_v_diagType));

  /* "cupy_backends/cuda/libs/cusparse.pyx":1615
 * cpdef void setMatDiagType(size_t descrA, int diagType) except *:
 *     status = cusparseSetMatDiagType(<MatDescr>descrA, <DiagType>diagType)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef void setPointerMode(intptr_t handle, int mode) except *:
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1615, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":1613
 *     check_status(status)
 * 
 * cpdef void setMatDiagType(size_t descrA, int diagType) except *:             # <<<<<<<<<<<<<<
 *     status = cusparseSetMatDiagType(<MatDescr>descrA, <DiagType>diagType)
 *     check_status(status)
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.setMatDiagType", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_21setMatDiagType(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_20setMatDiagType, "setMatDiagType(size_t descrA, int diagType) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_21setMatDiagType(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  size_t __pyx_v_descrA;
  int __pyx_v_diagType;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("setMatDiagType (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_diagType,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 1613, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1613, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1613, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setMatDiagType", 0) < (0)) __PYX_ERR(0, 1613, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setMatDiagType", 1, 2, 2, i); __PYX_ERR(0, 1613, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1613, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1613, __pyx_L3_error)
    }
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[0]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1613, __pyx_L3_error)
    __pyx_v_diagType = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_diagType == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1613, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setMatDiagType", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1613, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.setMatDiagType", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_20setMatDiagType(__pyx_self, __pyx_v_descrA, __pyx_v_diagType);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_20setMatDiagType(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_descrA, int __pyx_v_diagType) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("setMatDiagType", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_setMatDiagType(__pyx_v_descrA, __pyx_v_diagType, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1613, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1613, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":1617
 *     check_status(status)
 * 
 * cpdef void setPointerMode(intptr_t handle, int mode) except *:             # <<<<<<<<<<<<<<
 *     status = cusparseSetPointerMode(<Handle>handle, <PointerMode>mode)
 *     check_status(status)
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_23setPointerMode(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_setPointerMode(intptr_t __pyx_v_handle, int __pyx_v_mode, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  __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_backends/cuda/libs/cusparse.pyx":1618
 * 
 * cpdef void setPointerMode(intptr_t handle, int mode) except *:
 *     status = cusparseSetPointerMode(<Handle>handle, <PointerMode>mode)             # <<<<<<<<<<<<<<
 *     check_status(status)
 * 
*/
  __pyx_v_status = cusparseSetPointerMode(((cusparseHandle_t)__pyx_v_handle), ((cusparsePointerMode_t)__pyx_v_mode));

  /* "cupy_backends/cuda/libs/cusparse.pyx":1619
 * cpdef void setPointerMode(intptr_t handle, int mode) except *:
 *     status = cusparseSetPointerMode(<Handle>handle, <PointerMode>mode)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef void spMatSetAttribute(
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1619, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":1617
 *     check_status(status)
 * 
 * cpdef void setPointerMode(intptr_t handle, int mode) except *:             # <<<<<<<<<<<<<<
 *     status = cusparseSetPointerMode(<Handle>handle, <PointerMode>mode)
 *     check_status(status)
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.setPointerMode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_23setPointerMode(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_22setPointerMode, "setPointerMode(intptr_t handle, int mode) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_23setPointerMode(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_t __pyx_v_handle;
  int __pyx_v_mode;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("setPointerMode (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_mode,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 1617, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1617, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1617, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setPointerMode", 0) < (0)) __PYX_ERR(0, 1617, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setPointerMode", 1, 2, 2, i); __PYX_ERR(0, 1617, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1617, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1617, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1617, __pyx_L3_error)
    __pyx_v_mode = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_mode == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1617, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setPointerMode", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1617, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.setPointerMode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_22setPointerMode(__pyx_self, __pyx_v_handle, __pyx_v_mode);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_22setPointerMode(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_f_13cupy_backends_4cuda_4libs_8cusparse_setPointerMode(__pyx_v_handle, __pyx_v_mode, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1617, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1617, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":1621
 *     check_status(status)
 * 
 * cpdef void spMatSetAttribute(             # <<<<<<<<<<<<<<
 *         size_t spMatDescr, int attribute, int data) except *:
 *     # Assuming the value of attribute is an enum value, whose underlying type
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_25spMatSetAttribute(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_spMatSetAttribute(size_t __pyx_v_spMatDescr, int __pyx_v_attribute, int __pyx_v_data, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("spMatSetAttribute", 0);

  /* "cupy_backends/cuda/libs/cusparse.pyx":1626
 *     # As for CUDA 11.7, the types of all the sparse matrix descriptor
 *     # attributes are enums, whose underlying type is always int in C.
 *     status = cusparseSpMatSetAttribute(             # <<<<<<<<<<<<<<
 *         <SpMatDescr>spMatDescr, <SpMatAttribute>attribute, <void*>&data,
 *         sizeof(int))
*/
  __pyx_v_status = __pyx_v_13cupy_backends_4cuda_4libs_8cusparse_cusparseSpMatSetAttribute(((cusparseSpMatDescr_t)__pyx_v_spMatDescr), ((cusparseSpMatAttribute_t)__pyx_v_attribute), ((void *)(&__pyx_v_data)), (sizeof(int)));

  /* "cupy_backends/cuda/libs/cusparse.pyx":1629
 *         <SpMatDescr>spMatDescr, <SpMatAttribute>attribute, <void*>&data,
 *         sizeof(int))
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1629, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":1621
 *     check_status(status)
 * 
 * cpdef void spMatSetAttribute(             # <<<<<<<<<<<<<<
 *         size_t spMatDescr, int attribute, int data) except *:
 *     # Assuming the value of attribute is an enum value, whose underlying type
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.spMatSetAttribute", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_25spMatSetAttribute(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_24spMatSetAttribute, "spMatSetAttribute(size_t spMatDescr, int attribute, int data) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_25spMatSetAttribute(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  size_t __pyx_v_spMatDescr;
  int __pyx_v_attribute;
  int __pyx_v_data;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("spMatSetAttribute (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_spMatDescr,&__pyx_mstate_global->__pyx_n_u_attribute,&__pyx_mstate_global->__pyx_n_u_data,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 1621, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1621, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1621, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1621, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "spMatSetAttribute", 0) < (0)) __PYX_ERR(0, 1621, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("spMatSetAttribute", 1, 3, 3, i); __PYX_ERR(0, 1621, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1621, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1621, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1621, __pyx_L3_error)
    }
    __pyx_v_spMatDescr = __Pyx_PyLong_As_size_t(values[0]); if (unlikely((__pyx_v_spMatDescr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1622, __pyx_L3_error)
    __pyx_v_attribute = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_attribute == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1622, __pyx_L3_error)
    __pyx_v_data = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_data == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1622, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("spMatSetAttribute", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 1621, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.spMatSetAttribute", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_24spMatSetAttribute(__pyx_self, __pyx_v_spMatDescr, __pyx_v_attribute, __pyx_v_data);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_24spMatSetAttribute(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_spMatDescr, int __pyx_v_attribute, int __pyx_v_data) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("spMatSetAttribute", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_spMatSetAttribute(__pyx_v_spMatDescr, __pyx_v_attribute, __pyx_v_data, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1621, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1621, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":1635
 * # Stream
 * 
 * cpdef void setStream(intptr_t handle, size_t stream) except *:             # <<<<<<<<<<<<<<
 *     # TODO(leofang): It seems most of cuSPARSE APIs support stream capture (as
 *     # of CUDA 11.5) under certain conditions, see
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_27setStream(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_setStream(intptr_t __pyx_v_handle, size_t __pyx_v_stream, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("setStream", 0);

  /* "cupy_backends/cuda/libs/cusparse.pyx":1641
 *     # Before we come up with a robust strategy to test the support conditions,
 *     # we disable this functionality.
 *     if not runtime._is_hip_environment and runtime.streamIsCapturing(stream):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError(
 *             'calling cuSPARSE API during stream capture is currently '
*/
  __pyx_t_2 = (!__pyx_v_13cupy_backends_4cuda_3api_7runtime__is_hip_environment);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = __pyx_f_13cupy_backends_4cuda_3api_7runtime_streamIsCapturing(__pyx_v_stream, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1641, __pyx_L1_error)
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (unlikely(__pyx_t_1)) {

    /* "cupy_backends/cuda/libs/cusparse.pyx":1642
 *     # we disable this functionality.
 *     if not runtime._is_hip_environment and runtime.streamIsCapturing(stream):
 *         raise NotImplementedError(             # <<<<<<<<<<<<<<
 *             'calling cuSPARSE API during stream capture is currently '
 *             'unsupported')
*/
    __pyx_t_4 = NULL;
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_calling_cuSPARSE_API_during_stre};
      __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_NotImplementedError)), __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1642, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 1642, __pyx_L1_error)

    /* "cupy_backends/cuda/libs/cusparse.pyx":1641
 *     # Before we come up with a robust strategy to test the support conditions,
 *     # we disable this functionality.
 *     if not runtime._is_hip_environment and runtime.streamIsCapturing(stream):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError(
 *             'calling cuSPARSE API during stream capture is currently '
*/
  }

  /* "cupy_backends/cuda/libs/cusparse.pyx":1646
 *             'unsupported')
 * 
 *     status = cusparseSetStream(<Handle>handle, <Stream>stream)             # <<<<<<<<<<<<<<
 *     check_status(status)
 * 
*/
  __pyx_v_status = cusparseSetStream(((cusparseHandle_t)__pyx_v_handle), ((cudaStream_t)__pyx_v_stream));

  /* "cupy_backends/cuda/libs/cusparse.pyx":1647
 * 
 *     status = cusparseSetStream(<Handle>handle, <Stream>stream)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_3 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1647, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":1635
 * # Stream
 * 
 * cpdef void setStream(intptr_t handle, size_t stream) except *:             # <<<<<<<<<<<<<<
 *     # TODO(leofang): It seems most of cuSPARSE APIs support stream capture (as
 *     # of CUDA 11.5) under certain conditions, see
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.setStream", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_27setStream(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_26setStream, "setStream(intptr_t handle, size_t stream) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_27setStream(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_t __pyx_v_handle;
  size_t __pyx_v_stream;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("setStream (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_stream,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 1635, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1635, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1635, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setStream", 0) < (0)) __PYX_ERR(0, 1635, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setStream", 1, 2, 2, i); __PYX_ERR(0, 1635, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1635, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1635, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1635, __pyx_L3_error)
    __pyx_v_stream = __Pyx_PyLong_As_size_t(values[1]); if (unlikely((__pyx_v_stream == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1635, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setStream", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1635, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.setStream", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_26setStream(__pyx_self, __pyx_v_handle, __pyx_v_stream);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_26setStream(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_f_13cupy_backends_4cuda_4libs_8cusparse_setStream(__pyx_v_handle, __pyx_v_stream, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1635, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1635, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":1650
 * 
 * 
 * cpdef size_t getStream(intptr_t handle) except? -1:             # <<<<<<<<<<<<<<
 *     cdef Stream stream
 *     status = cusparseGetStream(<Handle>handle, &stream)
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_29getStream(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static size_t __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_getStream(intptr_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_backends/cuda/libs/cusparse.pyx":1652
 * cpdef size_t getStream(intptr_t handle) except? -1:
 *     cdef 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_backends/cuda/libs/cusparse.pyx":1653
 *     cdef Stream stream
 *     status = cusparseGetStream(<Handle>handle, &stream)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return <size_t>stream
 * 
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1653, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":1654
 *     status = cusparseGetStream(<Handle>handle, &stream)
 *     check_status(status)
 *     return <size_t>stream             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_r = ((size_t)__pyx_v_stream);
  goto __pyx_L0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":1650
 * 
 * 
 * cpdef size_t getStream(intptr_t handle) except? -1:             # <<<<<<<<<<<<<<
 *     cdef Stream stream
 *     status = cusparseGetStream(<Handle>handle, &stream)
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.getStream", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1L;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_29getStream(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_28getStream, "getStream(intptr_t handle) -> size_t");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_29getStream(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_t __pyx_v_handle;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("getStream (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 1650, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1650, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getStream", 0) < (0)) __PYX_ERR(0, 1650, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getStream", 1, 1, 1, i); __PYX_ERR(0, 1650, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1650, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1650, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("getStream", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1650, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.getStream", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_28getStream(__pyx_self, __pyx_v_handle);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_28getStream(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_13cupy_backends_4cuda_4libs_8cusparse_getStream(__pyx_v_handle, 1); if (unlikely(__pyx_t_1 == ((size_t)-1L) && PyErr_Occurred())) __PYX_ERR(0, 1650, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyLong_FromSize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1650, __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_backends.cuda.libs.cusparse.getStream", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy_backends/cuda/libs/cusparse.pyx":1657
 * 
 * 
 * cdef void _setStream(intptr_t handle) except *:             # <<<<<<<<<<<<<<
 *     """Set current stream"""
 *     setStream(handle, stream_module.get_current_stream_ptr())
*/

static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(intptr_t __pyx_v_handle) {
  intptr_t __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":1659
 * cdef void _setStream(intptr_t handle) except *:
 *     """Set current stream"""
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_6stream_get_current_stream_ptr(); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1659, __pyx_L1_error)
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_setStream(__pyx_v_handle, __pyx_t_1, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1659, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":1657
 * 
 * 
 * cdef void _setStream(intptr_t handle) except *:             # <<<<<<<<<<<<<<
 *     """Set current stream"""
 *     setStream(handle, stream_module.get_current_stream_ptr())
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse._setStream", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
}

/* "cupy_backends/cuda/libs/cusparse.pyx":1665
 * # cuSPARSE Level1 Function
 * 
 * cpdef void sgthr(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int nnz, size_t y, size_t xVal, size_t xInd,
 *         int idxBase) except *:
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_31sgthr(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_sgthr(intptr_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;
  __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_backends/cuda/libs/cusparse.pyx":1668
 *         intptr_t handle, int nnz, size_t y, size_t xVal, size_t xInd,
 *         int idxBase) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     status = cusparseSgthr(
 *         <Handle>handle, nnz, <const float *>y, <float *>xVal,
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1668, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":1669
 *         int idxBase) except *:
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":1672
 *         <Handle>handle, nnz, <const float *>y, <float *>xVal,
 *         <const int *>xInd, <IndexBase>idxBase)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef void dgthr(
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1672, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":1665
 * # cuSPARSE Level1 Function
 * 
 * cpdef void sgthr(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int nnz, size_t y, size_t xVal, size_t xInd,
 *         int idxBase) except *:
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.sgthr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_31sgthr(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_30sgthr, "sgthr(intptr_t handle, int nnz, size_t y, size_t xVal, size_t xInd, int idxBase) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_31sgthr(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[6] = {0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("sgthr (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_nnz,&__pyx_mstate_global->__pyx_n_u_y,&__pyx_mstate_global->__pyx_n_u_xVal,&__pyx_mstate_global->__pyx_n_u_xInd,&__pyx_mstate_global->__pyx_n_u_idxBase,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 1665, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 1665, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1665, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1665, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1665, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1665, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1665, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "sgthr", 0) < (0)) __PYX_ERR(0, 1665, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 6; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("sgthr", 1, 6, 6, i); __PYX_ERR(0, 1665, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 6)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1665, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1665, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1665, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1665, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1665, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 1665, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1666, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1666, __pyx_L3_error)
    __pyx_v_y = __Pyx_PyLong_As_size_t(values[2]); if (unlikely((__pyx_v_y == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1666, __pyx_L3_error)
    __pyx_v_xVal = __Pyx_PyLong_As_size_t(values[3]); if (unlikely((__pyx_v_xVal == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1666, __pyx_L3_error)
    __pyx_v_xInd = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_xInd == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1666, __pyx_L3_error)
    __pyx_v_idxBase = __Pyx_PyLong_As_int(values[5]); if (unlikely((__pyx_v_idxBase == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1667, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("sgthr", 1, 6, 6, __pyx_nargs); __PYX_ERR(0, 1665, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.sgthr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_30sgthr(__pyx_self, __pyx_v_handle, __pyx_v_nnz, __pyx_v_y, __pyx_v_xVal, __pyx_v_xInd, __pyx_v_idxBase);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_30sgthr(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_f_13cupy_backends_4cuda_4libs_8cusparse_sgthr(__pyx_v_handle, __pyx_v_nnz, __pyx_v_y, __pyx_v_xVal, __pyx_v_xInd, __pyx_v_idxBase, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1665, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1665, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":1674
 *     check_status(status)
 * 
 * cpdef void dgthr(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int nnz, size_t y, size_t xVal, size_t xInd,
 *         int idxBase) except *:
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_33dgthr(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_dgthr(intptr_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;
  __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_backends/cuda/libs/cusparse.pyx":1677
 *         intptr_t handle, int nnz, size_t y, size_t xVal, size_t xInd,
 *         int idxBase) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     status = cusparseDgthr(
 *         <Handle>handle, nnz, <const double *>y, <double *>xVal,
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1677, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":1678
 *         int idxBase) except *:
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":1681
 *         <Handle>handle, nnz, <const double *>y, <double *>xVal,
 *         <const int *>xInd, <IndexBase>idxBase)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef void cgthr(
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1681, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":1674
 *     check_status(status)
 * 
 * cpdef void dgthr(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int nnz, size_t y, size_t xVal, size_t xInd,
 *         int idxBase) except *:
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.dgthr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_33dgthr(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_32dgthr, "dgthr(intptr_t handle, int nnz, size_t y, size_t xVal, size_t xInd, int idxBase) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_33dgthr(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[6] = {0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dgthr (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_nnz,&__pyx_mstate_global->__pyx_n_u_y,&__pyx_mstate_global->__pyx_n_u_xVal,&__pyx_mstate_global->__pyx_n_u_xInd,&__pyx_mstate_global->__pyx_n_u_idxBase,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 1674, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 1674, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1674, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1674, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1674, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1674, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1674, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "dgthr", 0) < (0)) __PYX_ERR(0, 1674, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 6; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("dgthr", 1, 6, 6, i); __PYX_ERR(0, 1674, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 6)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1674, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1674, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1674, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1674, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1674, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 1674, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1675, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1675, __pyx_L3_error)
    __pyx_v_y = __Pyx_PyLong_As_size_t(values[2]); if (unlikely((__pyx_v_y == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1675, __pyx_L3_error)
    __pyx_v_xVal = __Pyx_PyLong_As_size_t(values[3]); if (unlikely((__pyx_v_xVal == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1675, __pyx_L3_error)
    __pyx_v_xInd = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_xInd == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1675, __pyx_L3_error)
    __pyx_v_idxBase = __Pyx_PyLong_As_int(values[5]); if (unlikely((__pyx_v_idxBase == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1676, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("dgthr", 1, 6, 6, __pyx_nargs); __PYX_ERR(0, 1674, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.dgthr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_32dgthr(__pyx_self, __pyx_v_handle, __pyx_v_nnz, __pyx_v_y, __pyx_v_xVal, __pyx_v_xInd, __pyx_v_idxBase);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_32dgthr(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_f_13cupy_backends_4cuda_4libs_8cusparse_dgthr(__pyx_v_handle, __pyx_v_nnz, __pyx_v_y, __pyx_v_xVal, __pyx_v_xInd, __pyx_v_idxBase, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1674, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1674, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":1683
 *     check_status(status)
 * 
 * cpdef void cgthr(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int nnz, size_t y, size_t xVal, size_t xInd,
 *         int idxBase) except *:
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_35cgthr(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_cgthr(intptr_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;
  __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_backends/cuda/libs/cusparse.pyx":1686
 *         intptr_t handle, int nnz, size_t y, size_t xVal, size_t xInd,
 *         int idxBase) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     status = cusparseCgthr(
 *         <Handle>handle, nnz, <const cuComplex *>y, <cuComplex *>xVal,
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1686, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":1687
 *         int idxBase) except *:
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":1690
 *         <Handle>handle, nnz, <const cuComplex *>y, <cuComplex *>xVal,
 *         <const int *>xInd, <IndexBase>idxBase)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef void zgthr(
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1690, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":1683
 *     check_status(status)
 * 
 * cpdef void cgthr(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int nnz, size_t y, size_t xVal, size_t xInd,
 *         int idxBase) except *:
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.cgthr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_35cgthr(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_34cgthr, "cgthr(intptr_t handle, int nnz, size_t y, size_t xVal, size_t xInd, int idxBase) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_35cgthr(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[6] = {0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("cgthr (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_nnz,&__pyx_mstate_global->__pyx_n_u_y,&__pyx_mstate_global->__pyx_n_u_xVal,&__pyx_mstate_global->__pyx_n_u_xInd,&__pyx_mstate_global->__pyx_n_u_idxBase,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 1683, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 1683, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1683, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1683, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1683, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1683, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1683, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "cgthr", 0) < (0)) __PYX_ERR(0, 1683, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 6; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("cgthr", 1, 6, 6, i); __PYX_ERR(0, 1683, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 6)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1683, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1683, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1683, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1683, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1683, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 1683, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1684, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1684, __pyx_L3_error)
    __pyx_v_y = __Pyx_PyLong_As_size_t(values[2]); if (unlikely((__pyx_v_y == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1684, __pyx_L3_error)
    __pyx_v_xVal = __Pyx_PyLong_As_size_t(values[3]); if (unlikely((__pyx_v_xVal == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1684, __pyx_L3_error)
    __pyx_v_xInd = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_xInd == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1684, __pyx_L3_error)
    __pyx_v_idxBase = __Pyx_PyLong_As_int(values[5]); if (unlikely((__pyx_v_idxBase == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1685, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("cgthr", 1, 6, 6, __pyx_nargs); __PYX_ERR(0, 1683, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.cgthr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_34cgthr(__pyx_self, __pyx_v_handle, __pyx_v_nnz, __pyx_v_y, __pyx_v_xVal, __pyx_v_xInd, __pyx_v_idxBase);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_34cgthr(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_f_13cupy_backends_4cuda_4libs_8cusparse_cgthr(__pyx_v_handle, __pyx_v_nnz, __pyx_v_y, __pyx_v_xVal, __pyx_v_xInd, __pyx_v_idxBase, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1683, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1683, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":1692
 *     check_status(status)
 * 
 * cpdef void zgthr(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int nnz, size_t y, size_t xVal, size_t xInd,
 *         int idxBase) except *:
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_37zgthr(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_zgthr(intptr_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;
  __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_backends/cuda/libs/cusparse.pyx":1695
 *         intptr_t handle, int nnz, size_t y, size_t xVal, size_t xInd,
 *         int idxBase) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     status = cusparseZgthr(
 *         <Handle>handle, nnz, <const cuDoubleComplex *>y,
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1695, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":1696
 *         int idxBase) except *:
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":1699
 *         <Handle>handle, nnz, <const cuDoubleComplex *>y,
 *         <cuDoubleComplex *>xVal, <const int *>xInd, <IndexBase>idxBase)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * ########################################
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1699, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":1692
 *     check_status(status)
 * 
 * cpdef void zgthr(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int nnz, size_t y, size_t xVal, size_t xInd,
 *         int idxBase) except *:
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.zgthr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_37zgthr(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_36zgthr, "zgthr(intptr_t handle, int nnz, size_t y, size_t xVal, size_t xInd, int idxBase) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_37zgthr(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[6] = {0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("zgthr (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_nnz,&__pyx_mstate_global->__pyx_n_u_y,&__pyx_mstate_global->__pyx_n_u_xVal,&__pyx_mstate_global->__pyx_n_u_xInd,&__pyx_mstate_global->__pyx_n_u_idxBase,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 1692, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 1692, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1692, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1692, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1692, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1692, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1692, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "zgthr", 0) < (0)) __PYX_ERR(0, 1692, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 6; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("zgthr", 1, 6, 6, i); __PYX_ERR(0, 1692, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 6)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1692, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1692, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1692, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1692, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1692, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 1692, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1693, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1693, __pyx_L3_error)
    __pyx_v_y = __Pyx_PyLong_As_size_t(values[2]); if (unlikely((__pyx_v_y == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1693, __pyx_L3_error)
    __pyx_v_xVal = __Pyx_PyLong_As_size_t(values[3]); if (unlikely((__pyx_v_xVal == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1693, __pyx_L3_error)
    __pyx_v_xInd = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_xInd == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1693, __pyx_L3_error)
    __pyx_v_idxBase = __Pyx_PyLong_As_int(values[5]); if (unlikely((__pyx_v_idxBase == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1694, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("zgthr", 1, 6, 6, __pyx_nargs); __PYX_ERR(0, 1692, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.zgthr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_36zgthr(__pyx_self, __pyx_v_handle, __pyx_v_nnz, __pyx_v_y, __pyx_v_xVal, __pyx_v_xInd, __pyx_v_idxBase);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_36zgthr(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_f_13cupy_backends_4cuda_4libs_8cusparse_zgthr(__pyx_v_handle, __pyx_v_nnz, __pyx_v_y, __pyx_v_xVal, __pyx_v_xInd, __pyx_v_idxBase, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1692, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1692, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":1704
 * # cuSPARSE Level2 Function
 * 
 * cpdef void scsrmv(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int transA, int m, int n, int nnz,
 *         size_t alpha, size_t descrA, size_t csrSortedValA,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_39scsrmv(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_scsrmv(intptr_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;
  __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_backends/cuda/libs/cusparse.pyx":1709
 *         size_t csrSortedRowPtrA, size_t csrSortedColIndA,
 *         size_t x, size_t beta, size_t y) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     status = cusparseScsrmv(
 *         <Handle>handle, <Operation>transA, m, n, nnz,
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1709, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":1710
 *         size_t x, size_t beta, size_t y) except *:
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":1715
 *         <const int *>csrSortedRowPtrA, <const int *>csrSortedColIndA,
 *         <const float *>x, <const float *>beta, <float *>y)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef void dcsrmv(
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 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_backends/cuda/libs/cusparse.pyx":1704
 * # cuSPARSE Level2 Function
 * 
 * cpdef void scsrmv(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int transA, int m, int n, int nnz,
 *         size_t alpha, size_t descrA, size_t csrSortedValA,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.scsrmv", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_39scsrmv(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_38scsrmv, "scsrmv(intptr_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) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_39scsrmv(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[13] = {0,0,0,0,0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("scsrmv (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_transA,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_n,&__pyx_mstate_global->__pyx_n_u_nnz,&__pyx_mstate_global->__pyx_n_u_alpha,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_csrSortedValA,&__pyx_mstate_global->__pyx_n_u_csrSortedRowPtrA,&__pyx_mstate_global->__pyx_n_u_csrSortedColIndA,&__pyx_mstate_global->__pyx_n_u_x,&__pyx_mstate_global->__pyx_n_u_beta,&__pyx_mstate_global->__pyx_n_u_y,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 1704, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 13:
        values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 1704, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 12:
        values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 1704, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 11:
        values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 1704, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 1704, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 1704, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 1704, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 1704, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 1704, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1704, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1704, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1704, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1704, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1704, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "scsrmv", 0) < (0)) __PYX_ERR(0, 1704, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 13; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("scsrmv", 1, 13, 13, i); __PYX_ERR(0, 1704, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 13)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1704, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1704, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1704, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1704, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1704, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 1704, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 1704, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 1704, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 1704, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 1704, __pyx_L3_error)
      values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 1704, __pyx_L3_error)
      values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 1704, __pyx_L3_error)
      values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 1704, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1705, __pyx_L3_error)
    __pyx_v_transA = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_transA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1705, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1705, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyLong_As_int(values[3]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1705, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyLong_As_int(values[4]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1705, __pyx_L3_error)
    __pyx_v_alpha = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_alpha == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1706, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1706, __pyx_L3_error)
    __pyx_v_csrSortedValA = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_csrSortedValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1706, __pyx_L3_error)
    __pyx_v_csrSortedRowPtrA = __Pyx_PyLong_As_size_t(values[8]); if (unlikely((__pyx_v_csrSortedRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1707, __pyx_L3_error)
    __pyx_v_csrSortedColIndA = __Pyx_PyLong_As_size_t(values[9]); if (unlikely((__pyx_v_csrSortedColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1707, __pyx_L3_error)
    __pyx_v_x = __Pyx_PyLong_As_size_t(values[10]); if (unlikely((__pyx_v_x == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1708, __pyx_L3_error)
    __pyx_v_beta = __Pyx_PyLong_As_size_t(values[11]); if (unlikely((__pyx_v_beta == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1708, __pyx_L3_error)
    __pyx_v_y = __Pyx_PyLong_As_size_t(values[12]); if (unlikely((__pyx_v_y == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1708, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("scsrmv", 1, 13, 13, __pyx_nargs); __PYX_ERR(0, 1704, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.scsrmv", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_38scsrmv(__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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_38scsrmv(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1704, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1704, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":1717
 *     check_status(status)
 * 
 * cpdef void dcsrmv(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int transA, int m, int n, int nnz,
 *         size_t alpha, size_t descrA, size_t csrSortedValA,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_41dcsrmv(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_dcsrmv(intptr_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;
  __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_backends/cuda/libs/cusparse.pyx":1722
 *         size_t csrSortedRowPtrA, size_t csrSortedColIndA,
 *         size_t x, size_t beta, size_t y) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     status = cusparseDcsrmv(
 *         <Handle>handle, <Operation>transA, m, n, nnz,
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1722, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":1723
 *         size_t x, size_t beta, size_t y) except *:
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":1728
 *         <const int *>csrSortedRowPtrA, <const int *>csrSortedColIndA,
 *         <const double *>x, <const double *>beta, <double *>y)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef void ccsrmv(
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1728, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":1717
 *     check_status(status)
 * 
 * cpdef void dcsrmv(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int transA, int m, int n, int nnz,
 *         size_t alpha, size_t descrA, size_t csrSortedValA,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.dcsrmv", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_41dcsrmv(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_40dcsrmv, "dcsrmv(intptr_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) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_41dcsrmv(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[13] = {0,0,0,0,0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dcsrmv (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_transA,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_n,&__pyx_mstate_global->__pyx_n_u_nnz,&__pyx_mstate_global->__pyx_n_u_alpha,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_csrSortedValA,&__pyx_mstate_global->__pyx_n_u_csrSortedRowPtrA,&__pyx_mstate_global->__pyx_n_u_csrSortedColIndA,&__pyx_mstate_global->__pyx_n_u_x,&__pyx_mstate_global->__pyx_n_u_beta,&__pyx_mstate_global->__pyx_n_u_y,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 1717, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 13:
        values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 1717, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 12:
        values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 1717, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 11:
        values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 1717, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 1717, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 1717, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 1717, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 1717, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 1717, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1717, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1717, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1717, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1717, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1717, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "dcsrmv", 0) < (0)) __PYX_ERR(0, 1717, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 13; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("dcsrmv", 1, 13, 13, i); __PYX_ERR(0, 1717, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 13)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1717, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1717, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1717, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1717, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1717, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 1717, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 1717, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 1717, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 1717, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 1717, __pyx_L3_error)
      values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 1717, __pyx_L3_error)
      values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 1717, __pyx_L3_error)
      values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 1717, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1718, __pyx_L3_error)
    __pyx_v_transA = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_transA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1718, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1718, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyLong_As_int(values[3]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1718, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyLong_As_int(values[4]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1718, __pyx_L3_error)
    __pyx_v_alpha = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_alpha == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1719, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1719, __pyx_L3_error)
    __pyx_v_csrSortedValA = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_csrSortedValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1719, __pyx_L3_error)
    __pyx_v_csrSortedRowPtrA = __Pyx_PyLong_As_size_t(values[8]); if (unlikely((__pyx_v_csrSortedRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1720, __pyx_L3_error)
    __pyx_v_csrSortedColIndA = __Pyx_PyLong_As_size_t(values[9]); if (unlikely((__pyx_v_csrSortedColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1720, __pyx_L3_error)
    __pyx_v_x = __Pyx_PyLong_As_size_t(values[10]); if (unlikely((__pyx_v_x == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1721, __pyx_L3_error)
    __pyx_v_beta = __Pyx_PyLong_As_size_t(values[11]); if (unlikely((__pyx_v_beta == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1721, __pyx_L3_error)
    __pyx_v_y = __Pyx_PyLong_As_size_t(values[12]); if (unlikely((__pyx_v_y == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1721, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("dcsrmv", 1, 13, 13, __pyx_nargs); __PYX_ERR(0, 1717, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.dcsrmv", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_40dcsrmv(__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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_40dcsrmv(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1717, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1717, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":1730
 *     check_status(status)
 * 
 * cpdef void ccsrmv(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int transA, int m, int n, int nnz,
 *         size_t alpha, size_t descrA, size_t csrSortedValA,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_43ccsrmv(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_ccsrmv(intptr_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;
  __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_backends/cuda/libs/cusparse.pyx":1735
 *         size_t csrSortedRowPtrA, size_t csrSortedColIndA,
 *         size_t x, size_t beta, size_t y) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     status = cusparseCcsrmv(
 *         <Handle>handle, <Operation>transA, m, n, nnz,
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1735, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":1736
 *         size_t x, size_t beta, size_t y) except *:
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":1742
 *         <const int *>csrSortedRowPtrA, <const int *>csrSortedColIndA,
 *         <const cuComplex *>x, <const cuComplex *>beta, <cuComplex *>y)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef void zcsrmv(
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1742, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":1730
 *     check_status(status)
 * 
 * cpdef void ccsrmv(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int transA, int m, int n, int nnz,
 *         size_t alpha, size_t descrA, size_t csrSortedValA,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.ccsrmv", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_43ccsrmv(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_42ccsrmv, "ccsrmv(intptr_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) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_43ccsrmv(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[13] = {0,0,0,0,0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ccsrmv (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_transA,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_n,&__pyx_mstate_global->__pyx_n_u_nnz,&__pyx_mstate_global->__pyx_n_u_alpha,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_csrSortedValA,&__pyx_mstate_global->__pyx_n_u_csrSortedRowPtrA,&__pyx_mstate_global->__pyx_n_u_csrSortedColIndA,&__pyx_mstate_global->__pyx_n_u_x,&__pyx_mstate_global->__pyx_n_u_beta,&__pyx_mstate_global->__pyx_n_u_y,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 1730, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 13:
        values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 1730, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 12:
        values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 1730, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 11:
        values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 1730, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 1730, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 1730, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 1730, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 1730, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 1730, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1730, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1730, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1730, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1730, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1730, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "ccsrmv", 0) < (0)) __PYX_ERR(0, 1730, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 13; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("ccsrmv", 1, 13, 13, i); __PYX_ERR(0, 1730, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 13)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1730, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1730, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1730, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1730, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1730, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 1730, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 1730, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 1730, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 1730, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 1730, __pyx_L3_error)
      values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 1730, __pyx_L3_error)
      values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 1730, __pyx_L3_error)
      values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 1730, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1731, __pyx_L3_error)
    __pyx_v_transA = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_transA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1731, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1731, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyLong_As_int(values[3]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1731, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyLong_As_int(values[4]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1731, __pyx_L3_error)
    __pyx_v_alpha = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_alpha == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1732, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1732, __pyx_L3_error)
    __pyx_v_csrSortedValA = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_csrSortedValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1732, __pyx_L3_error)
    __pyx_v_csrSortedRowPtrA = __Pyx_PyLong_As_size_t(values[8]); if (unlikely((__pyx_v_csrSortedRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1733, __pyx_L3_error)
    __pyx_v_csrSortedColIndA = __Pyx_PyLong_As_size_t(values[9]); if (unlikely((__pyx_v_csrSortedColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1733, __pyx_L3_error)
    __pyx_v_x = __Pyx_PyLong_As_size_t(values[10]); if (unlikely((__pyx_v_x == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1734, __pyx_L3_error)
    __pyx_v_beta = __Pyx_PyLong_As_size_t(values[11]); if (unlikely((__pyx_v_beta == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1734, __pyx_L3_error)
    __pyx_v_y = __Pyx_PyLong_As_size_t(values[12]); if (unlikely((__pyx_v_y == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1734, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ccsrmv", 1, 13, 13, __pyx_nargs); __PYX_ERR(0, 1730, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.ccsrmv", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_42ccsrmv(__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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_42ccsrmv(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1730, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1730, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":1744
 *     check_status(status)
 * 
 * cpdef void zcsrmv(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int transA, int m, int n, int nnz,
 *         size_t alpha, size_t descrA, size_t csrSortedValA,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_45zcsrmv(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_zcsrmv(intptr_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;
  __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_backends/cuda/libs/cusparse.pyx":1749
 *         size_t csrSortedRowPtrA, size_t csrSortedColIndA,
 *         size_t x, size_t beta, size_t y) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     status = cusparseZcsrmv(
 *         <Handle>handle, <Operation>transA, m, n, nnz,
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1749, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":1750
 *         size_t x, size_t beta, size_t y) except *:
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":1757
 *         <const cuDoubleComplex *>x, <const cuDoubleComplex *>beta,
 *         <cuDoubleComplex *>y)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef size_t csrmvEx_bufferSize(
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1757, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":1744
 *     check_status(status)
 * 
 * cpdef void zcsrmv(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int transA, int m, int n, int nnz,
 *         size_t alpha, size_t descrA, size_t csrSortedValA,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.zcsrmv", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_45zcsrmv(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_44zcsrmv, "zcsrmv(intptr_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) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_45zcsrmv(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[13] = {0,0,0,0,0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("zcsrmv (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_transA,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_n,&__pyx_mstate_global->__pyx_n_u_nnz,&__pyx_mstate_global->__pyx_n_u_alpha,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_csrSortedValA,&__pyx_mstate_global->__pyx_n_u_csrSortedRowPtrA,&__pyx_mstate_global->__pyx_n_u_csrSortedColIndA,&__pyx_mstate_global->__pyx_n_u_x,&__pyx_mstate_global->__pyx_n_u_beta,&__pyx_mstate_global->__pyx_n_u_y,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 1744, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 13:
        values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 1744, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 12:
        values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 1744, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 11:
        values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 1744, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 1744, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 1744, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 1744, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 1744, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 1744, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1744, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1744, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1744, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1744, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1744, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "zcsrmv", 0) < (0)) __PYX_ERR(0, 1744, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 13; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("zcsrmv", 1, 13, 13, i); __PYX_ERR(0, 1744, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 13)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1744, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1744, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1744, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1744, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1744, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 1744, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 1744, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 1744, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 1744, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 1744, __pyx_L3_error)
      values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 1744, __pyx_L3_error)
      values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 1744, __pyx_L3_error)
      values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 1744, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1745, __pyx_L3_error)
    __pyx_v_transA = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_transA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1745, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1745, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyLong_As_int(values[3]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1745, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyLong_As_int(values[4]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1745, __pyx_L3_error)
    __pyx_v_alpha = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_alpha == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1746, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1746, __pyx_L3_error)
    __pyx_v_csrSortedValA = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_csrSortedValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1746, __pyx_L3_error)
    __pyx_v_csrSortedRowPtrA = __Pyx_PyLong_As_size_t(values[8]); if (unlikely((__pyx_v_csrSortedRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1747, __pyx_L3_error)
    __pyx_v_csrSortedColIndA = __Pyx_PyLong_As_size_t(values[9]); if (unlikely((__pyx_v_csrSortedColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1747, __pyx_L3_error)
    __pyx_v_x = __Pyx_PyLong_As_size_t(values[10]); if (unlikely((__pyx_v_x == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1748, __pyx_L3_error)
    __pyx_v_beta = __Pyx_PyLong_As_size_t(values[11]); if (unlikely((__pyx_v_beta == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1748, __pyx_L3_error)
    __pyx_v_y = __Pyx_PyLong_As_size_t(values[12]); if (unlikely((__pyx_v_y == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1748, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("zcsrmv", 1, 13, 13, __pyx_nargs); __PYX_ERR(0, 1744, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.zcsrmv", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_44zcsrmv(__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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_44zcsrmv(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1744, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1744, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":1759
 *     check_status(status)
 * 
 * cpdef size_t csrmvEx_bufferSize(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int alg, int transA, int m, int n,
 *         int nnz, size_t alpha, int alphatype, size_t descrA,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_47csrmvEx_bufferSize(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static size_t __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_csrmvEx_bufferSize(intptr_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_backends/cuda/libs/cusparse.pyx":1766
 *         int betatype, size_t y, int ytype, int executiontype) except? -1:
 *     cdef size_t bufferSizeInBytes
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     status = cusparseCsrmvEx_bufferSize(
 *         <Handle>handle, <AlgMode>alg, <Operation>transA, m,
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1766, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":1767
 *     cdef size_t bufferSizeInBytes
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":1775
 *         <DataType>betatype, <void *>y, <DataType>ytype,
 *         <DataType>executiontype, &bufferSizeInBytes)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return bufferSizeInBytes
 * 
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1775, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":1776
 *         <DataType>executiontype, &bufferSizeInBytes)
 *     check_status(status)
 *     return bufferSizeInBytes             # <<<<<<<<<<<<<<
 * 
 * cpdef void csrmvEx(
*/
  __pyx_r = __pyx_v_bufferSizeInBytes;
  goto __pyx_L0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":1759
 *     check_status(status)
 * 
 * cpdef size_t csrmvEx_bufferSize(             # <<<<<<<<<<<<<<
 *         intptr_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_AddTraceback("cupy_backends.cuda.libs.cusparse.csrmvEx_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1L;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_47csrmvEx_bufferSize(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_46csrmvEx_bufferSize, "csrmvEx_bufferSize(intptr_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_13cupy_backends_4cuda_4libs_8cusparse_47csrmvEx_bufferSize(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[20] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
  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);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_alg,&__pyx_mstate_global->__pyx_n_u_transA,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_n,&__pyx_mstate_global->__pyx_n_u_nnz,&__pyx_mstate_global->__pyx_n_u_alpha,&__pyx_mstate_global->__pyx_n_u_alphatype,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_csrValA,&__pyx_mstate_global->__pyx_n_u_csrValAtype,&__pyx_mstate_global->__pyx_n_u_csrRowPtrA,&__pyx_mstate_global->__pyx_n_u_csrColIndA,&__pyx_mstate_global->__pyx_n_u_x,&__pyx_mstate_global->__pyx_n_u_xtype,&__pyx_mstate_global->__pyx_n_u_beta,&__pyx_mstate_global->__pyx_n_u_betatype,&__pyx_mstate_global->__pyx_n_u_y,&__pyx_mstate_global->__pyx_n_u_ytype,&__pyx_mstate_global->__pyx_n_u_executiontype,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 1759, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 20:
        values[19] = __Pyx_ArgRef_FASTCALL(__pyx_args, 19);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[19])) __PYX_ERR(0, 1759, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 19:
        values[18] = __Pyx_ArgRef_FASTCALL(__pyx_args, 18);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[18])) __PYX_ERR(0, 1759, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 18:
        values[17] = __Pyx_ArgRef_FASTCALL(__pyx_args, 17);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[17])) __PYX_ERR(0, 1759, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 17:
        values[16] = __Pyx_ArgRef_FASTCALL(__pyx_args, 16);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[16])) __PYX_ERR(0, 1759, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 16:
        values[15] = __Pyx_ArgRef_FASTCALL(__pyx_args, 15);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 1759, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 15:
        values[14] = __Pyx_ArgRef_FASTCALL(__pyx_args, 14);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 1759, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 14:
        values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 1759, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 13:
        values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 1759, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 12:
        values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 1759, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 11:
        values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 1759, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 1759, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 1759, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 1759, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 1759, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 1759, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1759, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1759, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1759, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1759, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1759, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "csrmvEx_bufferSize", 0) < (0)) __PYX_ERR(0, 1759, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 20; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("csrmvEx_bufferSize", 1, 20, 20, i); __PYX_ERR(0, 1759, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 20)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1759, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1759, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1759, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1759, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1759, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 1759, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 1759, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 1759, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 1759, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 1759, __pyx_L3_error)
      values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 1759, __pyx_L3_error)
      values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 1759, __pyx_L3_error)
      values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 1759, __pyx_L3_error)
      values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 1759, __pyx_L3_error)
      values[14] = __Pyx_ArgRef_FASTCALL(__pyx_args, 14);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 1759, __pyx_L3_error)
      values[15] = __Pyx_ArgRef_FASTCALL(__pyx_args, 15);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 1759, __pyx_L3_error)
      values[16] = __Pyx_ArgRef_FASTCALL(__pyx_args, 16);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[16])) __PYX_ERR(0, 1759, __pyx_L3_error)
      values[17] = __Pyx_ArgRef_FASTCALL(__pyx_args, 17);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[17])) __PYX_ERR(0, 1759, __pyx_L3_error)
      values[18] = __Pyx_ArgRef_FASTCALL(__pyx_args, 18);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[18])) __PYX_ERR(0, 1759, __pyx_L3_error)
      values[19] = __Pyx_ArgRef_FASTCALL(__pyx_args, 19);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[19])) __PYX_ERR(0, 1759, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1760, __pyx_L3_error)
    __pyx_v_alg = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_alg == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1760, __pyx_L3_error)
    __pyx_v_transA = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_transA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1760, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[3]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1760, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyLong_As_int(values[4]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1760, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyLong_As_int(values[5]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1761, __pyx_L3_error)
    __pyx_v_alpha = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_alpha == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1761, __pyx_L3_error)
    __pyx_v_alphatype = __Pyx_PyLong_As_int(values[7]); if (unlikely((__pyx_v_alphatype == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1761, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[8]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1761, __pyx_L3_error)
    __pyx_v_csrValA = __Pyx_PyLong_As_size_t(values[9]); if (unlikely((__pyx_v_csrValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1762, __pyx_L3_error)
    __pyx_v_csrValAtype = __Pyx_PyLong_As_int(values[10]); if (unlikely((__pyx_v_csrValAtype == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1762, __pyx_L3_error)
    __pyx_v_csrRowPtrA = __Pyx_PyLong_As_size_t(values[11]); if (unlikely((__pyx_v_csrRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1762, __pyx_L3_error)
    __pyx_v_csrColIndA = __Pyx_PyLong_As_size_t(values[12]); if (unlikely((__pyx_v_csrColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1763, __pyx_L3_error)
    __pyx_v_x = __Pyx_PyLong_As_size_t(values[13]); if (unlikely((__pyx_v_x == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1763, __pyx_L3_error)
    __pyx_v_xtype = __Pyx_PyLong_As_int(values[14]); if (unlikely((__pyx_v_xtype == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1763, __pyx_L3_error)
    __pyx_v_beta = __Pyx_PyLong_As_size_t(values[15]); if (unlikely((__pyx_v_beta == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1763, __pyx_L3_error)
    __pyx_v_betatype = __Pyx_PyLong_As_int(values[16]); if (unlikely((__pyx_v_betatype == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1764, __pyx_L3_error)
    __pyx_v_y = __Pyx_PyLong_As_size_t(values[17]); if (unlikely((__pyx_v_y == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1764, __pyx_L3_error)
    __pyx_v_ytype = __Pyx_PyLong_As_int(values[18]); if (unlikely((__pyx_v_ytype == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1764, __pyx_L3_error)
    __pyx_v_executiontype = __Pyx_PyLong_As_int(values[19]); if (unlikely((__pyx_v_executiontype == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1764, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("csrmvEx_bufferSize", 1, 20, 20, __pyx_nargs); __PYX_ERR(0, 1759, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.csrmvEx_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_46csrmvEx_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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_46csrmvEx_bufferSize(CYTHON_UNUSED PyObject *__pyx_self, intptr_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
  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("csrmvEx_bufferSize", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(__pyx_t_1 == ((size_t)-1L) && PyErr_Occurred())) __PYX_ERR(0, 1759, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyLong_FromSize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1759, __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_backends.cuda.libs.cusparse.csrmvEx_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy_backends/cuda/libs/cusparse.pyx":1778
 *     return bufferSizeInBytes
 * 
 * cpdef void csrmvEx(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int alg, int transA, int m, int n,
 *         int nnz, size_t alpha, int alphatype, size_t descrA,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_49csrmvEx(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_csrmvEx(intptr_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;
  __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_backends/cuda/libs/cusparse.pyx":1785
 *         int betatype, size_t y, int ytype, int executiontype,
 *         size_t buffer) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     status = cusparseCsrmvEx(
 *         <Handle>handle, <AlgMode>alg, <Operation>transA, m,
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1785, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":1786
 *         size_t buffer) except *:
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":1794
 *         <DataType>betatype, <void *>y, <DataType>ytype,
 *         <DataType>executiontype, <void *>buffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef size_t createCsrsv2Info() except? -1:
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1794, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":1778
 *     return bufferSizeInBytes
 * 
 * cpdef void csrmvEx(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int alg, int transA, int m, int n,
 *         int nnz, size_t alpha, int alphatype, size_t descrA,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.csrmvEx", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_49csrmvEx(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_48csrmvEx, "csrmvEx(intptr_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) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_49csrmvEx(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[21] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("csrmvEx (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_alg,&__pyx_mstate_global->__pyx_n_u_transA,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_n,&__pyx_mstate_global->__pyx_n_u_nnz,&__pyx_mstate_global->__pyx_n_u_alpha,&__pyx_mstate_global->__pyx_n_u_alphatype,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_csrValA,&__pyx_mstate_global->__pyx_n_u_csrValAtype,&__pyx_mstate_global->__pyx_n_u_csrRowPtrA,&__pyx_mstate_global->__pyx_n_u_csrColIndA,&__pyx_mstate_global->__pyx_n_u_x,&__pyx_mstate_global->__pyx_n_u_xtype,&__pyx_mstate_global->__pyx_n_u_beta,&__pyx_mstate_global->__pyx_n_u_betatype,&__pyx_mstate_global->__pyx_n_u_y,&__pyx_mstate_global->__pyx_n_u_ytype,&__pyx_mstate_global->__pyx_n_u_executiontype,&__pyx_mstate_global->__pyx_n_u_buffer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 1778, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 21:
        values[20] = __Pyx_ArgRef_FASTCALL(__pyx_args, 20);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[20])) __PYX_ERR(0, 1778, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 20:
        values[19] = __Pyx_ArgRef_FASTCALL(__pyx_args, 19);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[19])) __PYX_ERR(0, 1778, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 19:
        values[18] = __Pyx_ArgRef_FASTCALL(__pyx_args, 18);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[18])) __PYX_ERR(0, 1778, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 18:
        values[17] = __Pyx_ArgRef_FASTCALL(__pyx_args, 17);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[17])) __PYX_ERR(0, 1778, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 17:
        values[16] = __Pyx_ArgRef_FASTCALL(__pyx_args, 16);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[16])) __PYX_ERR(0, 1778, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 16:
        values[15] = __Pyx_ArgRef_FASTCALL(__pyx_args, 15);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 1778, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 15:
        values[14] = __Pyx_ArgRef_FASTCALL(__pyx_args, 14);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 1778, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 14:
        values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 1778, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 13:
        values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 1778, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 12:
        values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 1778, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 11:
        values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 1778, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 1778, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 1778, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 1778, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 1778, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 1778, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1778, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1778, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1778, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1778, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1778, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "csrmvEx", 0) < (0)) __PYX_ERR(0, 1778, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 21; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("csrmvEx", 1, 21, 21, i); __PYX_ERR(0, 1778, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 21)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1778, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1778, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1778, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1778, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1778, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 1778, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 1778, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 1778, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 1778, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 1778, __pyx_L3_error)
      values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 1778, __pyx_L3_error)
      values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 1778, __pyx_L3_error)
      values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 1778, __pyx_L3_error)
      values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 1778, __pyx_L3_error)
      values[14] = __Pyx_ArgRef_FASTCALL(__pyx_args, 14);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 1778, __pyx_L3_error)
      values[15] = __Pyx_ArgRef_FASTCALL(__pyx_args, 15);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 1778, __pyx_L3_error)
      values[16] = __Pyx_ArgRef_FASTCALL(__pyx_args, 16);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[16])) __PYX_ERR(0, 1778, __pyx_L3_error)
      values[17] = __Pyx_ArgRef_FASTCALL(__pyx_args, 17);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[17])) __PYX_ERR(0, 1778, __pyx_L3_error)
      values[18] = __Pyx_ArgRef_FASTCALL(__pyx_args, 18);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[18])) __PYX_ERR(0, 1778, __pyx_L3_error)
      values[19] = __Pyx_ArgRef_FASTCALL(__pyx_args, 19);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[19])) __PYX_ERR(0, 1778, __pyx_L3_error)
      values[20] = __Pyx_ArgRef_FASTCALL(__pyx_args, 20);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[20])) __PYX_ERR(0, 1778, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1779, __pyx_L3_error)
    __pyx_v_alg = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_alg == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1779, __pyx_L3_error)
    __pyx_v_transA = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_transA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1779, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[3]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1779, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyLong_As_int(values[4]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1779, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyLong_As_int(values[5]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1780, __pyx_L3_error)
    __pyx_v_alpha = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_alpha == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1780, __pyx_L3_error)
    __pyx_v_alphatype = __Pyx_PyLong_As_int(values[7]); if (unlikely((__pyx_v_alphatype == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1780, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[8]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1780, __pyx_L3_error)
    __pyx_v_csrValA = __Pyx_PyLong_As_size_t(values[9]); if (unlikely((__pyx_v_csrValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1781, __pyx_L3_error)
    __pyx_v_csrValAtype = __Pyx_PyLong_As_int(values[10]); if (unlikely((__pyx_v_csrValAtype == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1781, __pyx_L3_error)
    __pyx_v_csrRowPtrA = __Pyx_PyLong_As_size_t(values[11]); if (unlikely((__pyx_v_csrRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1781, __pyx_L3_error)
    __pyx_v_csrColIndA = __Pyx_PyLong_As_size_t(values[12]); if (unlikely((__pyx_v_csrColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1782, __pyx_L3_error)
    __pyx_v_x = __Pyx_PyLong_As_size_t(values[13]); if (unlikely((__pyx_v_x == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1782, __pyx_L3_error)
    __pyx_v_xtype = __Pyx_PyLong_As_int(values[14]); if (unlikely((__pyx_v_xtype == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1782, __pyx_L3_error)
    __pyx_v_beta = __Pyx_PyLong_As_size_t(values[15]); if (unlikely((__pyx_v_beta == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1782, __pyx_L3_error)
    __pyx_v_betatype = __Pyx_PyLong_As_int(values[16]); if (unlikely((__pyx_v_betatype == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1783, __pyx_L3_error)
    __pyx_v_y = __Pyx_PyLong_As_size_t(values[17]); if (unlikely((__pyx_v_y == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1783, __pyx_L3_error)
    __pyx_v_ytype = __Pyx_PyLong_As_int(values[18]); if (unlikely((__pyx_v_ytype == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1783, __pyx_L3_error)
    __pyx_v_executiontype = __Pyx_PyLong_As_int(values[19]); if (unlikely((__pyx_v_executiontype == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1783, __pyx_L3_error)
    __pyx_v_buffer = __Pyx_PyLong_As_size_t(values[20]); if (unlikely((__pyx_v_buffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1784, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("csrmvEx", 1, 21, 21, __pyx_nargs); __PYX_ERR(0, 1778, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.csrmvEx", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_48csrmvEx(__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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_48csrmvEx(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1778, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1778, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":1796
 *     check_status(status)
 * 
 * cpdef size_t createCsrsv2Info() except? -1:             # <<<<<<<<<<<<<<
 *     cdef csrsv2Info_t info
 *     status = cusparseCreateCsrsv2Info(&info)
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_51createCsrsv2Info(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static size_t __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_createCsrsv2Info(CYTHON_UNUSED int __pyx_skip_dispatch) {
  csrsv2Info_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("createCsrsv2Info", 0);

  /* "cupy_backends/cuda/libs/cusparse.pyx":1798
 * cpdef size_t createCsrsv2Info() except? -1:
 *     cdef csrsv2Info_t info
 *     status = cusparseCreateCsrsv2Info(&info)             # <<<<<<<<<<<<<<
 *     check_status(status)
 *     return <size_t>info
*/
  __pyx_v_status = cusparseCreateCsrsv2Info((&__pyx_v_info));

  /* "cupy_backends/cuda/libs/cusparse.pyx":1799
 *     cdef csrsv2Info_t info
 *     status = cusparseCreateCsrsv2Info(&info)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return <size_t>info
 * 
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1799, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":1800
 *     status = cusparseCreateCsrsv2Info(&info)
 *     check_status(status)
 *     return <size_t>info             # <<<<<<<<<<<<<<
 * 
 * cpdef void destroyCsrsv2Info(size_t info) except *:
*/
  __pyx_r = ((size_t)__pyx_v_info);
  goto __pyx_L0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":1796
 *     check_status(status)
 * 
 * cpdef size_t createCsrsv2Info() except? -1:             # <<<<<<<<<<<<<<
 *     cdef csrsv2Info_t info
 *     status = cusparseCreateCsrsv2Info(&info)
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.createCsrsv2Info", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1L;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_51createCsrsv2Info(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_50createCsrsv2Info, "createCsrsv2Info() -> size_t");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_51createCsrsv2Info(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("createCsrsv2Info (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_50createCsrsv2Info(__pyx_self);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_50createCsrsv2Info(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("createCsrsv2Info", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_createCsrsv2Info(1); if (unlikely(__pyx_t_1 == ((size_t)-1L) && PyErr_Occurred())) __PYX_ERR(0, 1796, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyLong_FromSize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1796, __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_backends.cuda.libs.cusparse.createCsrsv2Info", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy_backends/cuda/libs/cusparse.pyx":1802
 *     return <size_t>info
 * 
 * cpdef void destroyCsrsv2Info(size_t info) except *:             # <<<<<<<<<<<<<<
 *     status = cusparseDestroyCsrsv2Info(<csrsv2Info_t>info)
 *     check_status(status)
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_53destroyCsrsv2Info(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_destroyCsrsv2Info(size_t __pyx_v_info, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("destroyCsrsv2Info", 0);

  /* "cupy_backends/cuda/libs/cusparse.pyx":1803
 * 
 * cpdef void destroyCsrsv2Info(size_t info) except *:
 *     status = cusparseDestroyCsrsv2Info(<csrsv2Info_t>info)             # <<<<<<<<<<<<<<
 *     check_status(status)
 * 
*/
  __pyx_v_status = cusparseDestroyCsrsv2Info(((csrsv2Info_t)__pyx_v_info));

  /* "cupy_backends/cuda/libs/cusparse.pyx":1804
 * cpdef void destroyCsrsv2Info(size_t info) except *:
 *     status = cusparseDestroyCsrsv2Info(<csrsv2Info_t>info)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef int scsrsv2_bufferSize(
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1804, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":1802
 *     return <size_t>info
 * 
 * cpdef void destroyCsrsv2Info(size_t info) except *:             # <<<<<<<<<<<<<<
 *     status = cusparseDestroyCsrsv2Info(<csrsv2Info_t>info)
 *     check_status(status)
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.destroyCsrsv2Info", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_53destroyCsrsv2Info(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_52destroyCsrsv2Info, "destroyCsrsv2Info(size_t info) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_53destroyCsrsv2Info(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  size_t __pyx_v_info;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("destroyCsrsv2Info (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_info,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 1802, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1802, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "destroyCsrsv2Info", 0) < (0)) __PYX_ERR(0, 1802, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("destroyCsrsv2Info", 1, 1, 1, i); __PYX_ERR(0, 1802, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1802, __pyx_L3_error)
    }
    __pyx_v_info = __Pyx_PyLong_As_size_t(values[0]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1802, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("destroyCsrsv2Info", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1802, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.destroyCsrsv2Info", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_52destroyCsrsv2Info(__pyx_self, __pyx_v_info);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_52destroyCsrsv2Info(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("destroyCsrsv2Info", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_destroyCsrsv2Info(__pyx_v_info, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1802, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1802, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":1806
 *     check_status(status)
 * 
 * cpdef int scsrsv2_bufferSize(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int transA, int m, int nnz, size_t descrA,
 *         size_t csrSortedValA, size_t csrSortedRowPtrA,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_55scsrsv2_bufferSize(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static int __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_scsrsv2_bufferSize(intptr_t __pyx_v_handle, int __pyx_v_transA, 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_bufferSize;
  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("scsrsv2_bufferSize", 0);

  /* "cupy_backends/cuda/libs/cusparse.pyx":1811
 *         size_t csrSortedColIndA, size_t info) except? -1:
 *     cdef int bufferSize
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     status = cusparseScsrsv2_bufferSize(
 *         <Handle>handle, <Operation>transA, m, nnz, <const MatDescr>descrA,
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1811, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":1812
 *     cdef int bufferSize
 *     _setStream(handle)
 *     status = cusparseScsrsv2_bufferSize(             # <<<<<<<<<<<<<<
 *         <Handle>handle, <Operation>transA, m, nnz, <const MatDescr>descrA,
 *         <float*>csrSortedValA, <const int*>csrSortedRowPtrA,
*/
  __pyx_v_status = cusparseScsrsv2_bufferSize(((cusparseHandle_t)__pyx_v_handle), ((cusparseOperation_t)__pyx_v_transA), __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), ((csrsv2Info_t)__pyx_v_info), (&__pyx_v_bufferSize));

  /* "cupy_backends/cuda/libs/cusparse.pyx":1816
 *         <float*>csrSortedValA, <const int*>csrSortedRowPtrA,
 *         <const int*>csrSortedColIndA, <csrsv2Info_t>info, &bufferSize)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return bufferSize
 * 
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1816, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":1817
 *         <const int*>csrSortedColIndA, <csrsv2Info_t>info, &bufferSize)
 *     check_status(status)
 *     return bufferSize             # <<<<<<<<<<<<<<
 * 
 * cpdef int dcsrsv2_bufferSize(
*/
  __pyx_r = __pyx_v_bufferSize;
  goto __pyx_L0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":1806
 *     check_status(status)
 * 
 * cpdef int scsrsv2_bufferSize(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int transA, int m, int nnz, size_t descrA,
 *         size_t csrSortedValA, size_t csrSortedRowPtrA,
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.scsrsv2_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_55scsrsv2_bufferSize(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_54scsrsv2_bufferSize, "scsrsv2_bufferSize(intptr_t handle, int transA, int m, int nnz, size_t descrA, size_t csrSortedValA, size_t csrSortedRowPtrA, size_t csrSortedColIndA, size_t info) -> int");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_55scsrsv2_bufferSize(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_t __pyx_v_handle;
  int __pyx_v_transA;
  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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("scsrsv2_bufferSize (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_transA,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_nnz,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_csrSortedValA,&__pyx_mstate_global->__pyx_n_u_csrSortedRowPtrA,&__pyx_mstate_global->__pyx_n_u_csrSortedColIndA,&__pyx_mstate_global->__pyx_n_u_info,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 1806, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 1806, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 1806, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 1806, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 1806, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1806, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1806, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1806, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1806, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1806, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "scsrsv2_bufferSize", 0) < (0)) __PYX_ERR(0, 1806, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 9; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("scsrsv2_bufferSize", 1, 9, 9, i); __PYX_ERR(0, 1806, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 9)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1806, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1806, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1806, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1806, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1806, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 1806, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 1806, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 1806, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 1806, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1807, __pyx_L3_error)
    __pyx_v_transA = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_transA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1807, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1807, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyLong_As_int(values[3]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1807, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1807, __pyx_L3_error)
    __pyx_v_csrSortedValA = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_csrSortedValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1808, __pyx_L3_error)
    __pyx_v_csrSortedRowPtrA = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_csrSortedRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1808, __pyx_L3_error)
    __pyx_v_csrSortedColIndA = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_csrSortedColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1809, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyLong_As_size_t(values[8]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1809, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("scsrsv2_bufferSize", 1, 9, 9, __pyx_nargs); __PYX_ERR(0, 1806, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.scsrsv2_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_54scsrsv2_bufferSize(__pyx_self, __pyx_v_handle, __pyx_v_transA, __pyx_v_m, __pyx_v_nnz, __pyx_v_descrA, __pyx_v_csrSortedValA, __pyx_v_csrSortedRowPtrA, __pyx_v_csrSortedColIndA, __pyx_v_info);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_54scsrsv2_bufferSize(CYTHON_UNUSED PyObject *__pyx_self, intptr_t __pyx_v_handle, int __pyx_v_transA, 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
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("scsrsv2_bufferSize", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_scsrsv2_bufferSize(__pyx_v_handle, __pyx_v_transA, __pyx_v_m, __pyx_v_nnz, __pyx_v_descrA, __pyx_v_csrSortedValA, __pyx_v_csrSortedRowPtrA, __pyx_v_csrSortedColIndA, __pyx_v_info, 1); if (unlikely(__pyx_t_1 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1806, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1806, __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_backends.cuda.libs.cusparse.scsrsv2_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy_backends/cuda/libs/cusparse.pyx":1819
 *     return bufferSize
 * 
 * cpdef int dcsrsv2_bufferSize(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int transA, int m, int nnz, size_t descrA,
 *         size_t csrSortedValA, size_t csrSortedRowPtrA,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_57dcsrsv2_bufferSize(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static int __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_dcsrsv2_bufferSize(intptr_t __pyx_v_handle, int __pyx_v_transA, 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_bufferSize;
  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("dcsrsv2_bufferSize", 0);

  /* "cupy_backends/cuda/libs/cusparse.pyx":1824
 *         size_t csrSortedColIndA, size_t info) except? -1:
 *     cdef int bufferSize
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     status = cusparseDcsrsv2_bufferSize(
 *         <Handle>handle, <Operation>transA, m, nnz, <const MatDescr>descrA,
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1824, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":1825
 *     cdef int bufferSize
 *     _setStream(handle)
 *     status = cusparseDcsrsv2_bufferSize(             # <<<<<<<<<<<<<<
 *         <Handle>handle, <Operation>transA, m, nnz, <const MatDescr>descrA,
 *         <double*>csrSortedValA, <const int*>csrSortedRowPtrA,
*/
  __pyx_v_status = cusparseDcsrsv2_bufferSize(((cusparseHandle_t)__pyx_v_handle), ((cusparseOperation_t)__pyx_v_transA), __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), ((csrsv2Info_t)__pyx_v_info), (&__pyx_v_bufferSize));

  /* "cupy_backends/cuda/libs/cusparse.pyx":1829
 *         <double*>csrSortedValA, <const int*>csrSortedRowPtrA,
 *         <const int*>csrSortedColIndA, <csrsv2Info_t>info, &bufferSize)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return bufferSize
 * 
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 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_backends/cuda/libs/cusparse.pyx":1830
 *         <const int*>csrSortedColIndA, <csrsv2Info_t>info, &bufferSize)
 *     check_status(status)
 *     return bufferSize             # <<<<<<<<<<<<<<
 * 
 * cpdef int ccsrsv2_bufferSize(
*/
  __pyx_r = __pyx_v_bufferSize;
  goto __pyx_L0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":1819
 *     return bufferSize
 * 
 * cpdef int dcsrsv2_bufferSize(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int transA, int m, int nnz, size_t descrA,
 *         size_t csrSortedValA, size_t csrSortedRowPtrA,
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.dcsrsv2_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_57dcsrsv2_bufferSize(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_56dcsrsv2_bufferSize, "dcsrsv2_bufferSize(intptr_t handle, int transA, int m, int nnz, size_t descrA, size_t csrSortedValA, size_t csrSortedRowPtrA, size_t csrSortedColIndA, size_t info) -> int");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_57dcsrsv2_bufferSize(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_t __pyx_v_handle;
  int __pyx_v_transA;
  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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dcsrsv2_bufferSize (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_transA,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_nnz,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_csrSortedValA,&__pyx_mstate_global->__pyx_n_u_csrSortedRowPtrA,&__pyx_mstate_global->__pyx_n_u_csrSortedColIndA,&__pyx_mstate_global->__pyx_n_u_info,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 1819, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 1819, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 1819, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 1819, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 1819, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1819, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1819, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1819, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1819, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1819, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "dcsrsv2_bufferSize", 0) < (0)) __PYX_ERR(0, 1819, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 9; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("dcsrsv2_bufferSize", 1, 9, 9, i); __PYX_ERR(0, 1819, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 9)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1819, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1819, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1819, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1819, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1819, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 1819, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 1819, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 1819, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 1819, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1820, __pyx_L3_error)
    __pyx_v_transA = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_transA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1820, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1820, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyLong_As_int(values[3]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1820, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1820, __pyx_L3_error)
    __pyx_v_csrSortedValA = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_csrSortedValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1821, __pyx_L3_error)
    __pyx_v_csrSortedRowPtrA = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_csrSortedRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1821, __pyx_L3_error)
    __pyx_v_csrSortedColIndA = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_csrSortedColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1822, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyLong_As_size_t(values[8]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1822, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("dcsrsv2_bufferSize", 1, 9, 9, __pyx_nargs); __PYX_ERR(0, 1819, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.dcsrsv2_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_56dcsrsv2_bufferSize(__pyx_self, __pyx_v_handle, __pyx_v_transA, __pyx_v_m, __pyx_v_nnz, __pyx_v_descrA, __pyx_v_csrSortedValA, __pyx_v_csrSortedRowPtrA, __pyx_v_csrSortedColIndA, __pyx_v_info);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_56dcsrsv2_bufferSize(CYTHON_UNUSED PyObject *__pyx_self, intptr_t __pyx_v_handle, int __pyx_v_transA, 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
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dcsrsv2_bufferSize", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_dcsrsv2_bufferSize(__pyx_v_handle, __pyx_v_transA, __pyx_v_m, __pyx_v_nnz, __pyx_v_descrA, __pyx_v_csrSortedValA, __pyx_v_csrSortedRowPtrA, __pyx_v_csrSortedColIndA, __pyx_v_info, 1); if (unlikely(__pyx_t_1 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1819, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1819, __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_backends.cuda.libs.cusparse.dcsrsv2_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy_backends/cuda/libs/cusparse.pyx":1832
 *     return bufferSize
 * 
 * cpdef int ccsrsv2_bufferSize(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int transA, int m, int nnz, size_t descrA,
 *         size_t csrSortedValA, size_t csrSortedRowPtrA,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_59ccsrsv2_bufferSize(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static int __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_ccsrsv2_bufferSize(intptr_t __pyx_v_handle, int __pyx_v_transA, 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_bufferSize;
  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("ccsrsv2_bufferSize", 0);

  /* "cupy_backends/cuda/libs/cusparse.pyx":1837
 *         size_t csrSortedColIndA, size_t info) except? -1:
 *     cdef int bufferSize
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     status = cusparseCcsrsv2_bufferSize(
 *         <Handle>handle, <Operation>transA, m, nnz, <const MatDescr>descrA,
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1837, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":1838
 *     cdef int bufferSize
 *     _setStream(handle)
 *     status = cusparseCcsrsv2_bufferSize(             # <<<<<<<<<<<<<<
 *         <Handle>handle, <Operation>transA, m, nnz, <const MatDescr>descrA,
 *         <cuComplex*>csrSortedValA, <const int*>csrSortedRowPtrA,
*/
  __pyx_v_status = cusparseCcsrsv2_bufferSize(((cusparseHandle_t)__pyx_v_handle), ((cusparseOperation_t)__pyx_v_transA), __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), ((csrsv2Info_t)__pyx_v_info), (&__pyx_v_bufferSize));

  /* "cupy_backends/cuda/libs/cusparse.pyx":1842
 *         <cuComplex*>csrSortedValA, <const int*>csrSortedRowPtrA,
 *         <const int*>csrSortedColIndA, <csrsv2Info_t>info, &bufferSize)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return bufferSize
 * 
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1842, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":1843
 *         <const int*>csrSortedColIndA, <csrsv2Info_t>info, &bufferSize)
 *     check_status(status)
 *     return bufferSize             # <<<<<<<<<<<<<<
 * 
 * cpdef int zcsrsv2_bufferSize(
*/
  __pyx_r = __pyx_v_bufferSize;
  goto __pyx_L0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":1832
 *     return bufferSize
 * 
 * cpdef int ccsrsv2_bufferSize(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int transA, int m, int nnz, size_t descrA,
 *         size_t csrSortedValA, size_t csrSortedRowPtrA,
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.ccsrsv2_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_59ccsrsv2_bufferSize(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_58ccsrsv2_bufferSize, "ccsrsv2_bufferSize(intptr_t handle, int transA, int m, int nnz, size_t descrA, size_t csrSortedValA, size_t csrSortedRowPtrA, size_t csrSortedColIndA, size_t info) -> int");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_59ccsrsv2_bufferSize(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_t __pyx_v_handle;
  int __pyx_v_transA;
  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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ccsrsv2_bufferSize (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_transA,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_nnz,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_csrSortedValA,&__pyx_mstate_global->__pyx_n_u_csrSortedRowPtrA,&__pyx_mstate_global->__pyx_n_u_csrSortedColIndA,&__pyx_mstate_global->__pyx_n_u_info,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 1832, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 1832, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 1832, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 1832, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 1832, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1832, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1832, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1832, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1832, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1832, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "ccsrsv2_bufferSize", 0) < (0)) __PYX_ERR(0, 1832, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 9; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("ccsrsv2_bufferSize", 1, 9, 9, i); __PYX_ERR(0, 1832, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 9)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1832, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1832, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1832, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1832, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1832, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 1832, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 1832, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 1832, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 1832, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1833, __pyx_L3_error)
    __pyx_v_transA = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_transA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1833, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1833, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyLong_As_int(values[3]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1833, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1833, __pyx_L3_error)
    __pyx_v_csrSortedValA = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_csrSortedValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1834, __pyx_L3_error)
    __pyx_v_csrSortedRowPtrA = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_csrSortedRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1834, __pyx_L3_error)
    __pyx_v_csrSortedColIndA = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_csrSortedColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1835, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyLong_As_size_t(values[8]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1835, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ccsrsv2_bufferSize", 1, 9, 9, __pyx_nargs); __PYX_ERR(0, 1832, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.ccsrsv2_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_58ccsrsv2_bufferSize(__pyx_self, __pyx_v_handle, __pyx_v_transA, __pyx_v_m, __pyx_v_nnz, __pyx_v_descrA, __pyx_v_csrSortedValA, __pyx_v_csrSortedRowPtrA, __pyx_v_csrSortedColIndA, __pyx_v_info);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_58ccsrsv2_bufferSize(CYTHON_UNUSED PyObject *__pyx_self, intptr_t __pyx_v_handle, int __pyx_v_transA, 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
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("ccsrsv2_bufferSize", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_ccsrsv2_bufferSize(__pyx_v_handle, __pyx_v_transA, __pyx_v_m, __pyx_v_nnz, __pyx_v_descrA, __pyx_v_csrSortedValA, __pyx_v_csrSortedRowPtrA, __pyx_v_csrSortedColIndA, __pyx_v_info, 1); if (unlikely(__pyx_t_1 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1832, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1832, __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_backends.cuda.libs.cusparse.ccsrsv2_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy_backends/cuda/libs/cusparse.pyx":1845
 *     return bufferSize
 * 
 * cpdef int zcsrsv2_bufferSize(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int transA, int m, int nnz, size_t descrA,
 *         size_t csrSortedValA, size_t csrSortedRowPtrA,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_61zcsrsv2_bufferSize(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static int __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_zcsrsv2_bufferSize(intptr_t __pyx_v_handle, int __pyx_v_transA, 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_bufferSize;
  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("zcsrsv2_bufferSize", 0);

  /* "cupy_backends/cuda/libs/cusparse.pyx":1850
 *         size_t csrSortedColIndA, size_t info) except? -1:
 *     cdef int bufferSize
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     status = cusparseZcsrsv2_bufferSize(
 *         <Handle>handle, <Operation>transA, m, nnz, <const MatDescr>descrA,
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1850, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":1851
 *     cdef int bufferSize
 *     _setStream(handle)
 *     status = cusparseZcsrsv2_bufferSize(             # <<<<<<<<<<<<<<
 *         <Handle>handle, <Operation>transA, m, nnz, <const MatDescr>descrA,
 *         <cuDoubleComplex*>csrSortedValA, <const int*>csrSortedRowPtrA,
*/
  __pyx_v_status = cusparseZcsrsv2_bufferSize(((cusparseHandle_t)__pyx_v_handle), ((cusparseOperation_t)__pyx_v_transA), __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), ((csrsv2Info_t)__pyx_v_info), (&__pyx_v_bufferSize));

  /* "cupy_backends/cuda/libs/cusparse.pyx":1855
 *         <cuDoubleComplex*>csrSortedValA, <const int*>csrSortedRowPtrA,
 *         <const int*>csrSortedColIndA, <csrsv2Info_t>info, &bufferSize)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return bufferSize
 * 
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1855, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":1856
 *         <const int*>csrSortedColIndA, <csrsv2Info_t>info, &bufferSize)
 *     check_status(status)
 *     return bufferSize             # <<<<<<<<<<<<<<
 * 
 * cpdef void scsrsv2_analysis(
*/
  __pyx_r = __pyx_v_bufferSize;
  goto __pyx_L0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":1845
 *     return bufferSize
 * 
 * cpdef int zcsrsv2_bufferSize(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int transA, int m, int nnz, size_t descrA,
 *         size_t csrSortedValA, size_t csrSortedRowPtrA,
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.zcsrsv2_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_61zcsrsv2_bufferSize(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_60zcsrsv2_bufferSize, "zcsrsv2_bufferSize(intptr_t handle, int transA, int m, int nnz, size_t descrA, size_t csrSortedValA, size_t csrSortedRowPtrA, size_t csrSortedColIndA, size_t info) -> int");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_61zcsrsv2_bufferSize(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_t __pyx_v_handle;
  int __pyx_v_transA;
  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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("zcsrsv2_bufferSize (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_transA,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_nnz,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_csrSortedValA,&__pyx_mstate_global->__pyx_n_u_csrSortedRowPtrA,&__pyx_mstate_global->__pyx_n_u_csrSortedColIndA,&__pyx_mstate_global->__pyx_n_u_info,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 1845, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 1845, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 1845, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 1845, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 1845, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1845, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1845, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1845, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1845, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1845, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "zcsrsv2_bufferSize", 0) < (0)) __PYX_ERR(0, 1845, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 9; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("zcsrsv2_bufferSize", 1, 9, 9, i); __PYX_ERR(0, 1845, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 9)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1845, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1845, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1845, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1845, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1845, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 1845, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 1845, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 1845, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 1845, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1846, __pyx_L3_error)
    __pyx_v_transA = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_transA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1846, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1846, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyLong_As_int(values[3]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1846, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1846, __pyx_L3_error)
    __pyx_v_csrSortedValA = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_csrSortedValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1847, __pyx_L3_error)
    __pyx_v_csrSortedRowPtrA = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_csrSortedRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1847, __pyx_L3_error)
    __pyx_v_csrSortedColIndA = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_csrSortedColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1848, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyLong_As_size_t(values[8]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1848, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("zcsrsv2_bufferSize", 1, 9, 9, __pyx_nargs); __PYX_ERR(0, 1845, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.zcsrsv2_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_60zcsrsv2_bufferSize(__pyx_self, __pyx_v_handle, __pyx_v_transA, __pyx_v_m, __pyx_v_nnz, __pyx_v_descrA, __pyx_v_csrSortedValA, __pyx_v_csrSortedRowPtrA, __pyx_v_csrSortedColIndA, __pyx_v_info);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_60zcsrsv2_bufferSize(CYTHON_UNUSED PyObject *__pyx_self, intptr_t __pyx_v_handle, int __pyx_v_transA, 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
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("zcsrsv2_bufferSize", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_zcsrsv2_bufferSize(__pyx_v_handle, __pyx_v_transA, __pyx_v_m, __pyx_v_nnz, __pyx_v_descrA, __pyx_v_csrSortedValA, __pyx_v_csrSortedRowPtrA, __pyx_v_csrSortedColIndA, __pyx_v_info, 1); if (unlikely(__pyx_t_1 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1845, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1845, __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_backends.cuda.libs.cusparse.zcsrsv2_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy_backends/cuda/libs/cusparse.pyx":1858
 *     return bufferSize
 * 
 * cpdef void scsrsv2_analysis(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int transA, int m, int nnz, size_t descrA,
 *         size_t csrSortedValA, size_t csrSortedRowPtrA,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_63scsrsv2_analysis(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_scsrsv2_analysis(intptr_t __pyx_v_handle, int __pyx_v_transA, 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;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("scsrsv2_analysis", 0);

  /* "cupy_backends/cuda/libs/cusparse.pyx":1863
 *         size_t csrSortedColIndA, size_t info, int policy,
 *         size_t pBuffer) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     status = cusparseScsrsv2_analysis(
 *         <Handle>handle, <Operation>transA, m, nnz, <const MatDescr>descrA,
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1863, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":1864
 *         size_t pBuffer) except *:
 *     _setStream(handle)
 *     status = cusparseScsrsv2_analysis(             # <<<<<<<<<<<<<<
 *         <Handle>handle, <Operation>transA, m, nnz, <const MatDescr>descrA,
 *         <const float*>csrSortedValA, <const int*>csrSortedRowPtrA,
*/
  __pyx_v_status = cusparseScsrsv2_analysis(((cusparseHandle_t)__pyx_v_handle), ((cusparseOperation_t)__pyx_v_transA), __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), ((csrsv2Info_t)__pyx_v_info), ((cusparseSolvePolicy_t)__pyx_v_policy), ((void *)__pyx_v_pBuffer));

  /* "cupy_backends/cuda/libs/cusparse.pyx":1869
 *         <const int*>csrSortedColIndA, <csrsv2Info_t>info,
 *         <cusparseSolvePolicy_t>policy, <void*>pBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef void dcsrsv2_analysis(
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1869, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":1858
 *     return bufferSize
 * 
 * cpdef void scsrsv2_analysis(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int transA, int m, int nnz, size_t descrA,
 *         size_t csrSortedValA, size_t csrSortedRowPtrA,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.scsrsv2_analysis", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_63scsrsv2_analysis(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_62scsrsv2_analysis, "scsrsv2_analysis(intptr_t handle, int transA, int m, int nnz, size_t descrA, size_t csrSortedValA, size_t csrSortedRowPtrA, size_t csrSortedColIndA, size_t info, int policy, size_t pBuffer) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_63scsrsv2_analysis(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_t __pyx_v_handle;
  int __pyx_v_transA;
  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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[11] = {0,0,0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("scsrsv2_analysis (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_transA,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_nnz,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_csrSortedValA,&__pyx_mstate_global->__pyx_n_u_csrSortedRowPtrA,&__pyx_mstate_global->__pyx_n_u_csrSortedColIndA,&__pyx_mstate_global->__pyx_n_u_info,&__pyx_mstate_global->__pyx_n_u_policy,&__pyx_mstate_global->__pyx_n_u_pBuffer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 1858, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 11:
        values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 1858, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 1858, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 1858, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 1858, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 1858, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 1858, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1858, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1858, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1858, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1858, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1858, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "scsrsv2_analysis", 0) < (0)) __PYX_ERR(0, 1858, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 11; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("scsrsv2_analysis", 1, 11, 11, i); __PYX_ERR(0, 1858, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 11)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1858, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1858, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1858, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1858, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1858, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 1858, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 1858, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 1858, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 1858, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 1858, __pyx_L3_error)
      values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 1858, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1859, __pyx_L3_error)
    __pyx_v_transA = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_transA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1859, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1859, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyLong_As_int(values[3]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1859, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1859, __pyx_L3_error)
    __pyx_v_csrSortedValA = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_csrSortedValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1860, __pyx_L3_error)
    __pyx_v_csrSortedRowPtrA = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_csrSortedRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1860, __pyx_L3_error)
    __pyx_v_csrSortedColIndA = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_csrSortedColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1861, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyLong_As_size_t(values[8]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1861, __pyx_L3_error)
    __pyx_v_policy = __Pyx_PyLong_As_int(values[9]); if (unlikely((__pyx_v_policy == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1861, __pyx_L3_error)
    __pyx_v_pBuffer = __Pyx_PyLong_As_size_t(values[10]); if (unlikely((__pyx_v_pBuffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1862, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("scsrsv2_analysis", 1, 11, 11, __pyx_nargs); __PYX_ERR(0, 1858, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.scsrsv2_analysis", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_62scsrsv2_analysis(__pyx_self, __pyx_v_handle, __pyx_v_transA, __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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_62scsrsv2_analysis(CYTHON_UNUSED PyObject *__pyx_self, intptr_t __pyx_v_handle, int __pyx_v_transA, 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("scsrsv2_analysis", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_scsrsv2_analysis(__pyx_v_handle, __pyx_v_transA, __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, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1858, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1858, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":1871
 *     check_status(status)
 * 
 * cpdef void dcsrsv2_analysis(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int transA, int m, int nnz, size_t descrA,
 *         size_t csrSortedValA, size_t csrSortedRowPtrA,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_65dcsrsv2_analysis(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_dcsrsv2_analysis(intptr_t __pyx_v_handle, int __pyx_v_transA, 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;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dcsrsv2_analysis", 0);

  /* "cupy_backends/cuda/libs/cusparse.pyx":1876
 *         size_t csrSortedColIndA, size_t info, int policy,
 *         size_t pBuffer) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     status = cusparseDcsrsv2_analysis(
 *         <Handle>handle, <Operation>transA, m, nnz, <const MatDescr>descrA,
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1876, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":1877
 *         size_t pBuffer) except *:
 *     _setStream(handle)
 *     status = cusparseDcsrsv2_analysis(             # <<<<<<<<<<<<<<
 *         <Handle>handle, <Operation>transA, m, nnz, <const MatDescr>descrA,
 *         <const double*>csrSortedValA, <const int*>csrSortedRowPtrA,
*/
  __pyx_v_status = cusparseDcsrsv2_analysis(((cusparseHandle_t)__pyx_v_handle), ((cusparseOperation_t)__pyx_v_transA), __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), ((csrsv2Info_t)__pyx_v_info), ((cusparseSolvePolicy_t)__pyx_v_policy), ((void *)__pyx_v_pBuffer));

  /* "cupy_backends/cuda/libs/cusparse.pyx":1882
 *         <const int*>csrSortedColIndA, <csrsv2Info_t>info,
 *         <cusparseSolvePolicy_t>policy, <void*>pBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef void ccsrsv2_analysis(
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1882, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":1871
 *     check_status(status)
 * 
 * cpdef void dcsrsv2_analysis(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int transA, int m, int nnz, size_t descrA,
 *         size_t csrSortedValA, size_t csrSortedRowPtrA,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.dcsrsv2_analysis", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_65dcsrsv2_analysis(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_64dcsrsv2_analysis, "dcsrsv2_analysis(intptr_t handle, int transA, int m, int nnz, size_t descrA, size_t csrSortedValA, size_t csrSortedRowPtrA, size_t csrSortedColIndA, size_t info, int policy, size_t pBuffer) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_65dcsrsv2_analysis(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_t __pyx_v_handle;
  int __pyx_v_transA;
  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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[11] = {0,0,0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dcsrsv2_analysis (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_transA,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_nnz,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_csrSortedValA,&__pyx_mstate_global->__pyx_n_u_csrSortedRowPtrA,&__pyx_mstate_global->__pyx_n_u_csrSortedColIndA,&__pyx_mstate_global->__pyx_n_u_info,&__pyx_mstate_global->__pyx_n_u_policy,&__pyx_mstate_global->__pyx_n_u_pBuffer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 1871, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 11:
        values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 1871, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 1871, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 1871, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 1871, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 1871, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 1871, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1871, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1871, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1871, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1871, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1871, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "dcsrsv2_analysis", 0) < (0)) __PYX_ERR(0, 1871, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 11; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("dcsrsv2_analysis", 1, 11, 11, i); __PYX_ERR(0, 1871, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 11)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1871, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1871, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1871, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1871, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1871, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 1871, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 1871, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 1871, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 1871, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 1871, __pyx_L3_error)
      values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 1871, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1872, __pyx_L3_error)
    __pyx_v_transA = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_transA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1872, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1872, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyLong_As_int(values[3]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1872, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1872, __pyx_L3_error)
    __pyx_v_csrSortedValA = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_csrSortedValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1873, __pyx_L3_error)
    __pyx_v_csrSortedRowPtrA = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_csrSortedRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1873, __pyx_L3_error)
    __pyx_v_csrSortedColIndA = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_csrSortedColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1874, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyLong_As_size_t(values[8]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1874, __pyx_L3_error)
    __pyx_v_policy = __Pyx_PyLong_As_int(values[9]); if (unlikely((__pyx_v_policy == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1874, __pyx_L3_error)
    __pyx_v_pBuffer = __Pyx_PyLong_As_size_t(values[10]); if (unlikely((__pyx_v_pBuffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1875, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("dcsrsv2_analysis", 1, 11, 11, __pyx_nargs); __PYX_ERR(0, 1871, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.dcsrsv2_analysis", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_64dcsrsv2_analysis(__pyx_self, __pyx_v_handle, __pyx_v_transA, __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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_64dcsrsv2_analysis(CYTHON_UNUSED PyObject *__pyx_self, intptr_t __pyx_v_handle, int __pyx_v_transA, 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("dcsrsv2_analysis", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_dcsrsv2_analysis(__pyx_v_handle, __pyx_v_transA, __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, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1871, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1871, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":1884
 *     check_status(status)
 * 
 * cpdef void ccsrsv2_analysis(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int transA, int m, int nnz, size_t descrA,
 *         size_t csrSortedValA, size_t csrSortedRowPtrA,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_67ccsrsv2_analysis(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_ccsrsv2_analysis(intptr_t __pyx_v_handle, int __pyx_v_transA, 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;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("ccsrsv2_analysis", 0);

  /* "cupy_backends/cuda/libs/cusparse.pyx":1889
 *         size_t csrSortedColIndA, size_t info, int policy,
 *         size_t pBuffer) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     status = cusparseCcsrsv2_analysis(
 *         <Handle>handle, <Operation>transA, m, nnz, <const MatDescr>descrA,
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1889, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":1890
 *         size_t pBuffer) except *:
 *     _setStream(handle)
 *     status = cusparseCcsrsv2_analysis(             # <<<<<<<<<<<<<<
 *         <Handle>handle, <Operation>transA, m, nnz, <const MatDescr>descrA,
 *         <const cuComplex*>csrSortedValA, <const int*>csrSortedRowPtrA,
*/
  __pyx_v_status = cusparseCcsrsv2_analysis(((cusparseHandle_t)__pyx_v_handle), ((cusparseOperation_t)__pyx_v_transA), __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), ((csrsv2Info_t)__pyx_v_info), ((cusparseSolvePolicy_t)__pyx_v_policy), ((void *)__pyx_v_pBuffer));

  /* "cupy_backends/cuda/libs/cusparse.pyx":1895
 *         <const int*>csrSortedColIndA, <csrsv2Info_t>info,
 *         <cusparseSolvePolicy_t>policy, <void*>pBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef void zcsrsv2_analysis(
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1895, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":1884
 *     check_status(status)
 * 
 * cpdef void ccsrsv2_analysis(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int transA, int m, int nnz, size_t descrA,
 *         size_t csrSortedValA, size_t csrSortedRowPtrA,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.ccsrsv2_analysis", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_67ccsrsv2_analysis(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_66ccsrsv2_analysis, "ccsrsv2_analysis(intptr_t handle, int transA, int m, int nnz, size_t descrA, size_t csrSortedValA, size_t csrSortedRowPtrA, size_t csrSortedColIndA, size_t info, int policy, size_t pBuffer) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_67ccsrsv2_analysis(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_t __pyx_v_handle;
  int __pyx_v_transA;
  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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[11] = {0,0,0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ccsrsv2_analysis (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_transA,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_nnz,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_csrSortedValA,&__pyx_mstate_global->__pyx_n_u_csrSortedRowPtrA,&__pyx_mstate_global->__pyx_n_u_csrSortedColIndA,&__pyx_mstate_global->__pyx_n_u_info,&__pyx_mstate_global->__pyx_n_u_policy,&__pyx_mstate_global->__pyx_n_u_pBuffer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 1884, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 11:
        values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 1884, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 1884, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 1884, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 1884, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 1884, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 1884, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1884, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1884, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1884, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1884, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1884, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "ccsrsv2_analysis", 0) < (0)) __PYX_ERR(0, 1884, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 11; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("ccsrsv2_analysis", 1, 11, 11, i); __PYX_ERR(0, 1884, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 11)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1884, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1884, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1884, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1884, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1884, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 1884, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 1884, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 1884, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 1884, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 1884, __pyx_L3_error)
      values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 1884, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1885, __pyx_L3_error)
    __pyx_v_transA = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_transA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1885, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1885, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyLong_As_int(values[3]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1885, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1885, __pyx_L3_error)
    __pyx_v_csrSortedValA = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_csrSortedValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1886, __pyx_L3_error)
    __pyx_v_csrSortedRowPtrA = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_csrSortedRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1886, __pyx_L3_error)
    __pyx_v_csrSortedColIndA = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_csrSortedColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1887, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyLong_As_size_t(values[8]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1887, __pyx_L3_error)
    __pyx_v_policy = __Pyx_PyLong_As_int(values[9]); if (unlikely((__pyx_v_policy == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1887, __pyx_L3_error)
    __pyx_v_pBuffer = __Pyx_PyLong_As_size_t(values[10]); if (unlikely((__pyx_v_pBuffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1888, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ccsrsv2_analysis", 1, 11, 11, __pyx_nargs); __PYX_ERR(0, 1884, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.ccsrsv2_analysis", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_66ccsrsv2_analysis(__pyx_self, __pyx_v_handle, __pyx_v_transA, __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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_66ccsrsv2_analysis(CYTHON_UNUSED PyObject *__pyx_self, intptr_t __pyx_v_handle, int __pyx_v_transA, 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("ccsrsv2_analysis", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_ccsrsv2_analysis(__pyx_v_handle, __pyx_v_transA, __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, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1884, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1884, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":1897
 *     check_status(status)
 * 
 * cpdef void zcsrsv2_analysis(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int transA, int m, int nnz, size_t descrA,
 *         size_t csrSortedValA, size_t csrSortedRowPtrA,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_69zcsrsv2_analysis(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_zcsrsv2_analysis(intptr_t __pyx_v_handle, int __pyx_v_transA, 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;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("zcsrsv2_analysis", 0);

  /* "cupy_backends/cuda/libs/cusparse.pyx":1902
 *         size_t csrSortedColIndA, size_t info, int policy,
 *         size_t pBuffer) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     status = cusparseZcsrsv2_analysis(
 *         <Handle>handle, <Operation>transA, m, nnz, <const MatDescr>descrA,
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1902, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":1903
 *         size_t pBuffer) except *:
 *     _setStream(handle)
 *     status = cusparseZcsrsv2_analysis(             # <<<<<<<<<<<<<<
 *         <Handle>handle, <Operation>transA, m, nnz, <const MatDescr>descrA,
 *         <const cuDoubleComplex*>csrSortedValA, <const int*>csrSortedRowPtrA,
*/
  __pyx_v_status = cusparseZcsrsv2_analysis(((cusparseHandle_t)__pyx_v_handle), ((cusparseOperation_t)__pyx_v_transA), __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), ((csrsv2Info_t)__pyx_v_info), ((cusparseSolvePolicy_t)__pyx_v_policy), ((void *)__pyx_v_pBuffer));

  /* "cupy_backends/cuda/libs/cusparse.pyx":1908
 *         <const int*>csrSortedColIndA, <csrsv2Info_t>info,
 *         <cusparseSolvePolicy_t>policy, <void*>pBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef void scsrsv2_solve(
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1908, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":1897
 *     check_status(status)
 * 
 * cpdef void zcsrsv2_analysis(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int transA, int m, int nnz, size_t descrA,
 *         size_t csrSortedValA, size_t csrSortedRowPtrA,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.zcsrsv2_analysis", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_69zcsrsv2_analysis(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_68zcsrsv2_analysis, "zcsrsv2_analysis(intptr_t handle, int transA, int m, int nnz, size_t descrA, size_t csrSortedValA, size_t csrSortedRowPtrA, size_t csrSortedColIndA, size_t info, int policy, size_t pBuffer) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_69zcsrsv2_analysis(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_t __pyx_v_handle;
  int __pyx_v_transA;
  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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[11] = {0,0,0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("zcsrsv2_analysis (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_transA,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_nnz,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_csrSortedValA,&__pyx_mstate_global->__pyx_n_u_csrSortedRowPtrA,&__pyx_mstate_global->__pyx_n_u_csrSortedColIndA,&__pyx_mstate_global->__pyx_n_u_info,&__pyx_mstate_global->__pyx_n_u_policy,&__pyx_mstate_global->__pyx_n_u_pBuffer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 1897, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 11:
        values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 1897, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 1897, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 1897, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 1897, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 1897, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 1897, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1897, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1897, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1897, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1897, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1897, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "zcsrsv2_analysis", 0) < (0)) __PYX_ERR(0, 1897, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 11; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("zcsrsv2_analysis", 1, 11, 11, i); __PYX_ERR(0, 1897, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 11)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1897, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1897, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1897, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1897, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1897, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 1897, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 1897, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 1897, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 1897, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 1897, __pyx_L3_error)
      values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 1897, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1898, __pyx_L3_error)
    __pyx_v_transA = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_transA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1898, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1898, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyLong_As_int(values[3]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1898, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1898, __pyx_L3_error)
    __pyx_v_csrSortedValA = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_csrSortedValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1899, __pyx_L3_error)
    __pyx_v_csrSortedRowPtrA = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_csrSortedRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1899, __pyx_L3_error)
    __pyx_v_csrSortedColIndA = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_csrSortedColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1900, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyLong_As_size_t(values[8]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1900, __pyx_L3_error)
    __pyx_v_policy = __Pyx_PyLong_As_int(values[9]); if (unlikely((__pyx_v_policy == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1900, __pyx_L3_error)
    __pyx_v_pBuffer = __Pyx_PyLong_As_size_t(values[10]); if (unlikely((__pyx_v_pBuffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1901, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("zcsrsv2_analysis", 1, 11, 11, __pyx_nargs); __PYX_ERR(0, 1897, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.zcsrsv2_analysis", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_68zcsrsv2_analysis(__pyx_self, __pyx_v_handle, __pyx_v_transA, __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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_68zcsrsv2_analysis(CYTHON_UNUSED PyObject *__pyx_self, intptr_t __pyx_v_handle, int __pyx_v_transA, 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("zcsrsv2_analysis", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_zcsrsv2_analysis(__pyx_v_handle, __pyx_v_transA, __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, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1897, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1897, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":1910
 *     check_status(status)
 * 
 * cpdef void scsrsv2_solve(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int transA, int m, int nnz, size_t alpha,
 *         size_t descrA, size_t csrSortedValA, size_t csrSortedRowPtrA,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_71scsrsv2_solve(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_scsrsv2_solve(intptr_t __pyx_v_handle, int __pyx_v_transA, int __pyx_v_m, 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_info, size_t __pyx_v_x, size_t __pyx_v_y, int __pyx_v_policy, size_t __pyx_v_pBuffer, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("scsrsv2_solve", 0);

  /* "cupy_backends/cuda/libs/cusparse.pyx":1915
 *         size_t csrSortedColIndA, size_t info, size_t x, size_t y, int policy,
 *         size_t pBuffer) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     status = cusparseScsrsv2_solve(
 *         <Handle>handle, <Operation>transA, m, nnz,
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1915, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":1916
 *         size_t pBuffer) except *:
 *     _setStream(handle)
 *     status = cusparseScsrsv2_solve(             # <<<<<<<<<<<<<<
 *         <Handle>handle, <Operation>transA, m, nnz,
 *         <const float*>alpha, <const MatDescr>descrA,
*/
  __pyx_v_status = cusparseScsrsv2_solve(((cusparseHandle_t)__pyx_v_handle), ((cusparseOperation_t)__pyx_v_transA), __pyx_v_m, __pyx_v_nnz, ((float const *)__pyx_v_alpha), ((cusparseMatDescr_t const )__pyx_v_descrA), ((float const *)__pyx_v_csrSortedValA), ((int const *)__pyx_v_csrSortedRowPtrA), ((int const *)__pyx_v_csrSortedColIndA), ((csrsv2Info_t)__pyx_v_info), ((float const *)__pyx_v_x), ((float *)__pyx_v_y), ((cusparseSolvePolicy_t)__pyx_v_policy), ((void *)__pyx_v_pBuffer));

  /* "cupy_backends/cuda/libs/cusparse.pyx":1923
 *         <const float*>x, <float*>y,
 *         <cusparseSolvePolicy_t>policy, <void*>pBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef void dcsrsv2_solve(
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1923, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":1910
 *     check_status(status)
 * 
 * cpdef void scsrsv2_solve(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int transA, int m, int nnz, size_t alpha,
 *         size_t descrA, size_t csrSortedValA, size_t csrSortedRowPtrA,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.scsrsv2_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_71scsrsv2_solve(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_70scsrsv2_solve, "scsrsv2_solve(intptr_t handle, int transA, int m, int nnz, size_t alpha, size_t descrA, size_t csrSortedValA, size_t csrSortedRowPtrA, size_t csrSortedColIndA, size_t info, size_t x, size_t y, int policy, size_t pBuffer) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_71scsrsv2_solve(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_t __pyx_v_handle;
  int __pyx_v_transA;
  int __pyx_v_m;
  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_info;
  size_t __pyx_v_x;
  size_t __pyx_v_y;
  int __pyx_v_policy;
  size_t __pyx_v_pBuffer;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[14] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("scsrsv2_solve (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_transA,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_nnz,&__pyx_mstate_global->__pyx_n_u_alpha,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_csrSortedValA,&__pyx_mstate_global->__pyx_n_u_csrSortedRowPtrA,&__pyx_mstate_global->__pyx_n_u_csrSortedColIndA,&__pyx_mstate_global->__pyx_n_u_info,&__pyx_mstate_global->__pyx_n_u_x,&__pyx_mstate_global->__pyx_n_u_y,&__pyx_mstate_global->__pyx_n_u_policy,&__pyx_mstate_global->__pyx_n_u_pBuffer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 1910, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 14:
        values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 1910, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 13:
        values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 1910, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 12:
        values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 1910, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 11:
        values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 1910, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 1910, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 1910, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 1910, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 1910, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 1910, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1910, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1910, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1910, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1910, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1910, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "scsrsv2_solve", 0) < (0)) __PYX_ERR(0, 1910, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 14; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("scsrsv2_solve", 1, 14, 14, i); __PYX_ERR(0, 1910, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 14)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1910, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1910, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1910, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1910, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1910, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 1910, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 1910, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 1910, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 1910, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 1910, __pyx_L3_error)
      values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 1910, __pyx_L3_error)
      values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 1910, __pyx_L3_error)
      values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 1910, __pyx_L3_error)
      values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 1910, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1911, __pyx_L3_error)
    __pyx_v_transA = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_transA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1911, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1911, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyLong_As_int(values[3]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1911, __pyx_L3_error)
    __pyx_v_alpha = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_alpha == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1911, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1912, __pyx_L3_error)
    __pyx_v_csrSortedValA = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_csrSortedValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1912, __pyx_L3_error)
    __pyx_v_csrSortedRowPtrA = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_csrSortedRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1912, __pyx_L3_error)
    __pyx_v_csrSortedColIndA = __Pyx_PyLong_As_size_t(values[8]); if (unlikely((__pyx_v_csrSortedColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1913, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyLong_As_size_t(values[9]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1913, __pyx_L3_error)
    __pyx_v_x = __Pyx_PyLong_As_size_t(values[10]); if (unlikely((__pyx_v_x == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1913, __pyx_L3_error)
    __pyx_v_y = __Pyx_PyLong_As_size_t(values[11]); if (unlikely((__pyx_v_y == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1913, __pyx_L3_error)
    __pyx_v_policy = __Pyx_PyLong_As_int(values[12]); if (unlikely((__pyx_v_policy == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1913, __pyx_L3_error)
    __pyx_v_pBuffer = __Pyx_PyLong_As_size_t(values[13]); if (unlikely((__pyx_v_pBuffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1914, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("scsrsv2_solve", 1, 14, 14, __pyx_nargs); __PYX_ERR(0, 1910, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.scsrsv2_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_70scsrsv2_solve(__pyx_self, __pyx_v_handle, __pyx_v_transA, __pyx_v_m, __pyx_v_nnz, __pyx_v_alpha, __pyx_v_descrA, __pyx_v_csrSortedValA, __pyx_v_csrSortedRowPtrA, __pyx_v_csrSortedColIndA, __pyx_v_info, __pyx_v_x, __pyx_v_y, __pyx_v_policy, __pyx_v_pBuffer);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_70scsrsv2_solve(CYTHON_UNUSED PyObject *__pyx_self, intptr_t __pyx_v_handle, int __pyx_v_transA, int __pyx_v_m, 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_info, size_t __pyx_v_x, size_t __pyx_v_y, 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("scsrsv2_solve", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_scsrsv2_solve(__pyx_v_handle, __pyx_v_transA, __pyx_v_m, __pyx_v_nnz, __pyx_v_alpha, __pyx_v_descrA, __pyx_v_csrSortedValA, __pyx_v_csrSortedRowPtrA, __pyx_v_csrSortedColIndA, __pyx_v_info, __pyx_v_x, __pyx_v_y, __pyx_v_policy, __pyx_v_pBuffer, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1910, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1910, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":1925
 *     check_status(status)
 * 
 * cpdef void dcsrsv2_solve(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int transA, int m, int nnz, size_t alpha,
 *         size_t descrA, size_t csrSortedValA, size_t csrSortedRowPtrA,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_73dcsrsv2_solve(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_dcsrsv2_solve(intptr_t __pyx_v_handle, int __pyx_v_transA, int __pyx_v_m, 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_info, size_t __pyx_v_x, size_t __pyx_v_y, int __pyx_v_policy, size_t __pyx_v_pBuffer, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dcsrsv2_solve", 0);

  /* "cupy_backends/cuda/libs/cusparse.pyx":1930
 *         size_t csrSortedColIndA, size_t info, size_t x, size_t y, int policy,
 *         size_t pBuffer) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     status = cusparseDcsrsv2_solve(
 *         <Handle>handle, <Operation>transA, m, nnz,
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1930, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":1931
 *         size_t pBuffer) except *:
 *     _setStream(handle)
 *     status = cusparseDcsrsv2_solve(             # <<<<<<<<<<<<<<
 *         <Handle>handle, <Operation>transA, m, nnz,
 *         <const double*>alpha, <const MatDescr>descrA,
*/
  __pyx_v_status = cusparseDcsrsv2_solve(((cusparseHandle_t)__pyx_v_handle), ((cusparseOperation_t)__pyx_v_transA), __pyx_v_m, __pyx_v_nnz, ((double const *)__pyx_v_alpha), ((cusparseMatDescr_t const )__pyx_v_descrA), ((double const *)__pyx_v_csrSortedValA), ((int const *)__pyx_v_csrSortedRowPtrA), ((int const *)__pyx_v_csrSortedColIndA), ((csrsv2Info_t)__pyx_v_info), ((double const *)__pyx_v_x), ((double *)__pyx_v_y), ((cusparseSolvePolicy_t)__pyx_v_policy), ((void *)__pyx_v_pBuffer));

  /* "cupy_backends/cuda/libs/cusparse.pyx":1938
 *         <const double*>x, <double*>y,
 *         <cusparseSolvePolicy_t>policy, <void*>pBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef void ccsrsv2_solve(
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1938, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":1925
 *     check_status(status)
 * 
 * cpdef void dcsrsv2_solve(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int transA, int m, int nnz, size_t alpha,
 *         size_t descrA, size_t csrSortedValA, size_t csrSortedRowPtrA,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.dcsrsv2_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_73dcsrsv2_solve(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_72dcsrsv2_solve, "dcsrsv2_solve(intptr_t handle, int transA, int m, int nnz, size_t alpha, size_t descrA, size_t csrSortedValA, size_t csrSortedRowPtrA, size_t csrSortedColIndA, size_t info, size_t x, size_t y, int policy, size_t pBuffer) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_73dcsrsv2_solve(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_t __pyx_v_handle;
  int __pyx_v_transA;
  int __pyx_v_m;
  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_info;
  size_t __pyx_v_x;
  size_t __pyx_v_y;
  int __pyx_v_policy;
  size_t __pyx_v_pBuffer;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[14] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dcsrsv2_solve (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_transA,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_nnz,&__pyx_mstate_global->__pyx_n_u_alpha,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_csrSortedValA,&__pyx_mstate_global->__pyx_n_u_csrSortedRowPtrA,&__pyx_mstate_global->__pyx_n_u_csrSortedColIndA,&__pyx_mstate_global->__pyx_n_u_info,&__pyx_mstate_global->__pyx_n_u_x,&__pyx_mstate_global->__pyx_n_u_y,&__pyx_mstate_global->__pyx_n_u_policy,&__pyx_mstate_global->__pyx_n_u_pBuffer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 1925, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 14:
        values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 1925, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 13:
        values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 1925, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 12:
        values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 1925, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 11:
        values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 1925, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 1925, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 1925, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 1925, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 1925, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 1925, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1925, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1925, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1925, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1925, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1925, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "dcsrsv2_solve", 0) < (0)) __PYX_ERR(0, 1925, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 14; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("dcsrsv2_solve", 1, 14, 14, i); __PYX_ERR(0, 1925, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 14)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1925, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1925, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1925, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1925, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1925, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 1925, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 1925, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 1925, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 1925, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 1925, __pyx_L3_error)
      values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 1925, __pyx_L3_error)
      values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 1925, __pyx_L3_error)
      values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 1925, __pyx_L3_error)
      values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 1925, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1926, __pyx_L3_error)
    __pyx_v_transA = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_transA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1926, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1926, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyLong_As_int(values[3]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1926, __pyx_L3_error)
    __pyx_v_alpha = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_alpha == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1926, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1927, __pyx_L3_error)
    __pyx_v_csrSortedValA = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_csrSortedValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1927, __pyx_L3_error)
    __pyx_v_csrSortedRowPtrA = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_csrSortedRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1927, __pyx_L3_error)
    __pyx_v_csrSortedColIndA = __Pyx_PyLong_As_size_t(values[8]); if (unlikely((__pyx_v_csrSortedColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1928, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyLong_As_size_t(values[9]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1928, __pyx_L3_error)
    __pyx_v_x = __Pyx_PyLong_As_size_t(values[10]); if (unlikely((__pyx_v_x == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1928, __pyx_L3_error)
    __pyx_v_y = __Pyx_PyLong_As_size_t(values[11]); if (unlikely((__pyx_v_y == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1928, __pyx_L3_error)
    __pyx_v_policy = __Pyx_PyLong_As_int(values[12]); if (unlikely((__pyx_v_policy == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1928, __pyx_L3_error)
    __pyx_v_pBuffer = __Pyx_PyLong_As_size_t(values[13]); if (unlikely((__pyx_v_pBuffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1929, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("dcsrsv2_solve", 1, 14, 14, __pyx_nargs); __PYX_ERR(0, 1925, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.dcsrsv2_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_72dcsrsv2_solve(__pyx_self, __pyx_v_handle, __pyx_v_transA, __pyx_v_m, __pyx_v_nnz, __pyx_v_alpha, __pyx_v_descrA, __pyx_v_csrSortedValA, __pyx_v_csrSortedRowPtrA, __pyx_v_csrSortedColIndA, __pyx_v_info, __pyx_v_x, __pyx_v_y, __pyx_v_policy, __pyx_v_pBuffer);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_72dcsrsv2_solve(CYTHON_UNUSED PyObject *__pyx_self, intptr_t __pyx_v_handle, int __pyx_v_transA, int __pyx_v_m, 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_info, size_t __pyx_v_x, size_t __pyx_v_y, 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("dcsrsv2_solve", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_dcsrsv2_solve(__pyx_v_handle, __pyx_v_transA, __pyx_v_m, __pyx_v_nnz, __pyx_v_alpha, __pyx_v_descrA, __pyx_v_csrSortedValA, __pyx_v_csrSortedRowPtrA, __pyx_v_csrSortedColIndA, __pyx_v_info, __pyx_v_x, __pyx_v_y, __pyx_v_policy, __pyx_v_pBuffer, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1925, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1925, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":1940
 *     check_status(status)
 * 
 * cpdef void ccsrsv2_solve(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int transA, int m, int nnz, size_t alpha,
 *         size_t descrA, size_t csrSortedValA, size_t csrSortedRowPtrA,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_75ccsrsv2_solve(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_ccsrsv2_solve(intptr_t __pyx_v_handle, int __pyx_v_transA, int __pyx_v_m, 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_info, size_t __pyx_v_x, size_t __pyx_v_y, int __pyx_v_policy, size_t __pyx_v_pBuffer, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("ccsrsv2_solve", 0);

  /* "cupy_backends/cuda/libs/cusparse.pyx":1945
 *         size_t csrSortedColIndA, size_t info, size_t x, size_t y, int policy,
 *         size_t pBuffer) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     status = cusparseCcsrsv2_solve(
 *         <Handle>handle, <Operation>transA, m, nnz,
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1945, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":1946
 *         size_t pBuffer) except *:
 *     _setStream(handle)
 *     status = cusparseCcsrsv2_solve(             # <<<<<<<<<<<<<<
 *         <Handle>handle, <Operation>transA, m, nnz,
 *         <const cuComplex*>alpha, <const MatDescr>descrA,
*/
  __pyx_v_status = cusparseCcsrsv2_solve(((cusparseHandle_t)__pyx_v_handle), ((cusparseOperation_t)__pyx_v_transA), __pyx_v_m, __pyx_v_nnz, ((cuComplex const *)__pyx_v_alpha), ((cusparseMatDescr_t const )__pyx_v_descrA), ((cuComplex const *)__pyx_v_csrSortedValA), ((int const *)__pyx_v_csrSortedRowPtrA), ((int const *)__pyx_v_csrSortedColIndA), ((csrsv2Info_t)__pyx_v_info), ((cuComplex const *)__pyx_v_x), ((cuComplex *)__pyx_v_y), ((cusparseSolvePolicy_t)__pyx_v_policy), ((void *)__pyx_v_pBuffer));

  /* "cupy_backends/cuda/libs/cusparse.pyx":1953
 *         <const cuComplex*>x, <cuComplex*>y,
 *         <cusparseSolvePolicy_t>policy, <void*>pBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef void zcsrsv2_solve(
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1953, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":1940
 *     check_status(status)
 * 
 * cpdef void ccsrsv2_solve(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int transA, int m, int nnz, size_t alpha,
 *         size_t descrA, size_t csrSortedValA, size_t csrSortedRowPtrA,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.ccsrsv2_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_75ccsrsv2_solve(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_74ccsrsv2_solve, "ccsrsv2_solve(intptr_t handle, int transA, int m, int nnz, size_t alpha, size_t descrA, size_t csrSortedValA, size_t csrSortedRowPtrA, size_t csrSortedColIndA, size_t info, size_t x, size_t y, int policy, size_t pBuffer) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_75ccsrsv2_solve(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_t __pyx_v_handle;
  int __pyx_v_transA;
  int __pyx_v_m;
  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_info;
  size_t __pyx_v_x;
  size_t __pyx_v_y;
  int __pyx_v_policy;
  size_t __pyx_v_pBuffer;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[14] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ccsrsv2_solve (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_transA,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_nnz,&__pyx_mstate_global->__pyx_n_u_alpha,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_csrSortedValA,&__pyx_mstate_global->__pyx_n_u_csrSortedRowPtrA,&__pyx_mstate_global->__pyx_n_u_csrSortedColIndA,&__pyx_mstate_global->__pyx_n_u_info,&__pyx_mstate_global->__pyx_n_u_x,&__pyx_mstate_global->__pyx_n_u_y,&__pyx_mstate_global->__pyx_n_u_policy,&__pyx_mstate_global->__pyx_n_u_pBuffer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 1940, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 14:
        values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 1940, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 13:
        values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 1940, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 12:
        values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 1940, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 11:
        values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 1940, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 1940, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 1940, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 1940, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 1940, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 1940, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1940, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1940, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1940, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1940, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1940, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "ccsrsv2_solve", 0) < (0)) __PYX_ERR(0, 1940, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 14; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("ccsrsv2_solve", 1, 14, 14, i); __PYX_ERR(0, 1940, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 14)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1940, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1940, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1940, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1940, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1940, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 1940, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 1940, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 1940, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 1940, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 1940, __pyx_L3_error)
      values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 1940, __pyx_L3_error)
      values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 1940, __pyx_L3_error)
      values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 1940, __pyx_L3_error)
      values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 1940, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1941, __pyx_L3_error)
    __pyx_v_transA = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_transA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1941, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1941, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyLong_As_int(values[3]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1941, __pyx_L3_error)
    __pyx_v_alpha = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_alpha == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1941, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1942, __pyx_L3_error)
    __pyx_v_csrSortedValA = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_csrSortedValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1942, __pyx_L3_error)
    __pyx_v_csrSortedRowPtrA = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_csrSortedRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1942, __pyx_L3_error)
    __pyx_v_csrSortedColIndA = __Pyx_PyLong_As_size_t(values[8]); if (unlikely((__pyx_v_csrSortedColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1943, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyLong_As_size_t(values[9]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1943, __pyx_L3_error)
    __pyx_v_x = __Pyx_PyLong_As_size_t(values[10]); if (unlikely((__pyx_v_x == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1943, __pyx_L3_error)
    __pyx_v_y = __Pyx_PyLong_As_size_t(values[11]); if (unlikely((__pyx_v_y == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1943, __pyx_L3_error)
    __pyx_v_policy = __Pyx_PyLong_As_int(values[12]); if (unlikely((__pyx_v_policy == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1943, __pyx_L3_error)
    __pyx_v_pBuffer = __Pyx_PyLong_As_size_t(values[13]); if (unlikely((__pyx_v_pBuffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1944, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ccsrsv2_solve", 1, 14, 14, __pyx_nargs); __PYX_ERR(0, 1940, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.ccsrsv2_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_74ccsrsv2_solve(__pyx_self, __pyx_v_handle, __pyx_v_transA, __pyx_v_m, __pyx_v_nnz, __pyx_v_alpha, __pyx_v_descrA, __pyx_v_csrSortedValA, __pyx_v_csrSortedRowPtrA, __pyx_v_csrSortedColIndA, __pyx_v_info, __pyx_v_x, __pyx_v_y, __pyx_v_policy, __pyx_v_pBuffer);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_74ccsrsv2_solve(CYTHON_UNUSED PyObject *__pyx_self, intptr_t __pyx_v_handle, int __pyx_v_transA, int __pyx_v_m, 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_info, size_t __pyx_v_x, size_t __pyx_v_y, 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("ccsrsv2_solve", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_ccsrsv2_solve(__pyx_v_handle, __pyx_v_transA, __pyx_v_m, __pyx_v_nnz, __pyx_v_alpha, __pyx_v_descrA, __pyx_v_csrSortedValA, __pyx_v_csrSortedRowPtrA, __pyx_v_csrSortedColIndA, __pyx_v_info, __pyx_v_x, __pyx_v_y, __pyx_v_policy, __pyx_v_pBuffer, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1940, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1940, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":1955
 *     check_status(status)
 * 
 * cpdef void zcsrsv2_solve(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int transA, int m, int nnz, size_t alpha,
 *         size_t descrA, size_t csrSortedValA, size_t csrSortedRowPtrA,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_77zcsrsv2_solve(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_zcsrsv2_solve(intptr_t __pyx_v_handle, int __pyx_v_transA, int __pyx_v_m, 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_info, size_t __pyx_v_x, size_t __pyx_v_y, int __pyx_v_policy, size_t __pyx_v_pBuffer, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("zcsrsv2_solve", 0);

  /* "cupy_backends/cuda/libs/cusparse.pyx":1960
 *         size_t csrSortedColIndA, size_t info, size_t x, size_t y, int policy,
 *         size_t pBuffer) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     status = cusparseZcsrsv2_solve(
 *         <Handle>handle, <Operation>transA, m, nnz,
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1960, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":1961
 *         size_t pBuffer) except *:
 *     _setStream(handle)
 *     status = cusparseZcsrsv2_solve(             # <<<<<<<<<<<<<<
 *         <Handle>handle, <Operation>transA, m, nnz,
 *         <const cuDoubleComplex*>alpha, <const MatDescr>descrA,
*/
  __pyx_v_status = cusparseZcsrsv2_solve(((cusparseHandle_t)__pyx_v_handle), ((cusparseOperation_t)__pyx_v_transA), __pyx_v_m, __pyx_v_nnz, ((cuDoubleComplex const *)__pyx_v_alpha), ((cusparseMatDescr_t const )__pyx_v_descrA), ((cuDoubleComplex const *)__pyx_v_csrSortedValA), ((int const *)__pyx_v_csrSortedRowPtrA), ((int const *)__pyx_v_csrSortedColIndA), ((csrsv2Info_t)__pyx_v_info), ((cuDoubleComplex const *)__pyx_v_x), ((cuDoubleComplex *)__pyx_v_y), ((cusparseSolvePolicy_t)__pyx_v_policy), ((void *)__pyx_v_pBuffer));

  /* "cupy_backends/cuda/libs/cusparse.pyx":1968
 *         <const cuDoubleComplex*>x, <cuDoubleComplex*>y,
 *         <cusparseSolvePolicy_t>policy, <void*>pBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef void xcsrsv2_zeroPivot(
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1968, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":1955
 *     check_status(status)
 * 
 * cpdef void zcsrsv2_solve(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int transA, int m, int nnz, size_t alpha,
 *         size_t descrA, size_t csrSortedValA, size_t csrSortedRowPtrA,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.zcsrsv2_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_77zcsrsv2_solve(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_76zcsrsv2_solve, "zcsrsv2_solve(intptr_t handle, int transA, int m, int nnz, size_t alpha, size_t descrA, size_t csrSortedValA, size_t csrSortedRowPtrA, size_t csrSortedColIndA, size_t info, size_t x, size_t y, int policy, size_t pBuffer) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_77zcsrsv2_solve(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_t __pyx_v_handle;
  int __pyx_v_transA;
  int __pyx_v_m;
  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_info;
  size_t __pyx_v_x;
  size_t __pyx_v_y;
  int __pyx_v_policy;
  size_t __pyx_v_pBuffer;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[14] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("zcsrsv2_solve (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_transA,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_nnz,&__pyx_mstate_global->__pyx_n_u_alpha,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_csrSortedValA,&__pyx_mstate_global->__pyx_n_u_csrSortedRowPtrA,&__pyx_mstate_global->__pyx_n_u_csrSortedColIndA,&__pyx_mstate_global->__pyx_n_u_info,&__pyx_mstate_global->__pyx_n_u_x,&__pyx_mstate_global->__pyx_n_u_y,&__pyx_mstate_global->__pyx_n_u_policy,&__pyx_mstate_global->__pyx_n_u_pBuffer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 1955, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 14:
        values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 1955, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 13:
        values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 1955, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 12:
        values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 1955, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 11:
        values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 1955, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 1955, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 1955, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 1955, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 1955, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 1955, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1955, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1955, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1955, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1955, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1955, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "zcsrsv2_solve", 0) < (0)) __PYX_ERR(0, 1955, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 14; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("zcsrsv2_solve", 1, 14, 14, i); __PYX_ERR(0, 1955, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 14)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1955, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1955, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1955, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1955, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1955, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 1955, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 1955, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 1955, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 1955, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 1955, __pyx_L3_error)
      values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 1955, __pyx_L3_error)
      values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 1955, __pyx_L3_error)
      values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 1955, __pyx_L3_error)
      values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 1955, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1956, __pyx_L3_error)
    __pyx_v_transA = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_transA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1956, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1956, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyLong_As_int(values[3]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1956, __pyx_L3_error)
    __pyx_v_alpha = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_alpha == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1956, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1957, __pyx_L3_error)
    __pyx_v_csrSortedValA = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_csrSortedValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1957, __pyx_L3_error)
    __pyx_v_csrSortedRowPtrA = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_csrSortedRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1957, __pyx_L3_error)
    __pyx_v_csrSortedColIndA = __Pyx_PyLong_As_size_t(values[8]); if (unlikely((__pyx_v_csrSortedColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1958, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyLong_As_size_t(values[9]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1958, __pyx_L3_error)
    __pyx_v_x = __Pyx_PyLong_As_size_t(values[10]); if (unlikely((__pyx_v_x == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1958, __pyx_L3_error)
    __pyx_v_y = __Pyx_PyLong_As_size_t(values[11]); if (unlikely((__pyx_v_y == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1958, __pyx_L3_error)
    __pyx_v_policy = __Pyx_PyLong_As_int(values[12]); if (unlikely((__pyx_v_policy == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1958, __pyx_L3_error)
    __pyx_v_pBuffer = __Pyx_PyLong_As_size_t(values[13]); if (unlikely((__pyx_v_pBuffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1959, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("zcsrsv2_solve", 1, 14, 14, __pyx_nargs); __PYX_ERR(0, 1955, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.zcsrsv2_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_76zcsrsv2_solve(__pyx_self, __pyx_v_handle, __pyx_v_transA, __pyx_v_m, __pyx_v_nnz, __pyx_v_alpha, __pyx_v_descrA, __pyx_v_csrSortedValA, __pyx_v_csrSortedRowPtrA, __pyx_v_csrSortedColIndA, __pyx_v_info, __pyx_v_x, __pyx_v_y, __pyx_v_policy, __pyx_v_pBuffer);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_76zcsrsv2_solve(CYTHON_UNUSED PyObject *__pyx_self, intptr_t __pyx_v_handle, int __pyx_v_transA, int __pyx_v_m, 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_info, size_t __pyx_v_x, size_t __pyx_v_y, 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("zcsrsv2_solve", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_zcsrsv2_solve(__pyx_v_handle, __pyx_v_transA, __pyx_v_m, __pyx_v_nnz, __pyx_v_alpha, __pyx_v_descrA, __pyx_v_csrSortedValA, __pyx_v_csrSortedRowPtrA, __pyx_v_csrSortedColIndA, __pyx_v_info, __pyx_v_x, __pyx_v_y, __pyx_v_policy, __pyx_v_pBuffer, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1955, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1955, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":1970
 *     check_status(status)
 * 
 * cpdef void xcsrsv2_zeroPivot(             # <<<<<<<<<<<<<<
 *         intptr_t handle, size_t info, size_t position) except *:
 *     _setStream(handle)
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_79xcsrsv2_zeroPivot(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_xcsrsv2_zeroPivot(intptr_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;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("xcsrsv2_zeroPivot", 0);

  /* "cupy_backends/cuda/libs/cusparse.pyx":1972
 * cpdef void xcsrsv2_zeroPivot(
 *         intptr_t handle, size_t info, size_t position) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     status = cusparseXcsrsv2_zeroPivot(
 *         <Handle>handle, <csrsv2Info_t>info, <int*>position)
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1972, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":1973
 *         intptr_t handle, size_t info, size_t position) except *:
 *     _setStream(handle)
 *     status = cusparseXcsrsv2_zeroPivot(             # <<<<<<<<<<<<<<
 *         <Handle>handle, <csrsv2Info_t>info, <int*>position)
 *     check_status(status)
*/
  __pyx_v_status = cusparseXcsrsv2_zeroPivot(((cusparseHandle_t)__pyx_v_handle), ((csrsv2Info_t)__pyx_v_info), ((int *)__pyx_v_position));

  /* "cupy_backends/cuda/libs/cusparse.pyx":1975
 *     status = cusparseXcsrsv2_zeroPivot(
 *         <Handle>handle, <csrsv2Info_t>info, <int*>position)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * ########################################
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_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_backends/cuda/libs/cusparse.pyx":1970
 *     check_status(status)
 * 
 * cpdef void xcsrsv2_zeroPivot(             # <<<<<<<<<<<<<<
 *         intptr_t handle, size_t info, size_t position) except *:
 *     _setStream(handle)
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.xcsrsv2_zeroPivot", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_79xcsrsv2_zeroPivot(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_78xcsrsv2_zeroPivot, "xcsrsv2_zeroPivot(intptr_t handle, size_t info, size_t position) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_79xcsrsv2_zeroPivot(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_t __pyx_v_handle;
  size_t __pyx_v_info;
  size_t __pyx_v_position;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("xcsrsv2_zeroPivot (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_info,&__pyx_mstate_global->__pyx_n_u_position,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 1970, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1970, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1970, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1970, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "xcsrsv2_zeroPivot", 0) < (0)) __PYX_ERR(0, 1970, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("xcsrsv2_zeroPivot", 1, 3, 3, i); __PYX_ERR(0, 1970, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1970, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1970, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1970, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1971, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyLong_As_size_t(values[1]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1971, __pyx_L3_error)
    __pyx_v_position = __Pyx_PyLong_As_size_t(values[2]); if (unlikely((__pyx_v_position == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1971, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("xcsrsv2_zeroPivot", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 1970, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.xcsrsv2_zeroPivot", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_78xcsrsv2_zeroPivot(__pyx_self, __pyx_v_handle, __pyx_v_info, __pyx_v_position);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_78xcsrsv2_zeroPivot(CYTHON_UNUSED PyObject *__pyx_self, intptr_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("xcsrsv2_zeroPivot", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_xcsrsv2_zeroPivot(__pyx_v_handle, __pyx_v_info, __pyx_v_position, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1970, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1970, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":1980
 * # cuSPARSE Level3 Function
 * 
 * cpdef void scsrmm(             # <<<<<<<<<<<<<<
 *         intptr_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_13cupy_backends_4cuda_4libs_8cusparse_81scsrmm(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_scsrmm(intptr_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;
  __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_backends/cuda/libs/cusparse.pyx":1985
 *         size_t csrSortedRowPtrA, size_t csrSortedColIndA,
 *         size_t B, int ldb, size_t beta, size_t C, int ldc) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     status = cusparseScsrmm(
 *         <Handle>handle, <Operation>transA, m, n, k, nnz,
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1985, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":1986
 *         size_t B, int ldb, size_t beta, size_t C, int ldc) except *:
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":1991
 *         <const int *>csrSortedRowPtrA, <const int *>csrSortedColIndA,
 *         <const float *>B, ldb, <const float *>beta, <float *>C, ldc)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef void dcsrmm(
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1991, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":1980
 * # cuSPARSE Level3 Function
 * 
 * cpdef void scsrmm(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int transA, int m, int n, int k, int nnz,
 *         size_t alpha, size_t descrA, size_t csrSortedValA,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.scsrmm", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_81scsrmm(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_80scsrmm, "scsrmm(intptr_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) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_81scsrmm(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[16] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("scsrmm (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_transA,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_n,&__pyx_mstate_global->__pyx_n_u_k,&__pyx_mstate_global->__pyx_n_u_nnz,&__pyx_mstate_global->__pyx_n_u_alpha,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_csrSortedValA,&__pyx_mstate_global->__pyx_n_u_csrSortedRowPtrA,&__pyx_mstate_global->__pyx_n_u_csrSortedColIndA,&__pyx_mstate_global->__pyx_n_u_B,&__pyx_mstate_global->__pyx_n_u_ldb,&__pyx_mstate_global->__pyx_n_u_beta,&__pyx_mstate_global->__pyx_n_u_C,&__pyx_mstate_global->__pyx_n_u_ldc,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 1980, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 16:
        values[15] = __Pyx_ArgRef_FASTCALL(__pyx_args, 15);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 1980, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 15:
        values[14] = __Pyx_ArgRef_FASTCALL(__pyx_args, 14);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 1980, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 14:
        values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 1980, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 13:
        values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 1980, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 12:
        values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 1980, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 11:
        values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 1980, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 1980, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 1980, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 1980, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 1980, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 1980, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1980, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1980, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1980, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1980, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1980, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "scsrmm", 0) < (0)) __PYX_ERR(0, 1980, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 16; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("scsrmm", 1, 16, 16, i); __PYX_ERR(0, 1980, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 16)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1980, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1980, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1980, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1980, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1980, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 1980, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 1980, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 1980, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 1980, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 1980, __pyx_L3_error)
      values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 1980, __pyx_L3_error)
      values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 1980, __pyx_L3_error)
      values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 1980, __pyx_L3_error)
      values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 1980, __pyx_L3_error)
      values[14] = __Pyx_ArgRef_FASTCALL(__pyx_args, 14);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 1980, __pyx_L3_error)
      values[15] = __Pyx_ArgRef_FASTCALL(__pyx_args, 15);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 1980, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1981, __pyx_L3_error)
    __pyx_v_transA = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_transA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1981, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1981, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyLong_As_int(values[3]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1981, __pyx_L3_error)
    __pyx_v_k = __Pyx_PyLong_As_int(values[4]); if (unlikely((__pyx_v_k == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1981, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyLong_As_int(values[5]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1981, __pyx_L3_error)
    __pyx_v_alpha = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_alpha == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1982, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1982, __pyx_L3_error)
    __pyx_v_csrSortedValA = __Pyx_PyLong_As_size_t(values[8]); if (unlikely((__pyx_v_csrSortedValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1982, __pyx_L3_error)
    __pyx_v_csrSortedRowPtrA = __Pyx_PyLong_As_size_t(values[9]); if (unlikely((__pyx_v_csrSortedRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1983, __pyx_L3_error)
    __pyx_v_csrSortedColIndA = __Pyx_PyLong_As_size_t(values[10]); if (unlikely((__pyx_v_csrSortedColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1983, __pyx_L3_error)
    __pyx_v_B = __Pyx_PyLong_As_size_t(values[11]); if (unlikely((__pyx_v_B == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1984, __pyx_L3_error)
    __pyx_v_ldb = __Pyx_PyLong_As_int(values[12]); if (unlikely((__pyx_v_ldb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1984, __pyx_L3_error)
    __pyx_v_beta = __Pyx_PyLong_As_size_t(values[13]); if (unlikely((__pyx_v_beta == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1984, __pyx_L3_error)
    __pyx_v_C = __Pyx_PyLong_As_size_t(values[14]); if (unlikely((__pyx_v_C == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1984, __pyx_L3_error)
    __pyx_v_ldc = __Pyx_PyLong_As_int(values[15]); if (unlikely((__pyx_v_ldc == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1984, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("scsrmm", 1, 16, 16, __pyx_nargs); __PYX_ERR(0, 1980, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.scsrmm", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_80scsrmm(__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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_80scsrmm(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1980, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1980, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":1993
 *     check_status(status)
 * 
 * cpdef void dcsrmm(             # <<<<<<<<<<<<<<
 *         intptr_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_13cupy_backends_4cuda_4libs_8cusparse_83dcsrmm(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_dcsrmm(intptr_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;
  __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_backends/cuda/libs/cusparse.pyx":1998
 *         size_t csrSortedRowPtrA, size_t csrSortedColIndA,
 *         size_t B, int ldb, size_t beta, size_t C, int ldc) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     status = cusparseDcsrmm(
 *         <Handle>handle, <Operation>transA, m, n, k, nnz,
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1998, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":1999
 *         size_t B, int ldb, size_t beta, size_t C, int ldc) except *:
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":2004
 *         <const int *>csrSortedRowPtrA, <const int *>csrSortedColIndA,
 *         <const double *>B, ldb, <const double *>beta, <double *>C, ldc)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef void ccsrmm(
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2004, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":1993
 *     check_status(status)
 * 
 * cpdef void dcsrmm(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int transA, int m, int n, int k, int nnz,
 *         size_t alpha, size_t descrA, size_t csrSortedValA,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.dcsrmm", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_83dcsrmm(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_82dcsrmm, "dcsrmm(intptr_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) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_83dcsrmm(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[16] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dcsrmm (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_transA,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_n,&__pyx_mstate_global->__pyx_n_u_k,&__pyx_mstate_global->__pyx_n_u_nnz,&__pyx_mstate_global->__pyx_n_u_alpha,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_csrSortedValA,&__pyx_mstate_global->__pyx_n_u_csrSortedRowPtrA,&__pyx_mstate_global->__pyx_n_u_csrSortedColIndA,&__pyx_mstate_global->__pyx_n_u_B,&__pyx_mstate_global->__pyx_n_u_ldb,&__pyx_mstate_global->__pyx_n_u_beta,&__pyx_mstate_global->__pyx_n_u_C,&__pyx_mstate_global->__pyx_n_u_ldc,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 1993, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 16:
        values[15] = __Pyx_ArgRef_FASTCALL(__pyx_args, 15);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 1993, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 15:
        values[14] = __Pyx_ArgRef_FASTCALL(__pyx_args, 14);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 1993, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 14:
        values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 1993, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 13:
        values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 1993, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 12:
        values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 1993, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 11:
        values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 1993, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 1993, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 1993, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 1993, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 1993, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 1993, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1993, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1993, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1993, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1993, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1993, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "dcsrmm", 0) < (0)) __PYX_ERR(0, 1993, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 16; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("dcsrmm", 1, 16, 16, i); __PYX_ERR(0, 1993, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 16)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1993, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1993, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1993, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1993, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1993, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 1993, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 1993, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 1993, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 1993, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 1993, __pyx_L3_error)
      values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 1993, __pyx_L3_error)
      values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 1993, __pyx_L3_error)
      values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 1993, __pyx_L3_error)
      values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 1993, __pyx_L3_error)
      values[14] = __Pyx_ArgRef_FASTCALL(__pyx_args, 14);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 1993, __pyx_L3_error)
      values[15] = __Pyx_ArgRef_FASTCALL(__pyx_args, 15);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 1993, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1994, __pyx_L3_error)
    __pyx_v_transA = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_transA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1994, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1994, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyLong_As_int(values[3]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1994, __pyx_L3_error)
    __pyx_v_k = __Pyx_PyLong_As_int(values[4]); if (unlikely((__pyx_v_k == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1994, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyLong_As_int(values[5]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1994, __pyx_L3_error)
    __pyx_v_alpha = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_alpha == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1995, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1995, __pyx_L3_error)
    __pyx_v_csrSortedValA = __Pyx_PyLong_As_size_t(values[8]); if (unlikely((__pyx_v_csrSortedValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1995, __pyx_L3_error)
    __pyx_v_csrSortedRowPtrA = __Pyx_PyLong_As_size_t(values[9]); if (unlikely((__pyx_v_csrSortedRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1996, __pyx_L3_error)
    __pyx_v_csrSortedColIndA = __Pyx_PyLong_As_size_t(values[10]); if (unlikely((__pyx_v_csrSortedColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1996, __pyx_L3_error)
    __pyx_v_B = __Pyx_PyLong_As_size_t(values[11]); if (unlikely((__pyx_v_B == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1997, __pyx_L3_error)
    __pyx_v_ldb = __Pyx_PyLong_As_int(values[12]); if (unlikely((__pyx_v_ldb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1997, __pyx_L3_error)
    __pyx_v_beta = __Pyx_PyLong_As_size_t(values[13]); if (unlikely((__pyx_v_beta == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1997, __pyx_L3_error)
    __pyx_v_C = __Pyx_PyLong_As_size_t(values[14]); if (unlikely((__pyx_v_C == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1997, __pyx_L3_error)
    __pyx_v_ldc = __Pyx_PyLong_As_int(values[15]); if (unlikely((__pyx_v_ldc == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1997, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("dcsrmm", 1, 16, 16, __pyx_nargs); __PYX_ERR(0, 1993, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.dcsrmm", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_82dcsrmm(__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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_82dcsrmm(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1993, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1993, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":2006
 *     check_status(status)
 * 
 * cpdef void ccsrmm(             # <<<<<<<<<<<<<<
 *         intptr_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_13cupy_backends_4cuda_4libs_8cusparse_85ccsrmm(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_ccsrmm(intptr_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;
  __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_backends/cuda/libs/cusparse.pyx":2011
 *         size_t csrSortedRowPtrA, size_t csrSortedColIndA,
 *         size_t B, int ldb, size_t beta, size_t C, int ldc) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     status = cusparseCcsrmm(
 *         <Handle>handle, <Operation>transA, m, n, k, nnz,
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2011, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":2012
 *         size_t B, int ldb, size_t beta, size_t C, int ldc) except *:
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":2019
 *         <const cuComplex *>B, ldb, <const cuComplex *>beta,
 *         <cuComplex *>C, ldc)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef void zcsrmm(
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2019, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":2006
 *     check_status(status)
 * 
 * cpdef void ccsrmm(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int transA, int m, int n, int k, int nnz,
 *         size_t alpha, size_t descrA, size_t csrSortedValA,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.ccsrmm", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_85ccsrmm(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_84ccsrmm, "ccsrmm(intptr_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) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_85ccsrmm(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[16] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ccsrmm (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_transA,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_n,&__pyx_mstate_global->__pyx_n_u_k,&__pyx_mstate_global->__pyx_n_u_nnz,&__pyx_mstate_global->__pyx_n_u_alpha,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_csrSortedValA,&__pyx_mstate_global->__pyx_n_u_csrSortedRowPtrA,&__pyx_mstate_global->__pyx_n_u_csrSortedColIndA,&__pyx_mstate_global->__pyx_n_u_B,&__pyx_mstate_global->__pyx_n_u_ldb,&__pyx_mstate_global->__pyx_n_u_beta,&__pyx_mstate_global->__pyx_n_u_C,&__pyx_mstate_global->__pyx_n_u_ldc,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 2006, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 16:
        values[15] = __Pyx_ArgRef_FASTCALL(__pyx_args, 15);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 2006, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 15:
        values[14] = __Pyx_ArgRef_FASTCALL(__pyx_args, 14);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 2006, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 14:
        values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 2006, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 13:
        values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 2006, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 12:
        values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 2006, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 11:
        values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 2006, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 2006, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 2006, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 2006, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 2006, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 2006, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 2006, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2006, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2006, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2006, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2006, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "ccsrmm", 0) < (0)) __PYX_ERR(0, 2006, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 16; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("ccsrmm", 1, 16, 16, i); __PYX_ERR(0, 2006, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 16)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2006, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2006, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2006, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2006, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 2006, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 2006, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 2006, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 2006, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 2006, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 2006, __pyx_L3_error)
      values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 2006, __pyx_L3_error)
      values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 2006, __pyx_L3_error)
      values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 2006, __pyx_L3_error)
      values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 2006, __pyx_L3_error)
      values[14] = __Pyx_ArgRef_FASTCALL(__pyx_args, 14);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 2006, __pyx_L3_error)
      values[15] = __Pyx_ArgRef_FASTCALL(__pyx_args, 15);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 2006, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2007, __pyx_L3_error)
    __pyx_v_transA = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_transA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2007, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2007, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyLong_As_int(values[3]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2007, __pyx_L3_error)
    __pyx_v_k = __Pyx_PyLong_As_int(values[4]); if (unlikely((__pyx_v_k == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2007, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyLong_As_int(values[5]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2007, __pyx_L3_error)
    __pyx_v_alpha = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_alpha == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2008, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2008, __pyx_L3_error)
    __pyx_v_csrSortedValA = __Pyx_PyLong_As_size_t(values[8]); if (unlikely((__pyx_v_csrSortedValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2008, __pyx_L3_error)
    __pyx_v_csrSortedRowPtrA = __Pyx_PyLong_As_size_t(values[9]); if (unlikely((__pyx_v_csrSortedRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2009, __pyx_L3_error)
    __pyx_v_csrSortedColIndA = __Pyx_PyLong_As_size_t(values[10]); if (unlikely((__pyx_v_csrSortedColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2009, __pyx_L3_error)
    __pyx_v_B = __Pyx_PyLong_As_size_t(values[11]); if (unlikely((__pyx_v_B == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2010, __pyx_L3_error)
    __pyx_v_ldb = __Pyx_PyLong_As_int(values[12]); if (unlikely((__pyx_v_ldb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2010, __pyx_L3_error)
    __pyx_v_beta = __Pyx_PyLong_As_size_t(values[13]); if (unlikely((__pyx_v_beta == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2010, __pyx_L3_error)
    __pyx_v_C = __Pyx_PyLong_As_size_t(values[14]); if (unlikely((__pyx_v_C == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2010, __pyx_L3_error)
    __pyx_v_ldc = __Pyx_PyLong_As_int(values[15]); if (unlikely((__pyx_v_ldc == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2010, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ccsrmm", 1, 16, 16, __pyx_nargs); __PYX_ERR(0, 2006, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.ccsrmm", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_84ccsrmm(__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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_84ccsrmm(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2006, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2006, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":2021
 *     check_status(status)
 * 
 * cpdef void zcsrmm(             # <<<<<<<<<<<<<<
 *         intptr_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_13cupy_backends_4cuda_4libs_8cusparse_87zcsrmm(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_zcsrmm(intptr_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;
  __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_backends/cuda/libs/cusparse.pyx":2026
 *         size_t csrSortedRowPtrA, size_t csrSortedColIndA,
 *         size_t B, int ldb, size_t beta, size_t C, int ldc) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     status = cusparseZcsrmm(
 *         <Handle>handle, <Operation>transA, m, n, k, nnz,
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2026, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":2027
 *         size_t B, int ldb, size_t beta, size_t C, int ldc) except *:
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":2034
 *         <const cuDoubleComplex *>B, ldb,
 *         <const cuDoubleComplex *>beta, <cuDoubleComplex *>C, ldc)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef void scsrmm2(
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_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_backends/cuda/libs/cusparse.pyx":2021
 *     check_status(status)
 * 
 * cpdef void zcsrmm(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int transA, int m, int n, int k, int nnz,
 *         size_t alpha, size_t descrA, size_t csrSortedValA,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.zcsrmm", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_87zcsrmm(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_86zcsrmm, "zcsrmm(intptr_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) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_87zcsrmm(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[16] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("zcsrmm (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_transA,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_n,&__pyx_mstate_global->__pyx_n_u_k,&__pyx_mstate_global->__pyx_n_u_nnz,&__pyx_mstate_global->__pyx_n_u_alpha,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_csrSortedValA,&__pyx_mstate_global->__pyx_n_u_csrSortedRowPtrA,&__pyx_mstate_global->__pyx_n_u_csrSortedColIndA,&__pyx_mstate_global->__pyx_n_u_B,&__pyx_mstate_global->__pyx_n_u_ldb,&__pyx_mstate_global->__pyx_n_u_beta,&__pyx_mstate_global->__pyx_n_u_C,&__pyx_mstate_global->__pyx_n_u_ldc,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 2021, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 16:
        values[15] = __Pyx_ArgRef_FASTCALL(__pyx_args, 15);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 2021, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 15:
        values[14] = __Pyx_ArgRef_FASTCALL(__pyx_args, 14);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 2021, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 14:
        values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 2021, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 13:
        values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 2021, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 12:
        values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 2021, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 11:
        values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 2021, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 2021, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 2021, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 2021, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 2021, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 2021, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 2021, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2021, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2021, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2021, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2021, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "zcsrmm", 0) < (0)) __PYX_ERR(0, 2021, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 16; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("zcsrmm", 1, 16, 16, i); __PYX_ERR(0, 2021, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 16)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2021, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2021, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2021, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2021, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 2021, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 2021, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 2021, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 2021, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 2021, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 2021, __pyx_L3_error)
      values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 2021, __pyx_L3_error)
      values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 2021, __pyx_L3_error)
      values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 2021, __pyx_L3_error)
      values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 2021, __pyx_L3_error)
      values[14] = __Pyx_ArgRef_FASTCALL(__pyx_args, 14);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 2021, __pyx_L3_error)
      values[15] = __Pyx_ArgRef_FASTCALL(__pyx_args, 15);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 2021, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2022, __pyx_L3_error)
    __pyx_v_transA = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_transA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2022, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2022, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyLong_As_int(values[3]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2022, __pyx_L3_error)
    __pyx_v_k = __Pyx_PyLong_As_int(values[4]); if (unlikely((__pyx_v_k == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2022, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyLong_As_int(values[5]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2022, __pyx_L3_error)
    __pyx_v_alpha = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_alpha == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2023, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2023, __pyx_L3_error)
    __pyx_v_csrSortedValA = __Pyx_PyLong_As_size_t(values[8]); if (unlikely((__pyx_v_csrSortedValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2023, __pyx_L3_error)
    __pyx_v_csrSortedRowPtrA = __Pyx_PyLong_As_size_t(values[9]); if (unlikely((__pyx_v_csrSortedRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2024, __pyx_L3_error)
    __pyx_v_csrSortedColIndA = __Pyx_PyLong_As_size_t(values[10]); if (unlikely((__pyx_v_csrSortedColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2024, __pyx_L3_error)
    __pyx_v_B = __Pyx_PyLong_As_size_t(values[11]); if (unlikely((__pyx_v_B == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2025, __pyx_L3_error)
    __pyx_v_ldb = __Pyx_PyLong_As_int(values[12]); if (unlikely((__pyx_v_ldb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2025, __pyx_L3_error)
    __pyx_v_beta = __Pyx_PyLong_As_size_t(values[13]); if (unlikely((__pyx_v_beta == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2025, __pyx_L3_error)
    __pyx_v_C = __Pyx_PyLong_As_size_t(values[14]); if (unlikely((__pyx_v_C == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2025, __pyx_L3_error)
    __pyx_v_ldc = __Pyx_PyLong_As_int(values[15]); if (unlikely((__pyx_v_ldc == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2025, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("zcsrmm", 1, 16, 16, __pyx_nargs); __PYX_ERR(0, 2021, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.zcsrmm", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_86zcsrmm(__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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_86zcsrmm(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2021, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2021, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":2036
 *     check_status(status)
 * 
 * cpdef void scsrmm2(             # <<<<<<<<<<<<<<
 *         intptr_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_13cupy_backends_4cuda_4libs_8cusparse_89scsrmm2(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_scsrmm2(intptr_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;
  __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_backends/cuda/libs/cusparse.pyx":2041
 *         size_t csrRowPtrA, size_t csrColIndA,
 *         size_t B, int ldb, size_t beta, size_t C, int ldc) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     status = cusparseScsrmm2(
 *         <Handle>handle, <Operation>transA, <Operation>transB, m, n, k, nnz,
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2041, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":2042
 *         size_t B, int ldb, size_t beta, size_t C, int ldc) except *:
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":2047
 *         <const int *>csrRowPtrA, <const int *>csrColIndA,
 *         <const float *>B, ldb, <const float *>beta, <float *>C, ldc)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef void dcsrmm2(
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2047, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":2036
 *     check_status(status)
 * 
 * cpdef void scsrmm2(             # <<<<<<<<<<<<<<
 *         intptr_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 */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.scsrmm2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_89scsrmm2(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_88scsrmm2, "scsrmm2(intptr_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) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_89scsrmm2(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[17] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("scsrmm2 (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_transA,&__pyx_mstate_global->__pyx_n_u_transB,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_n,&__pyx_mstate_global->__pyx_n_u_k,&__pyx_mstate_global->__pyx_n_u_nnz,&__pyx_mstate_global->__pyx_n_u_alpha,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_csrValA,&__pyx_mstate_global->__pyx_n_u_csrRowPtrA,&__pyx_mstate_global->__pyx_n_u_csrColIndA,&__pyx_mstate_global->__pyx_n_u_B,&__pyx_mstate_global->__pyx_n_u_ldb,&__pyx_mstate_global->__pyx_n_u_beta,&__pyx_mstate_global->__pyx_n_u_C,&__pyx_mstate_global->__pyx_n_u_ldc,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 2036, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 17:
        values[16] = __Pyx_ArgRef_FASTCALL(__pyx_args, 16);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[16])) __PYX_ERR(0, 2036, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 16:
        values[15] = __Pyx_ArgRef_FASTCALL(__pyx_args, 15);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 2036, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 15:
        values[14] = __Pyx_ArgRef_FASTCALL(__pyx_args, 14);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 2036, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 14:
        values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 2036, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 13:
        values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 2036, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 12:
        values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 2036, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 11:
        values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 2036, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 2036, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 2036, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 2036, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 2036, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 2036, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 2036, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2036, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2036, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2036, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2036, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "scsrmm2", 0) < (0)) __PYX_ERR(0, 2036, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 17; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("scsrmm2", 1, 17, 17, i); __PYX_ERR(0, 2036, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 17)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2036, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2036, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2036, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2036, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 2036, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 2036, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 2036, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 2036, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 2036, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 2036, __pyx_L3_error)
      values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 2036, __pyx_L3_error)
      values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 2036, __pyx_L3_error)
      values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 2036, __pyx_L3_error)
      values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 2036, __pyx_L3_error)
      values[14] = __Pyx_ArgRef_FASTCALL(__pyx_args, 14);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 2036, __pyx_L3_error)
      values[15] = __Pyx_ArgRef_FASTCALL(__pyx_args, 15);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 2036, __pyx_L3_error)
      values[16] = __Pyx_ArgRef_FASTCALL(__pyx_args, 16);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[16])) __PYX_ERR(0, 2036, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2037, __pyx_L3_error)
    __pyx_v_transA = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_transA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2037, __pyx_L3_error)
    __pyx_v_transB = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_transB == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2037, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[3]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2037, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyLong_As_int(values[4]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2037, __pyx_L3_error)
    __pyx_v_k = __Pyx_PyLong_As_int(values[5]); if (unlikely((__pyx_v_k == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2037, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyLong_As_int(values[6]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2037, __pyx_L3_error)
    __pyx_v_alpha = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_alpha == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2038, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[8]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2038, __pyx_L3_error)
    __pyx_v_csrValA = __Pyx_PyLong_As_size_t(values[9]); if (unlikely((__pyx_v_csrValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2038, __pyx_L3_error)
    __pyx_v_csrRowPtrA = __Pyx_PyLong_As_size_t(values[10]); if (unlikely((__pyx_v_csrRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2039, __pyx_L3_error)
    __pyx_v_csrColIndA = __Pyx_PyLong_As_size_t(values[11]); if (unlikely((__pyx_v_csrColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2039, __pyx_L3_error)
    __pyx_v_B = __Pyx_PyLong_As_size_t(values[12]); if (unlikely((__pyx_v_B == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2040, __pyx_L3_error)
    __pyx_v_ldb = __Pyx_PyLong_As_int(values[13]); if (unlikely((__pyx_v_ldb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2040, __pyx_L3_error)
    __pyx_v_beta = __Pyx_PyLong_As_size_t(values[14]); if (unlikely((__pyx_v_beta == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2040, __pyx_L3_error)
    __pyx_v_C = __Pyx_PyLong_As_size_t(values[15]); if (unlikely((__pyx_v_C == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2040, __pyx_L3_error)
    __pyx_v_ldc = __Pyx_PyLong_As_int(values[16]); if (unlikely((__pyx_v_ldc == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2040, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("scsrmm2", 1, 17, 17, __pyx_nargs); __PYX_ERR(0, 2036, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.scsrmm2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_88scsrmm2(__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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_88scsrmm2(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2036, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2036, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":2049
 *     check_status(status)
 * 
 * cpdef void dcsrmm2(             # <<<<<<<<<<<<<<
 *         intptr_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_13cupy_backends_4cuda_4libs_8cusparse_91dcsrmm2(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_dcsrmm2(intptr_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;
  __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_backends/cuda/libs/cusparse.pyx":2054
 *         size_t csrRowPtrA, size_t csrColIndA,
 *         size_t B, int ldb, size_t beta, size_t C, int ldc) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     status = cusparseDcsrmm2(
 *         <Handle>handle, <Operation>transA, <Operation>transB, m, n, k, nnz,
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2054, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":2055
 *         size_t B, int ldb, size_t beta, size_t C, int ldc) except *:
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":2060
 *         <const int *>csrRowPtrA, <const int *>csrColIndA,
 *         <const double *>B, ldb, <const double *>beta, <double *>C, ldc)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef void ccsrmm2(
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2060, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":2049
 *     check_status(status)
 * 
 * cpdef void dcsrmm2(             # <<<<<<<<<<<<<<
 *         intptr_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 */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.dcsrmm2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_91dcsrmm2(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_90dcsrmm2, "dcsrmm2(intptr_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) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_91dcsrmm2(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[17] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dcsrmm2 (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_transA,&__pyx_mstate_global->__pyx_n_u_transB,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_n,&__pyx_mstate_global->__pyx_n_u_k,&__pyx_mstate_global->__pyx_n_u_nnz,&__pyx_mstate_global->__pyx_n_u_alpha,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_csrValA,&__pyx_mstate_global->__pyx_n_u_csrRowPtrA,&__pyx_mstate_global->__pyx_n_u_csrColIndA,&__pyx_mstate_global->__pyx_n_u_B,&__pyx_mstate_global->__pyx_n_u_ldb,&__pyx_mstate_global->__pyx_n_u_beta,&__pyx_mstate_global->__pyx_n_u_C,&__pyx_mstate_global->__pyx_n_u_ldc,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 2049, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 17:
        values[16] = __Pyx_ArgRef_FASTCALL(__pyx_args, 16);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[16])) __PYX_ERR(0, 2049, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 16:
        values[15] = __Pyx_ArgRef_FASTCALL(__pyx_args, 15);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 2049, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 15:
        values[14] = __Pyx_ArgRef_FASTCALL(__pyx_args, 14);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 2049, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 14:
        values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 2049, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 13:
        values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 2049, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 12:
        values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 2049, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 11:
        values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 2049, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 2049, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 2049, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 2049, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 2049, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 2049, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 2049, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2049, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2049, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2049, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2049, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "dcsrmm2", 0) < (0)) __PYX_ERR(0, 2049, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 17; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("dcsrmm2", 1, 17, 17, i); __PYX_ERR(0, 2049, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 17)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2049, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2049, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2049, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2049, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 2049, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 2049, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 2049, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 2049, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 2049, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 2049, __pyx_L3_error)
      values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 2049, __pyx_L3_error)
      values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 2049, __pyx_L3_error)
      values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 2049, __pyx_L3_error)
      values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 2049, __pyx_L3_error)
      values[14] = __Pyx_ArgRef_FASTCALL(__pyx_args, 14);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 2049, __pyx_L3_error)
      values[15] = __Pyx_ArgRef_FASTCALL(__pyx_args, 15);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 2049, __pyx_L3_error)
      values[16] = __Pyx_ArgRef_FASTCALL(__pyx_args, 16);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[16])) __PYX_ERR(0, 2049, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2050, __pyx_L3_error)
    __pyx_v_transA = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_transA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2050, __pyx_L3_error)
    __pyx_v_transB = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_transB == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2050, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[3]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2050, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyLong_As_int(values[4]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2050, __pyx_L3_error)
    __pyx_v_k = __Pyx_PyLong_As_int(values[5]); if (unlikely((__pyx_v_k == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2050, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyLong_As_int(values[6]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2050, __pyx_L3_error)
    __pyx_v_alpha = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_alpha == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2051, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[8]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2051, __pyx_L3_error)
    __pyx_v_csrValA = __Pyx_PyLong_As_size_t(values[9]); if (unlikely((__pyx_v_csrValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2051, __pyx_L3_error)
    __pyx_v_csrRowPtrA = __Pyx_PyLong_As_size_t(values[10]); if (unlikely((__pyx_v_csrRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2052, __pyx_L3_error)
    __pyx_v_csrColIndA = __Pyx_PyLong_As_size_t(values[11]); if (unlikely((__pyx_v_csrColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2052, __pyx_L3_error)
    __pyx_v_B = __Pyx_PyLong_As_size_t(values[12]); if (unlikely((__pyx_v_B == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2053, __pyx_L3_error)
    __pyx_v_ldb = __Pyx_PyLong_As_int(values[13]); if (unlikely((__pyx_v_ldb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2053, __pyx_L3_error)
    __pyx_v_beta = __Pyx_PyLong_As_size_t(values[14]); if (unlikely((__pyx_v_beta == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2053, __pyx_L3_error)
    __pyx_v_C = __Pyx_PyLong_As_size_t(values[15]); if (unlikely((__pyx_v_C == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2053, __pyx_L3_error)
    __pyx_v_ldc = __Pyx_PyLong_As_int(values[16]); if (unlikely((__pyx_v_ldc == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2053, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("dcsrmm2", 1, 17, 17, __pyx_nargs); __PYX_ERR(0, 2049, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.dcsrmm2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_90dcsrmm2(__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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_90dcsrmm2(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2049, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2049, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":2062
 *     check_status(status)
 * 
 * cpdef void ccsrmm2(             # <<<<<<<<<<<<<<
 *         intptr_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_13cupy_backends_4cuda_4libs_8cusparse_93ccsrmm2(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_ccsrmm2(intptr_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;
  __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_backends/cuda/libs/cusparse.pyx":2067
 *         size_t csrRowPtrA, size_t csrColIndA,
 *         size_t B, int ldb, size_t beta, size_t C, int ldc) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     status = cusparseCcsrmm2(
 *         <Handle>handle, <Operation>transA, <Operation>transB, m, n, k, nnz,
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2067, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":2068
 *         size_t B, int ldb, size_t beta, size_t C, int ldc) except *:
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":2074
 *         <const cuComplex *>B, ldb, <const cuComplex *>beta,
 *         <cuComplex *>C, ldc)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef void zcsrmm2(
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2074, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":2062
 *     check_status(status)
 * 
 * cpdef void ccsrmm2(             # <<<<<<<<<<<<<<
 *         intptr_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 */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.ccsrmm2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_93ccsrmm2(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_92ccsrmm2, "ccsrmm2(intptr_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) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_93ccsrmm2(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[17] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ccsrmm2 (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_transA,&__pyx_mstate_global->__pyx_n_u_transB,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_n,&__pyx_mstate_global->__pyx_n_u_k,&__pyx_mstate_global->__pyx_n_u_nnz,&__pyx_mstate_global->__pyx_n_u_alpha,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_csrValA,&__pyx_mstate_global->__pyx_n_u_csrRowPtrA,&__pyx_mstate_global->__pyx_n_u_csrColIndA,&__pyx_mstate_global->__pyx_n_u_B,&__pyx_mstate_global->__pyx_n_u_ldb,&__pyx_mstate_global->__pyx_n_u_beta,&__pyx_mstate_global->__pyx_n_u_C,&__pyx_mstate_global->__pyx_n_u_ldc,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 2062, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 17:
        values[16] = __Pyx_ArgRef_FASTCALL(__pyx_args, 16);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[16])) __PYX_ERR(0, 2062, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 16:
        values[15] = __Pyx_ArgRef_FASTCALL(__pyx_args, 15);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 2062, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 15:
        values[14] = __Pyx_ArgRef_FASTCALL(__pyx_args, 14);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 2062, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 14:
        values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 2062, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 13:
        values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 2062, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 12:
        values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 2062, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 11:
        values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 2062, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 2062, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 2062, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 2062, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 2062, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 2062, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 2062, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2062, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2062, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2062, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2062, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "ccsrmm2", 0) < (0)) __PYX_ERR(0, 2062, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 17; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("ccsrmm2", 1, 17, 17, i); __PYX_ERR(0, 2062, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 17)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2062, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2062, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2062, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2062, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 2062, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 2062, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 2062, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 2062, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 2062, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 2062, __pyx_L3_error)
      values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 2062, __pyx_L3_error)
      values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 2062, __pyx_L3_error)
      values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 2062, __pyx_L3_error)
      values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 2062, __pyx_L3_error)
      values[14] = __Pyx_ArgRef_FASTCALL(__pyx_args, 14);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 2062, __pyx_L3_error)
      values[15] = __Pyx_ArgRef_FASTCALL(__pyx_args, 15);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 2062, __pyx_L3_error)
      values[16] = __Pyx_ArgRef_FASTCALL(__pyx_args, 16);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[16])) __PYX_ERR(0, 2062, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2063, __pyx_L3_error)
    __pyx_v_transA = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_transA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2063, __pyx_L3_error)
    __pyx_v_transB = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_transB == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2063, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[3]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2063, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyLong_As_int(values[4]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2063, __pyx_L3_error)
    __pyx_v_k = __Pyx_PyLong_As_int(values[5]); if (unlikely((__pyx_v_k == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2063, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyLong_As_int(values[6]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2063, __pyx_L3_error)
    __pyx_v_alpha = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_alpha == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2064, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[8]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2064, __pyx_L3_error)
    __pyx_v_csrValA = __Pyx_PyLong_As_size_t(values[9]); if (unlikely((__pyx_v_csrValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2064, __pyx_L3_error)
    __pyx_v_csrRowPtrA = __Pyx_PyLong_As_size_t(values[10]); if (unlikely((__pyx_v_csrRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2065, __pyx_L3_error)
    __pyx_v_csrColIndA = __Pyx_PyLong_As_size_t(values[11]); if (unlikely((__pyx_v_csrColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2065, __pyx_L3_error)
    __pyx_v_B = __Pyx_PyLong_As_size_t(values[12]); if (unlikely((__pyx_v_B == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2066, __pyx_L3_error)
    __pyx_v_ldb = __Pyx_PyLong_As_int(values[13]); if (unlikely((__pyx_v_ldb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2066, __pyx_L3_error)
    __pyx_v_beta = __Pyx_PyLong_As_size_t(values[14]); if (unlikely((__pyx_v_beta == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2066, __pyx_L3_error)
    __pyx_v_C = __Pyx_PyLong_As_size_t(values[15]); if (unlikely((__pyx_v_C == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2066, __pyx_L3_error)
    __pyx_v_ldc = __Pyx_PyLong_As_int(values[16]); if (unlikely((__pyx_v_ldc == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2066, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ccsrmm2", 1, 17, 17, __pyx_nargs); __PYX_ERR(0, 2062, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.ccsrmm2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_92ccsrmm2(__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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_92ccsrmm2(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2062, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2062, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":2076
 *     check_status(status)
 * 
 * cpdef void zcsrmm2(             # <<<<<<<<<<<<<<
 *         intptr_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_13cupy_backends_4cuda_4libs_8cusparse_95zcsrmm2(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_zcsrmm2(intptr_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;
  __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_backends/cuda/libs/cusparse.pyx":2081
 *         size_t csrRowPtrA, size_t csrColIndA,
 *         size_t B, int ldb, size_t beta, size_t C, int ldc) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     status = cusparseZcsrmm2(
 *         <Handle>handle, <Operation>transA, <Operation>transB, m, n, k, nnz,
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2081, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":2082
 *         size_t B, int ldb, size_t beta, size_t C, int ldc) except *:
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":2089
 *         <const cuDoubleComplex *>B, ldb,
 *         <const cuDoubleComplex *>beta, <cuDoubleComplex *>C, ldc)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef size_t createCsrsm2Info() except? -1:
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2089, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":2076
 *     check_status(status)
 * 
 * cpdef void zcsrmm2(             # <<<<<<<<<<<<<<
 *         intptr_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 */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.zcsrmm2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_95zcsrmm2(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_94zcsrmm2, "zcsrmm2(intptr_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) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_95zcsrmm2(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[17] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("zcsrmm2 (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_transA,&__pyx_mstate_global->__pyx_n_u_transB,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_n,&__pyx_mstate_global->__pyx_n_u_k,&__pyx_mstate_global->__pyx_n_u_nnz,&__pyx_mstate_global->__pyx_n_u_alpha,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_csrValA,&__pyx_mstate_global->__pyx_n_u_csrRowPtrA,&__pyx_mstate_global->__pyx_n_u_csrColIndA,&__pyx_mstate_global->__pyx_n_u_B,&__pyx_mstate_global->__pyx_n_u_ldb,&__pyx_mstate_global->__pyx_n_u_beta,&__pyx_mstate_global->__pyx_n_u_C,&__pyx_mstate_global->__pyx_n_u_ldc,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 2076, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 17:
        values[16] = __Pyx_ArgRef_FASTCALL(__pyx_args, 16);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[16])) __PYX_ERR(0, 2076, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 16:
        values[15] = __Pyx_ArgRef_FASTCALL(__pyx_args, 15);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 2076, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 15:
        values[14] = __Pyx_ArgRef_FASTCALL(__pyx_args, 14);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 2076, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 14:
        values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 2076, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 13:
        values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 2076, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 12:
        values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 2076, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 11:
        values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 2076, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 2076, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 2076, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 2076, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 2076, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 2076, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 2076, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2076, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2076, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2076, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2076, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "zcsrmm2", 0) < (0)) __PYX_ERR(0, 2076, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 17; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("zcsrmm2", 1, 17, 17, i); __PYX_ERR(0, 2076, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 17)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2076, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2076, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2076, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2076, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 2076, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 2076, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 2076, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 2076, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 2076, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 2076, __pyx_L3_error)
      values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 2076, __pyx_L3_error)
      values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 2076, __pyx_L3_error)
      values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 2076, __pyx_L3_error)
      values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 2076, __pyx_L3_error)
      values[14] = __Pyx_ArgRef_FASTCALL(__pyx_args, 14);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 2076, __pyx_L3_error)
      values[15] = __Pyx_ArgRef_FASTCALL(__pyx_args, 15);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 2076, __pyx_L3_error)
      values[16] = __Pyx_ArgRef_FASTCALL(__pyx_args, 16);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[16])) __PYX_ERR(0, 2076, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2077, __pyx_L3_error)
    __pyx_v_transA = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_transA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2077, __pyx_L3_error)
    __pyx_v_transB = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_transB == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2077, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[3]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2077, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyLong_As_int(values[4]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2077, __pyx_L3_error)
    __pyx_v_k = __Pyx_PyLong_As_int(values[5]); if (unlikely((__pyx_v_k == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2077, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyLong_As_int(values[6]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2077, __pyx_L3_error)
    __pyx_v_alpha = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_alpha == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2078, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[8]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2078, __pyx_L3_error)
    __pyx_v_csrValA = __Pyx_PyLong_As_size_t(values[9]); if (unlikely((__pyx_v_csrValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2078, __pyx_L3_error)
    __pyx_v_csrRowPtrA = __Pyx_PyLong_As_size_t(values[10]); if (unlikely((__pyx_v_csrRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2079, __pyx_L3_error)
    __pyx_v_csrColIndA = __Pyx_PyLong_As_size_t(values[11]); if (unlikely((__pyx_v_csrColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2079, __pyx_L3_error)
    __pyx_v_B = __Pyx_PyLong_As_size_t(values[12]); if (unlikely((__pyx_v_B == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2080, __pyx_L3_error)
    __pyx_v_ldb = __Pyx_PyLong_As_int(values[13]); if (unlikely((__pyx_v_ldb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2080, __pyx_L3_error)
    __pyx_v_beta = __Pyx_PyLong_As_size_t(values[14]); if (unlikely((__pyx_v_beta == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2080, __pyx_L3_error)
    __pyx_v_C = __Pyx_PyLong_As_size_t(values[15]); if (unlikely((__pyx_v_C == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2080, __pyx_L3_error)
    __pyx_v_ldc = __Pyx_PyLong_As_int(values[16]); if (unlikely((__pyx_v_ldc == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2080, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("zcsrmm2", 1, 17, 17, __pyx_nargs); __PYX_ERR(0, 2076, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.zcsrmm2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_94zcsrmm2(__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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_94zcsrmm2(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2076, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2076, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":2091
 *     check_status(status)
 * 
 * cpdef size_t createCsrsm2Info() except? -1:             # <<<<<<<<<<<<<<
 *     cdef csrsm2Info_t info
 *     status = cusparseCreateCsrsm2Info(&info)
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_97createCsrsm2Info(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static size_t __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_createCsrsm2Info(CYTHON_UNUSED int __pyx_skip_dispatch) {
  csrsm2Info_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("createCsrsm2Info", 0);

  /* "cupy_backends/cuda/libs/cusparse.pyx":2093
 * cpdef size_t createCsrsm2Info() except? -1:
 *     cdef csrsm2Info_t info
 *     status = cusparseCreateCsrsm2Info(&info)             # <<<<<<<<<<<<<<
 *     check_status(status)
 *     return <size_t>info
*/
  __pyx_v_status = cusparseCreateCsrsm2Info((&__pyx_v_info));

  /* "cupy_backends/cuda/libs/cusparse.pyx":2094
 *     cdef csrsm2Info_t info
 *     status = cusparseCreateCsrsm2Info(&info)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return <size_t>info
 * 
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2094, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":2095
 *     status = cusparseCreateCsrsm2Info(&info)
 *     check_status(status)
 *     return <size_t>info             # <<<<<<<<<<<<<<
 * 
 * cpdef void destroyCsrsm2Info(size_t info) except *:
*/
  __pyx_r = ((size_t)__pyx_v_info);
  goto __pyx_L0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":2091
 *     check_status(status)
 * 
 * cpdef size_t createCsrsm2Info() except? -1:             # <<<<<<<<<<<<<<
 *     cdef csrsm2Info_t info
 *     status = cusparseCreateCsrsm2Info(&info)
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.createCsrsm2Info", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1L;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_97createCsrsm2Info(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_96createCsrsm2Info, "createCsrsm2Info() -> size_t");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_97createCsrsm2Info(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("createCsrsm2Info (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_96createCsrsm2Info(__pyx_self);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_96createCsrsm2Info(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("createCsrsm2Info", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_createCsrsm2Info(1); if (unlikely(__pyx_t_1 == ((size_t)-1L) && PyErr_Occurred())) __PYX_ERR(0, 2091, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyLong_FromSize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2091, __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_backends.cuda.libs.cusparse.createCsrsm2Info", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy_backends/cuda/libs/cusparse.pyx":2097
 *     return <size_t>info
 * 
 * cpdef void destroyCsrsm2Info(size_t info) except *:             # <<<<<<<<<<<<<<
 *     status = cusparseDestroyCsrsm2Info(<csrsm2Info_t>info)
 *     check_status(status)
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_99destroyCsrsm2Info(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_destroyCsrsm2Info(size_t __pyx_v_info, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("destroyCsrsm2Info", 0);

  /* "cupy_backends/cuda/libs/cusparse.pyx":2098
 * 
 * cpdef void destroyCsrsm2Info(size_t info) except *:
 *     status = cusparseDestroyCsrsm2Info(<csrsm2Info_t>info)             # <<<<<<<<<<<<<<
 *     check_status(status)
 * 
*/
  __pyx_v_status = cusparseDestroyCsrsm2Info(((csrsm2Info_t)__pyx_v_info));

  /* "cupy_backends/cuda/libs/cusparse.pyx":2099
 * cpdef void destroyCsrsm2Info(size_t info) except *:
 *     status = cusparseDestroyCsrsm2Info(<csrsm2Info_t>info)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef size_t scsrsm2_bufferSizeExt(
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2099, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":2097
 *     return <size_t>info
 * 
 * cpdef void destroyCsrsm2Info(size_t info) except *:             # <<<<<<<<<<<<<<
 *     status = cusparseDestroyCsrsm2Info(<csrsm2Info_t>info)
 *     check_status(status)
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.destroyCsrsm2Info", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_99destroyCsrsm2Info(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_98destroyCsrsm2Info, "destroyCsrsm2Info(size_t info) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_99destroyCsrsm2Info(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  size_t __pyx_v_info;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("destroyCsrsm2Info (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_info,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 2097, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2097, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "destroyCsrsm2Info", 0) < (0)) __PYX_ERR(0, 2097, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("destroyCsrsm2Info", 1, 1, 1, i); __PYX_ERR(0, 2097, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2097, __pyx_L3_error)
    }
    __pyx_v_info = __Pyx_PyLong_As_size_t(values[0]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2097, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("destroyCsrsm2Info", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2097, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.destroyCsrsm2Info", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_98destroyCsrsm2Info(__pyx_self, __pyx_v_info);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_98destroyCsrsm2Info(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("destroyCsrsm2Info", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_destroyCsrsm2Info(__pyx_v_info, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2097, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2097, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":2101
 *     check_status(status)
 * 
 * cpdef size_t scsrsm2_bufferSizeExt(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int algo, int transA, int transB, int m, int nrhs,
 *         int nnz, size_t alpha, size_t descrA, size_t csrSortedValA,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_101scsrsm2_bufferSizeExt(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static size_t __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_scsrsm2_bufferSizeExt(intptr_t __pyx_v_handle, int __pyx_v_algo, int __pyx_v_transA, int __pyx_v_transB, int __pyx_v_m, int __pyx_v_nrhs, 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_info, int __pyx_v_policy, 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("scsrsm2_bufferSizeExt", 0);

  /* "cupy_backends/cuda/libs/cusparse.pyx":2107
 *         size_t info, int policy) except? -1:
 *     cdef size_t bufferSize
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     status = cusparseScsrsm2_bufferSizeExt(
 *         <Handle>handle, algo, <Operation>transA, <Operation>transB, m, nrhs,
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2107, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":2108
 *     cdef size_t bufferSize
 *     _setStream(handle)
 *     status = cusparseScsrsm2_bufferSizeExt(             # <<<<<<<<<<<<<<
 *         <Handle>handle, algo, <Operation>transA, <Operation>transB, m, nrhs,
 *         nnz, <const float*>alpha, <const MatDescr>descrA,
*/
  __pyx_v_status = cusparseScsrsm2_bufferSizeExt(((cusparseHandle_t)__pyx_v_handle), __pyx_v_algo, ((cusparseOperation_t)__pyx_v_transA), ((cusparseOperation_t)__pyx_v_transB), __pyx_v_m, __pyx_v_nrhs, __pyx_v_nnz, ((float const *)__pyx_v_alpha), ((cusparseMatDescr_t const )__pyx_v_descrA), ((float const *)__pyx_v_csrSortedValA), ((int const *)__pyx_v_csrSortedRowPtrA), ((int const *)__pyx_v_csrSortedColIndA), ((float *)__pyx_v_B), __pyx_v_ldb, ((csrsm2Info_t)__pyx_v_info), ((cusparseSolvePolicy_t)__pyx_v_policy), (&__pyx_v_bufferSize));

  /* "cupy_backends/cuda/libs/cusparse.pyx":2114
 *         <const int*>csrSortedColIndA, <float*>B, ldb,
 *         <csrsm2Info_t>info, <cusparseSolvePolicy_t>policy, &bufferSize)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return bufferSize
 * 
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2114, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":2115
 *         <csrsm2Info_t>info, <cusparseSolvePolicy_t>policy, &bufferSize)
 *     check_status(status)
 *     return bufferSize             # <<<<<<<<<<<<<<
 * 
 * cpdef size_t dcsrsm2_bufferSizeExt(
*/
  __pyx_r = __pyx_v_bufferSize;
  goto __pyx_L0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":2101
 *     check_status(status)
 * 
 * cpdef size_t scsrsm2_bufferSizeExt(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int algo, int transA, int transB, int m, int nrhs,
 *         int nnz, size_t alpha, size_t descrA, size_t csrSortedValA,
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.scsrsm2_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1L;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_101scsrsm2_bufferSizeExt(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_100scsrsm2_bufferSizeExt, "scsrsm2_bufferSizeExt(intptr_t handle, int algo, int transA, int transB, int m, int nrhs, int nnz, size_t alpha, size_t descrA, size_t csrSortedValA, size_t csrSortedRowPtrA, size_t csrSortedColIndA, size_t B, int ldb, size_t info, int policy) -> size_t");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_101scsrsm2_bufferSizeExt(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_t __pyx_v_handle;
  int __pyx_v_algo;
  int __pyx_v_transA;
  int __pyx_v_transB;
  int __pyx_v_m;
  int __pyx_v_nrhs;
  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_info;
  int __pyx_v_policy;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[16] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("scsrsm2_bufferSizeExt (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_algo,&__pyx_mstate_global->__pyx_n_u_transA,&__pyx_mstate_global->__pyx_n_u_transB,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_nrhs,&__pyx_mstate_global->__pyx_n_u_nnz,&__pyx_mstate_global->__pyx_n_u_alpha,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_csrSortedValA,&__pyx_mstate_global->__pyx_n_u_csrSortedRowPtrA,&__pyx_mstate_global->__pyx_n_u_csrSortedColIndA,&__pyx_mstate_global->__pyx_n_u_B,&__pyx_mstate_global->__pyx_n_u_ldb,&__pyx_mstate_global->__pyx_n_u_info,&__pyx_mstate_global->__pyx_n_u_policy,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 2101, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 16:
        values[15] = __Pyx_ArgRef_FASTCALL(__pyx_args, 15);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 2101, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 15:
        values[14] = __Pyx_ArgRef_FASTCALL(__pyx_args, 14);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 2101, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 14:
        values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 2101, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 13:
        values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 2101, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 12:
        values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 2101, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 11:
        values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 2101, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 2101, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 2101, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 2101, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 2101, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 2101, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 2101, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2101, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2101, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2101, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2101, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "scsrsm2_bufferSizeExt", 0) < (0)) __PYX_ERR(0, 2101, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 16; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("scsrsm2_bufferSizeExt", 1, 16, 16, i); __PYX_ERR(0, 2101, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 16)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2101, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2101, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2101, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2101, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 2101, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 2101, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 2101, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 2101, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 2101, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 2101, __pyx_L3_error)
      values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 2101, __pyx_L3_error)
      values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 2101, __pyx_L3_error)
      values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 2101, __pyx_L3_error)
      values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 2101, __pyx_L3_error)
      values[14] = __Pyx_ArgRef_FASTCALL(__pyx_args, 14);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 2101, __pyx_L3_error)
      values[15] = __Pyx_ArgRef_FASTCALL(__pyx_args, 15);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 2101, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2102, __pyx_L3_error)
    __pyx_v_algo = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_algo == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2102, __pyx_L3_error)
    __pyx_v_transA = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_transA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2102, __pyx_L3_error)
    __pyx_v_transB = __Pyx_PyLong_As_int(values[3]); if (unlikely((__pyx_v_transB == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2102, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[4]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2102, __pyx_L3_error)
    __pyx_v_nrhs = __Pyx_PyLong_As_int(values[5]); if (unlikely((__pyx_v_nrhs == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2102, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyLong_As_int(values[6]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2103, __pyx_L3_error)
    __pyx_v_alpha = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_alpha == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2103, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[8]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2103, __pyx_L3_error)
    __pyx_v_csrSortedValA = __Pyx_PyLong_As_size_t(values[9]); if (unlikely((__pyx_v_csrSortedValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2103, __pyx_L3_error)
    __pyx_v_csrSortedRowPtrA = __Pyx_PyLong_As_size_t(values[10]); if (unlikely((__pyx_v_csrSortedRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2104, __pyx_L3_error)
    __pyx_v_csrSortedColIndA = __Pyx_PyLong_As_size_t(values[11]); if (unlikely((__pyx_v_csrSortedColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2104, __pyx_L3_error)
    __pyx_v_B = __Pyx_PyLong_As_size_t(values[12]); if (unlikely((__pyx_v_B == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2104, __pyx_L3_error)
    __pyx_v_ldb = __Pyx_PyLong_As_int(values[13]); if (unlikely((__pyx_v_ldb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2104, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyLong_As_size_t(values[14]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2105, __pyx_L3_error)
    __pyx_v_policy = __Pyx_PyLong_As_int(values[15]); if (unlikely((__pyx_v_policy == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2105, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("scsrsm2_bufferSizeExt", 1, 16, 16, __pyx_nargs); __PYX_ERR(0, 2101, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.scsrsm2_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_100scsrsm2_bufferSizeExt(__pyx_self, __pyx_v_handle, __pyx_v_algo, __pyx_v_transA, __pyx_v_transB, __pyx_v_m, __pyx_v_nrhs, __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_info, __pyx_v_policy);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_100scsrsm2_bufferSizeExt(CYTHON_UNUSED PyObject *__pyx_self, intptr_t __pyx_v_handle, int __pyx_v_algo, int __pyx_v_transA, int __pyx_v_transB, int __pyx_v_m, int __pyx_v_nrhs, 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_info, int __pyx_v_policy) {
  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("scsrsm2_bufferSizeExt", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_scsrsm2_bufferSizeExt(__pyx_v_handle, __pyx_v_algo, __pyx_v_transA, __pyx_v_transB, __pyx_v_m, __pyx_v_nrhs, __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_info, __pyx_v_policy, 1); if (unlikely(__pyx_t_1 == ((size_t)-1L) && PyErr_Occurred())) __PYX_ERR(0, 2101, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyLong_FromSize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2101, __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_backends.cuda.libs.cusparse.scsrsm2_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy_backends/cuda/libs/cusparse.pyx":2117
 *     return bufferSize
 * 
 * cpdef size_t dcsrsm2_bufferSizeExt(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int algo, int transA, int transB, int m, int nrhs,
 *         int nnz, size_t alpha, size_t descrA, size_t csrSortedValA,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_103dcsrsm2_bufferSizeExt(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static size_t __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_dcsrsm2_bufferSizeExt(intptr_t __pyx_v_handle, int __pyx_v_algo, int __pyx_v_transA, int __pyx_v_transB, int __pyx_v_m, int __pyx_v_nrhs, 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_info, int __pyx_v_policy, 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("dcsrsm2_bufferSizeExt", 0);

  /* "cupy_backends/cuda/libs/cusparse.pyx":2123
 *         size_t info, int policy) except? -1:
 *     cdef size_t bufferSize
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     status = cusparseDcsrsm2_bufferSizeExt(
 *         <Handle>handle, algo, <Operation>transA, <Operation>transB, m, nrhs,
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2123, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":2124
 *     cdef size_t bufferSize
 *     _setStream(handle)
 *     status = cusparseDcsrsm2_bufferSizeExt(             # <<<<<<<<<<<<<<
 *         <Handle>handle, algo, <Operation>transA, <Operation>transB, m, nrhs,
 *         nnz, <const double*>alpha, <const MatDescr>descrA,
*/
  __pyx_v_status = cusparseDcsrsm2_bufferSizeExt(((cusparseHandle_t)__pyx_v_handle), __pyx_v_algo, ((cusparseOperation_t)__pyx_v_transA), ((cusparseOperation_t)__pyx_v_transB), __pyx_v_m, __pyx_v_nrhs, __pyx_v_nnz, ((double const *)__pyx_v_alpha), ((cusparseMatDescr_t const )__pyx_v_descrA), ((double const *)__pyx_v_csrSortedValA), ((int const *)__pyx_v_csrSortedRowPtrA), ((int const *)__pyx_v_csrSortedColIndA), ((double *)__pyx_v_B), __pyx_v_ldb, ((csrsm2Info_t)__pyx_v_info), ((cusparseSolvePolicy_t)__pyx_v_policy), (&__pyx_v_bufferSize));

  /* "cupy_backends/cuda/libs/cusparse.pyx":2130
 *         <const int*>csrSortedColIndA, <double*>B, ldb,
 *         <csrsm2Info_t>info, <cusparseSolvePolicy_t>policy, &bufferSize)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return bufferSize
 * 
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2130, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":2131
 *         <csrsm2Info_t>info, <cusparseSolvePolicy_t>policy, &bufferSize)
 *     check_status(status)
 *     return bufferSize             # <<<<<<<<<<<<<<
 * 
 * cpdef size_t ccsrsm2_bufferSizeExt(
*/
  __pyx_r = __pyx_v_bufferSize;
  goto __pyx_L0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":2117
 *     return bufferSize
 * 
 * cpdef size_t dcsrsm2_bufferSizeExt(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int algo, int transA, int transB, int m, int nrhs,
 *         int nnz, size_t alpha, size_t descrA, size_t csrSortedValA,
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.dcsrsm2_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1L;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_103dcsrsm2_bufferSizeExt(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_102dcsrsm2_bufferSizeExt, "dcsrsm2_bufferSizeExt(intptr_t handle, int algo, int transA, int transB, int m, int nrhs, int nnz, size_t alpha, size_t descrA, size_t csrSortedValA, size_t csrSortedRowPtrA, size_t csrSortedColIndA, size_t B, int ldb, size_t info, int policy) -> size_t");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_103dcsrsm2_bufferSizeExt(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_t __pyx_v_handle;
  int __pyx_v_algo;
  int __pyx_v_transA;
  int __pyx_v_transB;
  int __pyx_v_m;
  int __pyx_v_nrhs;
  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_info;
  int __pyx_v_policy;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[16] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dcsrsm2_bufferSizeExt (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_algo,&__pyx_mstate_global->__pyx_n_u_transA,&__pyx_mstate_global->__pyx_n_u_transB,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_nrhs,&__pyx_mstate_global->__pyx_n_u_nnz,&__pyx_mstate_global->__pyx_n_u_alpha,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_csrSortedValA,&__pyx_mstate_global->__pyx_n_u_csrSortedRowPtrA,&__pyx_mstate_global->__pyx_n_u_csrSortedColIndA,&__pyx_mstate_global->__pyx_n_u_B,&__pyx_mstate_global->__pyx_n_u_ldb,&__pyx_mstate_global->__pyx_n_u_info,&__pyx_mstate_global->__pyx_n_u_policy,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 2117, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 16:
        values[15] = __Pyx_ArgRef_FASTCALL(__pyx_args, 15);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 2117, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 15:
        values[14] = __Pyx_ArgRef_FASTCALL(__pyx_args, 14);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 2117, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 14:
        values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 2117, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 13:
        values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 2117, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 12:
        values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 2117, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 11:
        values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 2117, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 2117, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 2117, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 2117, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 2117, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 2117, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 2117, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2117, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2117, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2117, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2117, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "dcsrsm2_bufferSizeExt", 0) < (0)) __PYX_ERR(0, 2117, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 16; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("dcsrsm2_bufferSizeExt", 1, 16, 16, i); __PYX_ERR(0, 2117, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 16)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2117, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2117, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2117, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2117, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 2117, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 2117, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 2117, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 2117, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 2117, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 2117, __pyx_L3_error)
      values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 2117, __pyx_L3_error)
      values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 2117, __pyx_L3_error)
      values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 2117, __pyx_L3_error)
      values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 2117, __pyx_L3_error)
      values[14] = __Pyx_ArgRef_FASTCALL(__pyx_args, 14);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 2117, __pyx_L3_error)
      values[15] = __Pyx_ArgRef_FASTCALL(__pyx_args, 15);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 2117, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2118, __pyx_L3_error)
    __pyx_v_algo = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_algo == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2118, __pyx_L3_error)
    __pyx_v_transA = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_transA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2118, __pyx_L3_error)
    __pyx_v_transB = __Pyx_PyLong_As_int(values[3]); if (unlikely((__pyx_v_transB == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2118, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[4]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2118, __pyx_L3_error)
    __pyx_v_nrhs = __Pyx_PyLong_As_int(values[5]); if (unlikely((__pyx_v_nrhs == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2118, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyLong_As_int(values[6]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2119, __pyx_L3_error)
    __pyx_v_alpha = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_alpha == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2119, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[8]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2119, __pyx_L3_error)
    __pyx_v_csrSortedValA = __Pyx_PyLong_As_size_t(values[9]); if (unlikely((__pyx_v_csrSortedValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2119, __pyx_L3_error)
    __pyx_v_csrSortedRowPtrA = __Pyx_PyLong_As_size_t(values[10]); if (unlikely((__pyx_v_csrSortedRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2120, __pyx_L3_error)
    __pyx_v_csrSortedColIndA = __Pyx_PyLong_As_size_t(values[11]); if (unlikely((__pyx_v_csrSortedColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2120, __pyx_L3_error)
    __pyx_v_B = __Pyx_PyLong_As_size_t(values[12]); if (unlikely((__pyx_v_B == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2120, __pyx_L3_error)
    __pyx_v_ldb = __Pyx_PyLong_As_int(values[13]); if (unlikely((__pyx_v_ldb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2120, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyLong_As_size_t(values[14]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2121, __pyx_L3_error)
    __pyx_v_policy = __Pyx_PyLong_As_int(values[15]); if (unlikely((__pyx_v_policy == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2121, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("dcsrsm2_bufferSizeExt", 1, 16, 16, __pyx_nargs); __PYX_ERR(0, 2117, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.dcsrsm2_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_102dcsrsm2_bufferSizeExt(__pyx_self, __pyx_v_handle, __pyx_v_algo, __pyx_v_transA, __pyx_v_transB, __pyx_v_m, __pyx_v_nrhs, __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_info, __pyx_v_policy);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_102dcsrsm2_bufferSizeExt(CYTHON_UNUSED PyObject *__pyx_self, intptr_t __pyx_v_handle, int __pyx_v_algo, int __pyx_v_transA, int __pyx_v_transB, int __pyx_v_m, int __pyx_v_nrhs, 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_info, int __pyx_v_policy) {
  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("dcsrsm2_bufferSizeExt", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_dcsrsm2_bufferSizeExt(__pyx_v_handle, __pyx_v_algo, __pyx_v_transA, __pyx_v_transB, __pyx_v_m, __pyx_v_nrhs, __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_info, __pyx_v_policy, 1); if (unlikely(__pyx_t_1 == ((size_t)-1L) && PyErr_Occurred())) __PYX_ERR(0, 2117, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyLong_FromSize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2117, __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_backends.cuda.libs.cusparse.dcsrsm2_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy_backends/cuda/libs/cusparse.pyx":2133
 *     return bufferSize
 * 
 * cpdef size_t ccsrsm2_bufferSizeExt(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int algo, int transA, int transB, int m, int nrhs,
 *         int nnz, size_t alpha, size_t descrA, size_t csrSortedValA,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_105ccsrsm2_bufferSizeExt(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static size_t __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_ccsrsm2_bufferSizeExt(intptr_t __pyx_v_handle, int __pyx_v_algo, int __pyx_v_transA, int __pyx_v_transB, int __pyx_v_m, int __pyx_v_nrhs, 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_info, int __pyx_v_policy, 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("ccsrsm2_bufferSizeExt", 0);

  /* "cupy_backends/cuda/libs/cusparse.pyx":2139
 *         size_t info, int policy) except? -1:
 *     cdef size_t bufferSize
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     status = cusparseCcsrsm2_bufferSizeExt(
 *         <Handle>handle, algo, <Operation>transA, <Operation>transB, m, nrhs,
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2139, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":2140
 *     cdef size_t bufferSize
 *     _setStream(handle)
 *     status = cusparseCcsrsm2_bufferSizeExt(             # <<<<<<<<<<<<<<
 *         <Handle>handle, algo, <Operation>transA, <Operation>transB, m, nrhs,
 *         nnz, <const cuComplex*>alpha, <const MatDescr>descrA,
*/
  __pyx_v_status = cusparseCcsrsm2_bufferSizeExt(((cusparseHandle_t)__pyx_v_handle), __pyx_v_algo, ((cusparseOperation_t)__pyx_v_transA), ((cusparseOperation_t)__pyx_v_transB), __pyx_v_m, __pyx_v_nrhs, __pyx_v_nnz, ((cuComplex const *)__pyx_v_alpha), ((cusparseMatDescr_t const )__pyx_v_descrA), ((cuComplex const *)__pyx_v_csrSortedValA), ((int const *)__pyx_v_csrSortedRowPtrA), ((int const *)__pyx_v_csrSortedColIndA), ((cuComplex *)__pyx_v_B), __pyx_v_ldb, ((csrsm2Info_t)__pyx_v_info), ((cusparseSolvePolicy_t)__pyx_v_policy), (&__pyx_v_bufferSize));

  /* "cupy_backends/cuda/libs/cusparse.pyx":2146
 *         <const int*>csrSortedColIndA, <cuComplex*>B, ldb,
 *         <csrsm2Info_t>info, <cusparseSolvePolicy_t>policy, &bufferSize)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return bufferSize
 * 
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2146, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":2147
 *         <csrsm2Info_t>info, <cusparseSolvePolicy_t>policy, &bufferSize)
 *     check_status(status)
 *     return bufferSize             # <<<<<<<<<<<<<<
 * 
 * cpdef size_t zcsrsm2_bufferSizeExt(
*/
  __pyx_r = __pyx_v_bufferSize;
  goto __pyx_L0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":2133
 *     return bufferSize
 * 
 * cpdef size_t ccsrsm2_bufferSizeExt(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int algo, int transA, int transB, int m, int nrhs,
 *         int nnz, size_t alpha, size_t descrA, size_t csrSortedValA,
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.ccsrsm2_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1L;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_105ccsrsm2_bufferSizeExt(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_104ccsrsm2_bufferSizeExt, "ccsrsm2_bufferSizeExt(intptr_t handle, int algo, int transA, int transB, int m, int nrhs, int nnz, size_t alpha, size_t descrA, size_t csrSortedValA, size_t csrSortedRowPtrA, size_t csrSortedColIndA, size_t B, int ldb, size_t info, int policy) -> size_t");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_105ccsrsm2_bufferSizeExt(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_t __pyx_v_handle;
  int __pyx_v_algo;
  int __pyx_v_transA;
  int __pyx_v_transB;
  int __pyx_v_m;
  int __pyx_v_nrhs;
  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_info;
  int __pyx_v_policy;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[16] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ccsrsm2_bufferSizeExt (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_algo,&__pyx_mstate_global->__pyx_n_u_transA,&__pyx_mstate_global->__pyx_n_u_transB,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_nrhs,&__pyx_mstate_global->__pyx_n_u_nnz,&__pyx_mstate_global->__pyx_n_u_alpha,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_csrSortedValA,&__pyx_mstate_global->__pyx_n_u_csrSortedRowPtrA,&__pyx_mstate_global->__pyx_n_u_csrSortedColIndA,&__pyx_mstate_global->__pyx_n_u_B,&__pyx_mstate_global->__pyx_n_u_ldb,&__pyx_mstate_global->__pyx_n_u_info,&__pyx_mstate_global->__pyx_n_u_policy,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 2133, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 16:
        values[15] = __Pyx_ArgRef_FASTCALL(__pyx_args, 15);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 2133, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 15:
        values[14] = __Pyx_ArgRef_FASTCALL(__pyx_args, 14);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 2133, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 14:
        values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 2133, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 13:
        values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 2133, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 12:
        values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 2133, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 11:
        values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 2133, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 2133, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 2133, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 2133, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 2133, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 2133, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 2133, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2133, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2133, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2133, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2133, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "ccsrsm2_bufferSizeExt", 0) < (0)) __PYX_ERR(0, 2133, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 16; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("ccsrsm2_bufferSizeExt", 1, 16, 16, i); __PYX_ERR(0, 2133, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 16)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2133, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2133, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2133, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2133, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 2133, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 2133, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 2133, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 2133, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 2133, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 2133, __pyx_L3_error)
      values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 2133, __pyx_L3_error)
      values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 2133, __pyx_L3_error)
      values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 2133, __pyx_L3_error)
      values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 2133, __pyx_L3_error)
      values[14] = __Pyx_ArgRef_FASTCALL(__pyx_args, 14);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 2133, __pyx_L3_error)
      values[15] = __Pyx_ArgRef_FASTCALL(__pyx_args, 15);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 2133, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2134, __pyx_L3_error)
    __pyx_v_algo = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_algo == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2134, __pyx_L3_error)
    __pyx_v_transA = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_transA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2134, __pyx_L3_error)
    __pyx_v_transB = __Pyx_PyLong_As_int(values[3]); if (unlikely((__pyx_v_transB == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2134, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[4]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2134, __pyx_L3_error)
    __pyx_v_nrhs = __Pyx_PyLong_As_int(values[5]); if (unlikely((__pyx_v_nrhs == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2134, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyLong_As_int(values[6]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2135, __pyx_L3_error)
    __pyx_v_alpha = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_alpha == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2135, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[8]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2135, __pyx_L3_error)
    __pyx_v_csrSortedValA = __Pyx_PyLong_As_size_t(values[9]); if (unlikely((__pyx_v_csrSortedValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2135, __pyx_L3_error)
    __pyx_v_csrSortedRowPtrA = __Pyx_PyLong_As_size_t(values[10]); if (unlikely((__pyx_v_csrSortedRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2136, __pyx_L3_error)
    __pyx_v_csrSortedColIndA = __Pyx_PyLong_As_size_t(values[11]); if (unlikely((__pyx_v_csrSortedColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2136, __pyx_L3_error)
    __pyx_v_B = __Pyx_PyLong_As_size_t(values[12]); if (unlikely((__pyx_v_B == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2136, __pyx_L3_error)
    __pyx_v_ldb = __Pyx_PyLong_As_int(values[13]); if (unlikely((__pyx_v_ldb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2136, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyLong_As_size_t(values[14]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2137, __pyx_L3_error)
    __pyx_v_policy = __Pyx_PyLong_As_int(values[15]); if (unlikely((__pyx_v_policy == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2137, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ccsrsm2_bufferSizeExt", 1, 16, 16, __pyx_nargs); __PYX_ERR(0, 2133, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.ccsrsm2_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_104ccsrsm2_bufferSizeExt(__pyx_self, __pyx_v_handle, __pyx_v_algo, __pyx_v_transA, __pyx_v_transB, __pyx_v_m, __pyx_v_nrhs, __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_info, __pyx_v_policy);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_104ccsrsm2_bufferSizeExt(CYTHON_UNUSED PyObject *__pyx_self, intptr_t __pyx_v_handle, int __pyx_v_algo, int __pyx_v_transA, int __pyx_v_transB, int __pyx_v_m, int __pyx_v_nrhs, 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_info, int __pyx_v_policy) {
  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("ccsrsm2_bufferSizeExt", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_ccsrsm2_bufferSizeExt(__pyx_v_handle, __pyx_v_algo, __pyx_v_transA, __pyx_v_transB, __pyx_v_m, __pyx_v_nrhs, __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_info, __pyx_v_policy, 1); if (unlikely(__pyx_t_1 == ((size_t)-1L) && PyErr_Occurred())) __PYX_ERR(0, 2133, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyLong_FromSize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2133, __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_backends.cuda.libs.cusparse.ccsrsm2_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy_backends/cuda/libs/cusparse.pyx":2149
 *     return bufferSize
 * 
 * cpdef size_t zcsrsm2_bufferSizeExt(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int algo, int transA, int transB, int m, int nrhs,
 *         int nnz, size_t alpha, size_t descrA, size_t csrSortedValA,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_107zcsrsm2_bufferSizeExt(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static size_t __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_zcsrsm2_bufferSizeExt(intptr_t __pyx_v_handle, int __pyx_v_algo, int __pyx_v_transA, int __pyx_v_transB, int __pyx_v_m, int __pyx_v_nrhs, 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_info, int __pyx_v_policy, 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("zcsrsm2_bufferSizeExt", 0);

  /* "cupy_backends/cuda/libs/cusparse.pyx":2155
 *         size_t info, int policy) except? -1:
 *     cdef size_t bufferSize
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     status = cusparseZcsrsm2_bufferSizeExt(
 *         <Handle>handle, algo, <Operation>transA, <Operation>transB, m, nrhs,
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2155, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":2156
 *     cdef size_t bufferSize
 *     _setStream(handle)
 *     status = cusparseZcsrsm2_bufferSizeExt(             # <<<<<<<<<<<<<<
 *         <Handle>handle, algo, <Operation>transA, <Operation>transB, m, nrhs,
 *         nnz, <const cuDoubleComplex*>alpha, <const MatDescr>descrA,
*/
  __pyx_v_status = cusparseZcsrsm2_bufferSizeExt(((cusparseHandle_t)__pyx_v_handle), __pyx_v_algo, ((cusparseOperation_t)__pyx_v_transA), ((cusparseOperation_t)__pyx_v_transB), __pyx_v_m, __pyx_v_nrhs, __pyx_v_nnz, ((cuDoubleComplex const *)__pyx_v_alpha), ((cusparseMatDescr_t const )__pyx_v_descrA), ((cuDoubleComplex const *)__pyx_v_csrSortedValA), ((int const *)__pyx_v_csrSortedRowPtrA), ((int const *)__pyx_v_csrSortedColIndA), ((cuDoubleComplex *)__pyx_v_B), __pyx_v_ldb, ((csrsm2Info_t)__pyx_v_info), ((cusparseSolvePolicy_t)__pyx_v_policy), (&__pyx_v_bufferSize));

  /* "cupy_backends/cuda/libs/cusparse.pyx":2162
 *         <const int*>csrSortedColIndA, <cuDoubleComplex*>B, ldb,
 *         <csrsm2Info_t>info, <cusparseSolvePolicy_t>policy, &bufferSize)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return bufferSize
 * 
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2162, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":2163
 *         <csrsm2Info_t>info, <cusparseSolvePolicy_t>policy, &bufferSize)
 *     check_status(status)
 *     return bufferSize             # <<<<<<<<<<<<<<
 * 
 * cpdef void scsrsm2_analysis(
*/
  __pyx_r = __pyx_v_bufferSize;
  goto __pyx_L0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":2149
 *     return bufferSize
 * 
 * cpdef size_t zcsrsm2_bufferSizeExt(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int algo, int transA, int transB, int m, int nrhs,
 *         int nnz, size_t alpha, size_t descrA, size_t csrSortedValA,
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.zcsrsm2_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1L;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_107zcsrsm2_bufferSizeExt(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_106zcsrsm2_bufferSizeExt, "zcsrsm2_bufferSizeExt(intptr_t handle, int algo, int transA, int transB, int m, int nrhs, int nnz, size_t alpha, size_t descrA, size_t csrSortedValA, size_t csrSortedRowPtrA, size_t csrSortedColIndA, size_t B, int ldb, size_t info, int policy) -> size_t");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_107zcsrsm2_bufferSizeExt(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_t __pyx_v_handle;
  int __pyx_v_algo;
  int __pyx_v_transA;
  int __pyx_v_transB;
  int __pyx_v_m;
  int __pyx_v_nrhs;
  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_info;
  int __pyx_v_policy;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[16] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("zcsrsm2_bufferSizeExt (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_algo,&__pyx_mstate_global->__pyx_n_u_transA,&__pyx_mstate_global->__pyx_n_u_transB,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_nrhs,&__pyx_mstate_global->__pyx_n_u_nnz,&__pyx_mstate_global->__pyx_n_u_alpha,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_csrSortedValA,&__pyx_mstate_global->__pyx_n_u_csrSortedRowPtrA,&__pyx_mstate_global->__pyx_n_u_csrSortedColIndA,&__pyx_mstate_global->__pyx_n_u_B,&__pyx_mstate_global->__pyx_n_u_ldb,&__pyx_mstate_global->__pyx_n_u_info,&__pyx_mstate_global->__pyx_n_u_policy,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 2149, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 16:
        values[15] = __Pyx_ArgRef_FASTCALL(__pyx_args, 15);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 2149, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 15:
        values[14] = __Pyx_ArgRef_FASTCALL(__pyx_args, 14);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 2149, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 14:
        values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 2149, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 13:
        values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 2149, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 12:
        values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 2149, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 11:
        values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 2149, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 2149, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 2149, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 2149, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 2149, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 2149, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 2149, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2149, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2149, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2149, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2149, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "zcsrsm2_bufferSizeExt", 0) < (0)) __PYX_ERR(0, 2149, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 16; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("zcsrsm2_bufferSizeExt", 1, 16, 16, i); __PYX_ERR(0, 2149, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 16)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2149, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2149, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2149, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2149, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 2149, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 2149, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 2149, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 2149, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 2149, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 2149, __pyx_L3_error)
      values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 2149, __pyx_L3_error)
      values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 2149, __pyx_L3_error)
      values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 2149, __pyx_L3_error)
      values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 2149, __pyx_L3_error)
      values[14] = __Pyx_ArgRef_FASTCALL(__pyx_args, 14);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 2149, __pyx_L3_error)
      values[15] = __Pyx_ArgRef_FASTCALL(__pyx_args, 15);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 2149, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2150, __pyx_L3_error)
    __pyx_v_algo = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_algo == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2150, __pyx_L3_error)
    __pyx_v_transA = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_transA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2150, __pyx_L3_error)
    __pyx_v_transB = __Pyx_PyLong_As_int(values[3]); if (unlikely((__pyx_v_transB == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2150, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[4]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2150, __pyx_L3_error)
    __pyx_v_nrhs = __Pyx_PyLong_As_int(values[5]); if (unlikely((__pyx_v_nrhs == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2150, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyLong_As_int(values[6]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2151, __pyx_L3_error)
    __pyx_v_alpha = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_alpha == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2151, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[8]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2151, __pyx_L3_error)
    __pyx_v_csrSortedValA = __Pyx_PyLong_As_size_t(values[9]); if (unlikely((__pyx_v_csrSortedValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2151, __pyx_L3_error)
    __pyx_v_csrSortedRowPtrA = __Pyx_PyLong_As_size_t(values[10]); if (unlikely((__pyx_v_csrSortedRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2152, __pyx_L3_error)
    __pyx_v_csrSortedColIndA = __Pyx_PyLong_As_size_t(values[11]); if (unlikely((__pyx_v_csrSortedColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2152, __pyx_L3_error)
    __pyx_v_B = __Pyx_PyLong_As_size_t(values[12]); if (unlikely((__pyx_v_B == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2152, __pyx_L3_error)
    __pyx_v_ldb = __Pyx_PyLong_As_int(values[13]); if (unlikely((__pyx_v_ldb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2152, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyLong_As_size_t(values[14]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2153, __pyx_L3_error)
    __pyx_v_policy = __Pyx_PyLong_As_int(values[15]); if (unlikely((__pyx_v_policy == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2153, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("zcsrsm2_bufferSizeExt", 1, 16, 16, __pyx_nargs); __PYX_ERR(0, 2149, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.zcsrsm2_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_106zcsrsm2_bufferSizeExt(__pyx_self, __pyx_v_handle, __pyx_v_algo, __pyx_v_transA, __pyx_v_transB, __pyx_v_m, __pyx_v_nrhs, __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_info, __pyx_v_policy);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_106zcsrsm2_bufferSizeExt(CYTHON_UNUSED PyObject *__pyx_self, intptr_t __pyx_v_handle, int __pyx_v_algo, int __pyx_v_transA, int __pyx_v_transB, int __pyx_v_m, int __pyx_v_nrhs, 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_info, int __pyx_v_policy) {
  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("zcsrsm2_bufferSizeExt", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_zcsrsm2_bufferSizeExt(__pyx_v_handle, __pyx_v_algo, __pyx_v_transA, __pyx_v_transB, __pyx_v_m, __pyx_v_nrhs, __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_info, __pyx_v_policy, 1); if (unlikely(__pyx_t_1 == ((size_t)-1L) && PyErr_Occurred())) __PYX_ERR(0, 2149, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyLong_FromSize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2149, __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_backends.cuda.libs.cusparse.zcsrsm2_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy_backends/cuda/libs/cusparse.pyx":2165
 *     return bufferSize
 * 
 * cpdef void scsrsm2_analysis(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int algo, int transA, int transB, int m, int nrhs,
 *         int nnz, size_t alpha, size_t descrA, size_t csrSortedValA,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_109scsrsm2_analysis(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_scsrsm2_analysis(intptr_t __pyx_v_handle, int __pyx_v_algo, int __pyx_v_transA, int __pyx_v_transB, int __pyx_v_m, int __pyx_v_nrhs, 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_info, int __pyx_v_policy, size_t __pyx_v_pBuffer, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("scsrsm2_analysis", 0);

  /* "cupy_backends/cuda/libs/cusparse.pyx":2170
 *         size_t csrSortedRowPtrA, size_t csrSortedColIndA, size_t B, int ldb,
 *         size_t info, int policy, size_t pBuffer) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     status = cusparseScsrsm2_analysis(
 *         <Handle>handle, algo, <Operation>transA, <Operation>transB, m, nrhs,
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2170, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":2171
 *         size_t info, int policy, size_t pBuffer) except *:
 *     _setStream(handle)
 *     status = cusparseScsrsm2_analysis(             # <<<<<<<<<<<<<<
 *         <Handle>handle, algo, <Operation>transA, <Operation>transB, m, nrhs,
 *         nnz, <const float*>alpha, <const MatDescr>descrA,
*/
  __pyx_v_status = cusparseScsrsm2_analysis(((cusparseHandle_t)__pyx_v_handle), __pyx_v_algo, ((cusparseOperation_t)__pyx_v_transA), ((cusparseOperation_t)__pyx_v_transB), __pyx_v_m, __pyx_v_nrhs, __pyx_v_nnz, ((float const *)__pyx_v_alpha), ((cusparseMatDescr_t const )__pyx_v_descrA), ((float const *)__pyx_v_csrSortedValA), ((int const *)__pyx_v_csrSortedRowPtrA), ((int const *)__pyx_v_csrSortedColIndA), ((float *)__pyx_v_B), __pyx_v_ldb, ((csrsm2Info_t)__pyx_v_info), ((cusparseSolvePolicy_t)__pyx_v_policy), ((void *)__pyx_v_pBuffer));

  /* "cupy_backends/cuda/libs/cusparse.pyx":2177
 *         <const int*>csrSortedColIndA, <float*>B, ldb,
 *         <csrsm2Info_t>info, <cusparseSolvePolicy_t>policy, <void*>pBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef void dcsrsm2_analysis(
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2177, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":2165
 *     return bufferSize
 * 
 * cpdef void scsrsm2_analysis(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int algo, int transA, int transB, int m, int nrhs,
 *         int nnz, size_t alpha, size_t descrA, size_t csrSortedValA,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.scsrsm2_analysis", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_109scsrsm2_analysis(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_108scsrsm2_analysis, "scsrsm2_analysis(intptr_t handle, int algo, int transA, int transB, int m, int nrhs, int nnz, size_t alpha, size_t descrA, size_t csrSortedValA, size_t csrSortedRowPtrA, size_t csrSortedColIndA, size_t B, int ldb, size_t info, int policy, size_t pBuffer) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_109scsrsm2_analysis(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_t __pyx_v_handle;
  int __pyx_v_algo;
  int __pyx_v_transA;
  int __pyx_v_transB;
  int __pyx_v_m;
  int __pyx_v_nrhs;
  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_info;
  int __pyx_v_policy;
  size_t __pyx_v_pBuffer;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[17] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("scsrsm2_analysis (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_algo,&__pyx_mstate_global->__pyx_n_u_transA,&__pyx_mstate_global->__pyx_n_u_transB,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_nrhs,&__pyx_mstate_global->__pyx_n_u_nnz,&__pyx_mstate_global->__pyx_n_u_alpha,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_csrSortedValA,&__pyx_mstate_global->__pyx_n_u_csrSortedRowPtrA,&__pyx_mstate_global->__pyx_n_u_csrSortedColIndA,&__pyx_mstate_global->__pyx_n_u_B,&__pyx_mstate_global->__pyx_n_u_ldb,&__pyx_mstate_global->__pyx_n_u_info,&__pyx_mstate_global->__pyx_n_u_policy,&__pyx_mstate_global->__pyx_n_u_pBuffer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 2165, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 17:
        values[16] = __Pyx_ArgRef_FASTCALL(__pyx_args, 16);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[16])) __PYX_ERR(0, 2165, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 16:
        values[15] = __Pyx_ArgRef_FASTCALL(__pyx_args, 15);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 2165, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 15:
        values[14] = __Pyx_ArgRef_FASTCALL(__pyx_args, 14);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 2165, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 14:
        values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 2165, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 13:
        values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 2165, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 12:
        values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 2165, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 11:
        values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 2165, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 2165, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 2165, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 2165, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 2165, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 2165, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 2165, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2165, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2165, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2165, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2165, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "scsrsm2_analysis", 0) < (0)) __PYX_ERR(0, 2165, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 17; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("scsrsm2_analysis", 1, 17, 17, i); __PYX_ERR(0, 2165, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 17)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2165, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2165, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2165, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2165, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 2165, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 2165, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 2165, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 2165, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 2165, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 2165, __pyx_L3_error)
      values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 2165, __pyx_L3_error)
      values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 2165, __pyx_L3_error)
      values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 2165, __pyx_L3_error)
      values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 2165, __pyx_L3_error)
      values[14] = __Pyx_ArgRef_FASTCALL(__pyx_args, 14);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 2165, __pyx_L3_error)
      values[15] = __Pyx_ArgRef_FASTCALL(__pyx_args, 15);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 2165, __pyx_L3_error)
      values[16] = __Pyx_ArgRef_FASTCALL(__pyx_args, 16);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[16])) __PYX_ERR(0, 2165, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2166, __pyx_L3_error)
    __pyx_v_algo = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_algo == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2166, __pyx_L3_error)
    __pyx_v_transA = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_transA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2166, __pyx_L3_error)
    __pyx_v_transB = __Pyx_PyLong_As_int(values[3]); if (unlikely((__pyx_v_transB == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2166, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[4]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2166, __pyx_L3_error)
    __pyx_v_nrhs = __Pyx_PyLong_As_int(values[5]); if (unlikely((__pyx_v_nrhs == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2166, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyLong_As_int(values[6]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2167, __pyx_L3_error)
    __pyx_v_alpha = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_alpha == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2167, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[8]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2167, __pyx_L3_error)
    __pyx_v_csrSortedValA = __Pyx_PyLong_As_size_t(values[9]); if (unlikely((__pyx_v_csrSortedValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2167, __pyx_L3_error)
    __pyx_v_csrSortedRowPtrA = __Pyx_PyLong_As_size_t(values[10]); if (unlikely((__pyx_v_csrSortedRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2168, __pyx_L3_error)
    __pyx_v_csrSortedColIndA = __Pyx_PyLong_As_size_t(values[11]); if (unlikely((__pyx_v_csrSortedColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2168, __pyx_L3_error)
    __pyx_v_B = __Pyx_PyLong_As_size_t(values[12]); if (unlikely((__pyx_v_B == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2168, __pyx_L3_error)
    __pyx_v_ldb = __Pyx_PyLong_As_int(values[13]); if (unlikely((__pyx_v_ldb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2168, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyLong_As_size_t(values[14]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2169, __pyx_L3_error)
    __pyx_v_policy = __Pyx_PyLong_As_int(values[15]); if (unlikely((__pyx_v_policy == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2169, __pyx_L3_error)
    __pyx_v_pBuffer = __Pyx_PyLong_As_size_t(values[16]); if (unlikely((__pyx_v_pBuffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2169, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("scsrsm2_analysis", 1, 17, 17, __pyx_nargs); __PYX_ERR(0, 2165, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.scsrsm2_analysis", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_108scsrsm2_analysis(__pyx_self, __pyx_v_handle, __pyx_v_algo, __pyx_v_transA, __pyx_v_transB, __pyx_v_m, __pyx_v_nrhs, __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_info, __pyx_v_policy, __pyx_v_pBuffer);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_108scsrsm2_analysis(CYTHON_UNUSED PyObject *__pyx_self, intptr_t __pyx_v_handle, int __pyx_v_algo, int __pyx_v_transA, int __pyx_v_transB, int __pyx_v_m, int __pyx_v_nrhs, 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_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("scsrsm2_analysis", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_scsrsm2_analysis(__pyx_v_handle, __pyx_v_algo, __pyx_v_transA, __pyx_v_transB, __pyx_v_m, __pyx_v_nrhs, __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_info, __pyx_v_policy, __pyx_v_pBuffer, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2165, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2165, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":2179
 *     check_status(status)
 * 
 * cpdef void dcsrsm2_analysis(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int algo, int transA, int transB, int m, int nrhs,
 *         int nnz, size_t alpha, size_t descrA, size_t csrSortedValA,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_111dcsrsm2_analysis(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_dcsrsm2_analysis(intptr_t __pyx_v_handle, int __pyx_v_algo, int __pyx_v_transA, int __pyx_v_transB, int __pyx_v_m, int __pyx_v_nrhs, 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_info, int __pyx_v_policy, size_t __pyx_v_pBuffer, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dcsrsm2_analysis", 0);

  /* "cupy_backends/cuda/libs/cusparse.pyx":2184
 *         size_t csrSortedRowPtrA, size_t csrSortedColIndA, size_t B, int ldb,
 *         size_t info, int policy, size_t pBuffer) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     status = cusparseDcsrsm2_analysis(
 *         <Handle>handle, algo, <Operation>transA, <Operation>transB, m, nrhs,
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2184, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":2185
 *         size_t info, int policy, size_t pBuffer) except *:
 *     _setStream(handle)
 *     status = cusparseDcsrsm2_analysis(             # <<<<<<<<<<<<<<
 *         <Handle>handle, algo, <Operation>transA, <Operation>transB, m, nrhs,
 *         nnz, <const double*>alpha, <const MatDescr>descrA,
*/
  __pyx_v_status = cusparseDcsrsm2_analysis(((cusparseHandle_t)__pyx_v_handle), __pyx_v_algo, ((cusparseOperation_t)__pyx_v_transA), ((cusparseOperation_t)__pyx_v_transB), __pyx_v_m, __pyx_v_nrhs, __pyx_v_nnz, ((double const *)__pyx_v_alpha), ((cusparseMatDescr_t const )__pyx_v_descrA), ((double const *)__pyx_v_csrSortedValA), ((int const *)__pyx_v_csrSortedRowPtrA), ((int const *)__pyx_v_csrSortedColIndA), ((double *)__pyx_v_B), __pyx_v_ldb, ((csrsm2Info_t)__pyx_v_info), ((cusparseSolvePolicy_t)__pyx_v_policy), ((void *)__pyx_v_pBuffer));

  /* "cupy_backends/cuda/libs/cusparse.pyx":2191
 *         <const int*>csrSortedColIndA, <double*>B, ldb,
 *         <csrsm2Info_t>info, <cusparseSolvePolicy_t>policy, <void*>pBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef void ccsrsm2_analysis(
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2191, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":2179
 *     check_status(status)
 * 
 * cpdef void dcsrsm2_analysis(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int algo, int transA, int transB, int m, int nrhs,
 *         int nnz, size_t alpha, size_t descrA, size_t csrSortedValA,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.dcsrsm2_analysis", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_111dcsrsm2_analysis(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_110dcsrsm2_analysis, "dcsrsm2_analysis(intptr_t handle, int algo, int transA, int transB, int m, int nrhs, int nnz, size_t alpha, size_t descrA, size_t csrSortedValA, size_t csrSortedRowPtrA, size_t csrSortedColIndA, size_t B, int ldb, size_t info, int policy, size_t pBuffer) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_111dcsrsm2_analysis(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_t __pyx_v_handle;
  int __pyx_v_algo;
  int __pyx_v_transA;
  int __pyx_v_transB;
  int __pyx_v_m;
  int __pyx_v_nrhs;
  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_info;
  int __pyx_v_policy;
  size_t __pyx_v_pBuffer;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[17] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dcsrsm2_analysis (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_algo,&__pyx_mstate_global->__pyx_n_u_transA,&__pyx_mstate_global->__pyx_n_u_transB,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_nrhs,&__pyx_mstate_global->__pyx_n_u_nnz,&__pyx_mstate_global->__pyx_n_u_alpha,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_csrSortedValA,&__pyx_mstate_global->__pyx_n_u_csrSortedRowPtrA,&__pyx_mstate_global->__pyx_n_u_csrSortedColIndA,&__pyx_mstate_global->__pyx_n_u_B,&__pyx_mstate_global->__pyx_n_u_ldb,&__pyx_mstate_global->__pyx_n_u_info,&__pyx_mstate_global->__pyx_n_u_policy,&__pyx_mstate_global->__pyx_n_u_pBuffer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 2179, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 17:
        values[16] = __Pyx_ArgRef_FASTCALL(__pyx_args, 16);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[16])) __PYX_ERR(0, 2179, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 16:
        values[15] = __Pyx_ArgRef_FASTCALL(__pyx_args, 15);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 2179, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 15:
        values[14] = __Pyx_ArgRef_FASTCALL(__pyx_args, 14);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 2179, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 14:
        values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 2179, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 13:
        values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 2179, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 12:
        values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 2179, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 11:
        values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 2179, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 2179, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 2179, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 2179, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 2179, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 2179, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 2179, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2179, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2179, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2179, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2179, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "dcsrsm2_analysis", 0) < (0)) __PYX_ERR(0, 2179, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 17; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("dcsrsm2_analysis", 1, 17, 17, i); __PYX_ERR(0, 2179, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 17)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2179, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2179, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2179, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2179, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 2179, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 2179, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 2179, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 2179, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 2179, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 2179, __pyx_L3_error)
      values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 2179, __pyx_L3_error)
      values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 2179, __pyx_L3_error)
      values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 2179, __pyx_L3_error)
      values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 2179, __pyx_L3_error)
      values[14] = __Pyx_ArgRef_FASTCALL(__pyx_args, 14);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 2179, __pyx_L3_error)
      values[15] = __Pyx_ArgRef_FASTCALL(__pyx_args, 15);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 2179, __pyx_L3_error)
      values[16] = __Pyx_ArgRef_FASTCALL(__pyx_args, 16);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[16])) __PYX_ERR(0, 2179, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2180, __pyx_L3_error)
    __pyx_v_algo = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_algo == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2180, __pyx_L3_error)
    __pyx_v_transA = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_transA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2180, __pyx_L3_error)
    __pyx_v_transB = __Pyx_PyLong_As_int(values[3]); if (unlikely((__pyx_v_transB == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2180, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[4]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2180, __pyx_L3_error)
    __pyx_v_nrhs = __Pyx_PyLong_As_int(values[5]); if (unlikely((__pyx_v_nrhs == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2180, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyLong_As_int(values[6]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2181, __pyx_L3_error)
    __pyx_v_alpha = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_alpha == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2181, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[8]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2181, __pyx_L3_error)
    __pyx_v_csrSortedValA = __Pyx_PyLong_As_size_t(values[9]); if (unlikely((__pyx_v_csrSortedValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2181, __pyx_L3_error)
    __pyx_v_csrSortedRowPtrA = __Pyx_PyLong_As_size_t(values[10]); if (unlikely((__pyx_v_csrSortedRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2182, __pyx_L3_error)
    __pyx_v_csrSortedColIndA = __Pyx_PyLong_As_size_t(values[11]); if (unlikely((__pyx_v_csrSortedColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2182, __pyx_L3_error)
    __pyx_v_B = __Pyx_PyLong_As_size_t(values[12]); if (unlikely((__pyx_v_B == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2182, __pyx_L3_error)
    __pyx_v_ldb = __Pyx_PyLong_As_int(values[13]); if (unlikely((__pyx_v_ldb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2182, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyLong_As_size_t(values[14]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2183, __pyx_L3_error)
    __pyx_v_policy = __Pyx_PyLong_As_int(values[15]); if (unlikely((__pyx_v_policy == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2183, __pyx_L3_error)
    __pyx_v_pBuffer = __Pyx_PyLong_As_size_t(values[16]); if (unlikely((__pyx_v_pBuffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2183, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("dcsrsm2_analysis", 1, 17, 17, __pyx_nargs); __PYX_ERR(0, 2179, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.dcsrsm2_analysis", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_110dcsrsm2_analysis(__pyx_self, __pyx_v_handle, __pyx_v_algo, __pyx_v_transA, __pyx_v_transB, __pyx_v_m, __pyx_v_nrhs, __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_info, __pyx_v_policy, __pyx_v_pBuffer);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_110dcsrsm2_analysis(CYTHON_UNUSED PyObject *__pyx_self, intptr_t __pyx_v_handle, int __pyx_v_algo, int __pyx_v_transA, int __pyx_v_transB, int __pyx_v_m, int __pyx_v_nrhs, 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_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("dcsrsm2_analysis", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_dcsrsm2_analysis(__pyx_v_handle, __pyx_v_algo, __pyx_v_transA, __pyx_v_transB, __pyx_v_m, __pyx_v_nrhs, __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_info, __pyx_v_policy, __pyx_v_pBuffer, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2179, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2179, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":2193
 *     check_status(status)
 * 
 * cpdef void ccsrsm2_analysis(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int algo, int transA, int transB, int m, int nrhs,
 *         int nnz, size_t alpha, size_t descrA, size_t csrSortedValA,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_113ccsrsm2_analysis(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_ccsrsm2_analysis(intptr_t __pyx_v_handle, int __pyx_v_algo, int __pyx_v_transA, int __pyx_v_transB, int __pyx_v_m, int __pyx_v_nrhs, 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_info, int __pyx_v_policy, size_t __pyx_v_pBuffer, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("ccsrsm2_analysis", 0);

  /* "cupy_backends/cuda/libs/cusparse.pyx":2198
 *         size_t csrSortedRowPtrA, size_t csrSortedColIndA, size_t B, int ldb,
 *         size_t info, int policy, size_t pBuffer) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     status = cusparseCcsrsm2_analysis(
 *         <Handle>handle, algo, <Operation>transA, <Operation>transB, m, nrhs,
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2198, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":2199
 *         size_t info, int policy, size_t pBuffer) except *:
 *     _setStream(handle)
 *     status = cusparseCcsrsm2_analysis(             # <<<<<<<<<<<<<<
 *         <Handle>handle, algo, <Operation>transA, <Operation>transB, m, nrhs,
 *         nnz, <const cuComplex*>alpha, <const MatDescr>descrA,
*/
  __pyx_v_status = cusparseCcsrsm2_analysis(((cusparseHandle_t)__pyx_v_handle), __pyx_v_algo, ((cusparseOperation_t)__pyx_v_transA), ((cusparseOperation_t)__pyx_v_transB), __pyx_v_m, __pyx_v_nrhs, __pyx_v_nnz, ((cuComplex const *)__pyx_v_alpha), ((cusparseMatDescr_t const )__pyx_v_descrA), ((cuComplex const *)__pyx_v_csrSortedValA), ((int const *)__pyx_v_csrSortedRowPtrA), ((int const *)__pyx_v_csrSortedColIndA), ((cuComplex *)__pyx_v_B), __pyx_v_ldb, ((csrsm2Info_t)__pyx_v_info), ((cusparseSolvePolicy_t)__pyx_v_policy), ((void *)__pyx_v_pBuffer));

  /* "cupy_backends/cuda/libs/cusparse.pyx":2205
 *         <const int*>csrSortedColIndA, <cuComplex*>B, ldb,
 *         <csrsm2Info_t>info, <cusparseSolvePolicy_t>policy, <void*>pBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef void zcsrsm2_analysis(
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2205, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":2193
 *     check_status(status)
 * 
 * cpdef void ccsrsm2_analysis(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int algo, int transA, int transB, int m, int nrhs,
 *         int nnz, size_t alpha, size_t descrA, size_t csrSortedValA,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.ccsrsm2_analysis", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_113ccsrsm2_analysis(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_112ccsrsm2_analysis, "ccsrsm2_analysis(intptr_t handle, int algo, int transA, int transB, int m, int nrhs, int nnz, size_t alpha, size_t descrA, size_t csrSortedValA, size_t csrSortedRowPtrA, size_t csrSortedColIndA, size_t B, int ldb, size_t info, int policy, size_t pBuffer) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_113ccsrsm2_analysis(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_t __pyx_v_handle;
  int __pyx_v_algo;
  int __pyx_v_transA;
  int __pyx_v_transB;
  int __pyx_v_m;
  int __pyx_v_nrhs;
  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_info;
  int __pyx_v_policy;
  size_t __pyx_v_pBuffer;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[17] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ccsrsm2_analysis (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_algo,&__pyx_mstate_global->__pyx_n_u_transA,&__pyx_mstate_global->__pyx_n_u_transB,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_nrhs,&__pyx_mstate_global->__pyx_n_u_nnz,&__pyx_mstate_global->__pyx_n_u_alpha,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_csrSortedValA,&__pyx_mstate_global->__pyx_n_u_csrSortedRowPtrA,&__pyx_mstate_global->__pyx_n_u_csrSortedColIndA,&__pyx_mstate_global->__pyx_n_u_B,&__pyx_mstate_global->__pyx_n_u_ldb,&__pyx_mstate_global->__pyx_n_u_info,&__pyx_mstate_global->__pyx_n_u_policy,&__pyx_mstate_global->__pyx_n_u_pBuffer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 2193, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 17:
        values[16] = __Pyx_ArgRef_FASTCALL(__pyx_args, 16);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[16])) __PYX_ERR(0, 2193, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 16:
        values[15] = __Pyx_ArgRef_FASTCALL(__pyx_args, 15);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 2193, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 15:
        values[14] = __Pyx_ArgRef_FASTCALL(__pyx_args, 14);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 2193, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 14:
        values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 2193, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 13:
        values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 2193, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 12:
        values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 2193, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 11:
        values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 2193, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 2193, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 2193, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 2193, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 2193, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 2193, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 2193, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2193, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2193, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2193, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2193, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "ccsrsm2_analysis", 0) < (0)) __PYX_ERR(0, 2193, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 17; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("ccsrsm2_analysis", 1, 17, 17, i); __PYX_ERR(0, 2193, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 17)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2193, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2193, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2193, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2193, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 2193, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 2193, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 2193, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 2193, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 2193, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 2193, __pyx_L3_error)
      values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 2193, __pyx_L3_error)
      values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 2193, __pyx_L3_error)
      values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 2193, __pyx_L3_error)
      values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 2193, __pyx_L3_error)
      values[14] = __Pyx_ArgRef_FASTCALL(__pyx_args, 14);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 2193, __pyx_L3_error)
      values[15] = __Pyx_ArgRef_FASTCALL(__pyx_args, 15);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 2193, __pyx_L3_error)
      values[16] = __Pyx_ArgRef_FASTCALL(__pyx_args, 16);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[16])) __PYX_ERR(0, 2193, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2194, __pyx_L3_error)
    __pyx_v_algo = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_algo == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2194, __pyx_L3_error)
    __pyx_v_transA = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_transA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2194, __pyx_L3_error)
    __pyx_v_transB = __Pyx_PyLong_As_int(values[3]); if (unlikely((__pyx_v_transB == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2194, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[4]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2194, __pyx_L3_error)
    __pyx_v_nrhs = __Pyx_PyLong_As_int(values[5]); if (unlikely((__pyx_v_nrhs == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2194, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyLong_As_int(values[6]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2195, __pyx_L3_error)
    __pyx_v_alpha = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_alpha == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2195, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[8]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2195, __pyx_L3_error)
    __pyx_v_csrSortedValA = __Pyx_PyLong_As_size_t(values[9]); if (unlikely((__pyx_v_csrSortedValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2195, __pyx_L3_error)
    __pyx_v_csrSortedRowPtrA = __Pyx_PyLong_As_size_t(values[10]); if (unlikely((__pyx_v_csrSortedRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2196, __pyx_L3_error)
    __pyx_v_csrSortedColIndA = __Pyx_PyLong_As_size_t(values[11]); if (unlikely((__pyx_v_csrSortedColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2196, __pyx_L3_error)
    __pyx_v_B = __Pyx_PyLong_As_size_t(values[12]); if (unlikely((__pyx_v_B == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2196, __pyx_L3_error)
    __pyx_v_ldb = __Pyx_PyLong_As_int(values[13]); if (unlikely((__pyx_v_ldb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2196, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyLong_As_size_t(values[14]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2197, __pyx_L3_error)
    __pyx_v_policy = __Pyx_PyLong_As_int(values[15]); if (unlikely((__pyx_v_policy == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2197, __pyx_L3_error)
    __pyx_v_pBuffer = __Pyx_PyLong_As_size_t(values[16]); if (unlikely((__pyx_v_pBuffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2197, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ccsrsm2_analysis", 1, 17, 17, __pyx_nargs); __PYX_ERR(0, 2193, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.ccsrsm2_analysis", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_112ccsrsm2_analysis(__pyx_self, __pyx_v_handle, __pyx_v_algo, __pyx_v_transA, __pyx_v_transB, __pyx_v_m, __pyx_v_nrhs, __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_info, __pyx_v_policy, __pyx_v_pBuffer);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_112ccsrsm2_analysis(CYTHON_UNUSED PyObject *__pyx_self, intptr_t __pyx_v_handle, int __pyx_v_algo, int __pyx_v_transA, int __pyx_v_transB, int __pyx_v_m, int __pyx_v_nrhs, 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_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("ccsrsm2_analysis", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_ccsrsm2_analysis(__pyx_v_handle, __pyx_v_algo, __pyx_v_transA, __pyx_v_transB, __pyx_v_m, __pyx_v_nrhs, __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_info, __pyx_v_policy, __pyx_v_pBuffer, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2193, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2193, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":2207
 *     check_status(status)
 * 
 * cpdef void zcsrsm2_analysis(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int algo, int transA, int transB, int m, int nrhs,
 *         int nnz, size_t alpha, size_t descrA, size_t csrSortedValA,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_115zcsrsm2_analysis(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_zcsrsm2_analysis(intptr_t __pyx_v_handle, int __pyx_v_algo, int __pyx_v_transA, int __pyx_v_transB, int __pyx_v_m, int __pyx_v_nrhs, 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_info, int __pyx_v_policy, size_t __pyx_v_pBuffer, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("zcsrsm2_analysis", 0);

  /* "cupy_backends/cuda/libs/cusparse.pyx":2212
 *         size_t csrSortedRowPtrA, size_t csrSortedColIndA, size_t B, int ldb,
 *         size_t info, int policy, size_t pBuffer) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     status = cusparseZcsrsm2_analysis(
 *         <Handle>handle, algo, <Operation>transA, <Operation>transB, m, nrhs,
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2212, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":2213
 *         size_t info, int policy, size_t pBuffer) except *:
 *     _setStream(handle)
 *     status = cusparseZcsrsm2_analysis(             # <<<<<<<<<<<<<<
 *         <Handle>handle, algo, <Operation>transA, <Operation>transB, m, nrhs,
 *         nnz, <const cuDoubleComplex*>alpha, <const MatDescr>descrA,
*/
  __pyx_v_status = cusparseZcsrsm2_analysis(((cusparseHandle_t)__pyx_v_handle), __pyx_v_algo, ((cusparseOperation_t)__pyx_v_transA), ((cusparseOperation_t)__pyx_v_transB), __pyx_v_m, __pyx_v_nrhs, __pyx_v_nnz, ((cuDoubleComplex const *)__pyx_v_alpha), ((cusparseMatDescr_t const )__pyx_v_descrA), ((cuDoubleComplex const *)__pyx_v_csrSortedValA), ((int const *)__pyx_v_csrSortedRowPtrA), ((int const *)__pyx_v_csrSortedColIndA), ((cuDoubleComplex *)__pyx_v_B), __pyx_v_ldb, ((csrsm2Info_t)__pyx_v_info), ((cusparseSolvePolicy_t)__pyx_v_policy), ((void *)__pyx_v_pBuffer));

  /* "cupy_backends/cuda/libs/cusparse.pyx":2219
 *         <const int*>csrSortedColIndA, <cuDoubleComplex*>B, ldb,
 *         <csrsm2Info_t>info, <cusparseSolvePolicy_t>policy, <void*>pBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef void scsrsm2_solve(
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2219, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":2207
 *     check_status(status)
 * 
 * cpdef void zcsrsm2_analysis(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int algo, int transA, int transB, int m, int nrhs,
 *         int nnz, size_t alpha, size_t descrA, size_t csrSortedValA,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.zcsrsm2_analysis", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_115zcsrsm2_analysis(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_114zcsrsm2_analysis, "zcsrsm2_analysis(intptr_t handle, int algo, int transA, int transB, int m, int nrhs, int nnz, size_t alpha, size_t descrA, size_t csrSortedValA, size_t csrSortedRowPtrA, size_t csrSortedColIndA, size_t B, int ldb, size_t info, int policy, size_t pBuffer) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_115zcsrsm2_analysis(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_t __pyx_v_handle;
  int __pyx_v_algo;
  int __pyx_v_transA;
  int __pyx_v_transB;
  int __pyx_v_m;
  int __pyx_v_nrhs;
  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_info;
  int __pyx_v_policy;
  size_t __pyx_v_pBuffer;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[17] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("zcsrsm2_analysis (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_algo,&__pyx_mstate_global->__pyx_n_u_transA,&__pyx_mstate_global->__pyx_n_u_transB,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_nrhs,&__pyx_mstate_global->__pyx_n_u_nnz,&__pyx_mstate_global->__pyx_n_u_alpha,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_csrSortedValA,&__pyx_mstate_global->__pyx_n_u_csrSortedRowPtrA,&__pyx_mstate_global->__pyx_n_u_csrSortedColIndA,&__pyx_mstate_global->__pyx_n_u_B,&__pyx_mstate_global->__pyx_n_u_ldb,&__pyx_mstate_global->__pyx_n_u_info,&__pyx_mstate_global->__pyx_n_u_policy,&__pyx_mstate_global->__pyx_n_u_pBuffer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 2207, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 17:
        values[16] = __Pyx_ArgRef_FASTCALL(__pyx_args, 16);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[16])) __PYX_ERR(0, 2207, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 16:
        values[15] = __Pyx_ArgRef_FASTCALL(__pyx_args, 15);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 2207, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 15:
        values[14] = __Pyx_ArgRef_FASTCALL(__pyx_args, 14);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 2207, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 14:
        values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 2207, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 13:
        values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 2207, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 12:
        values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 2207, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 11:
        values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 2207, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 2207, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 2207, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 2207, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 2207, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 2207, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 2207, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2207, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2207, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2207, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2207, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "zcsrsm2_analysis", 0) < (0)) __PYX_ERR(0, 2207, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 17; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("zcsrsm2_analysis", 1, 17, 17, i); __PYX_ERR(0, 2207, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 17)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2207, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2207, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2207, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2207, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 2207, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 2207, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 2207, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 2207, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 2207, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 2207, __pyx_L3_error)
      values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 2207, __pyx_L3_error)
      values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 2207, __pyx_L3_error)
      values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 2207, __pyx_L3_error)
      values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 2207, __pyx_L3_error)
      values[14] = __Pyx_ArgRef_FASTCALL(__pyx_args, 14);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 2207, __pyx_L3_error)
      values[15] = __Pyx_ArgRef_FASTCALL(__pyx_args, 15);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 2207, __pyx_L3_error)
      values[16] = __Pyx_ArgRef_FASTCALL(__pyx_args, 16);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[16])) __PYX_ERR(0, 2207, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2208, __pyx_L3_error)
    __pyx_v_algo = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_algo == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2208, __pyx_L3_error)
    __pyx_v_transA = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_transA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2208, __pyx_L3_error)
    __pyx_v_transB = __Pyx_PyLong_As_int(values[3]); if (unlikely((__pyx_v_transB == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2208, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[4]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2208, __pyx_L3_error)
    __pyx_v_nrhs = __Pyx_PyLong_As_int(values[5]); if (unlikely((__pyx_v_nrhs == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2208, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyLong_As_int(values[6]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2209, __pyx_L3_error)
    __pyx_v_alpha = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_alpha == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2209, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[8]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2209, __pyx_L3_error)
    __pyx_v_csrSortedValA = __Pyx_PyLong_As_size_t(values[9]); if (unlikely((__pyx_v_csrSortedValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2209, __pyx_L3_error)
    __pyx_v_csrSortedRowPtrA = __Pyx_PyLong_As_size_t(values[10]); if (unlikely((__pyx_v_csrSortedRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2210, __pyx_L3_error)
    __pyx_v_csrSortedColIndA = __Pyx_PyLong_As_size_t(values[11]); if (unlikely((__pyx_v_csrSortedColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2210, __pyx_L3_error)
    __pyx_v_B = __Pyx_PyLong_As_size_t(values[12]); if (unlikely((__pyx_v_B == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2210, __pyx_L3_error)
    __pyx_v_ldb = __Pyx_PyLong_As_int(values[13]); if (unlikely((__pyx_v_ldb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2210, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyLong_As_size_t(values[14]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2211, __pyx_L3_error)
    __pyx_v_policy = __Pyx_PyLong_As_int(values[15]); if (unlikely((__pyx_v_policy == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2211, __pyx_L3_error)
    __pyx_v_pBuffer = __Pyx_PyLong_As_size_t(values[16]); if (unlikely((__pyx_v_pBuffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2211, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("zcsrsm2_analysis", 1, 17, 17, __pyx_nargs); __PYX_ERR(0, 2207, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.zcsrsm2_analysis", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_114zcsrsm2_analysis(__pyx_self, __pyx_v_handle, __pyx_v_algo, __pyx_v_transA, __pyx_v_transB, __pyx_v_m, __pyx_v_nrhs, __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_info, __pyx_v_policy, __pyx_v_pBuffer);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_114zcsrsm2_analysis(CYTHON_UNUSED PyObject *__pyx_self, intptr_t __pyx_v_handle, int __pyx_v_algo, int __pyx_v_transA, int __pyx_v_transB, int __pyx_v_m, int __pyx_v_nrhs, 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_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("zcsrsm2_analysis", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_zcsrsm2_analysis(__pyx_v_handle, __pyx_v_algo, __pyx_v_transA, __pyx_v_transB, __pyx_v_m, __pyx_v_nrhs, __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_info, __pyx_v_policy, __pyx_v_pBuffer, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2207, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2207, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":2221
 *     check_status(status)
 * 
 * cpdef void scsrsm2_solve(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int algo, int transA, int transB, int m, int nrhs,
 *         int nnz, size_t alpha, size_t descrA, size_t csrSortedValA,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_117scsrsm2_solve(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_scsrsm2_solve(intptr_t __pyx_v_handle, int __pyx_v_algo, int __pyx_v_transA, int __pyx_v_transB, int __pyx_v_m, int __pyx_v_nrhs, 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_info, int __pyx_v_policy, size_t __pyx_v_pBuffer, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("scsrsm2_solve", 0);

  /* "cupy_backends/cuda/libs/cusparse.pyx":2226
 *         size_t csrSortedRowPtrA, size_t csrSortedColIndA, size_t B, int ldb,
 *         size_t info, int policy, size_t pBuffer) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     status = cusparseScsrsm2_solve(
 *         <Handle>handle, algo, <Operation>transA, <Operation>transB, m, nrhs,
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2226, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":2227
 *         size_t info, int policy, size_t pBuffer) except *:
 *     _setStream(handle)
 *     status = cusparseScsrsm2_solve(             # <<<<<<<<<<<<<<
 *         <Handle>handle, algo, <Operation>transA, <Operation>transB, m, nrhs,
 *         nnz, <const float*>alpha, <const MatDescr>descrA,
*/
  __pyx_v_status = cusparseScsrsm2_solve(((cusparseHandle_t)__pyx_v_handle), __pyx_v_algo, ((cusparseOperation_t)__pyx_v_transA), ((cusparseOperation_t)__pyx_v_transB), __pyx_v_m, __pyx_v_nrhs, __pyx_v_nnz, ((float const *)__pyx_v_alpha), ((cusparseMatDescr_t const )__pyx_v_descrA), ((float const *)__pyx_v_csrSortedValA), ((int const *)__pyx_v_csrSortedRowPtrA), ((int const *)__pyx_v_csrSortedColIndA), ((float *)__pyx_v_B), __pyx_v_ldb, ((csrsm2Info_t)__pyx_v_info), ((cusparseSolvePolicy_t)__pyx_v_policy), ((void *)__pyx_v_pBuffer));

  /* "cupy_backends/cuda/libs/cusparse.pyx":2233
 *         <const int*>csrSortedColIndA, <float*>B, ldb,
 *         <csrsm2Info_t>info, <cusparseSolvePolicy_t>policy, <void*>pBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef void dcsrsm2_solve(
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2233, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":2221
 *     check_status(status)
 * 
 * cpdef void scsrsm2_solve(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int algo, int transA, int transB, int m, int nrhs,
 *         int nnz, size_t alpha, size_t descrA, size_t csrSortedValA,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.scsrsm2_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_117scsrsm2_solve(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_116scsrsm2_solve, "scsrsm2_solve(intptr_t handle, int algo, int transA, int transB, int m, int nrhs, int nnz, size_t alpha, size_t descrA, size_t csrSortedValA, size_t csrSortedRowPtrA, size_t csrSortedColIndA, size_t B, int ldb, size_t info, int policy, size_t pBuffer) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_117scsrsm2_solve(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_t __pyx_v_handle;
  int __pyx_v_algo;
  int __pyx_v_transA;
  int __pyx_v_transB;
  int __pyx_v_m;
  int __pyx_v_nrhs;
  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_info;
  int __pyx_v_policy;
  size_t __pyx_v_pBuffer;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[17] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("scsrsm2_solve (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_algo,&__pyx_mstate_global->__pyx_n_u_transA,&__pyx_mstate_global->__pyx_n_u_transB,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_nrhs,&__pyx_mstate_global->__pyx_n_u_nnz,&__pyx_mstate_global->__pyx_n_u_alpha,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_csrSortedValA,&__pyx_mstate_global->__pyx_n_u_csrSortedRowPtrA,&__pyx_mstate_global->__pyx_n_u_csrSortedColIndA,&__pyx_mstate_global->__pyx_n_u_B,&__pyx_mstate_global->__pyx_n_u_ldb,&__pyx_mstate_global->__pyx_n_u_info,&__pyx_mstate_global->__pyx_n_u_policy,&__pyx_mstate_global->__pyx_n_u_pBuffer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 2221, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 17:
        values[16] = __Pyx_ArgRef_FASTCALL(__pyx_args, 16);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[16])) __PYX_ERR(0, 2221, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 16:
        values[15] = __Pyx_ArgRef_FASTCALL(__pyx_args, 15);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 2221, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 15:
        values[14] = __Pyx_ArgRef_FASTCALL(__pyx_args, 14);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 2221, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 14:
        values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 2221, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 13:
        values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 2221, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 12:
        values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 2221, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 11:
        values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 2221, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 2221, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 2221, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 2221, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 2221, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 2221, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 2221, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2221, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2221, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2221, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2221, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "scsrsm2_solve", 0) < (0)) __PYX_ERR(0, 2221, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 17; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("scsrsm2_solve", 1, 17, 17, i); __PYX_ERR(0, 2221, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 17)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2221, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2221, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2221, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2221, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 2221, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 2221, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 2221, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 2221, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 2221, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 2221, __pyx_L3_error)
      values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 2221, __pyx_L3_error)
      values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 2221, __pyx_L3_error)
      values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 2221, __pyx_L3_error)
      values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 2221, __pyx_L3_error)
      values[14] = __Pyx_ArgRef_FASTCALL(__pyx_args, 14);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 2221, __pyx_L3_error)
      values[15] = __Pyx_ArgRef_FASTCALL(__pyx_args, 15);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 2221, __pyx_L3_error)
      values[16] = __Pyx_ArgRef_FASTCALL(__pyx_args, 16);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[16])) __PYX_ERR(0, 2221, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2222, __pyx_L3_error)
    __pyx_v_algo = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_algo == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2222, __pyx_L3_error)
    __pyx_v_transA = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_transA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2222, __pyx_L3_error)
    __pyx_v_transB = __Pyx_PyLong_As_int(values[3]); if (unlikely((__pyx_v_transB == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2222, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[4]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2222, __pyx_L3_error)
    __pyx_v_nrhs = __Pyx_PyLong_As_int(values[5]); if (unlikely((__pyx_v_nrhs == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2222, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyLong_As_int(values[6]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2223, __pyx_L3_error)
    __pyx_v_alpha = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_alpha == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2223, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[8]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2223, __pyx_L3_error)
    __pyx_v_csrSortedValA = __Pyx_PyLong_As_size_t(values[9]); if (unlikely((__pyx_v_csrSortedValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2223, __pyx_L3_error)
    __pyx_v_csrSortedRowPtrA = __Pyx_PyLong_As_size_t(values[10]); if (unlikely((__pyx_v_csrSortedRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2224, __pyx_L3_error)
    __pyx_v_csrSortedColIndA = __Pyx_PyLong_As_size_t(values[11]); if (unlikely((__pyx_v_csrSortedColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2224, __pyx_L3_error)
    __pyx_v_B = __Pyx_PyLong_As_size_t(values[12]); if (unlikely((__pyx_v_B == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2224, __pyx_L3_error)
    __pyx_v_ldb = __Pyx_PyLong_As_int(values[13]); if (unlikely((__pyx_v_ldb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2224, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyLong_As_size_t(values[14]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2225, __pyx_L3_error)
    __pyx_v_policy = __Pyx_PyLong_As_int(values[15]); if (unlikely((__pyx_v_policy == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2225, __pyx_L3_error)
    __pyx_v_pBuffer = __Pyx_PyLong_As_size_t(values[16]); if (unlikely((__pyx_v_pBuffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2225, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("scsrsm2_solve", 1, 17, 17, __pyx_nargs); __PYX_ERR(0, 2221, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.scsrsm2_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_116scsrsm2_solve(__pyx_self, __pyx_v_handle, __pyx_v_algo, __pyx_v_transA, __pyx_v_transB, __pyx_v_m, __pyx_v_nrhs, __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_info, __pyx_v_policy, __pyx_v_pBuffer);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_116scsrsm2_solve(CYTHON_UNUSED PyObject *__pyx_self, intptr_t __pyx_v_handle, int __pyx_v_algo, int __pyx_v_transA, int __pyx_v_transB, int __pyx_v_m, int __pyx_v_nrhs, 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_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("scsrsm2_solve", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_scsrsm2_solve(__pyx_v_handle, __pyx_v_algo, __pyx_v_transA, __pyx_v_transB, __pyx_v_m, __pyx_v_nrhs, __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_info, __pyx_v_policy, __pyx_v_pBuffer, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2221, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2221, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":2235
 *     check_status(status)
 * 
 * cpdef void dcsrsm2_solve(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int algo, int transA, int transB, int m, int nrhs,
 *         int nnz, size_t alpha, size_t descrA, size_t csrSortedValA,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_119dcsrsm2_solve(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_dcsrsm2_solve(intptr_t __pyx_v_handle, int __pyx_v_algo, int __pyx_v_transA, int __pyx_v_transB, int __pyx_v_m, int __pyx_v_nrhs, 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_info, int __pyx_v_policy, size_t __pyx_v_pBuffer, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dcsrsm2_solve", 0);

  /* "cupy_backends/cuda/libs/cusparse.pyx":2240
 *         size_t csrSortedRowPtrA, size_t csrSortedColIndA, size_t B, int ldb,
 *         size_t info, int policy, size_t pBuffer) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     status = cusparseDcsrsm2_solve(
 *         <Handle>handle, algo, <Operation>transA, <Operation>transB, m, nrhs,
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2240, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":2241
 *         size_t info, int policy, size_t pBuffer) except *:
 *     _setStream(handle)
 *     status = cusparseDcsrsm2_solve(             # <<<<<<<<<<<<<<
 *         <Handle>handle, algo, <Operation>transA, <Operation>transB, m, nrhs,
 *         nnz, <const double*>alpha, <const MatDescr>descrA,
*/
  __pyx_v_status = cusparseDcsrsm2_solve(((cusparseHandle_t)__pyx_v_handle), __pyx_v_algo, ((cusparseOperation_t)__pyx_v_transA), ((cusparseOperation_t)__pyx_v_transB), __pyx_v_m, __pyx_v_nrhs, __pyx_v_nnz, ((double const *)__pyx_v_alpha), ((cusparseMatDescr_t const )__pyx_v_descrA), ((double const *)__pyx_v_csrSortedValA), ((int const *)__pyx_v_csrSortedRowPtrA), ((int const *)__pyx_v_csrSortedColIndA), ((double *)__pyx_v_B), __pyx_v_ldb, ((csrsm2Info_t)__pyx_v_info), ((cusparseSolvePolicy_t)__pyx_v_policy), ((void *)__pyx_v_pBuffer));

  /* "cupy_backends/cuda/libs/cusparse.pyx":2247
 *         <const int*>csrSortedColIndA, <double*>B, ldb,
 *         <csrsm2Info_t>info, <cusparseSolvePolicy_t>policy, <void*>pBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef void ccsrsm2_solve(
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 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_backends/cuda/libs/cusparse.pyx":2235
 *     check_status(status)
 * 
 * cpdef void dcsrsm2_solve(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int algo, int transA, int transB, int m, int nrhs,
 *         int nnz, size_t alpha, size_t descrA, size_t csrSortedValA,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.dcsrsm2_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_119dcsrsm2_solve(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_118dcsrsm2_solve, "dcsrsm2_solve(intptr_t handle, int algo, int transA, int transB, int m, int nrhs, int nnz, size_t alpha, size_t descrA, size_t csrSortedValA, size_t csrSortedRowPtrA, size_t csrSortedColIndA, size_t B, int ldb, size_t info, int policy, size_t pBuffer) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_119dcsrsm2_solve(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_t __pyx_v_handle;
  int __pyx_v_algo;
  int __pyx_v_transA;
  int __pyx_v_transB;
  int __pyx_v_m;
  int __pyx_v_nrhs;
  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_info;
  int __pyx_v_policy;
  size_t __pyx_v_pBuffer;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[17] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dcsrsm2_solve (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_algo,&__pyx_mstate_global->__pyx_n_u_transA,&__pyx_mstate_global->__pyx_n_u_transB,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_nrhs,&__pyx_mstate_global->__pyx_n_u_nnz,&__pyx_mstate_global->__pyx_n_u_alpha,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_csrSortedValA,&__pyx_mstate_global->__pyx_n_u_csrSortedRowPtrA,&__pyx_mstate_global->__pyx_n_u_csrSortedColIndA,&__pyx_mstate_global->__pyx_n_u_B,&__pyx_mstate_global->__pyx_n_u_ldb,&__pyx_mstate_global->__pyx_n_u_info,&__pyx_mstate_global->__pyx_n_u_policy,&__pyx_mstate_global->__pyx_n_u_pBuffer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 2235, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 17:
        values[16] = __Pyx_ArgRef_FASTCALL(__pyx_args, 16);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[16])) __PYX_ERR(0, 2235, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 16:
        values[15] = __Pyx_ArgRef_FASTCALL(__pyx_args, 15);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 2235, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 15:
        values[14] = __Pyx_ArgRef_FASTCALL(__pyx_args, 14);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 2235, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 14:
        values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 2235, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 13:
        values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 2235, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 12:
        values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 2235, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 11:
        values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 2235, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 2235, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 2235, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 2235, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 2235, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 2235, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 2235, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2235, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2235, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2235, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2235, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "dcsrsm2_solve", 0) < (0)) __PYX_ERR(0, 2235, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 17; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("dcsrsm2_solve", 1, 17, 17, i); __PYX_ERR(0, 2235, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 17)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2235, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2235, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2235, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2235, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 2235, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 2235, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 2235, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 2235, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 2235, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 2235, __pyx_L3_error)
      values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 2235, __pyx_L3_error)
      values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 2235, __pyx_L3_error)
      values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 2235, __pyx_L3_error)
      values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 2235, __pyx_L3_error)
      values[14] = __Pyx_ArgRef_FASTCALL(__pyx_args, 14);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 2235, __pyx_L3_error)
      values[15] = __Pyx_ArgRef_FASTCALL(__pyx_args, 15);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 2235, __pyx_L3_error)
      values[16] = __Pyx_ArgRef_FASTCALL(__pyx_args, 16);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[16])) __PYX_ERR(0, 2235, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2236, __pyx_L3_error)
    __pyx_v_algo = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_algo == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2236, __pyx_L3_error)
    __pyx_v_transA = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_transA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2236, __pyx_L3_error)
    __pyx_v_transB = __Pyx_PyLong_As_int(values[3]); if (unlikely((__pyx_v_transB == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2236, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[4]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2236, __pyx_L3_error)
    __pyx_v_nrhs = __Pyx_PyLong_As_int(values[5]); if (unlikely((__pyx_v_nrhs == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2236, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyLong_As_int(values[6]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2237, __pyx_L3_error)
    __pyx_v_alpha = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_alpha == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2237, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[8]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2237, __pyx_L3_error)
    __pyx_v_csrSortedValA = __Pyx_PyLong_As_size_t(values[9]); if (unlikely((__pyx_v_csrSortedValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2237, __pyx_L3_error)
    __pyx_v_csrSortedRowPtrA = __Pyx_PyLong_As_size_t(values[10]); if (unlikely((__pyx_v_csrSortedRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2238, __pyx_L3_error)
    __pyx_v_csrSortedColIndA = __Pyx_PyLong_As_size_t(values[11]); if (unlikely((__pyx_v_csrSortedColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2238, __pyx_L3_error)
    __pyx_v_B = __Pyx_PyLong_As_size_t(values[12]); if (unlikely((__pyx_v_B == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2238, __pyx_L3_error)
    __pyx_v_ldb = __Pyx_PyLong_As_int(values[13]); if (unlikely((__pyx_v_ldb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2238, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyLong_As_size_t(values[14]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2239, __pyx_L3_error)
    __pyx_v_policy = __Pyx_PyLong_As_int(values[15]); if (unlikely((__pyx_v_policy == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2239, __pyx_L3_error)
    __pyx_v_pBuffer = __Pyx_PyLong_As_size_t(values[16]); if (unlikely((__pyx_v_pBuffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2239, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("dcsrsm2_solve", 1, 17, 17, __pyx_nargs); __PYX_ERR(0, 2235, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.dcsrsm2_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_118dcsrsm2_solve(__pyx_self, __pyx_v_handle, __pyx_v_algo, __pyx_v_transA, __pyx_v_transB, __pyx_v_m, __pyx_v_nrhs, __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_info, __pyx_v_policy, __pyx_v_pBuffer);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_118dcsrsm2_solve(CYTHON_UNUSED PyObject *__pyx_self, intptr_t __pyx_v_handle, int __pyx_v_algo, int __pyx_v_transA, int __pyx_v_transB, int __pyx_v_m, int __pyx_v_nrhs, 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_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("dcsrsm2_solve", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_dcsrsm2_solve(__pyx_v_handle, __pyx_v_algo, __pyx_v_transA, __pyx_v_transB, __pyx_v_m, __pyx_v_nrhs, __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_info, __pyx_v_policy, __pyx_v_pBuffer, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2235, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2235, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":2249
 *     check_status(status)
 * 
 * cpdef void ccsrsm2_solve(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int algo, int transA, int transB, int m, int nrhs,
 *         int nnz, size_t alpha, size_t descrA, size_t csrSortedValA,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_121ccsrsm2_solve(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_ccsrsm2_solve(intptr_t __pyx_v_handle, int __pyx_v_algo, int __pyx_v_transA, int __pyx_v_transB, int __pyx_v_m, int __pyx_v_nrhs, 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_info, int __pyx_v_policy, size_t __pyx_v_pBuffer, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("ccsrsm2_solve", 0);

  /* "cupy_backends/cuda/libs/cusparse.pyx":2254
 *         size_t csrSortedRowPtrA, size_t csrSortedColIndA, size_t B, int ldb,
 *         size_t info, int policy, size_t pBuffer) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     status = cusparseCcsrsm2_solve(
 *         <Handle>handle, algo, <Operation>transA, <Operation>transB, m, nrhs,
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2254, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":2255
 *         size_t info, int policy, size_t pBuffer) except *:
 *     _setStream(handle)
 *     status = cusparseCcsrsm2_solve(             # <<<<<<<<<<<<<<
 *         <Handle>handle, algo, <Operation>transA, <Operation>transB, m, nrhs,
 *         nnz, <const cuComplex*>alpha, <const MatDescr>descrA,
*/
  __pyx_v_status = cusparseCcsrsm2_solve(((cusparseHandle_t)__pyx_v_handle), __pyx_v_algo, ((cusparseOperation_t)__pyx_v_transA), ((cusparseOperation_t)__pyx_v_transB), __pyx_v_m, __pyx_v_nrhs, __pyx_v_nnz, ((cuComplex const *)__pyx_v_alpha), ((cusparseMatDescr_t const )__pyx_v_descrA), ((cuComplex const *)__pyx_v_csrSortedValA), ((int const *)__pyx_v_csrSortedRowPtrA), ((int const *)__pyx_v_csrSortedColIndA), ((cuComplex *)__pyx_v_B), __pyx_v_ldb, ((csrsm2Info_t)__pyx_v_info), ((cusparseSolvePolicy_t)__pyx_v_policy), ((void *)__pyx_v_pBuffer));

  /* "cupy_backends/cuda/libs/cusparse.pyx":2261
 *         <const int*>csrSortedColIndA, <cuComplex*>B, ldb,
 *         <csrsm2Info_t>info, <cusparseSolvePolicy_t>policy, <void*>pBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef void zcsrsm2_solve(
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2261, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":2249
 *     check_status(status)
 * 
 * cpdef void ccsrsm2_solve(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int algo, int transA, int transB, int m, int nrhs,
 *         int nnz, size_t alpha, size_t descrA, size_t csrSortedValA,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.ccsrsm2_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_121ccsrsm2_solve(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_120ccsrsm2_solve, "ccsrsm2_solve(intptr_t handle, int algo, int transA, int transB, int m, int nrhs, int nnz, size_t alpha, size_t descrA, size_t csrSortedValA, size_t csrSortedRowPtrA, size_t csrSortedColIndA, size_t B, int ldb, size_t info, int policy, size_t pBuffer) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_121ccsrsm2_solve(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_t __pyx_v_handle;
  int __pyx_v_algo;
  int __pyx_v_transA;
  int __pyx_v_transB;
  int __pyx_v_m;
  int __pyx_v_nrhs;
  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_info;
  int __pyx_v_policy;
  size_t __pyx_v_pBuffer;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[17] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ccsrsm2_solve (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_algo,&__pyx_mstate_global->__pyx_n_u_transA,&__pyx_mstate_global->__pyx_n_u_transB,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_nrhs,&__pyx_mstate_global->__pyx_n_u_nnz,&__pyx_mstate_global->__pyx_n_u_alpha,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_csrSortedValA,&__pyx_mstate_global->__pyx_n_u_csrSortedRowPtrA,&__pyx_mstate_global->__pyx_n_u_csrSortedColIndA,&__pyx_mstate_global->__pyx_n_u_B,&__pyx_mstate_global->__pyx_n_u_ldb,&__pyx_mstate_global->__pyx_n_u_info,&__pyx_mstate_global->__pyx_n_u_policy,&__pyx_mstate_global->__pyx_n_u_pBuffer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 2249, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 17:
        values[16] = __Pyx_ArgRef_FASTCALL(__pyx_args, 16);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[16])) __PYX_ERR(0, 2249, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 16:
        values[15] = __Pyx_ArgRef_FASTCALL(__pyx_args, 15);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 2249, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 15:
        values[14] = __Pyx_ArgRef_FASTCALL(__pyx_args, 14);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 2249, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 14:
        values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 2249, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 13:
        values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 2249, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 12:
        values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 2249, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 11:
        values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 2249, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 2249, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 2249, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 2249, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 2249, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 2249, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 2249, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2249, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2249, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2249, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2249, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "ccsrsm2_solve", 0) < (0)) __PYX_ERR(0, 2249, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 17; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("ccsrsm2_solve", 1, 17, 17, i); __PYX_ERR(0, 2249, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 17)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2249, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2249, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2249, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2249, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 2249, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 2249, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 2249, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 2249, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 2249, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 2249, __pyx_L3_error)
      values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 2249, __pyx_L3_error)
      values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 2249, __pyx_L3_error)
      values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 2249, __pyx_L3_error)
      values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 2249, __pyx_L3_error)
      values[14] = __Pyx_ArgRef_FASTCALL(__pyx_args, 14);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 2249, __pyx_L3_error)
      values[15] = __Pyx_ArgRef_FASTCALL(__pyx_args, 15);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 2249, __pyx_L3_error)
      values[16] = __Pyx_ArgRef_FASTCALL(__pyx_args, 16);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[16])) __PYX_ERR(0, 2249, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2250, __pyx_L3_error)
    __pyx_v_algo = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_algo == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2250, __pyx_L3_error)
    __pyx_v_transA = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_transA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2250, __pyx_L3_error)
    __pyx_v_transB = __Pyx_PyLong_As_int(values[3]); if (unlikely((__pyx_v_transB == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2250, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[4]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2250, __pyx_L3_error)
    __pyx_v_nrhs = __Pyx_PyLong_As_int(values[5]); if (unlikely((__pyx_v_nrhs == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2250, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyLong_As_int(values[6]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2251, __pyx_L3_error)
    __pyx_v_alpha = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_alpha == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2251, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[8]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2251, __pyx_L3_error)
    __pyx_v_csrSortedValA = __Pyx_PyLong_As_size_t(values[9]); if (unlikely((__pyx_v_csrSortedValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2251, __pyx_L3_error)
    __pyx_v_csrSortedRowPtrA = __Pyx_PyLong_As_size_t(values[10]); if (unlikely((__pyx_v_csrSortedRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2252, __pyx_L3_error)
    __pyx_v_csrSortedColIndA = __Pyx_PyLong_As_size_t(values[11]); if (unlikely((__pyx_v_csrSortedColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2252, __pyx_L3_error)
    __pyx_v_B = __Pyx_PyLong_As_size_t(values[12]); if (unlikely((__pyx_v_B == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2252, __pyx_L3_error)
    __pyx_v_ldb = __Pyx_PyLong_As_int(values[13]); if (unlikely((__pyx_v_ldb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2252, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyLong_As_size_t(values[14]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2253, __pyx_L3_error)
    __pyx_v_policy = __Pyx_PyLong_As_int(values[15]); if (unlikely((__pyx_v_policy == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2253, __pyx_L3_error)
    __pyx_v_pBuffer = __Pyx_PyLong_As_size_t(values[16]); if (unlikely((__pyx_v_pBuffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2253, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ccsrsm2_solve", 1, 17, 17, __pyx_nargs); __PYX_ERR(0, 2249, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.ccsrsm2_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_120ccsrsm2_solve(__pyx_self, __pyx_v_handle, __pyx_v_algo, __pyx_v_transA, __pyx_v_transB, __pyx_v_m, __pyx_v_nrhs, __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_info, __pyx_v_policy, __pyx_v_pBuffer);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_120ccsrsm2_solve(CYTHON_UNUSED PyObject *__pyx_self, intptr_t __pyx_v_handle, int __pyx_v_algo, int __pyx_v_transA, int __pyx_v_transB, int __pyx_v_m, int __pyx_v_nrhs, 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_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("ccsrsm2_solve", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_ccsrsm2_solve(__pyx_v_handle, __pyx_v_algo, __pyx_v_transA, __pyx_v_transB, __pyx_v_m, __pyx_v_nrhs, __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_info, __pyx_v_policy, __pyx_v_pBuffer, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2249, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2249, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":2263
 *     check_status(status)
 * 
 * cpdef void zcsrsm2_solve(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int algo, int transA, int transB, int m, int nrhs,
 *         int nnz, size_t alpha, size_t descrA, size_t csrSortedValA,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_123zcsrsm2_solve(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_zcsrsm2_solve(intptr_t __pyx_v_handle, int __pyx_v_algo, int __pyx_v_transA, int __pyx_v_transB, int __pyx_v_m, int __pyx_v_nrhs, 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_info, int __pyx_v_policy, size_t __pyx_v_pBuffer, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("zcsrsm2_solve", 0);

  /* "cupy_backends/cuda/libs/cusparse.pyx":2268
 *         size_t csrSortedRowPtrA, size_t csrSortedColIndA, size_t B, int ldb,
 *         size_t info, int policy, size_t pBuffer) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     status = cusparseZcsrsm2_solve(
 *         <Handle>handle, algo, <Operation>transA, <Operation>transB, m, nrhs,
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2268, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":2269
 *         size_t info, int policy, size_t pBuffer) except *:
 *     _setStream(handle)
 *     status = cusparseZcsrsm2_solve(             # <<<<<<<<<<<<<<
 *         <Handle>handle, algo, <Operation>transA, <Operation>transB, m, nrhs,
 *         nnz, <const cuDoubleComplex*>alpha, <const MatDescr>descrA,
*/
  __pyx_v_status = cusparseZcsrsm2_solve(((cusparseHandle_t)__pyx_v_handle), __pyx_v_algo, ((cusparseOperation_t)__pyx_v_transA), ((cusparseOperation_t)__pyx_v_transB), __pyx_v_m, __pyx_v_nrhs, __pyx_v_nnz, ((cuDoubleComplex const *)__pyx_v_alpha), ((cusparseMatDescr_t const )__pyx_v_descrA), ((cuDoubleComplex const *)__pyx_v_csrSortedValA), ((int const *)__pyx_v_csrSortedRowPtrA), ((int const *)__pyx_v_csrSortedColIndA), ((cuDoubleComplex *)__pyx_v_B), __pyx_v_ldb, ((csrsm2Info_t)__pyx_v_info), ((cusparseSolvePolicy_t)__pyx_v_policy), ((void *)__pyx_v_pBuffer));

  /* "cupy_backends/cuda/libs/cusparse.pyx":2275
 *         <const int*>csrSortedColIndA, <cuDoubleComplex*>B, ldb,
 *         <csrsm2Info_t>info, <cusparseSolvePolicy_t>policy, <void*>pBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef void xcsrsm2_zeroPivot(
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2275, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":2263
 *     check_status(status)
 * 
 * cpdef void zcsrsm2_solve(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int algo, int transA, int transB, int m, int nrhs,
 *         int nnz, size_t alpha, size_t descrA, size_t csrSortedValA,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.zcsrsm2_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_123zcsrsm2_solve(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_122zcsrsm2_solve, "zcsrsm2_solve(intptr_t handle, int algo, int transA, int transB, int m, int nrhs, int nnz, size_t alpha, size_t descrA, size_t csrSortedValA, size_t csrSortedRowPtrA, size_t csrSortedColIndA, size_t B, int ldb, size_t info, int policy, size_t pBuffer) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_123zcsrsm2_solve(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_t __pyx_v_handle;
  int __pyx_v_algo;
  int __pyx_v_transA;
  int __pyx_v_transB;
  int __pyx_v_m;
  int __pyx_v_nrhs;
  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_info;
  int __pyx_v_policy;
  size_t __pyx_v_pBuffer;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[17] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("zcsrsm2_solve (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_algo,&__pyx_mstate_global->__pyx_n_u_transA,&__pyx_mstate_global->__pyx_n_u_transB,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_nrhs,&__pyx_mstate_global->__pyx_n_u_nnz,&__pyx_mstate_global->__pyx_n_u_alpha,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_csrSortedValA,&__pyx_mstate_global->__pyx_n_u_csrSortedRowPtrA,&__pyx_mstate_global->__pyx_n_u_csrSortedColIndA,&__pyx_mstate_global->__pyx_n_u_B,&__pyx_mstate_global->__pyx_n_u_ldb,&__pyx_mstate_global->__pyx_n_u_info,&__pyx_mstate_global->__pyx_n_u_policy,&__pyx_mstate_global->__pyx_n_u_pBuffer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 2263, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 17:
        values[16] = __Pyx_ArgRef_FASTCALL(__pyx_args, 16);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[16])) __PYX_ERR(0, 2263, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 16:
        values[15] = __Pyx_ArgRef_FASTCALL(__pyx_args, 15);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 2263, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 15:
        values[14] = __Pyx_ArgRef_FASTCALL(__pyx_args, 14);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 2263, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 14:
        values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 2263, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 13:
        values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 2263, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 12:
        values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 2263, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 11:
        values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 2263, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 2263, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 2263, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 2263, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 2263, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 2263, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 2263, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2263, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2263, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2263, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2263, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "zcsrsm2_solve", 0) < (0)) __PYX_ERR(0, 2263, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 17; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("zcsrsm2_solve", 1, 17, 17, i); __PYX_ERR(0, 2263, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 17)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2263, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2263, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2263, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2263, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 2263, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 2263, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 2263, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 2263, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 2263, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 2263, __pyx_L3_error)
      values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 2263, __pyx_L3_error)
      values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 2263, __pyx_L3_error)
      values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 2263, __pyx_L3_error)
      values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 2263, __pyx_L3_error)
      values[14] = __Pyx_ArgRef_FASTCALL(__pyx_args, 14);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 2263, __pyx_L3_error)
      values[15] = __Pyx_ArgRef_FASTCALL(__pyx_args, 15);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 2263, __pyx_L3_error)
      values[16] = __Pyx_ArgRef_FASTCALL(__pyx_args, 16);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[16])) __PYX_ERR(0, 2263, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2264, __pyx_L3_error)
    __pyx_v_algo = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_algo == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2264, __pyx_L3_error)
    __pyx_v_transA = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_transA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2264, __pyx_L3_error)
    __pyx_v_transB = __Pyx_PyLong_As_int(values[3]); if (unlikely((__pyx_v_transB == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2264, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[4]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2264, __pyx_L3_error)
    __pyx_v_nrhs = __Pyx_PyLong_As_int(values[5]); if (unlikely((__pyx_v_nrhs == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2264, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyLong_As_int(values[6]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2265, __pyx_L3_error)
    __pyx_v_alpha = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_alpha == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2265, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[8]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2265, __pyx_L3_error)
    __pyx_v_csrSortedValA = __Pyx_PyLong_As_size_t(values[9]); if (unlikely((__pyx_v_csrSortedValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2265, __pyx_L3_error)
    __pyx_v_csrSortedRowPtrA = __Pyx_PyLong_As_size_t(values[10]); if (unlikely((__pyx_v_csrSortedRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2266, __pyx_L3_error)
    __pyx_v_csrSortedColIndA = __Pyx_PyLong_As_size_t(values[11]); if (unlikely((__pyx_v_csrSortedColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2266, __pyx_L3_error)
    __pyx_v_B = __Pyx_PyLong_As_size_t(values[12]); if (unlikely((__pyx_v_B == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2266, __pyx_L3_error)
    __pyx_v_ldb = __Pyx_PyLong_As_int(values[13]); if (unlikely((__pyx_v_ldb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2266, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyLong_As_size_t(values[14]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2267, __pyx_L3_error)
    __pyx_v_policy = __Pyx_PyLong_As_int(values[15]); if (unlikely((__pyx_v_policy == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2267, __pyx_L3_error)
    __pyx_v_pBuffer = __Pyx_PyLong_As_size_t(values[16]); if (unlikely((__pyx_v_pBuffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2267, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("zcsrsm2_solve", 1, 17, 17, __pyx_nargs); __PYX_ERR(0, 2263, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.zcsrsm2_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_122zcsrsm2_solve(__pyx_self, __pyx_v_handle, __pyx_v_algo, __pyx_v_transA, __pyx_v_transB, __pyx_v_m, __pyx_v_nrhs, __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_info, __pyx_v_policy, __pyx_v_pBuffer);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_122zcsrsm2_solve(CYTHON_UNUSED PyObject *__pyx_self, intptr_t __pyx_v_handle, int __pyx_v_algo, int __pyx_v_transA, int __pyx_v_transB, int __pyx_v_m, int __pyx_v_nrhs, 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_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("zcsrsm2_solve", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_zcsrsm2_solve(__pyx_v_handle, __pyx_v_algo, __pyx_v_transA, __pyx_v_transB, __pyx_v_m, __pyx_v_nrhs, __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_info, __pyx_v_policy, __pyx_v_pBuffer, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2263, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2263, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":2277
 *     check_status(status)
 * 
 * cpdef void xcsrsm2_zeroPivot(             # <<<<<<<<<<<<<<
 *         intptr_t handle, size_t info, size_t position) except *:
 *     _setStream(handle)
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_125xcsrsm2_zeroPivot(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_xcsrsm2_zeroPivot(intptr_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;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("xcsrsm2_zeroPivot", 0);

  /* "cupy_backends/cuda/libs/cusparse.pyx":2279
 * cpdef void xcsrsm2_zeroPivot(
 *         intptr_t handle, size_t info, size_t position) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     status = cusparseXcsrsm2_zeroPivot(
 *         <Handle>handle, <csrsm2Info_t>info, <int*>position)
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2279, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":2280
 *         intptr_t handle, size_t info, size_t position) except *:
 *     _setStream(handle)
 *     status = cusparseXcsrsm2_zeroPivot(             # <<<<<<<<<<<<<<
 *         <Handle>handle, <csrsm2Info_t>info, <int*>position)
 *     check_status(status)
*/
  __pyx_v_status = cusparseXcsrsm2_zeroPivot(((cusparseHandle_t)__pyx_v_handle), ((csrsm2Info_t)__pyx_v_info), ((int *)__pyx_v_position));

  /* "cupy_backends/cuda/libs/cusparse.pyx":2282
 *     status = cusparseXcsrsm2_zeroPivot(
 *         <Handle>handle, <csrsm2Info_t>info, <int*>position)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * ########################################
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2282, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":2277
 *     check_status(status)
 * 
 * cpdef void xcsrsm2_zeroPivot(             # <<<<<<<<<<<<<<
 *         intptr_t handle, size_t info, size_t position) except *:
 *     _setStream(handle)
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.xcsrsm2_zeroPivot", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_125xcsrsm2_zeroPivot(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_124xcsrsm2_zeroPivot, "xcsrsm2_zeroPivot(intptr_t handle, size_t info, size_t position) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_125xcsrsm2_zeroPivot(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_t __pyx_v_handle;
  size_t __pyx_v_info;
  size_t __pyx_v_position;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("xcsrsm2_zeroPivot (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_info,&__pyx_mstate_global->__pyx_n_u_position,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 2277, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2277, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2277, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2277, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "xcsrsm2_zeroPivot", 0) < (0)) __PYX_ERR(0, 2277, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("xcsrsm2_zeroPivot", 1, 3, 3, i); __PYX_ERR(0, 2277, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2277, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2277, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2277, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2278, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyLong_As_size_t(values[1]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2278, __pyx_L3_error)
    __pyx_v_position = __Pyx_PyLong_As_size_t(values[2]); if (unlikely((__pyx_v_position == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2278, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("xcsrsm2_zeroPivot", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 2277, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.xcsrsm2_zeroPivot", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_124xcsrsm2_zeroPivot(__pyx_self, __pyx_v_handle, __pyx_v_info, __pyx_v_position);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_124xcsrsm2_zeroPivot(CYTHON_UNUSED PyObject *__pyx_self, intptr_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("xcsrsm2_zeroPivot", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_xcsrsm2_zeroPivot(__pyx_v_handle, __pyx_v_info, __pyx_v_position, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2277, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2277, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":2287
 * # cuSPARSE Extra Function
 * 
 * cpdef void xcsrgeamNnz(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int n, size_t descrA, int nnzA,
 *         size_t csrRowPtrA, size_t csrColIndA, size_t descrB,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_127xcsrgeamNnz(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_xcsrgeamNnz(intptr_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;
  __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_backends/cuda/libs/cusparse.pyx":2292
 *         int nnzB, size_t csrRowPtrB, size_t csrColIndB,
 *         size_t descrC, size_t csrRowPtrC, size_t nnzTotalDevHostPtr) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     status = cusparseXcsrgeamNnz(
 *         <Handle>handle, m, n, <const MatDescr>descrA, nnzA,
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2292, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":2293
 *         size_t descrC, size_t csrRowPtrC, size_t nnzTotalDevHostPtr) except *:
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":2299
 *         <const int *>csrColIndB, <const MatDescr>descrC, <int *>csrRowPtrC,
 *         <int *>nnzTotalDevHostPtr)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef void scsrgeam(
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_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_backends/cuda/libs/cusparse.pyx":2287
 * # cuSPARSE Extra Function
 * 
 * cpdef void xcsrgeamNnz(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int n, size_t descrA, int nnzA,
 *         size_t csrRowPtrA, size_t csrColIndA, size_t descrB,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.xcsrgeamNnz", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_127xcsrgeamNnz(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_126xcsrgeamNnz, "xcsrgeamNnz(intptr_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) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_127xcsrgeamNnz(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[14] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("xcsrgeamNnz (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_n,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_nnzA,&__pyx_mstate_global->__pyx_n_u_csrRowPtrA,&__pyx_mstate_global->__pyx_n_u_csrColIndA,&__pyx_mstate_global->__pyx_n_u_descrB,&__pyx_mstate_global->__pyx_n_u_nnzB,&__pyx_mstate_global->__pyx_n_u_csrRowPtrB,&__pyx_mstate_global->__pyx_n_u_csrColIndB,&__pyx_mstate_global->__pyx_n_u_descrC,&__pyx_mstate_global->__pyx_n_u_csrRowPtrC,&__pyx_mstate_global->__pyx_n_u_nnzTotalDevHostPtr,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 2287, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 14:
        values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 2287, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 13:
        values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 2287, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 12:
        values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 2287, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 11:
        values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 2287, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 2287, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 2287, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 2287, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 2287, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 2287, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 2287, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2287, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2287, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2287, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2287, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "xcsrgeamNnz", 0) < (0)) __PYX_ERR(0, 2287, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 14; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("xcsrgeamNnz", 1, 14, 14, i); __PYX_ERR(0, 2287, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 14)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2287, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2287, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2287, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2287, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 2287, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 2287, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 2287, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 2287, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 2287, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 2287, __pyx_L3_error)
      values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 2287, __pyx_L3_error)
      values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 2287, __pyx_L3_error)
      values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 2287, __pyx_L3_error)
      values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 2287, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2288, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2288, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2288, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[3]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2288, __pyx_L3_error)
    __pyx_v_nnzA = __Pyx_PyLong_As_int(values[4]); if (unlikely((__pyx_v_nnzA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2288, __pyx_L3_error)
    __pyx_v_csrRowPtrA = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_csrRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2289, __pyx_L3_error)
    __pyx_v_csrColIndA = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_csrColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2289, __pyx_L3_error)
    __pyx_v_descrB = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_descrB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2289, __pyx_L3_error)
    __pyx_v_nnzB = __Pyx_PyLong_As_int(values[8]); if (unlikely((__pyx_v_nnzB == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2290, __pyx_L3_error)
    __pyx_v_csrRowPtrB = __Pyx_PyLong_As_size_t(values[9]); if (unlikely((__pyx_v_csrRowPtrB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2290, __pyx_L3_error)
    __pyx_v_csrColIndB = __Pyx_PyLong_As_size_t(values[10]); if (unlikely((__pyx_v_csrColIndB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2290, __pyx_L3_error)
    __pyx_v_descrC = __Pyx_PyLong_As_size_t(values[11]); if (unlikely((__pyx_v_descrC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2291, __pyx_L3_error)
    __pyx_v_csrRowPtrC = __Pyx_PyLong_As_size_t(values[12]); if (unlikely((__pyx_v_csrRowPtrC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2291, __pyx_L3_error)
    __pyx_v_nnzTotalDevHostPtr = __Pyx_PyLong_As_size_t(values[13]); if (unlikely((__pyx_v_nnzTotalDevHostPtr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2291, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("xcsrgeamNnz", 1, 14, 14, __pyx_nargs); __PYX_ERR(0, 2287, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.xcsrgeamNnz", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_126xcsrgeamNnz(__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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_126xcsrgeamNnz(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2287, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2287, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":2301
 *     check_status(status)
 * 
 * cpdef void scsrgeam(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int n, size_t alpha, size_t descrA,
 *         int nnzA, size_t csrValA, size_t csrRowPtrA,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_129scsrgeam(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_scsrgeam(intptr_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;
  __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_backends/cuda/libs/cusparse.pyx":2308
 *         size_t csrColIndB, size_t descrC, size_t csrValC,
 *         size_t csrRowPtrC, size_t csrColIndC) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     status = cusparseScsrgeam(
 *         <Handle>handle, m, n, <const float *>alpha,
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2308, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":2309
 *         size_t csrRowPtrC, size_t csrColIndC) except *:
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":2317
 *         <const MatDescr>descrC, <float *>csrValC, <int *>csrRowPtrC,
 *         <int *>csrColIndC)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef void dcsrgeam(
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 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_backends/cuda/libs/cusparse.pyx":2301
 *     check_status(status)
 * 
 * cpdef void scsrgeam(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int n, size_t alpha, size_t descrA,
 *         int nnzA, size_t csrValA, size_t csrRowPtrA,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.scsrgeam", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_129scsrgeam(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_128scsrgeam, "scsrgeam(intptr_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) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_129scsrgeam(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[19] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("scsrgeam (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_n,&__pyx_mstate_global->__pyx_n_u_alpha,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_nnzA,&__pyx_mstate_global->__pyx_n_u_csrValA,&__pyx_mstate_global->__pyx_n_u_csrRowPtrA,&__pyx_mstate_global->__pyx_n_u_csrColIndA,&__pyx_mstate_global->__pyx_n_u_beta,&__pyx_mstate_global->__pyx_n_u_descrB,&__pyx_mstate_global->__pyx_n_u_nnzB,&__pyx_mstate_global->__pyx_n_u_csrValB,&__pyx_mstate_global->__pyx_n_u_csrRowPtrB,&__pyx_mstate_global->__pyx_n_u_csrColIndB,&__pyx_mstate_global->__pyx_n_u_descrC,&__pyx_mstate_global->__pyx_n_u_csrValC,&__pyx_mstate_global->__pyx_n_u_csrRowPtrC,&__pyx_mstate_global->__pyx_n_u_csrColIndC,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 2301, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 19:
        values[18] = __Pyx_ArgRef_FASTCALL(__pyx_args, 18);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[18])) __PYX_ERR(0, 2301, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 18:
        values[17] = __Pyx_ArgRef_FASTCALL(__pyx_args, 17);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[17])) __PYX_ERR(0, 2301, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 17:
        values[16] = __Pyx_ArgRef_FASTCALL(__pyx_args, 16);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[16])) __PYX_ERR(0, 2301, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 16:
        values[15] = __Pyx_ArgRef_FASTCALL(__pyx_args, 15);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 2301, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 15:
        values[14] = __Pyx_ArgRef_FASTCALL(__pyx_args, 14);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 2301, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 14:
        values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 2301, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 13:
        values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 2301, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 12:
        values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 2301, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 11:
        values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 2301, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 2301, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 2301, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 2301, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 2301, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 2301, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 2301, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2301, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2301, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2301, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2301, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "scsrgeam", 0) < (0)) __PYX_ERR(0, 2301, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 19; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("scsrgeam", 1, 19, 19, i); __PYX_ERR(0, 2301, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 19)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2301, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2301, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2301, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2301, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 2301, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 2301, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 2301, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 2301, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 2301, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 2301, __pyx_L3_error)
      values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 2301, __pyx_L3_error)
      values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 2301, __pyx_L3_error)
      values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 2301, __pyx_L3_error)
      values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 2301, __pyx_L3_error)
      values[14] = __Pyx_ArgRef_FASTCALL(__pyx_args, 14);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 2301, __pyx_L3_error)
      values[15] = __Pyx_ArgRef_FASTCALL(__pyx_args, 15);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 2301, __pyx_L3_error)
      values[16] = __Pyx_ArgRef_FASTCALL(__pyx_args, 16);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[16])) __PYX_ERR(0, 2301, __pyx_L3_error)
      values[17] = __Pyx_ArgRef_FASTCALL(__pyx_args, 17);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[17])) __PYX_ERR(0, 2301, __pyx_L3_error)
      values[18] = __Pyx_ArgRef_FASTCALL(__pyx_args, 18);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[18])) __PYX_ERR(0, 2301, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2302, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2302, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2302, __pyx_L3_error)
    __pyx_v_alpha = __Pyx_PyLong_As_size_t(values[3]); if (unlikely((__pyx_v_alpha == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2302, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2302, __pyx_L3_error)
    __pyx_v_nnzA = __Pyx_PyLong_As_int(values[5]); if (unlikely((__pyx_v_nnzA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2303, __pyx_L3_error)
    __pyx_v_csrValA = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_csrValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2303, __pyx_L3_error)
    __pyx_v_csrRowPtrA = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_csrRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2303, __pyx_L3_error)
    __pyx_v_csrColIndA = __Pyx_PyLong_As_size_t(values[8]); if (unlikely((__pyx_v_csrColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2304, __pyx_L3_error)
    __pyx_v_beta = __Pyx_PyLong_As_size_t(values[9]); if (unlikely((__pyx_v_beta == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2304, __pyx_L3_error)
    __pyx_v_descrB = __Pyx_PyLong_As_size_t(values[10]); if (unlikely((__pyx_v_descrB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2304, __pyx_L3_error)
    __pyx_v_nnzB = __Pyx_PyLong_As_int(values[11]); if (unlikely((__pyx_v_nnzB == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2305, __pyx_L3_error)
    __pyx_v_csrValB = __Pyx_PyLong_As_size_t(values[12]); if (unlikely((__pyx_v_csrValB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2305, __pyx_L3_error)
    __pyx_v_csrRowPtrB = __Pyx_PyLong_As_size_t(values[13]); if (unlikely((__pyx_v_csrRowPtrB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2305, __pyx_L3_error)
    __pyx_v_csrColIndB = __Pyx_PyLong_As_size_t(values[14]); if (unlikely((__pyx_v_csrColIndB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2306, __pyx_L3_error)
    __pyx_v_descrC = __Pyx_PyLong_As_size_t(values[15]); if (unlikely((__pyx_v_descrC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2306, __pyx_L3_error)
    __pyx_v_csrValC = __Pyx_PyLong_As_size_t(values[16]); if (unlikely((__pyx_v_csrValC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2306, __pyx_L3_error)
    __pyx_v_csrRowPtrC = __Pyx_PyLong_As_size_t(values[17]); if (unlikely((__pyx_v_csrRowPtrC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2307, __pyx_L3_error)
    __pyx_v_csrColIndC = __Pyx_PyLong_As_size_t(values[18]); if (unlikely((__pyx_v_csrColIndC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2307, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("scsrgeam", 1, 19, 19, __pyx_nargs); __PYX_ERR(0, 2301, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.scsrgeam", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_128scsrgeam(__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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_128scsrgeam(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2301, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); 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_backends.cuda.libs.cusparse.scsrgeam", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy_backends/cuda/libs/cusparse.pyx":2319
 *     check_status(status)
 * 
 * cpdef void dcsrgeam(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int n, size_t alpha, size_t descrA,
 *         int nnzA, size_t csrValA, size_t csrRowPtrA,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_131dcsrgeam(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_dcsrgeam(intptr_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;
  __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_backends/cuda/libs/cusparse.pyx":2326
 *         size_t csrColIndB, size_t descrC, size_t csrValC,
 *         size_t csrRowPtrC, size_t csrColIndC) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     status = cusparseDcsrgeam(
 *         <Handle>handle, m, n, <const double *>alpha,
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2326, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":2327
 *         size_t csrRowPtrC, size_t csrColIndC) except *:
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":2335
 *         <const MatDescr>descrC, <double *>csrValC, <int *>csrRowPtrC,
 *         <int *>csrColIndC)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef void ccsrgeam(
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_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_backends/cuda/libs/cusparse.pyx":2319
 *     check_status(status)
 * 
 * cpdef void dcsrgeam(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int n, size_t alpha, size_t descrA,
 *         int nnzA, size_t csrValA, size_t csrRowPtrA,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.dcsrgeam", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_131dcsrgeam(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_130dcsrgeam, "dcsrgeam(intptr_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) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_131dcsrgeam(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[19] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dcsrgeam (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_n,&__pyx_mstate_global->__pyx_n_u_alpha,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_nnzA,&__pyx_mstate_global->__pyx_n_u_csrValA,&__pyx_mstate_global->__pyx_n_u_csrRowPtrA,&__pyx_mstate_global->__pyx_n_u_csrColIndA,&__pyx_mstate_global->__pyx_n_u_beta,&__pyx_mstate_global->__pyx_n_u_descrB,&__pyx_mstate_global->__pyx_n_u_nnzB,&__pyx_mstate_global->__pyx_n_u_csrValB,&__pyx_mstate_global->__pyx_n_u_csrRowPtrB,&__pyx_mstate_global->__pyx_n_u_csrColIndB,&__pyx_mstate_global->__pyx_n_u_descrC,&__pyx_mstate_global->__pyx_n_u_csrValC,&__pyx_mstate_global->__pyx_n_u_csrRowPtrC,&__pyx_mstate_global->__pyx_n_u_csrColIndC,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 2319, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 19:
        values[18] = __Pyx_ArgRef_FASTCALL(__pyx_args, 18);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[18])) __PYX_ERR(0, 2319, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 18:
        values[17] = __Pyx_ArgRef_FASTCALL(__pyx_args, 17);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[17])) __PYX_ERR(0, 2319, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 17:
        values[16] = __Pyx_ArgRef_FASTCALL(__pyx_args, 16);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[16])) __PYX_ERR(0, 2319, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 16:
        values[15] = __Pyx_ArgRef_FASTCALL(__pyx_args, 15);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 2319, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 15:
        values[14] = __Pyx_ArgRef_FASTCALL(__pyx_args, 14);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 2319, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 14:
        values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 2319, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 13:
        values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 2319, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 12:
        values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 2319, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 11:
        values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 2319, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 2319, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 2319, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 2319, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 2319, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 2319, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 2319, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2319, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2319, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2319, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2319, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "dcsrgeam", 0) < (0)) __PYX_ERR(0, 2319, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 19; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("dcsrgeam", 1, 19, 19, i); __PYX_ERR(0, 2319, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 19)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2319, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2319, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2319, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2319, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 2319, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 2319, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 2319, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 2319, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 2319, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 2319, __pyx_L3_error)
      values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 2319, __pyx_L3_error)
      values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 2319, __pyx_L3_error)
      values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 2319, __pyx_L3_error)
      values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 2319, __pyx_L3_error)
      values[14] = __Pyx_ArgRef_FASTCALL(__pyx_args, 14);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 2319, __pyx_L3_error)
      values[15] = __Pyx_ArgRef_FASTCALL(__pyx_args, 15);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 2319, __pyx_L3_error)
      values[16] = __Pyx_ArgRef_FASTCALL(__pyx_args, 16);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[16])) __PYX_ERR(0, 2319, __pyx_L3_error)
      values[17] = __Pyx_ArgRef_FASTCALL(__pyx_args, 17);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[17])) __PYX_ERR(0, 2319, __pyx_L3_error)
      values[18] = __Pyx_ArgRef_FASTCALL(__pyx_args, 18);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[18])) __PYX_ERR(0, 2319, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2320, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2320, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2320, __pyx_L3_error)
    __pyx_v_alpha = __Pyx_PyLong_As_size_t(values[3]); if (unlikely((__pyx_v_alpha == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2320, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2320, __pyx_L3_error)
    __pyx_v_nnzA = __Pyx_PyLong_As_int(values[5]); if (unlikely((__pyx_v_nnzA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2321, __pyx_L3_error)
    __pyx_v_csrValA = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_csrValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2321, __pyx_L3_error)
    __pyx_v_csrRowPtrA = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_csrRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2321, __pyx_L3_error)
    __pyx_v_csrColIndA = __Pyx_PyLong_As_size_t(values[8]); if (unlikely((__pyx_v_csrColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2322, __pyx_L3_error)
    __pyx_v_beta = __Pyx_PyLong_As_size_t(values[9]); if (unlikely((__pyx_v_beta == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2322, __pyx_L3_error)
    __pyx_v_descrB = __Pyx_PyLong_As_size_t(values[10]); if (unlikely((__pyx_v_descrB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2322, __pyx_L3_error)
    __pyx_v_nnzB = __Pyx_PyLong_As_int(values[11]); if (unlikely((__pyx_v_nnzB == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2323, __pyx_L3_error)
    __pyx_v_csrValB = __Pyx_PyLong_As_size_t(values[12]); if (unlikely((__pyx_v_csrValB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2323, __pyx_L3_error)
    __pyx_v_csrRowPtrB = __Pyx_PyLong_As_size_t(values[13]); if (unlikely((__pyx_v_csrRowPtrB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2323, __pyx_L3_error)
    __pyx_v_csrColIndB = __Pyx_PyLong_As_size_t(values[14]); if (unlikely((__pyx_v_csrColIndB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2324, __pyx_L3_error)
    __pyx_v_descrC = __Pyx_PyLong_As_size_t(values[15]); if (unlikely((__pyx_v_descrC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2324, __pyx_L3_error)
    __pyx_v_csrValC = __Pyx_PyLong_As_size_t(values[16]); if (unlikely((__pyx_v_csrValC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2324, __pyx_L3_error)
    __pyx_v_csrRowPtrC = __Pyx_PyLong_As_size_t(values[17]); if (unlikely((__pyx_v_csrRowPtrC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2325, __pyx_L3_error)
    __pyx_v_csrColIndC = __Pyx_PyLong_As_size_t(values[18]); if (unlikely((__pyx_v_csrColIndC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2325, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("dcsrgeam", 1, 19, 19, __pyx_nargs); __PYX_ERR(0, 2319, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.dcsrgeam", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_130dcsrgeam(__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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_130dcsrgeam(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2319, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2319, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":2337
 *     check_status(status)
 * 
 * cpdef void ccsrgeam(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int n, size_t alpha, size_t descrA,
 *         int nnzA, size_t csrValA, size_t csrRowPtrA,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_133ccsrgeam(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_ccsrgeam(intptr_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;
  __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_backends/cuda/libs/cusparse.pyx":2344
 *         size_t csrColIndB, size_t descrC, size_t csrValC,
 *         size_t csrRowPtrC, size_t csrColIndC) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     status = cusparseCcsrgeam(
 *         <Handle>handle, m, n, <const cuComplex *>alpha,
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2344, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":2345
 *         size_t csrRowPtrC, size_t csrColIndC) except *:
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":2354
 *         <const MatDescr>descrC, <cuComplex *>csrValC, <int *>csrRowPtrC,
 *         <int *>csrColIndC)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef void zcsrgeam(
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2354, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":2337
 *     check_status(status)
 * 
 * cpdef void ccsrgeam(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int n, size_t alpha, size_t descrA,
 *         int nnzA, size_t csrValA, size_t csrRowPtrA,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.ccsrgeam", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_133ccsrgeam(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_132ccsrgeam, "ccsrgeam(intptr_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) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_133ccsrgeam(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[19] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ccsrgeam (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_n,&__pyx_mstate_global->__pyx_n_u_alpha,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_nnzA,&__pyx_mstate_global->__pyx_n_u_csrValA,&__pyx_mstate_global->__pyx_n_u_csrRowPtrA,&__pyx_mstate_global->__pyx_n_u_csrColIndA,&__pyx_mstate_global->__pyx_n_u_beta,&__pyx_mstate_global->__pyx_n_u_descrB,&__pyx_mstate_global->__pyx_n_u_nnzB,&__pyx_mstate_global->__pyx_n_u_csrValB,&__pyx_mstate_global->__pyx_n_u_csrRowPtrB,&__pyx_mstate_global->__pyx_n_u_csrColIndB,&__pyx_mstate_global->__pyx_n_u_descrC,&__pyx_mstate_global->__pyx_n_u_csrValC,&__pyx_mstate_global->__pyx_n_u_csrRowPtrC,&__pyx_mstate_global->__pyx_n_u_csrColIndC,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 2337, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 19:
        values[18] = __Pyx_ArgRef_FASTCALL(__pyx_args, 18);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[18])) __PYX_ERR(0, 2337, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 18:
        values[17] = __Pyx_ArgRef_FASTCALL(__pyx_args, 17);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[17])) __PYX_ERR(0, 2337, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 17:
        values[16] = __Pyx_ArgRef_FASTCALL(__pyx_args, 16);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[16])) __PYX_ERR(0, 2337, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 16:
        values[15] = __Pyx_ArgRef_FASTCALL(__pyx_args, 15);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 2337, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 15:
        values[14] = __Pyx_ArgRef_FASTCALL(__pyx_args, 14);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 2337, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 14:
        values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 2337, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 13:
        values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 2337, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 12:
        values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 2337, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 11:
        values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 2337, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 2337, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 2337, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 2337, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 2337, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 2337, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 2337, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2337, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2337, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2337, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2337, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "ccsrgeam", 0) < (0)) __PYX_ERR(0, 2337, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 19; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("ccsrgeam", 1, 19, 19, i); __PYX_ERR(0, 2337, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 19)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2337, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2337, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2337, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2337, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 2337, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 2337, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 2337, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 2337, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 2337, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 2337, __pyx_L3_error)
      values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 2337, __pyx_L3_error)
      values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 2337, __pyx_L3_error)
      values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 2337, __pyx_L3_error)
      values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 2337, __pyx_L3_error)
      values[14] = __Pyx_ArgRef_FASTCALL(__pyx_args, 14);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 2337, __pyx_L3_error)
      values[15] = __Pyx_ArgRef_FASTCALL(__pyx_args, 15);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 2337, __pyx_L3_error)
      values[16] = __Pyx_ArgRef_FASTCALL(__pyx_args, 16);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[16])) __PYX_ERR(0, 2337, __pyx_L3_error)
      values[17] = __Pyx_ArgRef_FASTCALL(__pyx_args, 17);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[17])) __PYX_ERR(0, 2337, __pyx_L3_error)
      values[18] = __Pyx_ArgRef_FASTCALL(__pyx_args, 18);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[18])) __PYX_ERR(0, 2337, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2338, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2338, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2338, __pyx_L3_error)
    __pyx_v_alpha = __Pyx_PyLong_As_size_t(values[3]); if (unlikely((__pyx_v_alpha == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2338, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2338, __pyx_L3_error)
    __pyx_v_nnzA = __Pyx_PyLong_As_int(values[5]); if (unlikely((__pyx_v_nnzA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2339, __pyx_L3_error)
    __pyx_v_csrValA = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_csrValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2339, __pyx_L3_error)
    __pyx_v_csrRowPtrA = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_csrRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2339, __pyx_L3_error)
    __pyx_v_csrColIndA = __Pyx_PyLong_As_size_t(values[8]); if (unlikely((__pyx_v_csrColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2340, __pyx_L3_error)
    __pyx_v_beta = __Pyx_PyLong_As_size_t(values[9]); if (unlikely((__pyx_v_beta == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2340, __pyx_L3_error)
    __pyx_v_descrB = __Pyx_PyLong_As_size_t(values[10]); if (unlikely((__pyx_v_descrB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2340, __pyx_L3_error)
    __pyx_v_nnzB = __Pyx_PyLong_As_int(values[11]); if (unlikely((__pyx_v_nnzB == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2341, __pyx_L3_error)
    __pyx_v_csrValB = __Pyx_PyLong_As_size_t(values[12]); if (unlikely((__pyx_v_csrValB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2341, __pyx_L3_error)
    __pyx_v_csrRowPtrB = __Pyx_PyLong_As_size_t(values[13]); if (unlikely((__pyx_v_csrRowPtrB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2341, __pyx_L3_error)
    __pyx_v_csrColIndB = __Pyx_PyLong_As_size_t(values[14]); if (unlikely((__pyx_v_csrColIndB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2342, __pyx_L3_error)
    __pyx_v_descrC = __Pyx_PyLong_As_size_t(values[15]); if (unlikely((__pyx_v_descrC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2342, __pyx_L3_error)
    __pyx_v_csrValC = __Pyx_PyLong_As_size_t(values[16]); if (unlikely((__pyx_v_csrValC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2342, __pyx_L3_error)
    __pyx_v_csrRowPtrC = __Pyx_PyLong_As_size_t(values[17]); if (unlikely((__pyx_v_csrRowPtrC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2343, __pyx_L3_error)
    __pyx_v_csrColIndC = __Pyx_PyLong_As_size_t(values[18]); if (unlikely((__pyx_v_csrColIndC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2343, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ccsrgeam", 1, 19, 19, __pyx_nargs); __PYX_ERR(0, 2337, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.ccsrgeam", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_132ccsrgeam(__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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_132ccsrgeam(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2337, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2337, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":2356
 *     check_status(status)
 * 
 * cpdef void zcsrgeam(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int n, size_t alpha, size_t descrA,
 *         int nnzA, size_t csrValA, size_t csrRowPtrA,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_135zcsrgeam(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_zcsrgeam(intptr_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;
  __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_backends/cuda/libs/cusparse.pyx":2363
 *         size_t csrColIndB, size_t descrC, size_t csrValC,
 *         size_t csrRowPtrC, size_t csrColIndC) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     status = cusparseZcsrgeam(
 *         <Handle>handle, m, n, <const cuDoubleComplex *>alpha,
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2363, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":2364
 *         size_t csrRowPtrC, size_t csrColIndC) except *:
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":2373
 *         <const MatDescr>descrC, <cuDoubleComplex *>csrValC, <int *>csrRowPtrC,
 *         <int *>csrColIndC)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef size_t scsrgeam2_bufferSizeExt(
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2373, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":2356
 *     check_status(status)
 * 
 * cpdef void zcsrgeam(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int n, size_t alpha, size_t descrA,
 *         int nnzA, size_t csrValA, size_t csrRowPtrA,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.zcsrgeam", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_135zcsrgeam(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_134zcsrgeam, "zcsrgeam(intptr_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) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_135zcsrgeam(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[19] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("zcsrgeam (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_n,&__pyx_mstate_global->__pyx_n_u_alpha,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_nnzA,&__pyx_mstate_global->__pyx_n_u_csrValA,&__pyx_mstate_global->__pyx_n_u_csrRowPtrA,&__pyx_mstate_global->__pyx_n_u_csrColIndA,&__pyx_mstate_global->__pyx_n_u_beta,&__pyx_mstate_global->__pyx_n_u_descrB,&__pyx_mstate_global->__pyx_n_u_nnzB,&__pyx_mstate_global->__pyx_n_u_csrValB,&__pyx_mstate_global->__pyx_n_u_csrRowPtrB,&__pyx_mstate_global->__pyx_n_u_csrColIndB,&__pyx_mstate_global->__pyx_n_u_descrC,&__pyx_mstate_global->__pyx_n_u_csrValC,&__pyx_mstate_global->__pyx_n_u_csrRowPtrC,&__pyx_mstate_global->__pyx_n_u_csrColIndC,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 2356, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 19:
        values[18] = __Pyx_ArgRef_FASTCALL(__pyx_args, 18);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[18])) __PYX_ERR(0, 2356, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 18:
        values[17] = __Pyx_ArgRef_FASTCALL(__pyx_args, 17);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[17])) __PYX_ERR(0, 2356, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 17:
        values[16] = __Pyx_ArgRef_FASTCALL(__pyx_args, 16);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[16])) __PYX_ERR(0, 2356, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 16:
        values[15] = __Pyx_ArgRef_FASTCALL(__pyx_args, 15);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 2356, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 15:
        values[14] = __Pyx_ArgRef_FASTCALL(__pyx_args, 14);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 2356, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 14:
        values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 2356, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 13:
        values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 2356, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 12:
        values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 2356, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 11:
        values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 2356, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 2356, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 2356, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 2356, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 2356, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 2356, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 2356, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2356, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2356, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2356, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2356, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "zcsrgeam", 0) < (0)) __PYX_ERR(0, 2356, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 19; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("zcsrgeam", 1, 19, 19, i); __PYX_ERR(0, 2356, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 19)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2356, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2356, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2356, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2356, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 2356, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 2356, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 2356, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 2356, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 2356, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 2356, __pyx_L3_error)
      values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 2356, __pyx_L3_error)
      values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 2356, __pyx_L3_error)
      values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 2356, __pyx_L3_error)
      values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 2356, __pyx_L3_error)
      values[14] = __Pyx_ArgRef_FASTCALL(__pyx_args, 14);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 2356, __pyx_L3_error)
      values[15] = __Pyx_ArgRef_FASTCALL(__pyx_args, 15);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 2356, __pyx_L3_error)
      values[16] = __Pyx_ArgRef_FASTCALL(__pyx_args, 16);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[16])) __PYX_ERR(0, 2356, __pyx_L3_error)
      values[17] = __Pyx_ArgRef_FASTCALL(__pyx_args, 17);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[17])) __PYX_ERR(0, 2356, __pyx_L3_error)
      values[18] = __Pyx_ArgRef_FASTCALL(__pyx_args, 18);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[18])) __PYX_ERR(0, 2356, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2357, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2357, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2357, __pyx_L3_error)
    __pyx_v_alpha = __Pyx_PyLong_As_size_t(values[3]); if (unlikely((__pyx_v_alpha == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2357, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2357, __pyx_L3_error)
    __pyx_v_nnzA = __Pyx_PyLong_As_int(values[5]); if (unlikely((__pyx_v_nnzA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2358, __pyx_L3_error)
    __pyx_v_csrValA = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_csrValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2358, __pyx_L3_error)
    __pyx_v_csrRowPtrA = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_csrRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2358, __pyx_L3_error)
    __pyx_v_csrColIndA = __Pyx_PyLong_As_size_t(values[8]); if (unlikely((__pyx_v_csrColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2359, __pyx_L3_error)
    __pyx_v_beta = __Pyx_PyLong_As_size_t(values[9]); if (unlikely((__pyx_v_beta == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2359, __pyx_L3_error)
    __pyx_v_descrB = __Pyx_PyLong_As_size_t(values[10]); if (unlikely((__pyx_v_descrB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2359, __pyx_L3_error)
    __pyx_v_nnzB = __Pyx_PyLong_As_int(values[11]); if (unlikely((__pyx_v_nnzB == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2360, __pyx_L3_error)
    __pyx_v_csrValB = __Pyx_PyLong_As_size_t(values[12]); if (unlikely((__pyx_v_csrValB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2360, __pyx_L3_error)
    __pyx_v_csrRowPtrB = __Pyx_PyLong_As_size_t(values[13]); if (unlikely((__pyx_v_csrRowPtrB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2360, __pyx_L3_error)
    __pyx_v_csrColIndB = __Pyx_PyLong_As_size_t(values[14]); if (unlikely((__pyx_v_csrColIndB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2361, __pyx_L3_error)
    __pyx_v_descrC = __Pyx_PyLong_As_size_t(values[15]); if (unlikely((__pyx_v_descrC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2361, __pyx_L3_error)
    __pyx_v_csrValC = __Pyx_PyLong_As_size_t(values[16]); if (unlikely((__pyx_v_csrValC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2361, __pyx_L3_error)
    __pyx_v_csrRowPtrC = __Pyx_PyLong_As_size_t(values[17]); if (unlikely((__pyx_v_csrRowPtrC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2362, __pyx_L3_error)
    __pyx_v_csrColIndC = __Pyx_PyLong_As_size_t(values[18]); if (unlikely((__pyx_v_csrColIndC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2362, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("zcsrgeam", 1, 19, 19, __pyx_nargs); __PYX_ERR(0, 2356, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.zcsrgeam", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_134zcsrgeam(__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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_134zcsrgeam(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2356, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2356, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":2375
 *     check_status(status)
 * 
 * cpdef size_t scsrgeam2_bufferSizeExt(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int n, size_t alpha, size_t descrA,
 *         int nnzA, size_t csrValA, size_t csrRowPtrA,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_137scsrgeam2_bufferSizeExt(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static size_t __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_scsrgeam2_bufferSizeExt(intptr_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_backends/cuda/libs/cusparse.pyx":2383
 *         size_t csrRowPtrC, size_t csrColIndC) except? -1:
 *     cdef size_t bufferSize
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     status = cusparseScsrgeam2_bufferSizeExt(
 *         <Handle>handle, m, n, <const float *>alpha,
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2383, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":2384
 *     cdef size_t bufferSize
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":2392
 *         <const MatDescr>descrC, <float *>csrValC, <int *>csrRowPtrC,
 *         <int *>csrColIndC, &bufferSize)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return bufferSize
 * 
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2392, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":2393
 *         <int *>csrColIndC, &bufferSize)
 *     check_status(status)
 *     return bufferSize             # <<<<<<<<<<<<<<
 * 
 * cpdef size_t dcsrgeam2_bufferSizeExt(
*/
  __pyx_r = __pyx_v_bufferSize;
  goto __pyx_L0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":2375
 *     check_status(status)
 * 
 * cpdef size_t scsrgeam2_bufferSizeExt(             # <<<<<<<<<<<<<<
 *         intptr_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_AddTraceback("cupy_backends.cuda.libs.cusparse.scsrgeam2_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1L;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_137scsrgeam2_bufferSizeExt(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_136scsrgeam2_bufferSizeExt, "scsrgeam2_bufferSizeExt(intptr_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_13cupy_backends_4cuda_4libs_8cusparse_137scsrgeam2_bufferSizeExt(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[19] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
  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);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_n,&__pyx_mstate_global->__pyx_n_u_alpha,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_nnzA,&__pyx_mstate_global->__pyx_n_u_csrValA,&__pyx_mstate_global->__pyx_n_u_csrRowPtrA,&__pyx_mstate_global->__pyx_n_u_csrColIndA,&__pyx_mstate_global->__pyx_n_u_beta,&__pyx_mstate_global->__pyx_n_u_descrB,&__pyx_mstate_global->__pyx_n_u_nnzB,&__pyx_mstate_global->__pyx_n_u_csrValB,&__pyx_mstate_global->__pyx_n_u_csrRowPtrB,&__pyx_mstate_global->__pyx_n_u_csrColIndB,&__pyx_mstate_global->__pyx_n_u_descrC,&__pyx_mstate_global->__pyx_n_u_csrValC,&__pyx_mstate_global->__pyx_n_u_csrRowPtrC,&__pyx_mstate_global->__pyx_n_u_csrColIndC,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 2375, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 19:
        values[18] = __Pyx_ArgRef_FASTCALL(__pyx_args, 18);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[18])) __PYX_ERR(0, 2375, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 18:
        values[17] = __Pyx_ArgRef_FASTCALL(__pyx_args, 17);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[17])) __PYX_ERR(0, 2375, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 17:
        values[16] = __Pyx_ArgRef_FASTCALL(__pyx_args, 16);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[16])) __PYX_ERR(0, 2375, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 16:
        values[15] = __Pyx_ArgRef_FASTCALL(__pyx_args, 15);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 2375, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 15:
        values[14] = __Pyx_ArgRef_FASTCALL(__pyx_args, 14);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 2375, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 14:
        values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 2375, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 13:
        values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 2375, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 12:
        values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 2375, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 11:
        values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 2375, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 2375, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 2375, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 2375, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 2375, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 2375, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 2375, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2375, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2375, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2375, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2375, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "scsrgeam2_bufferSizeExt", 0) < (0)) __PYX_ERR(0, 2375, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 19; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("scsrgeam2_bufferSizeExt", 1, 19, 19, i); __PYX_ERR(0, 2375, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 19)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2375, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2375, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2375, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2375, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 2375, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 2375, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 2375, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 2375, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 2375, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 2375, __pyx_L3_error)
      values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 2375, __pyx_L3_error)
      values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 2375, __pyx_L3_error)
      values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 2375, __pyx_L3_error)
      values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 2375, __pyx_L3_error)
      values[14] = __Pyx_ArgRef_FASTCALL(__pyx_args, 14);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 2375, __pyx_L3_error)
      values[15] = __Pyx_ArgRef_FASTCALL(__pyx_args, 15);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 2375, __pyx_L3_error)
      values[16] = __Pyx_ArgRef_FASTCALL(__pyx_args, 16);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[16])) __PYX_ERR(0, 2375, __pyx_L3_error)
      values[17] = __Pyx_ArgRef_FASTCALL(__pyx_args, 17);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[17])) __PYX_ERR(0, 2375, __pyx_L3_error)
      values[18] = __Pyx_ArgRef_FASTCALL(__pyx_args, 18);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[18])) __PYX_ERR(0, 2375, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2376, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2376, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2376, __pyx_L3_error)
    __pyx_v_alpha = __Pyx_PyLong_As_size_t(values[3]); if (unlikely((__pyx_v_alpha == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2376, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2376, __pyx_L3_error)
    __pyx_v_nnzA = __Pyx_PyLong_As_int(values[5]); if (unlikely((__pyx_v_nnzA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2377, __pyx_L3_error)
    __pyx_v_csrValA = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_csrValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2377, __pyx_L3_error)
    __pyx_v_csrRowPtrA = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_csrRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2377, __pyx_L3_error)
    __pyx_v_csrColIndA = __Pyx_PyLong_As_size_t(values[8]); if (unlikely((__pyx_v_csrColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2378, __pyx_L3_error)
    __pyx_v_beta = __Pyx_PyLong_As_size_t(values[9]); if (unlikely((__pyx_v_beta == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2378, __pyx_L3_error)
    __pyx_v_descrB = __Pyx_PyLong_As_size_t(values[10]); if (unlikely((__pyx_v_descrB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2378, __pyx_L3_error)
    __pyx_v_nnzB = __Pyx_PyLong_As_int(values[11]); if (unlikely((__pyx_v_nnzB == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2379, __pyx_L3_error)
    __pyx_v_csrValB = __Pyx_PyLong_As_size_t(values[12]); if (unlikely((__pyx_v_csrValB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2379, __pyx_L3_error)
    __pyx_v_csrRowPtrB = __Pyx_PyLong_As_size_t(values[13]); if (unlikely((__pyx_v_csrRowPtrB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2379, __pyx_L3_error)
    __pyx_v_csrColIndB = __Pyx_PyLong_As_size_t(values[14]); if (unlikely((__pyx_v_csrColIndB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2380, __pyx_L3_error)
    __pyx_v_descrC = __Pyx_PyLong_As_size_t(values[15]); if (unlikely((__pyx_v_descrC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2380, __pyx_L3_error)
    __pyx_v_csrValC = __Pyx_PyLong_As_size_t(values[16]); if (unlikely((__pyx_v_csrValC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2380, __pyx_L3_error)
    __pyx_v_csrRowPtrC = __Pyx_PyLong_As_size_t(values[17]); if (unlikely((__pyx_v_csrRowPtrC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2381, __pyx_L3_error)
    __pyx_v_csrColIndC = __Pyx_PyLong_As_size_t(values[18]); if (unlikely((__pyx_v_csrColIndC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2381, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("scsrgeam2_bufferSizeExt", 1, 19, 19, __pyx_nargs); __PYX_ERR(0, 2375, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.scsrgeam2_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_136scsrgeam2_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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_136scsrgeam2_bufferSizeExt(CYTHON_UNUSED PyObject *__pyx_self, intptr_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
  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("scsrgeam2_bufferSizeExt", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(__pyx_t_1 == ((size_t)-1L) && PyErr_Occurred())) __PYX_ERR(0, 2375, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyLong_FromSize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2375, __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_backends.cuda.libs.cusparse.scsrgeam2_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy_backends/cuda/libs/cusparse.pyx":2395
 *     return bufferSize
 * 
 * cpdef size_t dcsrgeam2_bufferSizeExt(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int n, size_t alpha, size_t descrA,
 *         int nnzA, size_t csrValA, size_t csrRowPtrA,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_139dcsrgeam2_bufferSizeExt(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static size_t __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_dcsrgeam2_bufferSizeExt(intptr_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_backends/cuda/libs/cusparse.pyx":2403
 *         size_t csrRowPtrC, size_t csrColIndC) except? -1:
 *     cdef size_t bufferSize
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     status = cusparseDcsrgeam2_bufferSizeExt(
 *         <Handle>handle, m, n, <const double *>alpha,
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2403, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":2404
 *     cdef size_t bufferSize
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":2412
 *         <const MatDescr>descrC, <double *>csrValC, <int *>csrRowPtrC,
 *         <int *>csrColIndC, &bufferSize)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return bufferSize
 * 
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2412, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":2413
 *         <int *>csrColIndC, &bufferSize)
 *     check_status(status)
 *     return bufferSize             # <<<<<<<<<<<<<<
 * 
 * cpdef size_t ccsrgeam2_bufferSizeExt(
*/
  __pyx_r = __pyx_v_bufferSize;
  goto __pyx_L0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":2395
 *     return bufferSize
 * 
 * cpdef size_t dcsrgeam2_bufferSizeExt(             # <<<<<<<<<<<<<<
 *         intptr_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_AddTraceback("cupy_backends.cuda.libs.cusparse.dcsrgeam2_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1L;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_139dcsrgeam2_bufferSizeExt(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_138dcsrgeam2_bufferSizeExt, "dcsrgeam2_bufferSizeExt(intptr_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_13cupy_backends_4cuda_4libs_8cusparse_139dcsrgeam2_bufferSizeExt(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[19] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
  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);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_n,&__pyx_mstate_global->__pyx_n_u_alpha,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_nnzA,&__pyx_mstate_global->__pyx_n_u_csrValA,&__pyx_mstate_global->__pyx_n_u_csrRowPtrA,&__pyx_mstate_global->__pyx_n_u_csrColIndA,&__pyx_mstate_global->__pyx_n_u_beta,&__pyx_mstate_global->__pyx_n_u_descrB,&__pyx_mstate_global->__pyx_n_u_nnzB,&__pyx_mstate_global->__pyx_n_u_csrValB,&__pyx_mstate_global->__pyx_n_u_csrRowPtrB,&__pyx_mstate_global->__pyx_n_u_csrColIndB,&__pyx_mstate_global->__pyx_n_u_descrC,&__pyx_mstate_global->__pyx_n_u_csrValC,&__pyx_mstate_global->__pyx_n_u_csrRowPtrC,&__pyx_mstate_global->__pyx_n_u_csrColIndC,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 2395, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 19:
        values[18] = __Pyx_ArgRef_FASTCALL(__pyx_args, 18);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[18])) __PYX_ERR(0, 2395, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 18:
        values[17] = __Pyx_ArgRef_FASTCALL(__pyx_args, 17);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[17])) __PYX_ERR(0, 2395, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 17:
        values[16] = __Pyx_ArgRef_FASTCALL(__pyx_args, 16);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[16])) __PYX_ERR(0, 2395, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 16:
        values[15] = __Pyx_ArgRef_FASTCALL(__pyx_args, 15);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 2395, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 15:
        values[14] = __Pyx_ArgRef_FASTCALL(__pyx_args, 14);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 2395, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 14:
        values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 2395, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 13:
        values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 2395, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 12:
        values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 2395, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 11:
        values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 2395, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 2395, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 2395, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 2395, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 2395, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 2395, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 2395, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2395, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2395, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2395, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2395, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "dcsrgeam2_bufferSizeExt", 0) < (0)) __PYX_ERR(0, 2395, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 19; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("dcsrgeam2_bufferSizeExt", 1, 19, 19, i); __PYX_ERR(0, 2395, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 19)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2395, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2395, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2395, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2395, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 2395, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 2395, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 2395, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 2395, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 2395, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 2395, __pyx_L3_error)
      values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 2395, __pyx_L3_error)
      values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 2395, __pyx_L3_error)
      values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 2395, __pyx_L3_error)
      values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 2395, __pyx_L3_error)
      values[14] = __Pyx_ArgRef_FASTCALL(__pyx_args, 14);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 2395, __pyx_L3_error)
      values[15] = __Pyx_ArgRef_FASTCALL(__pyx_args, 15);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 2395, __pyx_L3_error)
      values[16] = __Pyx_ArgRef_FASTCALL(__pyx_args, 16);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[16])) __PYX_ERR(0, 2395, __pyx_L3_error)
      values[17] = __Pyx_ArgRef_FASTCALL(__pyx_args, 17);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[17])) __PYX_ERR(0, 2395, __pyx_L3_error)
      values[18] = __Pyx_ArgRef_FASTCALL(__pyx_args, 18);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[18])) __PYX_ERR(0, 2395, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2396, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2396, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2396, __pyx_L3_error)
    __pyx_v_alpha = __Pyx_PyLong_As_size_t(values[3]); if (unlikely((__pyx_v_alpha == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2396, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2396, __pyx_L3_error)
    __pyx_v_nnzA = __Pyx_PyLong_As_int(values[5]); if (unlikely((__pyx_v_nnzA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2397, __pyx_L3_error)
    __pyx_v_csrValA = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_csrValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2397, __pyx_L3_error)
    __pyx_v_csrRowPtrA = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_csrRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2397, __pyx_L3_error)
    __pyx_v_csrColIndA = __Pyx_PyLong_As_size_t(values[8]); if (unlikely((__pyx_v_csrColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2398, __pyx_L3_error)
    __pyx_v_beta = __Pyx_PyLong_As_size_t(values[9]); if (unlikely((__pyx_v_beta == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2398, __pyx_L3_error)
    __pyx_v_descrB = __Pyx_PyLong_As_size_t(values[10]); if (unlikely((__pyx_v_descrB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2398, __pyx_L3_error)
    __pyx_v_nnzB = __Pyx_PyLong_As_int(values[11]); if (unlikely((__pyx_v_nnzB == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2399, __pyx_L3_error)
    __pyx_v_csrValB = __Pyx_PyLong_As_size_t(values[12]); if (unlikely((__pyx_v_csrValB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2399, __pyx_L3_error)
    __pyx_v_csrRowPtrB = __Pyx_PyLong_As_size_t(values[13]); if (unlikely((__pyx_v_csrRowPtrB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2399, __pyx_L3_error)
    __pyx_v_csrColIndB = __Pyx_PyLong_As_size_t(values[14]); if (unlikely((__pyx_v_csrColIndB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2400, __pyx_L3_error)
    __pyx_v_descrC = __Pyx_PyLong_As_size_t(values[15]); if (unlikely((__pyx_v_descrC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2400, __pyx_L3_error)
    __pyx_v_csrValC = __Pyx_PyLong_As_size_t(values[16]); if (unlikely((__pyx_v_csrValC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2400, __pyx_L3_error)
    __pyx_v_csrRowPtrC = __Pyx_PyLong_As_size_t(values[17]); if (unlikely((__pyx_v_csrRowPtrC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2401, __pyx_L3_error)
    __pyx_v_csrColIndC = __Pyx_PyLong_As_size_t(values[18]); if (unlikely((__pyx_v_csrColIndC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2401, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("dcsrgeam2_bufferSizeExt", 1, 19, 19, __pyx_nargs); __PYX_ERR(0, 2395, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.dcsrgeam2_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_138dcsrgeam2_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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_138dcsrgeam2_bufferSizeExt(CYTHON_UNUSED PyObject *__pyx_self, intptr_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
  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("dcsrgeam2_bufferSizeExt", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(__pyx_t_1 == ((size_t)-1L) && PyErr_Occurred())) __PYX_ERR(0, 2395, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyLong_FromSize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2395, __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_backends.cuda.libs.cusparse.dcsrgeam2_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy_backends/cuda/libs/cusparse.pyx":2415
 *     return bufferSize
 * 
 * cpdef size_t ccsrgeam2_bufferSizeExt(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int n, size_t alpha, size_t descrA,
 *         int nnzA, size_t csrValA, size_t csrRowPtrA,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_141ccsrgeam2_bufferSizeExt(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static size_t __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_ccsrgeam2_bufferSizeExt(intptr_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_backends/cuda/libs/cusparse.pyx":2423
 *         size_t csrRowPtrC, size_t csrColIndC) except? -1:
 *     cdef size_t bufferSize
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     status = cusparseCcsrgeam2_bufferSizeExt(
 *         <Handle>handle, m, n, <const cuComplex *>alpha,
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2423, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":2424
 *     cdef size_t bufferSize
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":2433
 *         <const MatDescr>descrC, <cuComplex *>csrValC, <int *>csrRowPtrC,
 *         <int *>csrColIndC, &bufferSize)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return bufferSize
 * 
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2433, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":2434
 *         <int *>csrColIndC, &bufferSize)
 *     check_status(status)
 *     return bufferSize             # <<<<<<<<<<<<<<
 * 
 * cpdef size_t zcsrgeam2_bufferSizeExt(
*/
  __pyx_r = __pyx_v_bufferSize;
  goto __pyx_L0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":2415
 *     return bufferSize
 * 
 * cpdef size_t ccsrgeam2_bufferSizeExt(             # <<<<<<<<<<<<<<
 *         intptr_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_AddTraceback("cupy_backends.cuda.libs.cusparse.ccsrgeam2_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1L;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_141ccsrgeam2_bufferSizeExt(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_140ccsrgeam2_bufferSizeExt, "ccsrgeam2_bufferSizeExt(intptr_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_13cupy_backends_4cuda_4libs_8cusparse_141ccsrgeam2_bufferSizeExt(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[19] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
  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);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_n,&__pyx_mstate_global->__pyx_n_u_alpha,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_nnzA,&__pyx_mstate_global->__pyx_n_u_csrValA,&__pyx_mstate_global->__pyx_n_u_csrRowPtrA,&__pyx_mstate_global->__pyx_n_u_csrColIndA,&__pyx_mstate_global->__pyx_n_u_beta,&__pyx_mstate_global->__pyx_n_u_descrB,&__pyx_mstate_global->__pyx_n_u_nnzB,&__pyx_mstate_global->__pyx_n_u_csrValB,&__pyx_mstate_global->__pyx_n_u_csrRowPtrB,&__pyx_mstate_global->__pyx_n_u_csrColIndB,&__pyx_mstate_global->__pyx_n_u_descrC,&__pyx_mstate_global->__pyx_n_u_csrValC,&__pyx_mstate_global->__pyx_n_u_csrRowPtrC,&__pyx_mstate_global->__pyx_n_u_csrColIndC,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 2415, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 19:
        values[18] = __Pyx_ArgRef_FASTCALL(__pyx_args, 18);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[18])) __PYX_ERR(0, 2415, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 18:
        values[17] = __Pyx_ArgRef_FASTCALL(__pyx_args, 17);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[17])) __PYX_ERR(0, 2415, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 17:
        values[16] = __Pyx_ArgRef_FASTCALL(__pyx_args, 16);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[16])) __PYX_ERR(0, 2415, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 16:
        values[15] = __Pyx_ArgRef_FASTCALL(__pyx_args, 15);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 2415, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 15:
        values[14] = __Pyx_ArgRef_FASTCALL(__pyx_args, 14);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 2415, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 14:
        values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 2415, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 13:
        values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 2415, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 12:
        values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 2415, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 11:
        values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 2415, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 2415, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 2415, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 2415, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 2415, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 2415, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 2415, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2415, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2415, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2415, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2415, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "ccsrgeam2_bufferSizeExt", 0) < (0)) __PYX_ERR(0, 2415, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 19; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("ccsrgeam2_bufferSizeExt", 1, 19, 19, i); __PYX_ERR(0, 2415, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 19)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2415, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2415, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2415, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2415, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 2415, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 2415, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 2415, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 2415, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 2415, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 2415, __pyx_L3_error)
      values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 2415, __pyx_L3_error)
      values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 2415, __pyx_L3_error)
      values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 2415, __pyx_L3_error)
      values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 2415, __pyx_L3_error)
      values[14] = __Pyx_ArgRef_FASTCALL(__pyx_args, 14);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 2415, __pyx_L3_error)
      values[15] = __Pyx_ArgRef_FASTCALL(__pyx_args, 15);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 2415, __pyx_L3_error)
      values[16] = __Pyx_ArgRef_FASTCALL(__pyx_args, 16);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[16])) __PYX_ERR(0, 2415, __pyx_L3_error)
      values[17] = __Pyx_ArgRef_FASTCALL(__pyx_args, 17);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[17])) __PYX_ERR(0, 2415, __pyx_L3_error)
      values[18] = __Pyx_ArgRef_FASTCALL(__pyx_args, 18);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[18])) __PYX_ERR(0, 2415, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2416, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2416, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2416, __pyx_L3_error)
    __pyx_v_alpha = __Pyx_PyLong_As_size_t(values[3]); if (unlikely((__pyx_v_alpha == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2416, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2416, __pyx_L3_error)
    __pyx_v_nnzA = __Pyx_PyLong_As_int(values[5]); if (unlikely((__pyx_v_nnzA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2417, __pyx_L3_error)
    __pyx_v_csrValA = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_csrValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2417, __pyx_L3_error)
    __pyx_v_csrRowPtrA = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_csrRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2417, __pyx_L3_error)
    __pyx_v_csrColIndA = __Pyx_PyLong_As_size_t(values[8]); if (unlikely((__pyx_v_csrColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2418, __pyx_L3_error)
    __pyx_v_beta = __Pyx_PyLong_As_size_t(values[9]); if (unlikely((__pyx_v_beta == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2418, __pyx_L3_error)
    __pyx_v_descrB = __Pyx_PyLong_As_size_t(values[10]); if (unlikely((__pyx_v_descrB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2418, __pyx_L3_error)
    __pyx_v_nnzB = __Pyx_PyLong_As_int(values[11]); if (unlikely((__pyx_v_nnzB == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2419, __pyx_L3_error)
    __pyx_v_csrValB = __Pyx_PyLong_As_size_t(values[12]); if (unlikely((__pyx_v_csrValB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2419, __pyx_L3_error)
    __pyx_v_csrRowPtrB = __Pyx_PyLong_As_size_t(values[13]); if (unlikely((__pyx_v_csrRowPtrB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2419, __pyx_L3_error)
    __pyx_v_csrColIndB = __Pyx_PyLong_As_size_t(values[14]); if (unlikely((__pyx_v_csrColIndB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2420, __pyx_L3_error)
    __pyx_v_descrC = __Pyx_PyLong_As_size_t(values[15]); if (unlikely((__pyx_v_descrC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2420, __pyx_L3_error)
    __pyx_v_csrValC = __Pyx_PyLong_As_size_t(values[16]); if (unlikely((__pyx_v_csrValC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2420, __pyx_L3_error)
    __pyx_v_csrRowPtrC = __Pyx_PyLong_As_size_t(values[17]); if (unlikely((__pyx_v_csrRowPtrC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2421, __pyx_L3_error)
    __pyx_v_csrColIndC = __Pyx_PyLong_As_size_t(values[18]); if (unlikely((__pyx_v_csrColIndC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2421, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ccsrgeam2_bufferSizeExt", 1, 19, 19, __pyx_nargs); __PYX_ERR(0, 2415, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.ccsrgeam2_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_140ccsrgeam2_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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_140ccsrgeam2_bufferSizeExt(CYTHON_UNUSED PyObject *__pyx_self, intptr_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
  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("ccsrgeam2_bufferSizeExt", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(__pyx_t_1 == ((size_t)-1L) && PyErr_Occurred())) __PYX_ERR(0, 2415, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyLong_FromSize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2415, __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_backends.cuda.libs.cusparse.ccsrgeam2_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy_backends/cuda/libs/cusparse.pyx":2436
 *     return bufferSize
 * 
 * cpdef size_t zcsrgeam2_bufferSizeExt(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int n, size_t alpha, size_t descrA,
 *         int nnzA, size_t csrValA, size_t csrRowPtrA,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_143zcsrgeam2_bufferSizeExt(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static size_t __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_zcsrgeam2_bufferSizeExt(intptr_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_backends/cuda/libs/cusparse.pyx":2444
 *         size_t csrRowPtrC, size_t csrColIndC) except? -1:
 *     cdef size_t bufferSize
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     status = cusparseZcsrgeam2_bufferSizeExt(
 *         <Handle>handle, m, n, <const cuDoubleComplex *>alpha,
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2444, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":2445
 *     cdef size_t bufferSize
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":2454
 *         <const MatDescr>descrC, <cuDoubleComplex *>csrValC, <int *>csrRowPtrC,
 *         <int *>csrColIndC, &bufferSize)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return bufferSize
 * 
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2454, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":2455
 *         <int *>csrColIndC, &bufferSize)
 *     check_status(status)
 *     return bufferSize             # <<<<<<<<<<<<<<
 * 
 * cpdef void xcsrgeam2Nnz(
*/
  __pyx_r = __pyx_v_bufferSize;
  goto __pyx_L0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":2436
 *     return bufferSize
 * 
 * cpdef size_t zcsrgeam2_bufferSizeExt(             # <<<<<<<<<<<<<<
 *         intptr_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_AddTraceback("cupy_backends.cuda.libs.cusparse.zcsrgeam2_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1L;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_143zcsrgeam2_bufferSizeExt(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_142zcsrgeam2_bufferSizeExt, "zcsrgeam2_bufferSizeExt(intptr_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_13cupy_backends_4cuda_4libs_8cusparse_143zcsrgeam2_bufferSizeExt(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[19] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
  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);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_n,&__pyx_mstate_global->__pyx_n_u_alpha,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_nnzA,&__pyx_mstate_global->__pyx_n_u_csrValA,&__pyx_mstate_global->__pyx_n_u_csrRowPtrA,&__pyx_mstate_global->__pyx_n_u_csrColIndA,&__pyx_mstate_global->__pyx_n_u_beta,&__pyx_mstate_global->__pyx_n_u_descrB,&__pyx_mstate_global->__pyx_n_u_nnzB,&__pyx_mstate_global->__pyx_n_u_csrValB,&__pyx_mstate_global->__pyx_n_u_csrRowPtrB,&__pyx_mstate_global->__pyx_n_u_csrColIndB,&__pyx_mstate_global->__pyx_n_u_descrC,&__pyx_mstate_global->__pyx_n_u_csrValC,&__pyx_mstate_global->__pyx_n_u_csrRowPtrC,&__pyx_mstate_global->__pyx_n_u_csrColIndC,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 2436, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 19:
        values[18] = __Pyx_ArgRef_FASTCALL(__pyx_args, 18);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[18])) __PYX_ERR(0, 2436, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 18:
        values[17] = __Pyx_ArgRef_FASTCALL(__pyx_args, 17);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[17])) __PYX_ERR(0, 2436, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 17:
        values[16] = __Pyx_ArgRef_FASTCALL(__pyx_args, 16);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[16])) __PYX_ERR(0, 2436, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 16:
        values[15] = __Pyx_ArgRef_FASTCALL(__pyx_args, 15);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 2436, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 15:
        values[14] = __Pyx_ArgRef_FASTCALL(__pyx_args, 14);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 2436, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 14:
        values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 2436, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 13:
        values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 2436, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 12:
        values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 2436, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 11:
        values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 2436, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 2436, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 2436, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 2436, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 2436, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 2436, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 2436, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2436, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2436, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2436, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2436, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "zcsrgeam2_bufferSizeExt", 0) < (0)) __PYX_ERR(0, 2436, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 19; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("zcsrgeam2_bufferSizeExt", 1, 19, 19, i); __PYX_ERR(0, 2436, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 19)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2436, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2436, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2436, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2436, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 2436, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 2436, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 2436, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 2436, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 2436, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 2436, __pyx_L3_error)
      values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 2436, __pyx_L3_error)
      values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 2436, __pyx_L3_error)
      values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 2436, __pyx_L3_error)
      values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 2436, __pyx_L3_error)
      values[14] = __Pyx_ArgRef_FASTCALL(__pyx_args, 14);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 2436, __pyx_L3_error)
      values[15] = __Pyx_ArgRef_FASTCALL(__pyx_args, 15);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 2436, __pyx_L3_error)
      values[16] = __Pyx_ArgRef_FASTCALL(__pyx_args, 16);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[16])) __PYX_ERR(0, 2436, __pyx_L3_error)
      values[17] = __Pyx_ArgRef_FASTCALL(__pyx_args, 17);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[17])) __PYX_ERR(0, 2436, __pyx_L3_error)
      values[18] = __Pyx_ArgRef_FASTCALL(__pyx_args, 18);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[18])) __PYX_ERR(0, 2436, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2437, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2437, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2437, __pyx_L3_error)
    __pyx_v_alpha = __Pyx_PyLong_As_size_t(values[3]); if (unlikely((__pyx_v_alpha == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2437, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2437, __pyx_L3_error)
    __pyx_v_nnzA = __Pyx_PyLong_As_int(values[5]); if (unlikely((__pyx_v_nnzA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2438, __pyx_L3_error)
    __pyx_v_csrValA = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_csrValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2438, __pyx_L3_error)
    __pyx_v_csrRowPtrA = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_csrRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2438, __pyx_L3_error)
    __pyx_v_csrColIndA = __Pyx_PyLong_As_size_t(values[8]); if (unlikely((__pyx_v_csrColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2439, __pyx_L3_error)
    __pyx_v_beta = __Pyx_PyLong_As_size_t(values[9]); if (unlikely((__pyx_v_beta == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2439, __pyx_L3_error)
    __pyx_v_descrB = __Pyx_PyLong_As_size_t(values[10]); if (unlikely((__pyx_v_descrB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2439, __pyx_L3_error)
    __pyx_v_nnzB = __Pyx_PyLong_As_int(values[11]); if (unlikely((__pyx_v_nnzB == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2440, __pyx_L3_error)
    __pyx_v_csrValB = __Pyx_PyLong_As_size_t(values[12]); if (unlikely((__pyx_v_csrValB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2440, __pyx_L3_error)
    __pyx_v_csrRowPtrB = __Pyx_PyLong_As_size_t(values[13]); if (unlikely((__pyx_v_csrRowPtrB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2440, __pyx_L3_error)
    __pyx_v_csrColIndB = __Pyx_PyLong_As_size_t(values[14]); if (unlikely((__pyx_v_csrColIndB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2441, __pyx_L3_error)
    __pyx_v_descrC = __Pyx_PyLong_As_size_t(values[15]); if (unlikely((__pyx_v_descrC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2441, __pyx_L3_error)
    __pyx_v_csrValC = __Pyx_PyLong_As_size_t(values[16]); if (unlikely((__pyx_v_csrValC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2441, __pyx_L3_error)
    __pyx_v_csrRowPtrC = __Pyx_PyLong_As_size_t(values[17]); if (unlikely((__pyx_v_csrRowPtrC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2442, __pyx_L3_error)
    __pyx_v_csrColIndC = __Pyx_PyLong_As_size_t(values[18]); if (unlikely((__pyx_v_csrColIndC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2442, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("zcsrgeam2_bufferSizeExt", 1, 19, 19, __pyx_nargs); __PYX_ERR(0, 2436, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.zcsrgeam2_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_142zcsrgeam2_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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_142zcsrgeam2_bufferSizeExt(CYTHON_UNUSED PyObject *__pyx_self, intptr_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
  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("zcsrgeam2_bufferSizeExt", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(__pyx_t_1 == ((size_t)-1L) && PyErr_Occurred())) __PYX_ERR(0, 2436, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyLong_FromSize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2436, __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_backends.cuda.libs.cusparse.zcsrgeam2_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy_backends/cuda/libs/cusparse.pyx":2457
 *     return bufferSize
 * 
 * cpdef void xcsrgeam2Nnz(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int n, size_t descrA, int nnzA,
 *         size_t csrRowPtrA, size_t csrColIndA, size_t descrB,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_145xcsrgeam2Nnz(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_xcsrgeam2Nnz(intptr_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;
  __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_backends/cuda/libs/cusparse.pyx":2463
 *         size_t descrC, size_t csrRowPtrC, size_t nnzTotalDevHostPtr,
 *         size_t workspace) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     status = cusparseXcsrgeam2Nnz(
 *         <Handle>handle, m, n, <const MatDescr>descrA, nnzA,
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2463, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":2464
 *         size_t workspace) except *:
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":2470
 *         <const int *>csrColIndB, <const MatDescr>descrC, <int *>csrRowPtrC,
 *         <int *>nnzTotalDevHostPtr, <void*> workspace)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef void scsrgeam2(
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2470, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":2457
 *     return bufferSize
 * 
 * cpdef void xcsrgeam2Nnz(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int n, size_t descrA, int nnzA,
 *         size_t csrRowPtrA, size_t csrColIndA, size_t descrB,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.xcsrgeam2Nnz", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_145xcsrgeam2Nnz(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_144xcsrgeam2Nnz, "xcsrgeam2Nnz(intptr_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) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_145xcsrgeam2Nnz(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[15] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("xcsrgeam2Nnz (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_n,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_nnzA,&__pyx_mstate_global->__pyx_n_u_csrRowPtrA,&__pyx_mstate_global->__pyx_n_u_csrColIndA,&__pyx_mstate_global->__pyx_n_u_descrB,&__pyx_mstate_global->__pyx_n_u_nnzB,&__pyx_mstate_global->__pyx_n_u_csrRowPtrB,&__pyx_mstate_global->__pyx_n_u_csrColIndB,&__pyx_mstate_global->__pyx_n_u_descrC,&__pyx_mstate_global->__pyx_n_u_csrRowPtrC,&__pyx_mstate_global->__pyx_n_u_nnzTotalDevHostPtr,&__pyx_mstate_global->__pyx_n_u_workspace,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 2457, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 15:
        values[14] = __Pyx_ArgRef_FASTCALL(__pyx_args, 14);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 2457, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 14:
        values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 2457, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 13:
        values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 2457, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 12:
        values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 2457, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 11:
        values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 2457, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 2457, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 2457, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 2457, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 2457, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 2457, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 2457, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2457, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2457, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2457, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2457, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "xcsrgeam2Nnz", 0) < (0)) __PYX_ERR(0, 2457, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 15; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("xcsrgeam2Nnz", 1, 15, 15, i); __PYX_ERR(0, 2457, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 15)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2457, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2457, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2457, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2457, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 2457, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 2457, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 2457, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 2457, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 2457, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 2457, __pyx_L3_error)
      values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 2457, __pyx_L3_error)
      values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 2457, __pyx_L3_error)
      values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 2457, __pyx_L3_error)
      values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 2457, __pyx_L3_error)
      values[14] = __Pyx_ArgRef_FASTCALL(__pyx_args, 14);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 2457, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2458, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2458, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2458, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[3]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2458, __pyx_L3_error)
    __pyx_v_nnzA = __Pyx_PyLong_As_int(values[4]); if (unlikely((__pyx_v_nnzA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2458, __pyx_L3_error)
    __pyx_v_csrRowPtrA = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_csrRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2459, __pyx_L3_error)
    __pyx_v_csrColIndA = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_csrColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2459, __pyx_L3_error)
    __pyx_v_descrB = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_descrB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2459, __pyx_L3_error)
    __pyx_v_nnzB = __Pyx_PyLong_As_int(values[8]); if (unlikely((__pyx_v_nnzB == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2460, __pyx_L3_error)
    __pyx_v_csrRowPtrB = __Pyx_PyLong_As_size_t(values[9]); if (unlikely((__pyx_v_csrRowPtrB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2460, __pyx_L3_error)
    __pyx_v_csrColIndB = __Pyx_PyLong_As_size_t(values[10]); if (unlikely((__pyx_v_csrColIndB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2460, __pyx_L3_error)
    __pyx_v_descrC = __Pyx_PyLong_As_size_t(values[11]); if (unlikely((__pyx_v_descrC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2461, __pyx_L3_error)
    __pyx_v_csrRowPtrC = __Pyx_PyLong_As_size_t(values[12]); if (unlikely((__pyx_v_csrRowPtrC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2461, __pyx_L3_error)
    __pyx_v_nnzTotalDevHostPtr = __Pyx_PyLong_As_size_t(values[13]); if (unlikely((__pyx_v_nnzTotalDevHostPtr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2461, __pyx_L3_error)
    __pyx_v_workspace = __Pyx_PyLong_As_size_t(values[14]); if (unlikely((__pyx_v_workspace == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2462, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("xcsrgeam2Nnz", 1, 15, 15, __pyx_nargs); __PYX_ERR(0, 2457, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.xcsrgeam2Nnz", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_144xcsrgeam2Nnz(__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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_144xcsrgeam2Nnz(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2457, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2457, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":2472
 *     check_status(status)
 * 
 * cpdef void scsrgeam2(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int n, size_t alpha, size_t descrA,
 *         int nnzA, size_t csrValA, size_t csrRowPtrA,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_147scsrgeam2(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_scsrgeam2(intptr_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;
  __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_backends/cuda/libs/cusparse.pyx":2479
 *         size_t csrColIndB, size_t descrC, size_t csrValC,
 *         size_t csrRowPtrC, size_t csrColIndC, size_t buffer) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     status = cusparseScsrgeam2(
 *         <Handle>handle, m, n, <const float *>alpha,
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2479, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":2480
 *         size_t csrRowPtrC, size_t csrColIndC, size_t buffer) except *:
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":2488
 *         <const MatDescr>descrC, <float *>csrValC, <int *>csrRowPtrC,
 *         <int *>csrColIndC, <void*>buffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef void dcsrgeam2(
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2488, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":2472
 *     check_status(status)
 * 
 * cpdef void scsrgeam2(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int n, size_t alpha, size_t descrA,
 *         int nnzA, size_t csrValA, size_t csrRowPtrA,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.scsrgeam2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_147scsrgeam2(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_146scsrgeam2, "scsrgeam2(intptr_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) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_147scsrgeam2(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[20] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("scsrgeam2 (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_n,&__pyx_mstate_global->__pyx_n_u_alpha,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_nnzA,&__pyx_mstate_global->__pyx_n_u_csrValA,&__pyx_mstate_global->__pyx_n_u_csrRowPtrA,&__pyx_mstate_global->__pyx_n_u_csrColIndA,&__pyx_mstate_global->__pyx_n_u_beta,&__pyx_mstate_global->__pyx_n_u_descrB,&__pyx_mstate_global->__pyx_n_u_nnzB,&__pyx_mstate_global->__pyx_n_u_csrValB,&__pyx_mstate_global->__pyx_n_u_csrRowPtrB,&__pyx_mstate_global->__pyx_n_u_csrColIndB,&__pyx_mstate_global->__pyx_n_u_descrC,&__pyx_mstate_global->__pyx_n_u_csrValC,&__pyx_mstate_global->__pyx_n_u_csrRowPtrC,&__pyx_mstate_global->__pyx_n_u_csrColIndC,&__pyx_mstate_global->__pyx_n_u_buffer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 2472, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 20:
        values[19] = __Pyx_ArgRef_FASTCALL(__pyx_args, 19);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[19])) __PYX_ERR(0, 2472, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 19:
        values[18] = __Pyx_ArgRef_FASTCALL(__pyx_args, 18);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[18])) __PYX_ERR(0, 2472, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 18:
        values[17] = __Pyx_ArgRef_FASTCALL(__pyx_args, 17);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[17])) __PYX_ERR(0, 2472, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 17:
        values[16] = __Pyx_ArgRef_FASTCALL(__pyx_args, 16);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[16])) __PYX_ERR(0, 2472, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 16:
        values[15] = __Pyx_ArgRef_FASTCALL(__pyx_args, 15);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 2472, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 15:
        values[14] = __Pyx_ArgRef_FASTCALL(__pyx_args, 14);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 2472, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 14:
        values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 2472, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 13:
        values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 2472, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 12:
        values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 2472, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 11:
        values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 2472, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 2472, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 2472, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 2472, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 2472, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 2472, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 2472, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2472, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2472, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2472, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2472, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "scsrgeam2", 0) < (0)) __PYX_ERR(0, 2472, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 20; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("scsrgeam2", 1, 20, 20, i); __PYX_ERR(0, 2472, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 20)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2472, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2472, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2472, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2472, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 2472, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 2472, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 2472, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 2472, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 2472, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 2472, __pyx_L3_error)
      values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 2472, __pyx_L3_error)
      values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 2472, __pyx_L3_error)
      values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 2472, __pyx_L3_error)
      values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 2472, __pyx_L3_error)
      values[14] = __Pyx_ArgRef_FASTCALL(__pyx_args, 14);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 2472, __pyx_L3_error)
      values[15] = __Pyx_ArgRef_FASTCALL(__pyx_args, 15);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 2472, __pyx_L3_error)
      values[16] = __Pyx_ArgRef_FASTCALL(__pyx_args, 16);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[16])) __PYX_ERR(0, 2472, __pyx_L3_error)
      values[17] = __Pyx_ArgRef_FASTCALL(__pyx_args, 17);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[17])) __PYX_ERR(0, 2472, __pyx_L3_error)
      values[18] = __Pyx_ArgRef_FASTCALL(__pyx_args, 18);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[18])) __PYX_ERR(0, 2472, __pyx_L3_error)
      values[19] = __Pyx_ArgRef_FASTCALL(__pyx_args, 19);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[19])) __PYX_ERR(0, 2472, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2473, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2473, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2473, __pyx_L3_error)
    __pyx_v_alpha = __Pyx_PyLong_As_size_t(values[3]); if (unlikely((__pyx_v_alpha == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2473, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2473, __pyx_L3_error)
    __pyx_v_nnzA = __Pyx_PyLong_As_int(values[5]); if (unlikely((__pyx_v_nnzA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2474, __pyx_L3_error)
    __pyx_v_csrValA = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_csrValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2474, __pyx_L3_error)
    __pyx_v_csrRowPtrA = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_csrRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2474, __pyx_L3_error)
    __pyx_v_csrColIndA = __Pyx_PyLong_As_size_t(values[8]); if (unlikely((__pyx_v_csrColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2475, __pyx_L3_error)
    __pyx_v_beta = __Pyx_PyLong_As_size_t(values[9]); if (unlikely((__pyx_v_beta == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2475, __pyx_L3_error)
    __pyx_v_descrB = __Pyx_PyLong_As_size_t(values[10]); if (unlikely((__pyx_v_descrB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2475, __pyx_L3_error)
    __pyx_v_nnzB = __Pyx_PyLong_As_int(values[11]); if (unlikely((__pyx_v_nnzB == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2476, __pyx_L3_error)
    __pyx_v_csrValB = __Pyx_PyLong_As_size_t(values[12]); if (unlikely((__pyx_v_csrValB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2476, __pyx_L3_error)
    __pyx_v_csrRowPtrB = __Pyx_PyLong_As_size_t(values[13]); if (unlikely((__pyx_v_csrRowPtrB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2476, __pyx_L3_error)
    __pyx_v_csrColIndB = __Pyx_PyLong_As_size_t(values[14]); if (unlikely((__pyx_v_csrColIndB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2477, __pyx_L3_error)
    __pyx_v_descrC = __Pyx_PyLong_As_size_t(values[15]); if (unlikely((__pyx_v_descrC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2477, __pyx_L3_error)
    __pyx_v_csrValC = __Pyx_PyLong_As_size_t(values[16]); if (unlikely((__pyx_v_csrValC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2477, __pyx_L3_error)
    __pyx_v_csrRowPtrC = __Pyx_PyLong_As_size_t(values[17]); if (unlikely((__pyx_v_csrRowPtrC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2478, __pyx_L3_error)
    __pyx_v_csrColIndC = __Pyx_PyLong_As_size_t(values[18]); if (unlikely((__pyx_v_csrColIndC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2478, __pyx_L3_error)
    __pyx_v_buffer = __Pyx_PyLong_As_size_t(values[19]); if (unlikely((__pyx_v_buffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2478, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("scsrgeam2", 1, 20, 20, __pyx_nargs); __PYX_ERR(0, 2472, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.scsrgeam2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_146scsrgeam2(__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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_146scsrgeam2(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2472, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2472, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":2490
 *     check_status(status)
 * 
 * cpdef void dcsrgeam2(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int n, size_t alpha, size_t descrA,
 *         int nnzA, size_t csrValA, size_t csrRowPtrA,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_149dcsrgeam2(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_dcsrgeam2(intptr_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;
  __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_backends/cuda/libs/cusparse.pyx":2497
 *         size_t csrColIndB, size_t descrC, size_t csrValC,
 *         size_t csrRowPtrC, size_t csrColIndC, size_t buffer) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     status = cusparseDcsrgeam2(
 *         <Handle>handle, m, n, <const double *>alpha,
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2497, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":2498
 *         size_t csrRowPtrC, size_t csrColIndC, size_t buffer) except *:
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":2506
 *         <const MatDescr>descrC, <double *>csrValC, <int *>csrRowPtrC,
 *         <int *>csrColIndC, <void*>buffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef void ccsrgeam2(
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2506, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":2490
 *     check_status(status)
 * 
 * cpdef void dcsrgeam2(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int n, size_t alpha, size_t descrA,
 *         int nnzA, size_t csrValA, size_t csrRowPtrA,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.dcsrgeam2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_149dcsrgeam2(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_148dcsrgeam2, "dcsrgeam2(intptr_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) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_149dcsrgeam2(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[20] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dcsrgeam2 (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_n,&__pyx_mstate_global->__pyx_n_u_alpha,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_nnzA,&__pyx_mstate_global->__pyx_n_u_csrValA,&__pyx_mstate_global->__pyx_n_u_csrRowPtrA,&__pyx_mstate_global->__pyx_n_u_csrColIndA,&__pyx_mstate_global->__pyx_n_u_beta,&__pyx_mstate_global->__pyx_n_u_descrB,&__pyx_mstate_global->__pyx_n_u_nnzB,&__pyx_mstate_global->__pyx_n_u_csrValB,&__pyx_mstate_global->__pyx_n_u_csrRowPtrB,&__pyx_mstate_global->__pyx_n_u_csrColIndB,&__pyx_mstate_global->__pyx_n_u_descrC,&__pyx_mstate_global->__pyx_n_u_csrValC,&__pyx_mstate_global->__pyx_n_u_csrRowPtrC,&__pyx_mstate_global->__pyx_n_u_csrColIndC,&__pyx_mstate_global->__pyx_n_u_buffer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 2490, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 20:
        values[19] = __Pyx_ArgRef_FASTCALL(__pyx_args, 19);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[19])) __PYX_ERR(0, 2490, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 19:
        values[18] = __Pyx_ArgRef_FASTCALL(__pyx_args, 18);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[18])) __PYX_ERR(0, 2490, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 18:
        values[17] = __Pyx_ArgRef_FASTCALL(__pyx_args, 17);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[17])) __PYX_ERR(0, 2490, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 17:
        values[16] = __Pyx_ArgRef_FASTCALL(__pyx_args, 16);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[16])) __PYX_ERR(0, 2490, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 16:
        values[15] = __Pyx_ArgRef_FASTCALL(__pyx_args, 15);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 2490, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 15:
        values[14] = __Pyx_ArgRef_FASTCALL(__pyx_args, 14);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 2490, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 14:
        values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 2490, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 13:
        values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 2490, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 12:
        values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 2490, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 11:
        values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 2490, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 2490, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 2490, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 2490, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 2490, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 2490, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 2490, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2490, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2490, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2490, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2490, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "dcsrgeam2", 0) < (0)) __PYX_ERR(0, 2490, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 20; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("dcsrgeam2", 1, 20, 20, i); __PYX_ERR(0, 2490, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 20)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2490, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2490, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2490, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2490, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 2490, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 2490, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 2490, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 2490, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 2490, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 2490, __pyx_L3_error)
      values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 2490, __pyx_L3_error)
      values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 2490, __pyx_L3_error)
      values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 2490, __pyx_L3_error)
      values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 2490, __pyx_L3_error)
      values[14] = __Pyx_ArgRef_FASTCALL(__pyx_args, 14);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 2490, __pyx_L3_error)
      values[15] = __Pyx_ArgRef_FASTCALL(__pyx_args, 15);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 2490, __pyx_L3_error)
      values[16] = __Pyx_ArgRef_FASTCALL(__pyx_args, 16);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[16])) __PYX_ERR(0, 2490, __pyx_L3_error)
      values[17] = __Pyx_ArgRef_FASTCALL(__pyx_args, 17);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[17])) __PYX_ERR(0, 2490, __pyx_L3_error)
      values[18] = __Pyx_ArgRef_FASTCALL(__pyx_args, 18);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[18])) __PYX_ERR(0, 2490, __pyx_L3_error)
      values[19] = __Pyx_ArgRef_FASTCALL(__pyx_args, 19);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[19])) __PYX_ERR(0, 2490, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2491, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2491, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2491, __pyx_L3_error)
    __pyx_v_alpha = __Pyx_PyLong_As_size_t(values[3]); if (unlikely((__pyx_v_alpha == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2491, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2491, __pyx_L3_error)
    __pyx_v_nnzA = __Pyx_PyLong_As_int(values[5]); if (unlikely((__pyx_v_nnzA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2492, __pyx_L3_error)
    __pyx_v_csrValA = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_csrValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2492, __pyx_L3_error)
    __pyx_v_csrRowPtrA = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_csrRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2492, __pyx_L3_error)
    __pyx_v_csrColIndA = __Pyx_PyLong_As_size_t(values[8]); if (unlikely((__pyx_v_csrColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2493, __pyx_L3_error)
    __pyx_v_beta = __Pyx_PyLong_As_size_t(values[9]); if (unlikely((__pyx_v_beta == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2493, __pyx_L3_error)
    __pyx_v_descrB = __Pyx_PyLong_As_size_t(values[10]); if (unlikely((__pyx_v_descrB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2493, __pyx_L3_error)
    __pyx_v_nnzB = __Pyx_PyLong_As_int(values[11]); if (unlikely((__pyx_v_nnzB == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2494, __pyx_L3_error)
    __pyx_v_csrValB = __Pyx_PyLong_As_size_t(values[12]); if (unlikely((__pyx_v_csrValB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2494, __pyx_L3_error)
    __pyx_v_csrRowPtrB = __Pyx_PyLong_As_size_t(values[13]); if (unlikely((__pyx_v_csrRowPtrB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2494, __pyx_L3_error)
    __pyx_v_csrColIndB = __Pyx_PyLong_As_size_t(values[14]); if (unlikely((__pyx_v_csrColIndB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2495, __pyx_L3_error)
    __pyx_v_descrC = __Pyx_PyLong_As_size_t(values[15]); if (unlikely((__pyx_v_descrC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2495, __pyx_L3_error)
    __pyx_v_csrValC = __Pyx_PyLong_As_size_t(values[16]); if (unlikely((__pyx_v_csrValC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2495, __pyx_L3_error)
    __pyx_v_csrRowPtrC = __Pyx_PyLong_As_size_t(values[17]); if (unlikely((__pyx_v_csrRowPtrC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2496, __pyx_L3_error)
    __pyx_v_csrColIndC = __Pyx_PyLong_As_size_t(values[18]); if (unlikely((__pyx_v_csrColIndC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2496, __pyx_L3_error)
    __pyx_v_buffer = __Pyx_PyLong_As_size_t(values[19]); if (unlikely((__pyx_v_buffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2496, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("dcsrgeam2", 1, 20, 20, __pyx_nargs); __PYX_ERR(0, 2490, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.dcsrgeam2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_148dcsrgeam2(__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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_148dcsrgeam2(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2490, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2490, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":2508
 *     check_status(status)
 * 
 * cpdef void ccsrgeam2(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int n, size_t alpha, size_t descrA,
 *         int nnzA, size_t csrValA, size_t csrRowPtrA,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_151ccsrgeam2(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_ccsrgeam2(intptr_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;
  __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_backends/cuda/libs/cusparse.pyx":2515
 *         size_t csrColIndB, size_t descrC, size_t csrValC,
 *         size_t csrRowPtrC, size_t csrColIndC, size_t buffer) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     status = cusparseCcsrgeam2(
 *         <Handle>handle, m, n, <const cuComplex *>alpha,
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2515, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":2516
 *         size_t csrRowPtrC, size_t csrColIndC, size_t buffer) except *:
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":2525
 *         <const MatDescr>descrC, <cuComplex *>csrValC, <int *>csrRowPtrC,
 *         <int *>csrColIndC, <void*>buffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef void zcsrgeam2(
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2525, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":2508
 *     check_status(status)
 * 
 * cpdef void ccsrgeam2(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int n, size_t alpha, size_t descrA,
 *         int nnzA, size_t csrValA, size_t csrRowPtrA,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.ccsrgeam2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_151ccsrgeam2(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_150ccsrgeam2, "ccsrgeam2(intptr_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) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_151ccsrgeam2(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[20] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ccsrgeam2 (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_n,&__pyx_mstate_global->__pyx_n_u_alpha,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_nnzA,&__pyx_mstate_global->__pyx_n_u_csrValA,&__pyx_mstate_global->__pyx_n_u_csrRowPtrA,&__pyx_mstate_global->__pyx_n_u_csrColIndA,&__pyx_mstate_global->__pyx_n_u_beta,&__pyx_mstate_global->__pyx_n_u_descrB,&__pyx_mstate_global->__pyx_n_u_nnzB,&__pyx_mstate_global->__pyx_n_u_csrValB,&__pyx_mstate_global->__pyx_n_u_csrRowPtrB,&__pyx_mstate_global->__pyx_n_u_csrColIndB,&__pyx_mstate_global->__pyx_n_u_descrC,&__pyx_mstate_global->__pyx_n_u_csrValC,&__pyx_mstate_global->__pyx_n_u_csrRowPtrC,&__pyx_mstate_global->__pyx_n_u_csrColIndC,&__pyx_mstate_global->__pyx_n_u_buffer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 2508, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 20:
        values[19] = __Pyx_ArgRef_FASTCALL(__pyx_args, 19);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[19])) __PYX_ERR(0, 2508, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 19:
        values[18] = __Pyx_ArgRef_FASTCALL(__pyx_args, 18);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[18])) __PYX_ERR(0, 2508, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 18:
        values[17] = __Pyx_ArgRef_FASTCALL(__pyx_args, 17);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[17])) __PYX_ERR(0, 2508, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 17:
        values[16] = __Pyx_ArgRef_FASTCALL(__pyx_args, 16);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[16])) __PYX_ERR(0, 2508, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 16:
        values[15] = __Pyx_ArgRef_FASTCALL(__pyx_args, 15);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 2508, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 15:
        values[14] = __Pyx_ArgRef_FASTCALL(__pyx_args, 14);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 2508, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 14:
        values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 2508, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 13:
        values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 2508, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 12:
        values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 2508, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 11:
        values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 2508, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 2508, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 2508, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 2508, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 2508, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 2508, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 2508, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2508, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2508, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2508, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2508, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "ccsrgeam2", 0) < (0)) __PYX_ERR(0, 2508, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 20; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("ccsrgeam2", 1, 20, 20, i); __PYX_ERR(0, 2508, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 20)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2508, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2508, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2508, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2508, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 2508, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 2508, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 2508, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 2508, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 2508, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 2508, __pyx_L3_error)
      values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 2508, __pyx_L3_error)
      values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 2508, __pyx_L3_error)
      values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 2508, __pyx_L3_error)
      values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 2508, __pyx_L3_error)
      values[14] = __Pyx_ArgRef_FASTCALL(__pyx_args, 14);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 2508, __pyx_L3_error)
      values[15] = __Pyx_ArgRef_FASTCALL(__pyx_args, 15);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 2508, __pyx_L3_error)
      values[16] = __Pyx_ArgRef_FASTCALL(__pyx_args, 16);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[16])) __PYX_ERR(0, 2508, __pyx_L3_error)
      values[17] = __Pyx_ArgRef_FASTCALL(__pyx_args, 17);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[17])) __PYX_ERR(0, 2508, __pyx_L3_error)
      values[18] = __Pyx_ArgRef_FASTCALL(__pyx_args, 18);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[18])) __PYX_ERR(0, 2508, __pyx_L3_error)
      values[19] = __Pyx_ArgRef_FASTCALL(__pyx_args, 19);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[19])) __PYX_ERR(0, 2508, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2509, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2509, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2509, __pyx_L3_error)
    __pyx_v_alpha = __Pyx_PyLong_As_size_t(values[3]); if (unlikely((__pyx_v_alpha == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2509, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2509, __pyx_L3_error)
    __pyx_v_nnzA = __Pyx_PyLong_As_int(values[5]); if (unlikely((__pyx_v_nnzA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2510, __pyx_L3_error)
    __pyx_v_csrValA = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_csrValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2510, __pyx_L3_error)
    __pyx_v_csrRowPtrA = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_csrRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2510, __pyx_L3_error)
    __pyx_v_csrColIndA = __Pyx_PyLong_As_size_t(values[8]); if (unlikely((__pyx_v_csrColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2511, __pyx_L3_error)
    __pyx_v_beta = __Pyx_PyLong_As_size_t(values[9]); if (unlikely((__pyx_v_beta == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2511, __pyx_L3_error)
    __pyx_v_descrB = __Pyx_PyLong_As_size_t(values[10]); if (unlikely((__pyx_v_descrB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2511, __pyx_L3_error)
    __pyx_v_nnzB = __Pyx_PyLong_As_int(values[11]); if (unlikely((__pyx_v_nnzB == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2512, __pyx_L3_error)
    __pyx_v_csrValB = __Pyx_PyLong_As_size_t(values[12]); if (unlikely((__pyx_v_csrValB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2512, __pyx_L3_error)
    __pyx_v_csrRowPtrB = __Pyx_PyLong_As_size_t(values[13]); if (unlikely((__pyx_v_csrRowPtrB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2512, __pyx_L3_error)
    __pyx_v_csrColIndB = __Pyx_PyLong_As_size_t(values[14]); if (unlikely((__pyx_v_csrColIndB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2513, __pyx_L3_error)
    __pyx_v_descrC = __Pyx_PyLong_As_size_t(values[15]); if (unlikely((__pyx_v_descrC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2513, __pyx_L3_error)
    __pyx_v_csrValC = __Pyx_PyLong_As_size_t(values[16]); if (unlikely((__pyx_v_csrValC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2513, __pyx_L3_error)
    __pyx_v_csrRowPtrC = __Pyx_PyLong_As_size_t(values[17]); if (unlikely((__pyx_v_csrRowPtrC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2514, __pyx_L3_error)
    __pyx_v_csrColIndC = __Pyx_PyLong_As_size_t(values[18]); if (unlikely((__pyx_v_csrColIndC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2514, __pyx_L3_error)
    __pyx_v_buffer = __Pyx_PyLong_As_size_t(values[19]); if (unlikely((__pyx_v_buffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2514, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ccsrgeam2", 1, 20, 20, __pyx_nargs); __PYX_ERR(0, 2508, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.ccsrgeam2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_150ccsrgeam2(__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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_150ccsrgeam2(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2508, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2508, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":2527
 *     check_status(status)
 * 
 * cpdef void zcsrgeam2(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int n, size_t alpha, size_t descrA,
 *         int nnzA, size_t csrValA, size_t csrRowPtrA,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_153zcsrgeam2(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_zcsrgeam2(intptr_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;
  __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_backends/cuda/libs/cusparse.pyx":2534
 *         size_t csrColIndB, size_t descrC, size_t csrValC,
 *         size_t csrRowPtrC, size_t csrColIndC, size_t buffer) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     status = cusparseZcsrgeam2(
 *         <Handle>handle, m, n, <const cuDoubleComplex *>alpha,
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2534, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":2535
 *         size_t csrRowPtrC, size_t csrColIndC, size_t buffer) except *:
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":2544
 *         <const MatDescr>descrC, <cuDoubleComplex *>csrValC, <int *>csrRowPtrC,
 *         <int *>csrColIndC, <void*>buffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef void xcsrgemmNnz(
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 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_backends/cuda/libs/cusparse.pyx":2527
 *     check_status(status)
 * 
 * cpdef void zcsrgeam2(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int n, size_t alpha, size_t descrA,
 *         int nnzA, size_t csrValA, size_t csrRowPtrA,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.zcsrgeam2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_153zcsrgeam2(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_152zcsrgeam2, "zcsrgeam2(intptr_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) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_153zcsrgeam2(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[20] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("zcsrgeam2 (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_n,&__pyx_mstate_global->__pyx_n_u_alpha,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_nnzA,&__pyx_mstate_global->__pyx_n_u_csrValA,&__pyx_mstate_global->__pyx_n_u_csrRowPtrA,&__pyx_mstate_global->__pyx_n_u_csrColIndA,&__pyx_mstate_global->__pyx_n_u_beta,&__pyx_mstate_global->__pyx_n_u_descrB,&__pyx_mstate_global->__pyx_n_u_nnzB,&__pyx_mstate_global->__pyx_n_u_csrValB,&__pyx_mstate_global->__pyx_n_u_csrRowPtrB,&__pyx_mstate_global->__pyx_n_u_csrColIndB,&__pyx_mstate_global->__pyx_n_u_descrC,&__pyx_mstate_global->__pyx_n_u_csrValC,&__pyx_mstate_global->__pyx_n_u_csrRowPtrC,&__pyx_mstate_global->__pyx_n_u_csrColIndC,&__pyx_mstate_global->__pyx_n_u_buffer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 2527, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 20:
        values[19] = __Pyx_ArgRef_FASTCALL(__pyx_args, 19);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[19])) __PYX_ERR(0, 2527, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 19:
        values[18] = __Pyx_ArgRef_FASTCALL(__pyx_args, 18);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[18])) __PYX_ERR(0, 2527, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 18:
        values[17] = __Pyx_ArgRef_FASTCALL(__pyx_args, 17);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[17])) __PYX_ERR(0, 2527, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 17:
        values[16] = __Pyx_ArgRef_FASTCALL(__pyx_args, 16);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[16])) __PYX_ERR(0, 2527, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 16:
        values[15] = __Pyx_ArgRef_FASTCALL(__pyx_args, 15);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 2527, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 15:
        values[14] = __Pyx_ArgRef_FASTCALL(__pyx_args, 14);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 2527, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 14:
        values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 2527, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 13:
        values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 2527, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 12:
        values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 2527, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 11:
        values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 2527, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 2527, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 2527, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 2527, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 2527, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 2527, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 2527, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2527, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2527, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2527, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2527, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "zcsrgeam2", 0) < (0)) __PYX_ERR(0, 2527, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 20; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("zcsrgeam2", 1, 20, 20, i); __PYX_ERR(0, 2527, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 20)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2527, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2527, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2527, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2527, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 2527, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 2527, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 2527, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 2527, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 2527, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 2527, __pyx_L3_error)
      values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 2527, __pyx_L3_error)
      values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 2527, __pyx_L3_error)
      values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 2527, __pyx_L3_error)
      values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 2527, __pyx_L3_error)
      values[14] = __Pyx_ArgRef_FASTCALL(__pyx_args, 14);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 2527, __pyx_L3_error)
      values[15] = __Pyx_ArgRef_FASTCALL(__pyx_args, 15);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 2527, __pyx_L3_error)
      values[16] = __Pyx_ArgRef_FASTCALL(__pyx_args, 16);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[16])) __PYX_ERR(0, 2527, __pyx_L3_error)
      values[17] = __Pyx_ArgRef_FASTCALL(__pyx_args, 17);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[17])) __PYX_ERR(0, 2527, __pyx_L3_error)
      values[18] = __Pyx_ArgRef_FASTCALL(__pyx_args, 18);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[18])) __PYX_ERR(0, 2527, __pyx_L3_error)
      values[19] = __Pyx_ArgRef_FASTCALL(__pyx_args, 19);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[19])) __PYX_ERR(0, 2527, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2528, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2528, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2528, __pyx_L3_error)
    __pyx_v_alpha = __Pyx_PyLong_As_size_t(values[3]); if (unlikely((__pyx_v_alpha == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2528, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2528, __pyx_L3_error)
    __pyx_v_nnzA = __Pyx_PyLong_As_int(values[5]); if (unlikely((__pyx_v_nnzA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2529, __pyx_L3_error)
    __pyx_v_csrValA = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_csrValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2529, __pyx_L3_error)
    __pyx_v_csrRowPtrA = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_csrRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2529, __pyx_L3_error)
    __pyx_v_csrColIndA = __Pyx_PyLong_As_size_t(values[8]); if (unlikely((__pyx_v_csrColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2530, __pyx_L3_error)
    __pyx_v_beta = __Pyx_PyLong_As_size_t(values[9]); if (unlikely((__pyx_v_beta == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2530, __pyx_L3_error)
    __pyx_v_descrB = __Pyx_PyLong_As_size_t(values[10]); if (unlikely((__pyx_v_descrB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2530, __pyx_L3_error)
    __pyx_v_nnzB = __Pyx_PyLong_As_int(values[11]); if (unlikely((__pyx_v_nnzB == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2531, __pyx_L3_error)
    __pyx_v_csrValB = __Pyx_PyLong_As_size_t(values[12]); if (unlikely((__pyx_v_csrValB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2531, __pyx_L3_error)
    __pyx_v_csrRowPtrB = __Pyx_PyLong_As_size_t(values[13]); if (unlikely((__pyx_v_csrRowPtrB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2531, __pyx_L3_error)
    __pyx_v_csrColIndB = __Pyx_PyLong_As_size_t(values[14]); if (unlikely((__pyx_v_csrColIndB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2532, __pyx_L3_error)
    __pyx_v_descrC = __Pyx_PyLong_As_size_t(values[15]); if (unlikely((__pyx_v_descrC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2532, __pyx_L3_error)
    __pyx_v_csrValC = __Pyx_PyLong_As_size_t(values[16]); if (unlikely((__pyx_v_csrValC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2532, __pyx_L3_error)
    __pyx_v_csrRowPtrC = __Pyx_PyLong_As_size_t(values[17]); if (unlikely((__pyx_v_csrRowPtrC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2533, __pyx_L3_error)
    __pyx_v_csrColIndC = __Pyx_PyLong_As_size_t(values[18]); if (unlikely((__pyx_v_csrColIndC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2533, __pyx_L3_error)
    __pyx_v_buffer = __Pyx_PyLong_As_size_t(values[19]); if (unlikely((__pyx_v_buffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2533, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("zcsrgeam2", 1, 20, 20, __pyx_nargs); __PYX_ERR(0, 2527, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.zcsrgeam2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_152zcsrgeam2(__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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_152zcsrgeam2(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2527, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2527, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":2546
 *     check_status(status)
 * 
 * cpdef void xcsrgemmNnz(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int transA, int transB, int m, int n, int k,
 *         size_t descrA, int nnzA, size_t csrRowPtrA,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_155xcsrgemmNnz(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_xcsrgemmNnz(intptr_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;
  __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_backends/cuda/libs/cusparse.pyx":2552
 *         size_t csrRowPtrB, size_t csrColIndB,
 *         size_t descrC, size_t csrRowPtrC, size_t nnzTotalDevHostPtr) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     status = cusparseXcsrgemmNnz(
 *         <Handle>handle, <Operation>transA, <Operation>transB, m, n, k,
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2552, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":2553
 *         size_t descrC, size_t csrRowPtrC, size_t nnzTotalDevHostPtr) except *:
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":2559
 *         <const int *>csrRowPtrB, <const int *>csrColIndB,
 *         <const MatDescr>descrC, <int *>csrRowPtrC, <int *>nnzTotalDevHostPtr)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef void scsrgemm(
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2559, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":2546
 *     check_status(status)
 * 
 * cpdef void xcsrgemmNnz(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int transA, int transB, int m, int n, int k,
 *         size_t descrA, int nnzA, size_t csrRowPtrA,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.xcsrgemmNnz", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_155xcsrgemmNnz(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_154xcsrgemmNnz, "xcsrgemmNnz(intptr_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) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_155xcsrgemmNnz(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[17] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("xcsrgemmNnz (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_transA,&__pyx_mstate_global->__pyx_n_u_transB,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_n,&__pyx_mstate_global->__pyx_n_u_k,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_nnzA,&__pyx_mstate_global->__pyx_n_u_csrRowPtrA,&__pyx_mstate_global->__pyx_n_u_csrColIndA,&__pyx_mstate_global->__pyx_n_u_descrB,&__pyx_mstate_global->__pyx_n_u_nnzB,&__pyx_mstate_global->__pyx_n_u_csrRowPtrB,&__pyx_mstate_global->__pyx_n_u_csrColIndB,&__pyx_mstate_global->__pyx_n_u_descrC,&__pyx_mstate_global->__pyx_n_u_csrRowPtrC,&__pyx_mstate_global->__pyx_n_u_nnzTotalDevHostPtr,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 2546, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 17:
        values[16] = __Pyx_ArgRef_FASTCALL(__pyx_args, 16);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[16])) __PYX_ERR(0, 2546, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 16:
        values[15] = __Pyx_ArgRef_FASTCALL(__pyx_args, 15);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 2546, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 15:
        values[14] = __Pyx_ArgRef_FASTCALL(__pyx_args, 14);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 2546, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 14:
        values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 2546, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 13:
        values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 2546, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 12:
        values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 2546, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 11:
        values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 2546, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 2546, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 2546, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 2546, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 2546, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 2546, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 2546, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2546, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2546, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2546, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2546, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "xcsrgemmNnz", 0) < (0)) __PYX_ERR(0, 2546, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 17; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("xcsrgemmNnz", 1, 17, 17, i); __PYX_ERR(0, 2546, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 17)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2546, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2546, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2546, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2546, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 2546, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 2546, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 2546, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 2546, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 2546, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 2546, __pyx_L3_error)
      values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 2546, __pyx_L3_error)
      values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 2546, __pyx_L3_error)
      values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 2546, __pyx_L3_error)
      values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 2546, __pyx_L3_error)
      values[14] = __Pyx_ArgRef_FASTCALL(__pyx_args, 14);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 2546, __pyx_L3_error)
      values[15] = __Pyx_ArgRef_FASTCALL(__pyx_args, 15);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 2546, __pyx_L3_error)
      values[16] = __Pyx_ArgRef_FASTCALL(__pyx_args, 16);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[16])) __PYX_ERR(0, 2546, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2547, __pyx_L3_error)
    __pyx_v_transA = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_transA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2547, __pyx_L3_error)
    __pyx_v_transB = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_transB == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2547, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[3]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2547, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyLong_As_int(values[4]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2547, __pyx_L3_error)
    __pyx_v_k = __Pyx_PyLong_As_int(values[5]); if (unlikely((__pyx_v_k == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2547, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2548, __pyx_L3_error)
    __pyx_v_nnzA = __Pyx_PyLong_As_int(values[7]); if (unlikely((__pyx_v_nnzA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2548, __pyx_L3_error)
    __pyx_v_csrRowPtrA = __Pyx_PyLong_As_size_t(values[8]); if (unlikely((__pyx_v_csrRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2548, __pyx_L3_error)
    __pyx_v_csrColIndA = __Pyx_PyLong_As_size_t(values[9]); if (unlikely((__pyx_v_csrColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2549, __pyx_L3_error)
    __pyx_v_descrB = __Pyx_PyLong_As_size_t(values[10]); if (unlikely((__pyx_v_descrB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2549, __pyx_L3_error)
    __pyx_v_nnzB = __Pyx_PyLong_As_int(values[11]); if (unlikely((__pyx_v_nnzB == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2549, __pyx_L3_error)
    __pyx_v_csrRowPtrB = __Pyx_PyLong_As_size_t(values[12]); if (unlikely((__pyx_v_csrRowPtrB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2550, __pyx_L3_error)
    __pyx_v_csrColIndB = __Pyx_PyLong_As_size_t(values[13]); if (unlikely((__pyx_v_csrColIndB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2550, __pyx_L3_error)
    __pyx_v_descrC = __Pyx_PyLong_As_size_t(values[14]); if (unlikely((__pyx_v_descrC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2551, __pyx_L3_error)
    __pyx_v_csrRowPtrC = __Pyx_PyLong_As_size_t(values[15]); if (unlikely((__pyx_v_csrRowPtrC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2551, __pyx_L3_error)
    __pyx_v_nnzTotalDevHostPtr = __Pyx_PyLong_As_size_t(values[16]); if (unlikely((__pyx_v_nnzTotalDevHostPtr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2551, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("xcsrgemmNnz", 1, 17, 17, __pyx_nargs); __PYX_ERR(0, 2546, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.xcsrgemmNnz", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_154xcsrgemmNnz(__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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_154xcsrgemmNnz(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2546, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2546, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":2561
 *     check_status(status)
 * 
 * cpdef void scsrgemm(             # <<<<<<<<<<<<<<
 *         intptr_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_13cupy_backends_4cuda_4libs_8cusparse_157scsrgemm(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_scsrgemm(intptr_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;
  __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_backends/cuda/libs/cusparse.pyx":2568
 *         size_t csrColIndB, size_t descrC, size_t csrValC,
 *         size_t csrRowPtrC, size_t csrColIndC) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     status = cusparseScsrgemm(
 *         <Handle>handle, <Operation>transA, <Operation>transB, m, n, k,
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2568, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":2569
 *         size_t csrRowPtrC, size_t csrColIndC) except *:
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":2577
 *         <const MatDescr>descrC, <float *>csrValC,
 *         <const int *>csrRowPtrC, <int *>csrColIndC)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef void dcsrgemm(
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2577, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":2561
 *     check_status(status)
 * 
 * cpdef void scsrgemm(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int transA, int transB, int m, int n, int k,
 *         size_t descrA, const int nnzA, size_t csrValA,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.scsrgemm", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_157scsrgemm(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_156scsrgemm, "scsrgemm(intptr_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) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_157scsrgemm(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[20] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("scsrgemm (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_transA,&__pyx_mstate_global->__pyx_n_u_transB,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_n,&__pyx_mstate_global->__pyx_n_u_k,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_nnzA,&__pyx_mstate_global->__pyx_n_u_csrValA,&__pyx_mstate_global->__pyx_n_u_csrRowPtrA,&__pyx_mstate_global->__pyx_n_u_csrColIndA,&__pyx_mstate_global->__pyx_n_u_descrB,&__pyx_mstate_global->__pyx_n_u_nnzB,&__pyx_mstate_global->__pyx_n_u_csrValB,&__pyx_mstate_global->__pyx_n_u_csrRowPtrB,&__pyx_mstate_global->__pyx_n_u_csrColIndB,&__pyx_mstate_global->__pyx_n_u_descrC,&__pyx_mstate_global->__pyx_n_u_csrValC,&__pyx_mstate_global->__pyx_n_u_csrRowPtrC,&__pyx_mstate_global->__pyx_n_u_csrColIndC,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 2561, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 20:
        values[19] = __Pyx_ArgRef_FASTCALL(__pyx_args, 19);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[19])) __PYX_ERR(0, 2561, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 19:
        values[18] = __Pyx_ArgRef_FASTCALL(__pyx_args, 18);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[18])) __PYX_ERR(0, 2561, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 18:
        values[17] = __Pyx_ArgRef_FASTCALL(__pyx_args, 17);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[17])) __PYX_ERR(0, 2561, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 17:
        values[16] = __Pyx_ArgRef_FASTCALL(__pyx_args, 16);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[16])) __PYX_ERR(0, 2561, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 16:
        values[15] = __Pyx_ArgRef_FASTCALL(__pyx_args, 15);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 2561, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 15:
        values[14] = __Pyx_ArgRef_FASTCALL(__pyx_args, 14);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 2561, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 14:
        values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 2561, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 13:
        values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 2561, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 12:
        values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 2561, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 11:
        values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 2561, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 2561, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 2561, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 2561, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 2561, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 2561, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 2561, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2561, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2561, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2561, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2561, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "scsrgemm", 0) < (0)) __PYX_ERR(0, 2561, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 20; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("scsrgemm", 1, 20, 20, i); __PYX_ERR(0, 2561, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 20)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2561, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2561, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2561, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2561, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 2561, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 2561, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 2561, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 2561, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 2561, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 2561, __pyx_L3_error)
      values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 2561, __pyx_L3_error)
      values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 2561, __pyx_L3_error)
      values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 2561, __pyx_L3_error)
      values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 2561, __pyx_L3_error)
      values[14] = __Pyx_ArgRef_FASTCALL(__pyx_args, 14);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 2561, __pyx_L3_error)
      values[15] = __Pyx_ArgRef_FASTCALL(__pyx_args, 15);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 2561, __pyx_L3_error)
      values[16] = __Pyx_ArgRef_FASTCALL(__pyx_args, 16);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[16])) __PYX_ERR(0, 2561, __pyx_L3_error)
      values[17] = __Pyx_ArgRef_FASTCALL(__pyx_args, 17);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[17])) __PYX_ERR(0, 2561, __pyx_L3_error)
      values[18] = __Pyx_ArgRef_FASTCALL(__pyx_args, 18);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[18])) __PYX_ERR(0, 2561, __pyx_L3_error)
      values[19] = __Pyx_ArgRef_FASTCALL(__pyx_args, 19);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[19])) __PYX_ERR(0, 2561, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2562, __pyx_L3_error)
    __pyx_v_transA = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_transA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2562, __pyx_L3_error)
    __pyx_v_transB = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_transB == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2562, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[3]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2562, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyLong_As_int(values[4]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2562, __pyx_L3_error)
    __pyx_v_k = __Pyx_PyLong_As_int(values[5]); if (unlikely((__pyx_v_k == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2562, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2563, __pyx_L3_error)
    __pyx_v_nnzA = __Pyx_PyLong_As_int(values[7]); if (unlikely((__pyx_v_nnzA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2563, __pyx_L3_error)
    __pyx_v_csrValA = __Pyx_PyLong_As_size_t(values[8]); if (unlikely((__pyx_v_csrValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2563, __pyx_L3_error)
    __pyx_v_csrRowPtrA = __Pyx_PyLong_As_size_t(values[9]); if (unlikely((__pyx_v_csrRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2564, __pyx_L3_error)
    __pyx_v_csrColIndA = __Pyx_PyLong_As_size_t(values[10]); if (unlikely((__pyx_v_csrColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2564, __pyx_L3_error)
    __pyx_v_descrB = __Pyx_PyLong_As_size_t(values[11]); if (unlikely((__pyx_v_descrB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2564, __pyx_L3_error)
    __pyx_v_nnzB = __Pyx_PyLong_As_int(values[12]); if (unlikely((__pyx_v_nnzB == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2565, __pyx_L3_error)
    __pyx_v_csrValB = __Pyx_PyLong_As_size_t(values[13]); if (unlikely((__pyx_v_csrValB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2565, __pyx_L3_error)
    __pyx_v_csrRowPtrB = __Pyx_PyLong_As_size_t(values[14]); if (unlikely((__pyx_v_csrRowPtrB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2565, __pyx_L3_error)
    __pyx_v_csrColIndB = __Pyx_PyLong_As_size_t(values[15]); if (unlikely((__pyx_v_csrColIndB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2566, __pyx_L3_error)
    __pyx_v_descrC = __Pyx_PyLong_As_size_t(values[16]); if (unlikely((__pyx_v_descrC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2566, __pyx_L3_error)
    __pyx_v_csrValC = __Pyx_PyLong_As_size_t(values[17]); if (unlikely((__pyx_v_csrValC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2566, __pyx_L3_error)
    __pyx_v_csrRowPtrC = __Pyx_PyLong_As_size_t(values[18]); if (unlikely((__pyx_v_csrRowPtrC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2567, __pyx_L3_error)
    __pyx_v_csrColIndC = __Pyx_PyLong_As_size_t(values[19]); if (unlikely((__pyx_v_csrColIndC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2567, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("scsrgemm", 1, 20, 20, __pyx_nargs); __PYX_ERR(0, 2561, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.scsrgemm", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_156scsrgemm(__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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_156scsrgemm(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2561, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2561, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":2579
 *     check_status(status)
 * 
 * cpdef void dcsrgemm(             # <<<<<<<<<<<<<<
 *         intptr_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_13cupy_backends_4cuda_4libs_8cusparse_159dcsrgemm(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_dcsrgemm(intptr_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;
  __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_backends/cuda/libs/cusparse.pyx":2586
 *         size_t csrColIndB, size_t descrC, size_t csrValC,
 *         size_t csrRowPtrC, size_t csrColIndC) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     status = cusparseDcsrgemm(
 *         <Handle>handle, <Operation>transA, <Operation>transB, m, n, k,
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2586, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":2587
 *         size_t csrRowPtrC, size_t csrColIndC) except *:
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":2595
 *         <const MatDescr>descrC, <double *>csrValC,
 *         <const int *>csrRowPtrC, <int *>csrColIndC)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef void ccsrgemm(
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2595, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":2579
 *     check_status(status)
 * 
 * cpdef void dcsrgemm(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int transA, int transB, int m, int n, int k,
 *         size_t descrA, const int nnzA, size_t csrValA,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.dcsrgemm", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_159dcsrgemm(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_158dcsrgemm, "dcsrgemm(intptr_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) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_159dcsrgemm(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[20] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dcsrgemm (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_transA,&__pyx_mstate_global->__pyx_n_u_transB,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_n,&__pyx_mstate_global->__pyx_n_u_k,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_nnzA,&__pyx_mstate_global->__pyx_n_u_csrValA,&__pyx_mstate_global->__pyx_n_u_csrRowPtrA,&__pyx_mstate_global->__pyx_n_u_csrColIndA,&__pyx_mstate_global->__pyx_n_u_descrB,&__pyx_mstate_global->__pyx_n_u_nnzB,&__pyx_mstate_global->__pyx_n_u_csrValB,&__pyx_mstate_global->__pyx_n_u_csrRowPtrB,&__pyx_mstate_global->__pyx_n_u_csrColIndB,&__pyx_mstate_global->__pyx_n_u_descrC,&__pyx_mstate_global->__pyx_n_u_csrValC,&__pyx_mstate_global->__pyx_n_u_csrRowPtrC,&__pyx_mstate_global->__pyx_n_u_csrColIndC,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 2579, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 20:
        values[19] = __Pyx_ArgRef_FASTCALL(__pyx_args, 19);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[19])) __PYX_ERR(0, 2579, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 19:
        values[18] = __Pyx_ArgRef_FASTCALL(__pyx_args, 18);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[18])) __PYX_ERR(0, 2579, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 18:
        values[17] = __Pyx_ArgRef_FASTCALL(__pyx_args, 17);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[17])) __PYX_ERR(0, 2579, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 17:
        values[16] = __Pyx_ArgRef_FASTCALL(__pyx_args, 16);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[16])) __PYX_ERR(0, 2579, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 16:
        values[15] = __Pyx_ArgRef_FASTCALL(__pyx_args, 15);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 2579, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 15:
        values[14] = __Pyx_ArgRef_FASTCALL(__pyx_args, 14);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 2579, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 14:
        values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 2579, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 13:
        values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 2579, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 12:
        values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 2579, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 11:
        values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 2579, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 2579, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 2579, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 2579, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 2579, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 2579, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 2579, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2579, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2579, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2579, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2579, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "dcsrgemm", 0) < (0)) __PYX_ERR(0, 2579, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 20; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("dcsrgemm", 1, 20, 20, i); __PYX_ERR(0, 2579, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 20)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2579, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2579, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2579, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2579, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 2579, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 2579, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 2579, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 2579, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 2579, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 2579, __pyx_L3_error)
      values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 2579, __pyx_L3_error)
      values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 2579, __pyx_L3_error)
      values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 2579, __pyx_L3_error)
      values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 2579, __pyx_L3_error)
      values[14] = __Pyx_ArgRef_FASTCALL(__pyx_args, 14);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 2579, __pyx_L3_error)
      values[15] = __Pyx_ArgRef_FASTCALL(__pyx_args, 15);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 2579, __pyx_L3_error)
      values[16] = __Pyx_ArgRef_FASTCALL(__pyx_args, 16);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[16])) __PYX_ERR(0, 2579, __pyx_L3_error)
      values[17] = __Pyx_ArgRef_FASTCALL(__pyx_args, 17);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[17])) __PYX_ERR(0, 2579, __pyx_L3_error)
      values[18] = __Pyx_ArgRef_FASTCALL(__pyx_args, 18);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[18])) __PYX_ERR(0, 2579, __pyx_L3_error)
      values[19] = __Pyx_ArgRef_FASTCALL(__pyx_args, 19);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[19])) __PYX_ERR(0, 2579, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2580, __pyx_L3_error)
    __pyx_v_transA = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_transA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2580, __pyx_L3_error)
    __pyx_v_transB = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_transB == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2580, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[3]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2580, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyLong_As_int(values[4]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2580, __pyx_L3_error)
    __pyx_v_k = __Pyx_PyLong_As_int(values[5]); if (unlikely((__pyx_v_k == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2580, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2581, __pyx_L3_error)
    __pyx_v_nnzA = __Pyx_PyLong_As_int(values[7]); if (unlikely((__pyx_v_nnzA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2581, __pyx_L3_error)
    __pyx_v_csrValA = __Pyx_PyLong_As_size_t(values[8]); if (unlikely((__pyx_v_csrValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2581, __pyx_L3_error)
    __pyx_v_csrRowPtrA = __Pyx_PyLong_As_size_t(values[9]); if (unlikely((__pyx_v_csrRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2582, __pyx_L3_error)
    __pyx_v_csrColIndA = __Pyx_PyLong_As_size_t(values[10]); if (unlikely((__pyx_v_csrColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2582, __pyx_L3_error)
    __pyx_v_descrB = __Pyx_PyLong_As_size_t(values[11]); if (unlikely((__pyx_v_descrB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2582, __pyx_L3_error)
    __pyx_v_nnzB = __Pyx_PyLong_As_int(values[12]); if (unlikely((__pyx_v_nnzB == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2583, __pyx_L3_error)
    __pyx_v_csrValB = __Pyx_PyLong_As_size_t(values[13]); if (unlikely((__pyx_v_csrValB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2583, __pyx_L3_error)
    __pyx_v_csrRowPtrB = __Pyx_PyLong_As_size_t(values[14]); if (unlikely((__pyx_v_csrRowPtrB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2583, __pyx_L3_error)
    __pyx_v_csrColIndB = __Pyx_PyLong_As_size_t(values[15]); if (unlikely((__pyx_v_csrColIndB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2584, __pyx_L3_error)
    __pyx_v_descrC = __Pyx_PyLong_As_size_t(values[16]); if (unlikely((__pyx_v_descrC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2584, __pyx_L3_error)
    __pyx_v_csrValC = __Pyx_PyLong_As_size_t(values[17]); if (unlikely((__pyx_v_csrValC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2584, __pyx_L3_error)
    __pyx_v_csrRowPtrC = __Pyx_PyLong_As_size_t(values[18]); if (unlikely((__pyx_v_csrRowPtrC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2585, __pyx_L3_error)
    __pyx_v_csrColIndC = __Pyx_PyLong_As_size_t(values[19]); if (unlikely((__pyx_v_csrColIndC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2585, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("dcsrgemm", 1, 20, 20, __pyx_nargs); __PYX_ERR(0, 2579, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.dcsrgemm", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_158dcsrgemm(__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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_158dcsrgemm(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2579, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2579, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":2597
 *     check_status(status)
 * 
 * cpdef void ccsrgemm(             # <<<<<<<<<<<<<<
 *         intptr_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_13cupy_backends_4cuda_4libs_8cusparse_161ccsrgemm(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_ccsrgemm(intptr_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;
  __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_backends/cuda/libs/cusparse.pyx":2604
 *         size_t csrColIndB, size_t descrC, size_t csrValC,
 *         size_t csrRowPtrC, size_t csrColIndC) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     status = cusparseCcsrgemm(
 *         <Handle>handle, <Operation>transA, <Operation>transB, m, n, k,
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2604, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":2605
 *         size_t csrRowPtrC, size_t csrColIndC) except *:
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":2613
 *         <const MatDescr>descrC, <cuComplex *>csrValC,
 *         <const int *>csrRowPtrC, <int *>csrColIndC)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef void zcsrgemm(
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2613, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":2597
 *     check_status(status)
 * 
 * cpdef void ccsrgemm(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int transA, int transB, int m, int n, int k,
 *         size_t descrA, const int nnzA, size_t csrValA,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.ccsrgemm", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_161ccsrgemm(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_160ccsrgemm, "ccsrgemm(intptr_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) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_161ccsrgemm(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[20] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ccsrgemm (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_transA,&__pyx_mstate_global->__pyx_n_u_transB,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_n,&__pyx_mstate_global->__pyx_n_u_k,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_nnzA,&__pyx_mstate_global->__pyx_n_u_csrValA,&__pyx_mstate_global->__pyx_n_u_csrRowPtrA,&__pyx_mstate_global->__pyx_n_u_csrColIndA,&__pyx_mstate_global->__pyx_n_u_descrB,&__pyx_mstate_global->__pyx_n_u_nnzB,&__pyx_mstate_global->__pyx_n_u_csrValB,&__pyx_mstate_global->__pyx_n_u_csrRowPtrB,&__pyx_mstate_global->__pyx_n_u_csrColIndB,&__pyx_mstate_global->__pyx_n_u_descrC,&__pyx_mstate_global->__pyx_n_u_csrValC,&__pyx_mstate_global->__pyx_n_u_csrRowPtrC,&__pyx_mstate_global->__pyx_n_u_csrColIndC,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 2597, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 20:
        values[19] = __Pyx_ArgRef_FASTCALL(__pyx_args, 19);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[19])) __PYX_ERR(0, 2597, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 19:
        values[18] = __Pyx_ArgRef_FASTCALL(__pyx_args, 18);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[18])) __PYX_ERR(0, 2597, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 18:
        values[17] = __Pyx_ArgRef_FASTCALL(__pyx_args, 17);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[17])) __PYX_ERR(0, 2597, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 17:
        values[16] = __Pyx_ArgRef_FASTCALL(__pyx_args, 16);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[16])) __PYX_ERR(0, 2597, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 16:
        values[15] = __Pyx_ArgRef_FASTCALL(__pyx_args, 15);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 2597, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 15:
        values[14] = __Pyx_ArgRef_FASTCALL(__pyx_args, 14);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 2597, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 14:
        values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 2597, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 13:
        values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 2597, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 12:
        values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 2597, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 11:
        values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 2597, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 2597, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 2597, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 2597, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 2597, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 2597, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 2597, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2597, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2597, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2597, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2597, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "ccsrgemm", 0) < (0)) __PYX_ERR(0, 2597, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 20; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("ccsrgemm", 1, 20, 20, i); __PYX_ERR(0, 2597, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 20)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2597, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2597, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2597, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2597, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 2597, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 2597, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 2597, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 2597, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 2597, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 2597, __pyx_L3_error)
      values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 2597, __pyx_L3_error)
      values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 2597, __pyx_L3_error)
      values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 2597, __pyx_L3_error)
      values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 2597, __pyx_L3_error)
      values[14] = __Pyx_ArgRef_FASTCALL(__pyx_args, 14);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 2597, __pyx_L3_error)
      values[15] = __Pyx_ArgRef_FASTCALL(__pyx_args, 15);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 2597, __pyx_L3_error)
      values[16] = __Pyx_ArgRef_FASTCALL(__pyx_args, 16);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[16])) __PYX_ERR(0, 2597, __pyx_L3_error)
      values[17] = __Pyx_ArgRef_FASTCALL(__pyx_args, 17);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[17])) __PYX_ERR(0, 2597, __pyx_L3_error)
      values[18] = __Pyx_ArgRef_FASTCALL(__pyx_args, 18);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[18])) __PYX_ERR(0, 2597, __pyx_L3_error)
      values[19] = __Pyx_ArgRef_FASTCALL(__pyx_args, 19);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[19])) __PYX_ERR(0, 2597, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2598, __pyx_L3_error)
    __pyx_v_transA = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_transA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2598, __pyx_L3_error)
    __pyx_v_transB = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_transB == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2598, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[3]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2598, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyLong_As_int(values[4]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2598, __pyx_L3_error)
    __pyx_v_k = __Pyx_PyLong_As_int(values[5]); if (unlikely((__pyx_v_k == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2598, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2599, __pyx_L3_error)
    __pyx_v_nnzA = __Pyx_PyLong_As_int(values[7]); if (unlikely((__pyx_v_nnzA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2599, __pyx_L3_error)
    __pyx_v_csrValA = __Pyx_PyLong_As_size_t(values[8]); if (unlikely((__pyx_v_csrValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2599, __pyx_L3_error)
    __pyx_v_csrRowPtrA = __Pyx_PyLong_As_size_t(values[9]); if (unlikely((__pyx_v_csrRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2600, __pyx_L3_error)
    __pyx_v_csrColIndA = __Pyx_PyLong_As_size_t(values[10]); if (unlikely((__pyx_v_csrColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2600, __pyx_L3_error)
    __pyx_v_descrB = __Pyx_PyLong_As_size_t(values[11]); if (unlikely((__pyx_v_descrB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2600, __pyx_L3_error)
    __pyx_v_nnzB = __Pyx_PyLong_As_int(values[12]); if (unlikely((__pyx_v_nnzB == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2601, __pyx_L3_error)
    __pyx_v_csrValB = __Pyx_PyLong_As_size_t(values[13]); if (unlikely((__pyx_v_csrValB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2601, __pyx_L3_error)
    __pyx_v_csrRowPtrB = __Pyx_PyLong_As_size_t(values[14]); if (unlikely((__pyx_v_csrRowPtrB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2601, __pyx_L3_error)
    __pyx_v_csrColIndB = __Pyx_PyLong_As_size_t(values[15]); if (unlikely((__pyx_v_csrColIndB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2602, __pyx_L3_error)
    __pyx_v_descrC = __Pyx_PyLong_As_size_t(values[16]); if (unlikely((__pyx_v_descrC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2602, __pyx_L3_error)
    __pyx_v_csrValC = __Pyx_PyLong_As_size_t(values[17]); if (unlikely((__pyx_v_csrValC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2602, __pyx_L3_error)
    __pyx_v_csrRowPtrC = __Pyx_PyLong_As_size_t(values[18]); if (unlikely((__pyx_v_csrRowPtrC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2603, __pyx_L3_error)
    __pyx_v_csrColIndC = __Pyx_PyLong_As_size_t(values[19]); if (unlikely((__pyx_v_csrColIndC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2603, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ccsrgemm", 1, 20, 20, __pyx_nargs); __PYX_ERR(0, 2597, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.ccsrgemm", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_160ccsrgemm(__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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_160ccsrgemm(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2597, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2597, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":2615
 *     check_status(status)
 * 
 * cpdef void zcsrgemm(             # <<<<<<<<<<<<<<
 *         intptr_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_13cupy_backends_4cuda_4libs_8cusparse_163zcsrgemm(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_zcsrgemm(intptr_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;
  __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_backends/cuda/libs/cusparse.pyx":2622
 *         size_t csrColIndB, size_t descrC, size_t csrValC,
 *         size_t csrRowPtrC, size_t csrColIndC) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     status = cusparseZcsrgemm(
 *         <Handle>handle, <Operation>transA, <Operation>transB, m, n, k,
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2622, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":2623
 *         size_t csrRowPtrC, size_t csrColIndC) except *:
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":2631
 *         <const MatDescr>descrC, <cuDoubleComplex *>csrValC,
 *         <const int *>csrRowPtrC, <int *>csrColIndC)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef size_t createCsrgemm2Info() except? -1:
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_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_backends/cuda/libs/cusparse.pyx":2615
 *     check_status(status)
 * 
 * cpdef void zcsrgemm(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int transA, int transB, int m, int n, int k,
 *         size_t descrA, const int nnzA, size_t csrValA,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.zcsrgemm", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_163zcsrgemm(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_162zcsrgemm, "zcsrgemm(intptr_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) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_163zcsrgemm(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[20] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("zcsrgemm (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_transA,&__pyx_mstate_global->__pyx_n_u_transB,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_n,&__pyx_mstate_global->__pyx_n_u_k,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_nnzA,&__pyx_mstate_global->__pyx_n_u_csrValA,&__pyx_mstate_global->__pyx_n_u_csrRowPtrA,&__pyx_mstate_global->__pyx_n_u_csrColIndA,&__pyx_mstate_global->__pyx_n_u_descrB,&__pyx_mstate_global->__pyx_n_u_nnzB,&__pyx_mstate_global->__pyx_n_u_csrValB,&__pyx_mstate_global->__pyx_n_u_csrRowPtrB,&__pyx_mstate_global->__pyx_n_u_csrColIndB,&__pyx_mstate_global->__pyx_n_u_descrC,&__pyx_mstate_global->__pyx_n_u_csrValC,&__pyx_mstate_global->__pyx_n_u_csrRowPtrC,&__pyx_mstate_global->__pyx_n_u_csrColIndC,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 2615, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 20:
        values[19] = __Pyx_ArgRef_FASTCALL(__pyx_args, 19);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[19])) __PYX_ERR(0, 2615, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 19:
        values[18] = __Pyx_ArgRef_FASTCALL(__pyx_args, 18);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[18])) __PYX_ERR(0, 2615, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 18:
        values[17] = __Pyx_ArgRef_FASTCALL(__pyx_args, 17);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[17])) __PYX_ERR(0, 2615, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 17:
        values[16] = __Pyx_ArgRef_FASTCALL(__pyx_args, 16);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[16])) __PYX_ERR(0, 2615, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 16:
        values[15] = __Pyx_ArgRef_FASTCALL(__pyx_args, 15);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 2615, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 15:
        values[14] = __Pyx_ArgRef_FASTCALL(__pyx_args, 14);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 2615, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 14:
        values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 2615, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 13:
        values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 2615, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 12:
        values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 2615, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 11:
        values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 2615, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 2615, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 2615, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 2615, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 2615, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 2615, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 2615, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2615, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2615, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2615, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2615, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "zcsrgemm", 0) < (0)) __PYX_ERR(0, 2615, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 20; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("zcsrgemm", 1, 20, 20, i); __PYX_ERR(0, 2615, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 20)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2615, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2615, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2615, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2615, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 2615, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 2615, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 2615, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 2615, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 2615, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 2615, __pyx_L3_error)
      values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 2615, __pyx_L3_error)
      values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 2615, __pyx_L3_error)
      values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 2615, __pyx_L3_error)
      values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 2615, __pyx_L3_error)
      values[14] = __Pyx_ArgRef_FASTCALL(__pyx_args, 14);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 2615, __pyx_L3_error)
      values[15] = __Pyx_ArgRef_FASTCALL(__pyx_args, 15);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 2615, __pyx_L3_error)
      values[16] = __Pyx_ArgRef_FASTCALL(__pyx_args, 16);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[16])) __PYX_ERR(0, 2615, __pyx_L3_error)
      values[17] = __Pyx_ArgRef_FASTCALL(__pyx_args, 17);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[17])) __PYX_ERR(0, 2615, __pyx_L3_error)
      values[18] = __Pyx_ArgRef_FASTCALL(__pyx_args, 18);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[18])) __PYX_ERR(0, 2615, __pyx_L3_error)
      values[19] = __Pyx_ArgRef_FASTCALL(__pyx_args, 19);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[19])) __PYX_ERR(0, 2615, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2616, __pyx_L3_error)
    __pyx_v_transA = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_transA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2616, __pyx_L3_error)
    __pyx_v_transB = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_transB == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2616, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[3]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2616, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyLong_As_int(values[4]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2616, __pyx_L3_error)
    __pyx_v_k = __Pyx_PyLong_As_int(values[5]); if (unlikely((__pyx_v_k == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2616, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2617, __pyx_L3_error)
    __pyx_v_nnzA = __Pyx_PyLong_As_int(values[7]); if (unlikely((__pyx_v_nnzA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2617, __pyx_L3_error)
    __pyx_v_csrValA = __Pyx_PyLong_As_size_t(values[8]); if (unlikely((__pyx_v_csrValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2617, __pyx_L3_error)
    __pyx_v_csrRowPtrA = __Pyx_PyLong_As_size_t(values[9]); if (unlikely((__pyx_v_csrRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2618, __pyx_L3_error)
    __pyx_v_csrColIndA = __Pyx_PyLong_As_size_t(values[10]); if (unlikely((__pyx_v_csrColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2618, __pyx_L3_error)
    __pyx_v_descrB = __Pyx_PyLong_As_size_t(values[11]); if (unlikely((__pyx_v_descrB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2618, __pyx_L3_error)
    __pyx_v_nnzB = __Pyx_PyLong_As_int(values[12]); if (unlikely((__pyx_v_nnzB == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2619, __pyx_L3_error)
    __pyx_v_csrValB = __Pyx_PyLong_As_size_t(values[13]); if (unlikely((__pyx_v_csrValB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2619, __pyx_L3_error)
    __pyx_v_csrRowPtrB = __Pyx_PyLong_As_size_t(values[14]); if (unlikely((__pyx_v_csrRowPtrB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2619, __pyx_L3_error)
    __pyx_v_csrColIndB = __Pyx_PyLong_As_size_t(values[15]); if (unlikely((__pyx_v_csrColIndB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2620, __pyx_L3_error)
    __pyx_v_descrC = __Pyx_PyLong_As_size_t(values[16]); if (unlikely((__pyx_v_descrC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2620, __pyx_L3_error)
    __pyx_v_csrValC = __Pyx_PyLong_As_size_t(values[17]); if (unlikely((__pyx_v_csrValC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2620, __pyx_L3_error)
    __pyx_v_csrRowPtrC = __Pyx_PyLong_As_size_t(values[18]); if (unlikely((__pyx_v_csrRowPtrC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2621, __pyx_L3_error)
    __pyx_v_csrColIndC = __Pyx_PyLong_As_size_t(values[19]); if (unlikely((__pyx_v_csrColIndC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2621, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("zcsrgemm", 1, 20, 20, __pyx_nargs); __PYX_ERR(0, 2615, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.zcsrgemm", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_162zcsrgemm(__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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_162zcsrgemm(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2615, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); 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_backends.cuda.libs.cusparse.zcsrgemm", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy_backends/cuda/libs/cusparse.pyx":2633
 *     check_status(status)
 * 
 * cpdef size_t createCsrgemm2Info() except? -1:             # <<<<<<<<<<<<<<
 *     cdef csrgemm2Info_t info
 *     with nogil:
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_165createCsrgemm2Info(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static size_t __pyx_f_13cupy_backends_4cuda_4libs_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_backends/cuda/libs/cusparse.pyx":2635
 * cpdef size_t createCsrgemm2Info() except? -1:
 *     cdef csrgemm2Info_t info
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseCreateCsrgemm2Info(&info)
 *     check_status(status)
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "cupy_backends/cuda/libs/cusparse.pyx":2636
 *     cdef csrgemm2Info_t info
 *     with nogil:
 *         status = cusparseCreateCsrgemm2Info(&info)             # <<<<<<<<<<<<<<
 *     check_status(status)
 *     return <size_t>info
*/
        __pyx_v_status = cusparseCreateCsrgemm2Info((&__pyx_v_info));
      }

      /* "cupy_backends/cuda/libs/cusparse.pyx":2635
 * cpdef size_t createCsrgemm2Info() except? -1:
 *     cdef csrgemm2Info_t info
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseCreateCsrgemm2Info(&info)
 *     check_status(status)
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy_backends/cuda/libs/cusparse.pyx":2637
 *     with nogil:
 *         status = cusparseCreateCsrgemm2Info(&info)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return <size_t>info
 * 
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_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_backends/cuda/libs/cusparse.pyx":2638
 *         status = cusparseCreateCsrgemm2Info(&info)
 *     check_status(status)
 *     return <size_t>info             # <<<<<<<<<<<<<<
 * 
 * cpdef void destroyCsrgemm2Info(size_t info) except *:
*/
  __pyx_r = ((size_t)__pyx_v_info);
  goto __pyx_L0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":2633
 *     check_status(status)
 * 
 * cpdef size_t createCsrgemm2Info() except? -1:             # <<<<<<<<<<<<<<
 *     cdef csrgemm2Info_t info
 *     with nogil:
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.createCsrgemm2Info", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1L;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_165createCsrgemm2Info(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_164createCsrgemm2Info, "createCsrgemm2Info() -> size_t");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_165createCsrgemm2Info(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("createCsrgemm2Info (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_164createCsrgemm2Info(__pyx_self);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_164createCsrgemm2Info(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("createCsrgemm2Info", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_createCsrgemm2Info(1); if (unlikely(__pyx_t_1 == ((size_t)-1L) && PyErr_Occurred())) __PYX_ERR(0, 2633, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyLong_FromSize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2633, __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_backends.cuda.libs.cusparse.createCsrgemm2Info", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy_backends/cuda/libs/cusparse.pyx":2640
 *     return <size_t>info
 * 
 * cpdef void destroyCsrgemm2Info(size_t info) except *:             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseDestroyCsrgemm2Info(<csrgemm2Info_t>info)
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_167destroyCsrgemm2Info(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_destroyCsrgemm2Info(size_t __pyx_v_info, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  __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_backends/cuda/libs/cusparse.pyx":2641
 * 
 * cpdef void destroyCsrgemm2Info(size_t info) except *:
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseDestroyCsrgemm2Info(<csrgemm2Info_t>info)
 *     check_status(status)
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "cupy_backends/cuda/libs/cusparse.pyx":2642
 * cpdef void destroyCsrgemm2Info(size_t info) except *:
 *     with nogil:
 *         status = cusparseDestroyCsrgemm2Info(<csrgemm2Info_t>info)             # <<<<<<<<<<<<<<
 *     check_status(status)
 * 
*/
        __pyx_v_status = cusparseDestroyCsrgemm2Info(((csrgemm2Info_t)__pyx_v_info));
      }

      /* "cupy_backends/cuda/libs/cusparse.pyx":2641
 * 
 * cpdef void destroyCsrgemm2Info(size_t info) except *:
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseDestroyCsrgemm2Info(<csrgemm2Info_t>info)
 *     check_status(status)
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy_backends/cuda/libs/cusparse.pyx":2643
 *     with nogil:
 *         status = cusparseDestroyCsrgemm2Info(<csrgemm2Info_t>info)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef size_t scsrgemm2_bufferSizeExt(
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_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_backends/cuda/libs/cusparse.pyx":2640
 *     return <size_t>info
 * 
 * cpdef void destroyCsrgemm2Info(size_t info) except *:             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseDestroyCsrgemm2Info(<csrgemm2Info_t>info)
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.destroyCsrgemm2Info", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_167destroyCsrgemm2Info(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_166destroyCsrgemm2Info, "destroyCsrgemm2Info(size_t info) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_167destroyCsrgemm2Info(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  size_t __pyx_v_info;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("destroyCsrgemm2Info (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_info,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 2640, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2640, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "destroyCsrgemm2Info", 0) < (0)) __PYX_ERR(0, 2640, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("destroyCsrgemm2Info", 1, 1, 1, i); __PYX_ERR(0, 2640, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2640, __pyx_L3_error)
    }
    __pyx_v_info = __Pyx_PyLong_As_size_t(values[0]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2640, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("destroyCsrgemm2Info", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2640, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.destroyCsrgemm2Info", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_166destroyCsrgemm2Info(__pyx_self, __pyx_v_info);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_166destroyCsrgemm2Info(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_f_13cupy_backends_4cuda_4libs_8cusparse_destroyCsrgemm2Info(__pyx_v_info, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2640, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2640, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":2645
 *     check_status(status)
 * 
 * cpdef size_t scsrgemm2_bufferSizeExt(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int n, int k,
 *         size_t alpha,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_169scsrgemm2_bufferSizeExt(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static size_t __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_scsrgemm2_bufferSizeExt(intptr_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_backends/cuda/libs/cusparse.pyx":2654
 *         size_t info) except? -1:
 *     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_backends/cuda/libs/cusparse.pyx":2662
 *         <MatDescr>descrD, nnzD, <int*>csrRowPtrD, <int*>csrColIndD,
 *         <csrgemm2Info_t>info, &bufferSize)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return bufferSize
 * 
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2662, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":2663
 *         <csrgemm2Info_t>info, &bufferSize)
 *     check_status(status)
 *     return bufferSize             # <<<<<<<<<<<<<<
 * 
 * cpdef size_t dcsrgemm2_bufferSizeExt(
*/
  __pyx_r = __pyx_v_bufferSize;
  goto __pyx_L0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":2645
 *     check_status(status)
 * 
 * cpdef size_t scsrgemm2_bufferSizeExt(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int n, int k,
 *         size_t alpha,
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.scsrgemm2_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1L;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_169scsrgemm2_bufferSizeExt(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_168scsrgemm2_bufferSizeExt, "scsrgemm2_bufferSizeExt(intptr_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_13cupy_backends_4cuda_4libs_8cusparse_169scsrgemm2_bufferSizeExt(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[19] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
  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);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_n,&__pyx_mstate_global->__pyx_n_u_k,&__pyx_mstate_global->__pyx_n_u_alpha,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_nnzA,&__pyx_mstate_global->__pyx_n_u_csrRowPtrA,&__pyx_mstate_global->__pyx_n_u_csrColIndA,&__pyx_mstate_global->__pyx_n_u_descrB,&__pyx_mstate_global->__pyx_n_u_nnzB,&__pyx_mstate_global->__pyx_n_u_csrRowPtrB,&__pyx_mstate_global->__pyx_n_u_csrColIndB,&__pyx_mstate_global->__pyx_n_u_beta,&__pyx_mstate_global->__pyx_n_u_descrD,&__pyx_mstate_global->__pyx_n_u_nnzD,&__pyx_mstate_global->__pyx_n_u_csrRowPtrD,&__pyx_mstate_global->__pyx_n_u_csrColIndD,&__pyx_mstate_global->__pyx_n_u_info,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 2645, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 19:
        values[18] = __Pyx_ArgRef_FASTCALL(__pyx_args, 18);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[18])) __PYX_ERR(0, 2645, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 18:
        values[17] = __Pyx_ArgRef_FASTCALL(__pyx_args, 17);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[17])) __PYX_ERR(0, 2645, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 17:
        values[16] = __Pyx_ArgRef_FASTCALL(__pyx_args, 16);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[16])) __PYX_ERR(0, 2645, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 16:
        values[15] = __Pyx_ArgRef_FASTCALL(__pyx_args, 15);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 2645, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 15:
        values[14] = __Pyx_ArgRef_FASTCALL(__pyx_args, 14);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 2645, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 14:
        values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 2645, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 13:
        values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 2645, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 12:
        values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 2645, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 11:
        values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 2645, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 2645, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 2645, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 2645, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 2645, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 2645, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 2645, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2645, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2645, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2645, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2645, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "scsrgemm2_bufferSizeExt", 0) < (0)) __PYX_ERR(0, 2645, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 19; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("scsrgemm2_bufferSizeExt", 1, 19, 19, i); __PYX_ERR(0, 2645, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 19)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2645, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2645, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2645, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2645, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 2645, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 2645, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 2645, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 2645, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 2645, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 2645, __pyx_L3_error)
      values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 2645, __pyx_L3_error)
      values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 2645, __pyx_L3_error)
      values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 2645, __pyx_L3_error)
      values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 2645, __pyx_L3_error)
      values[14] = __Pyx_ArgRef_FASTCALL(__pyx_args, 14);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 2645, __pyx_L3_error)
      values[15] = __Pyx_ArgRef_FASTCALL(__pyx_args, 15);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 2645, __pyx_L3_error)
      values[16] = __Pyx_ArgRef_FASTCALL(__pyx_args, 16);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[16])) __PYX_ERR(0, 2645, __pyx_L3_error)
      values[17] = __Pyx_ArgRef_FASTCALL(__pyx_args, 17);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[17])) __PYX_ERR(0, 2645, __pyx_L3_error)
      values[18] = __Pyx_ArgRef_FASTCALL(__pyx_args, 18);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[18])) __PYX_ERR(0, 2645, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2646, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2646, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2646, __pyx_L3_error)
    __pyx_v_k = __Pyx_PyLong_As_int(values[3]); if (unlikely((__pyx_v_k == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2646, __pyx_L3_error)
    __pyx_v_alpha = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_alpha == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2647, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2648, __pyx_L3_error)
    __pyx_v_nnzA = __Pyx_PyLong_As_int(values[6]); if (unlikely((__pyx_v_nnzA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2648, __pyx_L3_error)
    __pyx_v_csrRowPtrA = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_csrRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2648, __pyx_L3_error)
    __pyx_v_csrColIndA = __Pyx_PyLong_As_size_t(values[8]); if (unlikely((__pyx_v_csrColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2648, __pyx_L3_error)
    __pyx_v_descrB = __Pyx_PyLong_As_size_t(values[9]); if (unlikely((__pyx_v_descrB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2649, __pyx_L3_error)
    __pyx_v_nnzB = __Pyx_PyLong_As_int(values[10]); if (unlikely((__pyx_v_nnzB == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2649, __pyx_L3_error)
    __pyx_v_csrRowPtrB = __Pyx_PyLong_As_size_t(values[11]); if (unlikely((__pyx_v_csrRowPtrB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2649, __pyx_L3_error)
    __pyx_v_csrColIndB = __Pyx_PyLong_As_size_t(values[12]); if (unlikely((__pyx_v_csrColIndB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2649, __pyx_L3_error)
    __pyx_v_beta = __Pyx_PyLong_As_size_t(values[13]); if (unlikely((__pyx_v_beta == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2650, __pyx_L3_error)
    __pyx_v_descrD = __Pyx_PyLong_As_size_t(values[14]); if (unlikely((__pyx_v_descrD == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2651, __pyx_L3_error)
    __pyx_v_nnzD = __Pyx_PyLong_As_int(values[15]); if (unlikely((__pyx_v_nnzD == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2651, __pyx_L3_error)
    __pyx_v_csrRowPtrD = __Pyx_PyLong_As_size_t(values[16]); if (unlikely((__pyx_v_csrRowPtrD == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2651, __pyx_L3_error)
    __pyx_v_csrColIndD = __Pyx_PyLong_As_size_t(values[17]); if (unlikely((__pyx_v_csrColIndD == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2651, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyLong_As_size_t(values[18]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2652, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("scsrgemm2_bufferSizeExt", 1, 19, 19, __pyx_nargs); __PYX_ERR(0, 2645, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.scsrgemm2_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_168scsrgemm2_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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_168scsrgemm2_bufferSizeExt(CYTHON_UNUSED PyObject *__pyx_self, intptr_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
  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("scsrgemm2_bufferSizeExt", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(__pyx_t_1 == ((size_t)-1L) && PyErr_Occurred())) __PYX_ERR(0, 2645, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyLong_FromSize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2645, __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_backends.cuda.libs.cusparse.scsrgemm2_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy_backends/cuda/libs/cusparse.pyx":2665
 *     return bufferSize
 * 
 * cpdef size_t dcsrgemm2_bufferSizeExt(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int n, int k,
 *         size_t alpha,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_171dcsrgemm2_bufferSizeExt(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static size_t __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_dcsrgemm2_bufferSizeExt(intptr_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_backends/cuda/libs/cusparse.pyx":2674
 *         size_t info) except? -1:
 *     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_backends/cuda/libs/cusparse.pyx":2682
 *         <MatDescr>descrD, nnzD, <int*>csrRowPtrD, <int*>csrColIndD,
 *         <csrgemm2Info_t>info, &bufferSize)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return bufferSize
 * 
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_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_backends/cuda/libs/cusparse.pyx":2683
 *         <csrgemm2Info_t>info, &bufferSize)
 *     check_status(status)
 *     return bufferSize             # <<<<<<<<<<<<<<
 * 
 * cpdef size_t ccsrgemm2_bufferSizeExt(
*/
  __pyx_r = __pyx_v_bufferSize;
  goto __pyx_L0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":2665
 *     return bufferSize
 * 
 * cpdef size_t dcsrgemm2_bufferSizeExt(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int n, int k,
 *         size_t alpha,
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.dcsrgemm2_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1L;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_171dcsrgemm2_bufferSizeExt(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_170dcsrgemm2_bufferSizeExt, "dcsrgemm2_bufferSizeExt(intptr_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_13cupy_backends_4cuda_4libs_8cusparse_171dcsrgemm2_bufferSizeExt(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[19] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
  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);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_n,&__pyx_mstate_global->__pyx_n_u_k,&__pyx_mstate_global->__pyx_n_u_alpha,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_nnzA,&__pyx_mstate_global->__pyx_n_u_csrRowPtrA,&__pyx_mstate_global->__pyx_n_u_csrColIndA,&__pyx_mstate_global->__pyx_n_u_descrB,&__pyx_mstate_global->__pyx_n_u_nnzB,&__pyx_mstate_global->__pyx_n_u_csrRowPtrB,&__pyx_mstate_global->__pyx_n_u_csrColIndB,&__pyx_mstate_global->__pyx_n_u_beta,&__pyx_mstate_global->__pyx_n_u_descrD,&__pyx_mstate_global->__pyx_n_u_nnzD,&__pyx_mstate_global->__pyx_n_u_csrRowPtrD,&__pyx_mstate_global->__pyx_n_u_csrColIndD,&__pyx_mstate_global->__pyx_n_u_info,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 2665, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 19:
        values[18] = __Pyx_ArgRef_FASTCALL(__pyx_args, 18);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[18])) __PYX_ERR(0, 2665, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 18:
        values[17] = __Pyx_ArgRef_FASTCALL(__pyx_args, 17);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[17])) __PYX_ERR(0, 2665, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 17:
        values[16] = __Pyx_ArgRef_FASTCALL(__pyx_args, 16);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[16])) __PYX_ERR(0, 2665, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 16:
        values[15] = __Pyx_ArgRef_FASTCALL(__pyx_args, 15);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 2665, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 15:
        values[14] = __Pyx_ArgRef_FASTCALL(__pyx_args, 14);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 2665, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 14:
        values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 2665, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 13:
        values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 2665, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 12:
        values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 2665, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 11:
        values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 2665, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 2665, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 2665, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 2665, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 2665, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 2665, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 2665, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2665, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2665, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2665, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2665, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "dcsrgemm2_bufferSizeExt", 0) < (0)) __PYX_ERR(0, 2665, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 19; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("dcsrgemm2_bufferSizeExt", 1, 19, 19, i); __PYX_ERR(0, 2665, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 19)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2665, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2665, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2665, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2665, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 2665, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 2665, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 2665, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 2665, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 2665, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 2665, __pyx_L3_error)
      values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 2665, __pyx_L3_error)
      values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 2665, __pyx_L3_error)
      values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 2665, __pyx_L3_error)
      values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 2665, __pyx_L3_error)
      values[14] = __Pyx_ArgRef_FASTCALL(__pyx_args, 14);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 2665, __pyx_L3_error)
      values[15] = __Pyx_ArgRef_FASTCALL(__pyx_args, 15);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 2665, __pyx_L3_error)
      values[16] = __Pyx_ArgRef_FASTCALL(__pyx_args, 16);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[16])) __PYX_ERR(0, 2665, __pyx_L3_error)
      values[17] = __Pyx_ArgRef_FASTCALL(__pyx_args, 17);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[17])) __PYX_ERR(0, 2665, __pyx_L3_error)
      values[18] = __Pyx_ArgRef_FASTCALL(__pyx_args, 18);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[18])) __PYX_ERR(0, 2665, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2666, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2666, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2666, __pyx_L3_error)
    __pyx_v_k = __Pyx_PyLong_As_int(values[3]); if (unlikely((__pyx_v_k == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2666, __pyx_L3_error)
    __pyx_v_alpha = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_alpha == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2667, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2668, __pyx_L3_error)
    __pyx_v_nnzA = __Pyx_PyLong_As_int(values[6]); if (unlikely((__pyx_v_nnzA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2668, __pyx_L3_error)
    __pyx_v_csrRowPtrA = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_csrRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2668, __pyx_L3_error)
    __pyx_v_csrColIndA = __Pyx_PyLong_As_size_t(values[8]); if (unlikely((__pyx_v_csrColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2668, __pyx_L3_error)
    __pyx_v_descrB = __Pyx_PyLong_As_size_t(values[9]); if (unlikely((__pyx_v_descrB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2669, __pyx_L3_error)
    __pyx_v_nnzB = __Pyx_PyLong_As_int(values[10]); if (unlikely((__pyx_v_nnzB == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2669, __pyx_L3_error)
    __pyx_v_csrRowPtrB = __Pyx_PyLong_As_size_t(values[11]); if (unlikely((__pyx_v_csrRowPtrB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2669, __pyx_L3_error)
    __pyx_v_csrColIndB = __Pyx_PyLong_As_size_t(values[12]); if (unlikely((__pyx_v_csrColIndB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2669, __pyx_L3_error)
    __pyx_v_beta = __Pyx_PyLong_As_size_t(values[13]); if (unlikely((__pyx_v_beta == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2670, __pyx_L3_error)
    __pyx_v_descrD = __Pyx_PyLong_As_size_t(values[14]); if (unlikely((__pyx_v_descrD == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2671, __pyx_L3_error)
    __pyx_v_nnzD = __Pyx_PyLong_As_int(values[15]); if (unlikely((__pyx_v_nnzD == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2671, __pyx_L3_error)
    __pyx_v_csrRowPtrD = __Pyx_PyLong_As_size_t(values[16]); if (unlikely((__pyx_v_csrRowPtrD == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2671, __pyx_L3_error)
    __pyx_v_csrColIndD = __Pyx_PyLong_As_size_t(values[17]); if (unlikely((__pyx_v_csrColIndD == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2671, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyLong_As_size_t(values[18]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2672, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("dcsrgemm2_bufferSizeExt", 1, 19, 19, __pyx_nargs); __PYX_ERR(0, 2665, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.dcsrgemm2_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_170dcsrgemm2_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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_170dcsrgemm2_bufferSizeExt(CYTHON_UNUSED PyObject *__pyx_self, intptr_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
  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("dcsrgemm2_bufferSizeExt", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(__pyx_t_1 == ((size_t)-1L) && PyErr_Occurred())) __PYX_ERR(0, 2665, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyLong_FromSize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2665, __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_backends.cuda.libs.cusparse.dcsrgemm2_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy_backends/cuda/libs/cusparse.pyx":2685
 *     return bufferSize
 * 
 * cpdef size_t ccsrgemm2_bufferSizeExt(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int n, int k,
 *         size_t alpha,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_173ccsrgemm2_bufferSizeExt(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static size_t __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_ccsrgemm2_bufferSizeExt(intptr_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_backends/cuda/libs/cusparse.pyx":2694
 *         size_t info) except? -1:
 *     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_backends/cuda/libs/cusparse.pyx":2702
 *         <MatDescr>descrD, nnzD, <int*>csrRowPtrD, <int*>csrColIndD,
 *         <csrgemm2Info_t>info, &bufferSize)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return bufferSize
 * 
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2702, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":2703
 *         <csrgemm2Info_t>info, &bufferSize)
 *     check_status(status)
 *     return bufferSize             # <<<<<<<<<<<<<<
 * 
 * cpdef size_t zcsrgemm2_bufferSizeExt(
*/
  __pyx_r = __pyx_v_bufferSize;
  goto __pyx_L0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":2685
 *     return bufferSize
 * 
 * cpdef size_t ccsrgemm2_bufferSizeExt(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int n, int k,
 *         size_t alpha,
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.ccsrgemm2_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1L;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_173ccsrgemm2_bufferSizeExt(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_172ccsrgemm2_bufferSizeExt, "ccsrgemm2_bufferSizeExt(intptr_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_13cupy_backends_4cuda_4libs_8cusparse_173ccsrgemm2_bufferSizeExt(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[19] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
  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);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_n,&__pyx_mstate_global->__pyx_n_u_k,&__pyx_mstate_global->__pyx_n_u_alpha,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_nnzA,&__pyx_mstate_global->__pyx_n_u_csrRowPtrA,&__pyx_mstate_global->__pyx_n_u_csrColIndA,&__pyx_mstate_global->__pyx_n_u_descrB,&__pyx_mstate_global->__pyx_n_u_nnzB,&__pyx_mstate_global->__pyx_n_u_csrRowPtrB,&__pyx_mstate_global->__pyx_n_u_csrColIndB,&__pyx_mstate_global->__pyx_n_u_beta,&__pyx_mstate_global->__pyx_n_u_descrD,&__pyx_mstate_global->__pyx_n_u_nnzD,&__pyx_mstate_global->__pyx_n_u_csrRowPtrD,&__pyx_mstate_global->__pyx_n_u_csrColIndD,&__pyx_mstate_global->__pyx_n_u_info,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 2685, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 19:
        values[18] = __Pyx_ArgRef_FASTCALL(__pyx_args, 18);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[18])) __PYX_ERR(0, 2685, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 18:
        values[17] = __Pyx_ArgRef_FASTCALL(__pyx_args, 17);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[17])) __PYX_ERR(0, 2685, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 17:
        values[16] = __Pyx_ArgRef_FASTCALL(__pyx_args, 16);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[16])) __PYX_ERR(0, 2685, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 16:
        values[15] = __Pyx_ArgRef_FASTCALL(__pyx_args, 15);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 2685, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 15:
        values[14] = __Pyx_ArgRef_FASTCALL(__pyx_args, 14);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 2685, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 14:
        values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 2685, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 13:
        values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 2685, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 12:
        values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 2685, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 11:
        values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 2685, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 2685, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 2685, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 2685, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 2685, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 2685, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 2685, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2685, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2685, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2685, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2685, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "ccsrgemm2_bufferSizeExt", 0) < (0)) __PYX_ERR(0, 2685, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 19; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("ccsrgemm2_bufferSizeExt", 1, 19, 19, i); __PYX_ERR(0, 2685, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 19)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2685, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2685, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2685, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2685, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 2685, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 2685, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 2685, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 2685, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 2685, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 2685, __pyx_L3_error)
      values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 2685, __pyx_L3_error)
      values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 2685, __pyx_L3_error)
      values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 2685, __pyx_L3_error)
      values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 2685, __pyx_L3_error)
      values[14] = __Pyx_ArgRef_FASTCALL(__pyx_args, 14);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 2685, __pyx_L3_error)
      values[15] = __Pyx_ArgRef_FASTCALL(__pyx_args, 15);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 2685, __pyx_L3_error)
      values[16] = __Pyx_ArgRef_FASTCALL(__pyx_args, 16);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[16])) __PYX_ERR(0, 2685, __pyx_L3_error)
      values[17] = __Pyx_ArgRef_FASTCALL(__pyx_args, 17);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[17])) __PYX_ERR(0, 2685, __pyx_L3_error)
      values[18] = __Pyx_ArgRef_FASTCALL(__pyx_args, 18);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[18])) __PYX_ERR(0, 2685, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2686, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2686, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2686, __pyx_L3_error)
    __pyx_v_k = __Pyx_PyLong_As_int(values[3]); if (unlikely((__pyx_v_k == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2686, __pyx_L3_error)
    __pyx_v_alpha = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_alpha == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2687, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2688, __pyx_L3_error)
    __pyx_v_nnzA = __Pyx_PyLong_As_int(values[6]); if (unlikely((__pyx_v_nnzA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2688, __pyx_L3_error)
    __pyx_v_csrRowPtrA = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_csrRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2688, __pyx_L3_error)
    __pyx_v_csrColIndA = __Pyx_PyLong_As_size_t(values[8]); if (unlikely((__pyx_v_csrColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2688, __pyx_L3_error)
    __pyx_v_descrB = __Pyx_PyLong_As_size_t(values[9]); if (unlikely((__pyx_v_descrB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2689, __pyx_L3_error)
    __pyx_v_nnzB = __Pyx_PyLong_As_int(values[10]); if (unlikely((__pyx_v_nnzB == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2689, __pyx_L3_error)
    __pyx_v_csrRowPtrB = __Pyx_PyLong_As_size_t(values[11]); if (unlikely((__pyx_v_csrRowPtrB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2689, __pyx_L3_error)
    __pyx_v_csrColIndB = __Pyx_PyLong_As_size_t(values[12]); if (unlikely((__pyx_v_csrColIndB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2689, __pyx_L3_error)
    __pyx_v_beta = __Pyx_PyLong_As_size_t(values[13]); if (unlikely((__pyx_v_beta == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2690, __pyx_L3_error)
    __pyx_v_descrD = __Pyx_PyLong_As_size_t(values[14]); if (unlikely((__pyx_v_descrD == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2691, __pyx_L3_error)
    __pyx_v_nnzD = __Pyx_PyLong_As_int(values[15]); if (unlikely((__pyx_v_nnzD == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2691, __pyx_L3_error)
    __pyx_v_csrRowPtrD = __Pyx_PyLong_As_size_t(values[16]); if (unlikely((__pyx_v_csrRowPtrD == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2691, __pyx_L3_error)
    __pyx_v_csrColIndD = __Pyx_PyLong_As_size_t(values[17]); if (unlikely((__pyx_v_csrColIndD == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2691, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyLong_As_size_t(values[18]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2692, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ccsrgemm2_bufferSizeExt", 1, 19, 19, __pyx_nargs); __PYX_ERR(0, 2685, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.ccsrgemm2_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_172ccsrgemm2_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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_172ccsrgemm2_bufferSizeExt(CYTHON_UNUSED PyObject *__pyx_self, intptr_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
  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("ccsrgemm2_bufferSizeExt", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(__pyx_t_1 == ((size_t)-1L) && PyErr_Occurred())) __PYX_ERR(0, 2685, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyLong_FromSize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2685, __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_backends.cuda.libs.cusparse.ccsrgemm2_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy_backends/cuda/libs/cusparse.pyx":2705
 *     return bufferSize
 * 
 * cpdef size_t zcsrgemm2_bufferSizeExt(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int n, int k,
 *         size_t alpha,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_175zcsrgemm2_bufferSizeExt(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static size_t __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_zcsrgemm2_bufferSizeExt(intptr_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_backends/cuda/libs/cusparse.pyx":2714
 *         size_t info) except? -1:
 *     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_backends/cuda/libs/cusparse.pyx":2722
 *         <MatDescr>descrD, nnzD, <int*>csrRowPtrD, <int*>csrColIndD,
 *         <csrgemm2Info_t>info, &bufferSize)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return bufferSize
 * 
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 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_backends/cuda/libs/cusparse.pyx":2723
 *         <csrgemm2Info_t>info, &bufferSize)
 *     check_status(status)
 *     return bufferSize             # <<<<<<<<<<<<<<
 * 
 * cpdef void xcsrgemm2Nnz(
*/
  __pyx_r = __pyx_v_bufferSize;
  goto __pyx_L0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":2705
 *     return bufferSize
 * 
 * cpdef size_t zcsrgemm2_bufferSizeExt(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int n, int k,
 *         size_t alpha,
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.zcsrgemm2_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1L;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_175zcsrgemm2_bufferSizeExt(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_174zcsrgemm2_bufferSizeExt, "zcsrgemm2_bufferSizeExt(intptr_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_13cupy_backends_4cuda_4libs_8cusparse_175zcsrgemm2_bufferSizeExt(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[19] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
  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);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_n,&__pyx_mstate_global->__pyx_n_u_k,&__pyx_mstate_global->__pyx_n_u_alpha,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_nnzA,&__pyx_mstate_global->__pyx_n_u_csrRowPtrA,&__pyx_mstate_global->__pyx_n_u_csrColIndA,&__pyx_mstate_global->__pyx_n_u_descrB,&__pyx_mstate_global->__pyx_n_u_nnzB,&__pyx_mstate_global->__pyx_n_u_csrRowPtrB,&__pyx_mstate_global->__pyx_n_u_csrColIndB,&__pyx_mstate_global->__pyx_n_u_beta,&__pyx_mstate_global->__pyx_n_u_descrD,&__pyx_mstate_global->__pyx_n_u_nnzD,&__pyx_mstate_global->__pyx_n_u_csrRowPtrD,&__pyx_mstate_global->__pyx_n_u_csrColIndD,&__pyx_mstate_global->__pyx_n_u_info,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 2705, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 19:
        values[18] = __Pyx_ArgRef_FASTCALL(__pyx_args, 18);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[18])) __PYX_ERR(0, 2705, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 18:
        values[17] = __Pyx_ArgRef_FASTCALL(__pyx_args, 17);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[17])) __PYX_ERR(0, 2705, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 17:
        values[16] = __Pyx_ArgRef_FASTCALL(__pyx_args, 16);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[16])) __PYX_ERR(0, 2705, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 16:
        values[15] = __Pyx_ArgRef_FASTCALL(__pyx_args, 15);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 2705, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 15:
        values[14] = __Pyx_ArgRef_FASTCALL(__pyx_args, 14);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 2705, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 14:
        values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 2705, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 13:
        values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 2705, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 12:
        values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 2705, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 11:
        values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 2705, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 2705, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 2705, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 2705, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 2705, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 2705, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 2705, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2705, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2705, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2705, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2705, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "zcsrgemm2_bufferSizeExt", 0) < (0)) __PYX_ERR(0, 2705, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 19; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("zcsrgemm2_bufferSizeExt", 1, 19, 19, i); __PYX_ERR(0, 2705, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 19)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2705, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2705, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2705, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2705, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 2705, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 2705, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 2705, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 2705, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 2705, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 2705, __pyx_L3_error)
      values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 2705, __pyx_L3_error)
      values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 2705, __pyx_L3_error)
      values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 2705, __pyx_L3_error)
      values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 2705, __pyx_L3_error)
      values[14] = __Pyx_ArgRef_FASTCALL(__pyx_args, 14);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 2705, __pyx_L3_error)
      values[15] = __Pyx_ArgRef_FASTCALL(__pyx_args, 15);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 2705, __pyx_L3_error)
      values[16] = __Pyx_ArgRef_FASTCALL(__pyx_args, 16);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[16])) __PYX_ERR(0, 2705, __pyx_L3_error)
      values[17] = __Pyx_ArgRef_FASTCALL(__pyx_args, 17);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[17])) __PYX_ERR(0, 2705, __pyx_L3_error)
      values[18] = __Pyx_ArgRef_FASTCALL(__pyx_args, 18);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[18])) __PYX_ERR(0, 2705, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2706, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2706, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2706, __pyx_L3_error)
    __pyx_v_k = __Pyx_PyLong_As_int(values[3]); if (unlikely((__pyx_v_k == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2706, __pyx_L3_error)
    __pyx_v_alpha = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_alpha == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2707, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2708, __pyx_L3_error)
    __pyx_v_nnzA = __Pyx_PyLong_As_int(values[6]); if (unlikely((__pyx_v_nnzA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2708, __pyx_L3_error)
    __pyx_v_csrRowPtrA = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_csrRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2708, __pyx_L3_error)
    __pyx_v_csrColIndA = __Pyx_PyLong_As_size_t(values[8]); if (unlikely((__pyx_v_csrColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2708, __pyx_L3_error)
    __pyx_v_descrB = __Pyx_PyLong_As_size_t(values[9]); if (unlikely((__pyx_v_descrB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2709, __pyx_L3_error)
    __pyx_v_nnzB = __Pyx_PyLong_As_int(values[10]); if (unlikely((__pyx_v_nnzB == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2709, __pyx_L3_error)
    __pyx_v_csrRowPtrB = __Pyx_PyLong_As_size_t(values[11]); if (unlikely((__pyx_v_csrRowPtrB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2709, __pyx_L3_error)
    __pyx_v_csrColIndB = __Pyx_PyLong_As_size_t(values[12]); if (unlikely((__pyx_v_csrColIndB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2709, __pyx_L3_error)
    __pyx_v_beta = __Pyx_PyLong_As_size_t(values[13]); if (unlikely((__pyx_v_beta == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2710, __pyx_L3_error)
    __pyx_v_descrD = __Pyx_PyLong_As_size_t(values[14]); if (unlikely((__pyx_v_descrD == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2711, __pyx_L3_error)
    __pyx_v_nnzD = __Pyx_PyLong_As_int(values[15]); if (unlikely((__pyx_v_nnzD == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2711, __pyx_L3_error)
    __pyx_v_csrRowPtrD = __Pyx_PyLong_As_size_t(values[16]); if (unlikely((__pyx_v_csrRowPtrD == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2711, __pyx_L3_error)
    __pyx_v_csrColIndD = __Pyx_PyLong_As_size_t(values[17]); if (unlikely((__pyx_v_csrColIndD == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2711, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyLong_As_size_t(values[18]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2712, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("zcsrgemm2_bufferSizeExt", 1, 19, 19, __pyx_nargs); __PYX_ERR(0, 2705, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.zcsrgemm2_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_174zcsrgemm2_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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_174zcsrgemm2_bufferSizeExt(CYTHON_UNUSED PyObject *__pyx_self, intptr_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
  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("zcsrgemm2_bufferSizeExt", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(__pyx_t_1 == ((size_t)-1L) && PyErr_Occurred())) __PYX_ERR(0, 2705, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyLong_FromSize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2705, __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_backends.cuda.libs.cusparse.zcsrgemm2_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy_backends/cuda/libs/cusparse.pyx":2725
 *     return bufferSize
 * 
 * cpdef void xcsrgemm2Nnz(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int n, int k,
 *         size_t descrA, int nnzA, size_t csrRowPtrA, size_t csrColIndA,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_177xcsrgemm2Nnz(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_xcsrgemm2Nnz(intptr_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, intptr_t __pyx_v_nnzTotalDevHostPtr, size_t __pyx_v_info, intptr_t __pyx_v_pBuffer, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  __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_backends/cuda/libs/cusparse.pyx":2732
 *         size_t descrC, size_t csrRowPtrC,
 *         intptr_t nnzTotalDevHostPtr, size_t info, intptr_t pBuffer) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     status = cusparseXcsrgemm2Nnz(
 *         <Handle>handle, m, n, k,
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2732, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":2733
 *         intptr_t nnzTotalDevHostPtr, size_t info, intptr_t pBuffer) except *:
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":2740
 *         <MatDescr>descrC, <int*>csrRowPtrC,
 *         <int*>nnzTotalDevHostPtr, <csrgemm2Info_t>info, <void*>pBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef void scsrgemm2(
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2740, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":2725
 *     return bufferSize
 * 
 * cpdef void xcsrgemm2Nnz(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int n, int k,
 *         size_t descrA, int nnzA, size_t csrRowPtrA, size_t csrColIndA,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.xcsrgemm2Nnz", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_177xcsrgemm2Nnz(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_176xcsrgemm2Nnz, "xcsrgemm2Nnz(intptr_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, intptr_t nnzTotalDevHostPtr, size_t info, intptr_t pBuffer) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_177xcsrgemm2Nnz(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  intptr_t __pyx_v_nnzTotalDevHostPtr;
  size_t __pyx_v_info;
  intptr_t __pyx_v_pBuffer;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[21] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("xcsrgemm2Nnz (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_n,&__pyx_mstate_global->__pyx_n_u_k,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_nnzA,&__pyx_mstate_global->__pyx_n_u_csrRowPtrA,&__pyx_mstate_global->__pyx_n_u_csrColIndA,&__pyx_mstate_global->__pyx_n_u_descrB,&__pyx_mstate_global->__pyx_n_u_nnzB,&__pyx_mstate_global->__pyx_n_u_csrRowPtrB,&__pyx_mstate_global->__pyx_n_u_csrColIndB,&__pyx_mstate_global->__pyx_n_u_descrD,&__pyx_mstate_global->__pyx_n_u_nnzD,&__pyx_mstate_global->__pyx_n_u_csrRowPtrD,&__pyx_mstate_global->__pyx_n_u_csrColIndD,&__pyx_mstate_global->__pyx_n_u_descrC,&__pyx_mstate_global->__pyx_n_u_csrRowPtrC,&__pyx_mstate_global->__pyx_n_u_nnzTotalDevHostPtr,&__pyx_mstate_global->__pyx_n_u_info,&__pyx_mstate_global->__pyx_n_u_pBuffer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 2725, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 21:
        values[20] = __Pyx_ArgRef_FASTCALL(__pyx_args, 20);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[20])) __PYX_ERR(0, 2725, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 20:
        values[19] = __Pyx_ArgRef_FASTCALL(__pyx_args, 19);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[19])) __PYX_ERR(0, 2725, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 19:
        values[18] = __Pyx_ArgRef_FASTCALL(__pyx_args, 18);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[18])) __PYX_ERR(0, 2725, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 18:
        values[17] = __Pyx_ArgRef_FASTCALL(__pyx_args, 17);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[17])) __PYX_ERR(0, 2725, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 17:
        values[16] = __Pyx_ArgRef_FASTCALL(__pyx_args, 16);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[16])) __PYX_ERR(0, 2725, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 16:
        values[15] = __Pyx_ArgRef_FASTCALL(__pyx_args, 15);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 2725, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 15:
        values[14] = __Pyx_ArgRef_FASTCALL(__pyx_args, 14);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 2725, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 14:
        values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 2725, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 13:
        values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 2725, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 12:
        values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 2725, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 11:
        values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 2725, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 2725, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 2725, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 2725, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 2725, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 2725, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 2725, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2725, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2725, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2725, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2725, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "xcsrgemm2Nnz", 0) < (0)) __PYX_ERR(0, 2725, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 21; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("xcsrgemm2Nnz", 1, 21, 21, i); __PYX_ERR(0, 2725, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 21)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2725, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2725, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2725, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2725, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 2725, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 2725, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 2725, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 2725, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 2725, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 2725, __pyx_L3_error)
      values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 2725, __pyx_L3_error)
      values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 2725, __pyx_L3_error)
      values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 2725, __pyx_L3_error)
      values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 2725, __pyx_L3_error)
      values[14] = __Pyx_ArgRef_FASTCALL(__pyx_args, 14);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 2725, __pyx_L3_error)
      values[15] = __Pyx_ArgRef_FASTCALL(__pyx_args, 15);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 2725, __pyx_L3_error)
      values[16] = __Pyx_ArgRef_FASTCALL(__pyx_args, 16);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[16])) __PYX_ERR(0, 2725, __pyx_L3_error)
      values[17] = __Pyx_ArgRef_FASTCALL(__pyx_args, 17);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[17])) __PYX_ERR(0, 2725, __pyx_L3_error)
      values[18] = __Pyx_ArgRef_FASTCALL(__pyx_args, 18);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[18])) __PYX_ERR(0, 2725, __pyx_L3_error)
      values[19] = __Pyx_ArgRef_FASTCALL(__pyx_args, 19);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[19])) __PYX_ERR(0, 2725, __pyx_L3_error)
      values[20] = __Pyx_ArgRef_FASTCALL(__pyx_args, 20);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[20])) __PYX_ERR(0, 2725, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2726, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2726, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2726, __pyx_L3_error)
    __pyx_v_k = __Pyx_PyLong_As_int(values[3]); if (unlikely((__pyx_v_k == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2726, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2727, __pyx_L3_error)
    __pyx_v_nnzA = __Pyx_PyLong_As_int(values[5]); if (unlikely((__pyx_v_nnzA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2727, __pyx_L3_error)
    __pyx_v_csrRowPtrA = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_csrRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2727, __pyx_L3_error)
    __pyx_v_csrColIndA = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_csrColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2727, __pyx_L3_error)
    __pyx_v_descrB = __Pyx_PyLong_As_size_t(values[8]); if (unlikely((__pyx_v_descrB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2728, __pyx_L3_error)
    __pyx_v_nnzB = __Pyx_PyLong_As_int(values[9]); if (unlikely((__pyx_v_nnzB == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2728, __pyx_L3_error)
    __pyx_v_csrRowPtrB = __Pyx_PyLong_As_size_t(values[10]); if (unlikely((__pyx_v_csrRowPtrB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2728, __pyx_L3_error)
    __pyx_v_csrColIndB = __Pyx_PyLong_As_size_t(values[11]); if (unlikely((__pyx_v_csrColIndB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2728, __pyx_L3_error)
    __pyx_v_descrD = __Pyx_PyLong_As_size_t(values[12]); if (unlikely((__pyx_v_descrD == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2729, __pyx_L3_error)
    __pyx_v_nnzD = __Pyx_PyLong_As_int(values[13]); if (unlikely((__pyx_v_nnzD == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2729, __pyx_L3_error)
    __pyx_v_csrRowPtrD = __Pyx_PyLong_As_size_t(values[14]); if (unlikely((__pyx_v_csrRowPtrD == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2729, __pyx_L3_error)
    __pyx_v_csrColIndD = __Pyx_PyLong_As_size_t(values[15]); if (unlikely((__pyx_v_csrColIndD == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2729, __pyx_L3_error)
    __pyx_v_descrC = __Pyx_PyLong_As_size_t(values[16]); if (unlikely((__pyx_v_descrC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2730, __pyx_L3_error)
    __pyx_v_csrRowPtrC = __Pyx_PyLong_As_size_t(values[17]); if (unlikely((__pyx_v_csrRowPtrC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2730, __pyx_L3_error)
    __pyx_v_nnzTotalDevHostPtr = PyLong_AsSsize_t(values[18]); if (unlikely((__pyx_v_nnzTotalDevHostPtr == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2731, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyLong_As_size_t(values[19]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2731, __pyx_L3_error)
    __pyx_v_pBuffer = PyLong_AsSsize_t(values[20]); if (unlikely((__pyx_v_pBuffer == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2731, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("xcsrgemm2Nnz", 1, 21, 21, __pyx_nargs); __PYX_ERR(0, 2725, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.xcsrgemm2Nnz", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_176xcsrgemm2Nnz(__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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_176xcsrgemm2Nnz(CYTHON_UNUSED PyObject *__pyx_self, intptr_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, intptr_t __pyx_v_nnzTotalDevHostPtr, size_t __pyx_v_info, intptr_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_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2725, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2725, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":2742
 *     check_status(status)
 * 
 * cpdef void scsrgemm2(             # <<<<<<<<<<<<<<
 *         intptr_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_13cupy_backends_4cuda_4libs_8cusparse_179scsrgemm2(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_scsrgemm2(intptr_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, intptr_t __pyx_v_pBuffer, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  __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_backends/cuda/libs/cusparse.pyx":2750
 *         size_t csrValC, size_t csrRowPtrC, size_t csrColIndC, size_t info,
 *         intptr_t pBuffer) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     status = cusparseScsrgemm2(
 *         <Handle>handle, m, n, k, <float*>alpha, <MatDescr>descrA, nnzA,
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2750, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":2751
 *         intptr_t pBuffer) except *:
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":2759
 *         <int*>csrRowPtrC, <int*>csrColIndC, <csrgemm2Info_t>info,
 *         <void*>pBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef void dcsrgemm2(
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2759, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":2742
 *     check_status(status)
 * 
 * cpdef void scsrgemm2(             # <<<<<<<<<<<<<<
 *         intptr_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 */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.scsrgemm2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_179scsrgemm2(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_178scsrgemm2, "scsrgemm2(intptr_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, intptr_t pBuffer) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_179scsrgemm2(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  intptr_t __pyx_v_pBuffer;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  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};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("scsrgemm2 (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_n,&__pyx_mstate_global->__pyx_n_u_k,&__pyx_mstate_global->__pyx_n_u_alpha,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_nnzA,&__pyx_mstate_global->__pyx_n_u_csrValA,&__pyx_mstate_global->__pyx_n_u_csrRowPtrA,&__pyx_mstate_global->__pyx_n_u_csrColIndA,&__pyx_mstate_global->__pyx_n_u_descrB,&__pyx_mstate_global->__pyx_n_u_nnzB,&__pyx_mstate_global->__pyx_n_u_csrValB,&__pyx_mstate_global->__pyx_n_u_csrRowPtrB,&__pyx_mstate_global->__pyx_n_u_csrColIndB,&__pyx_mstate_global->__pyx_n_u_beta,&__pyx_mstate_global->__pyx_n_u_descrD,&__pyx_mstate_global->__pyx_n_u_nnzD,&__pyx_mstate_global->__pyx_n_u_csrValD,&__pyx_mstate_global->__pyx_n_u_csrRowPtrD,&__pyx_mstate_global->__pyx_n_u_csrColIndD,&__pyx_mstate_global->__pyx_n_u_descrC,&__pyx_mstate_global->__pyx_n_u_csrValC,&__pyx_mstate_global->__pyx_n_u_csrRowPtrC,&__pyx_mstate_global->__pyx_n_u_csrColIndC,&__pyx_mstate_global->__pyx_n_u_info,&__pyx_mstate_global->__pyx_n_u_pBuffer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 2742, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 27:
        values[26] = __Pyx_ArgRef_FASTCALL(__pyx_args, 26);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[26])) __PYX_ERR(0, 2742, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 26:
        values[25] = __Pyx_ArgRef_FASTCALL(__pyx_args, 25);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[25])) __PYX_ERR(0, 2742, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 25:
        values[24] = __Pyx_ArgRef_FASTCALL(__pyx_args, 24);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[24])) __PYX_ERR(0, 2742, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 24:
        values[23] = __Pyx_ArgRef_FASTCALL(__pyx_args, 23);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[23])) __PYX_ERR(0, 2742, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 23:
        values[22] = __Pyx_ArgRef_FASTCALL(__pyx_args, 22);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[22])) __PYX_ERR(0, 2742, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 22:
        values[21] = __Pyx_ArgRef_FASTCALL(__pyx_args, 21);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[21])) __PYX_ERR(0, 2742, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 21:
        values[20] = __Pyx_ArgRef_FASTCALL(__pyx_args, 20);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[20])) __PYX_ERR(0, 2742, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 20:
        values[19] = __Pyx_ArgRef_FASTCALL(__pyx_args, 19);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[19])) __PYX_ERR(0, 2742, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 19:
        values[18] = __Pyx_ArgRef_FASTCALL(__pyx_args, 18);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[18])) __PYX_ERR(0, 2742, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 18:
        values[17] = __Pyx_ArgRef_FASTCALL(__pyx_args, 17);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[17])) __PYX_ERR(0, 2742, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 17:
        values[16] = __Pyx_ArgRef_FASTCALL(__pyx_args, 16);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[16])) __PYX_ERR(0, 2742, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 16:
        values[15] = __Pyx_ArgRef_FASTCALL(__pyx_args, 15);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 2742, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 15:
        values[14] = __Pyx_ArgRef_FASTCALL(__pyx_args, 14);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 2742, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 14:
        values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 2742, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 13:
        values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 2742, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 12:
        values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 2742, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 11:
        values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 2742, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 2742, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 2742, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 2742, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 2742, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 2742, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 2742, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2742, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2742, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2742, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2742, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "scsrgemm2", 0) < (0)) __PYX_ERR(0, 2742, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 27; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("scsrgemm2", 1, 27, 27, i); __PYX_ERR(0, 2742, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 27)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2742, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2742, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2742, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2742, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 2742, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 2742, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 2742, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 2742, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 2742, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 2742, __pyx_L3_error)
      values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 2742, __pyx_L3_error)
      values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 2742, __pyx_L3_error)
      values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 2742, __pyx_L3_error)
      values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 2742, __pyx_L3_error)
      values[14] = __Pyx_ArgRef_FASTCALL(__pyx_args, 14);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 2742, __pyx_L3_error)
      values[15] = __Pyx_ArgRef_FASTCALL(__pyx_args, 15);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 2742, __pyx_L3_error)
      values[16] = __Pyx_ArgRef_FASTCALL(__pyx_args, 16);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[16])) __PYX_ERR(0, 2742, __pyx_L3_error)
      values[17] = __Pyx_ArgRef_FASTCALL(__pyx_args, 17);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[17])) __PYX_ERR(0, 2742, __pyx_L3_error)
      values[18] = __Pyx_ArgRef_FASTCALL(__pyx_args, 18);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[18])) __PYX_ERR(0, 2742, __pyx_L3_error)
      values[19] = __Pyx_ArgRef_FASTCALL(__pyx_args, 19);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[19])) __PYX_ERR(0, 2742, __pyx_L3_error)
      values[20] = __Pyx_ArgRef_FASTCALL(__pyx_args, 20);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[20])) __PYX_ERR(0, 2742, __pyx_L3_error)
      values[21] = __Pyx_ArgRef_FASTCALL(__pyx_args, 21);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[21])) __PYX_ERR(0, 2742, __pyx_L3_error)
      values[22] = __Pyx_ArgRef_FASTCALL(__pyx_args, 22);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[22])) __PYX_ERR(0, 2742, __pyx_L3_error)
      values[23] = __Pyx_ArgRef_FASTCALL(__pyx_args, 23);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[23])) __PYX_ERR(0, 2742, __pyx_L3_error)
      values[24] = __Pyx_ArgRef_FASTCALL(__pyx_args, 24);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[24])) __PYX_ERR(0, 2742, __pyx_L3_error)
      values[25] = __Pyx_ArgRef_FASTCALL(__pyx_args, 25);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[25])) __PYX_ERR(0, 2742, __pyx_L3_error)
      values[26] = __Pyx_ArgRef_FASTCALL(__pyx_args, 26);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[26])) __PYX_ERR(0, 2742, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2743, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2743, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2743, __pyx_L3_error)
    __pyx_v_k = __Pyx_PyLong_As_int(values[3]); if (unlikely((__pyx_v_k == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2743, __pyx_L3_error)
    __pyx_v_alpha = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_alpha == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2743, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2743, __pyx_L3_error)
    __pyx_v_nnzA = __Pyx_PyLong_As_int(values[6]); if (unlikely((__pyx_v_nnzA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2744, __pyx_L3_error)
    __pyx_v_csrValA = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_csrValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2744, __pyx_L3_error)
    __pyx_v_csrRowPtrA = __Pyx_PyLong_As_size_t(values[8]); if (unlikely((__pyx_v_csrRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2744, __pyx_L3_error)
    __pyx_v_csrColIndA = __Pyx_PyLong_As_size_t(values[9]); if (unlikely((__pyx_v_csrColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2744, __pyx_L3_error)
    __pyx_v_descrB = __Pyx_PyLong_As_size_t(values[10]); if (unlikely((__pyx_v_descrB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2745, __pyx_L3_error)
    __pyx_v_nnzB = __Pyx_PyLong_As_int(values[11]); if (unlikely((__pyx_v_nnzB == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2745, __pyx_L3_error)
    __pyx_v_csrValB = __Pyx_PyLong_As_size_t(values[12]); if (unlikely((__pyx_v_csrValB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2745, __pyx_L3_error)
    __pyx_v_csrRowPtrB = __Pyx_PyLong_As_size_t(values[13]); if (unlikely((__pyx_v_csrRowPtrB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2745, __pyx_L3_error)
    __pyx_v_csrColIndB = __Pyx_PyLong_As_size_t(values[14]); if (unlikely((__pyx_v_csrColIndB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2746, __pyx_L3_error)
    __pyx_v_beta = __Pyx_PyLong_As_size_t(values[15]); if (unlikely((__pyx_v_beta == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2746, __pyx_L3_error)
    __pyx_v_descrD = __Pyx_PyLong_As_size_t(values[16]); if (unlikely((__pyx_v_descrD == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2746, __pyx_L3_error)
    __pyx_v_nnzD = __Pyx_PyLong_As_int(values[17]); if (unlikely((__pyx_v_nnzD == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2746, __pyx_L3_error)
    __pyx_v_csrValD = __Pyx_PyLong_As_size_t(values[18]); if (unlikely((__pyx_v_csrValD == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2747, __pyx_L3_error)
    __pyx_v_csrRowPtrD = __Pyx_PyLong_As_size_t(values[19]); if (unlikely((__pyx_v_csrRowPtrD == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2747, __pyx_L3_error)
    __pyx_v_csrColIndD = __Pyx_PyLong_As_size_t(values[20]); if (unlikely((__pyx_v_csrColIndD == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2747, __pyx_L3_error)
    __pyx_v_descrC = __Pyx_PyLong_As_size_t(values[21]); if (unlikely((__pyx_v_descrC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2747, __pyx_L3_error)
    __pyx_v_csrValC = __Pyx_PyLong_As_size_t(values[22]); if (unlikely((__pyx_v_csrValC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2748, __pyx_L3_error)
    __pyx_v_csrRowPtrC = __Pyx_PyLong_As_size_t(values[23]); if (unlikely((__pyx_v_csrRowPtrC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2748, __pyx_L3_error)
    __pyx_v_csrColIndC = __Pyx_PyLong_As_size_t(values[24]); if (unlikely((__pyx_v_csrColIndC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2748, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyLong_As_size_t(values[25]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2748, __pyx_L3_error)
    __pyx_v_pBuffer = PyLong_AsSsize_t(values[26]); if (unlikely((__pyx_v_pBuffer == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2749, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("scsrgemm2", 1, 27, 27, __pyx_nargs); __PYX_ERR(0, 2742, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.scsrgemm2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_178scsrgemm2(__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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_178scsrgemm2(CYTHON_UNUSED PyObject *__pyx_self, intptr_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, intptr_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_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2742, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2742, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":2761
 *     check_status(status)
 * 
 * cpdef void dcsrgemm2(             # <<<<<<<<<<<<<<
 *         intptr_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_13cupy_backends_4cuda_4libs_8cusparse_181dcsrgemm2(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_dcsrgemm2(intptr_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, intptr_t __pyx_v_pBuffer, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  __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_backends/cuda/libs/cusparse.pyx":2769
 *         size_t csrValC, size_t csrRowPtrC, size_t csrColIndC, size_t info,
 *         intptr_t pBuffer) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     status = cusparseDcsrgemm2(
 *         <Handle>handle, m, n, k, <double*>alpha, <MatDescr>descrA, nnzA,
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2769, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":2770
 *         intptr_t pBuffer) except *:
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":2778
 *         <int*>csrRowPtrC, <int*>csrColIndC, <csrgemm2Info_t>info,
 *         <void*>pBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef void ccsrgemm2(
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 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_backends/cuda/libs/cusparse.pyx":2761
 *     check_status(status)
 * 
 * cpdef void dcsrgemm2(             # <<<<<<<<<<<<<<
 *         intptr_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 */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.dcsrgemm2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_181dcsrgemm2(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_180dcsrgemm2, "dcsrgemm2(intptr_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, intptr_t pBuffer) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_181dcsrgemm2(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  intptr_t __pyx_v_pBuffer;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  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};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dcsrgemm2 (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_n,&__pyx_mstate_global->__pyx_n_u_k,&__pyx_mstate_global->__pyx_n_u_alpha,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_nnzA,&__pyx_mstate_global->__pyx_n_u_csrValA,&__pyx_mstate_global->__pyx_n_u_csrRowPtrA,&__pyx_mstate_global->__pyx_n_u_csrColIndA,&__pyx_mstate_global->__pyx_n_u_descrB,&__pyx_mstate_global->__pyx_n_u_nnzB,&__pyx_mstate_global->__pyx_n_u_csrValB,&__pyx_mstate_global->__pyx_n_u_csrRowPtrB,&__pyx_mstate_global->__pyx_n_u_csrColIndB,&__pyx_mstate_global->__pyx_n_u_beta,&__pyx_mstate_global->__pyx_n_u_descrD,&__pyx_mstate_global->__pyx_n_u_nnzD,&__pyx_mstate_global->__pyx_n_u_csrValD,&__pyx_mstate_global->__pyx_n_u_csrRowPtrD,&__pyx_mstate_global->__pyx_n_u_csrColIndD,&__pyx_mstate_global->__pyx_n_u_descrC,&__pyx_mstate_global->__pyx_n_u_csrValC,&__pyx_mstate_global->__pyx_n_u_csrRowPtrC,&__pyx_mstate_global->__pyx_n_u_csrColIndC,&__pyx_mstate_global->__pyx_n_u_info,&__pyx_mstate_global->__pyx_n_u_pBuffer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 2761, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 27:
        values[26] = __Pyx_ArgRef_FASTCALL(__pyx_args, 26);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[26])) __PYX_ERR(0, 2761, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 26:
        values[25] = __Pyx_ArgRef_FASTCALL(__pyx_args, 25);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[25])) __PYX_ERR(0, 2761, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 25:
        values[24] = __Pyx_ArgRef_FASTCALL(__pyx_args, 24);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[24])) __PYX_ERR(0, 2761, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 24:
        values[23] = __Pyx_ArgRef_FASTCALL(__pyx_args, 23);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[23])) __PYX_ERR(0, 2761, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 23:
        values[22] = __Pyx_ArgRef_FASTCALL(__pyx_args, 22);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[22])) __PYX_ERR(0, 2761, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 22:
        values[21] = __Pyx_ArgRef_FASTCALL(__pyx_args, 21);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[21])) __PYX_ERR(0, 2761, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 21:
        values[20] = __Pyx_ArgRef_FASTCALL(__pyx_args, 20);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[20])) __PYX_ERR(0, 2761, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 20:
        values[19] = __Pyx_ArgRef_FASTCALL(__pyx_args, 19);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[19])) __PYX_ERR(0, 2761, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 19:
        values[18] = __Pyx_ArgRef_FASTCALL(__pyx_args, 18);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[18])) __PYX_ERR(0, 2761, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 18:
        values[17] = __Pyx_ArgRef_FASTCALL(__pyx_args, 17);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[17])) __PYX_ERR(0, 2761, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 17:
        values[16] = __Pyx_ArgRef_FASTCALL(__pyx_args, 16);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[16])) __PYX_ERR(0, 2761, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 16:
        values[15] = __Pyx_ArgRef_FASTCALL(__pyx_args, 15);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 2761, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 15:
        values[14] = __Pyx_ArgRef_FASTCALL(__pyx_args, 14);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 2761, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 14:
        values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 2761, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 13:
        values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 2761, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 12:
        values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 2761, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 11:
        values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 2761, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 2761, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 2761, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 2761, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 2761, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 2761, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 2761, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2761, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2761, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2761, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2761, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "dcsrgemm2", 0) < (0)) __PYX_ERR(0, 2761, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 27; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("dcsrgemm2", 1, 27, 27, i); __PYX_ERR(0, 2761, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 27)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2761, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2761, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2761, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2761, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 2761, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 2761, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 2761, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 2761, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 2761, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 2761, __pyx_L3_error)
      values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 2761, __pyx_L3_error)
      values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 2761, __pyx_L3_error)
      values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 2761, __pyx_L3_error)
      values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 2761, __pyx_L3_error)
      values[14] = __Pyx_ArgRef_FASTCALL(__pyx_args, 14);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 2761, __pyx_L3_error)
      values[15] = __Pyx_ArgRef_FASTCALL(__pyx_args, 15);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 2761, __pyx_L3_error)
      values[16] = __Pyx_ArgRef_FASTCALL(__pyx_args, 16);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[16])) __PYX_ERR(0, 2761, __pyx_L3_error)
      values[17] = __Pyx_ArgRef_FASTCALL(__pyx_args, 17);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[17])) __PYX_ERR(0, 2761, __pyx_L3_error)
      values[18] = __Pyx_ArgRef_FASTCALL(__pyx_args, 18);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[18])) __PYX_ERR(0, 2761, __pyx_L3_error)
      values[19] = __Pyx_ArgRef_FASTCALL(__pyx_args, 19);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[19])) __PYX_ERR(0, 2761, __pyx_L3_error)
      values[20] = __Pyx_ArgRef_FASTCALL(__pyx_args, 20);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[20])) __PYX_ERR(0, 2761, __pyx_L3_error)
      values[21] = __Pyx_ArgRef_FASTCALL(__pyx_args, 21);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[21])) __PYX_ERR(0, 2761, __pyx_L3_error)
      values[22] = __Pyx_ArgRef_FASTCALL(__pyx_args, 22);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[22])) __PYX_ERR(0, 2761, __pyx_L3_error)
      values[23] = __Pyx_ArgRef_FASTCALL(__pyx_args, 23);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[23])) __PYX_ERR(0, 2761, __pyx_L3_error)
      values[24] = __Pyx_ArgRef_FASTCALL(__pyx_args, 24);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[24])) __PYX_ERR(0, 2761, __pyx_L3_error)
      values[25] = __Pyx_ArgRef_FASTCALL(__pyx_args, 25);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[25])) __PYX_ERR(0, 2761, __pyx_L3_error)
      values[26] = __Pyx_ArgRef_FASTCALL(__pyx_args, 26);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[26])) __PYX_ERR(0, 2761, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2762, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2762, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2762, __pyx_L3_error)
    __pyx_v_k = __Pyx_PyLong_As_int(values[3]); if (unlikely((__pyx_v_k == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2762, __pyx_L3_error)
    __pyx_v_alpha = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_alpha == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2762, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2762, __pyx_L3_error)
    __pyx_v_nnzA = __Pyx_PyLong_As_int(values[6]); if (unlikely((__pyx_v_nnzA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2763, __pyx_L3_error)
    __pyx_v_csrValA = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_csrValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2763, __pyx_L3_error)
    __pyx_v_csrRowPtrA = __Pyx_PyLong_As_size_t(values[8]); if (unlikely((__pyx_v_csrRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2763, __pyx_L3_error)
    __pyx_v_csrColIndA = __Pyx_PyLong_As_size_t(values[9]); if (unlikely((__pyx_v_csrColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2763, __pyx_L3_error)
    __pyx_v_descrB = __Pyx_PyLong_As_size_t(values[10]); if (unlikely((__pyx_v_descrB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2764, __pyx_L3_error)
    __pyx_v_nnzB = __Pyx_PyLong_As_int(values[11]); if (unlikely((__pyx_v_nnzB == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2764, __pyx_L3_error)
    __pyx_v_csrValB = __Pyx_PyLong_As_size_t(values[12]); if (unlikely((__pyx_v_csrValB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2764, __pyx_L3_error)
    __pyx_v_csrRowPtrB = __Pyx_PyLong_As_size_t(values[13]); if (unlikely((__pyx_v_csrRowPtrB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2764, __pyx_L3_error)
    __pyx_v_csrColIndB = __Pyx_PyLong_As_size_t(values[14]); if (unlikely((__pyx_v_csrColIndB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2765, __pyx_L3_error)
    __pyx_v_beta = __Pyx_PyLong_As_size_t(values[15]); if (unlikely((__pyx_v_beta == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2765, __pyx_L3_error)
    __pyx_v_descrD = __Pyx_PyLong_As_size_t(values[16]); if (unlikely((__pyx_v_descrD == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2765, __pyx_L3_error)
    __pyx_v_nnzD = __Pyx_PyLong_As_int(values[17]); if (unlikely((__pyx_v_nnzD == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2765, __pyx_L3_error)
    __pyx_v_csrValD = __Pyx_PyLong_As_size_t(values[18]); if (unlikely((__pyx_v_csrValD == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2766, __pyx_L3_error)
    __pyx_v_csrRowPtrD = __Pyx_PyLong_As_size_t(values[19]); if (unlikely((__pyx_v_csrRowPtrD == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2766, __pyx_L3_error)
    __pyx_v_csrColIndD = __Pyx_PyLong_As_size_t(values[20]); if (unlikely((__pyx_v_csrColIndD == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2766, __pyx_L3_error)
    __pyx_v_descrC = __Pyx_PyLong_As_size_t(values[21]); if (unlikely((__pyx_v_descrC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2766, __pyx_L3_error)
    __pyx_v_csrValC = __Pyx_PyLong_As_size_t(values[22]); if (unlikely((__pyx_v_csrValC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2767, __pyx_L3_error)
    __pyx_v_csrRowPtrC = __Pyx_PyLong_As_size_t(values[23]); if (unlikely((__pyx_v_csrRowPtrC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2767, __pyx_L3_error)
    __pyx_v_csrColIndC = __Pyx_PyLong_As_size_t(values[24]); if (unlikely((__pyx_v_csrColIndC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2767, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyLong_As_size_t(values[25]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2767, __pyx_L3_error)
    __pyx_v_pBuffer = PyLong_AsSsize_t(values[26]); if (unlikely((__pyx_v_pBuffer == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2768, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("dcsrgemm2", 1, 27, 27, __pyx_nargs); __PYX_ERR(0, 2761, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.dcsrgemm2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_180dcsrgemm2(__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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_180dcsrgemm2(CYTHON_UNUSED PyObject *__pyx_self, intptr_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, intptr_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_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2761, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2761, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":2780
 *     check_status(status)
 * 
 * cpdef void ccsrgemm2(             # <<<<<<<<<<<<<<
 *         intptr_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_13cupy_backends_4cuda_4libs_8cusparse_183ccsrgemm2(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_ccsrgemm2(intptr_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, intptr_t __pyx_v_pBuffer, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  __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_backends/cuda/libs/cusparse.pyx":2788
 *         size_t csrValC, size_t csrRowPtrC, size_t csrColIndC, size_t info,
 *         intptr_t pBuffer) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     status = cusparseCcsrgemm2(
 *         <Handle>handle, m, n, k, <cuComplex*>alpha, <MatDescr>descrA, nnzA,
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2788, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":2789
 *         intptr_t pBuffer) except *:
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":2797
 *         <MatDescr>descrC, <cuComplex*>csrValC, <int*>csrRowPtrC,
 *         <int*>csrColIndC, <csrgemm2Info_t>info, <void*>pBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef void zcsrgemm2(
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2797, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":2780
 *     check_status(status)
 * 
 * cpdef void ccsrgemm2(             # <<<<<<<<<<<<<<
 *         intptr_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 */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.ccsrgemm2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_183ccsrgemm2(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_182ccsrgemm2, "ccsrgemm2(intptr_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, intptr_t pBuffer) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_183ccsrgemm2(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  intptr_t __pyx_v_pBuffer;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  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};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ccsrgemm2 (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_n,&__pyx_mstate_global->__pyx_n_u_k,&__pyx_mstate_global->__pyx_n_u_alpha,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_nnzA,&__pyx_mstate_global->__pyx_n_u_csrValA,&__pyx_mstate_global->__pyx_n_u_csrRowPtrA,&__pyx_mstate_global->__pyx_n_u_csrColIndA,&__pyx_mstate_global->__pyx_n_u_descrB,&__pyx_mstate_global->__pyx_n_u_nnzB,&__pyx_mstate_global->__pyx_n_u_csrValB,&__pyx_mstate_global->__pyx_n_u_csrRowPtrB,&__pyx_mstate_global->__pyx_n_u_csrColIndB,&__pyx_mstate_global->__pyx_n_u_beta,&__pyx_mstate_global->__pyx_n_u_descrD,&__pyx_mstate_global->__pyx_n_u_nnzD,&__pyx_mstate_global->__pyx_n_u_csrValD,&__pyx_mstate_global->__pyx_n_u_csrRowPtrD,&__pyx_mstate_global->__pyx_n_u_csrColIndD,&__pyx_mstate_global->__pyx_n_u_descrC,&__pyx_mstate_global->__pyx_n_u_csrValC,&__pyx_mstate_global->__pyx_n_u_csrRowPtrC,&__pyx_mstate_global->__pyx_n_u_csrColIndC,&__pyx_mstate_global->__pyx_n_u_info,&__pyx_mstate_global->__pyx_n_u_pBuffer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 2780, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 27:
        values[26] = __Pyx_ArgRef_FASTCALL(__pyx_args, 26);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[26])) __PYX_ERR(0, 2780, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 26:
        values[25] = __Pyx_ArgRef_FASTCALL(__pyx_args, 25);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[25])) __PYX_ERR(0, 2780, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 25:
        values[24] = __Pyx_ArgRef_FASTCALL(__pyx_args, 24);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[24])) __PYX_ERR(0, 2780, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 24:
        values[23] = __Pyx_ArgRef_FASTCALL(__pyx_args, 23);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[23])) __PYX_ERR(0, 2780, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 23:
        values[22] = __Pyx_ArgRef_FASTCALL(__pyx_args, 22);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[22])) __PYX_ERR(0, 2780, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 22:
        values[21] = __Pyx_ArgRef_FASTCALL(__pyx_args, 21);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[21])) __PYX_ERR(0, 2780, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 21:
        values[20] = __Pyx_ArgRef_FASTCALL(__pyx_args, 20);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[20])) __PYX_ERR(0, 2780, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 20:
        values[19] = __Pyx_ArgRef_FASTCALL(__pyx_args, 19);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[19])) __PYX_ERR(0, 2780, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 19:
        values[18] = __Pyx_ArgRef_FASTCALL(__pyx_args, 18);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[18])) __PYX_ERR(0, 2780, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 18:
        values[17] = __Pyx_ArgRef_FASTCALL(__pyx_args, 17);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[17])) __PYX_ERR(0, 2780, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 17:
        values[16] = __Pyx_ArgRef_FASTCALL(__pyx_args, 16);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[16])) __PYX_ERR(0, 2780, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 16:
        values[15] = __Pyx_ArgRef_FASTCALL(__pyx_args, 15);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 2780, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 15:
        values[14] = __Pyx_ArgRef_FASTCALL(__pyx_args, 14);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 2780, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 14:
        values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 2780, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 13:
        values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 2780, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 12:
        values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 2780, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 11:
        values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 2780, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 2780, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 2780, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 2780, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 2780, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 2780, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 2780, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2780, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2780, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2780, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2780, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "ccsrgemm2", 0) < (0)) __PYX_ERR(0, 2780, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 27; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("ccsrgemm2", 1, 27, 27, i); __PYX_ERR(0, 2780, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 27)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2780, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2780, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2780, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2780, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 2780, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 2780, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 2780, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 2780, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 2780, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 2780, __pyx_L3_error)
      values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 2780, __pyx_L3_error)
      values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 2780, __pyx_L3_error)
      values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 2780, __pyx_L3_error)
      values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 2780, __pyx_L3_error)
      values[14] = __Pyx_ArgRef_FASTCALL(__pyx_args, 14);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 2780, __pyx_L3_error)
      values[15] = __Pyx_ArgRef_FASTCALL(__pyx_args, 15);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 2780, __pyx_L3_error)
      values[16] = __Pyx_ArgRef_FASTCALL(__pyx_args, 16);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[16])) __PYX_ERR(0, 2780, __pyx_L3_error)
      values[17] = __Pyx_ArgRef_FASTCALL(__pyx_args, 17);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[17])) __PYX_ERR(0, 2780, __pyx_L3_error)
      values[18] = __Pyx_ArgRef_FASTCALL(__pyx_args, 18);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[18])) __PYX_ERR(0, 2780, __pyx_L3_error)
      values[19] = __Pyx_ArgRef_FASTCALL(__pyx_args, 19);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[19])) __PYX_ERR(0, 2780, __pyx_L3_error)
      values[20] = __Pyx_ArgRef_FASTCALL(__pyx_args, 20);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[20])) __PYX_ERR(0, 2780, __pyx_L3_error)
      values[21] = __Pyx_ArgRef_FASTCALL(__pyx_args, 21);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[21])) __PYX_ERR(0, 2780, __pyx_L3_error)
      values[22] = __Pyx_ArgRef_FASTCALL(__pyx_args, 22);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[22])) __PYX_ERR(0, 2780, __pyx_L3_error)
      values[23] = __Pyx_ArgRef_FASTCALL(__pyx_args, 23);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[23])) __PYX_ERR(0, 2780, __pyx_L3_error)
      values[24] = __Pyx_ArgRef_FASTCALL(__pyx_args, 24);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[24])) __PYX_ERR(0, 2780, __pyx_L3_error)
      values[25] = __Pyx_ArgRef_FASTCALL(__pyx_args, 25);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[25])) __PYX_ERR(0, 2780, __pyx_L3_error)
      values[26] = __Pyx_ArgRef_FASTCALL(__pyx_args, 26);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[26])) __PYX_ERR(0, 2780, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2781, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2781, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2781, __pyx_L3_error)
    __pyx_v_k = __Pyx_PyLong_As_int(values[3]); if (unlikely((__pyx_v_k == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2781, __pyx_L3_error)
    __pyx_v_alpha = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_alpha == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2781, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2781, __pyx_L3_error)
    __pyx_v_nnzA = __Pyx_PyLong_As_int(values[6]); if (unlikely((__pyx_v_nnzA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2782, __pyx_L3_error)
    __pyx_v_csrValA = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_csrValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2782, __pyx_L3_error)
    __pyx_v_csrRowPtrA = __Pyx_PyLong_As_size_t(values[8]); if (unlikely((__pyx_v_csrRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2782, __pyx_L3_error)
    __pyx_v_csrColIndA = __Pyx_PyLong_As_size_t(values[9]); if (unlikely((__pyx_v_csrColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2782, __pyx_L3_error)
    __pyx_v_descrB = __Pyx_PyLong_As_size_t(values[10]); if (unlikely((__pyx_v_descrB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2783, __pyx_L3_error)
    __pyx_v_nnzB = __Pyx_PyLong_As_int(values[11]); if (unlikely((__pyx_v_nnzB == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2783, __pyx_L3_error)
    __pyx_v_csrValB = __Pyx_PyLong_As_size_t(values[12]); if (unlikely((__pyx_v_csrValB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2783, __pyx_L3_error)
    __pyx_v_csrRowPtrB = __Pyx_PyLong_As_size_t(values[13]); if (unlikely((__pyx_v_csrRowPtrB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2783, __pyx_L3_error)
    __pyx_v_csrColIndB = __Pyx_PyLong_As_size_t(values[14]); if (unlikely((__pyx_v_csrColIndB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2784, __pyx_L3_error)
    __pyx_v_beta = __Pyx_PyLong_As_size_t(values[15]); if (unlikely((__pyx_v_beta == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2784, __pyx_L3_error)
    __pyx_v_descrD = __Pyx_PyLong_As_size_t(values[16]); if (unlikely((__pyx_v_descrD == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2784, __pyx_L3_error)
    __pyx_v_nnzD = __Pyx_PyLong_As_int(values[17]); if (unlikely((__pyx_v_nnzD == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2784, __pyx_L3_error)
    __pyx_v_csrValD = __Pyx_PyLong_As_size_t(values[18]); if (unlikely((__pyx_v_csrValD == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2785, __pyx_L3_error)
    __pyx_v_csrRowPtrD = __Pyx_PyLong_As_size_t(values[19]); if (unlikely((__pyx_v_csrRowPtrD == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2785, __pyx_L3_error)
    __pyx_v_csrColIndD = __Pyx_PyLong_As_size_t(values[20]); if (unlikely((__pyx_v_csrColIndD == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2785, __pyx_L3_error)
    __pyx_v_descrC = __Pyx_PyLong_As_size_t(values[21]); if (unlikely((__pyx_v_descrC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2785, __pyx_L3_error)
    __pyx_v_csrValC = __Pyx_PyLong_As_size_t(values[22]); if (unlikely((__pyx_v_csrValC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2786, __pyx_L3_error)
    __pyx_v_csrRowPtrC = __Pyx_PyLong_As_size_t(values[23]); if (unlikely((__pyx_v_csrRowPtrC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2786, __pyx_L3_error)
    __pyx_v_csrColIndC = __Pyx_PyLong_As_size_t(values[24]); if (unlikely((__pyx_v_csrColIndC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2786, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyLong_As_size_t(values[25]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2786, __pyx_L3_error)
    __pyx_v_pBuffer = PyLong_AsSsize_t(values[26]); if (unlikely((__pyx_v_pBuffer == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2787, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ccsrgemm2", 1, 27, 27, __pyx_nargs); __PYX_ERR(0, 2780, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.ccsrgemm2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_182ccsrgemm2(__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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_182ccsrgemm2(CYTHON_UNUSED PyObject *__pyx_self, intptr_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, intptr_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_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2780, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2780, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":2799
 *     check_status(status)
 * 
 * cpdef void zcsrgemm2(             # <<<<<<<<<<<<<<
 *         intptr_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_13cupy_backends_4cuda_4libs_8cusparse_185zcsrgemm2(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_zcsrgemm2(intptr_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, intptr_t __pyx_v_pBuffer, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  __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_backends/cuda/libs/cusparse.pyx":2807
 *         size_t csrValC, size_t csrRowPtrC, size_t csrColIndC, size_t info,
 *         intptr_t pBuffer) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     status = cusparseZcsrgemm2(
 *         <Handle>handle, m, n, k, <cuDoubleComplex*>alpha, <MatDescr>descrA,
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2807, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":2808
 *         intptr_t pBuffer) except *:
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":2816
 *         <MatDescr>descrC, <cuDoubleComplex*>csrValC, <int*>csrRowPtrC,
 *         <int*>csrColIndC, <csrgemm2Info_t>info, <void*>pBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * ########################################
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2816, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":2799
 *     check_status(status)
 * 
 * cpdef void zcsrgemm2(             # <<<<<<<<<<<<<<
 *         intptr_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 */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.zcsrgemm2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_185zcsrgemm2(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_184zcsrgemm2, "zcsrgemm2(intptr_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, intptr_t pBuffer) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_185zcsrgemm2(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  intptr_t __pyx_v_pBuffer;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  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};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("zcsrgemm2 (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_n,&__pyx_mstate_global->__pyx_n_u_k,&__pyx_mstate_global->__pyx_n_u_alpha,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_nnzA,&__pyx_mstate_global->__pyx_n_u_csrValA,&__pyx_mstate_global->__pyx_n_u_csrRowPtrA,&__pyx_mstate_global->__pyx_n_u_csrColIndA,&__pyx_mstate_global->__pyx_n_u_descrB,&__pyx_mstate_global->__pyx_n_u_nnzB,&__pyx_mstate_global->__pyx_n_u_csrValB,&__pyx_mstate_global->__pyx_n_u_csrRowPtrB,&__pyx_mstate_global->__pyx_n_u_csrColIndB,&__pyx_mstate_global->__pyx_n_u_beta,&__pyx_mstate_global->__pyx_n_u_descrD,&__pyx_mstate_global->__pyx_n_u_nnzD,&__pyx_mstate_global->__pyx_n_u_csrValD,&__pyx_mstate_global->__pyx_n_u_csrRowPtrD,&__pyx_mstate_global->__pyx_n_u_csrColIndD,&__pyx_mstate_global->__pyx_n_u_descrC,&__pyx_mstate_global->__pyx_n_u_csrValC,&__pyx_mstate_global->__pyx_n_u_csrRowPtrC,&__pyx_mstate_global->__pyx_n_u_csrColIndC,&__pyx_mstate_global->__pyx_n_u_info,&__pyx_mstate_global->__pyx_n_u_pBuffer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 2799, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 27:
        values[26] = __Pyx_ArgRef_FASTCALL(__pyx_args, 26);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[26])) __PYX_ERR(0, 2799, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 26:
        values[25] = __Pyx_ArgRef_FASTCALL(__pyx_args, 25);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[25])) __PYX_ERR(0, 2799, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 25:
        values[24] = __Pyx_ArgRef_FASTCALL(__pyx_args, 24);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[24])) __PYX_ERR(0, 2799, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 24:
        values[23] = __Pyx_ArgRef_FASTCALL(__pyx_args, 23);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[23])) __PYX_ERR(0, 2799, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 23:
        values[22] = __Pyx_ArgRef_FASTCALL(__pyx_args, 22);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[22])) __PYX_ERR(0, 2799, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 22:
        values[21] = __Pyx_ArgRef_FASTCALL(__pyx_args, 21);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[21])) __PYX_ERR(0, 2799, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 21:
        values[20] = __Pyx_ArgRef_FASTCALL(__pyx_args, 20);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[20])) __PYX_ERR(0, 2799, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 20:
        values[19] = __Pyx_ArgRef_FASTCALL(__pyx_args, 19);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[19])) __PYX_ERR(0, 2799, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 19:
        values[18] = __Pyx_ArgRef_FASTCALL(__pyx_args, 18);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[18])) __PYX_ERR(0, 2799, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 18:
        values[17] = __Pyx_ArgRef_FASTCALL(__pyx_args, 17);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[17])) __PYX_ERR(0, 2799, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 17:
        values[16] = __Pyx_ArgRef_FASTCALL(__pyx_args, 16);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[16])) __PYX_ERR(0, 2799, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 16:
        values[15] = __Pyx_ArgRef_FASTCALL(__pyx_args, 15);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 2799, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 15:
        values[14] = __Pyx_ArgRef_FASTCALL(__pyx_args, 14);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 2799, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 14:
        values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 2799, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 13:
        values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 2799, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 12:
        values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 2799, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 11:
        values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 2799, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 2799, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 2799, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 2799, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 2799, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 2799, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 2799, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2799, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2799, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2799, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2799, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "zcsrgemm2", 0) < (0)) __PYX_ERR(0, 2799, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 27; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("zcsrgemm2", 1, 27, 27, i); __PYX_ERR(0, 2799, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 27)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2799, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2799, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2799, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2799, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 2799, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 2799, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 2799, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 2799, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 2799, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 2799, __pyx_L3_error)
      values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 2799, __pyx_L3_error)
      values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 2799, __pyx_L3_error)
      values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 2799, __pyx_L3_error)
      values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 2799, __pyx_L3_error)
      values[14] = __Pyx_ArgRef_FASTCALL(__pyx_args, 14);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 2799, __pyx_L3_error)
      values[15] = __Pyx_ArgRef_FASTCALL(__pyx_args, 15);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 2799, __pyx_L3_error)
      values[16] = __Pyx_ArgRef_FASTCALL(__pyx_args, 16);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[16])) __PYX_ERR(0, 2799, __pyx_L3_error)
      values[17] = __Pyx_ArgRef_FASTCALL(__pyx_args, 17);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[17])) __PYX_ERR(0, 2799, __pyx_L3_error)
      values[18] = __Pyx_ArgRef_FASTCALL(__pyx_args, 18);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[18])) __PYX_ERR(0, 2799, __pyx_L3_error)
      values[19] = __Pyx_ArgRef_FASTCALL(__pyx_args, 19);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[19])) __PYX_ERR(0, 2799, __pyx_L3_error)
      values[20] = __Pyx_ArgRef_FASTCALL(__pyx_args, 20);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[20])) __PYX_ERR(0, 2799, __pyx_L3_error)
      values[21] = __Pyx_ArgRef_FASTCALL(__pyx_args, 21);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[21])) __PYX_ERR(0, 2799, __pyx_L3_error)
      values[22] = __Pyx_ArgRef_FASTCALL(__pyx_args, 22);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[22])) __PYX_ERR(0, 2799, __pyx_L3_error)
      values[23] = __Pyx_ArgRef_FASTCALL(__pyx_args, 23);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[23])) __PYX_ERR(0, 2799, __pyx_L3_error)
      values[24] = __Pyx_ArgRef_FASTCALL(__pyx_args, 24);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[24])) __PYX_ERR(0, 2799, __pyx_L3_error)
      values[25] = __Pyx_ArgRef_FASTCALL(__pyx_args, 25);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[25])) __PYX_ERR(0, 2799, __pyx_L3_error)
      values[26] = __Pyx_ArgRef_FASTCALL(__pyx_args, 26);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[26])) __PYX_ERR(0, 2799, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2800, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2800, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2800, __pyx_L3_error)
    __pyx_v_k = __Pyx_PyLong_As_int(values[3]); if (unlikely((__pyx_v_k == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2800, __pyx_L3_error)
    __pyx_v_alpha = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_alpha == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2800, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2800, __pyx_L3_error)
    __pyx_v_nnzA = __Pyx_PyLong_As_int(values[6]); if (unlikely((__pyx_v_nnzA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2801, __pyx_L3_error)
    __pyx_v_csrValA = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_csrValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2801, __pyx_L3_error)
    __pyx_v_csrRowPtrA = __Pyx_PyLong_As_size_t(values[8]); if (unlikely((__pyx_v_csrRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2801, __pyx_L3_error)
    __pyx_v_csrColIndA = __Pyx_PyLong_As_size_t(values[9]); if (unlikely((__pyx_v_csrColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2801, __pyx_L3_error)
    __pyx_v_descrB = __Pyx_PyLong_As_size_t(values[10]); if (unlikely((__pyx_v_descrB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2802, __pyx_L3_error)
    __pyx_v_nnzB = __Pyx_PyLong_As_int(values[11]); if (unlikely((__pyx_v_nnzB == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2802, __pyx_L3_error)
    __pyx_v_csrValB = __Pyx_PyLong_As_size_t(values[12]); if (unlikely((__pyx_v_csrValB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2802, __pyx_L3_error)
    __pyx_v_csrRowPtrB = __Pyx_PyLong_As_size_t(values[13]); if (unlikely((__pyx_v_csrRowPtrB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2802, __pyx_L3_error)
    __pyx_v_csrColIndB = __Pyx_PyLong_As_size_t(values[14]); if (unlikely((__pyx_v_csrColIndB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2803, __pyx_L3_error)
    __pyx_v_beta = __Pyx_PyLong_As_size_t(values[15]); if (unlikely((__pyx_v_beta == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2803, __pyx_L3_error)
    __pyx_v_descrD = __Pyx_PyLong_As_size_t(values[16]); if (unlikely((__pyx_v_descrD == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2803, __pyx_L3_error)
    __pyx_v_nnzD = __Pyx_PyLong_As_int(values[17]); if (unlikely((__pyx_v_nnzD == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2803, __pyx_L3_error)
    __pyx_v_csrValD = __Pyx_PyLong_As_size_t(values[18]); if (unlikely((__pyx_v_csrValD == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2804, __pyx_L3_error)
    __pyx_v_csrRowPtrD = __Pyx_PyLong_As_size_t(values[19]); if (unlikely((__pyx_v_csrRowPtrD == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2804, __pyx_L3_error)
    __pyx_v_csrColIndD = __Pyx_PyLong_As_size_t(values[20]); if (unlikely((__pyx_v_csrColIndD == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2804, __pyx_L3_error)
    __pyx_v_descrC = __Pyx_PyLong_As_size_t(values[21]); if (unlikely((__pyx_v_descrC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2804, __pyx_L3_error)
    __pyx_v_csrValC = __Pyx_PyLong_As_size_t(values[22]); if (unlikely((__pyx_v_csrValC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2805, __pyx_L3_error)
    __pyx_v_csrRowPtrC = __Pyx_PyLong_As_size_t(values[23]); if (unlikely((__pyx_v_csrRowPtrC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2805, __pyx_L3_error)
    __pyx_v_csrColIndC = __Pyx_PyLong_As_size_t(values[24]); if (unlikely((__pyx_v_csrColIndC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2805, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyLong_As_size_t(values[25]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2805, __pyx_L3_error)
    __pyx_v_pBuffer = PyLong_AsSsize_t(values[26]); if (unlikely((__pyx_v_pBuffer == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2806, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("zcsrgemm2", 1, 27, 27, __pyx_nargs); __PYX_ERR(0, 2799, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.zcsrgemm2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_184zcsrgemm2(__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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_184zcsrgemm2(CYTHON_UNUSED PyObject *__pyx_self, intptr_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, intptr_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_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2799, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2799, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":2821
 * # cuSPARSE Format Convrsion
 * 
 * cpdef void xcoo2csr(             # <<<<<<<<<<<<<<
 *         intptr_t handle, size_t cooRowInd, int nnz, int m, size_t csrRowPtr,
 *         int idxBase) except *:
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_187xcoo2csr(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_xcoo2csr(intptr_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;
  __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_backends/cuda/libs/cusparse.pyx":2824
 *         intptr_t handle, size_t cooRowInd, int nnz, int m, size_t csrRowPtr,
 *         int idxBase) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     status = cusparseXcoo2csr(
 *         <Handle>handle, <const int *>cooRowInd, nnz, m, <int *>csrRowPtr,
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2824, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":2825
 *         int idxBase) except *:
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":2828
 *         <Handle>handle, <const int *>cooRowInd, nnz, m, <int *>csrRowPtr,
 *         <IndexBase>idxBase)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2828, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":2821
 * # cuSPARSE Format Convrsion
 * 
 * cpdef void xcoo2csr(             # <<<<<<<<<<<<<<
 *         intptr_t handle, size_t cooRowInd, int nnz, int m, size_t csrRowPtr,
 *         int idxBase) except *:
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.xcoo2csr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_187xcoo2csr(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_186xcoo2csr, "xcoo2csr(intptr_t handle, size_t cooRowInd, int nnz, int m, size_t csrRowPtr, int idxBase) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_187xcoo2csr(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[6] = {0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("xcoo2csr (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_cooRowInd,&__pyx_mstate_global->__pyx_n_u_nnz,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_csrRowPtr,&__pyx_mstate_global->__pyx_n_u_idxBase,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 2821, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 2821, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 2821, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2821, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2821, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2821, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2821, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "xcoo2csr", 0) < (0)) __PYX_ERR(0, 2821, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 6; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("xcoo2csr", 1, 6, 6, i); __PYX_ERR(0, 2821, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 6)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2821, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2821, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2821, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2821, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 2821, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 2821, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2822, __pyx_L3_error)
    __pyx_v_cooRowInd = __Pyx_PyLong_As_size_t(values[1]); if (unlikely((__pyx_v_cooRowInd == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2822, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2822, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[3]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2822, __pyx_L3_error)
    __pyx_v_csrRowPtr = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_csrRowPtr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2822, __pyx_L3_error)
    __pyx_v_idxBase = __Pyx_PyLong_As_int(values[5]); if (unlikely((__pyx_v_idxBase == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2823, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("xcoo2csr", 1, 6, 6, __pyx_nargs); __PYX_ERR(0, 2821, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.xcoo2csr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_186xcoo2csr(__pyx_self, __pyx_v_handle, __pyx_v_cooRowInd, __pyx_v_nnz, __pyx_v_m, __pyx_v_csrRowPtr, __pyx_v_idxBase);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_186xcoo2csr(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_f_13cupy_backends_4cuda_4libs_8cusparse_xcoo2csr(__pyx_v_handle, __pyx_v_cooRowInd, __pyx_v_nnz, __pyx_v_m, __pyx_v_csrRowPtr, __pyx_v_idxBase, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2821, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2821, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":2831
 * 
 * 
 * cpdef void scsc2dense(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int n, size_t descrA,
 *         size_t cscSortedValA, size_t cscSortedRowIndA,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_189scsc2dense(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_scsc2dense(intptr_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;
  __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_backends/cuda/libs/cusparse.pyx":2835
 *         size_t cscSortedValA, size_t cscSortedRowIndA,
 *         size_t cscSortedColPtrA, size_t A, int lda) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     status = cusparseScsc2dense(
 *         <Handle>handle, m, n, <MatDescr>descrA,
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2835, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":2836
 *         size_t cscSortedColPtrA, size_t A, int lda) except *:
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":2840
 *         <const float *>cscSortedValA, <const int *>cscSortedRowIndA,
 *         <const int *>cscSortedColPtrA, <float *>A, lda)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2840, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":2831
 * 
 * 
 * cpdef void scsc2dense(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int n, size_t descrA,
 *         size_t cscSortedValA, size_t cscSortedRowIndA,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.scsc2dense", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_189scsc2dense(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_188scsc2dense, "scsc2dense(intptr_t handle, int m, int n, size_t descrA, size_t cscSortedValA, size_t cscSortedRowIndA, size_t cscSortedColPtrA, size_t A, int lda) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_189scsc2dense(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("scsc2dense (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_n,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_cscSortedValA,&__pyx_mstate_global->__pyx_n_u_cscSortedRowIndA,&__pyx_mstate_global->__pyx_n_u_cscSortedColPtrA,&__pyx_mstate_global->__pyx_n_u_A,&__pyx_mstate_global->__pyx_n_u_lda,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 2831, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 2831, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 2831, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 2831, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 2831, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 2831, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2831, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2831, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2831, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2831, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "scsc2dense", 0) < (0)) __PYX_ERR(0, 2831, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 9; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("scsc2dense", 1, 9, 9, i); __PYX_ERR(0, 2831, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 9)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2831, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2831, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2831, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2831, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 2831, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 2831, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 2831, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 2831, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 2831, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2832, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2832, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2832, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[3]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2832, __pyx_L3_error)
    __pyx_v_cscSortedValA = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_cscSortedValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2833, __pyx_L3_error)
    __pyx_v_cscSortedRowIndA = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_cscSortedRowIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2833, __pyx_L3_error)
    __pyx_v_cscSortedColPtrA = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_cscSortedColPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2834, __pyx_L3_error)
    __pyx_v_A = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_A == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2834, __pyx_L3_error)
    __pyx_v_lda = __Pyx_PyLong_As_int(values[8]); if (unlikely((__pyx_v_lda == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2834, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("scsc2dense", 1, 9, 9, __pyx_nargs); __PYX_ERR(0, 2831, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.scsc2dense", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_188scsc2dense(__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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_188scsc2dense(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2831, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2831, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":2843
 * 
 * 
 * cpdef void dcsc2dense(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int n, size_t descrA,
 *         size_t cscSortedValA, size_t cscSortedRowIndA,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_191dcsc2dense(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_dcsc2dense(intptr_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;
  __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_backends/cuda/libs/cusparse.pyx":2847
 *         size_t cscSortedValA, size_t cscSortedRowIndA,
 *         size_t cscSortedColPtrA, size_t A, int lda) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     status = cusparseDcsc2dense(
 *         <Handle>handle, m, n, <MatDescr>descrA,
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2847, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":2848
 *         size_t cscSortedColPtrA, size_t A, int lda) except *:
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":2852
 *         <const double *>cscSortedValA, <const int *>cscSortedRowIndA,
 *         <const int *>cscSortedColPtrA, <double *>A, lda)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef void ccsc2dense(
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2852, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":2843
 * 
 * 
 * cpdef void dcsc2dense(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int n, size_t descrA,
 *         size_t cscSortedValA, size_t cscSortedRowIndA,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.dcsc2dense", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_191dcsc2dense(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_190dcsc2dense, "dcsc2dense(intptr_t handle, int m, int n, size_t descrA, size_t cscSortedValA, size_t cscSortedRowIndA, size_t cscSortedColPtrA, size_t A, int lda) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_191dcsc2dense(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dcsc2dense (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_n,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_cscSortedValA,&__pyx_mstate_global->__pyx_n_u_cscSortedRowIndA,&__pyx_mstate_global->__pyx_n_u_cscSortedColPtrA,&__pyx_mstate_global->__pyx_n_u_A,&__pyx_mstate_global->__pyx_n_u_lda,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 2843, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 2843, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 2843, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 2843, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 2843, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 2843, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2843, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2843, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2843, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2843, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "dcsc2dense", 0) < (0)) __PYX_ERR(0, 2843, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 9; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("dcsc2dense", 1, 9, 9, i); __PYX_ERR(0, 2843, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 9)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2843, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2843, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2843, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2843, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 2843, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 2843, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 2843, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 2843, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 2843, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2844, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2844, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2844, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[3]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2844, __pyx_L3_error)
    __pyx_v_cscSortedValA = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_cscSortedValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2845, __pyx_L3_error)
    __pyx_v_cscSortedRowIndA = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_cscSortedRowIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2845, __pyx_L3_error)
    __pyx_v_cscSortedColPtrA = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_cscSortedColPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2846, __pyx_L3_error)
    __pyx_v_A = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_A == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2846, __pyx_L3_error)
    __pyx_v_lda = __Pyx_PyLong_As_int(values[8]); if (unlikely((__pyx_v_lda == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2846, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("dcsc2dense", 1, 9, 9, __pyx_nargs); __PYX_ERR(0, 2843, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.dcsc2dense", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_190dcsc2dense(__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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_190dcsc2dense(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2843, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2843, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":2854
 *     check_status(status)
 * 
 * cpdef void ccsc2dense(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int n, size_t descrA,
 *         size_t cscSortedValA, size_t cscSortedRowIndA,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_193ccsc2dense(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_ccsc2dense(intptr_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;
  __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_backends/cuda/libs/cusparse.pyx":2858
 *         size_t cscSortedValA, size_t cscSortedRowIndA,
 *         size_t cscSortedColPtrA, size_t A, int lda) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     status = cusparseCcsc2dense(
 *         <Handle>handle, m, n, <MatDescr>descrA,
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2858, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":2859
 *         size_t cscSortedColPtrA, size_t A, int lda) except *:
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":2863
 *         <const cuComplex *>cscSortedValA, <const int *>cscSortedRowIndA,
 *         <const int *>cscSortedColPtrA, <cuComplex *>A, lda)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef void zcsc2dense(
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2863, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":2854
 *     check_status(status)
 * 
 * cpdef void ccsc2dense(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int n, size_t descrA,
 *         size_t cscSortedValA, size_t cscSortedRowIndA,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.ccsc2dense", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_193ccsc2dense(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_192ccsc2dense, "ccsc2dense(intptr_t handle, int m, int n, size_t descrA, size_t cscSortedValA, size_t cscSortedRowIndA, size_t cscSortedColPtrA, size_t A, int lda) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_193ccsc2dense(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ccsc2dense (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_n,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_cscSortedValA,&__pyx_mstate_global->__pyx_n_u_cscSortedRowIndA,&__pyx_mstate_global->__pyx_n_u_cscSortedColPtrA,&__pyx_mstate_global->__pyx_n_u_A,&__pyx_mstate_global->__pyx_n_u_lda,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 2854, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 2854, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 2854, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 2854, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 2854, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 2854, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2854, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2854, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2854, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2854, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "ccsc2dense", 0) < (0)) __PYX_ERR(0, 2854, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 9; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("ccsc2dense", 1, 9, 9, i); __PYX_ERR(0, 2854, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 9)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2854, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2854, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2854, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2854, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 2854, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 2854, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 2854, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 2854, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 2854, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2855, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2855, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2855, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[3]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2855, __pyx_L3_error)
    __pyx_v_cscSortedValA = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_cscSortedValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2856, __pyx_L3_error)
    __pyx_v_cscSortedRowIndA = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_cscSortedRowIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2856, __pyx_L3_error)
    __pyx_v_cscSortedColPtrA = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_cscSortedColPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2857, __pyx_L3_error)
    __pyx_v_A = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_A == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2857, __pyx_L3_error)
    __pyx_v_lda = __Pyx_PyLong_As_int(values[8]); if (unlikely((__pyx_v_lda == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2857, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ccsc2dense", 1, 9, 9, __pyx_nargs); __PYX_ERR(0, 2854, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.ccsc2dense", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_192ccsc2dense(__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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_192ccsc2dense(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2854, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2854, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":2865
 *     check_status(status)
 * 
 * cpdef void zcsc2dense(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int n, size_t descrA,
 *         size_t cscSortedValA, size_t cscSortedRowIndA,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_195zcsc2dense(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_zcsc2dense(intptr_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;
  __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_backends/cuda/libs/cusparse.pyx":2869
 *         size_t cscSortedValA, size_t cscSortedRowIndA,
 *         size_t cscSortedColPtrA, size_t A, int lda) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     status = cusparseZcsc2dense(
 *         <Handle>handle, m, n, <MatDescr>descrA,
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2869, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":2870
 *         size_t cscSortedColPtrA, size_t A, int lda) except *:
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":2874
 *         <const cuDoubleComplex *>cscSortedValA, <const int *>cscSortedRowIndA,
 *         <const int *>cscSortedColPtrA, <cuDoubleComplex *>A, lda)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef void xcsr2coo(
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2874, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":2865
 *     check_status(status)
 * 
 * cpdef void zcsc2dense(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int n, size_t descrA,
 *         size_t cscSortedValA, size_t cscSortedRowIndA,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.zcsc2dense", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_195zcsc2dense(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_194zcsc2dense, "zcsc2dense(intptr_t handle, int m, int n, size_t descrA, size_t cscSortedValA, size_t cscSortedRowIndA, size_t cscSortedColPtrA, size_t A, int lda) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_195zcsc2dense(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("zcsc2dense (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_n,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_cscSortedValA,&__pyx_mstate_global->__pyx_n_u_cscSortedRowIndA,&__pyx_mstate_global->__pyx_n_u_cscSortedColPtrA,&__pyx_mstate_global->__pyx_n_u_A,&__pyx_mstate_global->__pyx_n_u_lda,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 2865, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 2865, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 2865, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 2865, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 2865, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 2865, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2865, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2865, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2865, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2865, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "zcsc2dense", 0) < (0)) __PYX_ERR(0, 2865, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 9; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("zcsc2dense", 1, 9, 9, i); __PYX_ERR(0, 2865, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 9)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2865, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2865, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2865, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2865, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 2865, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 2865, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 2865, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 2865, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 2865, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2866, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2866, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2866, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[3]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2866, __pyx_L3_error)
    __pyx_v_cscSortedValA = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_cscSortedValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2867, __pyx_L3_error)
    __pyx_v_cscSortedRowIndA = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_cscSortedRowIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2867, __pyx_L3_error)
    __pyx_v_cscSortedColPtrA = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_cscSortedColPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2868, __pyx_L3_error)
    __pyx_v_A = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_A == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2868, __pyx_L3_error)
    __pyx_v_lda = __Pyx_PyLong_As_int(values[8]); if (unlikely((__pyx_v_lda == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2868, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("zcsc2dense", 1, 9, 9, __pyx_nargs); __PYX_ERR(0, 2865, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.zcsc2dense", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_194zcsc2dense(__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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_194zcsc2dense(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2865, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2865, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":2876
 *     check_status(status)
 * 
 * cpdef void xcsr2coo(             # <<<<<<<<<<<<<<
 *         intptr_t handle, size_t csrRowPtr, int nnz, int m, size_t cooRowInd,
 *         int idxBase) except *:
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_197xcsr2coo(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_xcsr2coo(intptr_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;
  __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_backends/cuda/libs/cusparse.pyx":2879
 *         intptr_t handle, size_t csrRowPtr, int nnz, int m, size_t cooRowInd,
 *         int idxBase) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     status = cusparseXcsr2coo(
 *         <Handle>handle, <const int *>csrRowPtr, nnz, m, <int *>cooRowInd,
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2879, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":2880
 *         int idxBase) except *:
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":2883
 *         <Handle>handle, <const int *>csrRowPtr, nnz, m, <int *>cooRowInd,
 *         <IndexBase>idxBase)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2883, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":2876
 *     check_status(status)
 * 
 * cpdef void xcsr2coo(             # <<<<<<<<<<<<<<
 *         intptr_t handle, size_t csrRowPtr, int nnz, int m, size_t cooRowInd,
 *         int idxBase) except *:
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.xcsr2coo", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_197xcsr2coo(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_196xcsr2coo, "xcsr2coo(intptr_t handle, size_t csrRowPtr, int nnz, int m, size_t cooRowInd, int idxBase) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_197xcsr2coo(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[6] = {0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("xcsr2coo (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_csrRowPtr,&__pyx_mstate_global->__pyx_n_u_nnz,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_cooRowInd,&__pyx_mstate_global->__pyx_n_u_idxBase,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 2876, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 2876, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 2876, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2876, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2876, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2876, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2876, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "xcsr2coo", 0) < (0)) __PYX_ERR(0, 2876, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 6; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("xcsr2coo", 1, 6, 6, i); __PYX_ERR(0, 2876, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 6)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2876, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2876, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2876, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2876, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 2876, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 2876, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2877, __pyx_L3_error)
    __pyx_v_csrRowPtr = __Pyx_PyLong_As_size_t(values[1]); if (unlikely((__pyx_v_csrRowPtr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2877, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2877, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[3]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2877, __pyx_L3_error)
    __pyx_v_cooRowInd = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_cooRowInd == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2877, __pyx_L3_error)
    __pyx_v_idxBase = __Pyx_PyLong_As_int(values[5]); if (unlikely((__pyx_v_idxBase == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2878, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("xcsr2coo", 1, 6, 6, __pyx_nargs); __PYX_ERR(0, 2876, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.xcsr2coo", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_196xcsr2coo(__pyx_self, __pyx_v_handle, __pyx_v_csrRowPtr, __pyx_v_nnz, __pyx_v_m, __pyx_v_cooRowInd, __pyx_v_idxBase);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_196xcsr2coo(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_f_13cupy_backends_4cuda_4libs_8cusparse_xcsr2coo(__pyx_v_handle, __pyx_v_csrRowPtr, __pyx_v_nnz, __pyx_v_m, __pyx_v_cooRowInd, __pyx_v_idxBase, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2876, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2876, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":2886
 * 
 * 
 * cpdef void scsr2csc(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int n, int nnz, size_t csrVal,
 *         size_t csrRowPtr, size_t csrColInd, size_t cscVal,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_199scsr2csc(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_scsr2csc(intptr_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;
  __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_backends/cuda/libs/cusparse.pyx":2891
 *         size_t cscRowInd, size_t cscColPtr, int copyValues,
 *         int idxBase) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     status = cusparseScsr2csc(
 *         <Handle>handle, m, n, nnz, <const float *>csrVal,
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2891, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":2892
 *         int idxBase) except *:
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":2897
 *         <int *>cscRowInd, <int *>cscColPtr, <Action>copyValues,
 *         <IndexBase>idxBase)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2897, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":2886
 * 
 * 
 * cpdef void scsr2csc(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int n, int nnz, size_t csrVal,
 *         size_t csrRowPtr, size_t csrColInd, size_t cscVal,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.scsr2csc", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_199scsr2csc(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_198scsr2csc, "scsr2csc(intptr_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) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_199scsr2csc(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[12] = {0,0,0,0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("scsr2csc (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_n,&__pyx_mstate_global->__pyx_n_u_nnz,&__pyx_mstate_global->__pyx_n_u_csrVal,&__pyx_mstate_global->__pyx_n_u_csrRowPtr,&__pyx_mstate_global->__pyx_n_u_csrColInd,&__pyx_mstate_global->__pyx_n_u_cscVal,&__pyx_mstate_global->__pyx_n_u_cscRowInd,&__pyx_mstate_global->__pyx_n_u_cscColPtr,&__pyx_mstate_global->__pyx_n_u_copyValues,&__pyx_mstate_global->__pyx_n_u_idxBase,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 2886, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 12:
        values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 2886, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 11:
        values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 2886, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 2886, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 2886, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 2886, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 2886, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 2886, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 2886, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2886, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2886, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2886, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2886, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "scsr2csc", 0) < (0)) __PYX_ERR(0, 2886, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 12; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("scsr2csc", 1, 12, 12, i); __PYX_ERR(0, 2886, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 12)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2886, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2886, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2886, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2886, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 2886, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 2886, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 2886, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 2886, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 2886, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 2886, __pyx_L3_error)
      values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 2886, __pyx_L3_error)
      values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 2886, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2887, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2887, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2887, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyLong_As_int(values[3]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2887, __pyx_L3_error)
    __pyx_v_csrVal = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_csrVal == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2887, __pyx_L3_error)
    __pyx_v_csrRowPtr = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_csrRowPtr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2888, __pyx_L3_error)
    __pyx_v_csrColInd = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_csrColInd == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2888, __pyx_L3_error)
    __pyx_v_cscVal = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_cscVal == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2888, __pyx_L3_error)
    __pyx_v_cscRowInd = __Pyx_PyLong_As_size_t(values[8]); if (unlikely((__pyx_v_cscRowInd == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2889, __pyx_L3_error)
    __pyx_v_cscColPtr = __Pyx_PyLong_As_size_t(values[9]); if (unlikely((__pyx_v_cscColPtr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2889, __pyx_L3_error)
    __pyx_v_copyValues = __Pyx_PyLong_As_int(values[10]); if (unlikely((__pyx_v_copyValues == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2889, __pyx_L3_error)
    __pyx_v_idxBase = __Pyx_PyLong_As_int(values[11]); if (unlikely((__pyx_v_idxBase == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2890, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("scsr2csc", 1, 12, 12, __pyx_nargs); __PYX_ERR(0, 2886, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.scsr2csc", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_198scsr2csc(__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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_198scsr2csc(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2886, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2886, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":2900
 * 
 * 
 * cpdef void dcsr2csc(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int n, int nnz, size_t csrVal,
 *         size_t csrRowPtr, size_t csrColInd, size_t cscVal,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_201dcsr2csc(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_dcsr2csc(intptr_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;
  __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_backends/cuda/libs/cusparse.pyx":2905
 *         size_t cscRowInd, size_t cscColPtr, int copyValues,
 *         int idxBase) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     status = cusparseDcsr2csc(
 *         <Handle>handle, m, n, nnz, <const double *>csrVal,
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2905, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":2906
 *         int idxBase) except *:
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":2911
 *         <int *>cscRowInd, <int *>cscColPtr, <Action>copyValues,
 *         <IndexBase>idxBase)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef void ccsr2csc(
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2911, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":2900
 * 
 * 
 * cpdef void dcsr2csc(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int n, int nnz, size_t csrVal,
 *         size_t csrRowPtr, size_t csrColInd, size_t cscVal,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.dcsr2csc", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_201dcsr2csc(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_200dcsr2csc, "dcsr2csc(intptr_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) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_201dcsr2csc(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[12] = {0,0,0,0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dcsr2csc (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_n,&__pyx_mstate_global->__pyx_n_u_nnz,&__pyx_mstate_global->__pyx_n_u_csrVal,&__pyx_mstate_global->__pyx_n_u_csrRowPtr,&__pyx_mstate_global->__pyx_n_u_csrColInd,&__pyx_mstate_global->__pyx_n_u_cscVal,&__pyx_mstate_global->__pyx_n_u_cscRowInd,&__pyx_mstate_global->__pyx_n_u_cscColPtr,&__pyx_mstate_global->__pyx_n_u_copyValues,&__pyx_mstate_global->__pyx_n_u_idxBase,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 2900, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 12:
        values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 2900, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 11:
        values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 2900, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 2900, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 2900, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 2900, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 2900, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 2900, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 2900, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2900, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2900, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2900, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2900, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "dcsr2csc", 0) < (0)) __PYX_ERR(0, 2900, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 12; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("dcsr2csc", 1, 12, 12, i); __PYX_ERR(0, 2900, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 12)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2900, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2900, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2900, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2900, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 2900, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 2900, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 2900, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 2900, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 2900, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 2900, __pyx_L3_error)
      values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 2900, __pyx_L3_error)
      values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 2900, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2901, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2901, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2901, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyLong_As_int(values[3]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2901, __pyx_L3_error)
    __pyx_v_csrVal = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_csrVal == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2901, __pyx_L3_error)
    __pyx_v_csrRowPtr = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_csrRowPtr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2902, __pyx_L3_error)
    __pyx_v_csrColInd = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_csrColInd == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2902, __pyx_L3_error)
    __pyx_v_cscVal = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_cscVal == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2902, __pyx_L3_error)
    __pyx_v_cscRowInd = __Pyx_PyLong_As_size_t(values[8]); if (unlikely((__pyx_v_cscRowInd == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2903, __pyx_L3_error)
    __pyx_v_cscColPtr = __Pyx_PyLong_As_size_t(values[9]); if (unlikely((__pyx_v_cscColPtr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2903, __pyx_L3_error)
    __pyx_v_copyValues = __Pyx_PyLong_As_int(values[10]); if (unlikely((__pyx_v_copyValues == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2903, __pyx_L3_error)
    __pyx_v_idxBase = __Pyx_PyLong_As_int(values[11]); if (unlikely((__pyx_v_idxBase == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2904, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("dcsr2csc", 1, 12, 12, __pyx_nargs); __PYX_ERR(0, 2900, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.dcsr2csc", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_200dcsr2csc(__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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_200dcsr2csc(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2900, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2900, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":2913
 *     check_status(status)
 * 
 * cpdef void ccsr2csc(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int n, int nnz, size_t csrVal,
 *         size_t csrRowPtr, size_t csrColInd, size_t cscVal,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_203ccsr2csc(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_ccsr2csc(intptr_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;
  __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_backends/cuda/libs/cusparse.pyx":2918
 *         size_t cscRowInd, size_t cscColPtr, int copyValues,
 *         int idxBase) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     status = cusparseCcsr2csc(
 *         <Handle>handle, m, n, nnz, <const cuComplex *>csrVal,
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2918, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":2919
 *         int idxBase) except *:
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":2924
 *         <int *>cscRowInd, <int *>cscColPtr, <Action>copyValues,
 *         <IndexBase>idxBase)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef void zcsr2csc(
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2924, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":2913
 *     check_status(status)
 * 
 * cpdef void ccsr2csc(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int n, int nnz, size_t csrVal,
 *         size_t csrRowPtr, size_t csrColInd, size_t cscVal,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.ccsr2csc", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_203ccsr2csc(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_202ccsr2csc, "ccsr2csc(intptr_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) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_203ccsr2csc(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[12] = {0,0,0,0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ccsr2csc (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_n,&__pyx_mstate_global->__pyx_n_u_nnz,&__pyx_mstate_global->__pyx_n_u_csrVal,&__pyx_mstate_global->__pyx_n_u_csrRowPtr,&__pyx_mstate_global->__pyx_n_u_csrColInd,&__pyx_mstate_global->__pyx_n_u_cscVal,&__pyx_mstate_global->__pyx_n_u_cscRowInd,&__pyx_mstate_global->__pyx_n_u_cscColPtr,&__pyx_mstate_global->__pyx_n_u_copyValues,&__pyx_mstate_global->__pyx_n_u_idxBase,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 2913, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 12:
        values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 2913, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 11:
        values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 2913, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 2913, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 2913, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 2913, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 2913, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 2913, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 2913, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2913, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2913, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2913, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2913, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "ccsr2csc", 0) < (0)) __PYX_ERR(0, 2913, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 12; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("ccsr2csc", 1, 12, 12, i); __PYX_ERR(0, 2913, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 12)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2913, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2913, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2913, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2913, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 2913, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 2913, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 2913, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 2913, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 2913, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 2913, __pyx_L3_error)
      values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 2913, __pyx_L3_error)
      values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 2913, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2914, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2914, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2914, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyLong_As_int(values[3]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2914, __pyx_L3_error)
    __pyx_v_csrVal = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_csrVal == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2914, __pyx_L3_error)
    __pyx_v_csrRowPtr = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_csrRowPtr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2915, __pyx_L3_error)
    __pyx_v_csrColInd = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_csrColInd == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2915, __pyx_L3_error)
    __pyx_v_cscVal = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_cscVal == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2915, __pyx_L3_error)
    __pyx_v_cscRowInd = __Pyx_PyLong_As_size_t(values[8]); if (unlikely((__pyx_v_cscRowInd == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2916, __pyx_L3_error)
    __pyx_v_cscColPtr = __Pyx_PyLong_As_size_t(values[9]); if (unlikely((__pyx_v_cscColPtr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2916, __pyx_L3_error)
    __pyx_v_copyValues = __Pyx_PyLong_As_int(values[10]); if (unlikely((__pyx_v_copyValues == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2916, __pyx_L3_error)
    __pyx_v_idxBase = __Pyx_PyLong_As_int(values[11]); if (unlikely((__pyx_v_idxBase == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2917, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ccsr2csc", 1, 12, 12, __pyx_nargs); __PYX_ERR(0, 2913, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.ccsr2csc", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_202ccsr2csc(__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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_202ccsr2csc(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2913, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2913, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":2926
 *     check_status(status)
 * 
 * cpdef void zcsr2csc(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int n, int nnz, size_t csrVal,
 *         size_t csrRowPtr, size_t csrColInd, size_t cscVal,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_205zcsr2csc(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_zcsr2csc(intptr_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;
  __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_backends/cuda/libs/cusparse.pyx":2931
 *         size_t cscRowInd, size_t cscColPtr, int copyValues,
 *         int idxBase) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     status = cusparseZcsr2csc(
 *         <Handle>handle, m, n, nnz, <const cuDoubleComplex *>csrVal,
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2931, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":2932
 *         int idxBase) except *:
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":2938
 *         <int *>cscRowInd, <int *>cscColPtr, <Action>copyValues,
 *         <IndexBase>idxBase)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef void scsr2dense(
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2938, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":2926
 *     check_status(status)
 * 
 * cpdef void zcsr2csc(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int n, int nnz, size_t csrVal,
 *         size_t csrRowPtr, size_t csrColInd, size_t cscVal,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.zcsr2csc", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_205zcsr2csc(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_204zcsr2csc, "zcsr2csc(intptr_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) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_205zcsr2csc(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[12] = {0,0,0,0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("zcsr2csc (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_n,&__pyx_mstate_global->__pyx_n_u_nnz,&__pyx_mstate_global->__pyx_n_u_csrVal,&__pyx_mstate_global->__pyx_n_u_csrRowPtr,&__pyx_mstate_global->__pyx_n_u_csrColInd,&__pyx_mstate_global->__pyx_n_u_cscVal,&__pyx_mstate_global->__pyx_n_u_cscRowInd,&__pyx_mstate_global->__pyx_n_u_cscColPtr,&__pyx_mstate_global->__pyx_n_u_copyValues,&__pyx_mstate_global->__pyx_n_u_idxBase,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 2926, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 12:
        values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 2926, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 11:
        values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 2926, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 2926, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 2926, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 2926, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 2926, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 2926, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 2926, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2926, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2926, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2926, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2926, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "zcsr2csc", 0) < (0)) __PYX_ERR(0, 2926, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 12; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("zcsr2csc", 1, 12, 12, i); __PYX_ERR(0, 2926, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 12)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2926, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2926, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2926, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2926, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 2926, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 2926, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 2926, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 2926, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 2926, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 2926, __pyx_L3_error)
      values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 2926, __pyx_L3_error)
      values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 2926, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2927, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2927, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2927, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyLong_As_int(values[3]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2927, __pyx_L3_error)
    __pyx_v_csrVal = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_csrVal == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2927, __pyx_L3_error)
    __pyx_v_csrRowPtr = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_csrRowPtr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2928, __pyx_L3_error)
    __pyx_v_csrColInd = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_csrColInd == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2928, __pyx_L3_error)
    __pyx_v_cscVal = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_cscVal == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2928, __pyx_L3_error)
    __pyx_v_cscRowInd = __Pyx_PyLong_As_size_t(values[8]); if (unlikely((__pyx_v_cscRowInd == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2929, __pyx_L3_error)
    __pyx_v_cscColPtr = __Pyx_PyLong_As_size_t(values[9]); if (unlikely((__pyx_v_cscColPtr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2929, __pyx_L3_error)
    __pyx_v_copyValues = __Pyx_PyLong_As_int(values[10]); if (unlikely((__pyx_v_copyValues == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2929, __pyx_L3_error)
    __pyx_v_idxBase = __Pyx_PyLong_As_int(values[11]); if (unlikely((__pyx_v_idxBase == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2930, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("zcsr2csc", 1, 12, 12, __pyx_nargs); __PYX_ERR(0, 2926, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.zcsr2csc", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_204zcsr2csc(__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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_204zcsr2csc(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2926, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2926, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":2940
 *     check_status(status)
 * 
 * cpdef void scsr2dense(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int n, size_t descrA,
 *         size_t csrSortedValA, size_t csrSortedRowPtrA,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_207scsr2dense(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_scsr2dense(intptr_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;
  __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_backends/cuda/libs/cusparse.pyx":2944
 *         size_t csrSortedValA, size_t csrSortedRowPtrA,
 *         size_t csrSortedColIndA, size_t A, int lda) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     status = cusparseScsr2dense(
 *         <Handle>handle, m, n, <MatDescr>descrA,
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2944, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":2945
 *         size_t csrSortedColIndA, size_t A, int lda) except *:
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":2949
 *         <const float *>csrSortedValA, <const int *>csrSortedRowPtrA,
 *         <const int *>csrSortedColIndA, <float *>A, lda)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef void dcsr2dense(
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_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_backends/cuda/libs/cusparse.pyx":2940
 *     check_status(status)
 * 
 * cpdef void scsr2dense(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int n, size_t descrA,
 *         size_t csrSortedValA, size_t csrSortedRowPtrA,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.scsr2dense", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_207scsr2dense(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_206scsr2dense, "scsr2dense(intptr_t handle, int m, int n, size_t descrA, size_t csrSortedValA, size_t csrSortedRowPtrA, size_t csrSortedColIndA, size_t A, int lda) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_207scsr2dense(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("scsr2dense (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_n,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_csrSortedValA,&__pyx_mstate_global->__pyx_n_u_csrSortedRowPtrA,&__pyx_mstate_global->__pyx_n_u_csrSortedColIndA,&__pyx_mstate_global->__pyx_n_u_A,&__pyx_mstate_global->__pyx_n_u_lda,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 2940, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 2940, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 2940, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 2940, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 2940, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 2940, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2940, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2940, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2940, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2940, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "scsr2dense", 0) < (0)) __PYX_ERR(0, 2940, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 9; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("scsr2dense", 1, 9, 9, i); __PYX_ERR(0, 2940, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 9)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2940, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2940, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2940, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2940, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 2940, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 2940, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 2940, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 2940, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 2940, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2941, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2941, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2941, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[3]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2941, __pyx_L3_error)
    __pyx_v_csrSortedValA = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_csrSortedValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2942, __pyx_L3_error)
    __pyx_v_csrSortedRowPtrA = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_csrSortedRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2942, __pyx_L3_error)
    __pyx_v_csrSortedColIndA = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_csrSortedColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2943, __pyx_L3_error)
    __pyx_v_A = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_A == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2943, __pyx_L3_error)
    __pyx_v_lda = __Pyx_PyLong_As_int(values[8]); if (unlikely((__pyx_v_lda == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2943, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("scsr2dense", 1, 9, 9, __pyx_nargs); __PYX_ERR(0, 2940, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.scsr2dense", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_206scsr2dense(__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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_206scsr2dense(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2940, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2940, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":2951
 *     check_status(status)
 * 
 * cpdef void dcsr2dense(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int n, size_t descrA,
 *         size_t csrSortedValA, size_t csrSortedRowPtrA,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_209dcsr2dense(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_dcsr2dense(intptr_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;
  __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_backends/cuda/libs/cusparse.pyx":2955
 *         size_t csrSortedValA, size_t csrSortedRowPtrA,
 *         size_t csrSortedColIndA, size_t A, int lda) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     status = cusparseDcsr2dense(
 *         <Handle>handle, m, n, <MatDescr>descrA,
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2955, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":2956
 *         size_t csrSortedColIndA, size_t A, int lda) except *:
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":2960
 *         <const double *>csrSortedValA, <const int *>csrSortedRowPtrA,
 *         <const int *>csrSortedColIndA, <double *>A, lda)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef void ccsr2dense(
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2960, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":2951
 *     check_status(status)
 * 
 * cpdef void dcsr2dense(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int n, size_t descrA,
 *         size_t csrSortedValA, size_t csrSortedRowPtrA,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.dcsr2dense", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_209dcsr2dense(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_208dcsr2dense, "dcsr2dense(intptr_t handle, int m, int n, size_t descrA, size_t csrSortedValA, size_t csrSortedRowPtrA, size_t csrSortedColIndA, size_t A, int lda) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_209dcsr2dense(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dcsr2dense (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_n,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_csrSortedValA,&__pyx_mstate_global->__pyx_n_u_csrSortedRowPtrA,&__pyx_mstate_global->__pyx_n_u_csrSortedColIndA,&__pyx_mstate_global->__pyx_n_u_A,&__pyx_mstate_global->__pyx_n_u_lda,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 2951, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 2951, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 2951, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 2951, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 2951, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 2951, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2951, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2951, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2951, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2951, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "dcsr2dense", 0) < (0)) __PYX_ERR(0, 2951, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 9; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("dcsr2dense", 1, 9, 9, i); __PYX_ERR(0, 2951, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 9)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2951, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2951, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2951, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2951, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 2951, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 2951, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 2951, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 2951, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 2951, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2952, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2952, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2952, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[3]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2952, __pyx_L3_error)
    __pyx_v_csrSortedValA = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_csrSortedValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2953, __pyx_L3_error)
    __pyx_v_csrSortedRowPtrA = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_csrSortedRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2953, __pyx_L3_error)
    __pyx_v_csrSortedColIndA = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_csrSortedColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2954, __pyx_L3_error)
    __pyx_v_A = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_A == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2954, __pyx_L3_error)
    __pyx_v_lda = __Pyx_PyLong_As_int(values[8]); if (unlikely((__pyx_v_lda == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2954, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("dcsr2dense", 1, 9, 9, __pyx_nargs); __PYX_ERR(0, 2951, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.dcsr2dense", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_208dcsr2dense(__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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_208dcsr2dense(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2951, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2951, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":2962
 *     check_status(status)
 * 
 * cpdef void ccsr2dense(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int n, size_t descrA,
 *         size_t csrSortedValA, size_t csrSortedRowPtrA,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_211ccsr2dense(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_ccsr2dense(intptr_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;
  __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_backends/cuda/libs/cusparse.pyx":2966
 *         size_t csrSortedValA, size_t csrSortedRowPtrA,
 *         size_t csrSortedColIndA, size_t A, int lda) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     status = cusparseCcsr2dense(
 *         <Handle>handle, m, n, <MatDescr>descrA,
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2966, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":2967
 *         size_t csrSortedColIndA, size_t A, int lda) except *:
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":2971
 *         <const cuComplex *>csrSortedValA, <const int *>csrSortedRowPtrA,
 *         <const int *>csrSortedColIndA, <cuComplex *>A, lda)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef void zcsr2dense(
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2971, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":2962
 *     check_status(status)
 * 
 * cpdef void ccsr2dense(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int n, size_t descrA,
 *         size_t csrSortedValA, size_t csrSortedRowPtrA,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.ccsr2dense", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_211ccsr2dense(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_210ccsr2dense, "ccsr2dense(intptr_t handle, int m, int n, size_t descrA, size_t csrSortedValA, size_t csrSortedRowPtrA, size_t csrSortedColIndA, size_t A, int lda) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_211ccsr2dense(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ccsr2dense (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_n,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_csrSortedValA,&__pyx_mstate_global->__pyx_n_u_csrSortedRowPtrA,&__pyx_mstate_global->__pyx_n_u_csrSortedColIndA,&__pyx_mstate_global->__pyx_n_u_A,&__pyx_mstate_global->__pyx_n_u_lda,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 2962, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 2962, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 2962, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 2962, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 2962, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 2962, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2962, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2962, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2962, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2962, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "ccsr2dense", 0) < (0)) __PYX_ERR(0, 2962, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 9; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("ccsr2dense", 1, 9, 9, i); __PYX_ERR(0, 2962, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 9)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2962, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2962, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2962, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2962, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 2962, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 2962, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 2962, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 2962, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 2962, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2963, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2963, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2963, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[3]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2963, __pyx_L3_error)
    __pyx_v_csrSortedValA = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_csrSortedValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2964, __pyx_L3_error)
    __pyx_v_csrSortedRowPtrA = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_csrSortedRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2964, __pyx_L3_error)
    __pyx_v_csrSortedColIndA = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_csrSortedColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2965, __pyx_L3_error)
    __pyx_v_A = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_A == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2965, __pyx_L3_error)
    __pyx_v_lda = __Pyx_PyLong_As_int(values[8]); if (unlikely((__pyx_v_lda == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2965, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ccsr2dense", 1, 9, 9, __pyx_nargs); __PYX_ERR(0, 2962, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.ccsr2dense", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_210ccsr2dense(__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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_210ccsr2dense(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2962, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2962, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":2973
 *     check_status(status)
 * 
 * cpdef void zcsr2dense(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int n, size_t descrA,
 *         size_t csrSortedValA, size_t csrSortedRowPtrA,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_213zcsr2dense(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_zcsr2dense(intptr_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;
  __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_backends/cuda/libs/cusparse.pyx":2977
 *         size_t csrSortedValA, size_t csrSortedRowPtrA,
 *         size_t csrSortedColIndA, size_t A, int lda) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     status = cusparseZcsr2dense(
 *         <Handle>handle, m, n, <MatDescr>descrA,
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2977, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":2978
 *         size_t csrSortedColIndA, size_t A, int lda) except *:
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":2982
 *         <const cuDoubleComplex *>csrSortedValA, <const int *>csrSortedRowPtrA,
 *         <const int *>csrSortedColIndA, <cuDoubleComplex *>A, lda)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef int snnz_compress(
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2982, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":2973
 *     check_status(status)
 * 
 * cpdef void zcsr2dense(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int n, size_t descrA,
 *         size_t csrSortedValA, size_t csrSortedRowPtrA,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.zcsr2dense", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_213zcsr2dense(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_212zcsr2dense, "zcsr2dense(intptr_t handle, int m, int n, size_t descrA, size_t csrSortedValA, size_t csrSortedRowPtrA, size_t csrSortedColIndA, size_t A, int lda) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_213zcsr2dense(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("zcsr2dense (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_n,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_csrSortedValA,&__pyx_mstate_global->__pyx_n_u_csrSortedRowPtrA,&__pyx_mstate_global->__pyx_n_u_csrSortedColIndA,&__pyx_mstate_global->__pyx_n_u_A,&__pyx_mstate_global->__pyx_n_u_lda,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 2973, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 2973, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 2973, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 2973, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 2973, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 2973, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2973, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2973, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2973, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2973, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "zcsr2dense", 0) < (0)) __PYX_ERR(0, 2973, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 9; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("zcsr2dense", 1, 9, 9, i); __PYX_ERR(0, 2973, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 9)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2973, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2973, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2973, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2973, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 2973, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 2973, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 2973, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 2973, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 2973, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2974, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2974, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2974, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[3]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2974, __pyx_L3_error)
    __pyx_v_csrSortedValA = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_csrSortedValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2975, __pyx_L3_error)
    __pyx_v_csrSortedRowPtrA = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_csrSortedRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2975, __pyx_L3_error)
    __pyx_v_csrSortedColIndA = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_csrSortedColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2976, __pyx_L3_error)
    __pyx_v_A = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_A == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2976, __pyx_L3_error)
    __pyx_v_lda = __Pyx_PyLong_As_int(values[8]); if (unlikely((__pyx_v_lda == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2976, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("zcsr2dense", 1, 9, 9, __pyx_nargs); __PYX_ERR(0, 2973, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.zcsr2dense", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_212zcsr2dense(__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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_212zcsr2dense(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2973, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2973, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":2984
 *     check_status(status)
 * 
 * cpdef int snnz_compress(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, size_t descr,
 *         size_t values, size_t rowPtr, size_t nnzPerRow,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_215snnz_compress(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static int __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_snnz_compress(intptr_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;
  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("snnz_compress", 0);

  /* "cupy_backends/cuda/libs/cusparse.pyx":2989
 *         float tol) except? -1:
 *     cdef int nnz_total
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     status = cusparseSnnz_compress(
 *         <Handle>handle, m, <const MatDescr>descr,
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2989, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":2990
 *     cdef int nnz_total
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":2994
 *         <const float *>values, <const int *>rowPtr, <int *>nnzPerRow,
 *         &nnz_total, tol)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return nnz_total
 * 
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_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_backends/cuda/libs/cusparse.pyx":2995
 *         &nnz_total, tol)
 *     check_status(status)
 *     return nnz_total             # <<<<<<<<<<<<<<
 * 
 * cpdef int dnnz_compress(
*/
  __pyx_r = __pyx_v_nnz_total;
  goto __pyx_L0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":2984
 *     check_status(status)
 * 
 * cpdef int snnz_compress(             # <<<<<<<<<<<<<<
 *         intptr_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_backends.cuda.libs.cusparse.snnz_compress", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_215snnz_compress(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_214snnz_compress, "snnz_compress(intptr_t handle, int m, size_t descr, size_t values, size_t rowPtr, size_t nnzPerRow, float tol) -> int");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_215snnz_compress(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[7] = {0,0,0,0,0,0,0};
  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);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_descr,&__pyx_mstate_global->__pyx_n_u_values,&__pyx_mstate_global->__pyx_n_u_rowPtr,&__pyx_mstate_global->__pyx_n_u_nnzPerRow,&__pyx_mstate_global->__pyx_n_u_tol,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 2984, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 2984, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 2984, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 2984, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2984, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2984, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2984, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2984, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "snnz_compress", 0) < (0)) __PYX_ERR(0, 2984, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 7; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("snnz_compress", 1, 7, 7, i); __PYX_ERR(0, 2984, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 7)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2984, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2984, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2984, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2984, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 2984, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 2984, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 2984, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2985, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2985, __pyx_L3_error)
    __pyx_v_descr = __Pyx_PyLong_As_size_t(values[2]); if (unlikely((__pyx_v_descr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2985, __pyx_L3_error)
    __pyx_v_values = __Pyx_PyLong_As_size_t(values[3]); if (unlikely((__pyx_v_values == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2986, __pyx_L3_error)
    __pyx_v_rowPtr = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_rowPtr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2986, __pyx_L3_error)
    __pyx_v_nnzPerRow = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_nnzPerRow == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2986, __pyx_L3_error)
    __pyx_v_tol = __Pyx_PyFloat_AsFloat(values[6]); if (unlikely((__pyx_v_tol == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 2987, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("snnz_compress", 1, 7, 7, __pyx_nargs); __PYX_ERR(0, 2984, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.snnz_compress", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_214snnz_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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_214snnz_compress(CYTHON_UNUSED PyObject *__pyx_self, intptr_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
  int __pyx_t_1;
  PyObject *__pyx_t_2 = 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_13cupy_backends_4cuda_4libs_8cusparse_snnz_compress(__pyx_v_handle, __pyx_v_m, __pyx_v_descr, __pyx_v_values, __pyx_v_rowPtr, __pyx_v_nnzPerRow, __pyx_v_tol, 1); if (unlikely(__pyx_t_1 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2984, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2984, __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_backends.cuda.libs.cusparse.snnz_compress", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy_backends/cuda/libs/cusparse.pyx":2997
 *     return nnz_total
 * 
 * cpdef int dnnz_compress(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, size_t descr,
 *         size_t values, size_t rowPtr, size_t nnzPerRow,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_217dnnz_compress(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static int __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_dnnz_compress(intptr_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;
  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("dnnz_compress", 0);

  /* "cupy_backends/cuda/libs/cusparse.pyx":3002
 *         double tol) except? -1:
 *     cdef int nnz_total
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     status = cusparseDnnz_compress(
 *         <Handle>handle, m, <const MatDescr>descr,
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3002, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":3003
 *     cdef int nnz_total
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":3007
 *         <const double *>values, <const int *>rowPtr, <int *>nnzPerRow,
 *         &nnz_total, tol)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return nnz_total
 * 
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3007, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":3008
 *         &nnz_total, tol)
 *     check_status(status)
 *     return nnz_total             # <<<<<<<<<<<<<<
 * 
 * cpdef int cnnz_compress(
*/
  __pyx_r = __pyx_v_nnz_total;
  goto __pyx_L0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":2997
 *     return nnz_total
 * 
 * cpdef int dnnz_compress(             # <<<<<<<<<<<<<<
 *         intptr_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_backends.cuda.libs.cusparse.dnnz_compress", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_217dnnz_compress(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_216dnnz_compress, "dnnz_compress(intptr_t handle, int m, size_t descr, size_t values, size_t rowPtr, size_t nnzPerRow, double tol) -> int");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_217dnnz_compress(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[7] = {0,0,0,0,0,0,0};
  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);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_descr,&__pyx_mstate_global->__pyx_n_u_values,&__pyx_mstate_global->__pyx_n_u_rowPtr,&__pyx_mstate_global->__pyx_n_u_nnzPerRow,&__pyx_mstate_global->__pyx_n_u_tol,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 2997, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 2997, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 2997, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 2997, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2997, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2997, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2997, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2997, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "dnnz_compress", 0) < (0)) __PYX_ERR(0, 2997, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 7; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("dnnz_compress", 1, 7, 7, i); __PYX_ERR(0, 2997, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 7)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2997, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2997, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2997, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2997, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 2997, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 2997, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 2997, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2998, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2998, __pyx_L3_error)
    __pyx_v_descr = __Pyx_PyLong_As_size_t(values[2]); if (unlikely((__pyx_v_descr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2998, __pyx_L3_error)
    __pyx_v_values = __Pyx_PyLong_As_size_t(values[3]); if (unlikely((__pyx_v_values == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2999, __pyx_L3_error)
    __pyx_v_rowPtr = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_rowPtr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2999, __pyx_L3_error)
    __pyx_v_nnzPerRow = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_nnzPerRow == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2999, __pyx_L3_error)
    __pyx_v_tol = __Pyx_PyFloat_AsDouble(values[6]); if (unlikely((__pyx_v_tol == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 3000, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("dnnz_compress", 1, 7, 7, __pyx_nargs); __PYX_ERR(0, 2997, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.dnnz_compress", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_216dnnz_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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_216dnnz_compress(CYTHON_UNUSED PyObject *__pyx_self, intptr_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
  int __pyx_t_1;
  PyObject *__pyx_t_2 = 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_13cupy_backends_4cuda_4libs_8cusparse_dnnz_compress(__pyx_v_handle, __pyx_v_m, __pyx_v_descr, __pyx_v_values, __pyx_v_rowPtr, __pyx_v_nnzPerRow, __pyx_v_tol, 1); if (unlikely(__pyx_t_1 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2997, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2997, __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_backends.cuda.libs.cusparse.dnnz_compress", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy_backends/cuda/libs/cusparse.pyx":3010
 *     return nnz_total
 * 
 * cpdef int cnnz_compress(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, size_t descr,
 *         size_t values, size_t rowPtr, size_t nnzPerRow,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_219cnnz_compress(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static int __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_cnnz_compress(intptr_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;
  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("cnnz_compress", 0);

  /* "cupy_backends/cuda/libs/cusparse.pyx":3015
 *         complex tol) except? -1:
 *     cdef int nnz_total
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     status = cusparseCnnz_compress(
 *         <Handle>handle, m, <const MatDescr>descr,
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3015, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":3016
 *     cdef int nnz_total
 *     _setStream(handle)
 *     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_13cupy_backends_4cuda_4libs_8cusparse_complex_to_cuda(__pyx_v_tol));

  /* "cupy_backends/cuda/libs/cusparse.pyx":3020
 *         <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_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3020, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":3021
 *         &nnz_total, complex_to_cuda(tol))
 *     check_status(status)
 *     return nnz_total             # <<<<<<<<<<<<<<
 * 
 * cpdef int znnz_compress(
*/
  __pyx_r = __pyx_v_nnz_total;
  goto __pyx_L0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":3010
 *     return nnz_total
 * 
 * cpdef int cnnz_compress(             # <<<<<<<<<<<<<<
 *         intptr_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_backends.cuda.libs.cusparse.cnnz_compress", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_219cnnz_compress(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_218cnnz_compress, "cnnz_compress(intptr_t handle, int m, size_t descr, size_t values, size_t rowPtr, size_t nnzPerRow, double complex tol) -> int");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_219cnnz_compress(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[7] = {0,0,0,0,0,0,0};
  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);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_descr,&__pyx_mstate_global->__pyx_n_u_values,&__pyx_mstate_global->__pyx_n_u_rowPtr,&__pyx_mstate_global->__pyx_n_u_nnzPerRow,&__pyx_mstate_global->__pyx_n_u_tol,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 3010, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 3010, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 3010, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3010, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3010, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3010, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3010, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3010, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "cnnz_compress", 0) < (0)) __PYX_ERR(0, 3010, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 7; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("cnnz_compress", 1, 7, 7, i); __PYX_ERR(0, 3010, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 7)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3010, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3010, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3010, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3010, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3010, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 3010, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 3010, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3011, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3011, __pyx_L3_error)
    __pyx_v_descr = __Pyx_PyLong_As_size_t(values[2]); if (unlikely((__pyx_v_descr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3011, __pyx_L3_error)
    __pyx_v_values = __Pyx_PyLong_As_size_t(values[3]); if (unlikely((__pyx_v_values == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3012, __pyx_L3_error)
    __pyx_v_rowPtr = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_rowPtr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3012, __pyx_L3_error)
    __pyx_v_nnzPerRow = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_nnzPerRow == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3012, __pyx_L3_error)
    __pyx_v_tol = __Pyx_PyComplex_As___pyx_t_double_complex(values[6]); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3013, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("cnnz_compress", 1, 7, 7, __pyx_nargs); __PYX_ERR(0, 3010, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.cnnz_compress", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_218cnnz_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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_218cnnz_compress(CYTHON_UNUSED PyObject *__pyx_self, intptr_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
  int __pyx_t_1;
  PyObject *__pyx_t_2 = 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_13cupy_backends_4cuda_4libs_8cusparse_cnnz_compress(__pyx_v_handle, __pyx_v_m, __pyx_v_descr, __pyx_v_values, __pyx_v_rowPtr, __pyx_v_nnzPerRow, __pyx_v_tol, 1); if (unlikely(__pyx_t_1 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3010, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3010, __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_backends.cuda.libs.cusparse.cnnz_compress", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy_backends/cuda/libs/cusparse.pyx":3023
 *     return nnz_total
 * 
 * cpdef int znnz_compress(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, size_t descr,
 *         size_t values, size_t rowPtr, size_t nnzPerRow,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_221znnz_compress(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static int __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_znnz_compress(intptr_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;
  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("znnz_compress", 0);

  /* "cupy_backends/cuda/libs/cusparse.pyx":3028
 *         double complex tol) except? -1:
 *     cdef int nnz_total
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     status = cusparseZnnz_compress(
 *         <Handle>handle, m, <const MatDescr>descr,
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3028, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":3029
 *     cdef int nnz_total
 *     _setStream(handle)
 *     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_13cupy_backends_4cuda_4libs_8cusparse_double_complex_to_cuda(__pyx_v_tol));

  /* "cupy_backends/cuda/libs/cusparse.pyx":3033
 *         <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_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3033, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":3034
 *         &nnz_total, double_complex_to_cuda(tol))
 *     check_status(status)
 *     return nnz_total             # <<<<<<<<<<<<<<
 * 
 * cpdef void scsr2csr_compress(
*/
  __pyx_r = __pyx_v_nnz_total;
  goto __pyx_L0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":3023
 *     return nnz_total
 * 
 * cpdef int znnz_compress(             # <<<<<<<<<<<<<<
 *         intptr_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_backends.cuda.libs.cusparse.znnz_compress", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_221znnz_compress(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_220znnz_compress, "znnz_compress(intptr_t handle, int m, size_t descr, size_t values, size_t rowPtr, size_t nnzPerRow, double complex tol) -> int");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_221znnz_compress(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[7] = {0,0,0,0,0,0,0};
  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);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_descr,&__pyx_mstate_global->__pyx_n_u_values,&__pyx_mstate_global->__pyx_n_u_rowPtr,&__pyx_mstate_global->__pyx_n_u_nnzPerRow,&__pyx_mstate_global->__pyx_n_u_tol,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 3023, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 3023, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 3023, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3023, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3023, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3023, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3023, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3023, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "znnz_compress", 0) < (0)) __PYX_ERR(0, 3023, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 7; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("znnz_compress", 1, 7, 7, i); __PYX_ERR(0, 3023, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 7)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3023, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3023, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3023, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3023, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3023, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 3023, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 3023, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3024, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3024, __pyx_L3_error)
    __pyx_v_descr = __Pyx_PyLong_As_size_t(values[2]); if (unlikely((__pyx_v_descr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3024, __pyx_L3_error)
    __pyx_v_values = __Pyx_PyLong_As_size_t(values[3]); if (unlikely((__pyx_v_values == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3025, __pyx_L3_error)
    __pyx_v_rowPtr = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_rowPtr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3025, __pyx_L3_error)
    __pyx_v_nnzPerRow = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_nnzPerRow == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3025, __pyx_L3_error)
    __pyx_v_tol = __Pyx_PyComplex_As___pyx_t_double_complex(values[6]); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3026, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("znnz_compress", 1, 7, 7, __pyx_nargs); __PYX_ERR(0, 3023, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.znnz_compress", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_220znnz_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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_220znnz_compress(CYTHON_UNUSED PyObject *__pyx_self, intptr_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
  int __pyx_t_1;
  PyObject *__pyx_t_2 = 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_13cupy_backends_4cuda_4libs_8cusparse_znnz_compress(__pyx_v_handle, __pyx_v_m, __pyx_v_descr, __pyx_v_values, __pyx_v_rowPtr, __pyx_v_nnzPerRow, __pyx_v_tol, 1); if (unlikely(__pyx_t_1 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3023, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3023, __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_backends.cuda.libs.cusparse.znnz_compress", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy_backends/cuda/libs/cusparse.pyx":3036
 *     return nnz_total
 * 
 * cpdef void scsr2csr_compress(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int n, size_t descrA,
 *         size_t inVal, size_t inColInd, size_t inRowPtr,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_223scsr2csr_compress(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_scsr2csr_compress(intptr_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;
  __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_backends/cuda/libs/cusparse.pyx":3041
 *         int inNnz, size_t nnzPerRow, size_t outVal, size_t outColInd,
 *         size_t outRowPtr, float tol) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     status = cusparseScsr2csr_compress(
 *         <Handle>handle, m, n, <MatDescr>descrA,
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3041, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":3042
 *         size_t outRowPtr, float tol) except *:
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":3047
 *         inNnz, <int *>nnzPerRow, <float *>outVal, <int *>outColInd,
 *         <int *>outRowPtr, tol)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3047, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":3036
 *     return nnz_total
 * 
 * cpdef void scsr2csr_compress(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int n, size_t descrA,
 *         size_t inVal, size_t inColInd, size_t inRowPtr,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.scsr2csr_compress", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_223scsr2csr_compress(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_222scsr2csr_compress, "scsr2csr_compress(intptr_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) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_223scsr2csr_compress(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[13] = {0,0,0,0,0,0,0,0,0,0,0,0,0};
  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);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_n,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_inVal,&__pyx_mstate_global->__pyx_n_u_inColInd,&__pyx_mstate_global->__pyx_n_u_inRowPtr,&__pyx_mstate_global->__pyx_n_u_inNnz,&__pyx_mstate_global->__pyx_n_u_nnzPerRow,&__pyx_mstate_global->__pyx_n_u_outVal,&__pyx_mstate_global->__pyx_n_u_outColInd,&__pyx_mstate_global->__pyx_n_u_outRowPtr,&__pyx_mstate_global->__pyx_n_u_tol,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 3036, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 13:
        values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 3036, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 12:
        values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 3036, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 11:
        values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 3036, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 3036, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 3036, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 3036, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 3036, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 3036, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3036, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3036, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3036, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3036, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3036, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "scsr2csr_compress", 0) < (0)) __PYX_ERR(0, 3036, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 13; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("scsr2csr_compress", 1, 13, 13, i); __PYX_ERR(0, 3036, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 13)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3036, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3036, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3036, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3036, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3036, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 3036, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 3036, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 3036, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 3036, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 3036, __pyx_L3_error)
      values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 3036, __pyx_L3_error)
      values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 3036, __pyx_L3_error)
      values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 3036, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3037, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3037, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3037, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[3]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3037, __pyx_L3_error)
    __pyx_v_inVal = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_inVal == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3038, __pyx_L3_error)
    __pyx_v_inColInd = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_inColInd == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3038, __pyx_L3_error)
    __pyx_v_inRowPtr = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_inRowPtr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3038, __pyx_L3_error)
    __pyx_v_inNnz = __Pyx_PyLong_As_int(values[7]); if (unlikely((__pyx_v_inNnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3039, __pyx_L3_error)
    __pyx_v_nnzPerRow = __Pyx_PyLong_As_size_t(values[8]); if (unlikely((__pyx_v_nnzPerRow == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3039, __pyx_L3_error)
    __pyx_v_outVal = __Pyx_PyLong_As_size_t(values[9]); if (unlikely((__pyx_v_outVal == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3039, __pyx_L3_error)
    __pyx_v_outColInd = __Pyx_PyLong_As_size_t(values[10]); if (unlikely((__pyx_v_outColInd == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3039, __pyx_L3_error)
    __pyx_v_outRowPtr = __Pyx_PyLong_As_size_t(values[11]); if (unlikely((__pyx_v_outRowPtr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3040, __pyx_L3_error)
    __pyx_v_tol = __Pyx_PyFloat_AsFloat(values[12]); if (unlikely((__pyx_v_tol == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 3040, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("scsr2csr_compress", 1, 13, 13, __pyx_nargs); __PYX_ERR(0, 3036, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.scsr2csr_compress", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_222scsr2csr_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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_222scsr2csr_compress(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3036, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3036, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":3050
 * 
 * 
 * cpdef void dcsr2csr_compress(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int n, size_t descrA,
 *         size_t inVal, size_t inColInd, size_t inRowPtr,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_225dcsr2csr_compress(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_dcsr2csr_compress(intptr_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;
  __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_backends/cuda/libs/cusparse.pyx":3055
 *         int inNnz, size_t nnzPerRow, size_t outVal, size_t outColInd,
 *         size_t outRowPtr, float tol) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     status = cusparseDcsr2csr_compress(
 *         <Handle>handle, m, n, <MatDescr>descrA,
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3055, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":3056
 *         size_t outRowPtr, float tol) except *:
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":3061
 *         inNnz, <int *>nnzPerRow, <double *>outVal, <int *>outColInd,
 *         <int *>outRowPtr, tol)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef void ccsr2csr_compress(
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3061, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":3050
 * 
 * 
 * cpdef void dcsr2csr_compress(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int n, size_t descrA,
 *         size_t inVal, size_t inColInd, size_t inRowPtr,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.dcsr2csr_compress", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_225dcsr2csr_compress(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_224dcsr2csr_compress, "dcsr2csr_compress(intptr_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) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_225dcsr2csr_compress(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[13] = {0,0,0,0,0,0,0,0,0,0,0,0,0};
  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);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_n,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_inVal,&__pyx_mstate_global->__pyx_n_u_inColInd,&__pyx_mstate_global->__pyx_n_u_inRowPtr,&__pyx_mstate_global->__pyx_n_u_inNnz,&__pyx_mstate_global->__pyx_n_u_nnzPerRow,&__pyx_mstate_global->__pyx_n_u_outVal,&__pyx_mstate_global->__pyx_n_u_outColInd,&__pyx_mstate_global->__pyx_n_u_outRowPtr,&__pyx_mstate_global->__pyx_n_u_tol,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 3050, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 13:
        values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 3050, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 12:
        values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 3050, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 11:
        values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 3050, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 3050, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 3050, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 3050, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 3050, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 3050, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3050, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3050, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3050, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3050, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3050, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "dcsr2csr_compress", 0) < (0)) __PYX_ERR(0, 3050, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 13; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("dcsr2csr_compress", 1, 13, 13, i); __PYX_ERR(0, 3050, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 13)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3050, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3050, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3050, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3050, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3050, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 3050, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 3050, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 3050, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 3050, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 3050, __pyx_L3_error)
      values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 3050, __pyx_L3_error)
      values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 3050, __pyx_L3_error)
      values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 3050, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3051, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3051, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3051, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[3]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3051, __pyx_L3_error)
    __pyx_v_inVal = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_inVal == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3052, __pyx_L3_error)
    __pyx_v_inColInd = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_inColInd == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3052, __pyx_L3_error)
    __pyx_v_inRowPtr = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_inRowPtr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3052, __pyx_L3_error)
    __pyx_v_inNnz = __Pyx_PyLong_As_int(values[7]); if (unlikely((__pyx_v_inNnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3053, __pyx_L3_error)
    __pyx_v_nnzPerRow = __Pyx_PyLong_As_size_t(values[8]); if (unlikely((__pyx_v_nnzPerRow == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3053, __pyx_L3_error)
    __pyx_v_outVal = __Pyx_PyLong_As_size_t(values[9]); if (unlikely((__pyx_v_outVal == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3053, __pyx_L3_error)
    __pyx_v_outColInd = __Pyx_PyLong_As_size_t(values[10]); if (unlikely((__pyx_v_outColInd == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3053, __pyx_L3_error)
    __pyx_v_outRowPtr = __Pyx_PyLong_As_size_t(values[11]); if (unlikely((__pyx_v_outRowPtr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3054, __pyx_L3_error)
    __pyx_v_tol = __Pyx_PyFloat_AsFloat(values[12]); if (unlikely((__pyx_v_tol == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 3054, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("dcsr2csr_compress", 1, 13, 13, __pyx_nargs); __PYX_ERR(0, 3050, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.dcsr2csr_compress", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_224dcsr2csr_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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_224dcsr2csr_compress(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3050, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3050, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":3063
 *     check_status(status)
 * 
 * cpdef void ccsr2csr_compress(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int n, size_t descrA,
 *         size_t inVal, size_t inColInd, size_t inRowPtr,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_227ccsr2csr_compress(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_ccsr2csr_compress(intptr_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;
  __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_backends/cuda/libs/cusparse.pyx":3068
 *         int inNnz, size_t nnzPerRow, size_t outVal, size_t outColInd,
 *         size_t outRowPtr, complex tol) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     status = cusparseCcsr2csr_compress(
 *         <Handle>handle, m, n, <MatDescr>descrA,
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3068, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":3069
 *         size_t outRowPtr, complex tol) except *:
 *     _setStream(handle)
 *     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_13cupy_backends_4cuda_4libs_8cusparse_complex_to_cuda(__pyx_v_tol));

  /* "cupy_backends/cuda/libs/cusparse.pyx":3074
 *         inNnz, <int *>nnzPerRow, <cuComplex *>outVal, <int *>outColInd,
 *         <int *>outRowPtr, complex_to_cuda(tol))
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef void zcsr2csr_compress(
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3074, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":3063
 *     check_status(status)
 * 
 * cpdef void ccsr2csr_compress(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int n, size_t descrA,
 *         size_t inVal, size_t inColInd, size_t inRowPtr,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.ccsr2csr_compress", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_227ccsr2csr_compress(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_226ccsr2csr_compress, "ccsr2csr_compress(intptr_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) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_227ccsr2csr_compress(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[13] = {0,0,0,0,0,0,0,0,0,0,0,0,0};
  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);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_n,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_inVal,&__pyx_mstate_global->__pyx_n_u_inColInd,&__pyx_mstate_global->__pyx_n_u_inRowPtr,&__pyx_mstate_global->__pyx_n_u_inNnz,&__pyx_mstate_global->__pyx_n_u_nnzPerRow,&__pyx_mstate_global->__pyx_n_u_outVal,&__pyx_mstate_global->__pyx_n_u_outColInd,&__pyx_mstate_global->__pyx_n_u_outRowPtr,&__pyx_mstate_global->__pyx_n_u_tol,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 3063, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 13:
        values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 3063, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 12:
        values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 3063, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 11:
        values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 3063, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 3063, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 3063, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 3063, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 3063, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 3063, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3063, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3063, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3063, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3063, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3063, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "ccsr2csr_compress", 0) < (0)) __PYX_ERR(0, 3063, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 13; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("ccsr2csr_compress", 1, 13, 13, i); __PYX_ERR(0, 3063, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 13)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3063, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3063, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3063, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3063, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3063, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 3063, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 3063, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 3063, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 3063, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 3063, __pyx_L3_error)
      values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 3063, __pyx_L3_error)
      values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 3063, __pyx_L3_error)
      values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 3063, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3064, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3064, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3064, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[3]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3064, __pyx_L3_error)
    __pyx_v_inVal = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_inVal == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3065, __pyx_L3_error)
    __pyx_v_inColInd = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_inColInd == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3065, __pyx_L3_error)
    __pyx_v_inRowPtr = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_inRowPtr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3065, __pyx_L3_error)
    __pyx_v_inNnz = __Pyx_PyLong_As_int(values[7]); if (unlikely((__pyx_v_inNnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3066, __pyx_L3_error)
    __pyx_v_nnzPerRow = __Pyx_PyLong_As_size_t(values[8]); if (unlikely((__pyx_v_nnzPerRow == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3066, __pyx_L3_error)
    __pyx_v_outVal = __Pyx_PyLong_As_size_t(values[9]); if (unlikely((__pyx_v_outVal == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3066, __pyx_L3_error)
    __pyx_v_outColInd = __Pyx_PyLong_As_size_t(values[10]); if (unlikely((__pyx_v_outColInd == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3066, __pyx_L3_error)
    __pyx_v_outRowPtr = __Pyx_PyLong_As_size_t(values[11]); if (unlikely((__pyx_v_outRowPtr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3067, __pyx_L3_error)
    __pyx_v_tol = __Pyx_PyComplex_As___pyx_t_double_complex(values[12]); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3067, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ccsr2csr_compress", 1, 13, 13, __pyx_nargs); __PYX_ERR(0, 3063, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.ccsr2csr_compress", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_226ccsr2csr_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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_226ccsr2csr_compress(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3063, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3063, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":3076
 *     check_status(status)
 * 
 * cpdef void zcsr2csr_compress(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int n, size_t descrA,
 *         size_t inVal, size_t inColInd, size_t inRowPtr,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_229zcsr2csr_compress(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_zcsr2csr_compress(intptr_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;
  __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_backends/cuda/libs/cusparse.pyx":3081
 *         int inNnz, size_t nnzPerRow, size_t outVal, size_t outColInd,
 *         size_t outRowPtr, double complex tol) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     status = cusparseZcsr2csr_compress(
 *         <Handle>handle, m, n, <MatDescr>descrA,
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3081, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":3082
 *         size_t outRowPtr, double complex tol) except *:
 *     _setStream(handle)
 *     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_13cupy_backends_4cuda_4libs_8cusparse_double_complex_to_cuda(__pyx_v_tol));

  /* "cupy_backends/cuda/libs/cusparse.pyx":3088
 *         inNnz, <int *>nnzPerRow, <cuDoubleComplex *>outVal, <int *>outColInd,
 *         <int *>outRowPtr, double_complex_to_cuda(tol))
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef void sdense2csc(
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3088, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":3076
 *     check_status(status)
 * 
 * cpdef void zcsr2csr_compress(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int n, size_t descrA,
 *         size_t inVal, size_t inColInd, size_t inRowPtr,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.zcsr2csr_compress", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_229zcsr2csr_compress(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_228zcsr2csr_compress, "zcsr2csr_compress(intptr_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) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_229zcsr2csr_compress(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[13] = {0,0,0,0,0,0,0,0,0,0,0,0,0};
  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);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_n,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_inVal,&__pyx_mstate_global->__pyx_n_u_inColInd,&__pyx_mstate_global->__pyx_n_u_inRowPtr,&__pyx_mstate_global->__pyx_n_u_inNnz,&__pyx_mstate_global->__pyx_n_u_nnzPerRow,&__pyx_mstate_global->__pyx_n_u_outVal,&__pyx_mstate_global->__pyx_n_u_outColInd,&__pyx_mstate_global->__pyx_n_u_outRowPtr,&__pyx_mstate_global->__pyx_n_u_tol,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 3076, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 13:
        values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 3076, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 12:
        values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 3076, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 11:
        values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 3076, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 3076, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 3076, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 3076, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 3076, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 3076, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3076, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3076, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3076, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3076, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3076, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "zcsr2csr_compress", 0) < (0)) __PYX_ERR(0, 3076, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 13; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("zcsr2csr_compress", 1, 13, 13, i); __PYX_ERR(0, 3076, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 13)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3076, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3076, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3076, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3076, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3076, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 3076, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 3076, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 3076, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 3076, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 3076, __pyx_L3_error)
      values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 3076, __pyx_L3_error)
      values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 3076, __pyx_L3_error)
      values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 3076, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3077, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3077, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3077, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[3]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3077, __pyx_L3_error)
    __pyx_v_inVal = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_inVal == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3078, __pyx_L3_error)
    __pyx_v_inColInd = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_inColInd == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3078, __pyx_L3_error)
    __pyx_v_inRowPtr = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_inRowPtr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3078, __pyx_L3_error)
    __pyx_v_inNnz = __Pyx_PyLong_As_int(values[7]); if (unlikely((__pyx_v_inNnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3079, __pyx_L3_error)
    __pyx_v_nnzPerRow = __Pyx_PyLong_As_size_t(values[8]); if (unlikely((__pyx_v_nnzPerRow == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3079, __pyx_L3_error)
    __pyx_v_outVal = __Pyx_PyLong_As_size_t(values[9]); if (unlikely((__pyx_v_outVal == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3079, __pyx_L3_error)
    __pyx_v_outColInd = __Pyx_PyLong_As_size_t(values[10]); if (unlikely((__pyx_v_outColInd == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3079, __pyx_L3_error)
    __pyx_v_outRowPtr = __Pyx_PyLong_As_size_t(values[11]); if (unlikely((__pyx_v_outRowPtr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3080, __pyx_L3_error)
    __pyx_v_tol = __Pyx_PyComplex_As___pyx_t_double_complex(values[12]); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3080, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("zcsr2csr_compress", 1, 13, 13, __pyx_nargs); __PYX_ERR(0, 3076, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.zcsr2csr_compress", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_228zcsr2csr_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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_228zcsr2csr_compress(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3076, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3076, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":3090
 *     check_status(status)
 * 
 * cpdef void sdense2csc(             # <<<<<<<<<<<<<<
 *         intptr_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_13cupy_backends_4cuda_4libs_8cusparse_231sdense2csc(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_sdense2csc(intptr_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;
  __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_backends/cuda/libs/cusparse.pyx":3094
 *         int lda, size_t nnzPerCol, size_t cscValA, size_t cscRowIndA,
 *         size_t cscColPtrA) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     status = cusparseSdense2csc(
 *         <Handle>handle, m, n, <const MatDescr>descrA, <const float *>A,
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3094, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":3095
 *         size_t cscColPtrA) except *:
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":3099
 *         lda, <const int *>nnzPerCol, <float *>cscValA, <int *>cscRowIndA,
 *         <int *>cscColPtrA)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_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_backends/cuda/libs/cusparse.pyx":3090
 *     check_status(status)
 * 
 * cpdef void sdense2csc(             # <<<<<<<<<<<<<<
 *         intptr_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 */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.sdense2csc", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_231sdense2csc(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_230sdense2csc, "sdense2csc(intptr_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) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_231sdense2csc(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("sdense2csc (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_n,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_A,&__pyx_mstate_global->__pyx_n_u_lda,&__pyx_mstate_global->__pyx_n_u_nnzPerCol,&__pyx_mstate_global->__pyx_n_u_cscValA,&__pyx_mstate_global->__pyx_n_u_cscRowIndA,&__pyx_mstate_global->__pyx_n_u_cscColPtrA,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 3090, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 3090, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 3090, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 3090, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 3090, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 3090, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3090, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3090, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3090, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3090, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3090, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "sdense2csc", 0) < (0)) __PYX_ERR(0, 3090, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 10; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("sdense2csc", 1, 10, 10, i); __PYX_ERR(0, 3090, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 10)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3090, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3090, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3090, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3090, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3090, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 3090, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 3090, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 3090, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 3090, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 3090, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3091, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3091, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3091, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[3]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3091, __pyx_L3_error)
    __pyx_v_A = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_A == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3091, __pyx_L3_error)
    __pyx_v_lda = __Pyx_PyLong_As_int(values[5]); if (unlikely((__pyx_v_lda == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3092, __pyx_L3_error)
    __pyx_v_nnzPerCol = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_nnzPerCol == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3092, __pyx_L3_error)
    __pyx_v_cscValA = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_cscValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3092, __pyx_L3_error)
    __pyx_v_cscRowIndA = __Pyx_PyLong_As_size_t(values[8]); if (unlikely((__pyx_v_cscRowIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3092, __pyx_L3_error)
    __pyx_v_cscColPtrA = __Pyx_PyLong_As_size_t(values[9]); if (unlikely((__pyx_v_cscColPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3093, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("sdense2csc", 1, 10, 10, __pyx_nargs); __PYX_ERR(0, 3090, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.sdense2csc", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_230sdense2csc(__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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_230sdense2csc(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3090, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3090, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":3102
 * 
 * 
 * cpdef void ddense2csc(             # <<<<<<<<<<<<<<
 *         intptr_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_13cupy_backends_4cuda_4libs_8cusparse_233ddense2csc(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_ddense2csc(intptr_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;
  __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_backends/cuda/libs/cusparse.pyx":3106
 *         int lda, size_t nnzPerCol, size_t cscValA, size_t cscRowIndA,
 *         size_t cscColPtrA) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     status = cusparseDdense2csc(
 *         <Handle>handle, m, n, <const MatDescr>descrA, <const double *>A,
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3106, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":3107
 *         size_t cscColPtrA) except *:
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":3111
 *         lda, <const int *>nnzPerCol, <double *>cscValA, <int *>cscRowIndA,
 *         <int *>cscColPtrA)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef void cdense2csc(
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3111, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":3102
 * 
 * 
 * cpdef void ddense2csc(             # <<<<<<<<<<<<<<
 *         intptr_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 */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.ddense2csc", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_233ddense2csc(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_232ddense2csc, "ddense2csc(intptr_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) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_233ddense2csc(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ddense2csc (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_n,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_A,&__pyx_mstate_global->__pyx_n_u_lda,&__pyx_mstate_global->__pyx_n_u_nnzPerCol,&__pyx_mstate_global->__pyx_n_u_cscValA,&__pyx_mstate_global->__pyx_n_u_cscRowIndA,&__pyx_mstate_global->__pyx_n_u_cscColPtrA,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 3102, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 3102, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 3102, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 3102, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 3102, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 3102, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3102, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3102, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3102, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3102, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3102, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "ddense2csc", 0) < (0)) __PYX_ERR(0, 3102, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 10; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("ddense2csc", 1, 10, 10, i); __PYX_ERR(0, 3102, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 10)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3102, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3102, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3102, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3102, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3102, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 3102, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 3102, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 3102, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 3102, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 3102, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3103, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3103, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3103, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[3]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3103, __pyx_L3_error)
    __pyx_v_A = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_A == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3103, __pyx_L3_error)
    __pyx_v_lda = __Pyx_PyLong_As_int(values[5]); if (unlikely((__pyx_v_lda == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3104, __pyx_L3_error)
    __pyx_v_nnzPerCol = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_nnzPerCol == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3104, __pyx_L3_error)
    __pyx_v_cscValA = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_cscValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3104, __pyx_L3_error)
    __pyx_v_cscRowIndA = __Pyx_PyLong_As_size_t(values[8]); if (unlikely((__pyx_v_cscRowIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3104, __pyx_L3_error)
    __pyx_v_cscColPtrA = __Pyx_PyLong_As_size_t(values[9]); if (unlikely((__pyx_v_cscColPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3105, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ddense2csc", 1, 10, 10, __pyx_nargs); __PYX_ERR(0, 3102, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.ddense2csc", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_232ddense2csc(__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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_232ddense2csc(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3102, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3102, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":3113
 *     check_status(status)
 * 
 * cpdef void cdense2csc(             # <<<<<<<<<<<<<<
 *         intptr_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_13cupy_backends_4cuda_4libs_8cusparse_235cdense2csc(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_cdense2csc(intptr_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;
  __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_backends/cuda/libs/cusparse.pyx":3117
 *         int lda, size_t nnzPerCol, size_t cscValA, size_t cscRowIndA,
 *         size_t cscColPtrA) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     status = cusparseCdense2csc(
 *         <Handle>handle, m, n, <const MatDescr>descrA, <const cuComplex *>A,
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3117, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":3118
 *         size_t cscColPtrA) except *:
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":3122
 *         lda, <const int *>nnzPerCol, <cuComplex *>cscValA, <int *>cscRowIndA,
 *         <int *>cscColPtrA)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef void zdense2csc(
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3122, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":3113
 *     check_status(status)
 * 
 * cpdef void cdense2csc(             # <<<<<<<<<<<<<<
 *         intptr_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 */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.cdense2csc", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_235cdense2csc(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_234cdense2csc, "cdense2csc(intptr_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) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_235cdense2csc(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("cdense2csc (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_n,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_A,&__pyx_mstate_global->__pyx_n_u_lda,&__pyx_mstate_global->__pyx_n_u_nnzPerCol,&__pyx_mstate_global->__pyx_n_u_cscValA,&__pyx_mstate_global->__pyx_n_u_cscRowIndA,&__pyx_mstate_global->__pyx_n_u_cscColPtrA,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 3113, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 3113, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 3113, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 3113, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 3113, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 3113, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3113, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3113, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3113, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3113, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3113, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "cdense2csc", 0) < (0)) __PYX_ERR(0, 3113, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 10; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("cdense2csc", 1, 10, 10, i); __PYX_ERR(0, 3113, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 10)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3113, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3113, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3113, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3113, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3113, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 3113, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 3113, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 3113, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 3113, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 3113, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3114, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3114, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3114, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[3]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3114, __pyx_L3_error)
    __pyx_v_A = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_A == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3114, __pyx_L3_error)
    __pyx_v_lda = __Pyx_PyLong_As_int(values[5]); if (unlikely((__pyx_v_lda == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3115, __pyx_L3_error)
    __pyx_v_nnzPerCol = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_nnzPerCol == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3115, __pyx_L3_error)
    __pyx_v_cscValA = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_cscValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3115, __pyx_L3_error)
    __pyx_v_cscRowIndA = __Pyx_PyLong_As_size_t(values[8]); if (unlikely((__pyx_v_cscRowIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3115, __pyx_L3_error)
    __pyx_v_cscColPtrA = __Pyx_PyLong_As_size_t(values[9]); if (unlikely((__pyx_v_cscColPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3116, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("cdense2csc", 1, 10, 10, __pyx_nargs); __PYX_ERR(0, 3113, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.cdense2csc", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_234cdense2csc(__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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_234cdense2csc(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3113, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3113, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":3124
 *     check_status(status)
 * 
 * cpdef void zdense2csc(             # <<<<<<<<<<<<<<
 *         intptr_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_13cupy_backends_4cuda_4libs_8cusparse_237zdense2csc(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_zdense2csc(intptr_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;
  __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_backends/cuda/libs/cusparse.pyx":3128
 *         int lda, size_t nnzPerCol, size_t cscValA, size_t cscRowIndA,
 *         size_t cscColPtrA) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     status = cusparseZdense2csc(
 *         <Handle>handle, m, n,
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3128, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":3129
 *         size_t cscColPtrA) except *:
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":3135
 *         <cuDoubleComplex *>cscValA, <int *>cscRowIndA,
 *         <int *>cscColPtrA)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef void sdense2csr(
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3135, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":3124
 *     check_status(status)
 * 
 * cpdef void zdense2csc(             # <<<<<<<<<<<<<<
 *         intptr_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 */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.zdense2csc", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_237zdense2csc(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_236zdense2csc, "zdense2csc(intptr_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) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_237zdense2csc(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("zdense2csc (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_n,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_A,&__pyx_mstate_global->__pyx_n_u_lda,&__pyx_mstate_global->__pyx_n_u_nnzPerCol,&__pyx_mstate_global->__pyx_n_u_cscValA,&__pyx_mstate_global->__pyx_n_u_cscRowIndA,&__pyx_mstate_global->__pyx_n_u_cscColPtrA,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 3124, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 3124, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 3124, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 3124, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 3124, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 3124, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3124, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3124, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3124, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3124, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3124, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "zdense2csc", 0) < (0)) __PYX_ERR(0, 3124, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 10; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("zdense2csc", 1, 10, 10, i); __PYX_ERR(0, 3124, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 10)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3124, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3124, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3124, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3124, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3124, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 3124, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 3124, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 3124, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 3124, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 3124, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3125, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3125, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3125, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[3]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3125, __pyx_L3_error)
    __pyx_v_A = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_A == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3125, __pyx_L3_error)
    __pyx_v_lda = __Pyx_PyLong_As_int(values[5]); if (unlikely((__pyx_v_lda == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3126, __pyx_L3_error)
    __pyx_v_nnzPerCol = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_nnzPerCol == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3126, __pyx_L3_error)
    __pyx_v_cscValA = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_cscValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3126, __pyx_L3_error)
    __pyx_v_cscRowIndA = __Pyx_PyLong_As_size_t(values[8]); if (unlikely((__pyx_v_cscRowIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3126, __pyx_L3_error)
    __pyx_v_cscColPtrA = __Pyx_PyLong_As_size_t(values[9]); if (unlikely((__pyx_v_cscColPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3127, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("zdense2csc", 1, 10, 10, __pyx_nargs); __PYX_ERR(0, 3124, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.zdense2csc", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_236zdense2csc(__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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_236zdense2csc(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3124, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3124, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":3137
 *     check_status(status)
 * 
 * cpdef void sdense2csr(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int n, size_t descrA,
 *         size_t A, int lda, size_t nnzPerRow, size_t csrValA,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_239sdense2csr(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_sdense2csr(intptr_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;
  __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_backends/cuda/libs/cusparse.pyx":3141
 *         size_t A, int lda, size_t nnzPerRow, size_t csrValA,
 *         size_t csrRowPtrA, size_t csrColIndA) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     status = cusparseSdense2csr(
 *         <Handle>handle, m, n, <MatDescr>descrA,
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3141, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":3142
 *         size_t csrRowPtrA, size_t csrColIndA) except *:
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":3146
 *         <const float *>A, lda, <const int *>nnzPerRow, <float *>csrValA,
 *         <int *>csrRowPtrA, <int *>csrColIndA)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3146, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":3137
 *     check_status(status)
 * 
 * cpdef void sdense2csr(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int n, size_t descrA,
 *         size_t A, int lda, size_t nnzPerRow, size_t csrValA,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.sdense2csr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_239sdense2csr(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_238sdense2csr, "sdense2csr(intptr_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) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_239sdense2csr(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("sdense2csr (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_n,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_A,&__pyx_mstate_global->__pyx_n_u_lda,&__pyx_mstate_global->__pyx_n_u_nnzPerRow,&__pyx_mstate_global->__pyx_n_u_csrValA,&__pyx_mstate_global->__pyx_n_u_csrRowPtrA,&__pyx_mstate_global->__pyx_n_u_csrColIndA,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 3137, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 3137, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 3137, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 3137, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 3137, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 3137, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3137, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3137, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3137, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3137, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3137, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "sdense2csr", 0) < (0)) __PYX_ERR(0, 3137, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 10; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("sdense2csr", 1, 10, 10, i); __PYX_ERR(0, 3137, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 10)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3137, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3137, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3137, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3137, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3137, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 3137, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 3137, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 3137, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 3137, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 3137, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3138, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3138, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3138, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[3]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3138, __pyx_L3_error)
    __pyx_v_A = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_A == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3139, __pyx_L3_error)
    __pyx_v_lda = __Pyx_PyLong_As_int(values[5]); if (unlikely((__pyx_v_lda == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3139, __pyx_L3_error)
    __pyx_v_nnzPerRow = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_nnzPerRow == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3139, __pyx_L3_error)
    __pyx_v_csrValA = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_csrValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3139, __pyx_L3_error)
    __pyx_v_csrRowPtrA = __Pyx_PyLong_As_size_t(values[8]); if (unlikely((__pyx_v_csrRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3140, __pyx_L3_error)
    __pyx_v_csrColIndA = __Pyx_PyLong_As_size_t(values[9]); if (unlikely((__pyx_v_csrColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3140, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("sdense2csr", 1, 10, 10, __pyx_nargs); __PYX_ERR(0, 3137, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.sdense2csr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_238sdense2csr(__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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_238sdense2csr(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3137, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3137, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":3149
 * 
 * 
 * cpdef void ddense2csr(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int n, size_t descrA,
 *         size_t A, int lda, size_t nnzPerRow, size_t csrValA,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_241ddense2csr(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_ddense2csr(intptr_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;
  __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_backends/cuda/libs/cusparse.pyx":3153
 *         size_t A, int lda, size_t nnzPerRow, size_t csrValA,
 *         size_t csrRowPtrA, size_t csrColIndA) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     status = cusparseDdense2csr(
 *         <Handle>handle, m, n, <MatDescr>descrA,
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3153, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":3154
 *         size_t csrRowPtrA, size_t csrColIndA) except *:
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":3158
 *         <const double *>A, lda, <const int *>nnzPerRow, <double *>csrValA,
 *         <int *>csrRowPtrA, <int *>csrColIndA)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef void cdense2csr(
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3158, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":3149
 * 
 * 
 * cpdef void ddense2csr(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int n, size_t descrA,
 *         size_t A, int lda, size_t nnzPerRow, size_t csrValA,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.ddense2csr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_241ddense2csr(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_240ddense2csr, "ddense2csr(intptr_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) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_241ddense2csr(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ddense2csr (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_n,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_A,&__pyx_mstate_global->__pyx_n_u_lda,&__pyx_mstate_global->__pyx_n_u_nnzPerRow,&__pyx_mstate_global->__pyx_n_u_csrValA,&__pyx_mstate_global->__pyx_n_u_csrRowPtrA,&__pyx_mstate_global->__pyx_n_u_csrColIndA,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 3149, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 3149, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 3149, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 3149, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 3149, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 3149, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3149, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3149, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3149, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3149, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3149, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "ddense2csr", 0) < (0)) __PYX_ERR(0, 3149, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 10; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("ddense2csr", 1, 10, 10, i); __PYX_ERR(0, 3149, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 10)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3149, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3149, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3149, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3149, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3149, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 3149, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 3149, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 3149, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 3149, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 3149, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3150, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3150, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3150, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[3]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3150, __pyx_L3_error)
    __pyx_v_A = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_A == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3151, __pyx_L3_error)
    __pyx_v_lda = __Pyx_PyLong_As_int(values[5]); if (unlikely((__pyx_v_lda == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3151, __pyx_L3_error)
    __pyx_v_nnzPerRow = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_nnzPerRow == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3151, __pyx_L3_error)
    __pyx_v_csrValA = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_csrValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3151, __pyx_L3_error)
    __pyx_v_csrRowPtrA = __Pyx_PyLong_As_size_t(values[8]); if (unlikely((__pyx_v_csrRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3152, __pyx_L3_error)
    __pyx_v_csrColIndA = __Pyx_PyLong_As_size_t(values[9]); if (unlikely((__pyx_v_csrColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3152, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ddense2csr", 1, 10, 10, __pyx_nargs); __PYX_ERR(0, 3149, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.ddense2csr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_240ddense2csr(__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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_240ddense2csr(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3149, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3149, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":3160
 *     check_status(status)
 * 
 * cpdef void cdense2csr(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int n, size_t descrA,
 *         size_t A, int lda, size_t nnzPerRow, size_t csrValA,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_243cdense2csr(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_cdense2csr(intptr_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;
  __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_backends/cuda/libs/cusparse.pyx":3164
 *         size_t A, int lda, size_t nnzPerRow, size_t csrValA,
 *         size_t csrRowPtrA, size_t csrColIndA) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     status = cusparseCdense2csr(
 *         <Handle>handle, m, n, <MatDescr>descrA,
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3164, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":3165
 *         size_t csrRowPtrA, size_t csrColIndA) except *:
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":3169
 *         <const cuComplex *>A, lda, <const int *>nnzPerRow,
 *         <cuComplex *>csrValA, <int *>csrRowPtrA, <int *>csrColIndA)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef void zdense2csr(
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3169, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":3160
 *     check_status(status)
 * 
 * cpdef void cdense2csr(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int n, size_t descrA,
 *         size_t A, int lda, size_t nnzPerRow, size_t csrValA,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.cdense2csr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_243cdense2csr(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_242cdense2csr, "cdense2csr(intptr_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) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_243cdense2csr(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("cdense2csr (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_n,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_A,&__pyx_mstate_global->__pyx_n_u_lda,&__pyx_mstate_global->__pyx_n_u_nnzPerRow,&__pyx_mstate_global->__pyx_n_u_csrValA,&__pyx_mstate_global->__pyx_n_u_csrRowPtrA,&__pyx_mstate_global->__pyx_n_u_csrColIndA,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 3160, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 3160, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 3160, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 3160, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 3160, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 3160, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3160, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3160, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3160, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3160, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3160, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "cdense2csr", 0) < (0)) __PYX_ERR(0, 3160, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 10; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("cdense2csr", 1, 10, 10, i); __PYX_ERR(0, 3160, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 10)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3160, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3160, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3160, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3160, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3160, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 3160, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 3160, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 3160, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 3160, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 3160, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3161, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3161, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3161, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[3]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3161, __pyx_L3_error)
    __pyx_v_A = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_A == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3162, __pyx_L3_error)
    __pyx_v_lda = __Pyx_PyLong_As_int(values[5]); if (unlikely((__pyx_v_lda == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3162, __pyx_L3_error)
    __pyx_v_nnzPerRow = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_nnzPerRow == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3162, __pyx_L3_error)
    __pyx_v_csrValA = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_csrValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3162, __pyx_L3_error)
    __pyx_v_csrRowPtrA = __Pyx_PyLong_As_size_t(values[8]); if (unlikely((__pyx_v_csrRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3163, __pyx_L3_error)
    __pyx_v_csrColIndA = __Pyx_PyLong_As_size_t(values[9]); if (unlikely((__pyx_v_csrColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3163, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("cdense2csr", 1, 10, 10, __pyx_nargs); __PYX_ERR(0, 3160, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.cdense2csr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_242cdense2csr(__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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_242cdense2csr(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3160, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3160, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":3171
 *     check_status(status)
 * 
 * cpdef void zdense2csr(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int n, size_t descrA,
 *         size_t A, int lda, size_t nnzPerRow, size_t csrValA,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_245zdense2csr(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_zdense2csr(intptr_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;
  __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_backends/cuda/libs/cusparse.pyx":3175
 *         size_t A, int lda, size_t nnzPerRow, size_t csrValA,
 *         size_t csrRowPtrA, size_t csrColIndA) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     status = cusparseZdense2csr(
 *         <Handle>handle, m, n, <MatDescr>descrA,
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3175, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":3176
 *         size_t csrRowPtrA, size_t csrColIndA) except *:
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":3180
 *         <const cuDoubleComplex *>A, lda, <const int *>nnzPerRow,
 *         <cuDoubleComplex *>csrValA, <int *>csrRowPtrA, <int *>csrColIndA)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef void snnz(
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3180, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":3171
 *     check_status(status)
 * 
 * cpdef void zdense2csr(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int n, size_t descrA,
 *         size_t A, int lda, size_t nnzPerRow, size_t csrValA,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.zdense2csr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_245zdense2csr(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_244zdense2csr, "zdense2csr(intptr_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) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_245zdense2csr(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("zdense2csr (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_n,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_A,&__pyx_mstate_global->__pyx_n_u_lda,&__pyx_mstate_global->__pyx_n_u_nnzPerRow,&__pyx_mstate_global->__pyx_n_u_csrValA,&__pyx_mstate_global->__pyx_n_u_csrRowPtrA,&__pyx_mstate_global->__pyx_n_u_csrColIndA,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 3171, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 3171, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 3171, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 3171, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 3171, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 3171, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3171, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3171, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3171, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3171, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3171, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "zdense2csr", 0) < (0)) __PYX_ERR(0, 3171, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 10; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("zdense2csr", 1, 10, 10, i); __PYX_ERR(0, 3171, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 10)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3171, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3171, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3171, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3171, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3171, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 3171, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 3171, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 3171, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 3171, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 3171, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3172, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3172, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3172, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[3]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3172, __pyx_L3_error)
    __pyx_v_A = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_A == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3173, __pyx_L3_error)
    __pyx_v_lda = __Pyx_PyLong_As_int(values[5]); if (unlikely((__pyx_v_lda == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3173, __pyx_L3_error)
    __pyx_v_nnzPerRow = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_nnzPerRow == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3173, __pyx_L3_error)
    __pyx_v_csrValA = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_csrValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3173, __pyx_L3_error)
    __pyx_v_csrRowPtrA = __Pyx_PyLong_As_size_t(values[8]); if (unlikely((__pyx_v_csrRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3174, __pyx_L3_error)
    __pyx_v_csrColIndA = __Pyx_PyLong_As_size_t(values[9]); if (unlikely((__pyx_v_csrColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3174, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("zdense2csr", 1, 10, 10, __pyx_nargs); __PYX_ERR(0, 3171, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.zdense2csr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_244zdense2csr(__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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_244zdense2csr(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3171, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3171, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":3182
 *     check_status(status)
 * 
 * cpdef void snnz(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int dirA, int m, int n, size_t descrA,
 *         size_t A, int lda, size_t nnzPerRowColumn,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_247snnz(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_snnz(intptr_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;
  __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_backends/cuda/libs/cusparse.pyx":3186
 *         size_t A, int lda, size_t nnzPerRowColumn,
 *         size_t nnzTotalDevHostPtr) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     status = cusparseSnnz(
 *         <Handle>handle, <Direction>dirA, m, n, <const MatDescr>descrA,
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3186, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":3187
 *         size_t nnzTotalDevHostPtr) except *:
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":3191
 *         <const float *>A, lda, <int *>nnzPerRowColumn,
 *         <int *>nnzTotalDevHostPtr)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3191, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":3182
 *     check_status(status)
 * 
 * cpdef void snnz(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int dirA, int m, int n, size_t descrA,
 *         size_t A, int lda, size_t nnzPerRowColumn,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.snnz", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_247snnz(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_246snnz, "snnz(intptr_t handle, int dirA, int m, int n, size_t descrA, size_t A, int lda, size_t nnzPerRowColumn, size_t nnzTotalDevHostPtr) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_247snnz(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("snnz (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_dirA,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_n,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_A,&__pyx_mstate_global->__pyx_n_u_lda,&__pyx_mstate_global->__pyx_n_u_nnzPerRowColumn,&__pyx_mstate_global->__pyx_n_u_nnzTotalDevHostPtr,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 3182, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 3182, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 3182, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 3182, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 3182, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3182, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3182, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3182, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3182, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3182, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "snnz", 0) < (0)) __PYX_ERR(0, 3182, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 9; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("snnz", 1, 9, 9, i); __PYX_ERR(0, 3182, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 9)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3182, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3182, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3182, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3182, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3182, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 3182, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 3182, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 3182, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 3182, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3183, __pyx_L3_error)
    __pyx_v_dirA = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_dirA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3183, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3183, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyLong_As_int(values[3]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3183, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3183, __pyx_L3_error)
    __pyx_v_A = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_A == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3184, __pyx_L3_error)
    __pyx_v_lda = __Pyx_PyLong_As_int(values[6]); if (unlikely((__pyx_v_lda == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3184, __pyx_L3_error)
    __pyx_v_nnzPerRowColumn = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_nnzPerRowColumn == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3184, __pyx_L3_error)
    __pyx_v_nnzTotalDevHostPtr = __Pyx_PyLong_As_size_t(values[8]); if (unlikely((__pyx_v_nnzTotalDevHostPtr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3185, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("snnz", 1, 9, 9, __pyx_nargs); __PYX_ERR(0, 3182, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.snnz", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_246snnz(__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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_246snnz(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3182, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3182, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":3194
 * 
 * 
 * cpdef void dnnz(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int dirA, int m, int n, size_t descrA,
 *         size_t A, int lda, size_t nnzPerRowColumn,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_249dnnz(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_dnnz(intptr_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;
  __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_backends/cuda/libs/cusparse.pyx":3198
 *         size_t A, int lda, size_t nnzPerRowColumn,
 *         size_t nnzTotalDevHostPtr) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     status = cusparseDnnz(
 *         <Handle>handle, <Direction>dirA, m, n, <const MatDescr>descrA,
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3198, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":3199
 *         size_t nnzTotalDevHostPtr) except *:
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":3203
 *         <const double *>A, lda, <int *>nnzPerRowColumn,
 *         <int *>nnzTotalDevHostPtr)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef void cnnz(
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3203, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":3194
 * 
 * 
 * cpdef void dnnz(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int dirA, int m, int n, size_t descrA,
 *         size_t A, int lda, size_t nnzPerRowColumn,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.dnnz", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_249dnnz(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_248dnnz, "dnnz(intptr_t handle, int dirA, int m, int n, size_t descrA, size_t A, int lda, size_t nnzPerRowColumn, size_t nnzTotalDevHostPtr) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_249dnnz(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dnnz (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_dirA,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_n,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_A,&__pyx_mstate_global->__pyx_n_u_lda,&__pyx_mstate_global->__pyx_n_u_nnzPerRowColumn,&__pyx_mstate_global->__pyx_n_u_nnzTotalDevHostPtr,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 3194, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 3194, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 3194, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 3194, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 3194, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3194, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3194, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3194, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3194, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3194, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "dnnz", 0) < (0)) __PYX_ERR(0, 3194, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 9; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("dnnz", 1, 9, 9, i); __PYX_ERR(0, 3194, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 9)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3194, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3194, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3194, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3194, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3194, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 3194, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 3194, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 3194, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 3194, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3195, __pyx_L3_error)
    __pyx_v_dirA = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_dirA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3195, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3195, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyLong_As_int(values[3]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3195, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3195, __pyx_L3_error)
    __pyx_v_A = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_A == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3196, __pyx_L3_error)
    __pyx_v_lda = __Pyx_PyLong_As_int(values[6]); if (unlikely((__pyx_v_lda == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3196, __pyx_L3_error)
    __pyx_v_nnzPerRowColumn = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_nnzPerRowColumn == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3196, __pyx_L3_error)
    __pyx_v_nnzTotalDevHostPtr = __Pyx_PyLong_As_size_t(values[8]); if (unlikely((__pyx_v_nnzTotalDevHostPtr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3197, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("dnnz", 1, 9, 9, __pyx_nargs); __PYX_ERR(0, 3194, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.dnnz", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_248dnnz(__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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_248dnnz(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3194, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3194, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":3205
 *     check_status(status)
 * 
 * cpdef void cnnz(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int dirA, int m, int n, size_t descrA,
 *         size_t A, int lda, size_t nnzPerRowColumn,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_251cnnz(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_cnnz(intptr_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;
  __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_backends/cuda/libs/cusparse.pyx":3209
 *         size_t A, int lda, size_t nnzPerRowColumn,
 *         size_t nnzTotalDevHostPtr) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     status = cusparseCnnz(
 *         <Handle>handle, <Direction>dirA, m, n, <const MatDescr>descrA,
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3209, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":3210
 *         size_t nnzTotalDevHostPtr) except *:
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":3214
 *         <const cuComplex *>A, lda, <int *>nnzPerRowColumn,
 *         <int *>nnzTotalDevHostPtr)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef void znnz(
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3214, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":3205
 *     check_status(status)
 * 
 * cpdef void cnnz(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int dirA, int m, int n, size_t descrA,
 *         size_t A, int lda, size_t nnzPerRowColumn,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.cnnz", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_251cnnz(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_250cnnz, "cnnz(intptr_t handle, int dirA, int m, int n, size_t descrA, size_t A, int lda, size_t nnzPerRowColumn, size_t nnzTotalDevHostPtr) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_251cnnz(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("cnnz (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_dirA,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_n,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_A,&__pyx_mstate_global->__pyx_n_u_lda,&__pyx_mstate_global->__pyx_n_u_nnzPerRowColumn,&__pyx_mstate_global->__pyx_n_u_nnzTotalDevHostPtr,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 3205, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 3205, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 3205, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 3205, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 3205, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3205, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3205, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3205, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3205, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3205, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "cnnz", 0) < (0)) __PYX_ERR(0, 3205, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 9; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("cnnz", 1, 9, 9, i); __PYX_ERR(0, 3205, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 9)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3205, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3205, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3205, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3205, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3205, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 3205, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 3205, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 3205, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 3205, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3206, __pyx_L3_error)
    __pyx_v_dirA = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_dirA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3206, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3206, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyLong_As_int(values[3]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3206, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3206, __pyx_L3_error)
    __pyx_v_A = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_A == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3207, __pyx_L3_error)
    __pyx_v_lda = __Pyx_PyLong_As_int(values[6]); if (unlikely((__pyx_v_lda == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3207, __pyx_L3_error)
    __pyx_v_nnzPerRowColumn = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_nnzPerRowColumn == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3207, __pyx_L3_error)
    __pyx_v_nnzTotalDevHostPtr = __Pyx_PyLong_As_size_t(values[8]); if (unlikely((__pyx_v_nnzTotalDevHostPtr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3208, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("cnnz", 1, 9, 9, __pyx_nargs); __PYX_ERR(0, 3205, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.cnnz", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_250cnnz(__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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_250cnnz(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3205, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3205, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":3216
 *     check_status(status)
 * 
 * cpdef void znnz(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int dirA, int m, int n, size_t descrA,
 *         size_t A, int lda, size_t nnzPerRowColumn,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_253znnz(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_znnz(intptr_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;
  __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_backends/cuda/libs/cusparse.pyx":3220
 *         size_t A, int lda, size_t nnzPerRowColumn,
 *         size_t nnzTotalDevHostPtr) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     status = cusparseZnnz(
 *         <Handle>handle, <Direction>dirA, m, n, <const MatDescr>descrA,
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3220, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":3221
 *         size_t nnzTotalDevHostPtr) except *:
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":3225
 *         <const cuDoubleComplex *>A, lda, <int *>nnzPerRowColumn,
 *         <int *>nnzTotalDevHostPtr)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef void createIdentityPermutation(
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3225, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":3216
 *     check_status(status)
 * 
 * cpdef void znnz(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int dirA, int m, int n, size_t descrA,
 *         size_t A, int lda, size_t nnzPerRowColumn,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.znnz", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_253znnz(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_252znnz, "znnz(intptr_t handle, int dirA, int m, int n, size_t descrA, size_t A, int lda, size_t nnzPerRowColumn, size_t nnzTotalDevHostPtr) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_253znnz(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("znnz (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_dirA,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_n,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_A,&__pyx_mstate_global->__pyx_n_u_lda,&__pyx_mstate_global->__pyx_n_u_nnzPerRowColumn,&__pyx_mstate_global->__pyx_n_u_nnzTotalDevHostPtr,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 3216, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 3216, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 3216, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 3216, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 3216, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3216, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3216, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3216, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3216, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3216, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "znnz", 0) < (0)) __PYX_ERR(0, 3216, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 9; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("znnz", 1, 9, 9, i); __PYX_ERR(0, 3216, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 9)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3216, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3216, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3216, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3216, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3216, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 3216, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 3216, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 3216, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 3216, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3217, __pyx_L3_error)
    __pyx_v_dirA = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_dirA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3217, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3217, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyLong_As_int(values[3]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3217, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3217, __pyx_L3_error)
    __pyx_v_A = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_A == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3218, __pyx_L3_error)
    __pyx_v_lda = __Pyx_PyLong_As_int(values[6]); if (unlikely((__pyx_v_lda == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3218, __pyx_L3_error)
    __pyx_v_nnzPerRowColumn = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_nnzPerRowColumn == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3218, __pyx_L3_error)
    __pyx_v_nnzTotalDevHostPtr = __Pyx_PyLong_As_size_t(values[8]); if (unlikely((__pyx_v_nnzTotalDevHostPtr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3219, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("znnz", 1, 9, 9, __pyx_nargs); __PYX_ERR(0, 3216, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.znnz", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_252znnz(__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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_252znnz(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3216, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3216, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":3227
 *     check_status(status)
 * 
 * cpdef void createIdentityPermutation(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int n, size_t p) except *:
 *     _setStream(handle)
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_255createIdentityPermutation(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_createIdentityPermutation(intptr_t __pyx_v_handle, int __pyx_v_n, size_t __pyx_v_p, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  __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_backends/cuda/libs/cusparse.pyx":3229
 * cpdef void createIdentityPermutation(
 *         intptr_t handle, int n, size_t p) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     status = cusparseCreateIdentityPermutation(
 *         <Handle>handle, n, <int *>p)
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3229, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":3230
 *         intptr_t handle, int n, size_t p) except *:
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":3232
 *     status = cusparseCreateIdentityPermutation(
 *         <Handle>handle, n, <int *>p)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3232, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":3227
 *     check_status(status)
 * 
 * cpdef void createIdentityPermutation(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int n, size_t p) except *:
 *     _setStream(handle)
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.createIdentityPermutation", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_255createIdentityPermutation(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_254createIdentityPermutation, "createIdentityPermutation(intptr_t handle, int n, size_t p) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_255createIdentityPermutation(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_t __pyx_v_handle;
  int __pyx_v_n;
  size_t __pyx_v_p;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("createIdentityPermutation (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_n,&__pyx_mstate_global->__pyx_n_u_p,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 3227, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3227, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3227, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3227, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "createIdentityPermutation", 0) < (0)) __PYX_ERR(0, 3227, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("createIdentityPermutation", 1, 3, 3, i); __PYX_ERR(0, 3227, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3227, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3227, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3227, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3228, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3228, __pyx_L3_error)
    __pyx_v_p = __Pyx_PyLong_As_size_t(values[2]); if (unlikely((__pyx_v_p == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3228, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("createIdentityPermutation", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 3227, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.createIdentityPermutation", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_254createIdentityPermutation(__pyx_self, __pyx_v_handle, __pyx_v_n, __pyx_v_p);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_254createIdentityPermutation(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_f_13cupy_backends_4cuda_4libs_8cusparse_createIdentityPermutation(__pyx_v_handle, __pyx_v_n, __pyx_v_p, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3227, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3227, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":3235
 * 
 * 
 * cpdef size_t xcoosort_bufferSizeExt(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int n, int nnz, size_t cooRows,
 *         size_t cooCols) except? -1:
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_257xcoosort_bufferSizeExt(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static size_t __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_xcoosort_bufferSizeExt(intptr_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_backends/cuda/libs/cusparse.pyx":3239
 *         size_t cooCols) except? -1:
 *     cdef size_t bufferSizeInBytes
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     status = cusparseXcoosort_bufferSizeExt(
 *         <Handle>handle, m, n, nnz, <const int *>cooRows,
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3239, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":3240
 *     cdef size_t bufferSizeInBytes
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":3243
 *         <Handle>handle, m, n, nnz, <const int *>cooRows,
 *         <const int *>cooCols, &bufferSizeInBytes)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return bufferSizeInBytes
 * 
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3243, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":3244
 *         <const int *>cooCols, &bufferSizeInBytes)
 *     check_status(status)
 *     return bufferSizeInBytes             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_r = __pyx_v_bufferSizeInBytes;
  goto __pyx_L0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":3235
 * 
 * 
 * cpdef size_t xcoosort_bufferSizeExt(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int n, int nnz, size_t cooRows,
 *         size_t cooCols) except? -1:
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.xcoosort_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1L;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_257xcoosort_bufferSizeExt(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_256xcoosort_bufferSizeExt, "xcoosort_bufferSizeExt(intptr_t handle, int m, int n, int nnz, size_t cooRows, size_t cooCols) -> size_t");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_257xcoosort_bufferSizeExt(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[6] = {0,0,0,0,0,0};
  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);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_n,&__pyx_mstate_global->__pyx_n_u_nnz,&__pyx_mstate_global->__pyx_n_u_cooRows,&__pyx_mstate_global->__pyx_n_u_cooCols,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 3235, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 3235, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3235, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3235, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3235, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3235, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3235, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "xcoosort_bufferSizeExt", 0) < (0)) __PYX_ERR(0, 3235, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 6; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("xcoosort_bufferSizeExt", 1, 6, 6, i); __PYX_ERR(0, 3235, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 6)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3235, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3235, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3235, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3235, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3235, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 3235, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3236, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3236, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3236, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyLong_As_int(values[3]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3236, __pyx_L3_error)
    __pyx_v_cooRows = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_cooRows == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3236, __pyx_L3_error)
    __pyx_v_cooCols = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_cooCols == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3237, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("xcoosort_bufferSizeExt", 1, 6, 6, __pyx_nargs); __PYX_ERR(0, 3235, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.xcoosort_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_256xcoosort_bufferSizeExt(__pyx_self, __pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_nnz, __pyx_v_cooRows, __pyx_v_cooCols);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_256xcoosort_bufferSizeExt(CYTHON_UNUSED PyObject *__pyx_self, intptr_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
  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("xcoosort_bufferSizeExt", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_xcoosort_bufferSizeExt(__pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_nnz, __pyx_v_cooRows, __pyx_v_cooCols, 1); if (unlikely(__pyx_t_1 == ((size_t)-1L) && PyErr_Occurred())) __PYX_ERR(0, 3235, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyLong_FromSize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3235, __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_backends.cuda.libs.cusparse.xcoosort_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy_backends/cuda/libs/cusparse.pyx":3247
 * 
 * 
 * cpdef void xcoosortByRow(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int n, int nnz, size_t cooRows, size_t cooCols,
 *         size_t P, size_t pBuffer) except *:
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_259xcoosortByRow(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_xcoosortByRow(intptr_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;
  __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_backends/cuda/libs/cusparse.pyx":3250
 *         intptr_t handle, int m, int n, int nnz, size_t cooRows, size_t cooCols,
 *         size_t P, size_t pBuffer) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     status = cusparseXcoosortByRow(
 *         <Handle>handle, m, n, nnz, <int *>cooRows, <int *>cooCols,
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3250, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":3251
 *         size_t P, size_t pBuffer) except *:
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":3254
 *         <Handle>handle, m, n, nnz, <int *>cooRows, <int *>cooCols,
 *         <int *>P, <void *>pBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3254, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":3247
 * 
 * 
 * cpdef void xcoosortByRow(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int n, int nnz, size_t cooRows, size_t cooCols,
 *         size_t P, size_t pBuffer) except *:
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.xcoosortByRow", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_259xcoosortByRow(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_258xcoosortByRow, "xcoosortByRow(intptr_t handle, int m, int n, int nnz, size_t cooRows, size_t cooCols, size_t P, size_t pBuffer) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_259xcoosortByRow(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[8] = {0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("xcoosortByRow (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_n,&__pyx_mstate_global->__pyx_n_u_nnz,&__pyx_mstate_global->__pyx_n_u_cooRows,&__pyx_mstate_global->__pyx_n_u_cooCols,&__pyx_mstate_global->__pyx_n_u_P,&__pyx_mstate_global->__pyx_n_u_pBuffer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 3247, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 3247, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 3247, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 3247, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3247, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3247, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3247, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3247, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3247, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "xcoosortByRow", 0) < (0)) __PYX_ERR(0, 3247, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 8; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("xcoosortByRow", 1, 8, 8, i); __PYX_ERR(0, 3247, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 8)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3247, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3247, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3247, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3247, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3247, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 3247, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 3247, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 3247, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3248, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3248, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3248, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyLong_As_int(values[3]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3248, __pyx_L3_error)
    __pyx_v_cooRows = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_cooRows == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3248, __pyx_L3_error)
    __pyx_v_cooCols = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_cooCols == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3248, __pyx_L3_error)
    __pyx_v_P = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_P == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3249, __pyx_L3_error)
    __pyx_v_pBuffer = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_pBuffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3249, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("xcoosortByRow", 1, 8, 8, __pyx_nargs); __PYX_ERR(0, 3247, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.xcoosortByRow", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_258xcoosortByRow(__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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_258xcoosortByRow(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3247, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3247, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":3257
 * 
 * 
 * cpdef void xcoosortByColumn(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int n, int nnz, size_t cooRows, size_t cooCols,
 *         size_t P, size_t pBuffer) except *:
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_261xcoosortByColumn(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_xcoosortByColumn(intptr_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;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("xcoosortByColumn", 0);

  /* "cupy_backends/cuda/libs/cusparse.pyx":3260
 *         intptr_t handle, int m, int n, int nnz, size_t cooRows, size_t cooCols,
 *         size_t P, size_t pBuffer) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     status = cusparseXcoosortByColumn(
 *         <Handle>handle, m, n, nnz, <int *>cooRows, <int *>cooCols,
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3260, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":3261
 *         size_t P, size_t pBuffer) except *:
 *     _setStream(handle)
 *     status = cusparseXcoosortByColumn(             # <<<<<<<<<<<<<<
 *         <Handle>handle, m, n, nnz, <int *>cooRows, <int *>cooCols,
 *         <int *>P, <void *>pBuffer)
*/
  __pyx_v_status = cusparseXcoosortByColumn(((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_backends/cuda/libs/cusparse.pyx":3264
 *         <Handle>handle, m, n, nnz, <int *>cooRows, <int *>cooCols,
 *         <int *>P, <void *>pBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3264, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":3257
 * 
 * 
 * cpdef void xcoosortByColumn(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int n, int nnz, size_t cooRows, size_t cooCols,
 *         size_t P, size_t pBuffer) except *:
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.xcoosortByColumn", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_261xcoosortByColumn(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_260xcoosortByColumn, "xcoosortByColumn(intptr_t handle, int m, int n, int nnz, size_t cooRows, size_t cooCols, size_t P, size_t pBuffer) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_261xcoosortByColumn(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[8] = {0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("xcoosortByColumn (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_n,&__pyx_mstate_global->__pyx_n_u_nnz,&__pyx_mstate_global->__pyx_n_u_cooRows,&__pyx_mstate_global->__pyx_n_u_cooCols,&__pyx_mstate_global->__pyx_n_u_P,&__pyx_mstate_global->__pyx_n_u_pBuffer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 3257, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 3257, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 3257, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 3257, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3257, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3257, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3257, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3257, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3257, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "xcoosortByColumn", 0) < (0)) __PYX_ERR(0, 3257, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 8; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("xcoosortByColumn", 1, 8, 8, i); __PYX_ERR(0, 3257, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 8)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3257, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3257, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3257, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3257, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3257, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 3257, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 3257, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 3257, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3258, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3258, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3258, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyLong_As_int(values[3]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3258, __pyx_L3_error)
    __pyx_v_cooRows = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_cooRows == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3258, __pyx_L3_error)
    __pyx_v_cooCols = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_cooCols == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3258, __pyx_L3_error)
    __pyx_v_P = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_P == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3259, __pyx_L3_error)
    __pyx_v_pBuffer = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_pBuffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3259, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("xcoosortByColumn", 1, 8, 8, __pyx_nargs); __PYX_ERR(0, 3257, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.xcoosortByColumn", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_260xcoosortByColumn(__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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_260xcoosortByColumn(CYTHON_UNUSED PyObject *__pyx_self, intptr_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("xcoosortByColumn", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_xcoosortByColumn(__pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_nnz, __pyx_v_cooRows, __pyx_v_cooCols, __pyx_v_P, __pyx_v_pBuffer, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3257, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3257, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":3267
 * 
 * 
 * cpdef size_t xcsrsort_bufferSizeExt(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int n, int nnz, size_t csrRowPtr,
 *         size_t csrColInd) except? -1:
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_263xcsrsort_bufferSizeExt(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static size_t __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_xcsrsort_bufferSizeExt(intptr_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_backends/cuda/libs/cusparse.pyx":3271
 *         size_t csrColInd) except? -1:
 *     cdef size_t bufferSizeInBytes
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     status = cusparseXcsrsort_bufferSizeExt(
 *         <Handle>handle, m, n, nnz, <const int *>csrRowPtr,
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3271, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":3272
 *     cdef size_t bufferSizeInBytes
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":3275
 *         <Handle>handle, m, n, nnz, <const int *>csrRowPtr,
 *         <const int *>csrColInd, &bufferSizeInBytes)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return bufferSizeInBytes
 * 
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3275, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":3276
 *         <const int *>csrColInd, &bufferSizeInBytes)
 *     check_status(status)
 *     return bufferSizeInBytes             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_r = __pyx_v_bufferSizeInBytes;
  goto __pyx_L0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":3267
 * 
 * 
 * cpdef size_t xcsrsort_bufferSizeExt(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int n, int nnz, size_t csrRowPtr,
 *         size_t csrColInd) except? -1:
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.xcsrsort_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1L;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_263xcsrsort_bufferSizeExt(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_262xcsrsort_bufferSizeExt, "xcsrsort_bufferSizeExt(intptr_t handle, int m, int n, int nnz, size_t csrRowPtr, size_t csrColInd) -> size_t");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_263xcsrsort_bufferSizeExt(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[6] = {0,0,0,0,0,0};
  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);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_n,&__pyx_mstate_global->__pyx_n_u_nnz,&__pyx_mstate_global->__pyx_n_u_csrRowPtr,&__pyx_mstate_global->__pyx_n_u_csrColInd,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 3267, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 3267, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3267, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3267, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3267, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3267, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3267, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "xcsrsort_bufferSizeExt", 0) < (0)) __PYX_ERR(0, 3267, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 6; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("xcsrsort_bufferSizeExt", 1, 6, 6, i); __PYX_ERR(0, 3267, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 6)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3267, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3267, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3267, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3267, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3267, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 3267, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3268, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3268, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3268, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyLong_As_int(values[3]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3268, __pyx_L3_error)
    __pyx_v_csrRowPtr = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_csrRowPtr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3268, __pyx_L3_error)
    __pyx_v_csrColInd = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_csrColInd == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3269, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("xcsrsort_bufferSizeExt", 1, 6, 6, __pyx_nargs); __PYX_ERR(0, 3267, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.xcsrsort_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_262xcsrsort_bufferSizeExt(__pyx_self, __pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_nnz, __pyx_v_csrRowPtr, __pyx_v_csrColInd);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_262xcsrsort_bufferSizeExt(CYTHON_UNUSED PyObject *__pyx_self, intptr_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
  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("xcsrsort_bufferSizeExt", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_xcsrsort_bufferSizeExt(__pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_nnz, __pyx_v_csrRowPtr, __pyx_v_csrColInd, 1); if (unlikely(__pyx_t_1 == ((size_t)-1L) && PyErr_Occurred())) __PYX_ERR(0, 3267, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyLong_FromSize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3267, __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_backends.cuda.libs.cusparse.xcsrsort_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy_backends/cuda/libs/cusparse.pyx":3279
 * 
 * 
 * cpdef void xcsrsort(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int n, int nnz, size_t descrA,
 *         size_t csrRowPtr, size_t csrColInd, size_t P, size_t pBuffer) except *:
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_265xcsrsort(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_xcsrsort(intptr_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;
  __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_backends/cuda/libs/cusparse.pyx":3282
 *         intptr_t handle, int m, int n, int nnz, size_t descrA,
 *         size_t csrRowPtr, size_t csrColInd, size_t P, size_t pBuffer) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     status = cusparseXcsrsort(
 *         <Handle>handle, m, n, nnz, <const MatDescr>descrA,
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3282, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":3283
 *         size_t csrRowPtr, size_t csrColInd, size_t P, size_t pBuffer) except *:
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":3286
 *         <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_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3286, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":3279
 * 
 * 
 * cpdef void xcsrsort(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int n, int nnz, size_t descrA,
 *         size_t csrRowPtr, size_t csrColInd, size_t P, size_t pBuffer) except *:
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.xcsrsort", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_265xcsrsort(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_264xcsrsort, "xcsrsort(intptr_t handle, int m, int n, int nnz, size_t descrA, size_t csrRowPtr, size_t csrColInd, size_t P, size_t pBuffer) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_265xcsrsort(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("xcsrsort (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_n,&__pyx_mstate_global->__pyx_n_u_nnz,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_csrRowPtr,&__pyx_mstate_global->__pyx_n_u_csrColInd,&__pyx_mstate_global->__pyx_n_u_P,&__pyx_mstate_global->__pyx_n_u_pBuffer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 3279, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 3279, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 3279, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 3279, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 3279, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3279, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3279, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3279, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3279, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3279, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "xcsrsort", 0) < (0)) __PYX_ERR(0, 3279, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 9; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("xcsrsort", 1, 9, 9, i); __PYX_ERR(0, 3279, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 9)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3279, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3279, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3279, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3279, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3279, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 3279, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 3279, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 3279, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 3279, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3280, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3280, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3280, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyLong_As_int(values[3]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3280, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3280, __pyx_L3_error)
    __pyx_v_csrRowPtr = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_csrRowPtr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3281, __pyx_L3_error)
    __pyx_v_csrColInd = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_csrColInd == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3281, __pyx_L3_error)
    __pyx_v_P = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_P == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3281, __pyx_L3_error)
    __pyx_v_pBuffer = __Pyx_PyLong_As_size_t(values[8]); if (unlikely((__pyx_v_pBuffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3281, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("xcsrsort", 1, 9, 9, __pyx_nargs); __PYX_ERR(0, 3279, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.xcsrsort", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_264xcsrsort(__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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_264xcsrsort(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3279, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3279, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":3289
 * 
 * 
 * cpdef size_t xcscsort_bufferSizeExt(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int n, int nnz, size_t cscColPtr,
 *         size_t cscRowInd) except? -1:
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_267xcscsort_bufferSizeExt(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static size_t __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_xcscsort_bufferSizeExt(intptr_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_backends/cuda/libs/cusparse.pyx":3293
 *         size_t cscRowInd) except? -1:
 *     cdef size_t bufferSizeInBytes
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     status = cusparseXcscsort_bufferSizeExt(
 *         <Handle>handle, m, n, nnz, <const int *>cscColPtr,
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3293, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":3294
 *     cdef size_t bufferSizeInBytes
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":3297
 *         <Handle>handle, m, n, nnz, <const int *>cscColPtr,
 *         <const int *>cscRowInd, &bufferSizeInBytes)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return bufferSizeInBytes
 * 
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3297, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":3298
 *         <const int *>cscRowInd, &bufferSizeInBytes)
 *     check_status(status)
 *     return bufferSizeInBytes             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_r = __pyx_v_bufferSizeInBytes;
  goto __pyx_L0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":3289
 * 
 * 
 * cpdef size_t xcscsort_bufferSizeExt(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int n, int nnz, size_t cscColPtr,
 *         size_t cscRowInd) except? -1:
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.xcscsort_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1L;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_267xcscsort_bufferSizeExt(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_266xcscsort_bufferSizeExt, "xcscsort_bufferSizeExt(intptr_t handle, int m, int n, int nnz, size_t cscColPtr, size_t cscRowInd) -> size_t");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_267xcscsort_bufferSizeExt(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[6] = {0,0,0,0,0,0};
  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);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_n,&__pyx_mstate_global->__pyx_n_u_nnz,&__pyx_mstate_global->__pyx_n_u_cscColPtr,&__pyx_mstate_global->__pyx_n_u_cscRowInd,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 3289, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 3289, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3289, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3289, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3289, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3289, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3289, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "xcscsort_bufferSizeExt", 0) < (0)) __PYX_ERR(0, 3289, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 6; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("xcscsort_bufferSizeExt", 1, 6, 6, i); __PYX_ERR(0, 3289, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 6)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3289, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3289, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3289, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3289, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3289, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 3289, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3290, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3290, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3290, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyLong_As_int(values[3]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3290, __pyx_L3_error)
    __pyx_v_cscColPtr = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_cscColPtr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3290, __pyx_L3_error)
    __pyx_v_cscRowInd = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_cscRowInd == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3291, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("xcscsort_bufferSizeExt", 1, 6, 6, __pyx_nargs); __PYX_ERR(0, 3289, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.xcscsort_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_266xcscsort_bufferSizeExt(__pyx_self, __pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_nnz, __pyx_v_cscColPtr, __pyx_v_cscRowInd);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_266xcscsort_bufferSizeExt(CYTHON_UNUSED PyObject *__pyx_self, intptr_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
  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("xcscsort_bufferSizeExt", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_xcscsort_bufferSizeExt(__pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_nnz, __pyx_v_cscColPtr, __pyx_v_cscRowInd, 1); if (unlikely(__pyx_t_1 == ((size_t)-1L) && PyErr_Occurred())) __PYX_ERR(0, 3289, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyLong_FromSize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3289, __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_backends.cuda.libs.cusparse.xcscsort_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy_backends/cuda/libs/cusparse.pyx":3301
 * 
 * 
 * cpdef void xcscsort(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int n, int nnz, size_t descrA,
 *         size_t cscColPtr, size_t cscRowInd, size_t P, size_t pBuffer) except *:
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_269xcscsort(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_xcscsort(intptr_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;
  __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_backends/cuda/libs/cusparse.pyx":3304
 *         intptr_t handle, int m, int n, int nnz, size_t descrA,
 *         size_t cscColPtr, size_t cscRowInd, size_t P, size_t pBuffer) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     status = cusparseXcscsort(
 *         <Handle>handle, m, n, nnz, <const MatDescr>descrA,
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3304, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":3305
 *         size_t cscColPtr, size_t cscRowInd, size_t P, size_t pBuffer) except *:
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":3308
 *         <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_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3308, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":3301
 * 
 * 
 * cpdef void xcscsort(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int n, int nnz, size_t descrA,
 *         size_t cscColPtr, size_t cscRowInd, size_t P, size_t pBuffer) except *:
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.xcscsort", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_269xcscsort(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_268xcscsort, "xcscsort(intptr_t handle, int m, int n, int nnz, size_t descrA, size_t cscColPtr, size_t cscRowInd, size_t P, size_t pBuffer) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_269xcscsort(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("xcscsort (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_n,&__pyx_mstate_global->__pyx_n_u_nnz,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_cscColPtr,&__pyx_mstate_global->__pyx_n_u_cscRowInd,&__pyx_mstate_global->__pyx_n_u_P,&__pyx_mstate_global->__pyx_n_u_pBuffer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 3301, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 3301, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 3301, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 3301, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 3301, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3301, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3301, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3301, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3301, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3301, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "xcscsort", 0) < (0)) __PYX_ERR(0, 3301, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 9; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("xcscsort", 1, 9, 9, i); __PYX_ERR(0, 3301, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 9)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3301, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3301, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3301, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3301, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3301, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 3301, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 3301, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 3301, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 3301, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3302, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3302, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3302, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyLong_As_int(values[3]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3302, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3302, __pyx_L3_error)
    __pyx_v_cscColPtr = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_cscColPtr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3303, __pyx_L3_error)
    __pyx_v_cscRowInd = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_cscRowInd == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3303, __pyx_L3_error)
    __pyx_v_P = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_P == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3303, __pyx_L3_error)
    __pyx_v_pBuffer = __Pyx_PyLong_As_size_t(values[8]); if (unlikely((__pyx_v_pBuffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3303, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("xcscsort", 1, 9, 9, __pyx_nargs); __PYX_ERR(0, 3301, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.xcscsort", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_268xcscsort(__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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_268xcscsort(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3301, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3301, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":3313
 * # cuSPARSE PRECONDITIONERS
 * 
 * cpdef size_t createCsrilu02Info() except? -1:             # <<<<<<<<<<<<<<
 *     cdef csrilu02Info_t info
 *     with nogil:
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_271createCsrilu02Info(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static size_t __pyx_f_13cupy_backends_4cuda_4libs_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_backends/cuda/libs/cusparse.pyx":3315
 * cpdef size_t createCsrilu02Info() except? -1:
 *     cdef csrilu02Info_t info
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseCreateCsrilu02Info(&info)
 *     check_status(status)
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "cupy_backends/cuda/libs/cusparse.pyx":3316
 *     cdef csrilu02Info_t info
 *     with nogil:
 *         status = cusparseCreateCsrilu02Info(&info)             # <<<<<<<<<<<<<<
 *     check_status(status)
 *     return <size_t>info
*/
        __pyx_v_status = cusparseCreateCsrilu02Info((&__pyx_v_info));
      }

      /* "cupy_backends/cuda/libs/cusparse.pyx":3315
 * cpdef size_t createCsrilu02Info() except? -1:
 *     cdef csrilu02Info_t info
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseCreateCsrilu02Info(&info)
 *     check_status(status)
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy_backends/cuda/libs/cusparse.pyx":3317
 *     with nogil:
 *         status = cusparseCreateCsrilu02Info(&info)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return <size_t>info
 * 
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3317, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":3318
 *         status = cusparseCreateCsrilu02Info(&info)
 *     check_status(status)
 *     return <size_t>info             # <<<<<<<<<<<<<<
 * 
 * cpdef void destroyCsrilu02Info(size_t info) except *:
*/
  __pyx_r = ((size_t)__pyx_v_info);
  goto __pyx_L0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":3313
 * # cuSPARSE PRECONDITIONERS
 * 
 * cpdef size_t createCsrilu02Info() except? -1:             # <<<<<<<<<<<<<<
 *     cdef csrilu02Info_t info
 *     with nogil:
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.createCsrilu02Info", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1L;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_271createCsrilu02Info(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_270createCsrilu02Info, "createCsrilu02Info() -> size_t");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_271createCsrilu02Info(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("createCsrilu02Info (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_270createCsrilu02Info(__pyx_self);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_270createCsrilu02Info(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("createCsrilu02Info", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_createCsrilu02Info(1); if (unlikely(__pyx_t_1 == ((size_t)-1L) && PyErr_Occurred())) __PYX_ERR(0, 3313, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyLong_FromSize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3313, __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_backends.cuda.libs.cusparse.createCsrilu02Info", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy_backends/cuda/libs/cusparse.pyx":3320
 *     return <size_t>info
 * 
 * cpdef void destroyCsrilu02Info(size_t info) except *:             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseDestroyCsrilu02Info(<csrilu02Info_t>info)
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_273destroyCsrilu02Info(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_destroyCsrilu02Info(size_t __pyx_v_info, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  __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_backends/cuda/libs/cusparse.pyx":3321
 * 
 * cpdef void destroyCsrilu02Info(size_t info) except *:
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseDestroyCsrilu02Info(<csrilu02Info_t>info)
 *     check_status(status)
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "cupy_backends/cuda/libs/cusparse.pyx":3322
 * cpdef void destroyCsrilu02Info(size_t info) except *:
 *     with nogil:
 *         status = cusparseDestroyCsrilu02Info(<csrilu02Info_t>info)             # <<<<<<<<<<<<<<
 *     check_status(status)
 * 
*/
        __pyx_v_status = cusparseDestroyCsrilu02Info(((csrilu02Info_t)__pyx_v_info));
      }

      /* "cupy_backends/cuda/libs/cusparse.pyx":3321
 * 
 * cpdef void destroyCsrilu02Info(size_t info) except *:
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseDestroyCsrilu02Info(<csrilu02Info_t>info)
 *     check_status(status)
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy_backends/cuda/libs/cusparse.pyx":3323
 *     with nogil:
 *         status = cusparseDestroyCsrilu02Info(<csrilu02Info_t>info)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef size_t createBsrilu02Info() except? -1:
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3323, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":3320
 *     return <size_t>info
 * 
 * cpdef void destroyCsrilu02Info(size_t info) except *:             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseDestroyCsrilu02Info(<csrilu02Info_t>info)
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.destroyCsrilu02Info", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_273destroyCsrilu02Info(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_272destroyCsrilu02Info, "destroyCsrilu02Info(size_t info) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_273destroyCsrilu02Info(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  size_t __pyx_v_info;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("destroyCsrilu02Info (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_info,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 3320, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3320, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "destroyCsrilu02Info", 0) < (0)) __PYX_ERR(0, 3320, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("destroyCsrilu02Info", 1, 1, 1, i); __PYX_ERR(0, 3320, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3320, __pyx_L3_error)
    }
    __pyx_v_info = __Pyx_PyLong_As_size_t(values[0]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3320, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("destroyCsrilu02Info", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 3320, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.destroyCsrilu02Info", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_272destroyCsrilu02Info(__pyx_self, __pyx_v_info);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_272destroyCsrilu02Info(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_f_13cupy_backends_4cuda_4libs_8cusparse_destroyCsrilu02Info(__pyx_v_info, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3320, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3320, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":3325
 *     check_status(status)
 * 
 * cpdef size_t createBsrilu02Info() except? -1:             # <<<<<<<<<<<<<<
 *     cdef bsrilu02Info_t info
 *     with nogil:
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_275createBsrilu02Info(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static size_t __pyx_f_13cupy_backends_4cuda_4libs_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_backends/cuda/libs/cusparse.pyx":3327
 * cpdef size_t createBsrilu02Info() except? -1:
 *     cdef bsrilu02Info_t info
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseCreateBsrilu02Info(&info)
 *     check_status(status)
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "cupy_backends/cuda/libs/cusparse.pyx":3328
 *     cdef bsrilu02Info_t info
 *     with nogil:
 *         status = cusparseCreateBsrilu02Info(&info)             # <<<<<<<<<<<<<<
 *     check_status(status)
 *     return <size_t>info
*/
        __pyx_v_status = cusparseCreateBsrilu02Info((&__pyx_v_info));
      }

      /* "cupy_backends/cuda/libs/cusparse.pyx":3327
 * cpdef size_t createBsrilu02Info() except? -1:
 *     cdef bsrilu02Info_t info
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseCreateBsrilu02Info(&info)
 *     check_status(status)
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy_backends/cuda/libs/cusparse.pyx":3329
 *     with nogil:
 *         status = cusparseCreateBsrilu02Info(&info)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return <size_t>info
 * 
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3329, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":3330
 *         status = cusparseCreateBsrilu02Info(&info)
 *     check_status(status)
 *     return <size_t>info             # <<<<<<<<<<<<<<
 * 
 * cpdef void destroyBsrilu02Info(size_t info) except *:
*/
  __pyx_r = ((size_t)__pyx_v_info);
  goto __pyx_L0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":3325
 *     check_status(status)
 * 
 * cpdef size_t createBsrilu02Info() except? -1:             # <<<<<<<<<<<<<<
 *     cdef bsrilu02Info_t info
 *     with nogil:
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.createBsrilu02Info", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1L;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_275createBsrilu02Info(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_274createBsrilu02Info, "createBsrilu02Info() -> size_t");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_275createBsrilu02Info(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("createBsrilu02Info (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_274createBsrilu02Info(__pyx_self);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_274createBsrilu02Info(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("createBsrilu02Info", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_createBsrilu02Info(1); if (unlikely(__pyx_t_1 == ((size_t)-1L) && PyErr_Occurred())) __PYX_ERR(0, 3325, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyLong_FromSize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3325, __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_backends.cuda.libs.cusparse.createBsrilu02Info", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy_backends/cuda/libs/cusparse.pyx":3332
 *     return <size_t>info
 * 
 * cpdef void destroyBsrilu02Info(size_t info) except *:             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseDestroyBsrilu02Info(<bsrilu02Info_t>info)
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_277destroyBsrilu02Info(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_destroyBsrilu02Info(size_t __pyx_v_info, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  __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_backends/cuda/libs/cusparse.pyx":3333
 * 
 * cpdef void destroyBsrilu02Info(size_t info) except *:
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseDestroyBsrilu02Info(<bsrilu02Info_t>info)
 *     check_status(status)
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "cupy_backends/cuda/libs/cusparse.pyx":3334
 * cpdef void destroyBsrilu02Info(size_t info) except *:
 *     with nogil:
 *         status = cusparseDestroyBsrilu02Info(<bsrilu02Info_t>info)             # <<<<<<<<<<<<<<
 *     check_status(status)
 * 
*/
        __pyx_v_status = cusparseDestroyBsrilu02Info(((bsrilu02Info_t)__pyx_v_info));
      }

      /* "cupy_backends/cuda/libs/cusparse.pyx":3333
 * 
 * cpdef void destroyBsrilu02Info(size_t info) except *:
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseDestroyBsrilu02Info(<bsrilu02Info_t>info)
 *     check_status(status)
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy_backends/cuda/libs/cusparse.pyx":3335
 *     with nogil:
 *         status = cusparseDestroyBsrilu02Info(<bsrilu02Info_t>info)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef size_t createCsric02Info() except? -1:
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3335, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":3332
 *     return <size_t>info
 * 
 * cpdef void destroyBsrilu02Info(size_t info) except *:             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseDestroyBsrilu02Info(<bsrilu02Info_t>info)
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.destroyBsrilu02Info", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_277destroyBsrilu02Info(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_276destroyBsrilu02Info, "destroyBsrilu02Info(size_t info) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_277destroyBsrilu02Info(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  size_t __pyx_v_info;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("destroyBsrilu02Info (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_info,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 3332, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3332, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "destroyBsrilu02Info", 0) < (0)) __PYX_ERR(0, 3332, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("destroyBsrilu02Info", 1, 1, 1, i); __PYX_ERR(0, 3332, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3332, __pyx_L3_error)
    }
    __pyx_v_info = __Pyx_PyLong_As_size_t(values[0]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3332, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("destroyBsrilu02Info", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 3332, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.destroyBsrilu02Info", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_276destroyBsrilu02Info(__pyx_self, __pyx_v_info);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_276destroyBsrilu02Info(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_f_13cupy_backends_4cuda_4libs_8cusparse_destroyBsrilu02Info(__pyx_v_info, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3332, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3332, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":3337
 *     check_status(status)
 * 
 * cpdef size_t createCsric02Info() except? -1:             # <<<<<<<<<<<<<<
 *     cdef csric02Info_t info
 *     with nogil:
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_279createCsric02Info(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static size_t __pyx_f_13cupy_backends_4cuda_4libs_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_backends/cuda/libs/cusparse.pyx":3339
 * cpdef size_t createCsric02Info() except? -1:
 *     cdef csric02Info_t info
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseCreateCsric02Info(&info)
 *     check_status(status)
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "cupy_backends/cuda/libs/cusparse.pyx":3340
 *     cdef csric02Info_t info
 *     with nogil:
 *         status = cusparseCreateCsric02Info(&info)             # <<<<<<<<<<<<<<
 *     check_status(status)
 *     return <size_t>info
*/
        __pyx_v_status = cusparseCreateCsric02Info((&__pyx_v_info));
      }

      /* "cupy_backends/cuda/libs/cusparse.pyx":3339
 * cpdef size_t createCsric02Info() except? -1:
 *     cdef csric02Info_t info
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseCreateCsric02Info(&info)
 *     check_status(status)
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy_backends/cuda/libs/cusparse.pyx":3341
 *     with nogil:
 *         status = cusparseCreateCsric02Info(&info)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return <size_t>info
 * 
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3341, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":3342
 *         status = cusparseCreateCsric02Info(&info)
 *     check_status(status)
 *     return <size_t>info             # <<<<<<<<<<<<<<
 * 
 * cpdef void destroyCsric02Info(size_t info) except *:
*/
  __pyx_r = ((size_t)__pyx_v_info);
  goto __pyx_L0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":3337
 *     check_status(status)
 * 
 * cpdef size_t createCsric02Info() except? -1:             # <<<<<<<<<<<<<<
 *     cdef csric02Info_t info
 *     with nogil:
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.createCsric02Info", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1L;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_279createCsric02Info(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_278createCsric02Info, "createCsric02Info() -> size_t");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_279createCsric02Info(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("createCsric02Info (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_278createCsric02Info(__pyx_self);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_278createCsric02Info(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("createCsric02Info", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_createCsric02Info(1); if (unlikely(__pyx_t_1 == ((size_t)-1L) && PyErr_Occurred())) __PYX_ERR(0, 3337, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyLong_FromSize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3337, __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_backends.cuda.libs.cusparse.createCsric02Info", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy_backends/cuda/libs/cusparse.pyx":3344
 *     return <size_t>info
 * 
 * cpdef void destroyCsric02Info(size_t info) except *:             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseDestroyCsric02Info(<csric02Info_t>info)
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_281destroyCsric02Info(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_destroyCsric02Info(size_t __pyx_v_info, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  __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_backends/cuda/libs/cusparse.pyx":3345
 * 
 * cpdef void destroyCsric02Info(size_t info) except *:
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseDestroyCsric02Info(<csric02Info_t>info)
 *     check_status(status)
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "cupy_backends/cuda/libs/cusparse.pyx":3346
 * cpdef void destroyCsric02Info(size_t info) except *:
 *     with nogil:
 *         status = cusparseDestroyCsric02Info(<csric02Info_t>info)             # <<<<<<<<<<<<<<
 *     check_status(status)
 * 
*/
        __pyx_v_status = cusparseDestroyCsric02Info(((csric02Info_t)__pyx_v_info));
      }

      /* "cupy_backends/cuda/libs/cusparse.pyx":3345
 * 
 * cpdef void destroyCsric02Info(size_t info) except *:
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseDestroyCsric02Info(<csric02Info_t>info)
 *     check_status(status)
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy_backends/cuda/libs/cusparse.pyx":3347
 *     with nogil:
 *         status = cusparseDestroyCsric02Info(<csric02Info_t>info)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef size_t createBsric02Info() except? -1:
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3347, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":3344
 *     return <size_t>info
 * 
 * cpdef void destroyCsric02Info(size_t info) except *:             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseDestroyCsric02Info(<csric02Info_t>info)
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.destroyCsric02Info", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_281destroyCsric02Info(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_280destroyCsric02Info, "destroyCsric02Info(size_t info) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_281destroyCsric02Info(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  size_t __pyx_v_info;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("destroyCsric02Info (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_info,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 3344, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3344, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "destroyCsric02Info", 0) < (0)) __PYX_ERR(0, 3344, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("destroyCsric02Info", 1, 1, 1, i); __PYX_ERR(0, 3344, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3344, __pyx_L3_error)
    }
    __pyx_v_info = __Pyx_PyLong_As_size_t(values[0]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3344, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("destroyCsric02Info", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 3344, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.destroyCsric02Info", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_280destroyCsric02Info(__pyx_self, __pyx_v_info);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_280destroyCsric02Info(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_f_13cupy_backends_4cuda_4libs_8cusparse_destroyCsric02Info(__pyx_v_info, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3344, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3344, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":3349
 *     check_status(status)
 * 
 * cpdef size_t createBsric02Info() except? -1:             # <<<<<<<<<<<<<<
 *     cdef bsric02Info_t info
 *     with nogil:
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_283createBsric02Info(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static size_t __pyx_f_13cupy_backends_4cuda_4libs_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_backends/cuda/libs/cusparse.pyx":3351
 * cpdef size_t createBsric02Info() except? -1:
 *     cdef bsric02Info_t info
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseCreateBsric02Info(&info)
 *     check_status(status)
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "cupy_backends/cuda/libs/cusparse.pyx":3352
 *     cdef bsric02Info_t info
 *     with nogil:
 *         status = cusparseCreateBsric02Info(&info)             # <<<<<<<<<<<<<<
 *     check_status(status)
 *     return <size_t>info
*/
        __pyx_v_status = cusparseCreateBsric02Info((&__pyx_v_info));
      }

      /* "cupy_backends/cuda/libs/cusparse.pyx":3351
 * cpdef size_t createBsric02Info() except? -1:
 *     cdef bsric02Info_t info
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseCreateBsric02Info(&info)
 *     check_status(status)
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy_backends/cuda/libs/cusparse.pyx":3353
 *     with nogil:
 *         status = cusparseCreateBsric02Info(&info)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return <size_t>info
 * 
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3353, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":3354
 *         status = cusparseCreateBsric02Info(&info)
 *     check_status(status)
 *     return <size_t>info             # <<<<<<<<<<<<<<
 * 
 * cpdef void destroyBsric02Info(size_t info) except *:
*/
  __pyx_r = ((size_t)__pyx_v_info);
  goto __pyx_L0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":3349
 *     check_status(status)
 * 
 * cpdef size_t createBsric02Info() except? -1:             # <<<<<<<<<<<<<<
 *     cdef bsric02Info_t info
 *     with nogil:
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.createBsric02Info", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1L;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_283createBsric02Info(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_282createBsric02Info, "createBsric02Info() -> size_t");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_283createBsric02Info(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("createBsric02Info (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_282createBsric02Info(__pyx_self);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_282createBsric02Info(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("createBsric02Info", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_createBsric02Info(1); if (unlikely(__pyx_t_1 == ((size_t)-1L) && PyErr_Occurred())) __PYX_ERR(0, 3349, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyLong_FromSize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3349, __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_backends.cuda.libs.cusparse.createBsric02Info", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy_backends/cuda/libs/cusparse.pyx":3356
 *     return <size_t>info
 * 
 * cpdef void destroyBsric02Info(size_t info) except *:             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseDestroyBsric02Info(<bsric02Info_t>info)
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_285destroyBsric02Info(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_destroyBsric02Info(size_t __pyx_v_info, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  __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_backends/cuda/libs/cusparse.pyx":3357
 * 
 * cpdef void destroyBsric02Info(size_t info) except *:
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseDestroyBsric02Info(<bsric02Info_t>info)
 *     check_status(status)
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "cupy_backends/cuda/libs/cusparse.pyx":3358
 * cpdef void destroyBsric02Info(size_t info) except *:
 *     with nogil:
 *         status = cusparseDestroyBsric02Info(<bsric02Info_t>info)             # <<<<<<<<<<<<<<
 *     check_status(status)
 * 
*/
        __pyx_v_status = cusparseDestroyBsric02Info(((bsric02Info_t)__pyx_v_info));
      }

      /* "cupy_backends/cuda/libs/cusparse.pyx":3357
 * 
 * cpdef void destroyBsric02Info(size_t info) except *:
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseDestroyBsric02Info(<bsric02Info_t>info)
 *     check_status(status)
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy_backends/cuda/libs/cusparse.pyx":3359
 *     with nogil:
 *         status = cusparseDestroyBsric02Info(<bsric02Info_t>info)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef void scsrilu02_numericBoost(
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3359, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":3356
 *     return <size_t>info
 * 
 * cpdef void destroyBsric02Info(size_t info) except *:             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseDestroyBsric02Info(<bsric02Info_t>info)
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.destroyBsric02Info", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_285destroyBsric02Info(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_284destroyBsric02Info, "destroyBsric02Info(size_t info) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_285destroyBsric02Info(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  size_t __pyx_v_info;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("destroyBsric02Info (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_info,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 3356, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3356, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "destroyBsric02Info", 0) < (0)) __PYX_ERR(0, 3356, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("destroyBsric02Info", 1, 1, 1, i); __PYX_ERR(0, 3356, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3356, __pyx_L3_error)
    }
    __pyx_v_info = __Pyx_PyLong_As_size_t(values[0]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3356, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("destroyBsric02Info", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 3356, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.destroyBsric02Info", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_284destroyBsric02Info(__pyx_self, __pyx_v_info);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_284destroyBsric02Info(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_f_13cupy_backends_4cuda_4libs_8cusparse_destroyBsric02Info(__pyx_v_info, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3356, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); 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_backends.cuda.libs.cusparse.destroyBsric02Info", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy_backends/cuda/libs/cusparse.pyx":3361
 *     check_status(status)
 * 
 * cpdef void scsrilu02_numericBoost(             # <<<<<<<<<<<<<<
 *         intptr_t handle, size_t info, int enable_boost,
 *         size_t tol, size_t boost_val) except *:
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_287scsrilu02_numericBoost(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_scsrilu02_numericBoost(intptr_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;
  __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_backends/cuda/libs/cusparse.pyx":3364
 *         intptr_t handle, size_t info, int enable_boost,
 *         size_t tol, size_t boost_val) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseScsrilu02_numericBoost(
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3364, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":3365
 *         size_t tol, size_t boost_val) except *:
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseScsrilu02_numericBoost(
 *             <cusparseHandle_t>handle, <csrilu02Info_t>info, enable_boost,
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "cupy_backends/cuda/libs/cusparse.pyx":3366
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":3365
 *         size_t tol, size_t boost_val) except *:
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseScsrilu02_numericBoost(
 *             <cusparseHandle_t>handle, <csrilu02Info_t>info, enable_boost,
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy_backends/cuda/libs/cusparse.pyx":3369
 *             <cusparseHandle_t>handle, <csrilu02Info_t>info, enable_boost,
 *             <double*>tol, <float*>boost_val)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef void dcsrilu02_numericBoost(
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3369, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":3361
 *     check_status(status)
 * 
 * cpdef void scsrilu02_numericBoost(             # <<<<<<<<<<<<<<
 *         intptr_t handle, size_t info, int enable_boost,
 *         size_t tol, size_t boost_val) except *:
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.scsrilu02_numericBoost", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_287scsrilu02_numericBoost(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_286scsrilu02_numericBoost, "scsrilu02_numericBoost(intptr_t handle, size_t info, int enable_boost, size_t tol, size_t boost_val) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_287scsrilu02_numericBoost(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[5] = {0,0,0,0,0};
  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);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_info,&__pyx_mstate_global->__pyx_n_u_enable_boost,&__pyx_mstate_global->__pyx_n_u_tol,&__pyx_mstate_global->__pyx_n_u_boost_val,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 3361, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3361, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3361, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3361, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3361, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3361, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "scsrilu02_numericBoost", 0) < (0)) __PYX_ERR(0, 3361, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 5; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("scsrilu02_numericBoost", 1, 5, 5, i); __PYX_ERR(0, 3361, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 5)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3361, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3361, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3361, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3361, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3361, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3362, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyLong_As_size_t(values[1]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3362, __pyx_L3_error)
    __pyx_v_enable_boost = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_enable_boost == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3362, __pyx_L3_error)
    __pyx_v_tol = __Pyx_PyLong_As_size_t(values[3]); if (unlikely((__pyx_v_tol == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3363, __pyx_L3_error)
    __pyx_v_boost_val = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_boost_val == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3363, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("scsrilu02_numericBoost", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 3361, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.scsrilu02_numericBoost", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_286scsrilu02_numericBoost(__pyx_self, __pyx_v_handle, __pyx_v_info, __pyx_v_enable_boost, __pyx_v_tol, __pyx_v_boost_val);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_286scsrilu02_numericBoost(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_f_13cupy_backends_4cuda_4libs_8cusparse_scsrilu02_numericBoost(__pyx_v_handle, __pyx_v_info, __pyx_v_enable_boost, __pyx_v_tol, __pyx_v_boost_val, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3361, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3361, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":3371
 *     check_status(status)
 * 
 * cpdef void dcsrilu02_numericBoost(             # <<<<<<<<<<<<<<
 *         intptr_t handle, size_t info, int enable_boost,
 *         size_t tol, size_t boost_val) except *:
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_289dcsrilu02_numericBoost(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_dcsrilu02_numericBoost(intptr_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;
  __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_backends/cuda/libs/cusparse.pyx":3374
 *         intptr_t handle, size_t info, int enable_boost,
 *         size_t tol, size_t boost_val) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseDcsrilu02_numericBoost(
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3374, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":3375
 *         size_t tol, size_t boost_val) except *:
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseDcsrilu02_numericBoost(
 *             <cusparseHandle_t>handle, <csrilu02Info_t>info, enable_boost,
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "cupy_backends/cuda/libs/cusparse.pyx":3376
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":3375
 *         size_t tol, size_t boost_val) except *:
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseDcsrilu02_numericBoost(
 *             <cusparseHandle_t>handle, <csrilu02Info_t>info, enable_boost,
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy_backends/cuda/libs/cusparse.pyx":3379
 *             <cusparseHandle_t>handle, <csrilu02Info_t>info, enable_boost,
 *             <double*>tol, <double*>boost_val)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef void ccsrilu02_numericBoost(
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3379, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":3371
 *     check_status(status)
 * 
 * cpdef void dcsrilu02_numericBoost(             # <<<<<<<<<<<<<<
 *         intptr_t handle, size_t info, int enable_boost,
 *         size_t tol, size_t boost_val) except *:
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.dcsrilu02_numericBoost", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_289dcsrilu02_numericBoost(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_288dcsrilu02_numericBoost, "dcsrilu02_numericBoost(intptr_t handle, size_t info, int enable_boost, size_t tol, size_t boost_val) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_289dcsrilu02_numericBoost(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[5] = {0,0,0,0,0};
  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);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_info,&__pyx_mstate_global->__pyx_n_u_enable_boost,&__pyx_mstate_global->__pyx_n_u_tol,&__pyx_mstate_global->__pyx_n_u_boost_val,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 3371, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3371, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3371, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3371, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3371, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3371, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "dcsrilu02_numericBoost", 0) < (0)) __PYX_ERR(0, 3371, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 5; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("dcsrilu02_numericBoost", 1, 5, 5, i); __PYX_ERR(0, 3371, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 5)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3371, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3371, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3371, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3371, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3371, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3372, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyLong_As_size_t(values[1]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3372, __pyx_L3_error)
    __pyx_v_enable_boost = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_enable_boost == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3372, __pyx_L3_error)
    __pyx_v_tol = __Pyx_PyLong_As_size_t(values[3]); if (unlikely((__pyx_v_tol == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3373, __pyx_L3_error)
    __pyx_v_boost_val = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_boost_val == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3373, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("dcsrilu02_numericBoost", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 3371, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.dcsrilu02_numericBoost", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_288dcsrilu02_numericBoost(__pyx_self, __pyx_v_handle, __pyx_v_info, __pyx_v_enable_boost, __pyx_v_tol, __pyx_v_boost_val);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_288dcsrilu02_numericBoost(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_f_13cupy_backends_4cuda_4libs_8cusparse_dcsrilu02_numericBoost(__pyx_v_handle, __pyx_v_info, __pyx_v_enable_boost, __pyx_v_tol, __pyx_v_boost_val, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3371, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3371, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":3381
 *     check_status(status)
 * 
 * cpdef void ccsrilu02_numericBoost(             # <<<<<<<<<<<<<<
 *         intptr_t handle, size_t info, int enable_boost,
 *         size_t tol, size_t boost_val) except *:
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_291ccsrilu02_numericBoost(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_ccsrilu02_numericBoost(intptr_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;
  __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_backends/cuda/libs/cusparse.pyx":3384
 *         intptr_t handle, size_t info, int enable_boost,
 *         size_t tol, size_t boost_val) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseCcsrilu02_numericBoost(
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3384, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":3385
 *         size_t tol, size_t boost_val) except *:
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseCcsrilu02_numericBoost(
 *             <cusparseHandle_t>handle, <csrilu02Info_t>info, enable_boost,
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "cupy_backends/cuda/libs/cusparse.pyx":3386
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":3385
 *         size_t tol, size_t boost_val) except *:
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseCcsrilu02_numericBoost(
 *             <cusparseHandle_t>handle, <csrilu02Info_t>info, enable_boost,
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy_backends/cuda/libs/cusparse.pyx":3389
 *             <cusparseHandle_t>handle, <csrilu02Info_t>info, enable_boost,
 *             <double*>tol, <cuComplex*>boost_val)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef void zcsrilu02_numericBoost(
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3389, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":3381
 *     check_status(status)
 * 
 * cpdef void ccsrilu02_numericBoost(             # <<<<<<<<<<<<<<
 *         intptr_t handle, size_t info, int enable_boost,
 *         size_t tol, size_t boost_val) except *:
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.ccsrilu02_numericBoost", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_291ccsrilu02_numericBoost(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_290ccsrilu02_numericBoost, "ccsrilu02_numericBoost(intptr_t handle, size_t info, int enable_boost, size_t tol, size_t boost_val) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_291ccsrilu02_numericBoost(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[5] = {0,0,0,0,0};
  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);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_info,&__pyx_mstate_global->__pyx_n_u_enable_boost,&__pyx_mstate_global->__pyx_n_u_tol,&__pyx_mstate_global->__pyx_n_u_boost_val,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 3381, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3381, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3381, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3381, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3381, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3381, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "ccsrilu02_numericBoost", 0) < (0)) __PYX_ERR(0, 3381, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 5; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("ccsrilu02_numericBoost", 1, 5, 5, i); __PYX_ERR(0, 3381, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 5)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3381, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3381, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3381, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3381, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3381, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3382, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyLong_As_size_t(values[1]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3382, __pyx_L3_error)
    __pyx_v_enable_boost = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_enable_boost == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3382, __pyx_L3_error)
    __pyx_v_tol = __Pyx_PyLong_As_size_t(values[3]); if (unlikely((__pyx_v_tol == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3383, __pyx_L3_error)
    __pyx_v_boost_val = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_boost_val == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3383, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ccsrilu02_numericBoost", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 3381, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.ccsrilu02_numericBoost", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_290ccsrilu02_numericBoost(__pyx_self, __pyx_v_handle, __pyx_v_info, __pyx_v_enable_boost, __pyx_v_tol, __pyx_v_boost_val);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_290ccsrilu02_numericBoost(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_f_13cupy_backends_4cuda_4libs_8cusparse_ccsrilu02_numericBoost(__pyx_v_handle, __pyx_v_info, __pyx_v_enable_boost, __pyx_v_tol, __pyx_v_boost_val, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3381, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3381, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":3391
 *     check_status(status)
 * 
 * cpdef void zcsrilu02_numericBoost(             # <<<<<<<<<<<<<<
 *         intptr_t handle, size_t info, int enable_boost,
 *         size_t tol, size_t boost_val) except *:
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_293zcsrilu02_numericBoost(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_zcsrilu02_numericBoost(intptr_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;
  __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_backends/cuda/libs/cusparse.pyx":3394
 *         intptr_t handle, size_t info, int enable_boost,
 *         size_t tol, size_t boost_val) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseZcsrilu02_numericBoost(
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3394, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":3395
 *         size_t tol, size_t boost_val) except *:
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseZcsrilu02_numericBoost(
 *             <cusparseHandle_t>handle, <csrilu02Info_t>info, enable_boost,
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "cupy_backends/cuda/libs/cusparse.pyx":3396
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":3395
 *         size_t tol, size_t boost_val) except *:
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseZcsrilu02_numericBoost(
 *             <cusparseHandle_t>handle, <csrilu02Info_t>info, enable_boost,
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy_backends/cuda/libs/cusparse.pyx":3399
 *             <cusparseHandle_t>handle, <csrilu02Info_t>info, enable_boost,
 *             <double*>tol, <cuDoubleComplex*>boost_val)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef void xcsrilu02_zeroPivot(
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3399, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":3391
 *     check_status(status)
 * 
 * cpdef void zcsrilu02_numericBoost(             # <<<<<<<<<<<<<<
 *         intptr_t handle, size_t info, int enable_boost,
 *         size_t tol, size_t boost_val) except *:
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.zcsrilu02_numericBoost", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_293zcsrilu02_numericBoost(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_292zcsrilu02_numericBoost, "zcsrilu02_numericBoost(intptr_t handle, size_t info, int enable_boost, size_t tol, size_t boost_val) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_293zcsrilu02_numericBoost(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[5] = {0,0,0,0,0};
  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);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_info,&__pyx_mstate_global->__pyx_n_u_enable_boost,&__pyx_mstate_global->__pyx_n_u_tol,&__pyx_mstate_global->__pyx_n_u_boost_val,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 3391, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3391, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3391, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3391, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3391, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3391, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "zcsrilu02_numericBoost", 0) < (0)) __PYX_ERR(0, 3391, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 5; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("zcsrilu02_numericBoost", 1, 5, 5, i); __PYX_ERR(0, 3391, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 5)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3391, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3391, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3391, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3391, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3391, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3392, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyLong_As_size_t(values[1]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3392, __pyx_L3_error)
    __pyx_v_enable_boost = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_enable_boost == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3392, __pyx_L3_error)
    __pyx_v_tol = __Pyx_PyLong_As_size_t(values[3]); if (unlikely((__pyx_v_tol == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3393, __pyx_L3_error)
    __pyx_v_boost_val = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_boost_val == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3393, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("zcsrilu02_numericBoost", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 3391, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.zcsrilu02_numericBoost", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_292zcsrilu02_numericBoost(__pyx_self, __pyx_v_handle, __pyx_v_info, __pyx_v_enable_boost, __pyx_v_tol, __pyx_v_boost_val);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_292zcsrilu02_numericBoost(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_f_13cupy_backends_4cuda_4libs_8cusparse_zcsrilu02_numericBoost(__pyx_v_handle, __pyx_v_info, __pyx_v_enable_boost, __pyx_v_tol, __pyx_v_boost_val, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3391, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3391, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":3401
 *     check_status(status)
 * 
 * cpdef void xcsrilu02_zeroPivot(             # <<<<<<<<<<<<<<
 *         intptr_t handle, size_t info, size_t position) except *:
 *     _setStream(handle)
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_295xcsrilu02_zeroPivot(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_xcsrilu02_zeroPivot(intptr_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;
  __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_backends/cuda/libs/cusparse.pyx":3403
 * cpdef void xcsrilu02_zeroPivot(
 *         intptr_t handle, size_t info, size_t position) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseXcsrilu02_zeroPivot(
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3403, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":3404
 *         intptr_t handle, size_t info, size_t position) except *:
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseXcsrilu02_zeroPivot(
 *             <cusparseHandle_t>handle, <csrilu02Info_t>info, <int*>position)
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "cupy_backends/cuda/libs/cusparse.pyx":3405
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":3404
 *         intptr_t handle, size_t info, size_t position) except *:
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseXcsrilu02_zeroPivot(
 *             <cusparseHandle_t>handle, <csrilu02Info_t>info, <int*>position)
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy_backends/cuda/libs/cusparse.pyx":3407
 *         status = cusparseXcsrilu02_zeroPivot(
 *             <cusparseHandle_t>handle, <csrilu02Info_t>info, <int*>position)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef int scsrilu02_bufferSize(
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3407, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":3401
 *     check_status(status)
 * 
 * cpdef void xcsrilu02_zeroPivot(             # <<<<<<<<<<<<<<
 *         intptr_t handle, size_t info, size_t position) except *:
 *     _setStream(handle)
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.xcsrilu02_zeroPivot", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_295xcsrilu02_zeroPivot(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_294xcsrilu02_zeroPivot, "xcsrilu02_zeroPivot(intptr_t handle, size_t info, size_t position) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_295xcsrilu02_zeroPivot(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_t __pyx_v_handle;
  size_t __pyx_v_info;
  size_t __pyx_v_position;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  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);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_info,&__pyx_mstate_global->__pyx_n_u_position,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 3401, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3401, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3401, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3401, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "xcsrilu02_zeroPivot", 0) < (0)) __PYX_ERR(0, 3401, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("xcsrilu02_zeroPivot", 1, 3, 3, i); __PYX_ERR(0, 3401, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3401, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3401, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3401, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3402, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyLong_As_size_t(values[1]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3402, __pyx_L3_error)
    __pyx_v_position = __Pyx_PyLong_As_size_t(values[2]); if (unlikely((__pyx_v_position == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3402, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("xcsrilu02_zeroPivot", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 3401, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.xcsrilu02_zeroPivot", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_294xcsrilu02_zeroPivot(__pyx_self, __pyx_v_handle, __pyx_v_info, __pyx_v_position);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_294xcsrilu02_zeroPivot(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_f_13cupy_backends_4cuda_4libs_8cusparse_xcsrilu02_zeroPivot(__pyx_v_handle, __pyx_v_info, __pyx_v_position, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3401, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3401, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":3409
 *     check_status(status)
 * 
 * cpdef int scsrilu02_bufferSize(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int nnz, size_t descrA,
 *         size_t csrSortedValA, size_t csrSortedRowPtrA,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_297scsrilu02_bufferSize(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static int __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_scsrilu02_bufferSize(intptr_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_backends/cuda/libs/cusparse.pyx":3414
 *         size_t csrSortedColIndA, size_t info) except? -1:
 *     cdef int pBufferSizeInBytes
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseScsrilu02_bufferSize(
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3414, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":3415
 *     cdef int pBufferSizeInBytes
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseScsrilu02_bufferSize(
 *             <cusparseHandle_t>handle, m, nnz, <const cusparseMatDescr_t>descrA,
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "cupy_backends/cuda/libs/cusparse.pyx":3416
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":3415
 *     cdef int pBufferSizeInBytes
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseScsrilu02_bufferSize(
 *             <cusparseHandle_t>handle, m, nnz, <const cusparseMatDescr_t>descrA,
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy_backends/cuda/libs/cusparse.pyx":3421
 *             <const int*>csrSortedColIndA, <csrilu02Info_t>info,
 *             &pBufferSizeInBytes)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return <int>pBufferSizeInBytes
 * 
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_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_backends/cuda/libs/cusparse.pyx":3422
 *             &pBufferSizeInBytes)
 *     check_status(status)
 *     return <int>pBufferSizeInBytes             # <<<<<<<<<<<<<<
 * 
 * cpdef int dcsrilu02_bufferSize(
*/
  __pyx_r = ((int)__pyx_v_pBufferSizeInBytes);
  goto __pyx_L0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":3409
 *     check_status(status)
 * 
 * cpdef int scsrilu02_bufferSize(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int nnz, size_t descrA,
 *         size_t csrSortedValA, size_t csrSortedRowPtrA,
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.scsrilu02_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_297scsrilu02_bufferSize(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_296scsrilu02_bufferSize, "scsrilu02_bufferSize(intptr_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_13cupy_backends_4cuda_4libs_8cusparse_297scsrilu02_bufferSize(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[8] = {0,0,0,0,0,0,0,0};
  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);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_nnz,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_csrSortedValA,&__pyx_mstate_global->__pyx_n_u_csrSortedRowPtrA,&__pyx_mstate_global->__pyx_n_u_csrSortedColIndA,&__pyx_mstate_global->__pyx_n_u_info,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 3409, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 3409, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 3409, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 3409, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3409, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3409, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3409, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3409, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3409, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "scsrilu02_bufferSize", 0) < (0)) __PYX_ERR(0, 3409, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 8; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("scsrilu02_bufferSize", 1, 8, 8, i); __PYX_ERR(0, 3409, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 8)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3409, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3409, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3409, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3409, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3409, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 3409, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 3409, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 3409, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3410, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3410, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3410, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[3]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3410, __pyx_L3_error)
    __pyx_v_csrSortedValA = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_csrSortedValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3411, __pyx_L3_error)
    __pyx_v_csrSortedRowPtrA = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_csrSortedRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3411, __pyx_L3_error)
    __pyx_v_csrSortedColIndA = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_csrSortedColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3412, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3412, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("scsrilu02_bufferSize", 1, 8, 8, __pyx_nargs); __PYX_ERR(0, 3409, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.scsrilu02_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_296scsrilu02_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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_296scsrilu02_bufferSize(CYTHON_UNUSED PyObject *__pyx_self, intptr_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
  int __pyx_t_1;
  PyObject *__pyx_t_2 = 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_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(__pyx_t_1 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3409, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3409, __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_backends.cuda.libs.cusparse.scsrilu02_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy_backends/cuda/libs/cusparse.pyx":3424
 *     return <int>pBufferSizeInBytes
 * 
 * cpdef int dcsrilu02_bufferSize(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int nnz, size_t descrA,
 *         size_t csrSortedValA, size_t csrSortedRowPtrA,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_299dcsrilu02_bufferSize(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static int __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_dcsrilu02_bufferSize(intptr_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_backends/cuda/libs/cusparse.pyx":3429
 *         size_t csrSortedColIndA, size_t info) except? -1:
 *     cdef int pBufferSizeInBytes
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseDcsrilu02_bufferSize(
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3429, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":3430
 *     cdef int pBufferSizeInBytes
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseDcsrilu02_bufferSize(
 *             <cusparseHandle_t>handle, m, nnz, <const cusparseMatDescr_t>descrA,
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "cupy_backends/cuda/libs/cusparse.pyx":3431
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":3430
 *     cdef int pBufferSizeInBytes
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseDcsrilu02_bufferSize(
 *             <cusparseHandle_t>handle, m, nnz, <const cusparseMatDescr_t>descrA,
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy_backends/cuda/libs/cusparse.pyx":3436
 *             <const int*>csrSortedColIndA, <csrilu02Info_t>info,
 *             &pBufferSizeInBytes)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return <int>pBufferSizeInBytes
 * 
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3436, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":3437
 *             &pBufferSizeInBytes)
 *     check_status(status)
 *     return <int>pBufferSizeInBytes             # <<<<<<<<<<<<<<
 * 
 * cpdef int ccsrilu02_bufferSize(
*/
  __pyx_r = ((int)__pyx_v_pBufferSizeInBytes);
  goto __pyx_L0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":3424
 *     return <int>pBufferSizeInBytes
 * 
 * cpdef int dcsrilu02_bufferSize(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int nnz, size_t descrA,
 *         size_t csrSortedValA, size_t csrSortedRowPtrA,
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.dcsrilu02_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_299dcsrilu02_bufferSize(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_298dcsrilu02_bufferSize, "dcsrilu02_bufferSize(intptr_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_13cupy_backends_4cuda_4libs_8cusparse_299dcsrilu02_bufferSize(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[8] = {0,0,0,0,0,0,0,0};
  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);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_nnz,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_csrSortedValA,&__pyx_mstate_global->__pyx_n_u_csrSortedRowPtrA,&__pyx_mstate_global->__pyx_n_u_csrSortedColIndA,&__pyx_mstate_global->__pyx_n_u_info,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 3424, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 3424, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 3424, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 3424, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3424, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3424, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3424, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3424, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3424, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "dcsrilu02_bufferSize", 0) < (0)) __PYX_ERR(0, 3424, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 8; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("dcsrilu02_bufferSize", 1, 8, 8, i); __PYX_ERR(0, 3424, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 8)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3424, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3424, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3424, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3424, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3424, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 3424, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 3424, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 3424, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3425, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3425, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3425, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[3]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3425, __pyx_L3_error)
    __pyx_v_csrSortedValA = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_csrSortedValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3426, __pyx_L3_error)
    __pyx_v_csrSortedRowPtrA = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_csrSortedRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3426, __pyx_L3_error)
    __pyx_v_csrSortedColIndA = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_csrSortedColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3427, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3427, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("dcsrilu02_bufferSize", 1, 8, 8, __pyx_nargs); __PYX_ERR(0, 3424, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.dcsrilu02_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_298dcsrilu02_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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_298dcsrilu02_bufferSize(CYTHON_UNUSED PyObject *__pyx_self, intptr_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
  int __pyx_t_1;
  PyObject *__pyx_t_2 = 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_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(__pyx_t_1 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3424, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3424, __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_backends.cuda.libs.cusparse.dcsrilu02_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy_backends/cuda/libs/cusparse.pyx":3439
 *     return <int>pBufferSizeInBytes
 * 
 * cpdef int ccsrilu02_bufferSize(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int nnz, size_t descrA,
 *         size_t csrSortedValA, size_t csrSortedRowPtrA,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_301ccsrilu02_bufferSize(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static int __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_ccsrilu02_bufferSize(intptr_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_backends/cuda/libs/cusparse.pyx":3444
 *         size_t csrSortedColIndA, size_t info) except? -1:
 *     cdef int pBufferSizeInBytes
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseCcsrilu02_bufferSize(
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3444, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":3445
 *     cdef int pBufferSizeInBytes
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseCcsrilu02_bufferSize(
 *             <cusparseHandle_t>handle, m, nnz, <const cusparseMatDescr_t>descrA,
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "cupy_backends/cuda/libs/cusparse.pyx":3446
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":3445
 *     cdef int pBufferSizeInBytes
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseCcsrilu02_bufferSize(
 *             <cusparseHandle_t>handle, m, nnz, <const cusparseMatDescr_t>descrA,
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy_backends/cuda/libs/cusparse.pyx":3451
 *             <const int*>csrSortedColIndA, <csrilu02Info_t>info,
 *             &pBufferSizeInBytes)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return <int>pBufferSizeInBytes
 * 
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3451, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":3452
 *             &pBufferSizeInBytes)
 *     check_status(status)
 *     return <int>pBufferSizeInBytes             # <<<<<<<<<<<<<<
 * 
 * cpdef int zcsrilu02_bufferSize(
*/
  __pyx_r = ((int)__pyx_v_pBufferSizeInBytes);
  goto __pyx_L0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":3439
 *     return <int>pBufferSizeInBytes
 * 
 * cpdef int ccsrilu02_bufferSize(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int nnz, size_t descrA,
 *         size_t csrSortedValA, size_t csrSortedRowPtrA,
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.ccsrilu02_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_301ccsrilu02_bufferSize(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_300ccsrilu02_bufferSize, "ccsrilu02_bufferSize(intptr_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_13cupy_backends_4cuda_4libs_8cusparse_301ccsrilu02_bufferSize(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[8] = {0,0,0,0,0,0,0,0};
  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);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_nnz,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_csrSortedValA,&__pyx_mstate_global->__pyx_n_u_csrSortedRowPtrA,&__pyx_mstate_global->__pyx_n_u_csrSortedColIndA,&__pyx_mstate_global->__pyx_n_u_info,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 3439, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 3439, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 3439, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 3439, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3439, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3439, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3439, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3439, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3439, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "ccsrilu02_bufferSize", 0) < (0)) __PYX_ERR(0, 3439, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 8; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("ccsrilu02_bufferSize", 1, 8, 8, i); __PYX_ERR(0, 3439, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 8)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3439, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3439, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3439, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3439, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3439, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 3439, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 3439, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 3439, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3440, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3440, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3440, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[3]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3440, __pyx_L3_error)
    __pyx_v_csrSortedValA = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_csrSortedValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3441, __pyx_L3_error)
    __pyx_v_csrSortedRowPtrA = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_csrSortedRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3441, __pyx_L3_error)
    __pyx_v_csrSortedColIndA = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_csrSortedColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3442, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3442, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ccsrilu02_bufferSize", 1, 8, 8, __pyx_nargs); __PYX_ERR(0, 3439, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.ccsrilu02_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_300ccsrilu02_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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_300ccsrilu02_bufferSize(CYTHON_UNUSED PyObject *__pyx_self, intptr_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
  int __pyx_t_1;
  PyObject *__pyx_t_2 = 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_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(__pyx_t_1 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3439, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3439, __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_backends.cuda.libs.cusparse.ccsrilu02_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy_backends/cuda/libs/cusparse.pyx":3454
 *     return <int>pBufferSizeInBytes
 * 
 * cpdef int zcsrilu02_bufferSize(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int nnz, size_t descrA,
 *         size_t csrSortedValA, size_t csrSortedRowPtrA,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_303zcsrilu02_bufferSize(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static int __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_zcsrilu02_bufferSize(intptr_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_backends/cuda/libs/cusparse.pyx":3459
 *         size_t csrSortedColIndA, size_t info) except? -1:
 *     cdef int pBufferSizeInBytes
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseZcsrilu02_bufferSize(
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3459, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":3460
 *     cdef int pBufferSizeInBytes
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseZcsrilu02_bufferSize(
 *             <cusparseHandle_t>handle, m, nnz, <const cusparseMatDescr_t>descrA,
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "cupy_backends/cuda/libs/cusparse.pyx":3461
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":3460
 *     cdef int pBufferSizeInBytes
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseZcsrilu02_bufferSize(
 *             <cusparseHandle_t>handle, m, nnz, <const cusparseMatDescr_t>descrA,
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy_backends/cuda/libs/cusparse.pyx":3466
 *             <const int*>csrSortedColIndA, <csrilu02Info_t>info,
 *             &pBufferSizeInBytes)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return <int>pBufferSizeInBytes
 * 
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_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_backends/cuda/libs/cusparse.pyx":3467
 *             &pBufferSizeInBytes)
 *     check_status(status)
 *     return <int>pBufferSizeInBytes             # <<<<<<<<<<<<<<
 * 
 * cpdef void scsrilu02_analysis(intptr_t handle, int m, int nnz, size_t descrA,
*/
  __pyx_r = ((int)__pyx_v_pBufferSizeInBytes);
  goto __pyx_L0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":3454
 *     return <int>pBufferSizeInBytes
 * 
 * cpdef int zcsrilu02_bufferSize(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int nnz, size_t descrA,
 *         size_t csrSortedValA, size_t csrSortedRowPtrA,
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.zcsrilu02_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_303zcsrilu02_bufferSize(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_302zcsrilu02_bufferSize, "zcsrilu02_bufferSize(intptr_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_13cupy_backends_4cuda_4libs_8cusparse_303zcsrilu02_bufferSize(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[8] = {0,0,0,0,0,0,0,0};
  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);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_nnz,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_csrSortedValA,&__pyx_mstate_global->__pyx_n_u_csrSortedRowPtrA,&__pyx_mstate_global->__pyx_n_u_csrSortedColIndA,&__pyx_mstate_global->__pyx_n_u_info,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 3454, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 3454, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 3454, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 3454, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3454, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3454, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3454, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3454, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3454, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "zcsrilu02_bufferSize", 0) < (0)) __PYX_ERR(0, 3454, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 8; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("zcsrilu02_bufferSize", 1, 8, 8, i); __PYX_ERR(0, 3454, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 8)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3454, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3454, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3454, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3454, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3454, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 3454, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 3454, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 3454, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3455, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3455, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3455, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[3]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3455, __pyx_L3_error)
    __pyx_v_csrSortedValA = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_csrSortedValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3456, __pyx_L3_error)
    __pyx_v_csrSortedRowPtrA = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_csrSortedRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3456, __pyx_L3_error)
    __pyx_v_csrSortedColIndA = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_csrSortedColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3457, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3457, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("zcsrilu02_bufferSize", 1, 8, 8, __pyx_nargs); __PYX_ERR(0, 3454, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.zcsrilu02_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_302zcsrilu02_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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_302zcsrilu02_bufferSize(CYTHON_UNUSED PyObject *__pyx_self, intptr_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
  int __pyx_t_1;
  PyObject *__pyx_t_2 = 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_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(__pyx_t_1 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3454, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3454, __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_backends.cuda.libs.cusparse.zcsrilu02_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy_backends/cuda/libs/cusparse.pyx":3469
 *     return <int>pBufferSizeInBytes
 * 
 * cpdef void scsrilu02_analysis(intptr_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_13cupy_backends_4cuda_4libs_8cusparse_305scsrilu02_analysis(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_scsrilu02_analysis(intptr_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;
  __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_backends/cuda/libs/cusparse.pyx":3473
 *                               size_t csrSortedColIndA, size_t info, int policy,
 *                               size_t pBuffer) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseScsrilu02_analysis(
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3473, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":3474
 *                               size_t pBuffer) except *:
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseScsrilu02_analysis(
 *             <cusparseHandle_t>handle, m, nnz, <const cusparseMatDescr_t>descrA,
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "cupy_backends/cuda/libs/cusparse.pyx":3475
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":3474
 *                               size_t pBuffer) except *:
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseScsrilu02_analysis(
 *             <cusparseHandle_t>handle, m, nnz, <const cusparseMatDescr_t>descrA,
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy_backends/cuda/libs/cusparse.pyx":3480
 *             <const int*>csrSortedColIndA, <csrilu02Info_t>info,
 *             <cusparseSolvePolicy_t>policy, <void*>pBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef void dcsrilu02_analysis(intptr_t handle, int m, int nnz, size_t descrA,
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3480, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":3469
 *     return <int>pBufferSizeInBytes
 * 
 * cpdef void scsrilu02_analysis(intptr_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 */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.scsrilu02_analysis", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_305scsrilu02_analysis(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_304scsrilu02_analysis, "scsrilu02_analysis(intptr_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) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_305scsrilu02_analysis(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0};
  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);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_nnz,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_csrSortedValA,&__pyx_mstate_global->__pyx_n_u_csrSortedRowPtrA,&__pyx_mstate_global->__pyx_n_u_csrSortedColIndA,&__pyx_mstate_global->__pyx_n_u_info,&__pyx_mstate_global->__pyx_n_u_policy,&__pyx_mstate_global->__pyx_n_u_pBuffer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 3469, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 3469, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 3469, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 3469, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 3469, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 3469, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3469, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3469, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3469, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3469, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3469, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "scsrilu02_analysis", 0) < (0)) __PYX_ERR(0, 3469, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 10; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("scsrilu02_analysis", 1, 10, 10, i); __PYX_ERR(0, 3469, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 10)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3469, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3469, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3469, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3469, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3469, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 3469, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 3469, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 3469, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 3469, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 3469, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3469, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3469, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3469, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[3]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3469, __pyx_L3_error)
    __pyx_v_csrSortedValA = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_csrSortedValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3470, __pyx_L3_error)
    __pyx_v_csrSortedRowPtrA = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_csrSortedRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3470, __pyx_L3_error)
    __pyx_v_csrSortedColIndA = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_csrSortedColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3471, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3471, __pyx_L3_error)
    __pyx_v_policy = __Pyx_PyLong_As_int(values[8]); if (unlikely((__pyx_v_policy == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3471, __pyx_L3_error)
    __pyx_v_pBuffer = __Pyx_PyLong_As_size_t(values[9]); if (unlikely((__pyx_v_pBuffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3472, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("scsrilu02_analysis", 1, 10, 10, __pyx_nargs); __PYX_ERR(0, 3469, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.scsrilu02_analysis", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_304scsrilu02_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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_304scsrilu02_analysis(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3469, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3469, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":3482
 *     check_status(status)
 * 
 * cpdef void dcsrilu02_analysis(intptr_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_13cupy_backends_4cuda_4libs_8cusparse_307dcsrilu02_analysis(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_dcsrilu02_analysis(intptr_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;
  __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_backends/cuda/libs/cusparse.pyx":3486
 *                               size_t csrSortedColIndA, size_t info, int policy,
 *                               size_t pBuffer) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseDcsrilu02_analysis(
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3486, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":3487
 *                               size_t pBuffer) except *:
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseDcsrilu02_analysis(
 *             <cusparseHandle_t>handle, m, nnz, <const cusparseMatDescr_t>descrA,
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "cupy_backends/cuda/libs/cusparse.pyx":3488
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":3487
 *                               size_t pBuffer) except *:
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseDcsrilu02_analysis(
 *             <cusparseHandle_t>handle, m, nnz, <const cusparseMatDescr_t>descrA,
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy_backends/cuda/libs/cusparse.pyx":3493
 *             <const int*>csrSortedColIndA, <csrilu02Info_t>info,
 *             <cusparseSolvePolicy_t>policy, <void*>pBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef void ccsrilu02_analysis(intptr_t handle, int m, int nnz, size_t descrA,
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3493, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":3482
 *     check_status(status)
 * 
 * cpdef void dcsrilu02_analysis(intptr_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 */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.dcsrilu02_analysis", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_307dcsrilu02_analysis(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_306dcsrilu02_analysis, "dcsrilu02_analysis(intptr_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) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_307dcsrilu02_analysis(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0};
  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);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_nnz,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_csrSortedValA,&__pyx_mstate_global->__pyx_n_u_csrSortedRowPtrA,&__pyx_mstate_global->__pyx_n_u_csrSortedColIndA,&__pyx_mstate_global->__pyx_n_u_info,&__pyx_mstate_global->__pyx_n_u_policy,&__pyx_mstate_global->__pyx_n_u_pBuffer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 3482, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 3482, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 3482, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 3482, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 3482, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 3482, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3482, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3482, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3482, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3482, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3482, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "dcsrilu02_analysis", 0) < (0)) __PYX_ERR(0, 3482, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 10; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("dcsrilu02_analysis", 1, 10, 10, i); __PYX_ERR(0, 3482, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 10)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3482, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3482, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3482, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3482, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3482, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 3482, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 3482, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 3482, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 3482, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 3482, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3482, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3482, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3482, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[3]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3482, __pyx_L3_error)
    __pyx_v_csrSortedValA = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_csrSortedValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3483, __pyx_L3_error)
    __pyx_v_csrSortedRowPtrA = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_csrSortedRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3483, __pyx_L3_error)
    __pyx_v_csrSortedColIndA = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_csrSortedColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3484, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3484, __pyx_L3_error)
    __pyx_v_policy = __Pyx_PyLong_As_int(values[8]); if (unlikely((__pyx_v_policy == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3484, __pyx_L3_error)
    __pyx_v_pBuffer = __Pyx_PyLong_As_size_t(values[9]); if (unlikely((__pyx_v_pBuffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3485, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("dcsrilu02_analysis", 1, 10, 10, __pyx_nargs); __PYX_ERR(0, 3482, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.dcsrilu02_analysis", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_306dcsrilu02_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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_306dcsrilu02_analysis(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3482, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3482, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":3495
 *     check_status(status)
 * 
 * cpdef void ccsrilu02_analysis(intptr_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_13cupy_backends_4cuda_4libs_8cusparse_309ccsrilu02_analysis(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_ccsrilu02_analysis(intptr_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;
  __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_backends/cuda/libs/cusparse.pyx":3499
 *                               size_t csrSortedColIndA, size_t info, int policy,
 *                               size_t pBuffer) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseCcsrilu02_analysis(
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3499, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":3500
 *                               size_t pBuffer) except *:
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseCcsrilu02_analysis(
 *             <cusparseHandle_t>handle, m, nnz, <const cusparseMatDescr_t>descrA,
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "cupy_backends/cuda/libs/cusparse.pyx":3501
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":3500
 *                               size_t pBuffer) except *:
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseCcsrilu02_analysis(
 *             <cusparseHandle_t>handle, m, nnz, <const cusparseMatDescr_t>descrA,
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy_backends/cuda/libs/cusparse.pyx":3506
 *             <const int*>csrSortedColIndA, <csrilu02Info_t>info,
 *             <cusparseSolvePolicy_t>policy, <void*>pBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef void zcsrilu02_analysis(intptr_t handle, int m, int nnz, size_t descrA,
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_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_backends/cuda/libs/cusparse.pyx":3495
 *     check_status(status)
 * 
 * cpdef void ccsrilu02_analysis(intptr_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 */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.ccsrilu02_analysis", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_309ccsrilu02_analysis(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_308ccsrilu02_analysis, "ccsrilu02_analysis(intptr_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) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_309ccsrilu02_analysis(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0};
  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);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_nnz,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_csrSortedValA,&__pyx_mstate_global->__pyx_n_u_csrSortedRowPtrA,&__pyx_mstate_global->__pyx_n_u_csrSortedColIndA,&__pyx_mstate_global->__pyx_n_u_info,&__pyx_mstate_global->__pyx_n_u_policy,&__pyx_mstate_global->__pyx_n_u_pBuffer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 3495, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 3495, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 3495, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 3495, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 3495, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 3495, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3495, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3495, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3495, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3495, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3495, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "ccsrilu02_analysis", 0) < (0)) __PYX_ERR(0, 3495, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 10; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("ccsrilu02_analysis", 1, 10, 10, i); __PYX_ERR(0, 3495, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 10)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3495, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3495, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3495, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3495, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3495, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 3495, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 3495, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 3495, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 3495, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 3495, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3495, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3495, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3495, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[3]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3495, __pyx_L3_error)
    __pyx_v_csrSortedValA = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_csrSortedValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3496, __pyx_L3_error)
    __pyx_v_csrSortedRowPtrA = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_csrSortedRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3496, __pyx_L3_error)
    __pyx_v_csrSortedColIndA = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_csrSortedColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3497, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3497, __pyx_L3_error)
    __pyx_v_policy = __Pyx_PyLong_As_int(values[8]); if (unlikely((__pyx_v_policy == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3497, __pyx_L3_error)
    __pyx_v_pBuffer = __Pyx_PyLong_As_size_t(values[9]); if (unlikely((__pyx_v_pBuffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3498, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ccsrilu02_analysis", 1, 10, 10, __pyx_nargs); __PYX_ERR(0, 3495, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.ccsrilu02_analysis", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_308ccsrilu02_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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_308ccsrilu02_analysis(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3495, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3495, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":3508
 *     check_status(status)
 * 
 * cpdef void zcsrilu02_analysis(intptr_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_13cupy_backends_4cuda_4libs_8cusparse_311zcsrilu02_analysis(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_zcsrilu02_analysis(intptr_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;
  __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_backends/cuda/libs/cusparse.pyx":3512
 *                               size_t csrSortedColIndA, size_t info, int policy,
 *                               size_t pBuffer) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseZcsrilu02_analysis(
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3512, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":3513
 *                               size_t pBuffer) except *:
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseZcsrilu02_analysis(
 *             <cusparseHandle_t>handle, m, nnz, <const cusparseMatDescr_t>descrA,
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "cupy_backends/cuda/libs/cusparse.pyx":3514
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":3513
 *                               size_t pBuffer) except *:
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseZcsrilu02_analysis(
 *             <cusparseHandle_t>handle, m, nnz, <const cusparseMatDescr_t>descrA,
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy_backends/cuda/libs/cusparse.pyx":3520
 *             <csrilu02Info_t>info, <cusparseSolvePolicy_t>policy,
 *             <void*>pBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef void scsrilu02(intptr_t handle, int m, int nnz, size_t descrA,
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3520, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":3508
 *     check_status(status)
 * 
 * cpdef void zcsrilu02_analysis(intptr_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 */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.zcsrilu02_analysis", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_311zcsrilu02_analysis(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_310zcsrilu02_analysis, "zcsrilu02_analysis(intptr_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) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_311zcsrilu02_analysis(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0};
  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);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_nnz,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_csrSortedValA,&__pyx_mstate_global->__pyx_n_u_csrSortedRowPtrA,&__pyx_mstate_global->__pyx_n_u_csrSortedColIndA,&__pyx_mstate_global->__pyx_n_u_info,&__pyx_mstate_global->__pyx_n_u_policy,&__pyx_mstate_global->__pyx_n_u_pBuffer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 3508, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 3508, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 3508, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 3508, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 3508, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 3508, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3508, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3508, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3508, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3508, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3508, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "zcsrilu02_analysis", 0) < (0)) __PYX_ERR(0, 3508, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 10; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("zcsrilu02_analysis", 1, 10, 10, i); __PYX_ERR(0, 3508, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 10)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3508, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3508, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3508, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3508, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3508, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 3508, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 3508, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 3508, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 3508, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 3508, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3508, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3508, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3508, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[3]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3508, __pyx_L3_error)
    __pyx_v_csrSortedValA = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_csrSortedValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3509, __pyx_L3_error)
    __pyx_v_csrSortedRowPtrA = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_csrSortedRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3509, __pyx_L3_error)
    __pyx_v_csrSortedColIndA = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_csrSortedColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3510, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3510, __pyx_L3_error)
    __pyx_v_policy = __Pyx_PyLong_As_int(values[8]); if (unlikely((__pyx_v_policy == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3510, __pyx_L3_error)
    __pyx_v_pBuffer = __Pyx_PyLong_As_size_t(values[9]); if (unlikely((__pyx_v_pBuffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3511, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("zcsrilu02_analysis", 1, 10, 10, __pyx_nargs); __PYX_ERR(0, 3508, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.zcsrilu02_analysis", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_310zcsrilu02_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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_310zcsrilu02_analysis(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3508, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); 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_backends.cuda.libs.cusparse.zcsrilu02_analysis", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy_backends/cuda/libs/cusparse.pyx":3522
 *     check_status(status)
 * 
 * cpdef void scsrilu02(intptr_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_13cupy_backends_4cuda_4libs_8cusparse_313scsrilu02(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_scsrilu02(intptr_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;
  __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_backends/cuda/libs/cusparse.pyx":3526
 *                      size_t csrSortedColIndA, size_t info, int policy,
 *                      size_t pBuffer) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseScsrilu02(
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3526, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":3527
 *                      size_t pBuffer) except *:
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseScsrilu02(
 *             <cusparseHandle_t>handle, m, nnz, <const cusparseMatDescr_t>descrA,
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "cupy_backends/cuda/libs/cusparse.pyx":3528
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":3527
 *                      size_t pBuffer) except *:
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseScsrilu02(
 *             <cusparseHandle_t>handle, m, nnz, <const cusparseMatDescr_t>descrA,
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy_backends/cuda/libs/cusparse.pyx":3533
 *             <const int*>csrSortedColIndA, <csrilu02Info_t>info,
 *             <cusparseSolvePolicy_t>policy, <void*>pBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef void dcsrilu02(intptr_t handle, int m, int nnz, size_t descrA,
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3533, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":3522
 *     check_status(status)
 * 
 * cpdef void scsrilu02(intptr_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 */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.scsrilu02", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_313scsrilu02(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_312scsrilu02, "scsrilu02(intptr_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) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_313scsrilu02(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("scsrilu02 (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_nnz,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_csrSortedValA_valM,&__pyx_mstate_global->__pyx_n_u_csrSortedRowPtrA,&__pyx_mstate_global->__pyx_n_u_csrSortedColIndA,&__pyx_mstate_global->__pyx_n_u_info,&__pyx_mstate_global->__pyx_n_u_policy,&__pyx_mstate_global->__pyx_n_u_pBuffer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 3522, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 3522, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 3522, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 3522, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 3522, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 3522, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3522, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3522, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3522, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3522, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3522, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "scsrilu02", 0) < (0)) __PYX_ERR(0, 3522, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 10; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("scsrilu02", 1, 10, 10, i); __PYX_ERR(0, 3522, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 10)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3522, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3522, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3522, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3522, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3522, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 3522, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 3522, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 3522, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 3522, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 3522, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3522, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3522, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3522, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[3]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3522, __pyx_L3_error)
    __pyx_v_csrSortedValA_valM = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_csrSortedValA_valM == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3523, __pyx_L3_error)
    __pyx_v_csrSortedRowPtrA = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_csrSortedRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3523, __pyx_L3_error)
    __pyx_v_csrSortedColIndA = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_csrSortedColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3524, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3524, __pyx_L3_error)
    __pyx_v_policy = __Pyx_PyLong_As_int(values[8]); if (unlikely((__pyx_v_policy == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3524, __pyx_L3_error)
    __pyx_v_pBuffer = __Pyx_PyLong_As_size_t(values[9]); if (unlikely((__pyx_v_pBuffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3525, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("scsrilu02", 1, 10, 10, __pyx_nargs); __PYX_ERR(0, 3522, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.scsrilu02", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_312scsrilu02(__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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_312scsrilu02(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3522, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3522, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":3535
 *     check_status(status)
 * 
 * cpdef void dcsrilu02(intptr_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_13cupy_backends_4cuda_4libs_8cusparse_315dcsrilu02(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_dcsrilu02(intptr_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;
  __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_backends/cuda/libs/cusparse.pyx":3539
 *                      size_t csrSortedColIndA, size_t info, int policy,
 *                      size_t pBuffer) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseDcsrilu02(
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3539, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":3540
 *                      size_t pBuffer) except *:
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseDcsrilu02(
 *             <cusparseHandle_t>handle, m, nnz, <const cusparseMatDescr_t>descrA,
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "cupy_backends/cuda/libs/cusparse.pyx":3541
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":3540
 *                      size_t pBuffer) except *:
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseDcsrilu02(
 *             <cusparseHandle_t>handle, m, nnz, <const cusparseMatDescr_t>descrA,
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy_backends/cuda/libs/cusparse.pyx":3546
 *             <const int*>csrSortedColIndA, <csrilu02Info_t>info,
 *             <cusparseSolvePolicy_t>policy, <void*>pBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef void ccsrilu02(intptr_t handle, int m, int nnz, size_t descrA,
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3546, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":3535
 *     check_status(status)
 * 
 * cpdef void dcsrilu02(intptr_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 */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.dcsrilu02", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_315dcsrilu02(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_314dcsrilu02, "dcsrilu02(intptr_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) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_315dcsrilu02(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dcsrilu02 (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_nnz,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_csrSortedValA_valM,&__pyx_mstate_global->__pyx_n_u_csrSortedRowPtrA,&__pyx_mstate_global->__pyx_n_u_csrSortedColIndA,&__pyx_mstate_global->__pyx_n_u_info,&__pyx_mstate_global->__pyx_n_u_policy,&__pyx_mstate_global->__pyx_n_u_pBuffer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 3535, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 3535, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 3535, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 3535, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 3535, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 3535, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3535, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3535, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3535, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3535, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3535, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "dcsrilu02", 0) < (0)) __PYX_ERR(0, 3535, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 10; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("dcsrilu02", 1, 10, 10, i); __PYX_ERR(0, 3535, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 10)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3535, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3535, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3535, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3535, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3535, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 3535, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 3535, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 3535, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 3535, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 3535, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3535, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3535, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3535, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[3]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3535, __pyx_L3_error)
    __pyx_v_csrSortedValA_valM = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_csrSortedValA_valM == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3536, __pyx_L3_error)
    __pyx_v_csrSortedRowPtrA = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_csrSortedRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3536, __pyx_L3_error)
    __pyx_v_csrSortedColIndA = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_csrSortedColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3537, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3537, __pyx_L3_error)
    __pyx_v_policy = __Pyx_PyLong_As_int(values[8]); if (unlikely((__pyx_v_policy == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3537, __pyx_L3_error)
    __pyx_v_pBuffer = __Pyx_PyLong_As_size_t(values[9]); if (unlikely((__pyx_v_pBuffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3538, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("dcsrilu02", 1, 10, 10, __pyx_nargs); __PYX_ERR(0, 3535, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.dcsrilu02", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_314dcsrilu02(__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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_314dcsrilu02(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3535, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3535, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":3548
 *     check_status(status)
 * 
 * cpdef void ccsrilu02(intptr_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_13cupy_backends_4cuda_4libs_8cusparse_317ccsrilu02(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_ccsrilu02(intptr_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;
  __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_backends/cuda/libs/cusparse.pyx":3552
 *                      size_t csrSortedColIndA, size_t info, int policy,
 *                      size_t pBuffer) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseCcsrilu02(
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3552, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":3553
 *                      size_t pBuffer) except *:
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseCcsrilu02(
 *             <cusparseHandle_t>handle, m, nnz, <const cusparseMatDescr_t>descrA,
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "cupy_backends/cuda/libs/cusparse.pyx":3554
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":3553
 *                      size_t pBuffer) except *:
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseCcsrilu02(
 *             <cusparseHandle_t>handle, m, nnz, <const cusparseMatDescr_t>descrA,
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy_backends/cuda/libs/cusparse.pyx":3559
 *             <const int*>csrSortedColIndA, <csrilu02Info_t>info,
 *             <cusparseSolvePolicy_t>policy, <void*>pBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef void zcsrilu02(intptr_t handle, int m, int nnz, size_t descrA,
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_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_backends/cuda/libs/cusparse.pyx":3548
 *     check_status(status)
 * 
 * cpdef void ccsrilu02(intptr_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 */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.ccsrilu02", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_317ccsrilu02(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_316ccsrilu02, "ccsrilu02(intptr_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) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_317ccsrilu02(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ccsrilu02 (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_nnz,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_csrSortedValA_valM,&__pyx_mstate_global->__pyx_n_u_csrSortedRowPtrA,&__pyx_mstate_global->__pyx_n_u_csrSortedColIndA,&__pyx_mstate_global->__pyx_n_u_info,&__pyx_mstate_global->__pyx_n_u_policy,&__pyx_mstate_global->__pyx_n_u_pBuffer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 3548, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 3548, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 3548, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 3548, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 3548, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 3548, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3548, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3548, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3548, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3548, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3548, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "ccsrilu02", 0) < (0)) __PYX_ERR(0, 3548, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 10; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("ccsrilu02", 1, 10, 10, i); __PYX_ERR(0, 3548, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 10)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3548, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3548, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3548, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3548, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3548, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 3548, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 3548, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 3548, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 3548, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 3548, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3548, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3548, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3548, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[3]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3548, __pyx_L3_error)
    __pyx_v_csrSortedValA_valM = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_csrSortedValA_valM == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3549, __pyx_L3_error)
    __pyx_v_csrSortedRowPtrA = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_csrSortedRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3549, __pyx_L3_error)
    __pyx_v_csrSortedColIndA = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_csrSortedColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3550, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3550, __pyx_L3_error)
    __pyx_v_policy = __Pyx_PyLong_As_int(values[8]); if (unlikely((__pyx_v_policy == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3550, __pyx_L3_error)
    __pyx_v_pBuffer = __Pyx_PyLong_As_size_t(values[9]); if (unlikely((__pyx_v_pBuffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3551, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ccsrilu02", 1, 10, 10, __pyx_nargs); __PYX_ERR(0, 3548, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.ccsrilu02", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_316ccsrilu02(__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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_316ccsrilu02(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3548, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3548, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":3561
 *     check_status(status)
 * 
 * cpdef void zcsrilu02(intptr_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_13cupy_backends_4cuda_4libs_8cusparse_319zcsrilu02(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_zcsrilu02(intptr_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;
  __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_backends/cuda/libs/cusparse.pyx":3565
 *                      size_t csrSortedColIndA, size_t info, int policy,
 *                      size_t pBuffer) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseZcsrilu02(
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3565, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":3566
 *                      size_t pBuffer) except *:
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseZcsrilu02(
 *             <cusparseHandle_t>handle, m, nnz, <const cusparseMatDescr_t>descrA,
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "cupy_backends/cuda/libs/cusparse.pyx":3567
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":3566
 *                      size_t pBuffer) except *:
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseZcsrilu02(
 *             <cusparseHandle_t>handle, m, nnz, <const cusparseMatDescr_t>descrA,
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy_backends/cuda/libs/cusparse.pyx":3572
 *             <const int*>csrSortedColIndA, <csrilu02Info_t>info,
 *             <cusparseSolvePolicy_t>policy, <void*>pBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef void sbsrilu02_numericBoost(
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 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_backends/cuda/libs/cusparse.pyx":3561
 *     check_status(status)
 * 
 * cpdef void zcsrilu02(intptr_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 */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.zcsrilu02", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_319zcsrilu02(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_318zcsrilu02, "zcsrilu02(intptr_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) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_319zcsrilu02(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("zcsrilu02 (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_nnz,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_csrSortedValA_valM,&__pyx_mstate_global->__pyx_n_u_csrSortedRowPtrA,&__pyx_mstate_global->__pyx_n_u_csrSortedColIndA,&__pyx_mstate_global->__pyx_n_u_info,&__pyx_mstate_global->__pyx_n_u_policy,&__pyx_mstate_global->__pyx_n_u_pBuffer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 3561, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 3561, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 3561, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 3561, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 3561, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 3561, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3561, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3561, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3561, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3561, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3561, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "zcsrilu02", 0) < (0)) __PYX_ERR(0, 3561, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 10; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("zcsrilu02", 1, 10, 10, i); __PYX_ERR(0, 3561, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 10)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3561, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3561, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3561, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3561, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3561, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 3561, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 3561, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 3561, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 3561, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 3561, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3561, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3561, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3561, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[3]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3561, __pyx_L3_error)
    __pyx_v_csrSortedValA_valM = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_csrSortedValA_valM == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3562, __pyx_L3_error)
    __pyx_v_csrSortedRowPtrA = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_csrSortedRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3562, __pyx_L3_error)
    __pyx_v_csrSortedColIndA = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_csrSortedColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3563, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3563, __pyx_L3_error)
    __pyx_v_policy = __Pyx_PyLong_As_int(values[8]); if (unlikely((__pyx_v_policy == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3563, __pyx_L3_error)
    __pyx_v_pBuffer = __Pyx_PyLong_As_size_t(values[9]); if (unlikely((__pyx_v_pBuffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3564, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("zcsrilu02", 1, 10, 10, __pyx_nargs); __PYX_ERR(0, 3561, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.zcsrilu02", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_318zcsrilu02(__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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_318zcsrilu02(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3561, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); 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_backends.cuda.libs.cusparse.zcsrilu02", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy_backends/cuda/libs/cusparse.pyx":3574
 *     check_status(status)
 * 
 * cpdef void sbsrilu02_numericBoost(             # <<<<<<<<<<<<<<
 *         intptr_t handle, size_t info, int enable_boost,
 *         size_t tol, size_t boost_val) except *:
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_321sbsrilu02_numericBoost(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_sbsrilu02_numericBoost(intptr_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;
  __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_backends/cuda/libs/cusparse.pyx":3577
 *         intptr_t handle, size_t info, int enable_boost,
 *         size_t tol, size_t boost_val) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseSbsrilu02_numericBoost(
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3577, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":3578
 *         size_t tol, size_t boost_val) except *:
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseSbsrilu02_numericBoost(
 *             <cusparseHandle_t>handle, <bsrilu02Info_t>info, enable_boost,
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "cupy_backends/cuda/libs/cusparse.pyx":3579
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":3578
 *         size_t tol, size_t boost_val) except *:
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseSbsrilu02_numericBoost(
 *             <cusparseHandle_t>handle, <bsrilu02Info_t>info, enable_boost,
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy_backends/cuda/libs/cusparse.pyx":3582
 *             <cusparseHandle_t>handle, <bsrilu02Info_t>info, enable_boost,
 *             <double*>tol, <float*>boost_val)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef void dbsrilu02_numericBoost(
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 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_backends/cuda/libs/cusparse.pyx":3574
 *     check_status(status)
 * 
 * cpdef void sbsrilu02_numericBoost(             # <<<<<<<<<<<<<<
 *         intptr_t handle, size_t info, int enable_boost,
 *         size_t tol, size_t boost_val) except *:
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.sbsrilu02_numericBoost", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_321sbsrilu02_numericBoost(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_320sbsrilu02_numericBoost, "sbsrilu02_numericBoost(intptr_t handle, size_t info, int enable_boost, size_t tol, size_t boost_val) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_321sbsrilu02_numericBoost(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[5] = {0,0,0,0,0};
  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);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_info,&__pyx_mstate_global->__pyx_n_u_enable_boost,&__pyx_mstate_global->__pyx_n_u_tol,&__pyx_mstate_global->__pyx_n_u_boost_val,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 3574, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3574, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3574, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3574, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3574, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3574, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "sbsrilu02_numericBoost", 0) < (0)) __PYX_ERR(0, 3574, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 5; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("sbsrilu02_numericBoost", 1, 5, 5, i); __PYX_ERR(0, 3574, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 5)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3574, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3574, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3574, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3574, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3574, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3575, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyLong_As_size_t(values[1]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3575, __pyx_L3_error)
    __pyx_v_enable_boost = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_enable_boost == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3575, __pyx_L3_error)
    __pyx_v_tol = __Pyx_PyLong_As_size_t(values[3]); if (unlikely((__pyx_v_tol == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3576, __pyx_L3_error)
    __pyx_v_boost_val = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_boost_val == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3576, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("sbsrilu02_numericBoost", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 3574, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.sbsrilu02_numericBoost", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_320sbsrilu02_numericBoost(__pyx_self, __pyx_v_handle, __pyx_v_info, __pyx_v_enable_boost, __pyx_v_tol, __pyx_v_boost_val);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_320sbsrilu02_numericBoost(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_f_13cupy_backends_4cuda_4libs_8cusparse_sbsrilu02_numericBoost(__pyx_v_handle, __pyx_v_info, __pyx_v_enable_boost, __pyx_v_tol, __pyx_v_boost_val, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3574, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3574, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":3584
 *     check_status(status)
 * 
 * cpdef void dbsrilu02_numericBoost(             # <<<<<<<<<<<<<<
 *         intptr_t handle, size_t info, int enable_boost,
 *         size_t tol, size_t boost_val) except *:
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_323dbsrilu02_numericBoost(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_dbsrilu02_numericBoost(intptr_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;
  __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_backends/cuda/libs/cusparse.pyx":3587
 *         intptr_t handle, size_t info, int enable_boost,
 *         size_t tol, size_t boost_val) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseDbsrilu02_numericBoost(
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3587, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":3588
 *         size_t tol, size_t boost_val) except *:
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseDbsrilu02_numericBoost(
 *             <cusparseHandle_t>handle, <bsrilu02Info_t>info, enable_boost,
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "cupy_backends/cuda/libs/cusparse.pyx":3589
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":3588
 *         size_t tol, size_t boost_val) except *:
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseDbsrilu02_numericBoost(
 *             <cusparseHandle_t>handle, <bsrilu02Info_t>info, enable_boost,
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy_backends/cuda/libs/cusparse.pyx":3592
 *             <cusparseHandle_t>handle, <bsrilu02Info_t>info, enable_boost,
 *             <double*>tol, <double*>boost_val)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef void cbsrilu02_numericBoost(
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 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_backends/cuda/libs/cusparse.pyx":3584
 *     check_status(status)
 * 
 * cpdef void dbsrilu02_numericBoost(             # <<<<<<<<<<<<<<
 *         intptr_t handle, size_t info, int enable_boost,
 *         size_t tol, size_t boost_val) except *:
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.dbsrilu02_numericBoost", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_323dbsrilu02_numericBoost(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_322dbsrilu02_numericBoost, "dbsrilu02_numericBoost(intptr_t handle, size_t info, int enable_boost, size_t tol, size_t boost_val) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_323dbsrilu02_numericBoost(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[5] = {0,0,0,0,0};
  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);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_info,&__pyx_mstate_global->__pyx_n_u_enable_boost,&__pyx_mstate_global->__pyx_n_u_tol,&__pyx_mstate_global->__pyx_n_u_boost_val,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 3584, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3584, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3584, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3584, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3584, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3584, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "dbsrilu02_numericBoost", 0) < (0)) __PYX_ERR(0, 3584, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 5; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("dbsrilu02_numericBoost", 1, 5, 5, i); __PYX_ERR(0, 3584, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 5)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3584, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3584, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3584, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3584, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3584, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3585, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyLong_As_size_t(values[1]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3585, __pyx_L3_error)
    __pyx_v_enable_boost = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_enable_boost == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3585, __pyx_L3_error)
    __pyx_v_tol = __Pyx_PyLong_As_size_t(values[3]); if (unlikely((__pyx_v_tol == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3586, __pyx_L3_error)
    __pyx_v_boost_val = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_boost_val == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3586, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("dbsrilu02_numericBoost", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 3584, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.dbsrilu02_numericBoost", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_322dbsrilu02_numericBoost(__pyx_self, __pyx_v_handle, __pyx_v_info, __pyx_v_enable_boost, __pyx_v_tol, __pyx_v_boost_val);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_322dbsrilu02_numericBoost(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_f_13cupy_backends_4cuda_4libs_8cusparse_dbsrilu02_numericBoost(__pyx_v_handle, __pyx_v_info, __pyx_v_enable_boost, __pyx_v_tol, __pyx_v_boost_val, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3584, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3584, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":3594
 *     check_status(status)
 * 
 * cpdef void cbsrilu02_numericBoost(             # <<<<<<<<<<<<<<
 *         intptr_t handle, size_t info, int enable_boost,
 *         size_t tol, size_t boost_val) except *:
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_325cbsrilu02_numericBoost(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_cbsrilu02_numericBoost(intptr_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;
  __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_backends/cuda/libs/cusparse.pyx":3597
 *         intptr_t handle, size_t info, int enable_boost,
 *         size_t tol, size_t boost_val) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseCbsrilu02_numericBoost(
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3597, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":3598
 *         size_t tol, size_t boost_val) except *:
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseCbsrilu02_numericBoost(
 *             <cusparseHandle_t>handle, <bsrilu02Info_t>info, enable_boost,
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "cupy_backends/cuda/libs/cusparse.pyx":3599
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":3598
 *         size_t tol, size_t boost_val) except *:
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseCbsrilu02_numericBoost(
 *             <cusparseHandle_t>handle, <bsrilu02Info_t>info, enable_boost,
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy_backends/cuda/libs/cusparse.pyx":3602
 *             <cusparseHandle_t>handle, <bsrilu02Info_t>info, enable_boost,
 *             <double*>tol, <cuComplex*>boost_val)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef void zbsrilu02_numericBoost(
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3602, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":3594
 *     check_status(status)
 * 
 * cpdef void cbsrilu02_numericBoost(             # <<<<<<<<<<<<<<
 *         intptr_t handle, size_t info, int enable_boost,
 *         size_t tol, size_t boost_val) except *:
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.cbsrilu02_numericBoost", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_325cbsrilu02_numericBoost(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_324cbsrilu02_numericBoost, "cbsrilu02_numericBoost(intptr_t handle, size_t info, int enable_boost, size_t tol, size_t boost_val) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_325cbsrilu02_numericBoost(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[5] = {0,0,0,0,0};
  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);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_info,&__pyx_mstate_global->__pyx_n_u_enable_boost,&__pyx_mstate_global->__pyx_n_u_tol,&__pyx_mstate_global->__pyx_n_u_boost_val,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 3594, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3594, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3594, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3594, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3594, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3594, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "cbsrilu02_numericBoost", 0) < (0)) __PYX_ERR(0, 3594, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 5; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("cbsrilu02_numericBoost", 1, 5, 5, i); __PYX_ERR(0, 3594, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 5)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3594, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3594, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3594, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3594, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3594, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3595, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyLong_As_size_t(values[1]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3595, __pyx_L3_error)
    __pyx_v_enable_boost = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_enable_boost == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3595, __pyx_L3_error)
    __pyx_v_tol = __Pyx_PyLong_As_size_t(values[3]); if (unlikely((__pyx_v_tol == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3596, __pyx_L3_error)
    __pyx_v_boost_val = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_boost_val == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3596, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("cbsrilu02_numericBoost", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 3594, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.cbsrilu02_numericBoost", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_324cbsrilu02_numericBoost(__pyx_self, __pyx_v_handle, __pyx_v_info, __pyx_v_enable_boost, __pyx_v_tol, __pyx_v_boost_val);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_324cbsrilu02_numericBoost(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_f_13cupy_backends_4cuda_4libs_8cusparse_cbsrilu02_numericBoost(__pyx_v_handle, __pyx_v_info, __pyx_v_enable_boost, __pyx_v_tol, __pyx_v_boost_val, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3594, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3594, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":3604
 *     check_status(status)
 * 
 * cpdef void zbsrilu02_numericBoost(             # <<<<<<<<<<<<<<
 *         intptr_t handle, size_t info, int enable_boost,
 *         size_t tol, size_t boost_val) except *:
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_327zbsrilu02_numericBoost(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_zbsrilu02_numericBoost(intptr_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;
  __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_backends/cuda/libs/cusparse.pyx":3607
 *         intptr_t handle, size_t info, int enable_boost,
 *         size_t tol, size_t boost_val) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseZbsrilu02_numericBoost(
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3607, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":3608
 *         size_t tol, size_t boost_val) except *:
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseZbsrilu02_numericBoost(
 *             <cusparseHandle_t>handle, <bsrilu02Info_t>info, enable_boost,
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "cupy_backends/cuda/libs/cusparse.pyx":3609
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":3608
 *         size_t tol, size_t boost_val) except *:
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseZbsrilu02_numericBoost(
 *             <cusparseHandle_t>handle, <bsrilu02Info_t>info, enable_boost,
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy_backends/cuda/libs/cusparse.pyx":3612
 *             <cusparseHandle_t>handle, <bsrilu02Info_t>info, enable_boost,
 *             <double*>tol, <cuDoubleComplex*>boost_val)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef void xbsrilu02_zeroPivot(
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3612, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":3604
 *     check_status(status)
 * 
 * cpdef void zbsrilu02_numericBoost(             # <<<<<<<<<<<<<<
 *         intptr_t handle, size_t info, int enable_boost,
 *         size_t tol, size_t boost_val) except *:
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.zbsrilu02_numericBoost", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_327zbsrilu02_numericBoost(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_326zbsrilu02_numericBoost, "zbsrilu02_numericBoost(intptr_t handle, size_t info, int enable_boost, size_t tol, size_t boost_val) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_327zbsrilu02_numericBoost(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[5] = {0,0,0,0,0};
  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);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_info,&__pyx_mstate_global->__pyx_n_u_enable_boost,&__pyx_mstate_global->__pyx_n_u_tol,&__pyx_mstate_global->__pyx_n_u_boost_val,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 3604, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3604, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3604, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3604, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3604, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3604, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "zbsrilu02_numericBoost", 0) < (0)) __PYX_ERR(0, 3604, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 5; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("zbsrilu02_numericBoost", 1, 5, 5, i); __PYX_ERR(0, 3604, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 5)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3604, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3604, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3604, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3604, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3604, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3605, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyLong_As_size_t(values[1]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3605, __pyx_L3_error)
    __pyx_v_enable_boost = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_enable_boost == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3605, __pyx_L3_error)
    __pyx_v_tol = __Pyx_PyLong_As_size_t(values[3]); if (unlikely((__pyx_v_tol == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3606, __pyx_L3_error)
    __pyx_v_boost_val = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_boost_val == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3606, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("zbsrilu02_numericBoost", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 3604, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.zbsrilu02_numericBoost", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_326zbsrilu02_numericBoost(__pyx_self, __pyx_v_handle, __pyx_v_info, __pyx_v_enable_boost, __pyx_v_tol, __pyx_v_boost_val);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_326zbsrilu02_numericBoost(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_f_13cupy_backends_4cuda_4libs_8cusparse_zbsrilu02_numericBoost(__pyx_v_handle, __pyx_v_info, __pyx_v_enable_boost, __pyx_v_tol, __pyx_v_boost_val, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3604, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3604, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":3614
 *     check_status(status)
 * 
 * cpdef void xbsrilu02_zeroPivot(             # <<<<<<<<<<<<<<
 *         intptr_t handle, size_t info, size_t position) except *:
 *     _setStream(handle)
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_329xbsrilu02_zeroPivot(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_xbsrilu02_zeroPivot(intptr_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;
  __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_backends/cuda/libs/cusparse.pyx":3616
 * cpdef void xbsrilu02_zeroPivot(
 *         intptr_t handle, size_t info, size_t position) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseXbsrilu02_zeroPivot(
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3616, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":3617
 *         intptr_t handle, size_t info, size_t position) except *:
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseXbsrilu02_zeroPivot(
 *             <cusparseHandle_t>handle, <bsrilu02Info_t>info, <int*>position)
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "cupy_backends/cuda/libs/cusparse.pyx":3618
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":3617
 *         intptr_t handle, size_t info, size_t position) except *:
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseXbsrilu02_zeroPivot(
 *             <cusparseHandle_t>handle, <bsrilu02Info_t>info, <int*>position)
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy_backends/cuda/libs/cusparse.pyx":3620
 *         status = cusparseXbsrilu02_zeroPivot(
 *             <cusparseHandle_t>handle, <bsrilu02Info_t>info, <int*>position)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef int sbsrilu02_bufferSize(intptr_t handle, int dirA, int mb, int nnzb,
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_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_backends/cuda/libs/cusparse.pyx":3614
 *     check_status(status)
 * 
 * cpdef void xbsrilu02_zeroPivot(             # <<<<<<<<<<<<<<
 *         intptr_t handle, size_t info, size_t position) except *:
 *     _setStream(handle)
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.xbsrilu02_zeroPivot", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_329xbsrilu02_zeroPivot(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_328xbsrilu02_zeroPivot, "xbsrilu02_zeroPivot(intptr_t handle, size_t info, size_t position) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_329xbsrilu02_zeroPivot(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_t __pyx_v_handle;
  size_t __pyx_v_info;
  size_t __pyx_v_position;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  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);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_info,&__pyx_mstate_global->__pyx_n_u_position,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 3614, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3614, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3614, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3614, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "xbsrilu02_zeroPivot", 0) < (0)) __PYX_ERR(0, 3614, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("xbsrilu02_zeroPivot", 1, 3, 3, i); __PYX_ERR(0, 3614, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3614, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3614, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3614, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3615, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyLong_As_size_t(values[1]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3615, __pyx_L3_error)
    __pyx_v_position = __Pyx_PyLong_As_size_t(values[2]); if (unlikely((__pyx_v_position == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3615, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("xbsrilu02_zeroPivot", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 3614, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.xbsrilu02_zeroPivot", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_328xbsrilu02_zeroPivot(__pyx_self, __pyx_v_handle, __pyx_v_info, __pyx_v_position);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_328xbsrilu02_zeroPivot(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_f_13cupy_backends_4cuda_4libs_8cusparse_xbsrilu02_zeroPivot(__pyx_v_handle, __pyx_v_info, __pyx_v_position, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3614, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3614, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":3622
 *     check_status(status)
 * 
 * cpdef int sbsrilu02_bufferSize(intptr_t handle, int dirA, int mb, int nnzb,             # <<<<<<<<<<<<<<
 *                                size_t descrA, size_t bsrSortedVal,
 *                                size_t bsrSortedRowPtr, size_t bsrSortedColInd,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_331sbsrilu02_bufferSize(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static int __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_sbsrilu02_bufferSize(intptr_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_backends/cuda/libs/cusparse.pyx":3627
 *                                int blockDim, size_t info) except? -1:
 *     cdef int pBufferSizeInBytes
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseSbsrilu02_bufferSize(
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3627, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":3628
 *     cdef int pBufferSizeInBytes
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseSbsrilu02_bufferSize(
 *             <cusparseHandle_t>handle, <cusparseDirection_t>dirA, mb, nnzb,
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "cupy_backends/cuda/libs/cusparse.pyx":3629
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":3628
 *     cdef int pBufferSizeInBytes
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseSbsrilu02_bufferSize(
 *             <cusparseHandle_t>handle, <cusparseDirection_t>dirA, mb, nnzb,
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy_backends/cuda/libs/cusparse.pyx":3634
 *             <const int*>bsrSortedRowPtr, <const int*>bsrSortedColInd, blockDim,
 *             <bsrilu02Info_t>info, &pBufferSizeInBytes)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return <int>pBufferSizeInBytes
 * 
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3634, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":3635
 *             <bsrilu02Info_t>info, &pBufferSizeInBytes)
 *     check_status(status)
 *     return <int>pBufferSizeInBytes             # <<<<<<<<<<<<<<
 * 
 * cpdef int dbsrilu02_bufferSize(intptr_t handle, int dirA, int mb, int nnzb,
*/
  __pyx_r = ((int)__pyx_v_pBufferSizeInBytes);
  goto __pyx_L0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":3622
 *     check_status(status)
 * 
 * cpdef int sbsrilu02_bufferSize(intptr_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_AddTraceback("cupy_backends.cuda.libs.cusparse.sbsrilu02_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_331sbsrilu02_bufferSize(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_330sbsrilu02_bufferSize, "sbsrilu02_bufferSize(intptr_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_13cupy_backends_4cuda_4libs_8cusparse_331sbsrilu02_bufferSize(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0};
  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);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_dirA,&__pyx_mstate_global->__pyx_n_u_mb,&__pyx_mstate_global->__pyx_n_u_nnzb,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_bsrSortedVal,&__pyx_mstate_global->__pyx_n_u_bsrSortedRowPtr,&__pyx_mstate_global->__pyx_n_u_bsrSortedColInd,&__pyx_mstate_global->__pyx_n_u_blockDim,&__pyx_mstate_global->__pyx_n_u_info,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 3622, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 3622, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 3622, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 3622, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 3622, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 3622, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3622, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3622, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3622, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3622, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3622, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "sbsrilu02_bufferSize", 0) < (0)) __PYX_ERR(0, 3622, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 10; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("sbsrilu02_bufferSize", 1, 10, 10, i); __PYX_ERR(0, 3622, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 10)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3622, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3622, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3622, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3622, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3622, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 3622, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 3622, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 3622, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 3622, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 3622, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3622, __pyx_L3_error)
    __pyx_v_dirA = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_dirA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3622, __pyx_L3_error)
    __pyx_v_mb = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_mb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3622, __pyx_L3_error)
    __pyx_v_nnzb = __Pyx_PyLong_As_int(values[3]); if (unlikely((__pyx_v_nnzb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3622, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3623, __pyx_L3_error)
    __pyx_v_bsrSortedVal = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_bsrSortedVal == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3623, __pyx_L3_error)
    __pyx_v_bsrSortedRowPtr = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_bsrSortedRowPtr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3624, __pyx_L3_error)
    __pyx_v_bsrSortedColInd = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_bsrSortedColInd == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3624, __pyx_L3_error)
    __pyx_v_blockDim = __Pyx_PyLong_As_int(values[8]); if (unlikely((__pyx_v_blockDim == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3625, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyLong_As_size_t(values[9]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3625, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("sbsrilu02_bufferSize", 1, 10, 10, __pyx_nargs); __PYX_ERR(0, 3622, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.sbsrilu02_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_330sbsrilu02_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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_330sbsrilu02_bufferSize(CYTHON_UNUSED PyObject *__pyx_self, intptr_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
  int __pyx_t_1;
  PyObject *__pyx_t_2 = 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_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(__pyx_t_1 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3622, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3622, __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_backends.cuda.libs.cusparse.sbsrilu02_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy_backends/cuda/libs/cusparse.pyx":3637
 *     return <int>pBufferSizeInBytes
 * 
 * cpdef int dbsrilu02_bufferSize(intptr_t handle, int dirA, int mb, int nnzb,             # <<<<<<<<<<<<<<
 *                                size_t descrA, size_t bsrSortedVal,
 *                                size_t bsrSortedRowPtr, size_t bsrSortedColInd,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_333dbsrilu02_bufferSize(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static int __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_dbsrilu02_bufferSize(intptr_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_backends/cuda/libs/cusparse.pyx":3642
 *                                int blockDim, size_t info) except? -1:
 *     cdef int pBufferSizeInBytes
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseDbsrilu02_bufferSize(
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3642, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":3643
 *     cdef int pBufferSizeInBytes
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseDbsrilu02_bufferSize(
 *             <cusparseHandle_t>handle, <cusparseDirection_t>dirA, mb, nnzb,
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "cupy_backends/cuda/libs/cusparse.pyx":3644
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":3643
 *     cdef int pBufferSizeInBytes
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseDbsrilu02_bufferSize(
 *             <cusparseHandle_t>handle, <cusparseDirection_t>dirA, mb, nnzb,
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy_backends/cuda/libs/cusparse.pyx":3649
 *             <const int*>bsrSortedRowPtr, <const int*>bsrSortedColInd, blockDim,
 *             <bsrilu02Info_t>info, &pBufferSizeInBytes)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return <int>pBufferSizeInBytes
 * 
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3649, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":3650
 *             <bsrilu02Info_t>info, &pBufferSizeInBytes)
 *     check_status(status)
 *     return <int>pBufferSizeInBytes             # <<<<<<<<<<<<<<
 * 
 * cpdef int cbsrilu02_bufferSize(intptr_t handle, int dirA, int mb, int nnzb,
*/
  __pyx_r = ((int)__pyx_v_pBufferSizeInBytes);
  goto __pyx_L0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":3637
 *     return <int>pBufferSizeInBytes
 * 
 * cpdef int dbsrilu02_bufferSize(intptr_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_AddTraceback("cupy_backends.cuda.libs.cusparse.dbsrilu02_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_333dbsrilu02_bufferSize(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_332dbsrilu02_bufferSize, "dbsrilu02_bufferSize(intptr_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_13cupy_backends_4cuda_4libs_8cusparse_333dbsrilu02_bufferSize(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0};
  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);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_dirA,&__pyx_mstate_global->__pyx_n_u_mb,&__pyx_mstate_global->__pyx_n_u_nnzb,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_bsrSortedVal,&__pyx_mstate_global->__pyx_n_u_bsrSortedRowPtr,&__pyx_mstate_global->__pyx_n_u_bsrSortedColInd,&__pyx_mstate_global->__pyx_n_u_blockDim,&__pyx_mstate_global->__pyx_n_u_info,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 3637, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 3637, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 3637, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 3637, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 3637, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 3637, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3637, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3637, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3637, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3637, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3637, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "dbsrilu02_bufferSize", 0) < (0)) __PYX_ERR(0, 3637, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 10; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("dbsrilu02_bufferSize", 1, 10, 10, i); __PYX_ERR(0, 3637, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 10)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3637, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3637, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3637, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3637, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3637, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 3637, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 3637, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 3637, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 3637, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 3637, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3637, __pyx_L3_error)
    __pyx_v_dirA = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_dirA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3637, __pyx_L3_error)
    __pyx_v_mb = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_mb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3637, __pyx_L3_error)
    __pyx_v_nnzb = __Pyx_PyLong_As_int(values[3]); if (unlikely((__pyx_v_nnzb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3637, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3638, __pyx_L3_error)
    __pyx_v_bsrSortedVal = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_bsrSortedVal == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3638, __pyx_L3_error)
    __pyx_v_bsrSortedRowPtr = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_bsrSortedRowPtr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3639, __pyx_L3_error)
    __pyx_v_bsrSortedColInd = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_bsrSortedColInd == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3639, __pyx_L3_error)
    __pyx_v_blockDim = __Pyx_PyLong_As_int(values[8]); if (unlikely((__pyx_v_blockDim == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3640, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyLong_As_size_t(values[9]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3640, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("dbsrilu02_bufferSize", 1, 10, 10, __pyx_nargs); __PYX_ERR(0, 3637, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.dbsrilu02_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_332dbsrilu02_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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_332dbsrilu02_bufferSize(CYTHON_UNUSED PyObject *__pyx_self, intptr_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
  int __pyx_t_1;
  PyObject *__pyx_t_2 = 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_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(__pyx_t_1 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3637, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3637, __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_backends.cuda.libs.cusparse.dbsrilu02_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy_backends/cuda/libs/cusparse.pyx":3652
 *     return <int>pBufferSizeInBytes
 * 
 * cpdef int cbsrilu02_bufferSize(intptr_t handle, int dirA, int mb, int nnzb,             # <<<<<<<<<<<<<<
 *                                size_t descrA, size_t bsrSortedVal,
 *                                size_t bsrSortedRowPtr, size_t bsrSortedColInd,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_335cbsrilu02_bufferSize(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static int __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_cbsrilu02_bufferSize(intptr_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_backends/cuda/libs/cusparse.pyx":3657
 *                                int blockDim, size_t info) except? -1:
 *     cdef int pBufferSizeInBytes
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseCbsrilu02_bufferSize(
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3657, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":3658
 *     cdef int pBufferSizeInBytes
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseCbsrilu02_bufferSize(
 *             <cusparseHandle_t>handle, <cusparseDirection_t>dirA, mb, nnzb,
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "cupy_backends/cuda/libs/cusparse.pyx":3659
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":3658
 *     cdef int pBufferSizeInBytes
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseCbsrilu02_bufferSize(
 *             <cusparseHandle_t>handle, <cusparseDirection_t>dirA, mb, nnzb,
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy_backends/cuda/libs/cusparse.pyx":3664
 *             <const int*>bsrSortedRowPtr, <const int*>bsrSortedColInd, blockDim,
 *             <bsrilu02Info_t>info, &pBufferSizeInBytes)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return <int>pBufferSizeInBytes
 * 
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3664, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":3665
 *             <bsrilu02Info_t>info, &pBufferSizeInBytes)
 *     check_status(status)
 *     return <int>pBufferSizeInBytes             # <<<<<<<<<<<<<<
 * 
 * cpdef int zbsrilu02_bufferSize(intptr_t handle, int dirA, int mb, int nnzb,
*/
  __pyx_r = ((int)__pyx_v_pBufferSizeInBytes);
  goto __pyx_L0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":3652
 *     return <int>pBufferSizeInBytes
 * 
 * cpdef int cbsrilu02_bufferSize(intptr_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_AddTraceback("cupy_backends.cuda.libs.cusparse.cbsrilu02_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_335cbsrilu02_bufferSize(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_334cbsrilu02_bufferSize, "cbsrilu02_bufferSize(intptr_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_13cupy_backends_4cuda_4libs_8cusparse_335cbsrilu02_bufferSize(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0};
  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);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_dirA,&__pyx_mstate_global->__pyx_n_u_mb,&__pyx_mstate_global->__pyx_n_u_nnzb,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_bsrSortedVal,&__pyx_mstate_global->__pyx_n_u_bsrSortedRowPtr,&__pyx_mstate_global->__pyx_n_u_bsrSortedColInd,&__pyx_mstate_global->__pyx_n_u_blockDim,&__pyx_mstate_global->__pyx_n_u_info,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 3652, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 3652, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 3652, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 3652, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 3652, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 3652, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3652, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3652, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3652, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3652, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3652, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "cbsrilu02_bufferSize", 0) < (0)) __PYX_ERR(0, 3652, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 10; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("cbsrilu02_bufferSize", 1, 10, 10, i); __PYX_ERR(0, 3652, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 10)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3652, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3652, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3652, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3652, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3652, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 3652, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 3652, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 3652, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 3652, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 3652, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3652, __pyx_L3_error)
    __pyx_v_dirA = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_dirA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3652, __pyx_L3_error)
    __pyx_v_mb = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_mb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3652, __pyx_L3_error)
    __pyx_v_nnzb = __Pyx_PyLong_As_int(values[3]); if (unlikely((__pyx_v_nnzb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3652, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3653, __pyx_L3_error)
    __pyx_v_bsrSortedVal = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_bsrSortedVal == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3653, __pyx_L3_error)
    __pyx_v_bsrSortedRowPtr = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_bsrSortedRowPtr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3654, __pyx_L3_error)
    __pyx_v_bsrSortedColInd = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_bsrSortedColInd == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3654, __pyx_L3_error)
    __pyx_v_blockDim = __Pyx_PyLong_As_int(values[8]); if (unlikely((__pyx_v_blockDim == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3655, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyLong_As_size_t(values[9]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3655, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("cbsrilu02_bufferSize", 1, 10, 10, __pyx_nargs); __PYX_ERR(0, 3652, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.cbsrilu02_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_334cbsrilu02_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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_334cbsrilu02_bufferSize(CYTHON_UNUSED PyObject *__pyx_self, intptr_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
  int __pyx_t_1;
  PyObject *__pyx_t_2 = 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_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(__pyx_t_1 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3652, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3652, __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_backends.cuda.libs.cusparse.cbsrilu02_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy_backends/cuda/libs/cusparse.pyx":3667
 *     return <int>pBufferSizeInBytes
 * 
 * cpdef int zbsrilu02_bufferSize(intptr_t handle, int dirA, int mb, int nnzb,             # <<<<<<<<<<<<<<
 *                                size_t descrA, size_t bsrSortedVal,
 *                                size_t bsrSortedRowPtr, size_t bsrSortedColInd,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_337zbsrilu02_bufferSize(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static int __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_zbsrilu02_bufferSize(intptr_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_backends/cuda/libs/cusparse.pyx":3672
 *                                int blockDim, size_t info) except? -1:
 *     cdef int pBufferSizeInBytes
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseZbsrilu02_bufferSize(
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3672, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":3673
 *     cdef int pBufferSizeInBytes
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseZbsrilu02_bufferSize(
 *             <cusparseHandle_t>handle, <cusparseDirection_t>dirA, mb, nnzb,
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "cupy_backends/cuda/libs/cusparse.pyx":3674
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":3673
 *     cdef int pBufferSizeInBytes
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseZbsrilu02_bufferSize(
 *             <cusparseHandle_t>handle, <cusparseDirection_t>dirA, mb, nnzb,
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy_backends/cuda/libs/cusparse.pyx":3679
 *             <const int*>bsrSortedRowPtr, <const int*>bsrSortedColInd, blockDim,
 *             <bsrilu02Info_t>info, &pBufferSizeInBytes)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return <int>pBufferSizeInBytes
 * 
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3679, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":3680
 *             <bsrilu02Info_t>info, &pBufferSizeInBytes)
 *     check_status(status)
 *     return <int>pBufferSizeInBytes             # <<<<<<<<<<<<<<
 * 
 * cpdef void sbsrilu02_analysis(
*/
  __pyx_r = ((int)__pyx_v_pBufferSizeInBytes);
  goto __pyx_L0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":3667
 *     return <int>pBufferSizeInBytes
 * 
 * cpdef int zbsrilu02_bufferSize(intptr_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_AddTraceback("cupy_backends.cuda.libs.cusparse.zbsrilu02_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_337zbsrilu02_bufferSize(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_336zbsrilu02_bufferSize, "zbsrilu02_bufferSize(intptr_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_13cupy_backends_4cuda_4libs_8cusparse_337zbsrilu02_bufferSize(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0};
  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);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_dirA,&__pyx_mstate_global->__pyx_n_u_mb,&__pyx_mstate_global->__pyx_n_u_nnzb,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_bsrSortedVal,&__pyx_mstate_global->__pyx_n_u_bsrSortedRowPtr,&__pyx_mstate_global->__pyx_n_u_bsrSortedColInd,&__pyx_mstate_global->__pyx_n_u_blockDim,&__pyx_mstate_global->__pyx_n_u_info,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 3667, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 3667, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 3667, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 3667, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 3667, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 3667, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3667, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3667, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3667, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3667, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3667, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "zbsrilu02_bufferSize", 0) < (0)) __PYX_ERR(0, 3667, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 10; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("zbsrilu02_bufferSize", 1, 10, 10, i); __PYX_ERR(0, 3667, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 10)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3667, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3667, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3667, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3667, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3667, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 3667, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 3667, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 3667, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 3667, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 3667, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3667, __pyx_L3_error)
    __pyx_v_dirA = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_dirA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3667, __pyx_L3_error)
    __pyx_v_mb = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_mb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3667, __pyx_L3_error)
    __pyx_v_nnzb = __Pyx_PyLong_As_int(values[3]); if (unlikely((__pyx_v_nnzb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3667, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3668, __pyx_L3_error)
    __pyx_v_bsrSortedVal = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_bsrSortedVal == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3668, __pyx_L3_error)
    __pyx_v_bsrSortedRowPtr = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_bsrSortedRowPtr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3669, __pyx_L3_error)
    __pyx_v_bsrSortedColInd = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_bsrSortedColInd == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3669, __pyx_L3_error)
    __pyx_v_blockDim = __Pyx_PyLong_As_int(values[8]); if (unlikely((__pyx_v_blockDim == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3670, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyLong_As_size_t(values[9]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3670, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("zbsrilu02_bufferSize", 1, 10, 10, __pyx_nargs); __PYX_ERR(0, 3667, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.zbsrilu02_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_336zbsrilu02_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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_336zbsrilu02_bufferSize(CYTHON_UNUSED PyObject *__pyx_self, intptr_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
  int __pyx_t_1;
  PyObject *__pyx_t_2 = 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_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(__pyx_t_1 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3667, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3667, __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_backends.cuda.libs.cusparse.zbsrilu02_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy_backends/cuda/libs/cusparse.pyx":3682
 *     return <int>pBufferSizeInBytes
 * 
 * cpdef void sbsrilu02_analysis(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int dirA, int mb, int nnzb, size_t descrA,
 *         size_t bsrSortedVal, size_t bsrSortedRowPtr, size_t bsrSortedColInd,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_339sbsrilu02_analysis(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_sbsrilu02_analysis(intptr_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;
  __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_backends/cuda/libs/cusparse.pyx":3686
 *         size_t bsrSortedVal, size_t bsrSortedRowPtr, size_t bsrSortedColInd,
 *         int blockDim, size_t info, int policy, size_t pBuffer) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseSbsrilu02_analysis(
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3686, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":3687
 *         int blockDim, size_t info, int policy, size_t pBuffer) except *:
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseSbsrilu02_analysis(
 *             <cusparseHandle_t>handle, <cusparseDirection_t>dirA, mb, nnzb,
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "cupy_backends/cuda/libs/cusparse.pyx":3688
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":3687
 *         int blockDim, size_t info, int policy, size_t pBuffer) except *:
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseSbsrilu02_analysis(
 *             <cusparseHandle_t>handle, <cusparseDirection_t>dirA, mb, nnzb,
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy_backends/cuda/libs/cusparse.pyx":3694
 *             <bsrilu02Info_t>info, <cusparseSolvePolicy_t>policy,
 *             <void*>pBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef void dbsrilu02_analysis(
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3694, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":3682
 *     return <int>pBufferSizeInBytes
 * 
 * cpdef void sbsrilu02_analysis(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int dirA, int mb, int nnzb, size_t descrA,
 *         size_t bsrSortedVal, size_t bsrSortedRowPtr, size_t bsrSortedColInd,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.sbsrilu02_analysis", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_339sbsrilu02_analysis(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_338sbsrilu02_analysis, "sbsrilu02_analysis(intptr_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) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_339sbsrilu02_analysis(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[12] = {0,0,0,0,0,0,0,0,0,0,0,0};
  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);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_dirA,&__pyx_mstate_global->__pyx_n_u_mb,&__pyx_mstate_global->__pyx_n_u_nnzb,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_bsrSortedVal,&__pyx_mstate_global->__pyx_n_u_bsrSortedRowPtr,&__pyx_mstate_global->__pyx_n_u_bsrSortedColInd,&__pyx_mstate_global->__pyx_n_u_blockDim,&__pyx_mstate_global->__pyx_n_u_info,&__pyx_mstate_global->__pyx_n_u_policy,&__pyx_mstate_global->__pyx_n_u_pBuffer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 3682, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 12:
        values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 3682, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 11:
        values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 3682, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 3682, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 3682, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 3682, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 3682, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 3682, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3682, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3682, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3682, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3682, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3682, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "sbsrilu02_analysis", 0) < (0)) __PYX_ERR(0, 3682, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 12; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("sbsrilu02_analysis", 1, 12, 12, i); __PYX_ERR(0, 3682, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 12)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3682, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3682, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3682, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3682, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3682, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 3682, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 3682, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 3682, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 3682, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 3682, __pyx_L3_error)
      values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 3682, __pyx_L3_error)
      values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 3682, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3683, __pyx_L3_error)
    __pyx_v_dirA = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_dirA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3683, __pyx_L3_error)
    __pyx_v_mb = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_mb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3683, __pyx_L3_error)
    __pyx_v_nnzb = __Pyx_PyLong_As_int(values[3]); if (unlikely((__pyx_v_nnzb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3683, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3683, __pyx_L3_error)
    __pyx_v_bsrSortedVal = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_bsrSortedVal == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3684, __pyx_L3_error)
    __pyx_v_bsrSortedRowPtr = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_bsrSortedRowPtr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3684, __pyx_L3_error)
    __pyx_v_bsrSortedColInd = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_bsrSortedColInd == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3684, __pyx_L3_error)
    __pyx_v_blockDim = __Pyx_PyLong_As_int(values[8]); if (unlikely((__pyx_v_blockDim == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3685, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyLong_As_size_t(values[9]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3685, __pyx_L3_error)
    __pyx_v_policy = __Pyx_PyLong_As_int(values[10]); if (unlikely((__pyx_v_policy == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3685, __pyx_L3_error)
    __pyx_v_pBuffer = __Pyx_PyLong_As_size_t(values[11]); if (unlikely((__pyx_v_pBuffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3685, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("sbsrilu02_analysis", 1, 12, 12, __pyx_nargs); __PYX_ERR(0, 3682, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.sbsrilu02_analysis", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_338sbsrilu02_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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_338sbsrilu02_analysis(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3682, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3682, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":3696
 *     check_status(status)
 * 
 * cpdef void dbsrilu02_analysis(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int dirA, int mb, int nnzb, size_t descrA,
 *         size_t bsrSortedVal, size_t bsrSortedRowPtr, size_t bsrSortedColInd,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_341dbsrilu02_analysis(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_dbsrilu02_analysis(intptr_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;
  __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_backends/cuda/libs/cusparse.pyx":3700
 *         size_t bsrSortedVal, size_t bsrSortedRowPtr, size_t bsrSortedColInd,
 *         int blockDim, size_t info, int policy, size_t pBuffer) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseDbsrilu02_analysis(
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3700, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":3701
 *         int blockDim, size_t info, int policy, size_t pBuffer) except *:
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseDbsrilu02_analysis(
 *             <cusparseHandle_t>handle, <cusparseDirection_t>dirA, mb, nnzb,
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "cupy_backends/cuda/libs/cusparse.pyx":3702
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":3701
 *         int blockDim, size_t info, int policy, size_t pBuffer) except *:
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseDbsrilu02_analysis(
 *             <cusparseHandle_t>handle, <cusparseDirection_t>dirA, mb, nnzb,
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy_backends/cuda/libs/cusparse.pyx":3708
 *             <bsrilu02Info_t>info, <cusparseSolvePolicy_t>policy,
 *             <void*>pBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef void cbsrilu02_analysis(
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3708, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":3696
 *     check_status(status)
 * 
 * cpdef void dbsrilu02_analysis(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int dirA, int mb, int nnzb, size_t descrA,
 *         size_t bsrSortedVal, size_t bsrSortedRowPtr, size_t bsrSortedColInd,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.dbsrilu02_analysis", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_341dbsrilu02_analysis(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_340dbsrilu02_analysis, "dbsrilu02_analysis(intptr_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) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_341dbsrilu02_analysis(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[12] = {0,0,0,0,0,0,0,0,0,0,0,0};
  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);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_dirA,&__pyx_mstate_global->__pyx_n_u_mb,&__pyx_mstate_global->__pyx_n_u_nnzb,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_bsrSortedVal,&__pyx_mstate_global->__pyx_n_u_bsrSortedRowPtr,&__pyx_mstate_global->__pyx_n_u_bsrSortedColInd,&__pyx_mstate_global->__pyx_n_u_blockDim,&__pyx_mstate_global->__pyx_n_u_info,&__pyx_mstate_global->__pyx_n_u_policy,&__pyx_mstate_global->__pyx_n_u_pBuffer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 3696, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 12:
        values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 3696, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 11:
        values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 3696, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 3696, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 3696, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 3696, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 3696, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 3696, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3696, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3696, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3696, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3696, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3696, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "dbsrilu02_analysis", 0) < (0)) __PYX_ERR(0, 3696, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 12; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("dbsrilu02_analysis", 1, 12, 12, i); __PYX_ERR(0, 3696, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 12)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3696, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3696, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3696, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3696, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3696, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 3696, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 3696, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 3696, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 3696, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 3696, __pyx_L3_error)
      values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 3696, __pyx_L3_error)
      values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 3696, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3697, __pyx_L3_error)
    __pyx_v_dirA = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_dirA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3697, __pyx_L3_error)
    __pyx_v_mb = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_mb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3697, __pyx_L3_error)
    __pyx_v_nnzb = __Pyx_PyLong_As_int(values[3]); if (unlikely((__pyx_v_nnzb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3697, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3697, __pyx_L3_error)
    __pyx_v_bsrSortedVal = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_bsrSortedVal == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3698, __pyx_L3_error)
    __pyx_v_bsrSortedRowPtr = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_bsrSortedRowPtr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3698, __pyx_L3_error)
    __pyx_v_bsrSortedColInd = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_bsrSortedColInd == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3698, __pyx_L3_error)
    __pyx_v_blockDim = __Pyx_PyLong_As_int(values[8]); if (unlikely((__pyx_v_blockDim == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3699, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyLong_As_size_t(values[9]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3699, __pyx_L3_error)
    __pyx_v_policy = __Pyx_PyLong_As_int(values[10]); if (unlikely((__pyx_v_policy == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3699, __pyx_L3_error)
    __pyx_v_pBuffer = __Pyx_PyLong_As_size_t(values[11]); if (unlikely((__pyx_v_pBuffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3699, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("dbsrilu02_analysis", 1, 12, 12, __pyx_nargs); __PYX_ERR(0, 3696, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.dbsrilu02_analysis", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_340dbsrilu02_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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_340dbsrilu02_analysis(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3696, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3696, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":3710
 *     check_status(status)
 * 
 * cpdef void cbsrilu02_analysis(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int dirA, int mb, int nnzb, size_t descrA,
 *         size_t bsrSortedVal, size_t bsrSortedRowPtr, size_t bsrSortedColInd,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_343cbsrilu02_analysis(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_cbsrilu02_analysis(intptr_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;
  __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_backends/cuda/libs/cusparse.pyx":3714
 *         size_t bsrSortedVal, size_t bsrSortedRowPtr, size_t bsrSortedColInd,
 *         int blockDim, size_t info, int policy, size_t pBuffer) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseCbsrilu02_analysis(
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3714, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":3715
 *         int blockDim, size_t info, int policy, size_t pBuffer) except *:
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseCbsrilu02_analysis(
 *             <cusparseHandle_t>handle, <cusparseDirection_t>dirA, mb, nnzb,
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "cupy_backends/cuda/libs/cusparse.pyx":3716
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":3715
 *         int blockDim, size_t info, int policy, size_t pBuffer) except *:
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseCbsrilu02_analysis(
 *             <cusparseHandle_t>handle, <cusparseDirection_t>dirA, mb, nnzb,
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy_backends/cuda/libs/cusparse.pyx":3722
 *             <bsrilu02Info_t>info, <cusparseSolvePolicy_t>policy,
 *             <void*>pBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef void zbsrilu02_analysis(
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3722, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":3710
 *     check_status(status)
 * 
 * cpdef void cbsrilu02_analysis(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int dirA, int mb, int nnzb, size_t descrA,
 *         size_t bsrSortedVal, size_t bsrSortedRowPtr, size_t bsrSortedColInd,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.cbsrilu02_analysis", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_343cbsrilu02_analysis(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_342cbsrilu02_analysis, "cbsrilu02_analysis(intptr_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) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_343cbsrilu02_analysis(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[12] = {0,0,0,0,0,0,0,0,0,0,0,0};
  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);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_dirA,&__pyx_mstate_global->__pyx_n_u_mb,&__pyx_mstate_global->__pyx_n_u_nnzb,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_bsrSortedVal,&__pyx_mstate_global->__pyx_n_u_bsrSortedRowPtr,&__pyx_mstate_global->__pyx_n_u_bsrSortedColInd,&__pyx_mstate_global->__pyx_n_u_blockDim,&__pyx_mstate_global->__pyx_n_u_info,&__pyx_mstate_global->__pyx_n_u_policy,&__pyx_mstate_global->__pyx_n_u_pBuffer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 3710, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 12:
        values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 3710, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 11:
        values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 3710, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 3710, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 3710, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 3710, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 3710, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 3710, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3710, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3710, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3710, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3710, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3710, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "cbsrilu02_analysis", 0) < (0)) __PYX_ERR(0, 3710, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 12; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("cbsrilu02_analysis", 1, 12, 12, i); __PYX_ERR(0, 3710, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 12)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3710, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3710, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3710, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3710, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3710, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 3710, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 3710, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 3710, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 3710, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 3710, __pyx_L3_error)
      values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 3710, __pyx_L3_error)
      values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 3710, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3711, __pyx_L3_error)
    __pyx_v_dirA = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_dirA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3711, __pyx_L3_error)
    __pyx_v_mb = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_mb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3711, __pyx_L3_error)
    __pyx_v_nnzb = __Pyx_PyLong_As_int(values[3]); if (unlikely((__pyx_v_nnzb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3711, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3711, __pyx_L3_error)
    __pyx_v_bsrSortedVal = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_bsrSortedVal == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3712, __pyx_L3_error)
    __pyx_v_bsrSortedRowPtr = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_bsrSortedRowPtr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3712, __pyx_L3_error)
    __pyx_v_bsrSortedColInd = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_bsrSortedColInd == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3712, __pyx_L3_error)
    __pyx_v_blockDim = __Pyx_PyLong_As_int(values[8]); if (unlikely((__pyx_v_blockDim == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3713, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyLong_As_size_t(values[9]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3713, __pyx_L3_error)
    __pyx_v_policy = __Pyx_PyLong_As_int(values[10]); if (unlikely((__pyx_v_policy == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3713, __pyx_L3_error)
    __pyx_v_pBuffer = __Pyx_PyLong_As_size_t(values[11]); if (unlikely((__pyx_v_pBuffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3713, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("cbsrilu02_analysis", 1, 12, 12, __pyx_nargs); __PYX_ERR(0, 3710, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.cbsrilu02_analysis", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_342cbsrilu02_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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_342cbsrilu02_analysis(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3710, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3710, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":3724
 *     check_status(status)
 * 
 * cpdef void zbsrilu02_analysis(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int dirA, int mb, int nnzb, size_t descrA,
 *         size_t bsrSortedVal, size_t bsrSortedRowPtr, size_t bsrSortedColInd,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_345zbsrilu02_analysis(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_zbsrilu02_analysis(intptr_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;
  __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_backends/cuda/libs/cusparse.pyx":3728
 *         size_t bsrSortedVal, size_t bsrSortedRowPtr, size_t bsrSortedColInd,
 *         int blockDim, size_t info, int policy, size_t pBuffer) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseZbsrilu02_analysis(
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3728, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":3729
 *         int blockDim, size_t info, int policy, size_t pBuffer) except *:
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseZbsrilu02_analysis(
 *             <cusparseHandle_t>handle, <cusparseDirection_t>dirA, mb, nnzb,
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "cupy_backends/cuda/libs/cusparse.pyx":3730
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":3729
 *         int blockDim, size_t info, int policy, size_t pBuffer) except *:
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseZbsrilu02_analysis(
 *             <cusparseHandle_t>handle, <cusparseDirection_t>dirA, mb, nnzb,
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy_backends/cuda/libs/cusparse.pyx":3736
 *             <bsrilu02Info_t>info, <cusparseSolvePolicy_t>policy,
 *             <void*>pBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef void sbsrilu02(
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3736, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":3724
 *     check_status(status)
 * 
 * cpdef void zbsrilu02_analysis(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int dirA, int mb, int nnzb, size_t descrA,
 *         size_t bsrSortedVal, size_t bsrSortedRowPtr, size_t bsrSortedColInd,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.zbsrilu02_analysis", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_345zbsrilu02_analysis(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_344zbsrilu02_analysis, "zbsrilu02_analysis(intptr_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) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_345zbsrilu02_analysis(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[12] = {0,0,0,0,0,0,0,0,0,0,0,0};
  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);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_dirA,&__pyx_mstate_global->__pyx_n_u_mb,&__pyx_mstate_global->__pyx_n_u_nnzb,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_bsrSortedVal,&__pyx_mstate_global->__pyx_n_u_bsrSortedRowPtr,&__pyx_mstate_global->__pyx_n_u_bsrSortedColInd,&__pyx_mstate_global->__pyx_n_u_blockDim,&__pyx_mstate_global->__pyx_n_u_info,&__pyx_mstate_global->__pyx_n_u_policy,&__pyx_mstate_global->__pyx_n_u_pBuffer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 3724, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 12:
        values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 3724, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 11:
        values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 3724, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 3724, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 3724, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 3724, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 3724, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 3724, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3724, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3724, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3724, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3724, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3724, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "zbsrilu02_analysis", 0) < (0)) __PYX_ERR(0, 3724, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 12; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("zbsrilu02_analysis", 1, 12, 12, i); __PYX_ERR(0, 3724, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 12)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3724, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3724, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3724, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3724, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3724, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 3724, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 3724, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 3724, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 3724, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 3724, __pyx_L3_error)
      values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 3724, __pyx_L3_error)
      values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 3724, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3725, __pyx_L3_error)
    __pyx_v_dirA = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_dirA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3725, __pyx_L3_error)
    __pyx_v_mb = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_mb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3725, __pyx_L3_error)
    __pyx_v_nnzb = __Pyx_PyLong_As_int(values[3]); if (unlikely((__pyx_v_nnzb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3725, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3725, __pyx_L3_error)
    __pyx_v_bsrSortedVal = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_bsrSortedVal == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3726, __pyx_L3_error)
    __pyx_v_bsrSortedRowPtr = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_bsrSortedRowPtr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3726, __pyx_L3_error)
    __pyx_v_bsrSortedColInd = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_bsrSortedColInd == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3726, __pyx_L3_error)
    __pyx_v_blockDim = __Pyx_PyLong_As_int(values[8]); if (unlikely((__pyx_v_blockDim == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3727, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyLong_As_size_t(values[9]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3727, __pyx_L3_error)
    __pyx_v_policy = __Pyx_PyLong_As_int(values[10]); if (unlikely((__pyx_v_policy == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3727, __pyx_L3_error)
    __pyx_v_pBuffer = __Pyx_PyLong_As_size_t(values[11]); if (unlikely((__pyx_v_pBuffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3727, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("zbsrilu02_analysis", 1, 12, 12, __pyx_nargs); __PYX_ERR(0, 3724, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.zbsrilu02_analysis", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_344zbsrilu02_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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_344zbsrilu02_analysis(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3724, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3724, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":3738
 *     check_status(status)
 * 
 * cpdef void sbsrilu02(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int dirA, int mb, int nnzb, size_t descrA,
 *         size_t bsrSortedVal, size_t bsrSortedRowPtr,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_347sbsrilu02(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_sbsrilu02(intptr_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;
  __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_backends/cuda/libs/cusparse.pyx":3743
 *         size_t bsrSortedColInd, int blockDim, size_t info, int policy,
 *         size_t pBuffer) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseSbsrilu02(
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3743, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":3744
 *         size_t pBuffer) except *:
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseSbsrilu02(
 *             <cusparseHandle_t>handle, <cusparseDirection_t>dirA, mb, nnzb,
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "cupy_backends/cuda/libs/cusparse.pyx":3745
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":3744
 *         size_t pBuffer) except *:
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseSbsrilu02(
 *             <cusparseHandle_t>handle, <cusparseDirection_t>dirA, mb, nnzb,
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy_backends/cuda/libs/cusparse.pyx":3751
 *             <bsrilu02Info_t>info, <cusparseSolvePolicy_t>policy,
 *             <void*>pBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef void dbsrilu02(
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3751, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":3738
 *     check_status(status)
 * 
 * cpdef void sbsrilu02(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int dirA, int mb, int nnzb, size_t descrA,
 *         size_t bsrSortedVal, size_t bsrSortedRowPtr,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.sbsrilu02", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_347sbsrilu02(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_346sbsrilu02, "sbsrilu02(intptr_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) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_347sbsrilu02(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[12] = {0,0,0,0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("sbsrilu02 (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_dirA,&__pyx_mstate_global->__pyx_n_u_mb,&__pyx_mstate_global->__pyx_n_u_nnzb,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_bsrSortedVal,&__pyx_mstate_global->__pyx_n_u_bsrSortedRowPtr,&__pyx_mstate_global->__pyx_n_u_bsrSortedColInd,&__pyx_mstate_global->__pyx_n_u_blockDim,&__pyx_mstate_global->__pyx_n_u_info,&__pyx_mstate_global->__pyx_n_u_policy,&__pyx_mstate_global->__pyx_n_u_pBuffer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 3738, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 12:
        values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 3738, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 11:
        values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 3738, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 3738, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 3738, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 3738, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 3738, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 3738, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3738, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3738, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3738, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3738, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3738, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "sbsrilu02", 0) < (0)) __PYX_ERR(0, 3738, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 12; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("sbsrilu02", 1, 12, 12, i); __PYX_ERR(0, 3738, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 12)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3738, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3738, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3738, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3738, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3738, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 3738, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 3738, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 3738, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 3738, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 3738, __pyx_L3_error)
      values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 3738, __pyx_L3_error)
      values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 3738, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3739, __pyx_L3_error)
    __pyx_v_dirA = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_dirA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3739, __pyx_L3_error)
    __pyx_v_mb = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_mb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3739, __pyx_L3_error)
    __pyx_v_nnzb = __Pyx_PyLong_As_int(values[3]); if (unlikely((__pyx_v_nnzb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3739, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3739, __pyx_L3_error)
    __pyx_v_bsrSortedVal = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_bsrSortedVal == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3740, __pyx_L3_error)
    __pyx_v_bsrSortedRowPtr = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_bsrSortedRowPtr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3740, __pyx_L3_error)
    __pyx_v_bsrSortedColInd = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_bsrSortedColInd == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3741, __pyx_L3_error)
    __pyx_v_blockDim = __Pyx_PyLong_As_int(values[8]); if (unlikely((__pyx_v_blockDim == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3741, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyLong_As_size_t(values[9]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3741, __pyx_L3_error)
    __pyx_v_policy = __Pyx_PyLong_As_int(values[10]); if (unlikely((__pyx_v_policy == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3741, __pyx_L3_error)
    __pyx_v_pBuffer = __Pyx_PyLong_As_size_t(values[11]); if (unlikely((__pyx_v_pBuffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3742, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("sbsrilu02", 1, 12, 12, __pyx_nargs); __PYX_ERR(0, 3738, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.sbsrilu02", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_346sbsrilu02(__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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_346sbsrilu02(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3738, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3738, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":3753
 *     check_status(status)
 * 
 * cpdef void dbsrilu02(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int dirA, int mb, int nnzb, size_t descrA,
 *         size_t bsrSortedVal, size_t bsrSortedRowPtr,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_349dbsrilu02(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_dbsrilu02(intptr_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;
  __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_backends/cuda/libs/cusparse.pyx":3758
 *         size_t bsrSortedColInd, int blockDim, size_t info, int policy,
 *         size_t pBuffer) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseDbsrilu02(
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3758, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":3759
 *         size_t pBuffer) except *:
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseDbsrilu02(
 *             <cusparseHandle_t>handle, <cusparseDirection_t>dirA, mb, nnzb,
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "cupy_backends/cuda/libs/cusparse.pyx":3760
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":3759
 *         size_t pBuffer) except *:
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseDbsrilu02(
 *             <cusparseHandle_t>handle, <cusparseDirection_t>dirA, mb, nnzb,
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy_backends/cuda/libs/cusparse.pyx":3766
 *             <bsrilu02Info_t>info, <cusparseSolvePolicy_t>policy,
 *             <void*>pBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef void cbsrilu02(
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3766, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":3753
 *     check_status(status)
 * 
 * cpdef void dbsrilu02(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int dirA, int mb, int nnzb, size_t descrA,
 *         size_t bsrSortedVal, size_t bsrSortedRowPtr,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.dbsrilu02", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_349dbsrilu02(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_348dbsrilu02, "dbsrilu02(intptr_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) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_349dbsrilu02(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[12] = {0,0,0,0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dbsrilu02 (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_dirA,&__pyx_mstate_global->__pyx_n_u_mb,&__pyx_mstate_global->__pyx_n_u_nnzb,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_bsrSortedVal,&__pyx_mstate_global->__pyx_n_u_bsrSortedRowPtr,&__pyx_mstate_global->__pyx_n_u_bsrSortedColInd,&__pyx_mstate_global->__pyx_n_u_blockDim,&__pyx_mstate_global->__pyx_n_u_info,&__pyx_mstate_global->__pyx_n_u_policy,&__pyx_mstate_global->__pyx_n_u_pBuffer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 3753, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 12:
        values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 3753, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 11:
        values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 3753, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 3753, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 3753, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 3753, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 3753, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 3753, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3753, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3753, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3753, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3753, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3753, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "dbsrilu02", 0) < (0)) __PYX_ERR(0, 3753, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 12; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("dbsrilu02", 1, 12, 12, i); __PYX_ERR(0, 3753, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 12)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3753, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3753, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3753, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3753, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3753, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 3753, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 3753, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 3753, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 3753, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 3753, __pyx_L3_error)
      values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 3753, __pyx_L3_error)
      values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 3753, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3754, __pyx_L3_error)
    __pyx_v_dirA = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_dirA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3754, __pyx_L3_error)
    __pyx_v_mb = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_mb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3754, __pyx_L3_error)
    __pyx_v_nnzb = __Pyx_PyLong_As_int(values[3]); if (unlikely((__pyx_v_nnzb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3754, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3754, __pyx_L3_error)
    __pyx_v_bsrSortedVal = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_bsrSortedVal == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3755, __pyx_L3_error)
    __pyx_v_bsrSortedRowPtr = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_bsrSortedRowPtr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3755, __pyx_L3_error)
    __pyx_v_bsrSortedColInd = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_bsrSortedColInd == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3756, __pyx_L3_error)
    __pyx_v_blockDim = __Pyx_PyLong_As_int(values[8]); if (unlikely((__pyx_v_blockDim == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3756, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyLong_As_size_t(values[9]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3756, __pyx_L3_error)
    __pyx_v_policy = __Pyx_PyLong_As_int(values[10]); if (unlikely((__pyx_v_policy == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3756, __pyx_L3_error)
    __pyx_v_pBuffer = __Pyx_PyLong_As_size_t(values[11]); if (unlikely((__pyx_v_pBuffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3757, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("dbsrilu02", 1, 12, 12, __pyx_nargs); __PYX_ERR(0, 3753, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.dbsrilu02", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_348dbsrilu02(__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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_348dbsrilu02(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3753, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3753, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":3768
 *     check_status(status)
 * 
 * cpdef void cbsrilu02(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int dirA, int mb, int nnzb, size_t descrA,
 *         size_t bsrSortedVal, size_t bsrSortedRowPtr,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_351cbsrilu02(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_cbsrilu02(intptr_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;
  __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_backends/cuda/libs/cusparse.pyx":3773
 *         size_t bsrSortedColInd, int blockDim, size_t info, int policy,
 *         size_t pBuffer) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseCbsrilu02(
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3773, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":3774
 *         size_t pBuffer) except *:
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseCbsrilu02(
 *             <cusparseHandle_t>handle, <cusparseDirection_t>dirA, mb, nnzb,
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "cupy_backends/cuda/libs/cusparse.pyx":3775
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":3774
 *         size_t pBuffer) except *:
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseCbsrilu02(
 *             <cusparseHandle_t>handle, <cusparseDirection_t>dirA, mb, nnzb,
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy_backends/cuda/libs/cusparse.pyx":3781
 *             <bsrilu02Info_t>info, <cusparseSolvePolicy_t>policy,
 *             <void*>pBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef void zbsrilu02(
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3781, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":3768
 *     check_status(status)
 * 
 * cpdef void cbsrilu02(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int dirA, int mb, int nnzb, size_t descrA,
 *         size_t bsrSortedVal, size_t bsrSortedRowPtr,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.cbsrilu02", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_351cbsrilu02(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_350cbsrilu02, "cbsrilu02(intptr_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) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_351cbsrilu02(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[12] = {0,0,0,0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("cbsrilu02 (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_dirA,&__pyx_mstate_global->__pyx_n_u_mb,&__pyx_mstate_global->__pyx_n_u_nnzb,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_bsrSortedVal,&__pyx_mstate_global->__pyx_n_u_bsrSortedRowPtr,&__pyx_mstate_global->__pyx_n_u_bsrSortedColInd,&__pyx_mstate_global->__pyx_n_u_blockDim,&__pyx_mstate_global->__pyx_n_u_info,&__pyx_mstate_global->__pyx_n_u_policy,&__pyx_mstate_global->__pyx_n_u_pBuffer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 3768, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 12:
        values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 3768, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 11:
        values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 3768, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 3768, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 3768, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 3768, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 3768, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 3768, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3768, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3768, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3768, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3768, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3768, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "cbsrilu02", 0) < (0)) __PYX_ERR(0, 3768, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 12; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("cbsrilu02", 1, 12, 12, i); __PYX_ERR(0, 3768, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 12)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3768, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3768, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3768, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3768, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3768, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 3768, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 3768, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 3768, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 3768, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 3768, __pyx_L3_error)
      values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 3768, __pyx_L3_error)
      values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 3768, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3769, __pyx_L3_error)
    __pyx_v_dirA = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_dirA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3769, __pyx_L3_error)
    __pyx_v_mb = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_mb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3769, __pyx_L3_error)
    __pyx_v_nnzb = __Pyx_PyLong_As_int(values[3]); if (unlikely((__pyx_v_nnzb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3769, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3769, __pyx_L3_error)
    __pyx_v_bsrSortedVal = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_bsrSortedVal == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3770, __pyx_L3_error)
    __pyx_v_bsrSortedRowPtr = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_bsrSortedRowPtr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3770, __pyx_L3_error)
    __pyx_v_bsrSortedColInd = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_bsrSortedColInd == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3771, __pyx_L3_error)
    __pyx_v_blockDim = __Pyx_PyLong_As_int(values[8]); if (unlikely((__pyx_v_blockDim == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3771, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyLong_As_size_t(values[9]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3771, __pyx_L3_error)
    __pyx_v_policy = __Pyx_PyLong_As_int(values[10]); if (unlikely((__pyx_v_policy == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3771, __pyx_L3_error)
    __pyx_v_pBuffer = __Pyx_PyLong_As_size_t(values[11]); if (unlikely((__pyx_v_pBuffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3772, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("cbsrilu02", 1, 12, 12, __pyx_nargs); __PYX_ERR(0, 3768, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.cbsrilu02", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_350cbsrilu02(__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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_350cbsrilu02(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3768, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3768, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":3783
 *     check_status(status)
 * 
 * cpdef void zbsrilu02(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int dirA, int mb, int nnzb, size_t descrA,
 *         size_t bsrSortedVal, size_t bsrSortedRowPtr,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_353zbsrilu02(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_zbsrilu02(intptr_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;
  __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_backends/cuda/libs/cusparse.pyx":3788
 *         size_t bsrSortedColInd, int blockDim, size_t info, int policy,
 *         size_t pBuffer) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseZbsrilu02(
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3788, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":3789
 *         size_t pBuffer) except *:
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseZbsrilu02(
 *             <cusparseHandle_t>handle, <cusparseDirection_t>dirA, mb, nnzb,
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "cupy_backends/cuda/libs/cusparse.pyx":3790
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":3789
 *         size_t pBuffer) except *:
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseZbsrilu02(
 *             <cusparseHandle_t>handle, <cusparseDirection_t>dirA, mb, nnzb,
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy_backends/cuda/libs/cusparse.pyx":3796
 *             <bsrilu02Info_t>info, <cusparseSolvePolicy_t>policy,
 *             <void*>pBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef void xcsric02_zeroPivot(
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3796, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":3783
 *     check_status(status)
 * 
 * cpdef void zbsrilu02(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int dirA, int mb, int nnzb, size_t descrA,
 *         size_t bsrSortedVal, size_t bsrSortedRowPtr,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.zbsrilu02", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_353zbsrilu02(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_352zbsrilu02, "zbsrilu02(intptr_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) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_353zbsrilu02(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[12] = {0,0,0,0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("zbsrilu02 (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_dirA,&__pyx_mstate_global->__pyx_n_u_mb,&__pyx_mstate_global->__pyx_n_u_nnzb,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_bsrSortedVal,&__pyx_mstate_global->__pyx_n_u_bsrSortedRowPtr,&__pyx_mstate_global->__pyx_n_u_bsrSortedColInd,&__pyx_mstate_global->__pyx_n_u_blockDim,&__pyx_mstate_global->__pyx_n_u_info,&__pyx_mstate_global->__pyx_n_u_policy,&__pyx_mstate_global->__pyx_n_u_pBuffer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 3783, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 12:
        values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 3783, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 11:
        values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 3783, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 3783, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 3783, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 3783, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 3783, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 3783, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3783, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3783, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3783, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3783, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3783, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "zbsrilu02", 0) < (0)) __PYX_ERR(0, 3783, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 12; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("zbsrilu02", 1, 12, 12, i); __PYX_ERR(0, 3783, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 12)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3783, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3783, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3783, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3783, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3783, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 3783, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 3783, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 3783, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 3783, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 3783, __pyx_L3_error)
      values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 3783, __pyx_L3_error)
      values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 3783, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3784, __pyx_L3_error)
    __pyx_v_dirA = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_dirA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3784, __pyx_L3_error)
    __pyx_v_mb = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_mb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3784, __pyx_L3_error)
    __pyx_v_nnzb = __Pyx_PyLong_As_int(values[3]); if (unlikely((__pyx_v_nnzb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3784, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3784, __pyx_L3_error)
    __pyx_v_bsrSortedVal = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_bsrSortedVal == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3785, __pyx_L3_error)
    __pyx_v_bsrSortedRowPtr = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_bsrSortedRowPtr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3785, __pyx_L3_error)
    __pyx_v_bsrSortedColInd = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_bsrSortedColInd == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3786, __pyx_L3_error)
    __pyx_v_blockDim = __Pyx_PyLong_As_int(values[8]); if (unlikely((__pyx_v_blockDim == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3786, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyLong_As_size_t(values[9]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3786, __pyx_L3_error)
    __pyx_v_policy = __Pyx_PyLong_As_int(values[10]); if (unlikely((__pyx_v_policy == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3786, __pyx_L3_error)
    __pyx_v_pBuffer = __Pyx_PyLong_As_size_t(values[11]); if (unlikely((__pyx_v_pBuffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3787, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("zbsrilu02", 1, 12, 12, __pyx_nargs); __PYX_ERR(0, 3783, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.zbsrilu02", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_352zbsrilu02(__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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_352zbsrilu02(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3783, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3783, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":3798
 *     check_status(status)
 * 
 * cpdef void xcsric02_zeroPivot(             # <<<<<<<<<<<<<<
 *         intptr_t handle, size_t info, size_t position) except *:
 *     _setStream(handle)
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_355xcsric02_zeroPivot(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_xcsric02_zeroPivot(intptr_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;
  __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_backends/cuda/libs/cusparse.pyx":3800
 * cpdef void xcsric02_zeroPivot(
 *         intptr_t handle, size_t info, size_t position) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseXcsric02_zeroPivot(
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3800, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":3801
 *         intptr_t handle, size_t info, size_t position) except *:
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseXcsric02_zeroPivot(
 *             <cusparseHandle_t>handle, <csric02Info_t>info, <int*>position)
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "cupy_backends/cuda/libs/cusparse.pyx":3802
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":3801
 *         intptr_t handle, size_t info, size_t position) except *:
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseXcsric02_zeroPivot(
 *             <cusparseHandle_t>handle, <csric02Info_t>info, <int*>position)
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy_backends/cuda/libs/cusparse.pyx":3804
 *         status = cusparseXcsric02_zeroPivot(
 *             <cusparseHandle_t>handle, <csric02Info_t>info, <int*>position)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef int scsric02_bufferSize(intptr_t handle, int m, int nnz, size_t descrA,
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3804, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":3798
 *     check_status(status)
 * 
 * cpdef void xcsric02_zeroPivot(             # <<<<<<<<<<<<<<
 *         intptr_t handle, size_t info, size_t position) except *:
 *     _setStream(handle)
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.xcsric02_zeroPivot", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_355xcsric02_zeroPivot(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_354xcsric02_zeroPivot, "xcsric02_zeroPivot(intptr_t handle, size_t info, size_t position) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_355xcsric02_zeroPivot(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_t __pyx_v_handle;
  size_t __pyx_v_info;
  size_t __pyx_v_position;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  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);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_info,&__pyx_mstate_global->__pyx_n_u_position,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 3798, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3798, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3798, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3798, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "xcsric02_zeroPivot", 0) < (0)) __PYX_ERR(0, 3798, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("xcsric02_zeroPivot", 1, 3, 3, i); __PYX_ERR(0, 3798, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3798, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3798, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3798, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3799, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyLong_As_size_t(values[1]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3799, __pyx_L3_error)
    __pyx_v_position = __Pyx_PyLong_As_size_t(values[2]); if (unlikely((__pyx_v_position == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3799, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("xcsric02_zeroPivot", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 3798, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.xcsric02_zeroPivot", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_354xcsric02_zeroPivot(__pyx_self, __pyx_v_handle, __pyx_v_info, __pyx_v_position);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_354xcsric02_zeroPivot(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_f_13cupy_backends_4cuda_4libs_8cusparse_xcsric02_zeroPivot(__pyx_v_handle, __pyx_v_info, __pyx_v_position, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3798, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3798, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":3806
 *     check_status(status)
 * 
 * cpdef int scsric02_bufferSize(intptr_t handle, int m, int nnz, size_t descrA,             # <<<<<<<<<<<<<<
 *                               size_t csrSortedValA, size_t csrSortedRowPtrA,
 *                               size_t csrSortedColIndA, size_t info) except? -1:
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_357scsric02_bufferSize(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static int __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_scsric02_bufferSize(intptr_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_backends/cuda/libs/cusparse.pyx":3810
 *                               size_t csrSortedColIndA, size_t info) except? -1:
 *     cdef int pBufferSizeInBytes
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseScsric02_bufferSize(
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3810, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":3811
 *     cdef int pBufferSizeInBytes
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseScsric02_bufferSize(
 *             <cusparseHandle_t>handle, m, nnz, <const cusparseMatDescr_t>descrA,
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "cupy_backends/cuda/libs/cusparse.pyx":3812
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":3811
 *     cdef int pBufferSizeInBytes
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseScsric02_bufferSize(
 *             <cusparseHandle_t>handle, m, nnz, <const cusparseMatDescr_t>descrA,
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy_backends/cuda/libs/cusparse.pyx":3817
 *             <const int*>csrSortedColIndA, <csric02Info_t>info,
 *             &pBufferSizeInBytes)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return <int>pBufferSizeInBytes
 * 
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3817, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":3818
 *             &pBufferSizeInBytes)
 *     check_status(status)
 *     return <int>pBufferSizeInBytes             # <<<<<<<<<<<<<<
 * 
 * cpdef int dcsric02_bufferSize(intptr_t handle, int m, int nnz, size_t descrA,
*/
  __pyx_r = ((int)__pyx_v_pBufferSizeInBytes);
  goto __pyx_L0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":3806
 *     check_status(status)
 * 
 * cpdef int scsric02_bufferSize(intptr_t handle, int m, int nnz, size_t descrA,             # <<<<<<<<<<<<<<
 *                               size_t csrSortedValA, size_t csrSortedRowPtrA,
 *                               size_t csrSortedColIndA, size_t info) except? -1:
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.scsric02_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_357scsric02_bufferSize(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_356scsric02_bufferSize, "scsric02_bufferSize(intptr_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_13cupy_backends_4cuda_4libs_8cusparse_357scsric02_bufferSize(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[8] = {0,0,0,0,0,0,0,0};
  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);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_nnz,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_csrSortedValA,&__pyx_mstate_global->__pyx_n_u_csrSortedRowPtrA,&__pyx_mstate_global->__pyx_n_u_csrSortedColIndA,&__pyx_mstate_global->__pyx_n_u_info,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 3806, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 3806, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 3806, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 3806, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3806, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3806, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3806, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3806, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3806, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "scsric02_bufferSize", 0) < (0)) __PYX_ERR(0, 3806, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 8; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("scsric02_bufferSize", 1, 8, 8, i); __PYX_ERR(0, 3806, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 8)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3806, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3806, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3806, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3806, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3806, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 3806, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 3806, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 3806, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3806, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3806, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3806, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[3]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3806, __pyx_L3_error)
    __pyx_v_csrSortedValA = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_csrSortedValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3807, __pyx_L3_error)
    __pyx_v_csrSortedRowPtrA = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_csrSortedRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3807, __pyx_L3_error)
    __pyx_v_csrSortedColIndA = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_csrSortedColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3808, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3808, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("scsric02_bufferSize", 1, 8, 8, __pyx_nargs); __PYX_ERR(0, 3806, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.scsric02_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_356scsric02_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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_356scsric02_bufferSize(CYTHON_UNUSED PyObject *__pyx_self, intptr_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
  int __pyx_t_1;
  PyObject *__pyx_t_2 = 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_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(__pyx_t_1 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3806, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3806, __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_backends.cuda.libs.cusparse.scsric02_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy_backends/cuda/libs/cusparse.pyx":3820
 *     return <int>pBufferSizeInBytes
 * 
 * cpdef int dcsric02_bufferSize(intptr_t handle, int m, int nnz, size_t descrA,             # <<<<<<<<<<<<<<
 *                               size_t csrSortedValA, size_t csrSortedRowPtrA,
 *                               size_t csrSortedColIndA, size_t info) except? -1:
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_359dcsric02_bufferSize(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static int __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_dcsric02_bufferSize(intptr_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_backends/cuda/libs/cusparse.pyx":3824
 *                               size_t csrSortedColIndA, size_t info) except? -1:
 *     cdef int pBufferSizeInBytes
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseDcsric02_bufferSize(
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3824, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":3825
 *     cdef int pBufferSizeInBytes
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseDcsric02_bufferSize(
 *             <cusparseHandle_t>handle, m, nnz, <const cusparseMatDescr_t>descrA,
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "cupy_backends/cuda/libs/cusparse.pyx":3826
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":3825
 *     cdef int pBufferSizeInBytes
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseDcsric02_bufferSize(
 *             <cusparseHandle_t>handle, m, nnz, <const cusparseMatDescr_t>descrA,
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy_backends/cuda/libs/cusparse.pyx":3831
 *             <const int*>csrSortedColIndA, <csric02Info_t>info,
 *             &pBufferSizeInBytes)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return <int>pBufferSizeInBytes
 * 
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3831, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":3832
 *             &pBufferSizeInBytes)
 *     check_status(status)
 *     return <int>pBufferSizeInBytes             # <<<<<<<<<<<<<<
 * 
 * cpdef int ccsric02_bufferSize(intptr_t handle, int m, int nnz, size_t descrA,
*/
  __pyx_r = ((int)__pyx_v_pBufferSizeInBytes);
  goto __pyx_L0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":3820
 *     return <int>pBufferSizeInBytes
 * 
 * cpdef int dcsric02_bufferSize(intptr_t handle, int m, int nnz, size_t descrA,             # <<<<<<<<<<<<<<
 *                               size_t csrSortedValA, size_t csrSortedRowPtrA,
 *                               size_t csrSortedColIndA, size_t info) except? -1:
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.dcsric02_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_359dcsric02_bufferSize(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_358dcsric02_bufferSize, "dcsric02_bufferSize(intptr_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_13cupy_backends_4cuda_4libs_8cusparse_359dcsric02_bufferSize(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[8] = {0,0,0,0,0,0,0,0};
  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);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_nnz,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_csrSortedValA,&__pyx_mstate_global->__pyx_n_u_csrSortedRowPtrA,&__pyx_mstate_global->__pyx_n_u_csrSortedColIndA,&__pyx_mstate_global->__pyx_n_u_info,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 3820, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 3820, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 3820, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 3820, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3820, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3820, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3820, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3820, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3820, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "dcsric02_bufferSize", 0) < (0)) __PYX_ERR(0, 3820, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 8; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("dcsric02_bufferSize", 1, 8, 8, i); __PYX_ERR(0, 3820, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 8)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3820, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3820, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3820, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3820, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3820, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 3820, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 3820, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 3820, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3820, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3820, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3820, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[3]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3820, __pyx_L3_error)
    __pyx_v_csrSortedValA = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_csrSortedValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3821, __pyx_L3_error)
    __pyx_v_csrSortedRowPtrA = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_csrSortedRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3821, __pyx_L3_error)
    __pyx_v_csrSortedColIndA = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_csrSortedColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3822, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3822, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("dcsric02_bufferSize", 1, 8, 8, __pyx_nargs); __PYX_ERR(0, 3820, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.dcsric02_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_358dcsric02_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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_358dcsric02_bufferSize(CYTHON_UNUSED PyObject *__pyx_self, intptr_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
  int __pyx_t_1;
  PyObject *__pyx_t_2 = 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_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(__pyx_t_1 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3820, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3820, __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_backends.cuda.libs.cusparse.dcsric02_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy_backends/cuda/libs/cusparse.pyx":3834
 *     return <int>pBufferSizeInBytes
 * 
 * cpdef int ccsric02_bufferSize(intptr_t handle, int m, int nnz, size_t descrA,             # <<<<<<<<<<<<<<
 *                               size_t csrSortedValA, size_t csrSortedRowPtrA,
 *                               size_t csrSortedColIndA, size_t info) except? -1:
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_361ccsric02_bufferSize(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static int __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_ccsric02_bufferSize(intptr_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_backends/cuda/libs/cusparse.pyx":3838
 *                               size_t csrSortedColIndA, size_t info) except? -1:
 *     cdef int pBufferSizeInBytes
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseCcsric02_bufferSize(
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3838, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":3839
 *     cdef int pBufferSizeInBytes
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseCcsric02_bufferSize(
 *             <cusparseHandle_t>handle, m, nnz, <const cusparseMatDescr_t>descrA,
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "cupy_backends/cuda/libs/cusparse.pyx":3840
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":3839
 *     cdef int pBufferSizeInBytes
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseCcsric02_bufferSize(
 *             <cusparseHandle_t>handle, m, nnz, <const cusparseMatDescr_t>descrA,
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy_backends/cuda/libs/cusparse.pyx":3845
 *             <const int*>csrSortedColIndA, <csric02Info_t>info,
 *             &pBufferSizeInBytes)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return <int>pBufferSizeInBytes
 * 
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3845, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":3846
 *             &pBufferSizeInBytes)
 *     check_status(status)
 *     return <int>pBufferSizeInBytes             # <<<<<<<<<<<<<<
 * 
 * cpdef int zcsric02_bufferSize(intptr_t handle, int m, int nnz, size_t descrA,
*/
  __pyx_r = ((int)__pyx_v_pBufferSizeInBytes);
  goto __pyx_L0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":3834
 *     return <int>pBufferSizeInBytes
 * 
 * cpdef int ccsric02_bufferSize(intptr_t handle, int m, int nnz, size_t descrA,             # <<<<<<<<<<<<<<
 *                               size_t csrSortedValA, size_t csrSortedRowPtrA,
 *                               size_t csrSortedColIndA, size_t info) except? -1:
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.ccsric02_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_361ccsric02_bufferSize(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_360ccsric02_bufferSize, "ccsric02_bufferSize(intptr_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_13cupy_backends_4cuda_4libs_8cusparse_361ccsric02_bufferSize(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[8] = {0,0,0,0,0,0,0,0};
  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);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_nnz,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_csrSortedValA,&__pyx_mstate_global->__pyx_n_u_csrSortedRowPtrA,&__pyx_mstate_global->__pyx_n_u_csrSortedColIndA,&__pyx_mstate_global->__pyx_n_u_info,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 3834, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 3834, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 3834, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 3834, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3834, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3834, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3834, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3834, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3834, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "ccsric02_bufferSize", 0) < (0)) __PYX_ERR(0, 3834, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 8; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("ccsric02_bufferSize", 1, 8, 8, i); __PYX_ERR(0, 3834, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 8)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3834, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3834, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3834, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3834, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3834, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 3834, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 3834, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 3834, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3834, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3834, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3834, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[3]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3834, __pyx_L3_error)
    __pyx_v_csrSortedValA = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_csrSortedValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3835, __pyx_L3_error)
    __pyx_v_csrSortedRowPtrA = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_csrSortedRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3835, __pyx_L3_error)
    __pyx_v_csrSortedColIndA = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_csrSortedColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3836, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3836, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ccsric02_bufferSize", 1, 8, 8, __pyx_nargs); __PYX_ERR(0, 3834, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.ccsric02_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_360ccsric02_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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_360ccsric02_bufferSize(CYTHON_UNUSED PyObject *__pyx_self, intptr_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
  int __pyx_t_1;
  PyObject *__pyx_t_2 = 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_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(__pyx_t_1 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3834, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3834, __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_backends.cuda.libs.cusparse.ccsric02_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy_backends/cuda/libs/cusparse.pyx":3848
 *     return <int>pBufferSizeInBytes
 * 
 * cpdef int zcsric02_bufferSize(intptr_t handle, int m, int nnz, size_t descrA,             # <<<<<<<<<<<<<<
 *                               size_t csrSortedValA, size_t csrSortedRowPtrA,
 *                               size_t csrSortedColIndA, size_t info) except? -1:
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_363zcsric02_bufferSize(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static int __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_zcsric02_bufferSize(intptr_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_backends/cuda/libs/cusparse.pyx":3852
 *                               size_t csrSortedColIndA, size_t info) except? -1:
 *     cdef int pBufferSizeInBytes
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseZcsric02_bufferSize(
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3852, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":3853
 *     cdef int pBufferSizeInBytes
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseZcsric02_bufferSize(
 *             <cusparseHandle_t>handle, m, nnz, <const cusparseMatDescr_t>descrA,
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "cupy_backends/cuda/libs/cusparse.pyx":3854
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":3853
 *     cdef int pBufferSizeInBytes
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseZcsric02_bufferSize(
 *             <cusparseHandle_t>handle, m, nnz, <const cusparseMatDescr_t>descrA,
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy_backends/cuda/libs/cusparse.pyx":3859
 *             <const int*>csrSortedColIndA, <csric02Info_t>info,
 *             &pBufferSizeInBytes)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return <int>pBufferSizeInBytes
 * 
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3859, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":3860
 *             &pBufferSizeInBytes)
 *     check_status(status)
 *     return <int>pBufferSizeInBytes             # <<<<<<<<<<<<<<
 * 
 * cpdef void scsric02_analysis(
*/
  __pyx_r = ((int)__pyx_v_pBufferSizeInBytes);
  goto __pyx_L0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":3848
 *     return <int>pBufferSizeInBytes
 * 
 * cpdef int zcsric02_bufferSize(intptr_t handle, int m, int nnz, size_t descrA,             # <<<<<<<<<<<<<<
 *                               size_t csrSortedValA, size_t csrSortedRowPtrA,
 *                               size_t csrSortedColIndA, size_t info) except? -1:
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.zcsric02_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_363zcsric02_bufferSize(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_362zcsric02_bufferSize, "zcsric02_bufferSize(intptr_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_13cupy_backends_4cuda_4libs_8cusparse_363zcsric02_bufferSize(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[8] = {0,0,0,0,0,0,0,0};
  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);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_nnz,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_csrSortedValA,&__pyx_mstate_global->__pyx_n_u_csrSortedRowPtrA,&__pyx_mstate_global->__pyx_n_u_csrSortedColIndA,&__pyx_mstate_global->__pyx_n_u_info,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 3848, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 3848, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 3848, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 3848, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3848, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3848, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3848, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3848, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3848, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "zcsric02_bufferSize", 0) < (0)) __PYX_ERR(0, 3848, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 8; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("zcsric02_bufferSize", 1, 8, 8, i); __PYX_ERR(0, 3848, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 8)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3848, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3848, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3848, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3848, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3848, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 3848, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 3848, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 3848, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3848, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3848, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3848, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[3]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3848, __pyx_L3_error)
    __pyx_v_csrSortedValA = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_csrSortedValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3849, __pyx_L3_error)
    __pyx_v_csrSortedRowPtrA = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_csrSortedRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3849, __pyx_L3_error)
    __pyx_v_csrSortedColIndA = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_csrSortedColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3850, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3850, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("zcsric02_bufferSize", 1, 8, 8, __pyx_nargs); __PYX_ERR(0, 3848, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.zcsric02_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_362zcsric02_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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_362zcsric02_bufferSize(CYTHON_UNUSED PyObject *__pyx_self, intptr_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
  int __pyx_t_1;
  PyObject *__pyx_t_2 = 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_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(__pyx_t_1 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3848, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3848, __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_backends.cuda.libs.cusparse.zcsric02_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy_backends/cuda/libs/cusparse.pyx":3862
 *     return <int>pBufferSizeInBytes
 * 
 * cpdef void scsric02_analysis(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int nnz, size_t descrA,
 *         size_t csrSortedValA, size_t csrSortedRowPtrA,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_365scsric02_analysis(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_scsric02_analysis(intptr_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;
  __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_backends/cuda/libs/cusparse.pyx":3867
 *         size_t csrSortedColIndA, size_t info, int policy,
 *         size_t pBuffer) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseScsric02_analysis(
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3867, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":3868
 *         size_t pBuffer) except *:
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseScsric02_analysis(
 *             <cusparseHandle_t>handle, m, nnz, <const cusparseMatDescr_t>descrA,
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "cupy_backends/cuda/libs/cusparse.pyx":3869
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":3868
 *         size_t pBuffer) except *:
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseScsric02_analysis(
 *             <cusparseHandle_t>handle, m, nnz, <const cusparseMatDescr_t>descrA,
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy_backends/cuda/libs/cusparse.pyx":3874
 *             <const int*>csrSortedColIndA, <csric02Info_t>info,
 *             <cusparseSolvePolicy_t>policy, <void*>pBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef void dcsric02_analysis(
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3874, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":3862
 *     return <int>pBufferSizeInBytes
 * 
 * cpdef void scsric02_analysis(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int nnz, size_t descrA,
 *         size_t csrSortedValA, size_t csrSortedRowPtrA,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.scsric02_analysis", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_365scsric02_analysis(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_364scsric02_analysis, "scsric02_analysis(intptr_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) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_365scsric02_analysis(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0};
  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);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_nnz,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_csrSortedValA,&__pyx_mstate_global->__pyx_n_u_csrSortedRowPtrA,&__pyx_mstate_global->__pyx_n_u_csrSortedColIndA,&__pyx_mstate_global->__pyx_n_u_info,&__pyx_mstate_global->__pyx_n_u_policy,&__pyx_mstate_global->__pyx_n_u_pBuffer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 3862, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 3862, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 3862, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 3862, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 3862, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 3862, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3862, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3862, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3862, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3862, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3862, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "scsric02_analysis", 0) < (0)) __PYX_ERR(0, 3862, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 10; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("scsric02_analysis", 1, 10, 10, i); __PYX_ERR(0, 3862, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 10)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3862, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3862, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3862, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3862, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3862, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 3862, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 3862, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 3862, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 3862, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 3862, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3863, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3863, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3863, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[3]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3863, __pyx_L3_error)
    __pyx_v_csrSortedValA = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_csrSortedValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3864, __pyx_L3_error)
    __pyx_v_csrSortedRowPtrA = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_csrSortedRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3864, __pyx_L3_error)
    __pyx_v_csrSortedColIndA = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_csrSortedColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3865, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3865, __pyx_L3_error)
    __pyx_v_policy = __Pyx_PyLong_As_int(values[8]); if (unlikely((__pyx_v_policy == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3865, __pyx_L3_error)
    __pyx_v_pBuffer = __Pyx_PyLong_As_size_t(values[9]); if (unlikely((__pyx_v_pBuffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3866, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("scsric02_analysis", 1, 10, 10, __pyx_nargs); __PYX_ERR(0, 3862, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.scsric02_analysis", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_364scsric02_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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_364scsric02_analysis(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3862, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3862, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":3876
 *     check_status(status)
 * 
 * cpdef void dcsric02_analysis(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int nnz, size_t descrA,
 *         size_t csrSortedValA, size_t csrSortedRowPtrA,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_367dcsric02_analysis(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_dcsric02_analysis(intptr_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;
  __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_backends/cuda/libs/cusparse.pyx":3881
 *         size_t csrSortedColIndA, size_t info, int policy,
 *         size_t pBuffer) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseDcsric02_analysis(
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3881, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":3882
 *         size_t pBuffer) except *:
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseDcsric02_analysis(
 *             <cusparseHandle_t>handle, m, nnz, <const cusparseMatDescr_t>descrA,
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "cupy_backends/cuda/libs/cusparse.pyx":3883
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":3882
 *         size_t pBuffer) except *:
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseDcsric02_analysis(
 *             <cusparseHandle_t>handle, m, nnz, <const cusparseMatDescr_t>descrA,
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy_backends/cuda/libs/cusparse.pyx":3888
 *             <const int*>csrSortedColIndA, <csric02Info_t>info,
 *             <cusparseSolvePolicy_t>policy, <void*>pBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef void ccsric02_analysis(
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3888, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":3876
 *     check_status(status)
 * 
 * cpdef void dcsric02_analysis(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int nnz, size_t descrA,
 *         size_t csrSortedValA, size_t csrSortedRowPtrA,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.dcsric02_analysis", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_367dcsric02_analysis(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_366dcsric02_analysis, "dcsric02_analysis(intptr_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) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_367dcsric02_analysis(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0};
  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);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_nnz,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_csrSortedValA,&__pyx_mstate_global->__pyx_n_u_csrSortedRowPtrA,&__pyx_mstate_global->__pyx_n_u_csrSortedColIndA,&__pyx_mstate_global->__pyx_n_u_info,&__pyx_mstate_global->__pyx_n_u_policy,&__pyx_mstate_global->__pyx_n_u_pBuffer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 3876, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 3876, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 3876, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 3876, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 3876, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 3876, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3876, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3876, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3876, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3876, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3876, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "dcsric02_analysis", 0) < (0)) __PYX_ERR(0, 3876, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 10; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("dcsric02_analysis", 1, 10, 10, i); __PYX_ERR(0, 3876, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 10)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3876, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3876, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3876, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3876, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3876, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 3876, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 3876, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 3876, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 3876, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 3876, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3877, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3877, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3877, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[3]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3877, __pyx_L3_error)
    __pyx_v_csrSortedValA = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_csrSortedValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3878, __pyx_L3_error)
    __pyx_v_csrSortedRowPtrA = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_csrSortedRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3878, __pyx_L3_error)
    __pyx_v_csrSortedColIndA = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_csrSortedColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3879, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3879, __pyx_L3_error)
    __pyx_v_policy = __Pyx_PyLong_As_int(values[8]); if (unlikely((__pyx_v_policy == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3879, __pyx_L3_error)
    __pyx_v_pBuffer = __Pyx_PyLong_As_size_t(values[9]); if (unlikely((__pyx_v_pBuffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3880, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("dcsric02_analysis", 1, 10, 10, __pyx_nargs); __PYX_ERR(0, 3876, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.dcsric02_analysis", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_366dcsric02_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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_366dcsric02_analysis(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3876, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3876, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":3890
 *     check_status(status)
 * 
 * cpdef void ccsric02_analysis(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int nnz, size_t descrA,
 *         size_t csrSortedValA, size_t csrSortedRowPtrA,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_369ccsric02_analysis(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_ccsric02_analysis(intptr_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;
  __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_backends/cuda/libs/cusparse.pyx":3895
 *         size_t csrSortedColIndA, size_t info, int policy,
 *         size_t pBuffer) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseCcsric02_analysis(
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3895, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":3896
 *         size_t pBuffer) except *:
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseCcsric02_analysis(
 *             <cusparseHandle_t>handle, m, nnz, <const cusparseMatDescr_t>descrA,
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "cupy_backends/cuda/libs/cusparse.pyx":3897
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":3896
 *         size_t pBuffer) except *:
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseCcsric02_analysis(
 *             <cusparseHandle_t>handle, m, nnz, <const cusparseMatDescr_t>descrA,
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy_backends/cuda/libs/cusparse.pyx":3902
 *             <const int*>csrSortedColIndA, <csric02Info_t>info,
 *             <cusparseSolvePolicy_t>policy, <void*>pBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef void zcsric02_analysis(
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3902, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":3890
 *     check_status(status)
 * 
 * cpdef void ccsric02_analysis(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int nnz, size_t descrA,
 *         size_t csrSortedValA, size_t csrSortedRowPtrA,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.ccsric02_analysis", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_369ccsric02_analysis(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_368ccsric02_analysis, "ccsric02_analysis(intptr_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) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_369ccsric02_analysis(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0};
  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);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_nnz,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_csrSortedValA,&__pyx_mstate_global->__pyx_n_u_csrSortedRowPtrA,&__pyx_mstate_global->__pyx_n_u_csrSortedColIndA,&__pyx_mstate_global->__pyx_n_u_info,&__pyx_mstate_global->__pyx_n_u_policy,&__pyx_mstate_global->__pyx_n_u_pBuffer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 3890, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 3890, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 3890, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 3890, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 3890, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 3890, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3890, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3890, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3890, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3890, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3890, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "ccsric02_analysis", 0) < (0)) __PYX_ERR(0, 3890, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 10; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("ccsric02_analysis", 1, 10, 10, i); __PYX_ERR(0, 3890, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 10)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3890, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3890, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3890, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3890, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3890, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 3890, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 3890, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 3890, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 3890, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 3890, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3891, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3891, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3891, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[3]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3891, __pyx_L3_error)
    __pyx_v_csrSortedValA = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_csrSortedValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3892, __pyx_L3_error)
    __pyx_v_csrSortedRowPtrA = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_csrSortedRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3892, __pyx_L3_error)
    __pyx_v_csrSortedColIndA = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_csrSortedColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3893, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3893, __pyx_L3_error)
    __pyx_v_policy = __Pyx_PyLong_As_int(values[8]); if (unlikely((__pyx_v_policy == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3893, __pyx_L3_error)
    __pyx_v_pBuffer = __Pyx_PyLong_As_size_t(values[9]); if (unlikely((__pyx_v_pBuffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3894, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ccsric02_analysis", 1, 10, 10, __pyx_nargs); __PYX_ERR(0, 3890, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.ccsric02_analysis", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_368ccsric02_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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_368ccsric02_analysis(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3890, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3890, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":3904
 *     check_status(status)
 * 
 * cpdef void zcsric02_analysis(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int nnz, size_t descrA,
 *         size_t csrSortedValA, size_t csrSortedRowPtrA,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_371zcsric02_analysis(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_zcsric02_analysis(intptr_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;
  __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_backends/cuda/libs/cusparse.pyx":3909
 *         size_t csrSortedColIndA, size_t info, int policy,
 *         size_t pBuffer) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseZcsric02_analysis(
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3909, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":3910
 *         size_t pBuffer) except *:
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseZcsric02_analysis(
 *             <cusparseHandle_t>handle, m, nnz, <const cusparseMatDescr_t>descrA,
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "cupy_backends/cuda/libs/cusparse.pyx":3911
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":3910
 *         size_t pBuffer) except *:
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseZcsric02_analysis(
 *             <cusparseHandle_t>handle, m, nnz, <const cusparseMatDescr_t>descrA,
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy_backends/cuda/libs/cusparse.pyx":3916
 *             <const int*>csrSortedRowPtrA, <const int*>csrSortedColIndA,
 *             <csric02Info_t>info, <cusparseSolvePolicy_t>policy, <void*>pBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef void scsric02(
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3916, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":3904
 *     check_status(status)
 * 
 * cpdef void zcsric02_analysis(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int nnz, size_t descrA,
 *         size_t csrSortedValA, size_t csrSortedRowPtrA,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.zcsric02_analysis", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_371zcsric02_analysis(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_370zcsric02_analysis, "zcsric02_analysis(intptr_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) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_371zcsric02_analysis(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0};
  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);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_nnz,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_csrSortedValA,&__pyx_mstate_global->__pyx_n_u_csrSortedRowPtrA,&__pyx_mstate_global->__pyx_n_u_csrSortedColIndA,&__pyx_mstate_global->__pyx_n_u_info,&__pyx_mstate_global->__pyx_n_u_policy,&__pyx_mstate_global->__pyx_n_u_pBuffer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 3904, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 3904, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 3904, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 3904, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 3904, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 3904, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3904, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3904, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3904, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3904, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3904, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "zcsric02_analysis", 0) < (0)) __PYX_ERR(0, 3904, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 10; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("zcsric02_analysis", 1, 10, 10, i); __PYX_ERR(0, 3904, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 10)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3904, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3904, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3904, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3904, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3904, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 3904, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 3904, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 3904, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 3904, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 3904, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3905, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3905, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3905, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[3]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3905, __pyx_L3_error)
    __pyx_v_csrSortedValA = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_csrSortedValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3906, __pyx_L3_error)
    __pyx_v_csrSortedRowPtrA = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_csrSortedRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3906, __pyx_L3_error)
    __pyx_v_csrSortedColIndA = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_csrSortedColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3907, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3907, __pyx_L3_error)
    __pyx_v_policy = __Pyx_PyLong_As_int(values[8]); if (unlikely((__pyx_v_policy == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3907, __pyx_L3_error)
    __pyx_v_pBuffer = __Pyx_PyLong_As_size_t(values[9]); if (unlikely((__pyx_v_pBuffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3908, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("zcsric02_analysis", 1, 10, 10, __pyx_nargs); __PYX_ERR(0, 3904, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.zcsric02_analysis", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_370zcsric02_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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_370zcsric02_analysis(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3904, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3904, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":3918
 *     check_status(status)
 * 
 * cpdef void scsric02(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int nnz, size_t descrA,
 *         size_t csrSortedValA_valM, size_t csrSortedRowPtrA,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_373scsric02(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_scsric02(intptr_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;
  __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_backends/cuda/libs/cusparse.pyx":3923
 *         size_t csrSortedColIndA, size_t info, int policy,
 *         size_t pBuffer) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseScsric02(
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3923, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":3924
 *         size_t pBuffer) except *:
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseScsric02(
 *             <cusparseHandle_t>handle, m, nnz, <const cusparseMatDescr_t>descrA,
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "cupy_backends/cuda/libs/cusparse.pyx":3925
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":3924
 *         size_t pBuffer) except *:
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseScsric02(
 *             <cusparseHandle_t>handle, m, nnz, <const cusparseMatDescr_t>descrA,
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy_backends/cuda/libs/cusparse.pyx":3930
 *             <const int*>csrSortedColIndA, <csric02Info_t>info,
 *             <cusparseSolvePolicy_t>policy, <void*>pBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef void dcsric02(
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3930, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":3918
 *     check_status(status)
 * 
 * cpdef void scsric02(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int nnz, size_t descrA,
 *         size_t csrSortedValA_valM, size_t csrSortedRowPtrA,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.scsric02", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_373scsric02(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_372scsric02, "scsric02(intptr_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) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_373scsric02(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("scsric02 (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_nnz,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_csrSortedValA_valM,&__pyx_mstate_global->__pyx_n_u_csrSortedRowPtrA,&__pyx_mstate_global->__pyx_n_u_csrSortedColIndA,&__pyx_mstate_global->__pyx_n_u_info,&__pyx_mstate_global->__pyx_n_u_policy,&__pyx_mstate_global->__pyx_n_u_pBuffer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 3918, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 3918, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 3918, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 3918, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 3918, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 3918, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3918, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3918, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3918, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3918, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3918, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "scsric02", 0) < (0)) __PYX_ERR(0, 3918, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 10; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("scsric02", 1, 10, 10, i); __PYX_ERR(0, 3918, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 10)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3918, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3918, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3918, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3918, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3918, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 3918, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 3918, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 3918, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 3918, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 3918, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3919, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3919, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3919, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[3]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3919, __pyx_L3_error)
    __pyx_v_csrSortedValA_valM = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_csrSortedValA_valM == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3920, __pyx_L3_error)
    __pyx_v_csrSortedRowPtrA = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_csrSortedRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3920, __pyx_L3_error)
    __pyx_v_csrSortedColIndA = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_csrSortedColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3921, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3921, __pyx_L3_error)
    __pyx_v_policy = __Pyx_PyLong_As_int(values[8]); if (unlikely((__pyx_v_policy == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3921, __pyx_L3_error)
    __pyx_v_pBuffer = __Pyx_PyLong_As_size_t(values[9]); if (unlikely((__pyx_v_pBuffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3922, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("scsric02", 1, 10, 10, __pyx_nargs); __PYX_ERR(0, 3918, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.scsric02", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_372scsric02(__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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_372scsric02(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3918, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3918, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":3932
 *     check_status(status)
 * 
 * cpdef void dcsric02(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int nnz, size_t descrA,
 *         size_t csrSortedValA_valM, size_t csrSortedRowPtrA,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_375dcsric02(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_dcsric02(intptr_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;
  __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_backends/cuda/libs/cusparse.pyx":3937
 *         size_t csrSortedColIndA, size_t info, int policy,
 *         size_t pBuffer) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseDcsric02(
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3937, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":3938
 *         size_t pBuffer) except *:
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseDcsric02(
 *             <cusparseHandle_t>handle, m, nnz, <const cusparseMatDescr_t>descrA,
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "cupy_backends/cuda/libs/cusparse.pyx":3939
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":3938
 *         size_t pBuffer) except *:
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseDcsric02(
 *             <cusparseHandle_t>handle, m, nnz, <const cusparseMatDescr_t>descrA,
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy_backends/cuda/libs/cusparse.pyx":3944
 *             <const int*>csrSortedColIndA, <csric02Info_t>info,
 *             <cusparseSolvePolicy_t>policy, <void*>pBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef void ccsric02(
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3944, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":3932
 *     check_status(status)
 * 
 * cpdef void dcsric02(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int nnz, size_t descrA,
 *         size_t csrSortedValA_valM, size_t csrSortedRowPtrA,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.dcsric02", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_375dcsric02(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_374dcsric02, "dcsric02(intptr_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) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_375dcsric02(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dcsric02 (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_nnz,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_csrSortedValA_valM,&__pyx_mstate_global->__pyx_n_u_csrSortedRowPtrA,&__pyx_mstate_global->__pyx_n_u_csrSortedColIndA,&__pyx_mstate_global->__pyx_n_u_info,&__pyx_mstate_global->__pyx_n_u_policy,&__pyx_mstate_global->__pyx_n_u_pBuffer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 3932, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 3932, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 3932, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 3932, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 3932, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 3932, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3932, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3932, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3932, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3932, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3932, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "dcsric02", 0) < (0)) __PYX_ERR(0, 3932, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 10; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("dcsric02", 1, 10, 10, i); __PYX_ERR(0, 3932, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 10)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3932, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3932, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3932, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3932, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3932, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 3932, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 3932, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 3932, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 3932, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 3932, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3933, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3933, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3933, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[3]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3933, __pyx_L3_error)
    __pyx_v_csrSortedValA_valM = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_csrSortedValA_valM == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3934, __pyx_L3_error)
    __pyx_v_csrSortedRowPtrA = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_csrSortedRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3934, __pyx_L3_error)
    __pyx_v_csrSortedColIndA = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_csrSortedColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3935, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3935, __pyx_L3_error)
    __pyx_v_policy = __Pyx_PyLong_As_int(values[8]); if (unlikely((__pyx_v_policy == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3935, __pyx_L3_error)
    __pyx_v_pBuffer = __Pyx_PyLong_As_size_t(values[9]); if (unlikely((__pyx_v_pBuffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3936, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("dcsric02", 1, 10, 10, __pyx_nargs); __PYX_ERR(0, 3932, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.dcsric02", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_374dcsric02(__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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_374dcsric02(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3932, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3932, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":3946
 *     check_status(status)
 * 
 * cpdef void ccsric02(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int nnz, size_t descrA,
 *         size_t csrSortedValA_valM, size_t csrSortedRowPtrA,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_377ccsric02(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_ccsric02(intptr_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;
  __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_backends/cuda/libs/cusparse.pyx":3951
 *         size_t csrSortedColIndA, size_t info, int policy,
 *         size_t pBuffer) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseCcsric02(
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3951, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":3952
 *         size_t pBuffer) except *:
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseCcsric02(
 *             <cusparseHandle_t>handle, m, nnz, <const cusparseMatDescr_t>descrA,
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "cupy_backends/cuda/libs/cusparse.pyx":3953
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":3952
 *         size_t pBuffer) except *:
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseCcsric02(
 *             <cusparseHandle_t>handle, m, nnz, <const cusparseMatDescr_t>descrA,
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy_backends/cuda/libs/cusparse.pyx":3958
 *             <const int*>csrSortedColIndA, <csric02Info_t>info,
 *             <cusparseSolvePolicy_t>policy, <void*>pBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef void zcsric02(
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3958, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":3946
 *     check_status(status)
 * 
 * cpdef void ccsric02(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int nnz, size_t descrA,
 *         size_t csrSortedValA_valM, size_t csrSortedRowPtrA,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.ccsric02", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_377ccsric02(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_376ccsric02, "ccsric02(intptr_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) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_377ccsric02(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ccsric02 (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_nnz,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_csrSortedValA_valM,&__pyx_mstate_global->__pyx_n_u_csrSortedRowPtrA,&__pyx_mstate_global->__pyx_n_u_csrSortedColIndA,&__pyx_mstate_global->__pyx_n_u_info,&__pyx_mstate_global->__pyx_n_u_policy,&__pyx_mstate_global->__pyx_n_u_pBuffer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 3946, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 3946, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 3946, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 3946, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 3946, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 3946, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3946, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3946, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3946, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3946, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3946, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "ccsric02", 0) < (0)) __PYX_ERR(0, 3946, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 10; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("ccsric02", 1, 10, 10, i); __PYX_ERR(0, 3946, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 10)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3946, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3946, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3946, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3946, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3946, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 3946, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 3946, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 3946, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 3946, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 3946, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3947, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3947, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3947, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[3]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3947, __pyx_L3_error)
    __pyx_v_csrSortedValA_valM = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_csrSortedValA_valM == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3948, __pyx_L3_error)
    __pyx_v_csrSortedRowPtrA = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_csrSortedRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3948, __pyx_L3_error)
    __pyx_v_csrSortedColIndA = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_csrSortedColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3949, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3949, __pyx_L3_error)
    __pyx_v_policy = __Pyx_PyLong_As_int(values[8]); if (unlikely((__pyx_v_policy == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3949, __pyx_L3_error)
    __pyx_v_pBuffer = __Pyx_PyLong_As_size_t(values[9]); if (unlikely((__pyx_v_pBuffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3950, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ccsric02", 1, 10, 10, __pyx_nargs); __PYX_ERR(0, 3946, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.ccsric02", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_376ccsric02(__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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_376ccsric02(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3946, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3946, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":3960
 *     check_status(status)
 * 
 * cpdef void zcsric02(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int nnz, size_t descrA,
 *         size_t csrSortedValA_valM, size_t csrSortedRowPtrA,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_379zcsric02(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_zcsric02(intptr_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;
  __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_backends/cuda/libs/cusparse.pyx":3965
 *         size_t csrSortedColIndA, size_t info, int policy,
 *         size_t pBuffer) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseZcsric02(
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3965, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":3966
 *         size_t pBuffer) except *:
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseZcsric02(
 *             <cusparseHandle_t>handle, m, nnz, <const cusparseMatDescr_t>descrA,
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "cupy_backends/cuda/libs/cusparse.pyx":3967
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":3966
 *         size_t pBuffer) except *:
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseZcsric02(
 *             <cusparseHandle_t>handle, m, nnz, <const cusparseMatDescr_t>descrA,
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy_backends/cuda/libs/cusparse.pyx":3972
 *             <const int*>csrSortedColIndA, <csric02Info_t>info,
 *             <cusparseSolvePolicy_t>policy, <void*>pBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef void xbsric02_zeroPivot(
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3972, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":3960
 *     check_status(status)
 * 
 * cpdef void zcsric02(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int nnz, size_t descrA,
 *         size_t csrSortedValA_valM, size_t csrSortedRowPtrA,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.zcsric02", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_379zcsric02(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_378zcsric02, "zcsric02(intptr_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) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_379zcsric02(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("zcsric02 (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_nnz,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_csrSortedValA_valM,&__pyx_mstate_global->__pyx_n_u_csrSortedRowPtrA,&__pyx_mstate_global->__pyx_n_u_csrSortedColIndA,&__pyx_mstate_global->__pyx_n_u_info,&__pyx_mstate_global->__pyx_n_u_policy,&__pyx_mstate_global->__pyx_n_u_pBuffer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 3960, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 3960, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 3960, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 3960, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 3960, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 3960, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3960, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3960, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3960, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3960, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3960, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "zcsric02", 0) < (0)) __PYX_ERR(0, 3960, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 10; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("zcsric02", 1, 10, 10, i); __PYX_ERR(0, 3960, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 10)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3960, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3960, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3960, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3960, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3960, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 3960, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 3960, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 3960, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 3960, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 3960, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3961, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3961, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3961, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[3]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3961, __pyx_L3_error)
    __pyx_v_csrSortedValA_valM = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_csrSortedValA_valM == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3962, __pyx_L3_error)
    __pyx_v_csrSortedRowPtrA = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_csrSortedRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3962, __pyx_L3_error)
    __pyx_v_csrSortedColIndA = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_csrSortedColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3963, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3963, __pyx_L3_error)
    __pyx_v_policy = __Pyx_PyLong_As_int(values[8]); if (unlikely((__pyx_v_policy == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3963, __pyx_L3_error)
    __pyx_v_pBuffer = __Pyx_PyLong_As_size_t(values[9]); if (unlikely((__pyx_v_pBuffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3964, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("zcsric02", 1, 10, 10, __pyx_nargs); __PYX_ERR(0, 3960, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.zcsric02", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_378zcsric02(__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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_378zcsric02(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3960, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3960, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":3974
 *     check_status(status)
 * 
 * cpdef void xbsric02_zeroPivot(             # <<<<<<<<<<<<<<
 *         intptr_t handle, size_t info, size_t position) except *:
 *     _setStream(handle)
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_381xbsric02_zeroPivot(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_xbsric02_zeroPivot(intptr_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;
  __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_backends/cuda/libs/cusparse.pyx":3976
 * cpdef void xbsric02_zeroPivot(
 *         intptr_t handle, size_t info, size_t position) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseXbsric02_zeroPivot(
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3976, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":3977
 *         intptr_t handle, size_t info, size_t position) except *:
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseXbsric02_zeroPivot(
 *             <cusparseHandle_t>handle, <bsric02Info_t>info, <int*>position)
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "cupy_backends/cuda/libs/cusparse.pyx":3978
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":3977
 *         intptr_t handle, size_t info, size_t position) except *:
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseXbsric02_zeroPivot(
 *             <cusparseHandle_t>handle, <bsric02Info_t>info, <int*>position)
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy_backends/cuda/libs/cusparse.pyx":3980
 *         status = cusparseXbsric02_zeroPivot(
 *             <cusparseHandle_t>handle, <bsric02Info_t>info, <int*>position)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef int sbsric02_bufferSize(intptr_t handle, int dirA, int mb, int nnzb,
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3980, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":3974
 *     check_status(status)
 * 
 * cpdef void xbsric02_zeroPivot(             # <<<<<<<<<<<<<<
 *         intptr_t handle, size_t info, size_t position) except *:
 *     _setStream(handle)
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.xbsric02_zeroPivot", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_381xbsric02_zeroPivot(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_380xbsric02_zeroPivot, "xbsric02_zeroPivot(intptr_t handle, size_t info, size_t position) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_381xbsric02_zeroPivot(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_t __pyx_v_handle;
  size_t __pyx_v_info;
  size_t __pyx_v_position;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  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);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_info,&__pyx_mstate_global->__pyx_n_u_position,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 3974, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3974, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3974, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3974, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "xbsric02_zeroPivot", 0) < (0)) __PYX_ERR(0, 3974, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("xbsric02_zeroPivot", 1, 3, 3, i); __PYX_ERR(0, 3974, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3974, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3974, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3974, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3975, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyLong_As_size_t(values[1]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3975, __pyx_L3_error)
    __pyx_v_position = __Pyx_PyLong_As_size_t(values[2]); if (unlikely((__pyx_v_position == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3975, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("xbsric02_zeroPivot", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 3974, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.xbsric02_zeroPivot", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_380xbsric02_zeroPivot(__pyx_self, __pyx_v_handle, __pyx_v_info, __pyx_v_position);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_380xbsric02_zeroPivot(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_f_13cupy_backends_4cuda_4libs_8cusparse_xbsric02_zeroPivot(__pyx_v_handle, __pyx_v_info, __pyx_v_position, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3974, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3974, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":3982
 *     check_status(status)
 * 
 * cpdef int sbsric02_bufferSize(intptr_t handle, int dirA, int mb, int nnzb,             # <<<<<<<<<<<<<<
 *                               size_t descrA, size_t bsrSortedVal,
 *                               size_t bsrSortedRowPtr, size_t bsrSortedColInd,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_383sbsric02_bufferSize(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static int __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_sbsric02_bufferSize(intptr_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_backends/cuda/libs/cusparse.pyx":3987
 *                               int blockDim, size_t info) except? -1:
 *     cdef int pBufferSizeInBytes
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseSbsric02_bufferSize(
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3987, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":3988
 *     cdef int pBufferSizeInBytes
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseSbsric02_bufferSize(
 *             <cusparseHandle_t>handle, <cusparseDirection_t>dirA, mb, nnzb,
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "cupy_backends/cuda/libs/cusparse.pyx":3989
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":3988
 *     cdef int pBufferSizeInBytes
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseSbsric02_bufferSize(
 *             <cusparseHandle_t>handle, <cusparseDirection_t>dirA, mb, nnzb,
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy_backends/cuda/libs/cusparse.pyx":3994
 *             <const int*>bsrSortedRowPtr, <const int*>bsrSortedColInd, blockDim,
 *             <bsric02Info_t>info, &pBufferSizeInBytes)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return <int>pBufferSizeInBytes
 * 
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3994, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":3995
 *             <bsric02Info_t>info, &pBufferSizeInBytes)
 *     check_status(status)
 *     return <int>pBufferSizeInBytes             # <<<<<<<<<<<<<<
 * 
 * cpdef int dbsric02_bufferSize(intptr_t handle, int dirA, int mb, int nnzb,
*/
  __pyx_r = ((int)__pyx_v_pBufferSizeInBytes);
  goto __pyx_L0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":3982
 *     check_status(status)
 * 
 * cpdef int sbsric02_bufferSize(intptr_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_AddTraceback("cupy_backends.cuda.libs.cusparse.sbsric02_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_383sbsric02_bufferSize(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_382sbsric02_bufferSize, "sbsric02_bufferSize(intptr_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_13cupy_backends_4cuda_4libs_8cusparse_383sbsric02_bufferSize(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0};
  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);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_dirA,&__pyx_mstate_global->__pyx_n_u_mb,&__pyx_mstate_global->__pyx_n_u_nnzb,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_bsrSortedVal,&__pyx_mstate_global->__pyx_n_u_bsrSortedRowPtr,&__pyx_mstate_global->__pyx_n_u_bsrSortedColInd,&__pyx_mstate_global->__pyx_n_u_blockDim,&__pyx_mstate_global->__pyx_n_u_info,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 3982, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 3982, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 3982, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 3982, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 3982, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 3982, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3982, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3982, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3982, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3982, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3982, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "sbsric02_bufferSize", 0) < (0)) __PYX_ERR(0, 3982, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 10; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("sbsric02_bufferSize", 1, 10, 10, i); __PYX_ERR(0, 3982, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 10)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3982, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3982, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3982, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3982, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3982, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 3982, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 3982, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 3982, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 3982, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 3982, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3982, __pyx_L3_error)
    __pyx_v_dirA = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_dirA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3982, __pyx_L3_error)
    __pyx_v_mb = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_mb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3982, __pyx_L3_error)
    __pyx_v_nnzb = __Pyx_PyLong_As_int(values[3]); if (unlikely((__pyx_v_nnzb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3982, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3983, __pyx_L3_error)
    __pyx_v_bsrSortedVal = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_bsrSortedVal == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3983, __pyx_L3_error)
    __pyx_v_bsrSortedRowPtr = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_bsrSortedRowPtr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3984, __pyx_L3_error)
    __pyx_v_bsrSortedColInd = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_bsrSortedColInd == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3984, __pyx_L3_error)
    __pyx_v_blockDim = __Pyx_PyLong_As_int(values[8]); if (unlikely((__pyx_v_blockDim == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3985, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyLong_As_size_t(values[9]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3985, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("sbsric02_bufferSize", 1, 10, 10, __pyx_nargs); __PYX_ERR(0, 3982, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.sbsric02_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_382sbsric02_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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_382sbsric02_bufferSize(CYTHON_UNUSED PyObject *__pyx_self, intptr_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
  int __pyx_t_1;
  PyObject *__pyx_t_2 = 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_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(__pyx_t_1 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3982, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3982, __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_backends.cuda.libs.cusparse.sbsric02_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy_backends/cuda/libs/cusparse.pyx":3997
 *     return <int>pBufferSizeInBytes
 * 
 * cpdef int dbsric02_bufferSize(intptr_t handle, int dirA, int mb, int nnzb,             # <<<<<<<<<<<<<<
 *                               size_t descrA, size_t bsrSortedVal,
 *                               size_t bsrSortedRowPtr, size_t bsrSortedColInd,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_385dbsric02_bufferSize(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static int __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_dbsric02_bufferSize(intptr_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_backends/cuda/libs/cusparse.pyx":4002
 *                               int blockDim, size_t info) except? -1:
 *     cdef int pBufferSizeInBytes
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseDbsric02_bufferSize(
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4002, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":4003
 *     cdef int pBufferSizeInBytes
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseDbsric02_bufferSize(
 *             <cusparseHandle_t>handle, <cusparseDirection_t>dirA, mb, nnzb,
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "cupy_backends/cuda/libs/cusparse.pyx":4004
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":4003
 *     cdef int pBufferSizeInBytes
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseDbsric02_bufferSize(
 *             <cusparseHandle_t>handle, <cusparseDirection_t>dirA, mb, nnzb,
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy_backends/cuda/libs/cusparse.pyx":4009
 *             <const int*>bsrSortedRowPtr, <const int*>bsrSortedColInd, blockDim,
 *             <bsric02Info_t>info, &pBufferSizeInBytes)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return <int>pBufferSizeInBytes
 * 
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4009, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":4010
 *             <bsric02Info_t>info, &pBufferSizeInBytes)
 *     check_status(status)
 *     return <int>pBufferSizeInBytes             # <<<<<<<<<<<<<<
 * 
 * cpdef int cbsric02_bufferSize(intptr_t handle, int dirA, int mb, int nnzb,
*/
  __pyx_r = ((int)__pyx_v_pBufferSizeInBytes);
  goto __pyx_L0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":3997
 *     return <int>pBufferSizeInBytes
 * 
 * cpdef int dbsric02_bufferSize(intptr_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_AddTraceback("cupy_backends.cuda.libs.cusparse.dbsric02_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_385dbsric02_bufferSize(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_384dbsric02_bufferSize, "dbsric02_bufferSize(intptr_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_13cupy_backends_4cuda_4libs_8cusparse_385dbsric02_bufferSize(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0};
  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);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_dirA,&__pyx_mstate_global->__pyx_n_u_mb,&__pyx_mstate_global->__pyx_n_u_nnzb,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_bsrSortedVal,&__pyx_mstate_global->__pyx_n_u_bsrSortedRowPtr,&__pyx_mstate_global->__pyx_n_u_bsrSortedColInd,&__pyx_mstate_global->__pyx_n_u_blockDim,&__pyx_mstate_global->__pyx_n_u_info,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 3997, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 3997, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 3997, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 3997, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 3997, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 3997, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3997, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3997, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3997, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3997, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3997, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "dbsric02_bufferSize", 0) < (0)) __PYX_ERR(0, 3997, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 10; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("dbsric02_bufferSize", 1, 10, 10, i); __PYX_ERR(0, 3997, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 10)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3997, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3997, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3997, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3997, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3997, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 3997, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 3997, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 3997, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 3997, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 3997, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3997, __pyx_L3_error)
    __pyx_v_dirA = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_dirA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3997, __pyx_L3_error)
    __pyx_v_mb = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_mb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3997, __pyx_L3_error)
    __pyx_v_nnzb = __Pyx_PyLong_As_int(values[3]); if (unlikely((__pyx_v_nnzb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3997, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3998, __pyx_L3_error)
    __pyx_v_bsrSortedVal = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_bsrSortedVal == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3998, __pyx_L3_error)
    __pyx_v_bsrSortedRowPtr = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_bsrSortedRowPtr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3999, __pyx_L3_error)
    __pyx_v_bsrSortedColInd = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_bsrSortedColInd == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3999, __pyx_L3_error)
    __pyx_v_blockDim = __Pyx_PyLong_As_int(values[8]); if (unlikely((__pyx_v_blockDim == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4000, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyLong_As_size_t(values[9]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4000, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("dbsric02_bufferSize", 1, 10, 10, __pyx_nargs); __PYX_ERR(0, 3997, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.dbsric02_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_384dbsric02_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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_384dbsric02_bufferSize(CYTHON_UNUSED PyObject *__pyx_self, intptr_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
  int __pyx_t_1;
  PyObject *__pyx_t_2 = 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_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(__pyx_t_1 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3997, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3997, __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_backends.cuda.libs.cusparse.dbsric02_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy_backends/cuda/libs/cusparse.pyx":4012
 *     return <int>pBufferSizeInBytes
 * 
 * cpdef int cbsric02_bufferSize(intptr_t handle, int dirA, int mb, int nnzb,             # <<<<<<<<<<<<<<
 *                               size_t descrA, size_t bsrSortedVal,
 *                               size_t bsrSortedRowPtr, size_t bsrSortedColInd,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_387cbsric02_bufferSize(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static int __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_cbsric02_bufferSize(intptr_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_backends/cuda/libs/cusparse.pyx":4017
 *                               int blockDim, size_t info) except? -1:
 *     cdef int pBufferSizeInBytes
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseCbsric02_bufferSize(
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4017, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":4018
 *     cdef int pBufferSizeInBytes
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseCbsric02_bufferSize(
 *             <cusparseHandle_t>handle, <cusparseDirection_t>dirA, mb, nnzb,
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "cupy_backends/cuda/libs/cusparse.pyx":4019
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":4018
 *     cdef int pBufferSizeInBytes
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseCbsric02_bufferSize(
 *             <cusparseHandle_t>handle, <cusparseDirection_t>dirA, mb, nnzb,
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy_backends/cuda/libs/cusparse.pyx":4024
 *             <const int*>bsrSortedRowPtr, <const int*>bsrSortedColInd, blockDim,
 *             <bsric02Info_t>info, &pBufferSizeInBytes)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return <int>pBufferSizeInBytes
 * 
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_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_backends/cuda/libs/cusparse.pyx":4025
 *             <bsric02Info_t>info, &pBufferSizeInBytes)
 *     check_status(status)
 *     return <int>pBufferSizeInBytes             # <<<<<<<<<<<<<<
 * 
 * cpdef int zbsric02_bufferSize(intptr_t handle, int dirA, int mb, int nnzb,
*/
  __pyx_r = ((int)__pyx_v_pBufferSizeInBytes);
  goto __pyx_L0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":4012
 *     return <int>pBufferSizeInBytes
 * 
 * cpdef int cbsric02_bufferSize(intptr_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_AddTraceback("cupy_backends.cuda.libs.cusparse.cbsric02_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_387cbsric02_bufferSize(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_386cbsric02_bufferSize, "cbsric02_bufferSize(intptr_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_13cupy_backends_4cuda_4libs_8cusparse_387cbsric02_bufferSize(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0};
  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);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_dirA,&__pyx_mstate_global->__pyx_n_u_mb,&__pyx_mstate_global->__pyx_n_u_nnzb,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_bsrSortedVal,&__pyx_mstate_global->__pyx_n_u_bsrSortedRowPtr,&__pyx_mstate_global->__pyx_n_u_bsrSortedColInd,&__pyx_mstate_global->__pyx_n_u_blockDim,&__pyx_mstate_global->__pyx_n_u_info,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 4012, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 4012, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 4012, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 4012, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 4012, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 4012, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4012, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4012, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4012, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4012, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4012, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "cbsric02_bufferSize", 0) < (0)) __PYX_ERR(0, 4012, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 10; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("cbsric02_bufferSize", 1, 10, 10, i); __PYX_ERR(0, 4012, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 10)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4012, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4012, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4012, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4012, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4012, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 4012, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 4012, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 4012, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 4012, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 4012, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4012, __pyx_L3_error)
    __pyx_v_dirA = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_dirA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4012, __pyx_L3_error)
    __pyx_v_mb = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_mb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4012, __pyx_L3_error)
    __pyx_v_nnzb = __Pyx_PyLong_As_int(values[3]); if (unlikely((__pyx_v_nnzb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4012, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4013, __pyx_L3_error)
    __pyx_v_bsrSortedVal = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_bsrSortedVal == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4013, __pyx_L3_error)
    __pyx_v_bsrSortedRowPtr = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_bsrSortedRowPtr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4014, __pyx_L3_error)
    __pyx_v_bsrSortedColInd = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_bsrSortedColInd == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4014, __pyx_L3_error)
    __pyx_v_blockDim = __Pyx_PyLong_As_int(values[8]); if (unlikely((__pyx_v_blockDim == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4015, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyLong_As_size_t(values[9]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4015, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("cbsric02_bufferSize", 1, 10, 10, __pyx_nargs); __PYX_ERR(0, 4012, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.cbsric02_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_386cbsric02_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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_386cbsric02_bufferSize(CYTHON_UNUSED PyObject *__pyx_self, intptr_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
  int __pyx_t_1;
  PyObject *__pyx_t_2 = 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_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(__pyx_t_1 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4012, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4012, __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_backends.cuda.libs.cusparse.cbsric02_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy_backends/cuda/libs/cusparse.pyx":4027
 *     return <int>pBufferSizeInBytes
 * 
 * cpdef int zbsric02_bufferSize(intptr_t handle, int dirA, int mb, int nnzb,             # <<<<<<<<<<<<<<
 *                               size_t descrA, size_t bsrSortedVal,
 *                               size_t bsrSortedRowPtr, size_t bsrSortedColInd,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_389zbsric02_bufferSize(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static int __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_zbsric02_bufferSize(intptr_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_backends/cuda/libs/cusparse.pyx":4032
 *                               int blockDim, size_t info) except? -1:
 *     cdef int pBufferSizeInBytes
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseZbsric02_bufferSize(
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4032, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":4033
 *     cdef int pBufferSizeInBytes
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseZbsric02_bufferSize(
 *             <cusparseHandle_t>handle, <cusparseDirection_t>dirA, mb, nnzb,
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "cupy_backends/cuda/libs/cusparse.pyx":4034
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":4033
 *     cdef int pBufferSizeInBytes
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseZbsric02_bufferSize(
 *             <cusparseHandle_t>handle, <cusparseDirection_t>dirA, mb, nnzb,
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy_backends/cuda/libs/cusparse.pyx":4039
 *             <const int*>bsrSortedRowPtr, <const int*>bsrSortedColInd, blockDim,
 *             <bsric02Info_t>info, &pBufferSizeInBytes)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return <int>pBufferSizeInBytes
 * 
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_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_backends/cuda/libs/cusparse.pyx":4040
 *             <bsric02Info_t>info, &pBufferSizeInBytes)
 *     check_status(status)
 *     return <int>pBufferSizeInBytes             # <<<<<<<<<<<<<<
 * 
 * cpdef void sbsric02_analysis(
*/
  __pyx_r = ((int)__pyx_v_pBufferSizeInBytes);
  goto __pyx_L0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":4027
 *     return <int>pBufferSizeInBytes
 * 
 * cpdef int zbsric02_bufferSize(intptr_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_AddTraceback("cupy_backends.cuda.libs.cusparse.zbsric02_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_389zbsric02_bufferSize(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_388zbsric02_bufferSize, "zbsric02_bufferSize(intptr_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_13cupy_backends_4cuda_4libs_8cusparse_389zbsric02_bufferSize(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0};
  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);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_dirA,&__pyx_mstate_global->__pyx_n_u_mb,&__pyx_mstate_global->__pyx_n_u_nnzb,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_bsrSortedVal,&__pyx_mstate_global->__pyx_n_u_bsrSortedRowPtr,&__pyx_mstate_global->__pyx_n_u_bsrSortedColInd,&__pyx_mstate_global->__pyx_n_u_blockDim,&__pyx_mstate_global->__pyx_n_u_info,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 4027, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 4027, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 4027, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 4027, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 4027, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 4027, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4027, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4027, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4027, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4027, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4027, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "zbsric02_bufferSize", 0) < (0)) __PYX_ERR(0, 4027, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 10; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("zbsric02_bufferSize", 1, 10, 10, i); __PYX_ERR(0, 4027, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 10)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4027, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4027, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4027, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4027, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4027, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 4027, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 4027, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 4027, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 4027, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 4027, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4027, __pyx_L3_error)
    __pyx_v_dirA = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_dirA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4027, __pyx_L3_error)
    __pyx_v_mb = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_mb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4027, __pyx_L3_error)
    __pyx_v_nnzb = __Pyx_PyLong_As_int(values[3]); if (unlikely((__pyx_v_nnzb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4027, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4028, __pyx_L3_error)
    __pyx_v_bsrSortedVal = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_bsrSortedVal == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4028, __pyx_L3_error)
    __pyx_v_bsrSortedRowPtr = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_bsrSortedRowPtr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4029, __pyx_L3_error)
    __pyx_v_bsrSortedColInd = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_bsrSortedColInd == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4029, __pyx_L3_error)
    __pyx_v_blockDim = __Pyx_PyLong_As_int(values[8]); if (unlikely((__pyx_v_blockDim == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4030, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyLong_As_size_t(values[9]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4030, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("zbsric02_bufferSize", 1, 10, 10, __pyx_nargs); __PYX_ERR(0, 4027, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.zbsric02_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_388zbsric02_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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_388zbsric02_bufferSize(CYTHON_UNUSED PyObject *__pyx_self, intptr_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
  int __pyx_t_1;
  PyObject *__pyx_t_2 = 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_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(__pyx_t_1 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4027, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4027, __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_backends.cuda.libs.cusparse.zbsric02_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy_backends/cuda/libs/cusparse.pyx":4042
 *     return <int>pBufferSizeInBytes
 * 
 * cpdef void sbsric02_analysis(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int dirA, int mb, int nnzb, size_t descrA,
 *         size_t bsrSortedVal, size_t bsrSortedRowPtr, size_t bsrSortedColInd,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_391sbsric02_analysis(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_sbsric02_analysis(intptr_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;
  __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_backends/cuda/libs/cusparse.pyx":4046
 *         size_t bsrSortedVal, size_t bsrSortedRowPtr, size_t bsrSortedColInd,
 *         int blockDim, size_t info, int policy, size_t pInputBuffer) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseSbsric02_analysis(
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4046, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":4047
 *         int blockDim, size_t info, int policy, size_t pInputBuffer) except *:
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseSbsric02_analysis(
 *             <cusparseHandle_t>handle, <cusparseDirection_t>dirA, mb, nnzb,
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "cupy_backends/cuda/libs/cusparse.pyx":4048
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":4047
 *         int blockDim, size_t info, int policy, size_t pInputBuffer) except *:
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseSbsric02_analysis(
 *             <cusparseHandle_t>handle, <cusparseDirection_t>dirA, mb, nnzb,
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy_backends/cuda/libs/cusparse.pyx":4054
 *             <bsric02Info_t>info, <cusparseSolvePolicy_t>policy,
 *             <void*>pInputBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef void dbsric02_analysis(
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4054, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":4042
 *     return <int>pBufferSizeInBytes
 * 
 * cpdef void sbsric02_analysis(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int dirA, int mb, int nnzb, size_t descrA,
 *         size_t bsrSortedVal, size_t bsrSortedRowPtr, size_t bsrSortedColInd,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.sbsric02_analysis", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_391sbsric02_analysis(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_390sbsric02_analysis, "sbsric02_analysis(intptr_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) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_391sbsric02_analysis(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[12] = {0,0,0,0,0,0,0,0,0,0,0,0};
  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);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_dirA,&__pyx_mstate_global->__pyx_n_u_mb,&__pyx_mstate_global->__pyx_n_u_nnzb,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_bsrSortedVal,&__pyx_mstate_global->__pyx_n_u_bsrSortedRowPtr,&__pyx_mstate_global->__pyx_n_u_bsrSortedColInd,&__pyx_mstate_global->__pyx_n_u_blockDim,&__pyx_mstate_global->__pyx_n_u_info,&__pyx_mstate_global->__pyx_n_u_policy,&__pyx_mstate_global->__pyx_n_u_pInputBuffer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 4042, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 12:
        values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 4042, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 11:
        values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 4042, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 4042, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 4042, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 4042, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 4042, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 4042, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4042, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4042, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4042, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4042, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4042, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "sbsric02_analysis", 0) < (0)) __PYX_ERR(0, 4042, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 12; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("sbsric02_analysis", 1, 12, 12, i); __PYX_ERR(0, 4042, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 12)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4042, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4042, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4042, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4042, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4042, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 4042, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 4042, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 4042, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 4042, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 4042, __pyx_L3_error)
      values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 4042, __pyx_L3_error)
      values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 4042, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4043, __pyx_L3_error)
    __pyx_v_dirA = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_dirA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4043, __pyx_L3_error)
    __pyx_v_mb = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_mb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4043, __pyx_L3_error)
    __pyx_v_nnzb = __Pyx_PyLong_As_int(values[3]); if (unlikely((__pyx_v_nnzb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4043, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4043, __pyx_L3_error)
    __pyx_v_bsrSortedVal = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_bsrSortedVal == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4044, __pyx_L3_error)
    __pyx_v_bsrSortedRowPtr = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_bsrSortedRowPtr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4044, __pyx_L3_error)
    __pyx_v_bsrSortedColInd = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_bsrSortedColInd == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4044, __pyx_L3_error)
    __pyx_v_blockDim = __Pyx_PyLong_As_int(values[8]); if (unlikely((__pyx_v_blockDim == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4045, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyLong_As_size_t(values[9]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4045, __pyx_L3_error)
    __pyx_v_policy = __Pyx_PyLong_As_int(values[10]); if (unlikely((__pyx_v_policy == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4045, __pyx_L3_error)
    __pyx_v_pInputBuffer = __Pyx_PyLong_As_size_t(values[11]); if (unlikely((__pyx_v_pInputBuffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4045, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("sbsric02_analysis", 1, 12, 12, __pyx_nargs); __PYX_ERR(0, 4042, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.sbsric02_analysis", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_390sbsric02_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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_390sbsric02_analysis(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4042, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4042, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":4056
 *     check_status(status)
 * 
 * cpdef void dbsric02_analysis(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int dirA, int mb, int nnzb, size_t descrA,
 *         size_t bsrSortedVal, size_t bsrSortedRowPtr, size_t bsrSortedColInd,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_393dbsric02_analysis(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_dbsric02_analysis(intptr_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;
  __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_backends/cuda/libs/cusparse.pyx":4060
 *         size_t bsrSortedVal, size_t bsrSortedRowPtr, size_t bsrSortedColInd,
 *         int blockDim, size_t info, int policy, size_t pInputBuffer) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseDbsric02_analysis(
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4060, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":4061
 *         int blockDim, size_t info, int policy, size_t pInputBuffer) except *:
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseDbsric02_analysis(
 *             <cusparseHandle_t>handle, <cusparseDirection_t>dirA, mb, nnzb,
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "cupy_backends/cuda/libs/cusparse.pyx":4062
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":4061
 *         int blockDim, size_t info, int policy, size_t pInputBuffer) except *:
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseDbsric02_analysis(
 *             <cusparseHandle_t>handle, <cusparseDirection_t>dirA, mb, nnzb,
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy_backends/cuda/libs/cusparse.pyx":4068
 *             <bsric02Info_t>info, <cusparseSolvePolicy_t>policy,
 *             <void*>pInputBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef void cbsric02_analysis(
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4068, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":4056
 *     check_status(status)
 * 
 * cpdef void dbsric02_analysis(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int dirA, int mb, int nnzb, size_t descrA,
 *         size_t bsrSortedVal, size_t bsrSortedRowPtr, size_t bsrSortedColInd,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.dbsric02_analysis", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_393dbsric02_analysis(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_392dbsric02_analysis, "dbsric02_analysis(intptr_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) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_393dbsric02_analysis(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[12] = {0,0,0,0,0,0,0,0,0,0,0,0};
  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);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_dirA,&__pyx_mstate_global->__pyx_n_u_mb,&__pyx_mstate_global->__pyx_n_u_nnzb,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_bsrSortedVal,&__pyx_mstate_global->__pyx_n_u_bsrSortedRowPtr,&__pyx_mstate_global->__pyx_n_u_bsrSortedColInd,&__pyx_mstate_global->__pyx_n_u_blockDim,&__pyx_mstate_global->__pyx_n_u_info,&__pyx_mstate_global->__pyx_n_u_policy,&__pyx_mstate_global->__pyx_n_u_pInputBuffer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 4056, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 12:
        values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 4056, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 11:
        values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 4056, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 4056, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 4056, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 4056, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 4056, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 4056, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4056, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4056, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4056, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4056, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4056, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "dbsric02_analysis", 0) < (0)) __PYX_ERR(0, 4056, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 12; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("dbsric02_analysis", 1, 12, 12, i); __PYX_ERR(0, 4056, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 12)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4056, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4056, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4056, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4056, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4056, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 4056, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 4056, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 4056, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 4056, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 4056, __pyx_L3_error)
      values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 4056, __pyx_L3_error)
      values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 4056, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4057, __pyx_L3_error)
    __pyx_v_dirA = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_dirA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4057, __pyx_L3_error)
    __pyx_v_mb = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_mb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4057, __pyx_L3_error)
    __pyx_v_nnzb = __Pyx_PyLong_As_int(values[3]); if (unlikely((__pyx_v_nnzb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4057, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4057, __pyx_L3_error)
    __pyx_v_bsrSortedVal = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_bsrSortedVal == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4058, __pyx_L3_error)
    __pyx_v_bsrSortedRowPtr = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_bsrSortedRowPtr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4058, __pyx_L3_error)
    __pyx_v_bsrSortedColInd = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_bsrSortedColInd == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4058, __pyx_L3_error)
    __pyx_v_blockDim = __Pyx_PyLong_As_int(values[8]); if (unlikely((__pyx_v_blockDim == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4059, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyLong_As_size_t(values[9]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4059, __pyx_L3_error)
    __pyx_v_policy = __Pyx_PyLong_As_int(values[10]); if (unlikely((__pyx_v_policy == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4059, __pyx_L3_error)
    __pyx_v_pInputBuffer = __Pyx_PyLong_As_size_t(values[11]); if (unlikely((__pyx_v_pInputBuffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4059, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("dbsric02_analysis", 1, 12, 12, __pyx_nargs); __PYX_ERR(0, 4056, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.dbsric02_analysis", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_392dbsric02_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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_392dbsric02_analysis(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4056, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4056, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":4070
 *     check_status(status)
 * 
 * cpdef void cbsric02_analysis(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int dirA, int mb, int nnzb, size_t descrA,
 *         size_t bsrSortedVal, size_t bsrSortedRowPtr, size_t bsrSortedColInd,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_395cbsric02_analysis(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_cbsric02_analysis(intptr_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;
  __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_backends/cuda/libs/cusparse.pyx":4074
 *         size_t bsrSortedVal, size_t bsrSortedRowPtr, size_t bsrSortedColInd,
 *         int blockDim, size_t info, int policy, size_t pInputBuffer) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseCbsric02_analysis(
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4074, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":4075
 *         int blockDim, size_t info, int policy, size_t pInputBuffer) except *:
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseCbsric02_analysis(
 *             <cusparseHandle_t>handle, <cusparseDirection_t>dirA, mb, nnzb,
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "cupy_backends/cuda/libs/cusparse.pyx":4076
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":4075
 *         int blockDim, size_t info, int policy, size_t pInputBuffer) except *:
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseCbsric02_analysis(
 *             <cusparseHandle_t>handle, <cusparseDirection_t>dirA, mb, nnzb,
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy_backends/cuda/libs/cusparse.pyx":4082
 *             <bsric02Info_t>info, <cusparseSolvePolicy_t>policy,
 *             <void*>pInputBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef void zbsric02_analysis(
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_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_backends/cuda/libs/cusparse.pyx":4070
 *     check_status(status)
 * 
 * cpdef void cbsric02_analysis(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int dirA, int mb, int nnzb, size_t descrA,
 *         size_t bsrSortedVal, size_t bsrSortedRowPtr, size_t bsrSortedColInd,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.cbsric02_analysis", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_395cbsric02_analysis(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_394cbsric02_analysis, "cbsric02_analysis(intptr_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) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_395cbsric02_analysis(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[12] = {0,0,0,0,0,0,0,0,0,0,0,0};
  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);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_dirA,&__pyx_mstate_global->__pyx_n_u_mb,&__pyx_mstate_global->__pyx_n_u_nnzb,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_bsrSortedVal,&__pyx_mstate_global->__pyx_n_u_bsrSortedRowPtr,&__pyx_mstate_global->__pyx_n_u_bsrSortedColInd,&__pyx_mstate_global->__pyx_n_u_blockDim,&__pyx_mstate_global->__pyx_n_u_info,&__pyx_mstate_global->__pyx_n_u_policy,&__pyx_mstate_global->__pyx_n_u_pInputBuffer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 4070, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 12:
        values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 4070, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 11:
        values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 4070, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 4070, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 4070, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 4070, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 4070, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 4070, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4070, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4070, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4070, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4070, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4070, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "cbsric02_analysis", 0) < (0)) __PYX_ERR(0, 4070, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 12; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("cbsric02_analysis", 1, 12, 12, i); __PYX_ERR(0, 4070, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 12)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4070, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4070, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4070, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4070, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4070, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 4070, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 4070, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 4070, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 4070, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 4070, __pyx_L3_error)
      values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 4070, __pyx_L3_error)
      values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 4070, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4071, __pyx_L3_error)
    __pyx_v_dirA = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_dirA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4071, __pyx_L3_error)
    __pyx_v_mb = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_mb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4071, __pyx_L3_error)
    __pyx_v_nnzb = __Pyx_PyLong_As_int(values[3]); if (unlikely((__pyx_v_nnzb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4071, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4071, __pyx_L3_error)
    __pyx_v_bsrSortedVal = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_bsrSortedVal == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4072, __pyx_L3_error)
    __pyx_v_bsrSortedRowPtr = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_bsrSortedRowPtr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4072, __pyx_L3_error)
    __pyx_v_bsrSortedColInd = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_bsrSortedColInd == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4072, __pyx_L3_error)
    __pyx_v_blockDim = __Pyx_PyLong_As_int(values[8]); if (unlikely((__pyx_v_blockDim == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4073, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyLong_As_size_t(values[9]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4073, __pyx_L3_error)
    __pyx_v_policy = __Pyx_PyLong_As_int(values[10]); if (unlikely((__pyx_v_policy == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4073, __pyx_L3_error)
    __pyx_v_pInputBuffer = __Pyx_PyLong_As_size_t(values[11]); if (unlikely((__pyx_v_pInputBuffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4073, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("cbsric02_analysis", 1, 12, 12, __pyx_nargs); __PYX_ERR(0, 4070, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.cbsric02_analysis", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_394cbsric02_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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_394cbsric02_analysis(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4070, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); 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_backends.cuda.libs.cusparse.cbsric02_analysis", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy_backends/cuda/libs/cusparse.pyx":4084
 *     check_status(status)
 * 
 * cpdef void zbsric02_analysis(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int dirA, int mb, int nnzb, size_t descrA,
 *         size_t bsrSortedVal, size_t bsrSortedRowPtr, size_t bsrSortedColInd,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_397zbsric02_analysis(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_zbsric02_analysis(intptr_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;
  __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_backends/cuda/libs/cusparse.pyx":4088
 *         size_t bsrSortedVal, size_t bsrSortedRowPtr, size_t bsrSortedColInd,
 *         int blockDim, size_t info, int policy, size_t pInputBuffer) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseZbsric02_analysis(
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4088, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":4089
 *         int blockDim, size_t info, int policy, size_t pInputBuffer) except *:
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseZbsric02_analysis(
 *             <cusparseHandle_t>handle, <cusparseDirection_t>dirA, mb, nnzb,
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "cupy_backends/cuda/libs/cusparse.pyx":4090
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":4089
 *         int blockDim, size_t info, int policy, size_t pInputBuffer) except *:
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseZbsric02_analysis(
 *             <cusparseHandle_t>handle, <cusparseDirection_t>dirA, mb, nnzb,
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy_backends/cuda/libs/cusparse.pyx":4096
 *             <const int*>bsrSortedColInd, blockDim, <bsric02Info_t>info,
 *             <cusparseSolvePolicy_t>policy, <void*>pInputBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef void sbsric02(
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_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_backends/cuda/libs/cusparse.pyx":4084
 *     check_status(status)
 * 
 * cpdef void zbsric02_analysis(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int dirA, int mb, int nnzb, size_t descrA,
 *         size_t bsrSortedVal, size_t bsrSortedRowPtr, size_t bsrSortedColInd,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.zbsric02_analysis", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_397zbsric02_analysis(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_396zbsric02_analysis, "zbsric02_analysis(intptr_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) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_397zbsric02_analysis(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[12] = {0,0,0,0,0,0,0,0,0,0,0,0};
  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);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_dirA,&__pyx_mstate_global->__pyx_n_u_mb,&__pyx_mstate_global->__pyx_n_u_nnzb,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_bsrSortedVal,&__pyx_mstate_global->__pyx_n_u_bsrSortedRowPtr,&__pyx_mstate_global->__pyx_n_u_bsrSortedColInd,&__pyx_mstate_global->__pyx_n_u_blockDim,&__pyx_mstate_global->__pyx_n_u_info,&__pyx_mstate_global->__pyx_n_u_policy,&__pyx_mstate_global->__pyx_n_u_pInputBuffer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 4084, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 12:
        values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 4084, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 11:
        values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 4084, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 4084, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 4084, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 4084, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 4084, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 4084, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4084, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4084, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4084, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4084, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4084, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "zbsric02_analysis", 0) < (0)) __PYX_ERR(0, 4084, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 12; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("zbsric02_analysis", 1, 12, 12, i); __PYX_ERR(0, 4084, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 12)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4084, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4084, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4084, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4084, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4084, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 4084, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 4084, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 4084, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 4084, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 4084, __pyx_L3_error)
      values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 4084, __pyx_L3_error)
      values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 4084, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4085, __pyx_L3_error)
    __pyx_v_dirA = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_dirA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4085, __pyx_L3_error)
    __pyx_v_mb = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_mb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4085, __pyx_L3_error)
    __pyx_v_nnzb = __Pyx_PyLong_As_int(values[3]); if (unlikely((__pyx_v_nnzb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4085, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4085, __pyx_L3_error)
    __pyx_v_bsrSortedVal = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_bsrSortedVal == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4086, __pyx_L3_error)
    __pyx_v_bsrSortedRowPtr = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_bsrSortedRowPtr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4086, __pyx_L3_error)
    __pyx_v_bsrSortedColInd = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_bsrSortedColInd == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4086, __pyx_L3_error)
    __pyx_v_blockDim = __Pyx_PyLong_As_int(values[8]); if (unlikely((__pyx_v_blockDim == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4087, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyLong_As_size_t(values[9]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4087, __pyx_L3_error)
    __pyx_v_policy = __Pyx_PyLong_As_int(values[10]); if (unlikely((__pyx_v_policy == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4087, __pyx_L3_error)
    __pyx_v_pInputBuffer = __Pyx_PyLong_As_size_t(values[11]); if (unlikely((__pyx_v_pInputBuffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4087, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("zbsric02_analysis", 1, 12, 12, __pyx_nargs); __PYX_ERR(0, 4084, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.zbsric02_analysis", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_396zbsric02_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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_396zbsric02_analysis(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4084, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4084, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":4098
 *     check_status(status)
 * 
 * cpdef void sbsric02(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int dirA, int mb, int nnzb, size_t descrA,
 *         size_t bsrSortedVal, size_t bsrSortedRowPtr,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_399sbsric02(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_sbsric02(intptr_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;
  __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_backends/cuda/libs/cusparse.pyx":4103
 *         size_t bsrSortedColInd, int blockDim, size_t info, int policy,
 *         size_t pBuffer) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseSbsric02(
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4103, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":4104
 *         size_t pBuffer) except *:
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseSbsric02(
 *             <cusparseHandle_t>handle, <cusparseDirection_t>dirA, mb, nnzb,
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "cupy_backends/cuda/libs/cusparse.pyx":4105
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":4104
 *         size_t pBuffer) except *:
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseSbsric02(
 *             <cusparseHandle_t>handle, <cusparseDirection_t>dirA, mb, nnzb,
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy_backends/cuda/libs/cusparse.pyx":4110
 *             <const int*>bsrSortedRowPtr, <const int*>bsrSortedColInd, blockDim,
 *             <bsric02Info_t>info, <cusparseSolvePolicy_t>policy, <void*>pBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef void dbsric02(
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4110, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":4098
 *     check_status(status)
 * 
 * cpdef void sbsric02(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int dirA, int mb, int nnzb, size_t descrA,
 *         size_t bsrSortedVal, size_t bsrSortedRowPtr,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.sbsric02", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_399sbsric02(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_398sbsric02, "sbsric02(intptr_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) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_399sbsric02(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[12] = {0,0,0,0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("sbsric02 (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_dirA,&__pyx_mstate_global->__pyx_n_u_mb,&__pyx_mstate_global->__pyx_n_u_nnzb,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_bsrSortedVal,&__pyx_mstate_global->__pyx_n_u_bsrSortedRowPtr,&__pyx_mstate_global->__pyx_n_u_bsrSortedColInd,&__pyx_mstate_global->__pyx_n_u_blockDim,&__pyx_mstate_global->__pyx_n_u_info,&__pyx_mstate_global->__pyx_n_u_policy,&__pyx_mstate_global->__pyx_n_u_pBuffer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 4098, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 12:
        values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 4098, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 11:
        values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 4098, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 4098, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 4098, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 4098, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 4098, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 4098, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4098, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4098, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4098, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4098, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4098, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "sbsric02", 0) < (0)) __PYX_ERR(0, 4098, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 12; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("sbsric02", 1, 12, 12, i); __PYX_ERR(0, 4098, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 12)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4098, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4098, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4098, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4098, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4098, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 4098, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 4098, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 4098, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 4098, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 4098, __pyx_L3_error)
      values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 4098, __pyx_L3_error)
      values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 4098, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4099, __pyx_L3_error)
    __pyx_v_dirA = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_dirA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4099, __pyx_L3_error)
    __pyx_v_mb = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_mb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4099, __pyx_L3_error)
    __pyx_v_nnzb = __Pyx_PyLong_As_int(values[3]); if (unlikely((__pyx_v_nnzb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4099, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4099, __pyx_L3_error)
    __pyx_v_bsrSortedVal = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_bsrSortedVal == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4100, __pyx_L3_error)
    __pyx_v_bsrSortedRowPtr = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_bsrSortedRowPtr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4100, __pyx_L3_error)
    __pyx_v_bsrSortedColInd = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_bsrSortedColInd == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4101, __pyx_L3_error)
    __pyx_v_blockDim = __Pyx_PyLong_As_int(values[8]); if (unlikely((__pyx_v_blockDim == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4101, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyLong_As_size_t(values[9]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4101, __pyx_L3_error)
    __pyx_v_policy = __Pyx_PyLong_As_int(values[10]); if (unlikely((__pyx_v_policy == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4101, __pyx_L3_error)
    __pyx_v_pBuffer = __Pyx_PyLong_As_size_t(values[11]); if (unlikely((__pyx_v_pBuffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4102, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("sbsric02", 1, 12, 12, __pyx_nargs); __PYX_ERR(0, 4098, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.sbsric02", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_398sbsric02(__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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_398sbsric02(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4098, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4098, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":4112
 *     check_status(status)
 * 
 * cpdef void dbsric02(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int dirA, int mb, int nnzb, size_t descrA,
 *         size_t bsrSortedVal, size_t bsrSortedRowPtr,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_401dbsric02(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_dbsric02(intptr_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;
  __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_backends/cuda/libs/cusparse.pyx":4117
 *         size_t bsrSortedColInd, int blockDim, size_t info, int policy,
 *         size_t pBuffer) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseDbsric02(
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4117, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":4118
 *         size_t pBuffer) except *:
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseDbsric02(
 *             <cusparseHandle_t>handle, <cusparseDirection_t>dirA, mb, nnzb,
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "cupy_backends/cuda/libs/cusparse.pyx":4119
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":4118
 *         size_t pBuffer) except *:
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseDbsric02(
 *             <cusparseHandle_t>handle, <cusparseDirection_t>dirA, mb, nnzb,
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy_backends/cuda/libs/cusparse.pyx":4124
 *             <const int*>bsrSortedRowPtr, <const int*>bsrSortedColInd, blockDim,
 *             <bsric02Info_t>info, <cusparseSolvePolicy_t>policy, <void*>pBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef void cbsric02(
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4124, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":4112
 *     check_status(status)
 * 
 * cpdef void dbsric02(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int dirA, int mb, int nnzb, size_t descrA,
 *         size_t bsrSortedVal, size_t bsrSortedRowPtr,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.dbsric02", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_401dbsric02(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_400dbsric02, "dbsric02(intptr_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) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_401dbsric02(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[12] = {0,0,0,0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dbsric02 (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_dirA,&__pyx_mstate_global->__pyx_n_u_mb,&__pyx_mstate_global->__pyx_n_u_nnzb,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_bsrSortedVal,&__pyx_mstate_global->__pyx_n_u_bsrSortedRowPtr,&__pyx_mstate_global->__pyx_n_u_bsrSortedColInd,&__pyx_mstate_global->__pyx_n_u_blockDim,&__pyx_mstate_global->__pyx_n_u_info,&__pyx_mstate_global->__pyx_n_u_policy,&__pyx_mstate_global->__pyx_n_u_pBuffer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 4112, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 12:
        values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 4112, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 11:
        values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 4112, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 4112, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 4112, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 4112, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 4112, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 4112, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4112, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4112, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4112, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4112, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4112, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "dbsric02", 0) < (0)) __PYX_ERR(0, 4112, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 12; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("dbsric02", 1, 12, 12, i); __PYX_ERR(0, 4112, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 12)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4112, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4112, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4112, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4112, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4112, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 4112, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 4112, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 4112, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 4112, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 4112, __pyx_L3_error)
      values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 4112, __pyx_L3_error)
      values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 4112, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4113, __pyx_L3_error)
    __pyx_v_dirA = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_dirA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4113, __pyx_L3_error)
    __pyx_v_mb = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_mb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4113, __pyx_L3_error)
    __pyx_v_nnzb = __Pyx_PyLong_As_int(values[3]); if (unlikely((__pyx_v_nnzb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4113, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4113, __pyx_L3_error)
    __pyx_v_bsrSortedVal = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_bsrSortedVal == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4114, __pyx_L3_error)
    __pyx_v_bsrSortedRowPtr = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_bsrSortedRowPtr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4114, __pyx_L3_error)
    __pyx_v_bsrSortedColInd = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_bsrSortedColInd == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4115, __pyx_L3_error)
    __pyx_v_blockDim = __Pyx_PyLong_As_int(values[8]); if (unlikely((__pyx_v_blockDim == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4115, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyLong_As_size_t(values[9]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4115, __pyx_L3_error)
    __pyx_v_policy = __Pyx_PyLong_As_int(values[10]); if (unlikely((__pyx_v_policy == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4115, __pyx_L3_error)
    __pyx_v_pBuffer = __Pyx_PyLong_As_size_t(values[11]); if (unlikely((__pyx_v_pBuffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4116, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("dbsric02", 1, 12, 12, __pyx_nargs); __PYX_ERR(0, 4112, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.dbsric02", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_400dbsric02(__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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_400dbsric02(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4112, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4112, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":4126
 *     check_status(status)
 * 
 * cpdef void cbsric02(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int dirA, int mb, int nnzb, size_t descrA,
 *         size_t bsrSortedVal, size_t bsrSortedRowPtr,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_403cbsric02(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_cbsric02(intptr_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;
  __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_backends/cuda/libs/cusparse.pyx":4131
 *         size_t bsrSortedColInd, int blockDim, size_t info, int policy,
 *         size_t pBuffer) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseCbsric02(
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4131, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":4132
 *         size_t pBuffer) except *:
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseCbsric02(
 *             <cusparseHandle_t>handle, <cusparseDirection_t>dirA, mb, nnzb,
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "cupy_backends/cuda/libs/cusparse.pyx":4133
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":4132
 *         size_t pBuffer) except *:
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseCbsric02(
 *             <cusparseHandle_t>handle, <cusparseDirection_t>dirA, mb, nnzb,
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy_backends/cuda/libs/cusparse.pyx":4138
 *             <const int*>bsrSortedRowPtr, <const int*>bsrSortedColInd, blockDim,
 *             <bsric02Info_t>info, <cusparseSolvePolicy_t>policy, <void*>pBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef void zbsric02(
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4138, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":4126
 *     check_status(status)
 * 
 * cpdef void cbsric02(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int dirA, int mb, int nnzb, size_t descrA,
 *         size_t bsrSortedVal, size_t bsrSortedRowPtr,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.cbsric02", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_403cbsric02(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_402cbsric02, "cbsric02(intptr_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) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_403cbsric02(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[12] = {0,0,0,0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("cbsric02 (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_dirA,&__pyx_mstate_global->__pyx_n_u_mb,&__pyx_mstate_global->__pyx_n_u_nnzb,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_bsrSortedVal,&__pyx_mstate_global->__pyx_n_u_bsrSortedRowPtr,&__pyx_mstate_global->__pyx_n_u_bsrSortedColInd,&__pyx_mstate_global->__pyx_n_u_blockDim,&__pyx_mstate_global->__pyx_n_u_info,&__pyx_mstate_global->__pyx_n_u_policy,&__pyx_mstate_global->__pyx_n_u_pBuffer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 4126, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 12:
        values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 4126, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 11:
        values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 4126, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 4126, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 4126, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 4126, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 4126, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 4126, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4126, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4126, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4126, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4126, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4126, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "cbsric02", 0) < (0)) __PYX_ERR(0, 4126, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 12; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("cbsric02", 1, 12, 12, i); __PYX_ERR(0, 4126, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 12)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4126, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4126, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4126, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4126, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4126, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 4126, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 4126, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 4126, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 4126, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 4126, __pyx_L3_error)
      values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 4126, __pyx_L3_error)
      values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 4126, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4127, __pyx_L3_error)
    __pyx_v_dirA = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_dirA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4127, __pyx_L3_error)
    __pyx_v_mb = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_mb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4127, __pyx_L3_error)
    __pyx_v_nnzb = __Pyx_PyLong_As_int(values[3]); if (unlikely((__pyx_v_nnzb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4127, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4127, __pyx_L3_error)
    __pyx_v_bsrSortedVal = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_bsrSortedVal == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4128, __pyx_L3_error)
    __pyx_v_bsrSortedRowPtr = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_bsrSortedRowPtr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4128, __pyx_L3_error)
    __pyx_v_bsrSortedColInd = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_bsrSortedColInd == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4129, __pyx_L3_error)
    __pyx_v_blockDim = __Pyx_PyLong_As_int(values[8]); if (unlikely((__pyx_v_blockDim == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4129, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyLong_As_size_t(values[9]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4129, __pyx_L3_error)
    __pyx_v_policy = __Pyx_PyLong_As_int(values[10]); if (unlikely((__pyx_v_policy == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4129, __pyx_L3_error)
    __pyx_v_pBuffer = __Pyx_PyLong_As_size_t(values[11]); if (unlikely((__pyx_v_pBuffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4130, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("cbsric02", 1, 12, 12, __pyx_nargs); __PYX_ERR(0, 4126, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.cbsric02", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_402cbsric02(__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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_402cbsric02(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4126, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4126, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":4140
 *     check_status(status)
 * 
 * cpdef void zbsric02(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int dirA, int mb, int nnzb, size_t descrA,
 *         size_t bsrSortedVal, size_t bsrSortedRowPtr,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_405zbsric02(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_zbsric02(intptr_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;
  __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_backends/cuda/libs/cusparse.pyx":4145
 *         size_t bsrSortedColInd, int blockDim, size_t info, int policy,
 *         size_t pBuffer) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseZbsric02(
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4145, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":4146
 *         size_t pBuffer) except *:
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseZbsric02(
 *             <cusparseHandle_t>handle, <cusparseDirection_t>dirA, mb, nnzb,
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "cupy_backends/cuda/libs/cusparse.pyx":4147
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":4146
 *         size_t pBuffer) except *:
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseZbsric02(
 *             <cusparseHandle_t>handle, <cusparseDirection_t>dirA, mb, nnzb,
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy_backends/cuda/libs/cusparse.pyx":4152
 *             <const int*>bsrSortedRowPtr, <const int*>bsrSortedColInd, blockDim,
 *             <bsric02Info_t>info, <cusparseSolvePolicy_t>policy, <void*>pBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef size_t sgtsv2_bufferSizeExt(
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4152, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":4140
 *     check_status(status)
 * 
 * cpdef void zbsric02(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int dirA, int mb, int nnzb, size_t descrA,
 *         size_t bsrSortedVal, size_t bsrSortedRowPtr,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.zbsric02", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_405zbsric02(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_404zbsric02, "zbsric02(intptr_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) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_405zbsric02(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[12] = {0,0,0,0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("zbsric02 (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_dirA,&__pyx_mstate_global->__pyx_n_u_mb,&__pyx_mstate_global->__pyx_n_u_nnzb,&__pyx_mstate_global->__pyx_n_u_descrA,&__pyx_mstate_global->__pyx_n_u_bsrSortedVal,&__pyx_mstate_global->__pyx_n_u_bsrSortedRowPtr,&__pyx_mstate_global->__pyx_n_u_bsrSortedColInd,&__pyx_mstate_global->__pyx_n_u_blockDim,&__pyx_mstate_global->__pyx_n_u_info,&__pyx_mstate_global->__pyx_n_u_policy,&__pyx_mstate_global->__pyx_n_u_pBuffer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 4140, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 12:
        values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 4140, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 11:
        values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 4140, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 4140, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 4140, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 4140, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 4140, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 4140, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4140, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4140, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4140, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4140, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4140, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "zbsric02", 0) < (0)) __PYX_ERR(0, 4140, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 12; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("zbsric02", 1, 12, 12, i); __PYX_ERR(0, 4140, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 12)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4140, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4140, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4140, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4140, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4140, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 4140, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 4140, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 4140, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 4140, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 4140, __pyx_L3_error)
      values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 4140, __pyx_L3_error)
      values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 4140, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4141, __pyx_L3_error)
    __pyx_v_dirA = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_dirA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4141, __pyx_L3_error)
    __pyx_v_mb = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_mb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4141, __pyx_L3_error)
    __pyx_v_nnzb = __Pyx_PyLong_As_int(values[3]); if (unlikely((__pyx_v_nnzb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4141, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4141, __pyx_L3_error)
    __pyx_v_bsrSortedVal = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_bsrSortedVal == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4142, __pyx_L3_error)
    __pyx_v_bsrSortedRowPtr = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_bsrSortedRowPtr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4142, __pyx_L3_error)
    __pyx_v_bsrSortedColInd = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_bsrSortedColInd == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4143, __pyx_L3_error)
    __pyx_v_blockDim = __Pyx_PyLong_As_int(values[8]); if (unlikely((__pyx_v_blockDim == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4143, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyLong_As_size_t(values[9]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4143, __pyx_L3_error)
    __pyx_v_policy = __Pyx_PyLong_As_int(values[10]); if (unlikely((__pyx_v_policy == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4143, __pyx_L3_error)
    __pyx_v_pBuffer = __Pyx_PyLong_As_size_t(values[11]); if (unlikely((__pyx_v_pBuffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4144, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("zbsric02", 1, 12, 12, __pyx_nargs); __PYX_ERR(0, 4140, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.zbsric02", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_404zbsric02(__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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_404zbsric02(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4140, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4140, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":4154
 *     check_status(status)
 * 
 * cpdef size_t sgtsv2_bufferSizeExt(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int n, size_t dl, size_t d,
 *         size_t du, size_t B, int ldb) except? -1:
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_407sgtsv2_bufferSizeExt(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static size_t __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_sgtsv2_bufferSizeExt(intptr_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, 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("sgtsv2_bufferSizeExt", 0);

  /* "cupy_backends/cuda/libs/cusparse.pyx":4158
 *         size_t du, size_t B, int ldb) except? -1:
 *     cdef size_t bufferSizeInBytes
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseSgtsv2_bufferSizeExt(
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4158, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":4159
 *     cdef size_t bufferSizeInBytes
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseSgtsv2_bufferSizeExt(
 *             <cusparseHandle_t>handle, m, n, <const float*>dl, <const float*>d,
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "cupy_backends/cuda/libs/cusparse.pyx":4160
 *     _setStream(handle)
 *     with nogil:
 *         status = cusparseSgtsv2_bufferSizeExt(             # <<<<<<<<<<<<<<
 *             <cusparseHandle_t>handle, m, n, <const float*>dl, <const float*>d,
 *             <const float*>du, <const float*>B, ldb, &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, (&__pyx_v_bufferSizeInBytes));
      }

      /* "cupy_backends/cuda/libs/cusparse.pyx":4159
 *     cdef size_t bufferSizeInBytes
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseSgtsv2_bufferSizeExt(
 *             <cusparseHandle_t>handle, m, n, <const float*>dl, <const float*>d,
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy_backends/cuda/libs/cusparse.pyx":4163
 *             <cusparseHandle_t>handle, m, n, <const float*>dl, <const float*>d,
 *             <const float*>du, <const float*>B, ldb, &bufferSizeInBytes)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return bufferSizeInBytes
 * 
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4163, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":4164
 *             <const float*>du, <const float*>B, ldb, &bufferSizeInBytes)
 *     check_status(status)
 *     return bufferSizeInBytes             # <<<<<<<<<<<<<<
 * 
 * cpdef size_t dgtsv2_bufferSizeExt(
*/
  __pyx_r = __pyx_v_bufferSizeInBytes;
  goto __pyx_L0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":4154
 *     check_status(status)
 * 
 * cpdef size_t sgtsv2_bufferSizeExt(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int n, size_t dl, size_t d,
 *         size_t du, size_t B, int ldb) except? -1:
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.sgtsv2_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1L;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_407sgtsv2_bufferSizeExt(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_406sgtsv2_bufferSizeExt, "sgtsv2_bufferSizeExt(intptr_t handle, int m, int n, size_t dl, size_t d, size_t du, size_t B, int ldb) -> size_t");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_407sgtsv2_bufferSizeExt(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[8] = {0,0,0,0,0,0,0,0};
  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);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_n,&__pyx_mstate_global->__pyx_n_u_dl,&__pyx_mstate_global->__pyx_n_u_d,&__pyx_mstate_global->__pyx_n_u_du,&__pyx_mstate_global->__pyx_n_u_B,&__pyx_mstate_global->__pyx_n_u_ldb,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 4154, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 4154, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 4154, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 4154, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4154, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4154, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4154, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4154, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4154, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "sgtsv2_bufferSizeExt", 0) < (0)) __PYX_ERR(0, 4154, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 8; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("sgtsv2_bufferSizeExt", 1, 8, 8, i); __PYX_ERR(0, 4154, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 8)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4154, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4154, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4154, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4154, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4154, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 4154, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 4154, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 4154, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4155, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4155, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4155, __pyx_L3_error)
    __pyx_v_dl = __Pyx_PyLong_As_size_t(values[3]); if (unlikely((__pyx_v_dl == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4155, __pyx_L3_error)
    __pyx_v_d = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_d == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4155, __pyx_L3_error)
    __pyx_v_du = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_du == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4156, __pyx_L3_error)
    __pyx_v_B = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_B == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4156, __pyx_L3_error)
    __pyx_v_ldb = __Pyx_PyLong_As_int(values[7]); if (unlikely((__pyx_v_ldb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4156, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("sgtsv2_bufferSizeExt", 1, 8, 8, __pyx_nargs); __PYX_ERR(0, 4154, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.sgtsv2_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_406sgtsv2_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);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_406sgtsv2_bufferSizeExt(CYTHON_UNUSED PyObject *__pyx_self, intptr_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) {
  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("sgtsv2_bufferSizeExt", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(__pyx_t_1 == ((size_t)-1L) && PyErr_Occurred())) __PYX_ERR(0, 4154, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyLong_FromSize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4154, __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_backends.cuda.libs.cusparse.sgtsv2_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy_backends/cuda/libs/cusparse.pyx":4166
 *     return bufferSizeInBytes
 * 
 * cpdef size_t dgtsv2_bufferSizeExt(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int n, size_t dl, size_t d,
 *         size_t du, size_t B, int ldb) except? -1:
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_409dgtsv2_bufferSizeExt(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static size_t __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_dgtsv2_bufferSizeExt(intptr_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, 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("dgtsv2_bufferSizeExt", 0);

  /* "cupy_backends/cuda/libs/cusparse.pyx":4170
 *         size_t du, size_t B, int ldb) except? -1:
 *     cdef size_t bufferSizeInBytes
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseDgtsv2_bufferSizeExt(
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4170, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":4171
 *     cdef size_t bufferSizeInBytes
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseDgtsv2_bufferSizeExt(
 *             <cusparseHandle_t>handle, m, n, <const double*>dl,
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "cupy_backends/cuda/libs/cusparse.pyx":4172
 *     _setStream(handle)
 *     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, (&__pyx_v_bufferSizeInBytes));
      }

      /* "cupy_backends/cuda/libs/cusparse.pyx":4171
 *     cdef size_t bufferSizeInBytes
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseDgtsv2_bufferSizeExt(
 *             <cusparseHandle_t>handle, m, n, <const double*>dl,
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy_backends/cuda/libs/cusparse.pyx":4176
 *             <const double*>d, <const double*>du, <const double*>B, ldb,
 *             &bufferSizeInBytes)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return bufferSizeInBytes
 * 
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4176, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":4177
 *             &bufferSizeInBytes)
 *     check_status(status)
 *     return bufferSizeInBytes             # <<<<<<<<<<<<<<
 * 
 * cpdef size_t cgtsv2_bufferSizeExt(
*/
  __pyx_r = __pyx_v_bufferSizeInBytes;
  goto __pyx_L0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":4166
 *     return bufferSizeInBytes
 * 
 * cpdef size_t dgtsv2_bufferSizeExt(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int n, size_t dl, size_t d,
 *         size_t du, size_t B, int ldb) except? -1:
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.dgtsv2_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1L;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_409dgtsv2_bufferSizeExt(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_408dgtsv2_bufferSizeExt, "dgtsv2_bufferSizeExt(intptr_t handle, int m, int n, size_t dl, size_t d, size_t du, size_t B, int ldb) -> size_t");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_409dgtsv2_bufferSizeExt(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[8] = {0,0,0,0,0,0,0,0};
  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);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_n,&__pyx_mstate_global->__pyx_n_u_dl,&__pyx_mstate_global->__pyx_n_u_d,&__pyx_mstate_global->__pyx_n_u_du,&__pyx_mstate_global->__pyx_n_u_B,&__pyx_mstate_global->__pyx_n_u_ldb,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 4166, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 4166, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 4166, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 4166, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4166, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4166, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4166, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4166, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4166, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "dgtsv2_bufferSizeExt", 0) < (0)) __PYX_ERR(0, 4166, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 8; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("dgtsv2_bufferSizeExt", 1, 8, 8, i); __PYX_ERR(0, 4166, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 8)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4166, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4166, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4166, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4166, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4166, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 4166, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 4166, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 4166, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4167, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4167, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4167, __pyx_L3_error)
    __pyx_v_dl = __Pyx_PyLong_As_size_t(values[3]); if (unlikely((__pyx_v_dl == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4167, __pyx_L3_error)
    __pyx_v_d = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_d == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4167, __pyx_L3_error)
    __pyx_v_du = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_du == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4168, __pyx_L3_error)
    __pyx_v_B = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_B == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4168, __pyx_L3_error)
    __pyx_v_ldb = __Pyx_PyLong_As_int(values[7]); if (unlikely((__pyx_v_ldb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4168, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("dgtsv2_bufferSizeExt", 1, 8, 8, __pyx_nargs); __PYX_ERR(0, 4166, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.dgtsv2_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_408dgtsv2_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);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_408dgtsv2_bufferSizeExt(CYTHON_UNUSED PyObject *__pyx_self, intptr_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) {
  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("dgtsv2_bufferSizeExt", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(__pyx_t_1 == ((size_t)-1L) && PyErr_Occurred())) __PYX_ERR(0, 4166, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyLong_FromSize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4166, __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_backends.cuda.libs.cusparse.dgtsv2_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy_backends/cuda/libs/cusparse.pyx":4179
 *     return bufferSizeInBytes
 * 
 * cpdef size_t cgtsv2_bufferSizeExt(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int n, size_t dl, size_t d,
 *         size_t du, size_t B, int ldb) except? -1:
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_411cgtsv2_bufferSizeExt(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static size_t __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_cgtsv2_bufferSizeExt(intptr_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, 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("cgtsv2_bufferSizeExt", 0);

  /* "cupy_backends/cuda/libs/cusparse.pyx":4183
 *         size_t du, size_t B, int ldb) except? -1:
 *     cdef size_t bufferSizeInBytes
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseCgtsv2_bufferSizeExt(
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4183, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":4184
 *     cdef size_t bufferSizeInBytes
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseCgtsv2_bufferSizeExt(
 *             <cusparseHandle_t>handle, m, n, <const cuComplex*>dl,
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "cupy_backends/cuda/libs/cusparse.pyx":4185
 *     _setStream(handle)
 *     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, (&__pyx_v_bufferSizeInBytes));
      }

      /* "cupy_backends/cuda/libs/cusparse.pyx":4184
 *     cdef size_t bufferSizeInBytes
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseCgtsv2_bufferSizeExt(
 *             <cusparseHandle_t>handle, m, n, <const cuComplex*>dl,
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy_backends/cuda/libs/cusparse.pyx":4189
 *             <const cuComplex*>d, <const cuComplex*>du, <const cuComplex*>B,
 *             ldb, &bufferSizeInBytes)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return bufferSizeInBytes
 * 
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4189, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":4190
 *             ldb, &bufferSizeInBytes)
 *     check_status(status)
 *     return bufferSizeInBytes             # <<<<<<<<<<<<<<
 * 
 * cpdef size_t zgtsv2_bufferSizeExt(
*/
  __pyx_r = __pyx_v_bufferSizeInBytes;
  goto __pyx_L0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":4179
 *     return bufferSizeInBytes
 * 
 * cpdef size_t cgtsv2_bufferSizeExt(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int n, size_t dl, size_t d,
 *         size_t du, size_t B, int ldb) except? -1:
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.cgtsv2_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1L;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_411cgtsv2_bufferSizeExt(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_410cgtsv2_bufferSizeExt, "cgtsv2_bufferSizeExt(intptr_t handle, int m, int n, size_t dl, size_t d, size_t du, size_t B, int ldb) -> size_t");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_411cgtsv2_bufferSizeExt(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[8] = {0,0,0,0,0,0,0,0};
  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);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_n,&__pyx_mstate_global->__pyx_n_u_dl,&__pyx_mstate_global->__pyx_n_u_d,&__pyx_mstate_global->__pyx_n_u_du,&__pyx_mstate_global->__pyx_n_u_B,&__pyx_mstate_global->__pyx_n_u_ldb,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 4179, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 4179, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 4179, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 4179, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4179, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4179, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4179, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4179, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4179, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "cgtsv2_bufferSizeExt", 0) < (0)) __PYX_ERR(0, 4179, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 8; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("cgtsv2_bufferSizeExt", 1, 8, 8, i); __PYX_ERR(0, 4179, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 8)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4179, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4179, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4179, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4179, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4179, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 4179, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 4179, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 4179, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4180, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4180, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4180, __pyx_L3_error)
    __pyx_v_dl = __Pyx_PyLong_As_size_t(values[3]); if (unlikely((__pyx_v_dl == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4180, __pyx_L3_error)
    __pyx_v_d = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_d == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4180, __pyx_L3_error)
    __pyx_v_du = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_du == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4181, __pyx_L3_error)
    __pyx_v_B = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_B == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4181, __pyx_L3_error)
    __pyx_v_ldb = __Pyx_PyLong_As_int(values[7]); if (unlikely((__pyx_v_ldb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4181, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("cgtsv2_bufferSizeExt", 1, 8, 8, __pyx_nargs); __PYX_ERR(0, 4179, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.cgtsv2_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_410cgtsv2_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);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_410cgtsv2_bufferSizeExt(CYTHON_UNUSED PyObject *__pyx_self, intptr_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) {
  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("cgtsv2_bufferSizeExt", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(__pyx_t_1 == ((size_t)-1L) && PyErr_Occurred())) __PYX_ERR(0, 4179, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyLong_FromSize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4179, __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_backends.cuda.libs.cusparse.cgtsv2_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy_backends/cuda/libs/cusparse.pyx":4192
 *     return bufferSizeInBytes
 * 
 * cpdef size_t zgtsv2_bufferSizeExt(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int n, size_t dl, size_t d,
 *         size_t du, size_t B, int ldb) except? -1:
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_413zgtsv2_bufferSizeExt(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static size_t __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_zgtsv2_bufferSizeExt(intptr_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, 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("zgtsv2_bufferSizeExt", 0);

  /* "cupy_backends/cuda/libs/cusparse.pyx":4196
 *         size_t du, size_t B, int ldb) except? -1:
 *     cdef size_t bufferSizeInBytes
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseZgtsv2_bufferSizeExt(
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4196, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":4197
 *     cdef size_t bufferSizeInBytes
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseZgtsv2_bufferSizeExt(
 *             <cusparseHandle_t>handle, m, n, <const cuDoubleComplex*>dl,
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "cupy_backends/cuda/libs/cusparse.pyx":4198
 *     _setStream(handle)
 *     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, (&__pyx_v_bufferSizeInBytes));
      }

      /* "cupy_backends/cuda/libs/cusparse.pyx":4197
 *     cdef size_t bufferSizeInBytes
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseZgtsv2_bufferSizeExt(
 *             <cusparseHandle_t>handle, m, n, <const cuDoubleComplex*>dl,
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy_backends/cuda/libs/cusparse.pyx":4202
 *             <const cuDoubleComplex*>d, <const cuDoubleComplex*>du,
 *             <const cuDoubleComplex*>B, ldb, &bufferSizeInBytes)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return bufferSizeInBytes
 * 
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 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_backends/cuda/libs/cusparse.pyx":4203
 *             <const cuDoubleComplex*>B, ldb, &bufferSizeInBytes)
 *     check_status(status)
 *     return bufferSizeInBytes             # <<<<<<<<<<<<<<
 * 
 * cpdef void sgtsv2(
*/
  __pyx_r = __pyx_v_bufferSizeInBytes;
  goto __pyx_L0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":4192
 *     return bufferSizeInBytes
 * 
 * cpdef size_t zgtsv2_bufferSizeExt(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int n, size_t dl, size_t d,
 *         size_t du, size_t B, int ldb) except? -1:
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.zgtsv2_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1L;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_413zgtsv2_bufferSizeExt(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_412zgtsv2_bufferSizeExt, "zgtsv2_bufferSizeExt(intptr_t handle, int m, int n, size_t dl, size_t d, size_t du, size_t B, int ldb) -> size_t");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_413zgtsv2_bufferSizeExt(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[8] = {0,0,0,0,0,0,0,0};
  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);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_n,&__pyx_mstate_global->__pyx_n_u_dl,&__pyx_mstate_global->__pyx_n_u_d,&__pyx_mstate_global->__pyx_n_u_du,&__pyx_mstate_global->__pyx_n_u_B,&__pyx_mstate_global->__pyx_n_u_ldb,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 4192, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 4192, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 4192, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 4192, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4192, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4192, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4192, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4192, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4192, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "zgtsv2_bufferSizeExt", 0) < (0)) __PYX_ERR(0, 4192, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 8; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("zgtsv2_bufferSizeExt", 1, 8, 8, i); __PYX_ERR(0, 4192, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 8)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4192, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4192, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4192, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4192, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4192, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 4192, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 4192, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 4192, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4193, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4193, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4193, __pyx_L3_error)
    __pyx_v_dl = __Pyx_PyLong_As_size_t(values[3]); if (unlikely((__pyx_v_dl == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4193, __pyx_L3_error)
    __pyx_v_d = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_d == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4193, __pyx_L3_error)
    __pyx_v_du = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_du == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4194, __pyx_L3_error)
    __pyx_v_B = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_B == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4194, __pyx_L3_error)
    __pyx_v_ldb = __Pyx_PyLong_As_int(values[7]); if (unlikely((__pyx_v_ldb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4194, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("zgtsv2_bufferSizeExt", 1, 8, 8, __pyx_nargs); __PYX_ERR(0, 4192, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.zgtsv2_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_412zgtsv2_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);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_412zgtsv2_bufferSizeExt(CYTHON_UNUSED PyObject *__pyx_self, intptr_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) {
  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("zgtsv2_bufferSizeExt", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(__pyx_t_1 == ((size_t)-1L) && PyErr_Occurred())) __PYX_ERR(0, 4192, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyLong_FromSize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4192, __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_backends.cuda.libs.cusparse.zgtsv2_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy_backends/cuda/libs/cusparse.pyx":4205
 *     return bufferSizeInBytes
 * 
 * cpdef void sgtsv2(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int n, size_t dl, size_t d, size_t du,
 *         size_t B, int ldb, size_t pBuffer) except *:
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_415sgtsv2(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_sgtsv2(intptr_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;
  __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_backends/cuda/libs/cusparse.pyx":4208
 *         intptr_t handle, int m, int n, size_t dl, size_t d, size_t du,
 *         size_t B, int ldb, size_t pBuffer) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseSgtsv2(
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4208, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":4209
 *         size_t B, int ldb, size_t pBuffer) except *:
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseSgtsv2(
 *             <cusparseHandle_t>handle, m, n, <const float*>dl, <const float*>d,
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "cupy_backends/cuda/libs/cusparse.pyx":4210
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":4209
 *         size_t B, int ldb, size_t pBuffer) except *:
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseSgtsv2(
 *             <cusparseHandle_t>handle, m, n, <const float*>dl, <const float*>d,
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy_backends/cuda/libs/cusparse.pyx":4213
 *             <cusparseHandle_t>handle, m, n, <const float*>dl, <const float*>d,
 *             <const float*>du, <float*>B, ldb, <void*>pBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef void dgtsv2(
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4213, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":4205
 *     return bufferSizeInBytes
 * 
 * cpdef void sgtsv2(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int n, size_t dl, size_t d, size_t du,
 *         size_t B, int ldb, size_t pBuffer) except *:
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.sgtsv2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_415sgtsv2(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_414sgtsv2, "sgtsv2(intptr_t handle, int m, int n, size_t dl, size_t d, size_t du, size_t B, int ldb, size_t pBuffer) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_415sgtsv2(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("sgtsv2 (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_n,&__pyx_mstate_global->__pyx_n_u_dl,&__pyx_mstate_global->__pyx_n_u_d,&__pyx_mstate_global->__pyx_n_u_du,&__pyx_mstate_global->__pyx_n_u_B,&__pyx_mstate_global->__pyx_n_u_ldb,&__pyx_mstate_global->__pyx_n_u_pBuffer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 4205, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 4205, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 4205, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 4205, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 4205, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4205, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4205, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4205, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4205, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4205, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "sgtsv2", 0) < (0)) __PYX_ERR(0, 4205, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 9; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("sgtsv2", 1, 9, 9, i); __PYX_ERR(0, 4205, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 9)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4205, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4205, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4205, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4205, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4205, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 4205, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 4205, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 4205, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 4205, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4206, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4206, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4206, __pyx_L3_error)
    __pyx_v_dl = __Pyx_PyLong_As_size_t(values[3]); if (unlikely((__pyx_v_dl == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4206, __pyx_L3_error)
    __pyx_v_d = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_d == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4206, __pyx_L3_error)
    __pyx_v_du = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_du == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4206, __pyx_L3_error)
    __pyx_v_B = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_B == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4207, __pyx_L3_error)
    __pyx_v_ldb = __Pyx_PyLong_As_int(values[7]); if (unlikely((__pyx_v_ldb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4207, __pyx_L3_error)
    __pyx_v_pBuffer = __Pyx_PyLong_As_size_t(values[8]); if (unlikely((__pyx_v_pBuffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4207, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("sgtsv2", 1, 9, 9, __pyx_nargs); __PYX_ERR(0, 4205, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.sgtsv2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_414sgtsv2(__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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_414sgtsv2(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4205, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4205, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":4215
 *     check_status(status)
 * 
 * cpdef void dgtsv2(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int n, size_t dl, size_t d, size_t du,
 *         size_t B, int ldb, size_t pBuffer) except *:
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_417dgtsv2(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_dgtsv2(intptr_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;
  __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_backends/cuda/libs/cusparse.pyx":4218
 *         intptr_t handle, int m, int n, size_t dl, size_t d, size_t du,
 *         size_t B, int ldb, size_t pBuffer) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseDgtsv2(<cusparseHandle_t>handle, m, n,
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4218, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":4219
 *         size_t B, int ldb, size_t pBuffer) except *:
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseDgtsv2(<cusparseHandle_t>handle, m, n,
 *                                 <const double*>dl, <const double*>d,
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "cupy_backends/cuda/libs/cusparse.pyx":4220
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":4219
 *         size_t B, int ldb, size_t pBuffer) except *:
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseDgtsv2(<cusparseHandle_t>handle, m, n,
 *                                 <const double*>dl, <const double*>d,
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy_backends/cuda/libs/cusparse.pyx":4224
 *                                 <const double*>du, <double*>B, ldb,
 *                                 <void*>pBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef void cgtsv2(
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4224, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":4215
 *     check_status(status)
 * 
 * cpdef void dgtsv2(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int n, size_t dl, size_t d, size_t du,
 *         size_t B, int ldb, size_t pBuffer) except *:
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.dgtsv2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_417dgtsv2(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_416dgtsv2, "dgtsv2(intptr_t handle, int m, int n, size_t dl, size_t d, size_t du, size_t B, int ldb, size_t pBuffer) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_417dgtsv2(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dgtsv2 (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_n,&__pyx_mstate_global->__pyx_n_u_dl,&__pyx_mstate_global->__pyx_n_u_d,&__pyx_mstate_global->__pyx_n_u_du,&__pyx_mstate_global->__pyx_n_u_B,&__pyx_mstate_global->__pyx_n_u_ldb,&__pyx_mstate_global->__pyx_n_u_pBuffer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 4215, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 4215, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 4215, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 4215, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 4215, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4215, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4215, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4215, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4215, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4215, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "dgtsv2", 0) < (0)) __PYX_ERR(0, 4215, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 9; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("dgtsv2", 1, 9, 9, i); __PYX_ERR(0, 4215, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 9)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4215, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4215, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4215, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4215, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4215, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 4215, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 4215, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 4215, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 4215, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4216, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4216, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4216, __pyx_L3_error)
    __pyx_v_dl = __Pyx_PyLong_As_size_t(values[3]); if (unlikely((__pyx_v_dl == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4216, __pyx_L3_error)
    __pyx_v_d = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_d == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4216, __pyx_L3_error)
    __pyx_v_du = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_du == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4216, __pyx_L3_error)
    __pyx_v_B = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_B == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4217, __pyx_L3_error)
    __pyx_v_ldb = __Pyx_PyLong_As_int(values[7]); if (unlikely((__pyx_v_ldb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4217, __pyx_L3_error)
    __pyx_v_pBuffer = __Pyx_PyLong_As_size_t(values[8]); if (unlikely((__pyx_v_pBuffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4217, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("dgtsv2", 1, 9, 9, __pyx_nargs); __PYX_ERR(0, 4215, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.dgtsv2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_416dgtsv2(__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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_416dgtsv2(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4215, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4215, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":4226
 *     check_status(status)
 * 
 * cpdef void cgtsv2(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int n, size_t dl, size_t d, size_t du,
 *         size_t B, int ldb, size_t pBuffer) except *:
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_419cgtsv2(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_cgtsv2(intptr_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;
  __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_backends/cuda/libs/cusparse.pyx":4229
 *         intptr_t handle, int m, int n, size_t dl, size_t d, size_t du,
 *         size_t B, int ldb, size_t pBuffer) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseCgtsv2(<cusparseHandle_t>handle, m, n,
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4229, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":4230
 *         size_t B, int ldb, size_t pBuffer) except *:
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseCgtsv2(<cusparseHandle_t>handle, m, n,
 *                                 <const cuComplex*>dl, <const cuComplex*>d,
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "cupy_backends/cuda/libs/cusparse.pyx":4231
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":4230
 *         size_t B, int ldb, size_t pBuffer) except *:
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseCgtsv2(<cusparseHandle_t>handle, m, n,
 *                                 <const cuComplex*>dl, <const cuComplex*>d,
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy_backends/cuda/libs/cusparse.pyx":4235
 *                                 <const cuComplex*>du, <cuComplex*>B, ldb,
 *                                 <void*>pBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef void zgtsv2(
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4235, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":4226
 *     check_status(status)
 * 
 * cpdef void cgtsv2(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int n, size_t dl, size_t d, size_t du,
 *         size_t B, int ldb, size_t pBuffer) except *:
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.cgtsv2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_419cgtsv2(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_418cgtsv2, "cgtsv2(intptr_t handle, int m, int n, size_t dl, size_t d, size_t du, size_t B, int ldb, size_t pBuffer) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_419cgtsv2(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("cgtsv2 (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_n,&__pyx_mstate_global->__pyx_n_u_dl,&__pyx_mstate_global->__pyx_n_u_d,&__pyx_mstate_global->__pyx_n_u_du,&__pyx_mstate_global->__pyx_n_u_B,&__pyx_mstate_global->__pyx_n_u_ldb,&__pyx_mstate_global->__pyx_n_u_pBuffer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 4226, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 4226, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 4226, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 4226, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 4226, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4226, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4226, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4226, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4226, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4226, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "cgtsv2", 0) < (0)) __PYX_ERR(0, 4226, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 9; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("cgtsv2", 1, 9, 9, i); __PYX_ERR(0, 4226, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 9)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4226, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4226, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4226, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4226, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4226, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 4226, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 4226, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 4226, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 4226, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4227, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4227, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4227, __pyx_L3_error)
    __pyx_v_dl = __Pyx_PyLong_As_size_t(values[3]); if (unlikely((__pyx_v_dl == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4227, __pyx_L3_error)
    __pyx_v_d = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_d == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4227, __pyx_L3_error)
    __pyx_v_du = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_du == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4227, __pyx_L3_error)
    __pyx_v_B = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_B == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4228, __pyx_L3_error)
    __pyx_v_ldb = __Pyx_PyLong_As_int(values[7]); if (unlikely((__pyx_v_ldb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4228, __pyx_L3_error)
    __pyx_v_pBuffer = __Pyx_PyLong_As_size_t(values[8]); if (unlikely((__pyx_v_pBuffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4228, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("cgtsv2", 1, 9, 9, __pyx_nargs); __PYX_ERR(0, 4226, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.cgtsv2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_418cgtsv2(__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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_418cgtsv2(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4226, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4226, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":4237
 *     check_status(status)
 * 
 * cpdef void zgtsv2(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int n, size_t dl, size_t d, size_t du,
 *         size_t B, int ldb, size_t pBuffer) except *:
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_421zgtsv2(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_zgtsv2(intptr_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;
  __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_backends/cuda/libs/cusparse.pyx":4240
 *         intptr_t handle, int m, int n, size_t dl, size_t d, size_t du,
 *         size_t B, int ldb, size_t pBuffer) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseZgtsv2(
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4240, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":4241
 *         size_t B, int ldb, size_t pBuffer) except *:
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseZgtsv2(
 *             <cusparseHandle_t>handle, m, n, <const cuDoubleComplex*>dl,
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "cupy_backends/cuda/libs/cusparse.pyx":4242
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":4241
 *         size_t B, int ldb, size_t pBuffer) except *:
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseZgtsv2(
 *             <cusparseHandle_t>handle, m, n, <const cuDoubleComplex*>dl,
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy_backends/cuda/libs/cusparse.pyx":4246
 *             <const cuDoubleComplex*>d, <const cuDoubleComplex*>du,
 *             <cuDoubleComplex*>B, ldb, <void*>pBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef size_t sgtsv2_nopivot_bufferSizeExt(
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4246, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":4237
 *     check_status(status)
 * 
 * cpdef void zgtsv2(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int n, size_t dl, size_t d, size_t du,
 *         size_t B, int ldb, size_t pBuffer) except *:
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.zgtsv2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_421zgtsv2(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_420zgtsv2, "zgtsv2(intptr_t handle, int m, int n, size_t dl, size_t d, size_t du, size_t B, int ldb, size_t pBuffer) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_421zgtsv2(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("zgtsv2 (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_n,&__pyx_mstate_global->__pyx_n_u_dl,&__pyx_mstate_global->__pyx_n_u_d,&__pyx_mstate_global->__pyx_n_u_du,&__pyx_mstate_global->__pyx_n_u_B,&__pyx_mstate_global->__pyx_n_u_ldb,&__pyx_mstate_global->__pyx_n_u_pBuffer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 4237, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 4237, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 4237, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 4237, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 4237, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4237, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4237, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4237, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4237, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4237, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "zgtsv2", 0) < (0)) __PYX_ERR(0, 4237, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 9; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("zgtsv2", 1, 9, 9, i); __PYX_ERR(0, 4237, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 9)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4237, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4237, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4237, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4237, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4237, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 4237, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 4237, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 4237, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 4237, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4238, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4238, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4238, __pyx_L3_error)
    __pyx_v_dl = __Pyx_PyLong_As_size_t(values[3]); if (unlikely((__pyx_v_dl == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4238, __pyx_L3_error)
    __pyx_v_d = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_d == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4238, __pyx_L3_error)
    __pyx_v_du = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_du == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4238, __pyx_L3_error)
    __pyx_v_B = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_B == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4239, __pyx_L3_error)
    __pyx_v_ldb = __Pyx_PyLong_As_int(values[7]); if (unlikely((__pyx_v_ldb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4239, __pyx_L3_error)
    __pyx_v_pBuffer = __Pyx_PyLong_As_size_t(values[8]); if (unlikely((__pyx_v_pBuffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4239, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("zgtsv2", 1, 9, 9, __pyx_nargs); __PYX_ERR(0, 4237, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.zgtsv2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_420zgtsv2(__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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_420zgtsv2(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4237, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4237, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":4248
 *     check_status(status)
 * 
 * cpdef size_t sgtsv2_nopivot_bufferSizeExt(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int n, size_t dl,
 *         size_t d, size_t du, size_t B, int ldb) except? -1:
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_423sgtsv2_nopivot_bufferSizeExt(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static size_t __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_sgtsv2_nopivot_bufferSizeExt(intptr_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, 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("sgtsv2_nopivot_bufferSizeExt", 0);

  /* "cupy_backends/cuda/libs/cusparse.pyx":4252
 *         size_t d, size_t du, size_t B, int ldb) except? -1:
 *     cdef size_t pBufferSizeInBytes
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseSgtsv2_nopivot_bufferSizeExt(
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4252, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":4253
 *     cdef size_t pBufferSizeInBytes
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseSgtsv2_nopivot_bufferSizeExt(
 *             <cusparseHandle_t>handle, m, n, <const float*>dl, <const float*>d,
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "cupy_backends/cuda/libs/cusparse.pyx":4254
 *     _setStream(handle)
 *     with nogil:
 *         status = cusparseSgtsv2_nopivot_bufferSizeExt(             # <<<<<<<<<<<<<<
 *             <cusparseHandle_t>handle, m, n, <const float*>dl, <const float*>d,
 *             <const float*>du, <const float*>B, ldb, &pBufferSizeInBytes)
*/
        __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, (&__pyx_v_pBufferSizeInBytes));
      }

      /* "cupy_backends/cuda/libs/cusparse.pyx":4253
 *     cdef size_t pBufferSizeInBytes
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseSgtsv2_nopivot_bufferSizeExt(
 *             <cusparseHandle_t>handle, m, n, <const float*>dl, <const float*>d,
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy_backends/cuda/libs/cusparse.pyx":4257
 *             <cusparseHandle_t>handle, m, n, <const float*>dl, <const float*>d,
 *             <const float*>du, <const float*>B, ldb, &pBufferSizeInBytes)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return pBufferSizeInBytes
 * 
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4257, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":4258
 *             <const float*>du, <const float*>B, ldb, &pBufferSizeInBytes)
 *     check_status(status)
 *     return pBufferSizeInBytes             # <<<<<<<<<<<<<<
 * 
 * cpdef size_t dgtsv2_nopivot_bufferSizeExt(
*/
  __pyx_r = __pyx_v_pBufferSizeInBytes;
  goto __pyx_L0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":4248
 *     check_status(status)
 * 
 * cpdef size_t sgtsv2_nopivot_bufferSizeExt(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int n, size_t dl,
 *         size_t d, size_t du, size_t B, int ldb) except? -1:
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.sgtsv2_nopivot_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1L;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_423sgtsv2_nopivot_bufferSizeExt(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_422sgtsv2_nopivot_bufferSizeExt, "sgtsv2_nopivot_bufferSizeExt(intptr_t handle, int m, int n, size_t dl, size_t d, size_t du, size_t B, int ldb) -> size_t");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_423sgtsv2_nopivot_bufferSizeExt(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[8] = {0,0,0,0,0,0,0,0};
  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);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_n,&__pyx_mstate_global->__pyx_n_u_dl,&__pyx_mstate_global->__pyx_n_u_d,&__pyx_mstate_global->__pyx_n_u_du,&__pyx_mstate_global->__pyx_n_u_B,&__pyx_mstate_global->__pyx_n_u_ldb,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 4248, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 4248, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 4248, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 4248, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4248, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4248, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4248, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4248, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4248, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "sgtsv2_nopivot_bufferSizeExt", 0) < (0)) __PYX_ERR(0, 4248, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 8; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("sgtsv2_nopivot_bufferSizeExt", 1, 8, 8, i); __PYX_ERR(0, 4248, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 8)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4248, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4248, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4248, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4248, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4248, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 4248, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 4248, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 4248, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4249, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4249, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4249, __pyx_L3_error)
    __pyx_v_dl = __Pyx_PyLong_As_size_t(values[3]); if (unlikely((__pyx_v_dl == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4249, __pyx_L3_error)
    __pyx_v_d = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_d == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4250, __pyx_L3_error)
    __pyx_v_du = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_du == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4250, __pyx_L3_error)
    __pyx_v_B = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_B == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4250, __pyx_L3_error)
    __pyx_v_ldb = __Pyx_PyLong_As_int(values[7]); if (unlikely((__pyx_v_ldb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4250, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("sgtsv2_nopivot_bufferSizeExt", 1, 8, 8, __pyx_nargs); __PYX_ERR(0, 4248, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.sgtsv2_nopivot_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_422sgtsv2_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);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_422sgtsv2_nopivot_bufferSizeExt(CYTHON_UNUSED PyObject *__pyx_self, intptr_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) {
  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("sgtsv2_nopivot_bufferSizeExt", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(__pyx_t_1 == ((size_t)-1L) && PyErr_Occurred())) __PYX_ERR(0, 4248, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyLong_FromSize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4248, __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_backends.cuda.libs.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_backends/cuda/libs/cusparse.pyx":4260
 *     return pBufferSizeInBytes
 * 
 * cpdef size_t dgtsv2_nopivot_bufferSizeExt(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int n, size_t dl,
 *         size_t d, size_t du, size_t B, int ldb) except? -1:
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_425dgtsv2_nopivot_bufferSizeExt(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static size_t __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_dgtsv2_nopivot_bufferSizeExt(intptr_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, 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("dgtsv2_nopivot_bufferSizeExt", 0);

  /* "cupy_backends/cuda/libs/cusparse.pyx":4264
 *         size_t d, size_t du, size_t B, int ldb) except? -1:
 *     cdef size_t pBufferSizeInBytes
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseDgtsv2_nopivot_bufferSizeExt(
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4264, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":4265
 *     cdef size_t pBufferSizeInBytes
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseDgtsv2_nopivot_bufferSizeExt(
 *             <cusparseHandle_t>handle, m, n, <const double*>dl,
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "cupy_backends/cuda/libs/cusparse.pyx":4266
 *     _setStream(handle)
 *     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, (&__pyx_v_pBufferSizeInBytes));
      }

      /* "cupy_backends/cuda/libs/cusparse.pyx":4265
 *     cdef size_t pBufferSizeInBytes
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseDgtsv2_nopivot_bufferSizeExt(
 *             <cusparseHandle_t>handle, m, n, <const double*>dl,
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy_backends/cuda/libs/cusparse.pyx":4270
 *             <const double*>d, <const double*>du, <const double*>B, ldb,
 *             &pBufferSizeInBytes)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return pBufferSizeInBytes
 * 
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4270, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":4271
 *             &pBufferSizeInBytes)
 *     check_status(status)
 *     return pBufferSizeInBytes             # <<<<<<<<<<<<<<
 * 
 * cpdef size_t cgtsv2_nopivot_bufferSizeExt(
*/
  __pyx_r = __pyx_v_pBufferSizeInBytes;
  goto __pyx_L0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":4260
 *     return pBufferSizeInBytes
 * 
 * cpdef size_t dgtsv2_nopivot_bufferSizeExt(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int n, size_t dl,
 *         size_t d, size_t du, size_t B, int ldb) except? -1:
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.dgtsv2_nopivot_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1L;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_425dgtsv2_nopivot_bufferSizeExt(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_424dgtsv2_nopivot_bufferSizeExt, "dgtsv2_nopivot_bufferSizeExt(intptr_t handle, int m, int n, size_t dl, size_t d, size_t du, size_t B, int ldb) -> size_t");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_425dgtsv2_nopivot_bufferSizeExt(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[8] = {0,0,0,0,0,0,0,0};
  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);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_n,&__pyx_mstate_global->__pyx_n_u_dl,&__pyx_mstate_global->__pyx_n_u_d,&__pyx_mstate_global->__pyx_n_u_du,&__pyx_mstate_global->__pyx_n_u_B,&__pyx_mstate_global->__pyx_n_u_ldb,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 4260, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 4260, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 4260, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 4260, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4260, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4260, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4260, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4260, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4260, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "dgtsv2_nopivot_bufferSizeExt", 0) < (0)) __PYX_ERR(0, 4260, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 8; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("dgtsv2_nopivot_bufferSizeExt", 1, 8, 8, i); __PYX_ERR(0, 4260, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 8)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4260, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4260, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4260, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4260, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4260, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 4260, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 4260, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 4260, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4261, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4261, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4261, __pyx_L3_error)
    __pyx_v_dl = __Pyx_PyLong_As_size_t(values[3]); if (unlikely((__pyx_v_dl == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4261, __pyx_L3_error)
    __pyx_v_d = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_d == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4262, __pyx_L3_error)
    __pyx_v_du = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_du == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4262, __pyx_L3_error)
    __pyx_v_B = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_B == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4262, __pyx_L3_error)
    __pyx_v_ldb = __Pyx_PyLong_As_int(values[7]); if (unlikely((__pyx_v_ldb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4262, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("dgtsv2_nopivot_bufferSizeExt", 1, 8, 8, __pyx_nargs); __PYX_ERR(0, 4260, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.dgtsv2_nopivot_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_424dgtsv2_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);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_424dgtsv2_nopivot_bufferSizeExt(CYTHON_UNUSED PyObject *__pyx_self, intptr_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) {
  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("dgtsv2_nopivot_bufferSizeExt", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(__pyx_t_1 == ((size_t)-1L) && PyErr_Occurred())) __PYX_ERR(0, 4260, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyLong_FromSize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4260, __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_backends.cuda.libs.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_backends/cuda/libs/cusparse.pyx":4273
 *     return pBufferSizeInBytes
 * 
 * cpdef size_t cgtsv2_nopivot_bufferSizeExt(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int n, size_t dl,
 *         size_t d, size_t du, size_t B, int ldb) except? -1:
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_427cgtsv2_nopivot_bufferSizeExt(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static size_t __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_cgtsv2_nopivot_bufferSizeExt(intptr_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, 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("cgtsv2_nopivot_bufferSizeExt", 0);

  /* "cupy_backends/cuda/libs/cusparse.pyx":4277
 *         size_t d, size_t du, size_t B, int ldb) except? -1:
 *     cdef size_t pBufferSizeInBytes
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseCgtsv2_nopivot_bufferSizeExt(
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4277, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":4278
 *     cdef size_t pBufferSizeInBytes
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseCgtsv2_nopivot_bufferSizeExt(
 *             <cusparseHandle_t>handle, m, n, <const cuComplex*>dl,
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "cupy_backends/cuda/libs/cusparse.pyx":4279
 *     _setStream(handle)
 *     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, (&__pyx_v_pBufferSizeInBytes));
      }

      /* "cupy_backends/cuda/libs/cusparse.pyx":4278
 *     cdef size_t pBufferSizeInBytes
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseCgtsv2_nopivot_bufferSizeExt(
 *             <cusparseHandle_t>handle, m, n, <const cuComplex*>dl,
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy_backends/cuda/libs/cusparse.pyx":4283
 *             <const cuComplex*>d, <const cuComplex*>du, <const cuComplex*>B,
 *             ldb, &pBufferSizeInBytes)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return pBufferSizeInBytes
 * 
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4283, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":4284
 *             ldb, &pBufferSizeInBytes)
 *     check_status(status)
 *     return pBufferSizeInBytes             # <<<<<<<<<<<<<<
 * 
 * cpdef size_t zgtsv2_nopivot_bufferSizeExt(
*/
  __pyx_r = __pyx_v_pBufferSizeInBytes;
  goto __pyx_L0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":4273
 *     return pBufferSizeInBytes
 * 
 * cpdef size_t cgtsv2_nopivot_bufferSizeExt(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int n, size_t dl,
 *         size_t d, size_t du, size_t B, int ldb) except? -1:
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.cgtsv2_nopivot_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1L;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_427cgtsv2_nopivot_bufferSizeExt(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_426cgtsv2_nopivot_bufferSizeExt, "cgtsv2_nopivot_bufferSizeExt(intptr_t handle, int m, int n, size_t dl, size_t d, size_t du, size_t B, int ldb) -> size_t");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_427cgtsv2_nopivot_bufferSizeExt(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[8] = {0,0,0,0,0,0,0,0};
  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);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_n,&__pyx_mstate_global->__pyx_n_u_dl,&__pyx_mstate_global->__pyx_n_u_d,&__pyx_mstate_global->__pyx_n_u_du,&__pyx_mstate_global->__pyx_n_u_B,&__pyx_mstate_global->__pyx_n_u_ldb,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 4273, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 4273, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 4273, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 4273, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4273, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4273, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4273, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4273, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4273, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "cgtsv2_nopivot_bufferSizeExt", 0) < (0)) __PYX_ERR(0, 4273, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 8; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("cgtsv2_nopivot_bufferSizeExt", 1, 8, 8, i); __PYX_ERR(0, 4273, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 8)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4273, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4273, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4273, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4273, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4273, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 4273, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 4273, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 4273, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4274, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4274, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4274, __pyx_L3_error)
    __pyx_v_dl = __Pyx_PyLong_As_size_t(values[3]); if (unlikely((__pyx_v_dl == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4274, __pyx_L3_error)
    __pyx_v_d = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_d == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4275, __pyx_L3_error)
    __pyx_v_du = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_du == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4275, __pyx_L3_error)
    __pyx_v_B = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_B == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4275, __pyx_L3_error)
    __pyx_v_ldb = __Pyx_PyLong_As_int(values[7]); if (unlikely((__pyx_v_ldb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4275, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("cgtsv2_nopivot_bufferSizeExt", 1, 8, 8, __pyx_nargs); __PYX_ERR(0, 4273, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.cgtsv2_nopivot_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_426cgtsv2_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);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_426cgtsv2_nopivot_bufferSizeExt(CYTHON_UNUSED PyObject *__pyx_self, intptr_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) {
  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("cgtsv2_nopivot_bufferSizeExt", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(__pyx_t_1 == ((size_t)-1L) && PyErr_Occurred())) __PYX_ERR(0, 4273, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyLong_FromSize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4273, __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_backends.cuda.libs.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_backends/cuda/libs/cusparse.pyx":4286
 *     return pBufferSizeInBytes
 * 
 * cpdef size_t zgtsv2_nopivot_bufferSizeExt(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int n, size_t dl,
 *         size_t d, size_t du, size_t B, int ldb) except? -1:
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_429zgtsv2_nopivot_bufferSizeExt(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static size_t __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_zgtsv2_nopivot_bufferSizeExt(intptr_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, 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("zgtsv2_nopivot_bufferSizeExt", 0);

  /* "cupy_backends/cuda/libs/cusparse.pyx":4290
 *         size_t d, size_t du, size_t B, int ldb) except? -1:
 *     cdef size_t pBufferSizeInBytes
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseZgtsv2_nopivot_bufferSizeExt(
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4290, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":4291
 *     cdef size_t pBufferSizeInBytes
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseZgtsv2_nopivot_bufferSizeExt(
 *             <cusparseHandle_t>handle, m, n, <const cuDoubleComplex*>dl,
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "cupy_backends/cuda/libs/cusparse.pyx":4292
 *     _setStream(handle)
 *     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, (&__pyx_v_pBufferSizeInBytes));
      }

      /* "cupy_backends/cuda/libs/cusparse.pyx":4291
 *     cdef size_t pBufferSizeInBytes
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseZgtsv2_nopivot_bufferSizeExt(
 *             <cusparseHandle_t>handle, m, n, <const cuDoubleComplex*>dl,
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy_backends/cuda/libs/cusparse.pyx":4296
 *             <const cuDoubleComplex*>d, <const cuDoubleComplex*>du,
 *             <const cuDoubleComplex*>B, ldb, &pBufferSizeInBytes)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return pBufferSizeInBytes
 * 
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4296, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":4297
 *             <const cuDoubleComplex*>B, ldb, &pBufferSizeInBytes)
 *     check_status(status)
 *     return pBufferSizeInBytes             # <<<<<<<<<<<<<<
 * 
 * cpdef void sgtsv2_nopivot(
*/
  __pyx_r = __pyx_v_pBufferSizeInBytes;
  goto __pyx_L0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":4286
 *     return pBufferSizeInBytes
 * 
 * cpdef size_t zgtsv2_nopivot_bufferSizeExt(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int n, size_t dl,
 *         size_t d, size_t du, size_t B, int ldb) except? -1:
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.zgtsv2_nopivot_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1L;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_429zgtsv2_nopivot_bufferSizeExt(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_428zgtsv2_nopivot_bufferSizeExt, "zgtsv2_nopivot_bufferSizeExt(intptr_t handle, int m, int n, size_t dl, size_t d, size_t du, size_t B, int ldb) -> size_t");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_429zgtsv2_nopivot_bufferSizeExt(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[8] = {0,0,0,0,0,0,0,0};
  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);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_n,&__pyx_mstate_global->__pyx_n_u_dl,&__pyx_mstate_global->__pyx_n_u_d,&__pyx_mstate_global->__pyx_n_u_du,&__pyx_mstate_global->__pyx_n_u_B,&__pyx_mstate_global->__pyx_n_u_ldb,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 4286, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 4286, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 4286, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 4286, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4286, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4286, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4286, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4286, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4286, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "zgtsv2_nopivot_bufferSizeExt", 0) < (0)) __PYX_ERR(0, 4286, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 8; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("zgtsv2_nopivot_bufferSizeExt", 1, 8, 8, i); __PYX_ERR(0, 4286, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 8)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4286, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4286, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4286, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4286, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4286, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 4286, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 4286, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 4286, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4287, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4287, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4287, __pyx_L3_error)
    __pyx_v_dl = __Pyx_PyLong_As_size_t(values[3]); if (unlikely((__pyx_v_dl == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4287, __pyx_L3_error)
    __pyx_v_d = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_d == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4288, __pyx_L3_error)
    __pyx_v_du = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_du == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4288, __pyx_L3_error)
    __pyx_v_B = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_B == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4288, __pyx_L3_error)
    __pyx_v_ldb = __Pyx_PyLong_As_int(values[7]); if (unlikely((__pyx_v_ldb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4288, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("zgtsv2_nopivot_bufferSizeExt", 1, 8, 8, __pyx_nargs); __PYX_ERR(0, 4286, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.zgtsv2_nopivot_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_428zgtsv2_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);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_428zgtsv2_nopivot_bufferSizeExt(CYTHON_UNUSED PyObject *__pyx_self, intptr_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) {
  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("zgtsv2_nopivot_bufferSizeExt", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(__pyx_t_1 == ((size_t)-1L) && PyErr_Occurred())) __PYX_ERR(0, 4286, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyLong_FromSize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4286, __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_backends.cuda.libs.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_backends/cuda/libs/cusparse.pyx":4299
 *     return pBufferSizeInBytes
 * 
 * cpdef void sgtsv2_nopivot(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int n, size_t dl, size_t d,
 *         size_t du, size_t B, int ldb, size_t pBuffer) except *:
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_431sgtsv2_nopivot(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_sgtsv2_nopivot(intptr_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;
  __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_backends/cuda/libs/cusparse.pyx":4302
 *         intptr_t handle, int m, int n, size_t dl, size_t d,
 *         size_t du, size_t B, int ldb, size_t pBuffer) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseSgtsv2_nopivot(
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4302, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":4303
 *         size_t du, size_t B, int ldb, size_t pBuffer) except *:
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseSgtsv2_nopivot(
 *             <cusparseHandle_t>handle, m, n, <const float*>dl, <const float*>d,
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "cupy_backends/cuda/libs/cusparse.pyx":4304
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":4303
 *         size_t du, size_t B, int ldb, size_t pBuffer) except *:
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseSgtsv2_nopivot(
 *             <cusparseHandle_t>handle, m, n, <const float*>dl, <const float*>d,
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy_backends/cuda/libs/cusparse.pyx":4307
 *             <cusparseHandle_t>handle, m, n, <const float*>dl, <const float*>d,
 *             <const float*>du, <float*>B, ldb, <void*>pBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef void dgtsv2_nopivot(
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4307, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":4299
 *     return pBufferSizeInBytes
 * 
 * cpdef void sgtsv2_nopivot(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int n, size_t dl, size_t d,
 *         size_t du, size_t B, int ldb, size_t pBuffer) except *:
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.sgtsv2_nopivot", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_431sgtsv2_nopivot(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_430sgtsv2_nopivot, "sgtsv2_nopivot(intptr_t handle, int m, int n, size_t dl, size_t d, size_t du, size_t B, int ldb, size_t pBuffer) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_431sgtsv2_nopivot(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
  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);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_n,&__pyx_mstate_global->__pyx_n_u_dl,&__pyx_mstate_global->__pyx_n_u_d,&__pyx_mstate_global->__pyx_n_u_du,&__pyx_mstate_global->__pyx_n_u_B,&__pyx_mstate_global->__pyx_n_u_ldb,&__pyx_mstate_global->__pyx_n_u_pBuffer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 4299, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 4299, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 4299, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 4299, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 4299, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4299, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4299, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4299, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4299, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4299, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "sgtsv2_nopivot", 0) < (0)) __PYX_ERR(0, 4299, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 9; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("sgtsv2_nopivot", 1, 9, 9, i); __PYX_ERR(0, 4299, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 9)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4299, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4299, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4299, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4299, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4299, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 4299, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 4299, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 4299, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 4299, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4300, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4300, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4300, __pyx_L3_error)
    __pyx_v_dl = __Pyx_PyLong_As_size_t(values[3]); if (unlikely((__pyx_v_dl == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4300, __pyx_L3_error)
    __pyx_v_d = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_d == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4300, __pyx_L3_error)
    __pyx_v_du = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_du == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4301, __pyx_L3_error)
    __pyx_v_B = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_B == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4301, __pyx_L3_error)
    __pyx_v_ldb = __Pyx_PyLong_As_int(values[7]); if (unlikely((__pyx_v_ldb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4301, __pyx_L3_error)
    __pyx_v_pBuffer = __Pyx_PyLong_As_size_t(values[8]); if (unlikely((__pyx_v_pBuffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4301, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("sgtsv2_nopivot", 1, 9, 9, __pyx_nargs); __PYX_ERR(0, 4299, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.sgtsv2_nopivot", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_430sgtsv2_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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_430sgtsv2_nopivot(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4299, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4299, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":4309
 *     check_status(status)
 * 
 * cpdef void dgtsv2_nopivot(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int n, size_t dl, size_t d,
 *         size_t du, size_t B, int ldb, size_t pBuffer) except *:
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_433dgtsv2_nopivot(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_dgtsv2_nopivot(intptr_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;
  __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_backends/cuda/libs/cusparse.pyx":4312
 *         intptr_t handle, int m, int n, size_t dl, size_t d,
 *         size_t du, size_t B, int ldb, size_t pBuffer) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseDgtsv2_nopivot(<cusparseHandle_t>handle, m, n,
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4312, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":4313
 *         size_t du, size_t B, int ldb, size_t pBuffer) except *:
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseDgtsv2_nopivot(<cusparseHandle_t>handle, m, n,
 *                                         <const double*>dl, <const double*>d,
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "cupy_backends/cuda/libs/cusparse.pyx":4314
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":4313
 *         size_t du, size_t B, int ldb, size_t pBuffer) except *:
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseDgtsv2_nopivot(<cusparseHandle_t>handle, m, n,
 *                                         <const double*>dl, <const double*>d,
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy_backends/cuda/libs/cusparse.pyx":4318
 *                                         <const double*>du, <double*>B, ldb,
 *                                         <void*>pBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef void cgtsv2_nopivot(
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4318, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":4309
 *     check_status(status)
 * 
 * cpdef void dgtsv2_nopivot(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int n, size_t dl, size_t d,
 *         size_t du, size_t B, int ldb, size_t pBuffer) except *:
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.dgtsv2_nopivot", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_433dgtsv2_nopivot(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_432dgtsv2_nopivot, "dgtsv2_nopivot(intptr_t handle, int m, int n, size_t dl, size_t d, size_t du, size_t B, int ldb, size_t pBuffer) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_433dgtsv2_nopivot(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
  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);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_n,&__pyx_mstate_global->__pyx_n_u_dl,&__pyx_mstate_global->__pyx_n_u_d,&__pyx_mstate_global->__pyx_n_u_du,&__pyx_mstate_global->__pyx_n_u_B,&__pyx_mstate_global->__pyx_n_u_ldb,&__pyx_mstate_global->__pyx_n_u_pBuffer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 4309, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 4309, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 4309, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 4309, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 4309, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4309, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4309, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4309, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4309, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4309, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "dgtsv2_nopivot", 0) < (0)) __PYX_ERR(0, 4309, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 9; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("dgtsv2_nopivot", 1, 9, 9, i); __PYX_ERR(0, 4309, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 9)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4309, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4309, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4309, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4309, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4309, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 4309, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 4309, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 4309, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 4309, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4310, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4310, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4310, __pyx_L3_error)
    __pyx_v_dl = __Pyx_PyLong_As_size_t(values[3]); if (unlikely((__pyx_v_dl == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4310, __pyx_L3_error)
    __pyx_v_d = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_d == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4310, __pyx_L3_error)
    __pyx_v_du = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_du == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4311, __pyx_L3_error)
    __pyx_v_B = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_B == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4311, __pyx_L3_error)
    __pyx_v_ldb = __Pyx_PyLong_As_int(values[7]); if (unlikely((__pyx_v_ldb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4311, __pyx_L3_error)
    __pyx_v_pBuffer = __Pyx_PyLong_As_size_t(values[8]); if (unlikely((__pyx_v_pBuffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4311, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("dgtsv2_nopivot", 1, 9, 9, __pyx_nargs); __PYX_ERR(0, 4309, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.dgtsv2_nopivot", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_432dgtsv2_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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_432dgtsv2_nopivot(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4309, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4309, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":4320
 *     check_status(status)
 * 
 * cpdef void cgtsv2_nopivot(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int n, size_t dl, size_t d,
 *         size_t du, size_t B, int ldb, size_t pBuffer) except *:
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_435cgtsv2_nopivot(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_cgtsv2_nopivot(intptr_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;
  __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_backends/cuda/libs/cusparse.pyx":4323
 *         intptr_t handle, int m, int n, size_t dl, size_t d,
 *         size_t du, size_t B, int ldb, size_t pBuffer) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseCgtsv2_nopivot(
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4323, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":4324
 *         size_t du, size_t B, int ldb, size_t pBuffer) except *:
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseCgtsv2_nopivot(
 *             <cusparseHandle_t>handle, m, n, <const cuComplex*>dl,
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "cupy_backends/cuda/libs/cusparse.pyx":4325
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":4324
 *         size_t du, size_t B, int ldb, size_t pBuffer) except *:
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseCgtsv2_nopivot(
 *             <cusparseHandle_t>handle, m, n, <const cuComplex*>dl,
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy_backends/cuda/libs/cusparse.pyx":4329
 *             <const cuComplex*>d, <const cuComplex*>du, <cuComplex*>B, ldb,
 *             <void*>pBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef void zgtsv2_nopivot(
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4329, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":4320
 *     check_status(status)
 * 
 * cpdef void cgtsv2_nopivot(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int n, size_t dl, size_t d,
 *         size_t du, size_t B, int ldb, size_t pBuffer) except *:
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.cgtsv2_nopivot", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_435cgtsv2_nopivot(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_434cgtsv2_nopivot, "cgtsv2_nopivot(intptr_t handle, int m, int n, size_t dl, size_t d, size_t du, size_t B, int ldb, size_t pBuffer) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_435cgtsv2_nopivot(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
  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);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_n,&__pyx_mstate_global->__pyx_n_u_dl,&__pyx_mstate_global->__pyx_n_u_d,&__pyx_mstate_global->__pyx_n_u_du,&__pyx_mstate_global->__pyx_n_u_B,&__pyx_mstate_global->__pyx_n_u_ldb,&__pyx_mstate_global->__pyx_n_u_pBuffer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 4320, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 4320, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 4320, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 4320, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 4320, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4320, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4320, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4320, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4320, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4320, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "cgtsv2_nopivot", 0) < (0)) __PYX_ERR(0, 4320, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 9; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("cgtsv2_nopivot", 1, 9, 9, i); __PYX_ERR(0, 4320, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 9)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4320, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4320, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4320, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4320, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4320, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 4320, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 4320, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 4320, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 4320, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4321, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4321, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4321, __pyx_L3_error)
    __pyx_v_dl = __Pyx_PyLong_As_size_t(values[3]); if (unlikely((__pyx_v_dl == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4321, __pyx_L3_error)
    __pyx_v_d = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_d == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4321, __pyx_L3_error)
    __pyx_v_du = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_du == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4322, __pyx_L3_error)
    __pyx_v_B = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_B == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4322, __pyx_L3_error)
    __pyx_v_ldb = __Pyx_PyLong_As_int(values[7]); if (unlikely((__pyx_v_ldb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4322, __pyx_L3_error)
    __pyx_v_pBuffer = __Pyx_PyLong_As_size_t(values[8]); if (unlikely((__pyx_v_pBuffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4322, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("cgtsv2_nopivot", 1, 9, 9, __pyx_nargs); __PYX_ERR(0, 4320, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.cgtsv2_nopivot", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_434cgtsv2_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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_434cgtsv2_nopivot(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4320, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4320, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":4331
 *     check_status(status)
 * 
 * cpdef void zgtsv2_nopivot(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int n, size_t dl, size_t d,
 *         size_t du, size_t B, int ldb, size_t pBuffer) except *:
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_437zgtsv2_nopivot(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_zgtsv2_nopivot(intptr_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;
  __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_backends/cuda/libs/cusparse.pyx":4334
 *         intptr_t handle, int m, int n, size_t dl, size_t d,
 *         size_t du, size_t B, int ldb, size_t pBuffer) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseZgtsv2_nopivot(
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4334, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":4335
 *         size_t du, size_t B, int ldb, size_t pBuffer) except *:
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseZgtsv2_nopivot(
 *             <cusparseHandle_t>handle, m, n, <const cuDoubleComplex*>dl,
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "cupy_backends/cuda/libs/cusparse.pyx":4336
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":4335
 *         size_t du, size_t B, int ldb, size_t pBuffer) except *:
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseZgtsv2_nopivot(
 *             <cusparseHandle_t>handle, m, n, <const cuDoubleComplex*>dl,
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy_backends/cuda/libs/cusparse.pyx":4340
 *             <const cuDoubleComplex*>d, <const cuDoubleComplex*>du,
 *             <cuDoubleComplex*>B, ldb, <void*>pBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef size_t sgtsv2StridedBatch_bufferSizeExt(
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4340, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":4331
 *     check_status(status)
 * 
 * cpdef void zgtsv2_nopivot(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int n, size_t dl, size_t d,
 *         size_t du, size_t B, int ldb, size_t pBuffer) except *:
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.zgtsv2_nopivot", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_437zgtsv2_nopivot(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_436zgtsv2_nopivot, "zgtsv2_nopivot(intptr_t handle, int m, int n, size_t dl, size_t d, size_t du, size_t B, int ldb, size_t pBuffer) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_437zgtsv2_nopivot(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
  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);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_n,&__pyx_mstate_global->__pyx_n_u_dl,&__pyx_mstate_global->__pyx_n_u_d,&__pyx_mstate_global->__pyx_n_u_du,&__pyx_mstate_global->__pyx_n_u_B,&__pyx_mstate_global->__pyx_n_u_ldb,&__pyx_mstate_global->__pyx_n_u_pBuffer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 4331, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 4331, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 4331, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 4331, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 4331, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4331, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4331, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4331, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4331, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4331, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "zgtsv2_nopivot", 0) < (0)) __PYX_ERR(0, 4331, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 9; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("zgtsv2_nopivot", 1, 9, 9, i); __PYX_ERR(0, 4331, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 9)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4331, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4331, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4331, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4331, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4331, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 4331, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 4331, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 4331, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 4331, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4332, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4332, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4332, __pyx_L3_error)
    __pyx_v_dl = __Pyx_PyLong_As_size_t(values[3]); if (unlikely((__pyx_v_dl == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4332, __pyx_L3_error)
    __pyx_v_d = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_d == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4332, __pyx_L3_error)
    __pyx_v_du = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_du == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4333, __pyx_L3_error)
    __pyx_v_B = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_B == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4333, __pyx_L3_error)
    __pyx_v_ldb = __Pyx_PyLong_As_int(values[7]); if (unlikely((__pyx_v_ldb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4333, __pyx_L3_error)
    __pyx_v_pBuffer = __Pyx_PyLong_As_size_t(values[8]); if (unlikely((__pyx_v_pBuffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4333, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("zgtsv2_nopivot", 1, 9, 9, __pyx_nargs); __PYX_ERR(0, 4331, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.zgtsv2_nopivot", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_436zgtsv2_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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_436zgtsv2_nopivot(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4331, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4331, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":4342
 *     check_status(status)
 * 
 * cpdef size_t sgtsv2StridedBatch_bufferSizeExt(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, size_t dl, size_t d, size_t du, size_t x,
 *         int batchCount, int batchStride) except? -1:
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_439sgtsv2StridedBatch_bufferSizeExt(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static size_t __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_sgtsv2StridedBatch_bufferSizeExt(intptr_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, 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("sgtsv2StridedBatch_bufferSizeExt", 0);

  /* "cupy_backends/cuda/libs/cusparse.pyx":4346
 *         int batchCount, int batchStride) except? -1:
 *     cdef size_t bufferSizeInBytes
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseSgtsv2StridedBatch_bufferSizeExt(
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4346, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":4347
 *     cdef size_t bufferSizeInBytes
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseSgtsv2StridedBatch_bufferSizeExt(
 *             <cusparseHandle_t>handle, m, <const float*>dl, <const float*>d,
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "cupy_backends/cuda/libs/cusparse.pyx":4348
 *     _setStream(handle)
 *     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, (&__pyx_v_bufferSizeInBytes));
      }

      /* "cupy_backends/cuda/libs/cusparse.pyx":4347
 *     cdef size_t bufferSizeInBytes
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseSgtsv2StridedBatch_bufferSizeExt(
 *             <cusparseHandle_t>handle, m, <const float*>dl, <const float*>d,
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy_backends/cuda/libs/cusparse.pyx":4352
 *             <const float*>du, <const float*>x, batchCount, batchStride,
 *             &bufferSizeInBytes)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return bufferSizeInBytes
 * 
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4352, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":4353
 *             &bufferSizeInBytes)
 *     check_status(status)
 *     return bufferSizeInBytes             # <<<<<<<<<<<<<<
 * 
 * cpdef size_t dgtsv2StridedBatch_bufferSizeExt(
*/
  __pyx_r = __pyx_v_bufferSizeInBytes;
  goto __pyx_L0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":4342
 *     check_status(status)
 * 
 * cpdef size_t sgtsv2StridedBatch_bufferSizeExt(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, size_t dl, size_t d, size_t du, size_t x,
 *         int batchCount, int batchStride) except? -1:
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.sgtsv2StridedBatch_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1L;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_439sgtsv2StridedBatch_bufferSizeExt(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_438sgtsv2StridedBatch_bufferSizeExt, "sgtsv2StridedBatch_bufferSizeExt(intptr_t handle, int m, size_t dl, size_t d, size_t du, size_t x, int batchCount, int batchStride) -> size_t");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_439sgtsv2StridedBatch_bufferSizeExt(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[8] = {0,0,0,0,0,0,0,0};
  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);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_dl,&__pyx_mstate_global->__pyx_n_u_d,&__pyx_mstate_global->__pyx_n_u_du,&__pyx_mstate_global->__pyx_n_u_x,&__pyx_mstate_global->__pyx_n_u_batchCount,&__pyx_mstate_global->__pyx_n_u_batchStride,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 4342, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 4342, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 4342, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 4342, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4342, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4342, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4342, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4342, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4342, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "sgtsv2StridedBatch_bufferSizeExt", 0) < (0)) __PYX_ERR(0, 4342, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 8; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("sgtsv2StridedBatch_bufferSizeExt", 1, 8, 8, i); __PYX_ERR(0, 4342, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 8)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4342, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4342, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4342, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4342, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4342, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 4342, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 4342, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 4342, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4343, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4343, __pyx_L3_error)
    __pyx_v_dl = __Pyx_PyLong_As_size_t(values[2]); if (unlikely((__pyx_v_dl == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4343, __pyx_L3_error)
    __pyx_v_d = __Pyx_PyLong_As_size_t(values[3]); if (unlikely((__pyx_v_d == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4343, __pyx_L3_error)
    __pyx_v_du = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_du == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4343, __pyx_L3_error)
    __pyx_v_x = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_x == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4343, __pyx_L3_error)
    __pyx_v_batchCount = __Pyx_PyLong_As_int(values[6]); if (unlikely((__pyx_v_batchCount == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4344, __pyx_L3_error)
    __pyx_v_batchStride = __Pyx_PyLong_As_int(values[7]); if (unlikely((__pyx_v_batchStride == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4344, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("sgtsv2StridedBatch_bufferSizeExt", 1, 8, 8, __pyx_nargs); __PYX_ERR(0, 4342, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.sgtsv2StridedBatch_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_438sgtsv2StridedBatch_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);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_438sgtsv2StridedBatch_bufferSizeExt(CYTHON_UNUSED PyObject *__pyx_self, intptr_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) {
  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("sgtsv2StridedBatch_bufferSizeExt", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(__pyx_t_1 == ((size_t)-1L) && PyErr_Occurred())) __PYX_ERR(0, 4342, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyLong_FromSize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4342, __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_backends.cuda.libs.cusparse.sgtsv2StridedBatch_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy_backends/cuda/libs/cusparse.pyx":4355
 *     return bufferSizeInBytes
 * 
 * cpdef size_t dgtsv2StridedBatch_bufferSizeExt(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, size_t dl, size_t d, size_t du, size_t x,
 *         int batchCount, int batchStride):
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_441dgtsv2StridedBatch_bufferSizeExt(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static size_t __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_dgtsv2StridedBatch_bufferSizeExt(intptr_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, 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("dgtsv2StridedBatch_bufferSizeExt", 0);

  /* "cupy_backends/cuda/libs/cusparse.pyx":4359
 *         int batchCount, int batchStride):
 *     cdef size_t bufferSizeInBytes
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseDgtsv2StridedBatch_bufferSizeExt(
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4359, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":4360
 *     cdef size_t bufferSizeInBytes
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseDgtsv2StridedBatch_bufferSizeExt(
 *             <cusparseHandle_t>handle, m, <const double*>dl, <const double*>d,
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "cupy_backends/cuda/libs/cusparse.pyx":4361
 *     _setStream(handle)
 *     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, (&__pyx_v_bufferSizeInBytes));
      }

      /* "cupy_backends/cuda/libs/cusparse.pyx":4360
 *     cdef size_t bufferSizeInBytes
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseDgtsv2StridedBatch_bufferSizeExt(
 *             <cusparseHandle_t>handle, m, <const double*>dl, <const double*>d,
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy_backends/cuda/libs/cusparse.pyx":4365
 *             <const double*>du, <const double*>x, batchCount, batchStride,
 *             &bufferSizeInBytes)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return bufferSizeInBytes
 * 
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4365, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":4366
 *             &bufferSizeInBytes)
 *     check_status(status)
 *     return bufferSizeInBytes             # <<<<<<<<<<<<<<
 * 
 * cpdef size_t cgtsv2StridedBatch_bufferSizeExt(
*/
  __pyx_r = __pyx_v_bufferSizeInBytes;
  goto __pyx_L0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":4355
 *     return bufferSizeInBytes
 * 
 * cpdef size_t dgtsv2StridedBatch_bufferSizeExt(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, size_t dl, size_t d, size_t du, size_t x,
 *         int batchCount, int batchStride):
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.dgtsv2StridedBatch_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1L;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_441dgtsv2StridedBatch_bufferSizeExt(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_440dgtsv2StridedBatch_bufferSizeExt, "dgtsv2StridedBatch_bufferSizeExt(intptr_t handle, int m, size_t dl, size_t d, size_t du, size_t x, int batchCount, int batchStride) -> size_t");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_441dgtsv2StridedBatch_bufferSizeExt(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[8] = {0,0,0,0,0,0,0,0};
  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);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_dl,&__pyx_mstate_global->__pyx_n_u_d,&__pyx_mstate_global->__pyx_n_u_du,&__pyx_mstate_global->__pyx_n_u_x,&__pyx_mstate_global->__pyx_n_u_batchCount,&__pyx_mstate_global->__pyx_n_u_batchStride,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 4355, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 4355, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 4355, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 4355, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4355, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4355, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4355, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4355, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4355, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "dgtsv2StridedBatch_bufferSizeExt", 0) < (0)) __PYX_ERR(0, 4355, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 8; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("dgtsv2StridedBatch_bufferSizeExt", 1, 8, 8, i); __PYX_ERR(0, 4355, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 8)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4355, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4355, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4355, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4355, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4355, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 4355, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 4355, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 4355, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4356, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4356, __pyx_L3_error)
    __pyx_v_dl = __Pyx_PyLong_As_size_t(values[2]); if (unlikely((__pyx_v_dl == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4356, __pyx_L3_error)
    __pyx_v_d = __Pyx_PyLong_As_size_t(values[3]); if (unlikely((__pyx_v_d == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4356, __pyx_L3_error)
    __pyx_v_du = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_du == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4356, __pyx_L3_error)
    __pyx_v_x = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_x == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4356, __pyx_L3_error)
    __pyx_v_batchCount = __Pyx_PyLong_As_int(values[6]); if (unlikely((__pyx_v_batchCount == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4357, __pyx_L3_error)
    __pyx_v_batchStride = __Pyx_PyLong_As_int(values[7]); if (unlikely((__pyx_v_batchStride == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4357, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("dgtsv2StridedBatch_bufferSizeExt", 1, 8, 8, __pyx_nargs); __PYX_ERR(0, 4355, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.dgtsv2StridedBatch_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_440dgtsv2StridedBatch_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);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_440dgtsv2StridedBatch_bufferSizeExt(CYTHON_UNUSED PyObject *__pyx_self, intptr_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) {
  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("dgtsv2StridedBatch_bufferSizeExt", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(__pyx_t_1 == ((size_t)-1L) && PyErr_Occurred())) __PYX_ERR(0, 4355, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyLong_FromSize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4355, __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_backends.cuda.libs.cusparse.dgtsv2StridedBatch_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy_backends/cuda/libs/cusparse.pyx":4368
 *     return bufferSizeInBytes
 * 
 * cpdef size_t cgtsv2StridedBatch_bufferSizeExt(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, size_t dl, size_t d, size_t du, size_t x,
 *         int batchCount, int batchStride) except? -1:
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_443cgtsv2StridedBatch_bufferSizeExt(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static size_t __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_cgtsv2StridedBatch_bufferSizeExt(intptr_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, 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("cgtsv2StridedBatch_bufferSizeExt", 0);

  /* "cupy_backends/cuda/libs/cusparse.pyx":4372
 *         int batchCount, int batchStride) except? -1:
 *     cdef size_t bufferSizeInBytes
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseCgtsv2StridedBatch_bufferSizeExt(
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4372, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":4373
 *     cdef size_t bufferSizeInBytes
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseCgtsv2StridedBatch_bufferSizeExt(
 *             <cusparseHandle_t>handle, m, <const cuComplex*>dl,
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "cupy_backends/cuda/libs/cusparse.pyx":4374
 *     _setStream(handle)
 *     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, (&__pyx_v_bufferSizeInBytes));
      }

      /* "cupy_backends/cuda/libs/cusparse.pyx":4373
 *     cdef size_t bufferSizeInBytes
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseCgtsv2StridedBatch_bufferSizeExt(
 *             <cusparseHandle_t>handle, m, <const cuComplex*>dl,
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy_backends/cuda/libs/cusparse.pyx":4378
 *             <const cuComplex*>d, <const cuComplex*>du, <const cuComplex*>x,
 *             batchCount, batchStride, &bufferSizeInBytes)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return bufferSizeInBytes
 * 
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4378, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":4379
 *             batchCount, batchStride, &bufferSizeInBytes)
 *     check_status(status)
 *     return bufferSizeInBytes             # <<<<<<<<<<<<<<
 * 
 * cpdef size_t zgtsv2StridedBatch_bufferSizeExt(
*/
  __pyx_r = __pyx_v_bufferSizeInBytes;
  goto __pyx_L0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":4368
 *     return bufferSizeInBytes
 * 
 * cpdef size_t cgtsv2StridedBatch_bufferSizeExt(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, size_t dl, size_t d, size_t du, size_t x,
 *         int batchCount, int batchStride) except? -1:
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.cgtsv2StridedBatch_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1L;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_443cgtsv2StridedBatch_bufferSizeExt(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_442cgtsv2StridedBatch_bufferSizeExt, "cgtsv2StridedBatch_bufferSizeExt(intptr_t handle, int m, size_t dl, size_t d, size_t du, size_t x, int batchCount, int batchStride) -> size_t");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_443cgtsv2StridedBatch_bufferSizeExt(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[8] = {0,0,0,0,0,0,0,0};
  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);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_dl,&__pyx_mstate_global->__pyx_n_u_d,&__pyx_mstate_global->__pyx_n_u_du,&__pyx_mstate_global->__pyx_n_u_x,&__pyx_mstate_global->__pyx_n_u_batchCount,&__pyx_mstate_global->__pyx_n_u_batchStride,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 4368, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 4368, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 4368, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 4368, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4368, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4368, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4368, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4368, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4368, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "cgtsv2StridedBatch_bufferSizeExt", 0) < (0)) __PYX_ERR(0, 4368, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 8; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("cgtsv2StridedBatch_bufferSizeExt", 1, 8, 8, i); __PYX_ERR(0, 4368, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 8)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4368, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4368, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4368, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4368, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4368, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 4368, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 4368, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 4368, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4369, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4369, __pyx_L3_error)
    __pyx_v_dl = __Pyx_PyLong_As_size_t(values[2]); if (unlikely((__pyx_v_dl == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4369, __pyx_L3_error)
    __pyx_v_d = __Pyx_PyLong_As_size_t(values[3]); if (unlikely((__pyx_v_d == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4369, __pyx_L3_error)
    __pyx_v_du = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_du == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4369, __pyx_L3_error)
    __pyx_v_x = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_x == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4369, __pyx_L3_error)
    __pyx_v_batchCount = __Pyx_PyLong_As_int(values[6]); if (unlikely((__pyx_v_batchCount == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4370, __pyx_L3_error)
    __pyx_v_batchStride = __Pyx_PyLong_As_int(values[7]); if (unlikely((__pyx_v_batchStride == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4370, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("cgtsv2StridedBatch_bufferSizeExt", 1, 8, 8, __pyx_nargs); __PYX_ERR(0, 4368, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.cgtsv2StridedBatch_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_442cgtsv2StridedBatch_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);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_442cgtsv2StridedBatch_bufferSizeExt(CYTHON_UNUSED PyObject *__pyx_self, intptr_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) {
  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("cgtsv2StridedBatch_bufferSizeExt", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(__pyx_t_1 == ((size_t)-1L) && PyErr_Occurred())) __PYX_ERR(0, 4368, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyLong_FromSize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4368, __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_backends.cuda.libs.cusparse.cgtsv2StridedBatch_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy_backends/cuda/libs/cusparse.pyx":4381
 *     return bufferSizeInBytes
 * 
 * cpdef size_t zgtsv2StridedBatch_bufferSizeExt(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, size_t dl, size_t d, size_t du, size_t x,
 *         int batchCount, int batchStride) except? -1:
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_445zgtsv2StridedBatch_bufferSizeExt(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static size_t __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_zgtsv2StridedBatch_bufferSizeExt(intptr_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, 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("zgtsv2StridedBatch_bufferSizeExt", 0);

  /* "cupy_backends/cuda/libs/cusparse.pyx":4385
 *         int batchCount, int batchStride) except? -1:
 *     cdef size_t bufferSizeInBytes
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseZgtsv2StridedBatch_bufferSizeExt(
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4385, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":4386
 *     cdef size_t bufferSizeInBytes
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseZgtsv2StridedBatch_bufferSizeExt(
 *             <cusparseHandle_t>handle, m, <const cuDoubleComplex*>dl,
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "cupy_backends/cuda/libs/cusparse.pyx":4387
 *     _setStream(handle)
 *     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, (&__pyx_v_bufferSizeInBytes));
      }

      /* "cupy_backends/cuda/libs/cusparse.pyx":4386
 *     cdef size_t bufferSizeInBytes
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseZgtsv2StridedBatch_bufferSizeExt(
 *             <cusparseHandle_t>handle, m, <const cuDoubleComplex*>dl,
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy_backends/cuda/libs/cusparse.pyx":4392
 *             <const cuDoubleComplex*>x, batchCount, batchStride,
 *             &bufferSizeInBytes)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return bufferSizeInBytes
 * 
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4392, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":4393
 *             &bufferSizeInBytes)
 *     check_status(status)
 *     return bufferSizeInBytes             # <<<<<<<<<<<<<<
 * 
 * cpdef void sgtsv2StridedBatch(
*/
  __pyx_r = __pyx_v_bufferSizeInBytes;
  goto __pyx_L0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":4381
 *     return bufferSizeInBytes
 * 
 * cpdef size_t zgtsv2StridedBatch_bufferSizeExt(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, size_t dl, size_t d, size_t du, size_t x,
 *         int batchCount, int batchStride) except? -1:
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.zgtsv2StridedBatch_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1L;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_445zgtsv2StridedBatch_bufferSizeExt(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_444zgtsv2StridedBatch_bufferSizeExt, "zgtsv2StridedBatch_bufferSizeExt(intptr_t handle, int m, size_t dl, size_t d, size_t du, size_t x, int batchCount, int batchStride) -> size_t");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_445zgtsv2StridedBatch_bufferSizeExt(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[8] = {0,0,0,0,0,0,0,0};
  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);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_dl,&__pyx_mstate_global->__pyx_n_u_d,&__pyx_mstate_global->__pyx_n_u_du,&__pyx_mstate_global->__pyx_n_u_x,&__pyx_mstate_global->__pyx_n_u_batchCount,&__pyx_mstate_global->__pyx_n_u_batchStride,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 4381, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 4381, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 4381, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 4381, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4381, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4381, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4381, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4381, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4381, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "zgtsv2StridedBatch_bufferSizeExt", 0) < (0)) __PYX_ERR(0, 4381, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 8; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("zgtsv2StridedBatch_bufferSizeExt", 1, 8, 8, i); __PYX_ERR(0, 4381, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 8)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4381, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4381, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4381, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4381, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4381, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 4381, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 4381, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 4381, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4382, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4382, __pyx_L3_error)
    __pyx_v_dl = __Pyx_PyLong_As_size_t(values[2]); if (unlikely((__pyx_v_dl == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4382, __pyx_L3_error)
    __pyx_v_d = __Pyx_PyLong_As_size_t(values[3]); if (unlikely((__pyx_v_d == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4382, __pyx_L3_error)
    __pyx_v_du = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_du == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4382, __pyx_L3_error)
    __pyx_v_x = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_x == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4382, __pyx_L3_error)
    __pyx_v_batchCount = __Pyx_PyLong_As_int(values[6]); if (unlikely((__pyx_v_batchCount == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4383, __pyx_L3_error)
    __pyx_v_batchStride = __Pyx_PyLong_As_int(values[7]); if (unlikely((__pyx_v_batchStride == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4383, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("zgtsv2StridedBatch_bufferSizeExt", 1, 8, 8, __pyx_nargs); __PYX_ERR(0, 4381, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.zgtsv2StridedBatch_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_444zgtsv2StridedBatch_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);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_444zgtsv2StridedBatch_bufferSizeExt(CYTHON_UNUSED PyObject *__pyx_self, intptr_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) {
  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("zgtsv2StridedBatch_bufferSizeExt", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(__pyx_t_1 == ((size_t)-1L) && PyErr_Occurred())) __PYX_ERR(0, 4381, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyLong_FromSize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4381, __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_backends.cuda.libs.cusparse.zgtsv2StridedBatch_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy_backends/cuda/libs/cusparse.pyx":4395
 *     return bufferSizeInBytes
 * 
 * cpdef void sgtsv2StridedBatch(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, size_t dl, size_t d,
 *         size_t du, size_t x, int batchCount, int batchStride,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_447sgtsv2StridedBatch(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_sgtsv2StridedBatch(intptr_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;
  __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_backends/cuda/libs/cusparse.pyx":4399
 *         size_t du, size_t x, int batchCount, int batchStride,
 *         size_t pBuffer) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseSgtsv2StridedBatch(
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4399, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":4400
 *         size_t pBuffer) except *:
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseSgtsv2StridedBatch(
 *             <cusparseHandle_t>handle, m, <const float*>dl, <const float*>d,
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "cupy_backends/cuda/libs/cusparse.pyx":4401
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":4400
 *         size_t pBuffer) except *:
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseSgtsv2StridedBatch(
 *             <cusparseHandle_t>handle, m, <const float*>dl, <const float*>d,
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy_backends/cuda/libs/cusparse.pyx":4405
 *             <const float*>du, <float*>x, batchCount, batchStride,
 *             <void*>pBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef void dgtsv2StridedBatch(
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4405, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":4395
 *     return bufferSizeInBytes
 * 
 * cpdef void sgtsv2StridedBatch(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, size_t dl, size_t d,
 *         size_t du, size_t x, int batchCount, int batchStride,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.sgtsv2StridedBatch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_447sgtsv2StridedBatch(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_446sgtsv2StridedBatch, "sgtsv2StridedBatch(intptr_t handle, int m, size_t dl, size_t d, size_t du, size_t x, int batchCount, int batchStride, size_t pBuffer) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_447sgtsv2StridedBatch(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("sgtsv2StridedBatch (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_dl,&__pyx_mstate_global->__pyx_n_u_d,&__pyx_mstate_global->__pyx_n_u_du,&__pyx_mstate_global->__pyx_n_u_x,&__pyx_mstate_global->__pyx_n_u_batchCount,&__pyx_mstate_global->__pyx_n_u_batchStride,&__pyx_mstate_global->__pyx_n_u_pBuffer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 4395, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 4395, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 4395, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 4395, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 4395, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4395, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4395, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4395, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4395, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4395, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "sgtsv2StridedBatch", 0) < (0)) __PYX_ERR(0, 4395, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 9; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("sgtsv2StridedBatch", 1, 9, 9, i); __PYX_ERR(0, 4395, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 9)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4395, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4395, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4395, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4395, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4395, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 4395, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 4395, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 4395, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 4395, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4396, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4396, __pyx_L3_error)
    __pyx_v_dl = __Pyx_PyLong_As_size_t(values[2]); if (unlikely((__pyx_v_dl == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4396, __pyx_L3_error)
    __pyx_v_d = __Pyx_PyLong_As_size_t(values[3]); if (unlikely((__pyx_v_d == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4396, __pyx_L3_error)
    __pyx_v_du = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_du == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4397, __pyx_L3_error)
    __pyx_v_x = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_x == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4397, __pyx_L3_error)
    __pyx_v_batchCount = __Pyx_PyLong_As_int(values[6]); if (unlikely((__pyx_v_batchCount == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4397, __pyx_L3_error)
    __pyx_v_batchStride = __Pyx_PyLong_As_int(values[7]); if (unlikely((__pyx_v_batchStride == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4397, __pyx_L3_error)
    __pyx_v_pBuffer = __Pyx_PyLong_As_size_t(values[8]); if (unlikely((__pyx_v_pBuffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4398, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("sgtsv2StridedBatch", 1, 9, 9, __pyx_nargs); __PYX_ERR(0, 4395, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.sgtsv2StridedBatch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_446sgtsv2StridedBatch(__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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_446sgtsv2StridedBatch(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4395, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4395, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":4407
 *     check_status(status)
 * 
 * cpdef void dgtsv2StridedBatch(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, size_t dl, size_t d,
 *         size_t du, size_t x, int batchCount, int batchStride,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_449dgtsv2StridedBatch(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_dgtsv2StridedBatch(intptr_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;
  __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_backends/cuda/libs/cusparse.pyx":4411
 *         size_t du, size_t x, int batchCount, int batchStride,
 *         size_t pBuffer) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseDgtsv2StridedBatch(
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4411, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":4412
 *         size_t pBuffer) except *:
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseDgtsv2StridedBatch(
 *             <cusparseHandle_t>handle, m, <const double*>dl, <const double*>d,
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "cupy_backends/cuda/libs/cusparse.pyx":4413
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":4412
 *         size_t pBuffer) except *:
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseDgtsv2StridedBatch(
 *             <cusparseHandle_t>handle, m, <const double*>dl, <const double*>d,
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy_backends/cuda/libs/cusparse.pyx":4417
 *             <const double*>du, <double*>x, batchCount, batchStride,
 *             <void*>pBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef void cgtsv2StridedBatch(
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4417, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":4407
 *     check_status(status)
 * 
 * cpdef void dgtsv2StridedBatch(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, size_t dl, size_t d,
 *         size_t du, size_t x, int batchCount, int batchStride,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.dgtsv2StridedBatch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_449dgtsv2StridedBatch(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_448dgtsv2StridedBatch, "dgtsv2StridedBatch(intptr_t handle, int m, size_t dl, size_t d, size_t du, size_t x, int batchCount, int batchStride, size_t pBuffer) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_449dgtsv2StridedBatch(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dgtsv2StridedBatch (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_dl,&__pyx_mstate_global->__pyx_n_u_d,&__pyx_mstate_global->__pyx_n_u_du,&__pyx_mstate_global->__pyx_n_u_x,&__pyx_mstate_global->__pyx_n_u_batchCount,&__pyx_mstate_global->__pyx_n_u_batchStride,&__pyx_mstate_global->__pyx_n_u_pBuffer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 4407, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 4407, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 4407, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 4407, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 4407, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4407, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4407, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4407, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4407, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4407, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "dgtsv2StridedBatch", 0) < (0)) __PYX_ERR(0, 4407, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 9; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("dgtsv2StridedBatch", 1, 9, 9, i); __PYX_ERR(0, 4407, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 9)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4407, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4407, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4407, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4407, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4407, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 4407, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 4407, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 4407, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 4407, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4408, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4408, __pyx_L3_error)
    __pyx_v_dl = __Pyx_PyLong_As_size_t(values[2]); if (unlikely((__pyx_v_dl == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4408, __pyx_L3_error)
    __pyx_v_d = __Pyx_PyLong_As_size_t(values[3]); if (unlikely((__pyx_v_d == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4408, __pyx_L3_error)
    __pyx_v_du = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_du == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4409, __pyx_L3_error)
    __pyx_v_x = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_x == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4409, __pyx_L3_error)
    __pyx_v_batchCount = __Pyx_PyLong_As_int(values[6]); if (unlikely((__pyx_v_batchCount == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4409, __pyx_L3_error)
    __pyx_v_batchStride = __Pyx_PyLong_As_int(values[7]); if (unlikely((__pyx_v_batchStride == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4409, __pyx_L3_error)
    __pyx_v_pBuffer = __Pyx_PyLong_As_size_t(values[8]); if (unlikely((__pyx_v_pBuffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4410, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("dgtsv2StridedBatch", 1, 9, 9, __pyx_nargs); __PYX_ERR(0, 4407, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.dgtsv2StridedBatch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_448dgtsv2StridedBatch(__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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_448dgtsv2StridedBatch(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4407, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4407, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":4419
 *     check_status(status)
 * 
 * cpdef void cgtsv2StridedBatch(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, size_t dl, size_t d,
 *         size_t du, size_t x, int batchCount, int batchStride,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_451cgtsv2StridedBatch(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_cgtsv2StridedBatch(intptr_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;
  __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_backends/cuda/libs/cusparse.pyx":4423
 *         size_t du, size_t x, int batchCount, int batchStride,
 *         size_t pBuffer) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseCgtsv2StridedBatch(
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4423, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":4424
 *         size_t pBuffer) except *:
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseCgtsv2StridedBatch(
 *             <cusparseHandle_t>handle, m, <const cuComplex*>dl,
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "cupy_backends/cuda/libs/cusparse.pyx":4425
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":4424
 *         size_t pBuffer) except *:
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseCgtsv2StridedBatch(
 *             <cusparseHandle_t>handle, m, <const cuComplex*>dl,
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy_backends/cuda/libs/cusparse.pyx":4429
 *             <const cuComplex*>d, <const cuComplex*>du, <cuComplex*>x,
 *             batchCount, batchStride, <void*>pBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef void zgtsv2StridedBatch(
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4429, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":4419
 *     check_status(status)
 * 
 * cpdef void cgtsv2StridedBatch(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, size_t dl, size_t d,
 *         size_t du, size_t x, int batchCount, int batchStride,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.cgtsv2StridedBatch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_451cgtsv2StridedBatch(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_450cgtsv2StridedBatch, "cgtsv2StridedBatch(intptr_t handle, int m, size_t dl, size_t d, size_t du, size_t x, int batchCount, int batchStride, size_t pBuffer) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_451cgtsv2StridedBatch(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("cgtsv2StridedBatch (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_dl,&__pyx_mstate_global->__pyx_n_u_d,&__pyx_mstate_global->__pyx_n_u_du,&__pyx_mstate_global->__pyx_n_u_x,&__pyx_mstate_global->__pyx_n_u_batchCount,&__pyx_mstate_global->__pyx_n_u_batchStride,&__pyx_mstate_global->__pyx_n_u_pBuffer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 4419, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 4419, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 4419, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 4419, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 4419, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4419, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4419, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4419, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4419, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4419, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "cgtsv2StridedBatch", 0) < (0)) __PYX_ERR(0, 4419, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 9; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("cgtsv2StridedBatch", 1, 9, 9, i); __PYX_ERR(0, 4419, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 9)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4419, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4419, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4419, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4419, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4419, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 4419, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 4419, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 4419, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 4419, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4420, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4420, __pyx_L3_error)
    __pyx_v_dl = __Pyx_PyLong_As_size_t(values[2]); if (unlikely((__pyx_v_dl == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4420, __pyx_L3_error)
    __pyx_v_d = __Pyx_PyLong_As_size_t(values[3]); if (unlikely((__pyx_v_d == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4420, __pyx_L3_error)
    __pyx_v_du = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_du == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4421, __pyx_L3_error)
    __pyx_v_x = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_x == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4421, __pyx_L3_error)
    __pyx_v_batchCount = __Pyx_PyLong_As_int(values[6]); if (unlikely((__pyx_v_batchCount == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4421, __pyx_L3_error)
    __pyx_v_batchStride = __Pyx_PyLong_As_int(values[7]); if (unlikely((__pyx_v_batchStride == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4421, __pyx_L3_error)
    __pyx_v_pBuffer = __Pyx_PyLong_As_size_t(values[8]); if (unlikely((__pyx_v_pBuffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4422, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("cgtsv2StridedBatch", 1, 9, 9, __pyx_nargs); __PYX_ERR(0, 4419, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.cgtsv2StridedBatch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_450cgtsv2StridedBatch(__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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_450cgtsv2StridedBatch(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4419, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4419, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":4431
 *     check_status(status)
 * 
 * cpdef void zgtsv2StridedBatch(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, size_t dl, size_t d,
 *         size_t du, size_t x, int batchCount, int batchStride,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_453zgtsv2StridedBatch(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_zgtsv2StridedBatch(intptr_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;
  __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_backends/cuda/libs/cusparse.pyx":4435
 *         size_t du, size_t x, int batchCount, int batchStride,
 *         size_t pBuffer) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseZgtsv2StridedBatch(
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4435, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":4436
 *         size_t pBuffer) except *:
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseZgtsv2StridedBatch(
 *             <cusparseHandle_t>handle, m, <const cuDoubleComplex*>dl,
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "cupy_backends/cuda/libs/cusparse.pyx":4437
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":4436
 *         size_t pBuffer) except *:
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseZgtsv2StridedBatch(
 *             <cusparseHandle_t>handle, m, <const cuDoubleComplex*>dl,
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy_backends/cuda/libs/cusparse.pyx":4441
 *             <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_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4441, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":4431
 *     check_status(status)
 * 
 * cpdef void zgtsv2StridedBatch(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, size_t dl, size_t d,
 *         size_t du, size_t x, int batchCount, int batchStride,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.zgtsv2StridedBatch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_453zgtsv2StridedBatch(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_452zgtsv2StridedBatch, "zgtsv2StridedBatch(intptr_t handle, int m, size_t dl, size_t d, size_t du, size_t x, int batchCount, int batchStride, size_t pBuffer) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_453zgtsv2StridedBatch(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("zgtsv2StridedBatch (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_dl,&__pyx_mstate_global->__pyx_n_u_d,&__pyx_mstate_global->__pyx_n_u_du,&__pyx_mstate_global->__pyx_n_u_x,&__pyx_mstate_global->__pyx_n_u_batchCount,&__pyx_mstate_global->__pyx_n_u_batchStride,&__pyx_mstate_global->__pyx_n_u_pBuffer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 4431, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 4431, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 4431, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 4431, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 4431, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4431, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4431, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4431, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4431, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4431, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "zgtsv2StridedBatch", 0) < (0)) __PYX_ERR(0, 4431, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 9; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("zgtsv2StridedBatch", 1, 9, 9, i); __PYX_ERR(0, 4431, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 9)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4431, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4431, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4431, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4431, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4431, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 4431, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 4431, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 4431, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 4431, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4432, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4432, __pyx_L3_error)
    __pyx_v_dl = __Pyx_PyLong_As_size_t(values[2]); if (unlikely((__pyx_v_dl == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4432, __pyx_L3_error)
    __pyx_v_d = __Pyx_PyLong_As_size_t(values[3]); if (unlikely((__pyx_v_d == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4432, __pyx_L3_error)
    __pyx_v_du = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_du == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4433, __pyx_L3_error)
    __pyx_v_x = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_x == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4433, __pyx_L3_error)
    __pyx_v_batchCount = __Pyx_PyLong_As_int(values[6]); if (unlikely((__pyx_v_batchCount == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4433, __pyx_L3_error)
    __pyx_v_batchStride = __Pyx_PyLong_As_int(values[7]); if (unlikely((__pyx_v_batchStride == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4433, __pyx_L3_error)
    __pyx_v_pBuffer = __Pyx_PyLong_As_size_t(values[8]); if (unlikely((__pyx_v_pBuffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4434, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("zgtsv2StridedBatch", 1, 9, 9, __pyx_nargs); __PYX_ERR(0, 4431, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.zgtsv2StridedBatch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_452zgtsv2StridedBatch(__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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_452zgtsv2StridedBatch(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4431, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4431, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":4443
 *     check_status(status)
 * 
 * cpdef size_t sgtsvInterleavedBatch_bufferSizeExt(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int algo, int m, size_t dl, size_t d, size_t du,
 *         size_t x, int batchCount) except? -1:
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_455sgtsvInterleavedBatch_bufferSizeExt(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static size_t __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_sgtsvInterleavedBatch_bufferSizeExt(intptr_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_backends/cuda/libs/cusparse.pyx":4447
 *         size_t x, int batchCount) except? -1:
 *     cdef size_t pBufferSizeInBytes
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseSgtsvInterleavedBatch_bufferSizeExt(
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4447, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":4448
 *     cdef size_t pBufferSizeInBytes
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseSgtsvInterleavedBatch_bufferSizeExt(
 *             <cusparseHandle_t>handle, algo, m, <const float*>dl,
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "cupy_backends/cuda/libs/cusparse.pyx":4449
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":4448
 *     cdef size_t pBufferSizeInBytes
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseSgtsvInterleavedBatch_bufferSizeExt(
 *             <cusparseHandle_t>handle, algo, m, <const float*>dl,
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy_backends/cuda/libs/cusparse.pyx":4453
 *             <const float*>d, <const float*>du, <const float*>x, batchCount,
 *             &pBufferSizeInBytes)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return <size_t>pBufferSizeInBytes
 * 
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4453, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":4454
 *             &pBufferSizeInBytes)
 *     check_status(status)
 *     return <size_t>pBufferSizeInBytes             # <<<<<<<<<<<<<<
 * 
 * cpdef size_t dgtsvInterleavedBatch_bufferSizeExt(
*/
  __pyx_r = ((size_t)__pyx_v_pBufferSizeInBytes);
  goto __pyx_L0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":4443
 *     check_status(status)
 * 
 * cpdef size_t sgtsvInterleavedBatch_bufferSizeExt(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int algo, int m, size_t dl, size_t d, size_t du,
 *         size_t x, int batchCount) except? -1:
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.sgtsvInterleavedBatch_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1L;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_455sgtsvInterleavedBatch_bufferSizeExt(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_454sgtsvInterleavedBatch_bufferSizeExt, "sgtsvInterleavedBatch_bufferSizeExt(intptr_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_13cupy_backends_4cuda_4libs_8cusparse_455sgtsvInterleavedBatch_bufferSizeExt(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[8] = {0,0,0,0,0,0,0,0};
  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);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_algo,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_dl,&__pyx_mstate_global->__pyx_n_u_d,&__pyx_mstate_global->__pyx_n_u_du,&__pyx_mstate_global->__pyx_n_u_x,&__pyx_mstate_global->__pyx_n_u_batchCount,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 4443, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 4443, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 4443, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 4443, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4443, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4443, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4443, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4443, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4443, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "sgtsvInterleavedBatch_bufferSizeExt", 0) < (0)) __PYX_ERR(0, 4443, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 8; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("sgtsvInterleavedBatch_bufferSizeExt", 1, 8, 8, i); __PYX_ERR(0, 4443, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 8)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4443, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4443, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4443, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4443, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4443, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 4443, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 4443, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 4443, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4444, __pyx_L3_error)
    __pyx_v_algo = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_algo == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4444, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4444, __pyx_L3_error)
    __pyx_v_dl = __Pyx_PyLong_As_size_t(values[3]); if (unlikely((__pyx_v_dl == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4444, __pyx_L3_error)
    __pyx_v_d = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_d == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4444, __pyx_L3_error)
    __pyx_v_du = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_du == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4444, __pyx_L3_error)
    __pyx_v_x = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_x == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4445, __pyx_L3_error)
    __pyx_v_batchCount = __Pyx_PyLong_As_int(values[7]); if (unlikely((__pyx_v_batchCount == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4445, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("sgtsvInterleavedBatch_bufferSizeExt", 1, 8, 8, __pyx_nargs); __PYX_ERR(0, 4443, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.sgtsvInterleavedBatch_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_454sgtsvInterleavedBatch_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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_454sgtsvInterleavedBatch_bufferSizeExt(CYTHON_UNUSED PyObject *__pyx_self, intptr_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
  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("sgtsvInterleavedBatch_bufferSizeExt", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(__pyx_t_1 == ((size_t)-1L) && PyErr_Occurred())) __PYX_ERR(0, 4443, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyLong_FromSize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4443, __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_backends.cuda.libs.cusparse.sgtsvInterleavedBatch_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy_backends/cuda/libs/cusparse.pyx":4456
 *     return <size_t>pBufferSizeInBytes
 * 
 * cpdef size_t dgtsvInterleavedBatch_bufferSizeExt(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int algo, int m, size_t dl, size_t d, size_t du,
 *         size_t x, int batchCount) except? -1:
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_457dgtsvInterleavedBatch_bufferSizeExt(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static size_t __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_dgtsvInterleavedBatch_bufferSizeExt(intptr_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_backends/cuda/libs/cusparse.pyx":4460
 *         size_t x, int batchCount) except? -1:
 *     cdef size_t pBufferSizeInBytes
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseDgtsvInterleavedBatch_bufferSizeExt(
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4460, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":4461
 *     cdef size_t pBufferSizeInBytes
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseDgtsvInterleavedBatch_bufferSizeExt(
 *             <cusparseHandle_t>handle, algo, m, <const double*>dl,
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "cupy_backends/cuda/libs/cusparse.pyx":4462
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":4461
 *     cdef size_t pBufferSizeInBytes
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseDgtsvInterleavedBatch_bufferSizeExt(
 *             <cusparseHandle_t>handle, algo, m, <const double*>dl,
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy_backends/cuda/libs/cusparse.pyx":4466
 *             <const double*>d, <const double*>du, <const double*>x, batchCount,
 *             &pBufferSizeInBytes)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return <size_t>pBufferSizeInBytes
 * 
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4466, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":4467
 *             &pBufferSizeInBytes)
 *     check_status(status)
 *     return <size_t>pBufferSizeInBytes             # <<<<<<<<<<<<<<
 * 
 * cpdef size_t cgtsvInterleavedBatch_bufferSizeExt(
*/
  __pyx_r = ((size_t)__pyx_v_pBufferSizeInBytes);
  goto __pyx_L0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":4456
 *     return <size_t>pBufferSizeInBytes
 * 
 * cpdef size_t dgtsvInterleavedBatch_bufferSizeExt(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int algo, int m, size_t dl, size_t d, size_t du,
 *         size_t x, int batchCount) except? -1:
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.dgtsvInterleavedBatch_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1L;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_457dgtsvInterleavedBatch_bufferSizeExt(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_456dgtsvInterleavedBatch_bufferSizeExt, "dgtsvInterleavedBatch_bufferSizeExt(intptr_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_13cupy_backends_4cuda_4libs_8cusparse_457dgtsvInterleavedBatch_bufferSizeExt(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[8] = {0,0,0,0,0,0,0,0};
  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);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_algo,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_dl,&__pyx_mstate_global->__pyx_n_u_d,&__pyx_mstate_global->__pyx_n_u_du,&__pyx_mstate_global->__pyx_n_u_x,&__pyx_mstate_global->__pyx_n_u_batchCount,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 4456, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 4456, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 4456, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 4456, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4456, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4456, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4456, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4456, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4456, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "dgtsvInterleavedBatch_bufferSizeExt", 0) < (0)) __PYX_ERR(0, 4456, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 8; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("dgtsvInterleavedBatch_bufferSizeExt", 1, 8, 8, i); __PYX_ERR(0, 4456, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 8)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4456, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4456, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4456, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4456, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4456, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 4456, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 4456, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 4456, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4457, __pyx_L3_error)
    __pyx_v_algo = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_algo == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4457, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4457, __pyx_L3_error)
    __pyx_v_dl = __Pyx_PyLong_As_size_t(values[3]); if (unlikely((__pyx_v_dl == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4457, __pyx_L3_error)
    __pyx_v_d = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_d == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4457, __pyx_L3_error)
    __pyx_v_du = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_du == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4457, __pyx_L3_error)
    __pyx_v_x = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_x == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4458, __pyx_L3_error)
    __pyx_v_batchCount = __Pyx_PyLong_As_int(values[7]); if (unlikely((__pyx_v_batchCount == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4458, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("dgtsvInterleavedBatch_bufferSizeExt", 1, 8, 8, __pyx_nargs); __PYX_ERR(0, 4456, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.dgtsvInterleavedBatch_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_456dgtsvInterleavedBatch_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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_456dgtsvInterleavedBatch_bufferSizeExt(CYTHON_UNUSED PyObject *__pyx_self, intptr_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
  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("dgtsvInterleavedBatch_bufferSizeExt", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(__pyx_t_1 == ((size_t)-1L) && PyErr_Occurred())) __PYX_ERR(0, 4456, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyLong_FromSize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4456, __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_backends.cuda.libs.cusparse.dgtsvInterleavedBatch_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy_backends/cuda/libs/cusparse.pyx":4469
 *     return <size_t>pBufferSizeInBytes
 * 
 * cpdef size_t cgtsvInterleavedBatch_bufferSizeExt(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int algo, int m, size_t dl, size_t d, size_t du,
 *         size_t x, int batchCount) except? -1:
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_459cgtsvInterleavedBatch_bufferSizeExt(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static size_t __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_cgtsvInterleavedBatch_bufferSizeExt(intptr_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_backends/cuda/libs/cusparse.pyx":4473
 *         size_t x, int batchCount) except? -1:
 *     cdef size_t pBufferSizeInBytes
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseCgtsvInterleavedBatch_bufferSizeExt(
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4473, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":4474
 *     cdef size_t pBufferSizeInBytes
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseCgtsvInterleavedBatch_bufferSizeExt(
 *             <cusparseHandle_t>handle, algo, m, <const cuComplex*>dl,
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "cupy_backends/cuda/libs/cusparse.pyx":4475
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":4474
 *     cdef size_t pBufferSizeInBytes
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseCgtsvInterleavedBatch_bufferSizeExt(
 *             <cusparseHandle_t>handle, algo, m, <const cuComplex*>dl,
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy_backends/cuda/libs/cusparse.pyx":4479
 *             <const cuComplex*>d, <const cuComplex*>du, <const cuComplex*>x,
 *             batchCount, &pBufferSizeInBytes)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return <size_t>pBufferSizeInBytes
 * 
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4479, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":4480
 *             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_backends/cuda/libs/cusparse.pyx":4469
 *     return <size_t>pBufferSizeInBytes
 * 
 * cpdef size_t cgtsvInterleavedBatch_bufferSizeExt(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int algo, int m, size_t dl, size_t d, size_t du,
 *         size_t x, int batchCount) except? -1:
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.cgtsvInterleavedBatch_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1L;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_459cgtsvInterleavedBatch_bufferSizeExt(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_458cgtsvInterleavedBatch_bufferSizeExt, "cgtsvInterleavedBatch_bufferSizeExt(intptr_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_13cupy_backends_4cuda_4libs_8cusparse_459cgtsvInterleavedBatch_bufferSizeExt(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[8] = {0,0,0,0,0,0,0,0};
  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);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_algo,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_dl,&__pyx_mstate_global->__pyx_n_u_d,&__pyx_mstate_global->__pyx_n_u_du,&__pyx_mstate_global->__pyx_n_u_x,&__pyx_mstate_global->__pyx_n_u_batchCount,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 4469, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 4469, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 4469, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 4469, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4469, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4469, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4469, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4469, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4469, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "cgtsvInterleavedBatch_bufferSizeExt", 0) < (0)) __PYX_ERR(0, 4469, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 8; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("cgtsvInterleavedBatch_bufferSizeExt", 1, 8, 8, i); __PYX_ERR(0, 4469, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 8)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4469, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4469, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4469, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4469, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4469, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 4469, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 4469, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 4469, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4470, __pyx_L3_error)
    __pyx_v_algo = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_algo == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4470, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4470, __pyx_L3_error)
    __pyx_v_dl = __Pyx_PyLong_As_size_t(values[3]); if (unlikely((__pyx_v_dl == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4470, __pyx_L3_error)
    __pyx_v_d = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_d == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4470, __pyx_L3_error)
    __pyx_v_du = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_du == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4470, __pyx_L3_error)
    __pyx_v_x = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_x == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4471, __pyx_L3_error)
    __pyx_v_batchCount = __Pyx_PyLong_As_int(values[7]); if (unlikely((__pyx_v_batchCount == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4471, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("cgtsvInterleavedBatch_bufferSizeExt", 1, 8, 8, __pyx_nargs); __PYX_ERR(0, 4469, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.cgtsvInterleavedBatch_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_458cgtsvInterleavedBatch_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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_458cgtsvInterleavedBatch_bufferSizeExt(CYTHON_UNUSED PyObject *__pyx_self, intptr_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
  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("cgtsvInterleavedBatch_bufferSizeExt", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(__pyx_t_1 == ((size_t)-1L) && PyErr_Occurred())) __PYX_ERR(0, 4469, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyLong_FromSize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4469, __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_backends.cuda.libs.cusparse.cgtsvInterleavedBatch_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy_backends/cuda/libs/cusparse.pyx":4482
 *     return <size_t>pBufferSizeInBytes
 * 
 * cpdef size_t zgtsvInterleavedBatch_bufferSizeExt(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int algo, int m, size_t dl, size_t d, size_t du,
 *         size_t x, int batchCount) except? -1:
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_461zgtsvInterleavedBatch_bufferSizeExt(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static size_t __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_zgtsvInterleavedBatch_bufferSizeExt(intptr_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_backends/cuda/libs/cusparse.pyx":4486
 *         size_t x, int batchCount) except? -1:
 *     cdef size_t pBufferSizeInBytes
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseZgtsvInterleavedBatch_bufferSizeExt(
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4486, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":4487
 *     cdef size_t pBufferSizeInBytes
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseZgtsvInterleavedBatch_bufferSizeExt(
 *             <cusparseHandle_t>handle, algo, m, <const cuDoubleComplex*>dl,
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "cupy_backends/cuda/libs/cusparse.pyx":4488
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":4487
 *     cdef size_t pBufferSizeInBytes
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseZgtsvInterleavedBatch_bufferSizeExt(
 *             <cusparseHandle_t>handle, algo, m, <const cuDoubleComplex*>dl,
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy_backends/cuda/libs/cusparse.pyx":4492
 *             <const cuDoubleComplex*>d, <const cuDoubleComplex*>du,
 *             <const cuDoubleComplex*>x, batchCount, &pBufferSizeInBytes)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return <size_t>pBufferSizeInBytes
 * 
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4492, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":4493
 *             <const cuDoubleComplex*>x, batchCount, &pBufferSizeInBytes)
 *     check_status(status)
 *     return <size_t>pBufferSizeInBytes             # <<<<<<<<<<<<<<
 * 
 * cpdef void sgtsvInterleavedBatch(
*/
  __pyx_r = ((size_t)__pyx_v_pBufferSizeInBytes);
  goto __pyx_L0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":4482
 *     return <size_t>pBufferSizeInBytes
 * 
 * cpdef size_t zgtsvInterleavedBatch_bufferSizeExt(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int algo, int m, size_t dl, size_t d, size_t du,
 *         size_t x, int batchCount) except? -1:
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.zgtsvInterleavedBatch_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1L;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_461zgtsvInterleavedBatch_bufferSizeExt(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_460zgtsvInterleavedBatch_bufferSizeExt, "zgtsvInterleavedBatch_bufferSizeExt(intptr_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_13cupy_backends_4cuda_4libs_8cusparse_461zgtsvInterleavedBatch_bufferSizeExt(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[8] = {0,0,0,0,0,0,0,0};
  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);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_algo,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_dl,&__pyx_mstate_global->__pyx_n_u_d,&__pyx_mstate_global->__pyx_n_u_du,&__pyx_mstate_global->__pyx_n_u_x,&__pyx_mstate_global->__pyx_n_u_batchCount,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 4482, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 4482, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 4482, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 4482, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4482, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4482, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4482, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4482, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4482, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "zgtsvInterleavedBatch_bufferSizeExt", 0) < (0)) __PYX_ERR(0, 4482, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 8; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("zgtsvInterleavedBatch_bufferSizeExt", 1, 8, 8, i); __PYX_ERR(0, 4482, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 8)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4482, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4482, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4482, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4482, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4482, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 4482, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 4482, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 4482, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4483, __pyx_L3_error)
    __pyx_v_algo = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_algo == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4483, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4483, __pyx_L3_error)
    __pyx_v_dl = __Pyx_PyLong_As_size_t(values[3]); if (unlikely((__pyx_v_dl == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4483, __pyx_L3_error)
    __pyx_v_d = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_d == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4483, __pyx_L3_error)
    __pyx_v_du = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_du == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4483, __pyx_L3_error)
    __pyx_v_x = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_x == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4484, __pyx_L3_error)
    __pyx_v_batchCount = __Pyx_PyLong_As_int(values[7]); if (unlikely((__pyx_v_batchCount == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4484, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("zgtsvInterleavedBatch_bufferSizeExt", 1, 8, 8, __pyx_nargs); __PYX_ERR(0, 4482, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.zgtsvInterleavedBatch_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_460zgtsvInterleavedBatch_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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_460zgtsvInterleavedBatch_bufferSizeExt(CYTHON_UNUSED PyObject *__pyx_self, intptr_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
  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("zgtsvInterleavedBatch_bufferSizeExt", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(__pyx_t_1 == ((size_t)-1L) && PyErr_Occurred())) __PYX_ERR(0, 4482, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyLong_FromSize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4482, __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_backends.cuda.libs.cusparse.zgtsvInterleavedBatch_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy_backends/cuda/libs/cusparse.pyx":4495
 *     return <size_t>pBufferSizeInBytes
 * 
 * cpdef void sgtsvInterleavedBatch(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int algo, int m, size_t dl,
 *         size_t d, size_t du, size_t x, int batchCount,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_463sgtsvInterleavedBatch(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_sgtsvInterleavedBatch(intptr_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;
  __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_backends/cuda/libs/cusparse.pyx":4499
 *         size_t d, size_t du, size_t x, int batchCount,
 *         size_t pBuffer) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseSgtsvInterleavedBatch(
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4499, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":4500
 *         size_t pBuffer) except *:
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseSgtsvInterleavedBatch(
 *             <cusparseHandle_t>handle, algo, m, <float*>dl, <float*>d,
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "cupy_backends/cuda/libs/cusparse.pyx":4501
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":4500
 *         size_t pBuffer) except *:
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseSgtsvInterleavedBatch(
 *             <cusparseHandle_t>handle, algo, m, <float*>dl, <float*>d,
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy_backends/cuda/libs/cusparse.pyx":4504
 *             <cusparseHandle_t>handle, algo, m, <float*>dl, <float*>d,
 *             <float*>du, <float*>x, batchCount, <void*>pBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef void dgtsvInterleavedBatch(
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4504, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":4495
 *     return <size_t>pBufferSizeInBytes
 * 
 * cpdef void sgtsvInterleavedBatch(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int algo, int m, size_t dl,
 *         size_t d, size_t du, size_t x, int batchCount,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.sgtsvInterleavedBatch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_463sgtsvInterleavedBatch(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_462sgtsvInterleavedBatch, "sgtsvInterleavedBatch(intptr_t handle, int algo, int m, size_t dl, size_t d, size_t du, size_t x, int batchCount, size_t pBuffer) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_463sgtsvInterleavedBatch(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("sgtsvInterleavedBatch (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_algo,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_dl,&__pyx_mstate_global->__pyx_n_u_d,&__pyx_mstate_global->__pyx_n_u_du,&__pyx_mstate_global->__pyx_n_u_x,&__pyx_mstate_global->__pyx_n_u_batchCount,&__pyx_mstate_global->__pyx_n_u_pBuffer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 4495, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 4495, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 4495, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 4495, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 4495, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4495, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4495, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4495, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4495, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4495, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "sgtsvInterleavedBatch", 0) < (0)) __PYX_ERR(0, 4495, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 9; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("sgtsvInterleavedBatch", 1, 9, 9, i); __PYX_ERR(0, 4495, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 9)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4495, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4495, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4495, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4495, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4495, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 4495, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 4495, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 4495, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 4495, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4496, __pyx_L3_error)
    __pyx_v_algo = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_algo == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4496, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4496, __pyx_L3_error)
    __pyx_v_dl = __Pyx_PyLong_As_size_t(values[3]); if (unlikely((__pyx_v_dl == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4496, __pyx_L3_error)
    __pyx_v_d = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_d == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4497, __pyx_L3_error)
    __pyx_v_du = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_du == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4497, __pyx_L3_error)
    __pyx_v_x = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_x == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4497, __pyx_L3_error)
    __pyx_v_batchCount = __Pyx_PyLong_As_int(values[7]); if (unlikely((__pyx_v_batchCount == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4497, __pyx_L3_error)
    __pyx_v_pBuffer = __Pyx_PyLong_As_size_t(values[8]); if (unlikely((__pyx_v_pBuffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4498, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("sgtsvInterleavedBatch", 1, 9, 9, __pyx_nargs); __PYX_ERR(0, 4495, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.sgtsvInterleavedBatch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_462sgtsvInterleavedBatch(__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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_462sgtsvInterleavedBatch(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4495, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4495, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":4506
 *     check_status(status)
 * 
 * cpdef void dgtsvInterleavedBatch(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int algo, int m, size_t dl,
 *         size_t d, size_t du, size_t x, int batchCount,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_465dgtsvInterleavedBatch(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_dgtsvInterleavedBatch(intptr_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;
  __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_backends/cuda/libs/cusparse.pyx":4510
 *         size_t d, size_t du, size_t x, int batchCount,
 *         size_t pBuffer) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseDgtsvInterleavedBatch(
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4510, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":4511
 *         size_t pBuffer) except *:
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseDgtsvInterleavedBatch(
 *             <cusparseHandle_t>handle, algo, m, <double*>dl, <double*>d,
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "cupy_backends/cuda/libs/cusparse.pyx":4512
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":4511
 *         size_t pBuffer) except *:
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseDgtsvInterleavedBatch(
 *             <cusparseHandle_t>handle, algo, m, <double*>dl, <double*>d,
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy_backends/cuda/libs/cusparse.pyx":4515
 *             <cusparseHandle_t>handle, algo, m, <double*>dl, <double*>d,
 *             <double*>du, <double*>x, batchCount, <void*>pBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef void cgtsvInterleavedBatch(
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4515, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":4506
 *     check_status(status)
 * 
 * cpdef void dgtsvInterleavedBatch(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int algo, int m, size_t dl,
 *         size_t d, size_t du, size_t x, int batchCount,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.dgtsvInterleavedBatch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_465dgtsvInterleavedBatch(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_464dgtsvInterleavedBatch, "dgtsvInterleavedBatch(intptr_t handle, int algo, int m, size_t dl, size_t d, size_t du, size_t x, int batchCount, size_t pBuffer) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_465dgtsvInterleavedBatch(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dgtsvInterleavedBatch (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_algo,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_dl,&__pyx_mstate_global->__pyx_n_u_d,&__pyx_mstate_global->__pyx_n_u_du,&__pyx_mstate_global->__pyx_n_u_x,&__pyx_mstate_global->__pyx_n_u_batchCount,&__pyx_mstate_global->__pyx_n_u_pBuffer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 4506, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 4506, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 4506, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 4506, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 4506, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4506, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4506, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4506, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4506, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4506, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "dgtsvInterleavedBatch", 0) < (0)) __PYX_ERR(0, 4506, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 9; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("dgtsvInterleavedBatch", 1, 9, 9, i); __PYX_ERR(0, 4506, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 9)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4506, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4506, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4506, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4506, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4506, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 4506, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 4506, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 4506, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 4506, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4507, __pyx_L3_error)
    __pyx_v_algo = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_algo == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4507, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4507, __pyx_L3_error)
    __pyx_v_dl = __Pyx_PyLong_As_size_t(values[3]); if (unlikely((__pyx_v_dl == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4507, __pyx_L3_error)
    __pyx_v_d = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_d == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4508, __pyx_L3_error)
    __pyx_v_du = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_du == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4508, __pyx_L3_error)
    __pyx_v_x = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_x == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4508, __pyx_L3_error)
    __pyx_v_batchCount = __Pyx_PyLong_As_int(values[7]); if (unlikely((__pyx_v_batchCount == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4508, __pyx_L3_error)
    __pyx_v_pBuffer = __Pyx_PyLong_As_size_t(values[8]); if (unlikely((__pyx_v_pBuffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4509, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("dgtsvInterleavedBatch", 1, 9, 9, __pyx_nargs); __PYX_ERR(0, 4506, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.dgtsvInterleavedBatch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_464dgtsvInterleavedBatch(__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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_464dgtsvInterleavedBatch(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4506, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4506, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":4517
 *     check_status(status)
 * 
 * cpdef void cgtsvInterleavedBatch(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int algo, int m, size_t dl,
 *         size_t d, size_t du, size_t x, int batchCount,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_467cgtsvInterleavedBatch(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_cgtsvInterleavedBatch(intptr_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;
  __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_backends/cuda/libs/cusparse.pyx":4521
 *         size_t d, size_t du, size_t x, int batchCount,
 *         size_t pBuffer) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseCgtsvInterleavedBatch(
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4521, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":4522
 *         size_t pBuffer) except *:
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseCgtsvInterleavedBatch(
 *             <cusparseHandle_t>handle, algo, m, <cuComplex*>dl, <cuComplex*>d,
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "cupy_backends/cuda/libs/cusparse.pyx":4523
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":4522
 *         size_t pBuffer) except *:
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseCgtsvInterleavedBatch(
 *             <cusparseHandle_t>handle, algo, m, <cuComplex*>dl, <cuComplex*>d,
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy_backends/cuda/libs/cusparse.pyx":4526
 *             <cusparseHandle_t>handle, algo, m, <cuComplex*>dl, <cuComplex*>d,
 *             <cuComplex*>du, <cuComplex*>x, batchCount, <void*>pBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef void zgtsvInterleavedBatch(
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4526, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":4517
 *     check_status(status)
 * 
 * cpdef void cgtsvInterleavedBatch(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int algo, int m, size_t dl,
 *         size_t d, size_t du, size_t x, int batchCount,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.cgtsvInterleavedBatch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_467cgtsvInterleavedBatch(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_466cgtsvInterleavedBatch, "cgtsvInterleavedBatch(intptr_t handle, int algo, int m, size_t dl, size_t d, size_t du, size_t x, int batchCount, size_t pBuffer) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_467cgtsvInterleavedBatch(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("cgtsvInterleavedBatch (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_algo,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_dl,&__pyx_mstate_global->__pyx_n_u_d,&__pyx_mstate_global->__pyx_n_u_du,&__pyx_mstate_global->__pyx_n_u_x,&__pyx_mstate_global->__pyx_n_u_batchCount,&__pyx_mstate_global->__pyx_n_u_pBuffer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 4517, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 4517, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 4517, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 4517, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 4517, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4517, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4517, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4517, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4517, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4517, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "cgtsvInterleavedBatch", 0) < (0)) __PYX_ERR(0, 4517, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 9; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("cgtsvInterleavedBatch", 1, 9, 9, i); __PYX_ERR(0, 4517, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 9)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4517, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4517, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4517, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4517, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4517, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 4517, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 4517, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 4517, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 4517, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4518, __pyx_L3_error)
    __pyx_v_algo = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_algo == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4518, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4518, __pyx_L3_error)
    __pyx_v_dl = __Pyx_PyLong_As_size_t(values[3]); if (unlikely((__pyx_v_dl == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4518, __pyx_L3_error)
    __pyx_v_d = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_d == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4519, __pyx_L3_error)
    __pyx_v_du = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_du == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4519, __pyx_L3_error)
    __pyx_v_x = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_x == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4519, __pyx_L3_error)
    __pyx_v_batchCount = __Pyx_PyLong_As_int(values[7]); if (unlikely((__pyx_v_batchCount == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4519, __pyx_L3_error)
    __pyx_v_pBuffer = __Pyx_PyLong_As_size_t(values[8]); if (unlikely((__pyx_v_pBuffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4520, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("cgtsvInterleavedBatch", 1, 9, 9, __pyx_nargs); __PYX_ERR(0, 4517, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.cgtsvInterleavedBatch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_466cgtsvInterleavedBatch(__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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_466cgtsvInterleavedBatch(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4517, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4517, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":4528
 *     check_status(status)
 * 
 * cpdef void zgtsvInterleavedBatch(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int algo, int m, size_t dl,
 *         size_t d, size_t du, size_t x, int batchCount,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_469zgtsvInterleavedBatch(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_zgtsvInterleavedBatch(intptr_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;
  __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_backends/cuda/libs/cusparse.pyx":4532
 *         size_t d, size_t du, size_t x, int batchCount,
 *         size_t pBuffer) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseZgtsvInterleavedBatch(
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4532, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":4533
 *         size_t pBuffer) except *:
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseZgtsvInterleavedBatch(
 *             <cusparseHandle_t>handle, algo, m, <cuDoubleComplex*>dl,
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "cupy_backends/cuda/libs/cusparse.pyx":4534
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":4533
 *         size_t pBuffer) except *:
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseZgtsvInterleavedBatch(
 *             <cusparseHandle_t>handle, algo, m, <cuDoubleComplex*>dl,
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy_backends/cuda/libs/cusparse.pyx":4538
 *             <cuDoubleComplex*>d, <cuDoubleComplex*>du, <cuDoubleComplex*>x,
 *             batchCount, <void*>pBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef size_t sgpsvInterleavedBatch_bufferSizeExt(
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4538, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":4528
 *     check_status(status)
 * 
 * cpdef void zgtsvInterleavedBatch(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int algo, int m, size_t dl,
 *         size_t d, size_t du, size_t x, int batchCount,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.zgtsvInterleavedBatch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_469zgtsvInterleavedBatch(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_468zgtsvInterleavedBatch, "zgtsvInterleavedBatch(intptr_t handle, int algo, int m, size_t dl, size_t d, size_t du, size_t x, int batchCount, size_t pBuffer) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_469zgtsvInterleavedBatch(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("zgtsvInterleavedBatch (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_algo,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_dl,&__pyx_mstate_global->__pyx_n_u_d,&__pyx_mstate_global->__pyx_n_u_du,&__pyx_mstate_global->__pyx_n_u_x,&__pyx_mstate_global->__pyx_n_u_batchCount,&__pyx_mstate_global->__pyx_n_u_pBuffer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 4528, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 4528, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 4528, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 4528, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 4528, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4528, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4528, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4528, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4528, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4528, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "zgtsvInterleavedBatch", 0) < (0)) __PYX_ERR(0, 4528, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 9; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("zgtsvInterleavedBatch", 1, 9, 9, i); __PYX_ERR(0, 4528, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 9)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4528, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4528, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4528, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4528, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4528, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 4528, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 4528, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 4528, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 4528, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4529, __pyx_L3_error)
    __pyx_v_algo = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_algo == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4529, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4529, __pyx_L3_error)
    __pyx_v_dl = __Pyx_PyLong_As_size_t(values[3]); if (unlikely((__pyx_v_dl == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4529, __pyx_L3_error)
    __pyx_v_d = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_d == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4530, __pyx_L3_error)
    __pyx_v_du = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_du == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4530, __pyx_L3_error)
    __pyx_v_x = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_x == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4530, __pyx_L3_error)
    __pyx_v_batchCount = __Pyx_PyLong_As_int(values[7]); if (unlikely((__pyx_v_batchCount == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4530, __pyx_L3_error)
    __pyx_v_pBuffer = __Pyx_PyLong_As_size_t(values[8]); if (unlikely((__pyx_v_pBuffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4531, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("zgtsvInterleavedBatch", 1, 9, 9, __pyx_nargs); __PYX_ERR(0, 4528, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.zgtsvInterleavedBatch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_468zgtsvInterleavedBatch(__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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_468zgtsvInterleavedBatch(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4528, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4528, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":4540
 *     check_status(status)
 * 
 * cpdef size_t sgpsvInterleavedBatch_bufferSizeExt(             # <<<<<<<<<<<<<<
 *         intptr_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) except? -1:
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_471sgpsvInterleavedBatch_bufferSizeExt(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static size_t __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_sgpsvInterleavedBatch_bufferSizeExt(intptr_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_backends/cuda/libs/cusparse.pyx":4544
 *         size_t du, size_t dw, size_t x, int batchCount) except? -1:
 *     cdef size_t pBufferSizeInBytes
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseSgpsvInterleavedBatch_bufferSizeExt(
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4544, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":4545
 *     cdef size_t pBufferSizeInBytes
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseSgpsvInterleavedBatch_bufferSizeExt(
 *             <cusparseHandle_t>handle, algo, m, <const float*>ds,
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "cupy_backends/cuda/libs/cusparse.pyx":4546
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":4545
 *     cdef size_t pBufferSizeInBytes
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseSgpsvInterleavedBatch_bufferSizeExt(
 *             <cusparseHandle_t>handle, algo, m, <const float*>ds,
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy_backends/cuda/libs/cusparse.pyx":4550
 *             <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_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4550, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":4551
 *             <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_backends/cuda/libs/cusparse.pyx":4540
 *     check_status(status)
 * 
 * cpdef size_t sgpsvInterleavedBatch_bufferSizeExt(             # <<<<<<<<<<<<<<
 *         intptr_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) except? -1:
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.sgpsvInterleavedBatch_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1L;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_471sgpsvInterleavedBatch_bufferSizeExt(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_470sgpsvInterleavedBatch_bufferSizeExt, "sgpsvInterleavedBatch_bufferSizeExt(intptr_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_13cupy_backends_4cuda_4libs_8cusparse_471sgpsvInterleavedBatch_bufferSizeExt(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0};
  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);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_algo,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_ds,&__pyx_mstate_global->__pyx_n_u_dl,&__pyx_mstate_global->__pyx_n_u_d,&__pyx_mstate_global->__pyx_n_u_du,&__pyx_mstate_global->__pyx_n_u_dw,&__pyx_mstate_global->__pyx_n_u_x,&__pyx_mstate_global->__pyx_n_u_batchCount,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 4540, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 4540, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 4540, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 4540, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 4540, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 4540, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4540, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4540, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4540, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4540, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4540, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "sgpsvInterleavedBatch_bufferSizeExt", 0) < (0)) __PYX_ERR(0, 4540, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 10; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("sgpsvInterleavedBatch_bufferSizeExt", 1, 10, 10, i); __PYX_ERR(0, 4540, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 10)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4540, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4540, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4540, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4540, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4540, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 4540, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 4540, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 4540, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 4540, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 4540, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4541, __pyx_L3_error)
    __pyx_v_algo = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_algo == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4541, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4541, __pyx_L3_error)
    __pyx_v_ds = __Pyx_PyLong_As_size_t(values[3]); if (unlikely((__pyx_v_ds == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4541, __pyx_L3_error)
    __pyx_v_dl = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_dl == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4541, __pyx_L3_error)
    __pyx_v_d = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_d == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4541, __pyx_L3_error)
    __pyx_v_du = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_du == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4542, __pyx_L3_error)
    __pyx_v_dw = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_dw == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4542, __pyx_L3_error)
    __pyx_v_x = __Pyx_PyLong_As_size_t(values[8]); if (unlikely((__pyx_v_x == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4542, __pyx_L3_error)
    __pyx_v_batchCount = __Pyx_PyLong_As_int(values[9]); if (unlikely((__pyx_v_batchCount == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4542, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("sgpsvInterleavedBatch_bufferSizeExt", 1, 10, 10, __pyx_nargs); __PYX_ERR(0, 4540, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.sgpsvInterleavedBatch_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_470sgpsvInterleavedBatch_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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_470sgpsvInterleavedBatch_bufferSizeExt(CYTHON_UNUSED PyObject *__pyx_self, intptr_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
  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("sgpsvInterleavedBatch_bufferSizeExt", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(__pyx_t_1 == ((size_t)-1L) && PyErr_Occurred())) __PYX_ERR(0, 4540, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyLong_FromSize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4540, __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_backends.cuda.libs.cusparse.sgpsvInterleavedBatch_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy_backends/cuda/libs/cusparse.pyx":4553
 *     return <size_t>pBufferSizeInBytes
 * 
 * cpdef size_t dgpsvInterleavedBatch_bufferSizeExt(             # <<<<<<<<<<<<<<
 *         intptr_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) except? -1:
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_473dgpsvInterleavedBatch_bufferSizeExt(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static size_t __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_dgpsvInterleavedBatch_bufferSizeExt(intptr_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_backends/cuda/libs/cusparse.pyx":4557
 *         size_t du, size_t dw, size_t x, int batchCount) except? -1:
 *     cdef size_t pBufferSizeInBytes
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseDgpsvInterleavedBatch_bufferSizeExt(
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4557, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":4558
 *     cdef size_t pBufferSizeInBytes
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseDgpsvInterleavedBatch_bufferSizeExt(
 *             <cusparseHandle_t>handle, algo, m, <const double*>ds,
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "cupy_backends/cuda/libs/cusparse.pyx":4559
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":4558
 *     cdef size_t pBufferSizeInBytes
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseDgpsvInterleavedBatch_bufferSizeExt(
 *             <cusparseHandle_t>handle, algo, m, <const double*>ds,
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy_backends/cuda/libs/cusparse.pyx":4564
 *             <const double*>dw, <const double*>x, batchCount,
 *             &pBufferSizeInBytes)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return <size_t>pBufferSizeInBytes
 * 
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4564, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":4565
 *             &pBufferSizeInBytes)
 *     check_status(status)
 *     return <size_t>pBufferSizeInBytes             # <<<<<<<<<<<<<<
 * 
 * cpdef size_t cgpsvInterleavedBatch_bufferSizeExt(
*/
  __pyx_r = ((size_t)__pyx_v_pBufferSizeInBytes);
  goto __pyx_L0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":4553
 *     return <size_t>pBufferSizeInBytes
 * 
 * cpdef size_t dgpsvInterleavedBatch_bufferSizeExt(             # <<<<<<<<<<<<<<
 *         intptr_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) except? -1:
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.dgpsvInterleavedBatch_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1L;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_473dgpsvInterleavedBatch_bufferSizeExt(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_472dgpsvInterleavedBatch_bufferSizeExt, "dgpsvInterleavedBatch_bufferSizeExt(intptr_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_13cupy_backends_4cuda_4libs_8cusparse_473dgpsvInterleavedBatch_bufferSizeExt(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0};
  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);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_algo,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_ds,&__pyx_mstate_global->__pyx_n_u_dl,&__pyx_mstate_global->__pyx_n_u_d,&__pyx_mstate_global->__pyx_n_u_du,&__pyx_mstate_global->__pyx_n_u_dw,&__pyx_mstate_global->__pyx_n_u_x,&__pyx_mstate_global->__pyx_n_u_batchCount,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 4553, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 4553, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 4553, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 4553, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 4553, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 4553, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4553, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4553, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4553, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4553, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4553, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "dgpsvInterleavedBatch_bufferSizeExt", 0) < (0)) __PYX_ERR(0, 4553, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 10; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("dgpsvInterleavedBatch_bufferSizeExt", 1, 10, 10, i); __PYX_ERR(0, 4553, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 10)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4553, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4553, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4553, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4553, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4553, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 4553, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 4553, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 4553, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 4553, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 4553, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4554, __pyx_L3_error)
    __pyx_v_algo = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_algo == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4554, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4554, __pyx_L3_error)
    __pyx_v_ds = __Pyx_PyLong_As_size_t(values[3]); if (unlikely((__pyx_v_ds == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4554, __pyx_L3_error)
    __pyx_v_dl = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_dl == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4554, __pyx_L3_error)
    __pyx_v_d = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_d == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4554, __pyx_L3_error)
    __pyx_v_du = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_du == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4555, __pyx_L3_error)
    __pyx_v_dw = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_dw == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4555, __pyx_L3_error)
    __pyx_v_x = __Pyx_PyLong_As_size_t(values[8]); if (unlikely((__pyx_v_x == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4555, __pyx_L3_error)
    __pyx_v_batchCount = __Pyx_PyLong_As_int(values[9]); if (unlikely((__pyx_v_batchCount == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4555, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("dgpsvInterleavedBatch_bufferSizeExt", 1, 10, 10, __pyx_nargs); __PYX_ERR(0, 4553, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.dgpsvInterleavedBatch_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_472dgpsvInterleavedBatch_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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_472dgpsvInterleavedBatch_bufferSizeExt(CYTHON_UNUSED PyObject *__pyx_self, intptr_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
  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("dgpsvInterleavedBatch_bufferSizeExt", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(__pyx_t_1 == ((size_t)-1L) && PyErr_Occurred())) __PYX_ERR(0, 4553, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyLong_FromSize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4553, __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_backends.cuda.libs.cusparse.dgpsvInterleavedBatch_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy_backends/cuda/libs/cusparse.pyx":4567
 *     return <size_t>pBufferSizeInBytes
 * 
 * cpdef size_t cgpsvInterleavedBatch_bufferSizeExt(             # <<<<<<<<<<<<<<
 *         intptr_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) except? -1:
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_475cgpsvInterleavedBatch_bufferSizeExt(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static size_t __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_cgpsvInterleavedBatch_bufferSizeExt(intptr_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_backends/cuda/libs/cusparse.pyx":4571
 *         size_t du, size_t dw, size_t x, int batchCount) except? -1:
 *     cdef size_t pBufferSizeInBytes
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseCgpsvInterleavedBatch_bufferSizeExt(
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4571, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":4572
 *     cdef size_t pBufferSizeInBytes
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseCgpsvInterleavedBatch_bufferSizeExt(
 *             <cusparseHandle_t>handle, algo, m, <const cuComplex*>ds,
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "cupy_backends/cuda/libs/cusparse.pyx":4573
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":4572
 *     cdef size_t pBufferSizeInBytes
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseCgpsvInterleavedBatch_bufferSizeExt(
 *             <cusparseHandle_t>handle, algo, m, <const cuComplex*>ds,
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy_backends/cuda/libs/cusparse.pyx":4578
 *             <const cuComplex*>dw, <const cuComplex*>x, batchCount,
 *             &pBufferSizeInBytes)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return <size_t>pBufferSizeInBytes
 * 
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4578, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":4579
 *             &pBufferSizeInBytes)
 *     check_status(status)
 *     return <size_t>pBufferSizeInBytes             # <<<<<<<<<<<<<<
 * 
 * cpdef size_t zgpsvInterleavedBatch_bufferSizeExt(
*/
  __pyx_r = ((size_t)__pyx_v_pBufferSizeInBytes);
  goto __pyx_L0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":4567
 *     return <size_t>pBufferSizeInBytes
 * 
 * cpdef size_t cgpsvInterleavedBatch_bufferSizeExt(             # <<<<<<<<<<<<<<
 *         intptr_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) except? -1:
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.cgpsvInterleavedBatch_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1L;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_475cgpsvInterleavedBatch_bufferSizeExt(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_474cgpsvInterleavedBatch_bufferSizeExt, "cgpsvInterleavedBatch_bufferSizeExt(intptr_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_13cupy_backends_4cuda_4libs_8cusparse_475cgpsvInterleavedBatch_bufferSizeExt(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0};
  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);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_algo,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_ds,&__pyx_mstate_global->__pyx_n_u_dl,&__pyx_mstate_global->__pyx_n_u_d,&__pyx_mstate_global->__pyx_n_u_du,&__pyx_mstate_global->__pyx_n_u_dw,&__pyx_mstate_global->__pyx_n_u_x,&__pyx_mstate_global->__pyx_n_u_batchCount,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 4567, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 4567, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 4567, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 4567, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 4567, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 4567, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4567, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4567, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4567, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4567, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4567, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "cgpsvInterleavedBatch_bufferSizeExt", 0) < (0)) __PYX_ERR(0, 4567, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 10; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("cgpsvInterleavedBatch_bufferSizeExt", 1, 10, 10, i); __PYX_ERR(0, 4567, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 10)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4567, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4567, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4567, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4567, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4567, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 4567, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 4567, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 4567, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 4567, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 4567, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4568, __pyx_L3_error)
    __pyx_v_algo = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_algo == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4568, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4568, __pyx_L3_error)
    __pyx_v_ds = __Pyx_PyLong_As_size_t(values[3]); if (unlikely((__pyx_v_ds == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4568, __pyx_L3_error)
    __pyx_v_dl = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_dl == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4568, __pyx_L3_error)
    __pyx_v_d = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_d == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4568, __pyx_L3_error)
    __pyx_v_du = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_du == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4569, __pyx_L3_error)
    __pyx_v_dw = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_dw == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4569, __pyx_L3_error)
    __pyx_v_x = __Pyx_PyLong_As_size_t(values[8]); if (unlikely((__pyx_v_x == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4569, __pyx_L3_error)
    __pyx_v_batchCount = __Pyx_PyLong_As_int(values[9]); if (unlikely((__pyx_v_batchCount == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4569, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("cgpsvInterleavedBatch_bufferSizeExt", 1, 10, 10, __pyx_nargs); __PYX_ERR(0, 4567, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.cgpsvInterleavedBatch_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_474cgpsvInterleavedBatch_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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_474cgpsvInterleavedBatch_bufferSizeExt(CYTHON_UNUSED PyObject *__pyx_self, intptr_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
  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("cgpsvInterleavedBatch_bufferSizeExt", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(__pyx_t_1 == ((size_t)-1L) && PyErr_Occurred())) __PYX_ERR(0, 4567, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyLong_FromSize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4567, __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_backends.cuda.libs.cusparse.cgpsvInterleavedBatch_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy_backends/cuda/libs/cusparse.pyx":4581
 *     return <size_t>pBufferSizeInBytes
 * 
 * cpdef size_t zgpsvInterleavedBatch_bufferSizeExt(             # <<<<<<<<<<<<<<
 *         intptr_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) except? -1:
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_477zgpsvInterleavedBatch_bufferSizeExt(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static size_t __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_zgpsvInterleavedBatch_bufferSizeExt(intptr_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_backends/cuda/libs/cusparse.pyx":4585
 *         size_t du, size_t dw, size_t x, int batchCount) except? -1:
 *     cdef size_t pBufferSizeInBytes
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseZgpsvInterleavedBatch_bufferSizeExt(
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4585, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":4586
 *     cdef size_t pBufferSizeInBytes
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseZgpsvInterleavedBatch_bufferSizeExt(
 *             <cusparseHandle_t>handle, algo, m, <const cuDoubleComplex*>ds,
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "cupy_backends/cuda/libs/cusparse.pyx":4587
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":4586
 *     cdef size_t pBufferSizeInBytes
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseZgpsvInterleavedBatch_bufferSizeExt(
 *             <cusparseHandle_t>handle, algo, m, <const cuDoubleComplex*>ds,
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy_backends/cuda/libs/cusparse.pyx":4592
 *             <const cuDoubleComplex*>du, <const cuDoubleComplex*>dw,
 *             <const cuDoubleComplex*>x, batchCount, &pBufferSizeInBytes)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return <size_t>pBufferSizeInBytes
 * 
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4592, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":4593
 *             <const cuDoubleComplex*>x, batchCount, &pBufferSizeInBytes)
 *     check_status(status)
 *     return <size_t>pBufferSizeInBytes             # <<<<<<<<<<<<<<
 * 
 * cpdef void sgpsvInterleavedBatch(
*/
  __pyx_r = ((size_t)__pyx_v_pBufferSizeInBytes);
  goto __pyx_L0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":4581
 *     return <size_t>pBufferSizeInBytes
 * 
 * cpdef size_t zgpsvInterleavedBatch_bufferSizeExt(             # <<<<<<<<<<<<<<
 *         intptr_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) except? -1:
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.zgpsvInterleavedBatch_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1L;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_477zgpsvInterleavedBatch_bufferSizeExt(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_476zgpsvInterleavedBatch_bufferSizeExt, "zgpsvInterleavedBatch_bufferSizeExt(intptr_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_13cupy_backends_4cuda_4libs_8cusparse_477zgpsvInterleavedBatch_bufferSizeExt(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0};
  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);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_algo,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_ds,&__pyx_mstate_global->__pyx_n_u_dl,&__pyx_mstate_global->__pyx_n_u_d,&__pyx_mstate_global->__pyx_n_u_du,&__pyx_mstate_global->__pyx_n_u_dw,&__pyx_mstate_global->__pyx_n_u_x,&__pyx_mstate_global->__pyx_n_u_batchCount,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 4581, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 4581, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 4581, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 4581, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 4581, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 4581, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4581, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4581, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4581, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4581, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4581, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "zgpsvInterleavedBatch_bufferSizeExt", 0) < (0)) __PYX_ERR(0, 4581, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 10; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("zgpsvInterleavedBatch_bufferSizeExt", 1, 10, 10, i); __PYX_ERR(0, 4581, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 10)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4581, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4581, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4581, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4581, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4581, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 4581, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 4581, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 4581, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 4581, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 4581, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4582, __pyx_L3_error)
    __pyx_v_algo = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_algo == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4582, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4582, __pyx_L3_error)
    __pyx_v_ds = __Pyx_PyLong_As_size_t(values[3]); if (unlikely((__pyx_v_ds == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4582, __pyx_L3_error)
    __pyx_v_dl = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_dl == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4582, __pyx_L3_error)
    __pyx_v_d = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_d == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4582, __pyx_L3_error)
    __pyx_v_du = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_du == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4583, __pyx_L3_error)
    __pyx_v_dw = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_dw == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4583, __pyx_L3_error)
    __pyx_v_x = __Pyx_PyLong_As_size_t(values[8]); if (unlikely((__pyx_v_x == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4583, __pyx_L3_error)
    __pyx_v_batchCount = __Pyx_PyLong_As_int(values[9]); if (unlikely((__pyx_v_batchCount == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4583, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("zgpsvInterleavedBatch_bufferSizeExt", 1, 10, 10, __pyx_nargs); __PYX_ERR(0, 4581, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.zgpsvInterleavedBatch_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_476zgpsvInterleavedBatch_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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_476zgpsvInterleavedBatch_bufferSizeExt(CYTHON_UNUSED PyObject *__pyx_self, intptr_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
  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("zgpsvInterleavedBatch_bufferSizeExt", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(__pyx_t_1 == ((size_t)-1L) && PyErr_Occurred())) __PYX_ERR(0, 4581, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyLong_FromSize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4581, __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_backends.cuda.libs.cusparse.zgpsvInterleavedBatch_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy_backends/cuda/libs/cusparse.pyx":4595
 *     return <size_t>pBufferSizeInBytes
 * 
 * cpdef void sgpsvInterleavedBatch(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int algo, int m, size_t ds,
 *         size_t dl, size_t d, size_t du, size_t dw,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_479sgpsvInterleavedBatch(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_sgpsvInterleavedBatch(intptr_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;
  __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_backends/cuda/libs/cusparse.pyx":4599
 *         size_t dl, size_t d, size_t du, size_t dw,
 *         size_t x, int batchCount, size_t pBuffer) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseSgpsvInterleavedBatch(
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4599, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":4600
 *         size_t x, int batchCount, size_t pBuffer) except *:
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseSgpsvInterleavedBatch(
 *             <cusparseHandle_t>handle, algo, m, <float*>ds, <float*>dl,
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "cupy_backends/cuda/libs/cusparse.pyx":4601
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":4600
 *         size_t x, int batchCount, size_t pBuffer) except *:
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseSgpsvInterleavedBatch(
 *             <cusparseHandle_t>handle, algo, m, <float*>ds, <float*>dl,
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy_backends/cuda/libs/cusparse.pyx":4605
 *             <float*>d, <float*>du, <float*>dw, <float*>x, batchCount,
 *             <void*>pBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef void dgpsvInterleavedBatch(
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4605, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":4595
 *     return <size_t>pBufferSizeInBytes
 * 
 * cpdef void sgpsvInterleavedBatch(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int algo, int m, size_t ds,
 *         size_t dl, size_t d, size_t du, size_t dw,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.sgpsvInterleavedBatch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_479sgpsvInterleavedBatch(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_478sgpsvInterleavedBatch, "sgpsvInterleavedBatch(intptr_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) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_479sgpsvInterleavedBatch(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[11] = {0,0,0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("sgpsvInterleavedBatch (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_algo,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_ds,&__pyx_mstate_global->__pyx_n_u_dl,&__pyx_mstate_global->__pyx_n_u_d,&__pyx_mstate_global->__pyx_n_u_du,&__pyx_mstate_global->__pyx_n_u_dw,&__pyx_mstate_global->__pyx_n_u_x,&__pyx_mstate_global->__pyx_n_u_batchCount,&__pyx_mstate_global->__pyx_n_u_pBuffer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 4595, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 11:
        values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 4595, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 4595, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 4595, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 4595, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 4595, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 4595, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4595, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4595, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4595, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4595, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4595, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "sgpsvInterleavedBatch", 0) < (0)) __PYX_ERR(0, 4595, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 11; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("sgpsvInterleavedBatch", 1, 11, 11, i); __PYX_ERR(0, 4595, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 11)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4595, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4595, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4595, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4595, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4595, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 4595, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 4595, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 4595, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 4595, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 4595, __pyx_L3_error)
      values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 4595, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4596, __pyx_L3_error)
    __pyx_v_algo = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_algo == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4596, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4596, __pyx_L3_error)
    __pyx_v_ds = __Pyx_PyLong_As_size_t(values[3]); if (unlikely((__pyx_v_ds == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4596, __pyx_L3_error)
    __pyx_v_dl = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_dl == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4597, __pyx_L3_error)
    __pyx_v_d = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_d == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4597, __pyx_L3_error)
    __pyx_v_du = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_du == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4597, __pyx_L3_error)
    __pyx_v_dw = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_dw == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4597, __pyx_L3_error)
    __pyx_v_x = __Pyx_PyLong_As_size_t(values[8]); if (unlikely((__pyx_v_x == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4598, __pyx_L3_error)
    __pyx_v_batchCount = __Pyx_PyLong_As_int(values[9]); if (unlikely((__pyx_v_batchCount == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4598, __pyx_L3_error)
    __pyx_v_pBuffer = __Pyx_PyLong_As_size_t(values[10]); if (unlikely((__pyx_v_pBuffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4598, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("sgpsvInterleavedBatch", 1, 11, 11, __pyx_nargs); __PYX_ERR(0, 4595, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.sgpsvInterleavedBatch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_478sgpsvInterleavedBatch(__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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_478sgpsvInterleavedBatch(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4595, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4595, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":4607
 *     check_status(status)
 * 
 * cpdef void dgpsvInterleavedBatch(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int algo, int m, size_t ds,
 *         size_t dl, size_t d, size_t du, size_t dw,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_481dgpsvInterleavedBatch(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_dgpsvInterleavedBatch(intptr_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;
  __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_backends/cuda/libs/cusparse.pyx":4611
 *         size_t dl, size_t d, size_t du, size_t dw,
 *         size_t x, int batchCount, size_t pBuffer) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseDgpsvInterleavedBatch(
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4611, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":4612
 *         size_t x, int batchCount, size_t pBuffer) except *:
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseDgpsvInterleavedBatch(
 *             <cusparseHandle_t>handle, algo, m, <double*>ds, <double*>dl,
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "cupy_backends/cuda/libs/cusparse.pyx":4613
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":4612
 *         size_t x, int batchCount, size_t pBuffer) except *:
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseDgpsvInterleavedBatch(
 *             <cusparseHandle_t>handle, algo, m, <double*>ds, <double*>dl,
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy_backends/cuda/libs/cusparse.pyx":4617
 *             <double*>d, <double*>du, <double*>dw, <double*>x, batchCount,
 *             <void*>pBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef void cgpsvInterleavedBatch(
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4617, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":4607
 *     check_status(status)
 * 
 * cpdef void dgpsvInterleavedBatch(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int algo, int m, size_t ds,
 *         size_t dl, size_t d, size_t du, size_t dw,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.dgpsvInterleavedBatch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_481dgpsvInterleavedBatch(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_480dgpsvInterleavedBatch, "dgpsvInterleavedBatch(intptr_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) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_481dgpsvInterleavedBatch(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[11] = {0,0,0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dgpsvInterleavedBatch (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_algo,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_ds,&__pyx_mstate_global->__pyx_n_u_dl,&__pyx_mstate_global->__pyx_n_u_d,&__pyx_mstate_global->__pyx_n_u_du,&__pyx_mstate_global->__pyx_n_u_dw,&__pyx_mstate_global->__pyx_n_u_x,&__pyx_mstate_global->__pyx_n_u_batchCount,&__pyx_mstate_global->__pyx_n_u_pBuffer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 4607, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 11:
        values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 4607, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 4607, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 4607, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 4607, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 4607, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 4607, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4607, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4607, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4607, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4607, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4607, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "dgpsvInterleavedBatch", 0) < (0)) __PYX_ERR(0, 4607, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 11; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("dgpsvInterleavedBatch", 1, 11, 11, i); __PYX_ERR(0, 4607, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 11)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4607, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4607, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4607, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4607, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4607, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 4607, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 4607, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 4607, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 4607, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 4607, __pyx_L3_error)
      values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 4607, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4608, __pyx_L3_error)
    __pyx_v_algo = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_algo == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4608, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4608, __pyx_L3_error)
    __pyx_v_ds = __Pyx_PyLong_As_size_t(values[3]); if (unlikely((__pyx_v_ds == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4608, __pyx_L3_error)
    __pyx_v_dl = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_dl == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4609, __pyx_L3_error)
    __pyx_v_d = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_d == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4609, __pyx_L3_error)
    __pyx_v_du = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_du == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4609, __pyx_L3_error)
    __pyx_v_dw = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_dw == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4609, __pyx_L3_error)
    __pyx_v_x = __Pyx_PyLong_As_size_t(values[8]); if (unlikely((__pyx_v_x == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4610, __pyx_L3_error)
    __pyx_v_batchCount = __Pyx_PyLong_As_int(values[9]); if (unlikely((__pyx_v_batchCount == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4610, __pyx_L3_error)
    __pyx_v_pBuffer = __Pyx_PyLong_As_size_t(values[10]); if (unlikely((__pyx_v_pBuffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4610, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("dgpsvInterleavedBatch", 1, 11, 11, __pyx_nargs); __PYX_ERR(0, 4607, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.dgpsvInterleavedBatch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_480dgpsvInterleavedBatch(__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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_480dgpsvInterleavedBatch(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4607, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4607, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":4619
 *     check_status(status)
 * 
 * cpdef void cgpsvInterleavedBatch(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int algo, int m, size_t ds,
 *         size_t dl, size_t d, size_t du, size_t dw,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_483cgpsvInterleavedBatch(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_cgpsvInterleavedBatch(intptr_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;
  __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_backends/cuda/libs/cusparse.pyx":4623
 *         size_t dl, size_t d, size_t du, size_t dw,
 *         size_t x, int batchCount, size_t pBuffer) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseCgpsvInterleavedBatch(
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4623, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":4624
 *         size_t x, int batchCount, size_t pBuffer) except *:
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseCgpsvInterleavedBatch(
 *             <cusparseHandle_t>handle, algo, m, <cuComplex*>ds, <cuComplex*>dl,
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "cupy_backends/cuda/libs/cusparse.pyx":4625
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":4624
 *         size_t x, int batchCount, size_t pBuffer) except *:
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseCgpsvInterleavedBatch(
 *             <cusparseHandle_t>handle, algo, m, <cuComplex*>ds, <cuComplex*>dl,
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy_backends/cuda/libs/cusparse.pyx":4629
 *             <cuComplex*>d, <cuComplex*>du, <cuComplex*>dw, <cuComplex*>x,
 *             batchCount, <void*>pBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef void zgpsvInterleavedBatch(
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4629, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":4619
 *     check_status(status)
 * 
 * cpdef void cgpsvInterleavedBatch(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int algo, int m, size_t ds,
 *         size_t dl, size_t d, size_t du, size_t dw,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.cgpsvInterleavedBatch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_483cgpsvInterleavedBatch(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_482cgpsvInterleavedBatch, "cgpsvInterleavedBatch(intptr_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) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_483cgpsvInterleavedBatch(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[11] = {0,0,0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("cgpsvInterleavedBatch (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_algo,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_ds,&__pyx_mstate_global->__pyx_n_u_dl,&__pyx_mstate_global->__pyx_n_u_d,&__pyx_mstate_global->__pyx_n_u_du,&__pyx_mstate_global->__pyx_n_u_dw,&__pyx_mstate_global->__pyx_n_u_x,&__pyx_mstate_global->__pyx_n_u_batchCount,&__pyx_mstate_global->__pyx_n_u_pBuffer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 4619, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 11:
        values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 4619, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 4619, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 4619, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 4619, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 4619, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 4619, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4619, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4619, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4619, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4619, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4619, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "cgpsvInterleavedBatch", 0) < (0)) __PYX_ERR(0, 4619, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 11; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("cgpsvInterleavedBatch", 1, 11, 11, i); __PYX_ERR(0, 4619, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 11)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4619, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4619, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4619, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4619, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4619, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 4619, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 4619, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 4619, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 4619, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 4619, __pyx_L3_error)
      values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 4619, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4620, __pyx_L3_error)
    __pyx_v_algo = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_algo == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4620, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4620, __pyx_L3_error)
    __pyx_v_ds = __Pyx_PyLong_As_size_t(values[3]); if (unlikely((__pyx_v_ds == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4620, __pyx_L3_error)
    __pyx_v_dl = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_dl == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4621, __pyx_L3_error)
    __pyx_v_d = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_d == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4621, __pyx_L3_error)
    __pyx_v_du = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_du == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4621, __pyx_L3_error)
    __pyx_v_dw = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_dw == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4621, __pyx_L3_error)
    __pyx_v_x = __Pyx_PyLong_As_size_t(values[8]); if (unlikely((__pyx_v_x == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4622, __pyx_L3_error)
    __pyx_v_batchCount = __Pyx_PyLong_As_int(values[9]); if (unlikely((__pyx_v_batchCount == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4622, __pyx_L3_error)
    __pyx_v_pBuffer = __Pyx_PyLong_As_size_t(values[10]); if (unlikely((__pyx_v_pBuffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4622, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("cgpsvInterleavedBatch", 1, 11, 11, __pyx_nargs); __PYX_ERR(0, 4619, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.cgpsvInterleavedBatch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_482cgpsvInterleavedBatch(__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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_482cgpsvInterleavedBatch(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4619, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4619, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":4631
 *     check_status(status)
 * 
 * cpdef void zgpsvInterleavedBatch(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int algo, int m, size_t ds,
 *         size_t dl, size_t d, size_t du, size_t dw,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_485zgpsvInterleavedBatch(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_zgpsvInterleavedBatch(intptr_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;
  __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_backends/cuda/libs/cusparse.pyx":4635
 *         size_t dl, size_t d, size_t du, size_t dw,
 *         size_t x, int batchCount, size_t pBuffer) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseZgpsvInterleavedBatch(
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4635, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":4636
 *         size_t x, int batchCount, size_t pBuffer) except *:
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseZgpsvInterleavedBatch(
 *             <cusparseHandle_t>handle, algo, m, <cuDoubleComplex*>ds,
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "cupy_backends/cuda/libs/cusparse.pyx":4637
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":4636
 *         size_t x, int batchCount, size_t pBuffer) except *:
 *     _setStream(handle)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseZgpsvInterleavedBatch(
 *             <cusparseHandle_t>handle, algo, m, <cuDoubleComplex*>ds,
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy_backends/cuda/libs/cusparse.pyx":4642
 *             <cuDoubleComplex*>dw, <cuDoubleComplex*>x, batchCount,
 *             <void*>pBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * ############################################################
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4642, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":4631
 *     check_status(status)
 * 
 * cpdef void zgpsvInterleavedBatch(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int algo, int m, size_t ds,
 *         size_t dl, size_t d, size_t du, size_t dw,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.zgpsvInterleavedBatch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_485zgpsvInterleavedBatch(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_484zgpsvInterleavedBatch, "zgpsvInterleavedBatch(intptr_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) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_485zgpsvInterleavedBatch(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[11] = {0,0,0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("zgpsvInterleavedBatch (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_algo,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_ds,&__pyx_mstate_global->__pyx_n_u_dl,&__pyx_mstate_global->__pyx_n_u_d,&__pyx_mstate_global->__pyx_n_u_du,&__pyx_mstate_global->__pyx_n_u_dw,&__pyx_mstate_global->__pyx_n_u_x,&__pyx_mstate_global->__pyx_n_u_batchCount,&__pyx_mstate_global->__pyx_n_u_pBuffer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 4631, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 11:
        values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 4631, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 4631, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 4631, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 4631, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 4631, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 4631, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4631, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4631, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4631, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4631, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4631, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "zgpsvInterleavedBatch", 0) < (0)) __PYX_ERR(0, 4631, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 11; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("zgpsvInterleavedBatch", 1, 11, 11, i); __PYX_ERR(0, 4631, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 11)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4631, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4631, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4631, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4631, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4631, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 4631, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 4631, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 4631, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 4631, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 4631, __pyx_L3_error)
      values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 4631, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4632, __pyx_L3_error)
    __pyx_v_algo = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_algo == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4632, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4632, __pyx_L3_error)
    __pyx_v_ds = __Pyx_PyLong_As_size_t(values[3]); if (unlikely((__pyx_v_ds == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4632, __pyx_L3_error)
    __pyx_v_dl = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_dl == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4633, __pyx_L3_error)
    __pyx_v_d = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_d == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4633, __pyx_L3_error)
    __pyx_v_du = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_du == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4633, __pyx_L3_error)
    __pyx_v_dw = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_dw == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4633, __pyx_L3_error)
    __pyx_v_x = __Pyx_PyLong_As_size_t(values[8]); if (unlikely((__pyx_v_x == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4634, __pyx_L3_error)
    __pyx_v_batchCount = __Pyx_PyLong_As_int(values[9]); if (unlikely((__pyx_v_batchCount == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4634, __pyx_L3_error)
    __pyx_v_pBuffer = __Pyx_PyLong_As_size_t(values[10]); if (unlikely((__pyx_v_pBuffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4634, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("zgpsvInterleavedBatch", 1, 11, 11, __pyx_nargs); __PYX_ERR(0, 4631, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.zgpsvInterleavedBatch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_484zgpsvInterleavedBatch(__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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_484zgpsvInterleavedBatch(CYTHON_UNUSED PyObject *__pyx_self, intptr_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_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4631, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4631, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":4647
 * # 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? -1:
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_487createSpVec(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static size_t __pyx_f_13cupy_backends_4cuda_4libs_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_backends/cuda/libs/cusparse.pyx":4651
 *                          DataType valueType) except? -1:
 *     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_backends/cuda/libs/cusparse.pyx":4653
 *     status = cusparseCreateSpVec(&desc, size, nnz, <void*>indices,
 *                                  <void*>values, idxType, idxBase, valueType)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return <size_t>desc
 * 
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4653, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":4654
 *                                  <void*>values, idxType, idxBase, valueType)
 *     check_status(status)
 *     return <size_t>desc             # <<<<<<<<<<<<<<
 * 
 * cpdef void destroySpVec(size_t desc) except *:
*/
  __pyx_r = ((size_t)__pyx_v_desc);
  goto __pyx_L0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":4647
 * # 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? -1:
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.createSpVec", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1L;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_487createSpVec(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_486createSpVec, "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_13cupy_backends_4cuda_4libs_8cusparse_487createSpVec(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[7] = {0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("createSpVec (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_size,&__pyx_mstate_global->__pyx_n_u_nnz,&__pyx_mstate_global->__pyx_n_u_indices,&__pyx_mstate_global->__pyx_n_u_values,&__pyx_mstate_global->__pyx_n_u_idxType,&__pyx_mstate_global->__pyx_n_u_idxBase,&__pyx_mstate_global->__pyx_n_u_valueType,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 4647, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 4647, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 4647, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4647, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4647, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4647, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4647, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4647, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "createSpVec", 0) < (0)) __PYX_ERR(0, 4647, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 7; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("createSpVec", 1, 7, 7, i); __PYX_ERR(0, 4647, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 7)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4647, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4647, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4647, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4647, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4647, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 4647, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 4647, __pyx_L3_error)
    }
    __pyx_v_size = __Pyx_PyLong_As_int64_t(values[0]); if (unlikely((__pyx_v_size == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4647, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyLong_As_int64_t(values[1]); if (unlikely((__pyx_v_nnz == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4647, __pyx_L3_error)
    __pyx_v_indices = PyLong_AsSsize_t(values[2]); if (unlikely((__pyx_v_indices == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4647, __pyx_L3_error)
    __pyx_v_values = PyLong_AsSsize_t(values[3]); if (unlikely((__pyx_v_values == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4648, __pyx_L3_error)
    __pyx_v_idxType = __Pyx_PyLong_As_cusparseIndexType_t(values[4]); if (unlikely((__pyx_v_idxType == ((cusparseIndexType_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4648, __pyx_L3_error)
    __pyx_v_idxBase = __Pyx_PyLong_As_cusparseIndexBase_t(values[5]); if (unlikely((__pyx_v_idxBase == ((cusparseIndexBase_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4648, __pyx_L3_error)
    __pyx_v_valueType = __Pyx_PyLong_As_cudaDataType(values[6]); if (unlikely((__pyx_v_valueType == ((cudaDataType)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4649, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("createSpVec", 1, 7, 7, __pyx_nargs); __PYX_ERR(0, 4647, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.createSpVec", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_486createSpVec(__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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_486createSpVec(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_13cupy_backends_4cuda_4libs_8cusparse_createSpVec(__pyx_v_size, __pyx_v_nnz, __pyx_v_indices, __pyx_v_values, __pyx_v_idxType, __pyx_v_idxBase, __pyx_v_valueType, 1); if (unlikely(__pyx_t_1 == ((size_t)-1L) && PyErr_Occurred())) __PYX_ERR(0, 4647, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyLong_FromSize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4647, __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_backends.cuda.libs.cusparse.createSpVec", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy_backends/cuda/libs/cusparse.pyx":4656
 *     return <size_t>desc
 * 
 * cpdef void destroySpVec(size_t desc) except *:             # <<<<<<<<<<<<<<
 *     status = cusparseDestroySpVec(<SpVecDescr>desc)
 *     check_status(status)
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_489destroySpVec(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_destroySpVec(size_t __pyx_v_desc, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  __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_backends/cuda/libs/cusparse.pyx":4657
 * 
 * cpdef void destroySpVec(size_t desc) except *:
 *     status = cusparseDestroySpVec(<SpVecDescr>desc)             # <<<<<<<<<<<<<<
 *     check_status(status)
 * 
*/
  __pyx_v_status = cusparseDestroySpVec(((cusparseSpVecDescr_t)__pyx_v_desc));

  /* "cupy_backends/cuda/libs/cusparse.pyx":4658
 * cpdef void destroySpVec(size_t desc) except *:
 *     status = cusparseDestroySpVec(<SpVecDescr>desc)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef SpVecAttributes spVecGet(size_t desc):
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4658, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":4656
 *     return <size_t>desc
 * 
 * cpdef void destroySpVec(size_t desc) except *:             # <<<<<<<<<<<<<<
 *     status = cusparseDestroySpVec(<SpVecDescr>desc)
 *     check_status(status)
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.destroySpVec", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_489destroySpVec(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_488destroySpVec, "destroySpVec(size_t desc) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_489destroySpVec(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  size_t __pyx_v_desc;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("destroySpVec (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_desc,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 4656, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4656, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "destroySpVec", 0) < (0)) __PYX_ERR(0, 4656, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("destroySpVec", 1, 1, 1, i); __PYX_ERR(0, 4656, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4656, __pyx_L3_error)
    }
    __pyx_v_desc = __Pyx_PyLong_As_size_t(values[0]); if (unlikely((__pyx_v_desc == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4656, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("destroySpVec", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 4656, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.destroySpVec", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_488destroySpVec(__pyx_self, __pyx_v_desc);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_488destroySpVec(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_f_13cupy_backends_4cuda_4libs_8cusparse_destroySpVec(__pyx_v_desc, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4656, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4656, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":4660
 *     check_status(status)
 * 
 * cpdef SpVecAttributes spVecGet(size_t desc):             # <<<<<<<<<<<<<<
 *     cdef int64_t size, nnz
 *     cdef intptr_t indices, values
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_491spVecGet(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_SpVecAttributes *__pyx_f_13cupy_backends_4cuda_4libs_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_13cupy_backends_4cuda_4libs_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;
  PyObject *__pyx_t_9 = NULL;
  size_t __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("spVecGet", 0);

  /* "cupy_backends/cuda/libs/cusparse.pyx":4666
 *     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_backends/cuda/libs/cusparse.pyx":4669
 *                               <void**>&indices, <void**>&values,
 *                               &idxType, &idxBase, &valueType)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return SpVecAttributes(size, nnz, indices, values, idxType, idxBase,
 *                            valueType)
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4669, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":4670
 *                               &idxType, &idxBase, &valueType)
 *     check_status(status)
 *     return SpVecAttributes(size, nnz, indices, values, idxType, idxBase,             # <<<<<<<<<<<<<<
 *                            valueType)
 * 
*/
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_2 = NULL;
  __pyx_t_3 = __Pyx_PyLong_From_int64_t(__pyx_v_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4670, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyLong_From_int64_t(__pyx_v_nnz); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4670, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyLong_FromSsize_t(__pyx_v_indices); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4670, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyLong_FromSsize_t(__pyx_v_values); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4670, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = __Pyx_PyLong_From_cusparseIndexType_t(__pyx_v_idxType); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4670, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = __Pyx_PyLong_From_cusparseIndexBase_t(__pyx_v_idxBase); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4670, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);

  /* "cupy_backends/cuda/libs/cusparse.pyx":4671
 *     check_status(status)
 *     return SpVecAttributes(size, nnz, indices, values, idxType, idxBase,
 *                            valueType)             # <<<<<<<<<<<<<<
 * 
 * cpdef int spVecGetIndexBase(size_t desc) except? -1:
*/
  __pyx_t_9 = __Pyx_PyLong_From_cudaDataType(__pyx_v_valueType); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4671, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_10 = 1;
  {
    PyObject *__pyx_callargs[8] = {__pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_t_7, __pyx_t_8, __pyx_t_9};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_13cupy_backends_4cuda_4libs_8cusparse_SpVecAttributes, __pyx_callargs+__pyx_t_10, (8-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4670, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_r = ((struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_SpVecAttributes *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":4660
 *     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_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.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_13cupy_backends_4cuda_4libs_8cusparse_491spVecGet(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_490spVecGet, "spVecGet(size_t desc) -> SpVecAttributes");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_491spVecGet(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  size_t __pyx_v_desc;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("spVecGet (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_desc,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 4660, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4660, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "spVecGet", 0) < (0)) __PYX_ERR(0, 4660, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("spVecGet", 1, 1, 1, i); __PYX_ERR(0, 4660, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4660, __pyx_L3_error)
    }
    __pyx_v_desc = __Pyx_PyLong_As_size_t(values[0]); if (unlikely((__pyx_v_desc == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4660, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("spVecGet", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 4660, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.spVecGet", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_490spVecGet(__pyx_self, __pyx_v_desc);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_490spVecGet(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_13cupy_backends_4cuda_4libs_8cusparse_spVecGet(__pyx_v_desc, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4660, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":4673
 *                            valueType)
 * 
 * cpdef int spVecGetIndexBase(size_t desc) except? -1:             # <<<<<<<<<<<<<<
 *     cdef IndexBase idxBase
 *     status = cusparseSpVecGetIndexBase(<SpVecDescr>desc, &idxBase)
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_493spVecGetIndexBase(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static int __pyx_f_13cupy_backends_4cuda_4libs_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_backends/cuda/libs/cusparse.pyx":4675
 * cpdef int spVecGetIndexBase(size_t desc) except? -1:
 *     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_backends/cuda/libs/cusparse.pyx":4676
 *     cdef IndexBase idxBase
 *     status = cusparseSpVecGetIndexBase(<SpVecDescr>desc, &idxBase)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return <int>idxBase
 * 
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4676, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":4677
 *     status = cusparseSpVecGetIndexBase(<SpVecDescr>desc, &idxBase)
 *     check_status(status)
 *     return <int>idxBase             # <<<<<<<<<<<<<<
 * 
 * cpdef intptr_t spVecGetValues(size_t desc) except? -1:
*/
  __pyx_r = ((int)__pyx_v_idxBase);
  goto __pyx_L0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":4673
 *                            valueType)
 * 
 * cpdef int spVecGetIndexBase(size_t desc) except? -1:             # <<<<<<<<<<<<<<
 *     cdef IndexBase idxBase
 *     status = cusparseSpVecGetIndexBase(<SpVecDescr>desc, &idxBase)
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.spVecGetIndexBase", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_493spVecGetIndexBase(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_492spVecGetIndexBase, "spVecGetIndexBase(size_t desc) -> int");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_493spVecGetIndexBase(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  size_t __pyx_v_desc;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("spVecGetIndexBase (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_desc,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 4673, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4673, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "spVecGetIndexBase", 0) < (0)) __PYX_ERR(0, 4673, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("spVecGetIndexBase", 1, 1, 1, i); __PYX_ERR(0, 4673, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4673, __pyx_L3_error)
    }
    __pyx_v_desc = __Pyx_PyLong_As_size_t(values[0]); if (unlikely((__pyx_v_desc == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4673, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("spVecGetIndexBase", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 4673, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.spVecGetIndexBase", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_492spVecGetIndexBase(__pyx_self, __pyx_v_desc);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_492spVecGetIndexBase(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_desc) {
  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("spVecGetIndexBase", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_spVecGetIndexBase(__pyx_v_desc, 1); if (unlikely(__pyx_t_1 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4673, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4673, __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_backends.cuda.libs.cusparse.spVecGetIndexBase", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy_backends/cuda/libs/cusparse.pyx":4679
 *     return <int>idxBase
 * 
 * cpdef intptr_t spVecGetValues(size_t desc) except? -1:             # <<<<<<<<<<<<<<
 *     cdef intptr_t values
 *     status = cusparseSpVecGetValues(<SpVecDescr>desc, <void**>&values)
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_495spVecGetValues(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static intptr_t __pyx_f_13cupy_backends_4cuda_4libs_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_backends/cuda/libs/cusparse.pyx":4681
 * cpdef intptr_t spVecGetValues(size_t desc) except? -1:
 *     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_backends/cuda/libs/cusparse.pyx":4682
 *     cdef intptr_t values
 *     status = cusparseSpVecGetValues(<SpVecDescr>desc, <void**>&values)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return values
 * 
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4682, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":4683
 *     status = cusparseSpVecGetValues(<SpVecDescr>desc, <void**>&values)
 *     check_status(status)
 *     return values             # <<<<<<<<<<<<<<
 * 
 * cpdef void spVecSetValues(size_t desc, intptr_t values) except *:
*/
  __pyx_r = __pyx_v_values;
  goto __pyx_L0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":4679
 *     return <int>idxBase
 * 
 * cpdef intptr_t spVecGetValues(size_t desc) except? -1:             # <<<<<<<<<<<<<<
 *     cdef intptr_t values
 *     status = cusparseSpVecGetValues(<SpVecDescr>desc, <void**>&values)
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.spVecGetValues", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1L;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_495spVecGetValues(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_494spVecGetValues, "spVecGetValues(size_t desc) -> intptr_t");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_495spVecGetValues(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  size_t __pyx_v_desc;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("spVecGetValues (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_desc,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 4679, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4679, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "spVecGetValues", 0) < (0)) __PYX_ERR(0, 4679, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("spVecGetValues", 1, 1, 1, i); __PYX_ERR(0, 4679, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4679, __pyx_L3_error)
    }
    __pyx_v_desc = __Pyx_PyLong_As_size_t(values[0]); if (unlikely((__pyx_v_desc == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4679, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("spVecGetValues", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 4679, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.spVecGetValues", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_494spVecGetValues(__pyx_self, __pyx_v_desc);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_494spVecGetValues(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_desc) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  intptr_t __pyx_t_1;
  PyObject *__pyx_t_2 = 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 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_spVecGetValues(__pyx_v_desc, 1); if (unlikely(__pyx_t_1 == ((intptr_t)-1L) && PyErr_Occurred())) __PYX_ERR(0, 4679, __pyx_L1_error)
  __pyx_t_2 = PyLong_FromSsize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4679, __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_backends.cuda.libs.cusparse.spVecGetValues", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy_backends/cuda/libs/cusparse.pyx":4685
 *     return values
 * 
 * cpdef void spVecSetValues(size_t desc, intptr_t values) except *:             # <<<<<<<<<<<<<<
 *     status = cusparseSpVecSetValues(<SpVecDescr>desc, <void*>values)
 *     check_status(status)
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_497spVecSetValues(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_spVecSetValues(size_t __pyx_v_desc, intptr_t __pyx_v_values, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  __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_backends/cuda/libs/cusparse.pyx":4686
 * 
 * cpdef void spVecSetValues(size_t desc, intptr_t values) except *:
 *     status = cusparseSpVecSetValues(<SpVecDescr>desc, <void*>values)             # <<<<<<<<<<<<<<
 *     check_status(status)
 * 
*/
  __pyx_v_status = cusparseSpVecSetValues(((cusparseSpVecDescr_t)__pyx_v_desc), ((void *)__pyx_v_values));

  /* "cupy_backends/cuda/libs/cusparse.pyx":4687
 * cpdef void spVecSetValues(size_t desc, intptr_t values) except *:
 *     status = cusparseSpVecSetValues(<SpVecDescr>desc, <void*>values)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * ############################################################
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4687, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":4685
 *     return values
 * 
 * cpdef void spVecSetValues(size_t desc, intptr_t values) except *:             # <<<<<<<<<<<<<<
 *     status = cusparseSpVecSetValues(<SpVecDescr>desc, <void*>values)
 *     check_status(status)
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.spVecSetValues", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_497spVecSetValues(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_496spVecSetValues, "spVecSetValues(size_t desc, intptr_t values) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_497spVecSetValues(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  size_t __pyx_v_desc;
  intptr_t __pyx_v_values;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("spVecSetValues (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_desc,&__pyx_mstate_global->__pyx_n_u_values,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 4685, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4685, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4685, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "spVecSetValues", 0) < (0)) __PYX_ERR(0, 4685, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("spVecSetValues", 1, 2, 2, i); __PYX_ERR(0, 4685, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4685, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4685, __pyx_L3_error)
    }
    __pyx_v_desc = __Pyx_PyLong_As_size_t(values[0]); if (unlikely((__pyx_v_desc == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4685, __pyx_L3_error)
    __pyx_v_values = PyLong_AsSsize_t(values[1]); if (unlikely((__pyx_v_values == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4685, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("spVecSetValues", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 4685, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.spVecSetValues", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_496spVecSetValues(__pyx_self, __pyx_v_desc, __pyx_v_values);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_496spVecSetValues(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_f_13cupy_backends_4cuda_4libs_8cusparse_spVecSetValues(__pyx_v_desc, __pyx_v_values, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4685, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4685, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":4692
 * # 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_13cupy_backends_4cuda_4libs_8cusparse_499createCoo(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static size_t __pyx_f_13cupy_backends_4cuda_4libs_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_backends/cuda/libs/cusparse.pyx":4697
 *                        IndexBase idxBase, DataType valueType) except? -1:
 *     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_backends/cuda/libs/cusparse.pyx":4700
 *                                <void*>cooColInd, <void*>cooValues,
 *                                cooIdxType, idxBase, valueType)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return <size_t>desc
 * 
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4700, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":4701
 *                                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_backends/cuda/libs/cusparse.pyx":4692
 * # 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_AddTraceback("cupy_backends.cuda.libs.cusparse.createCoo", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1L;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_499createCoo(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_498createCoo, "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_13cupy_backends_4cuda_4libs_8cusparse_499createCoo(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("createCoo (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_rows,&__pyx_mstate_global->__pyx_n_u_cols,&__pyx_mstate_global->__pyx_n_u_nnz,&__pyx_mstate_global->__pyx_n_u_cooRowInd,&__pyx_mstate_global->__pyx_n_u_cooColInd,&__pyx_mstate_global->__pyx_n_u_cooValues,&__pyx_mstate_global->__pyx_n_u_cooIdxType,&__pyx_mstate_global->__pyx_n_u_idxBase,&__pyx_mstate_global->__pyx_n_u_valueType,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 4692, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 4692, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 4692, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 4692, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 4692, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4692, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4692, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4692, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4692, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4692, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "createCoo", 0) < (0)) __PYX_ERR(0, 4692, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 9; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("createCoo", 1, 9, 9, i); __PYX_ERR(0, 4692, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 9)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4692, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4692, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4692, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4692, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4692, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 4692, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 4692, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 4692, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 4692, __pyx_L3_error)
    }
    __pyx_v_rows = __Pyx_PyLong_As_int64_t(values[0]); if (unlikely((__pyx_v_rows == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4692, __pyx_L3_error)
    __pyx_v_cols = __Pyx_PyLong_As_int64_t(values[1]); if (unlikely((__pyx_v_cols == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4692, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyLong_As_int64_t(values[2]); if (unlikely((__pyx_v_nnz == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4692, __pyx_L3_error)
    __pyx_v_cooRowInd = PyLong_AsSsize_t(values[3]); if (unlikely((__pyx_v_cooRowInd == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4693, __pyx_L3_error)
    __pyx_v_cooColInd = PyLong_AsSsize_t(values[4]); if (unlikely((__pyx_v_cooColInd == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4693, __pyx_L3_error)
    __pyx_v_cooValues = PyLong_AsSsize_t(values[5]); if (unlikely((__pyx_v_cooValues == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4694, __pyx_L3_error)
    __pyx_v_cooIdxType = __Pyx_PyLong_As_cusparseIndexType_t(values[6]); if (unlikely((__pyx_v_cooIdxType == ((cusparseIndexType_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4694, __pyx_L3_error)
    __pyx_v_idxBase = __Pyx_PyLong_As_cusparseIndexBase_t(values[7]); if (unlikely((__pyx_v_idxBase == ((cusparseIndexBase_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4695, __pyx_L3_error)
    __pyx_v_valueType = __Pyx_PyLong_As_cudaDataType(values[8]); if (unlikely((__pyx_v_valueType == ((cudaDataType)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4695, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("createCoo", 1, 9, 9, __pyx_nargs); __PYX_ERR(0, 4692, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.createCoo", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_498createCoo(__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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_498createCoo(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
  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("createCoo", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(__pyx_t_1 == ((size_t)-1L) && PyErr_Occurred())) __PYX_ERR(0, 4692, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyLong_FromSize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4692, __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_backends.cuda.libs.cusparse.createCoo", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy_backends/cuda/libs/cusparse.pyx":4703
 *     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_13cupy_backends_4cuda_4libs_8cusparse_501createCooAoS(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static size_t __pyx_f_13cupy_backends_4cuda_4libs_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_backends/cuda/libs/cusparse.pyx":4708
 *                           DataType valueType) except? -1:
 *     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_backends/cuda/libs/cusparse.pyx":4711
 *                                   <void*>cooValues, cooIdxType, idxBase,
 *                                   valueType)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return <size_t>desc
 * 
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4711, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":4712
 *                                   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_backends/cuda/libs/cusparse.pyx":4703
 *     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_AddTraceback("cupy_backends.cuda.libs.cusparse.createCooAoS", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1L;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_501createCooAoS(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_500createCooAoS, "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_13cupy_backends_4cuda_4libs_8cusparse_501createCooAoS(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[8] = {0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("createCooAoS (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_rows,&__pyx_mstate_global->__pyx_n_u_cols,&__pyx_mstate_global->__pyx_n_u_nnz,&__pyx_mstate_global->__pyx_n_u_cooInd,&__pyx_mstate_global->__pyx_n_u_cooValues,&__pyx_mstate_global->__pyx_n_u_cooIdxType,&__pyx_mstate_global->__pyx_n_u_idxBase,&__pyx_mstate_global->__pyx_n_u_valueType,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 4703, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 4703, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 4703, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 4703, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4703, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4703, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4703, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4703, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4703, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "createCooAoS", 0) < (0)) __PYX_ERR(0, 4703, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 8; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("createCooAoS", 1, 8, 8, i); __PYX_ERR(0, 4703, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 8)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4703, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4703, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4703, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4703, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4703, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 4703, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 4703, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 4703, __pyx_L3_error)
    }
    __pyx_v_rows = __Pyx_PyLong_As_int64_t(values[0]); if (unlikely((__pyx_v_rows == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4703, __pyx_L3_error)
    __pyx_v_cols = __Pyx_PyLong_As_int64_t(values[1]); if (unlikely((__pyx_v_cols == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4703, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyLong_As_int64_t(values[2]); if (unlikely((__pyx_v_nnz == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4703, __pyx_L3_error)
    __pyx_v_cooInd = PyLong_AsSsize_t(values[3]); if (unlikely((__pyx_v_cooInd == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4704, __pyx_L3_error)
    __pyx_v_cooValues = PyLong_AsSsize_t(values[4]); if (unlikely((__pyx_v_cooValues == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4704, __pyx_L3_error)
    __pyx_v_cooIdxType = __Pyx_PyLong_As_cusparseIndexType_t(values[5]); if (unlikely((__pyx_v_cooIdxType == ((cusparseIndexType_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4705, __pyx_L3_error)
    __pyx_v_idxBase = __Pyx_PyLong_As_cusparseIndexBase_t(values[6]); if (unlikely((__pyx_v_idxBase == ((cusparseIndexBase_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4705, __pyx_L3_error)
    __pyx_v_valueType = __Pyx_PyLong_As_cudaDataType(values[7]); if (unlikely((__pyx_v_valueType == ((cudaDataType)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4706, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("createCooAoS", 1, 8, 8, __pyx_nargs); __PYX_ERR(0, 4703, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.createCooAoS", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_500createCooAoS(__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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_500createCooAoS(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
  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("createCooAoS", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(__pyx_t_1 == ((size_t)-1L) && PyErr_Occurred())) __PYX_ERR(0, 4703, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyLong_FromSize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4703, __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_backends.cuda.libs.cusparse.createCooAoS", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy_backends/cuda/libs/cusparse.pyx":4714
 *     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_13cupy_backends_4cuda_4libs_8cusparse_503createCsr(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static size_t __pyx_f_13cupy_backends_4cuda_4libs_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_backends/cuda/libs/cusparse.pyx":4720
 *                        DataType valueType) except? -1:
 *     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_backends/cuda/libs/cusparse.pyx":4724
 *                                <void*>csrValues, csrRowOffsetsType,
 *                                csrColIndType, idxBase, valueType)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return <size_t>desc
 * 
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4724, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":4725
 *                                csrColIndType, idxBase, valueType)
 *     check_status(status)
 *     return <size_t>desc             # <<<<<<<<<<<<<<
 * 
 * cpdef size_t createCsc(int64_t rows, int64_t cols, int64_t nnz,
*/
  __pyx_r = ((size_t)__pyx_v_desc);
  goto __pyx_L0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":4714
 *     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_AddTraceback("cupy_backends.cuda.libs.cusparse.createCsr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1L;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_503createCsr(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_502createCsr, "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_13cupy_backends_4cuda_4libs_8cusparse_503createCsr(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("createCsr (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_rows,&__pyx_mstate_global->__pyx_n_u_cols,&__pyx_mstate_global->__pyx_n_u_nnz,&__pyx_mstate_global->__pyx_n_u_csrRowOffsets,&__pyx_mstate_global->__pyx_n_u_csrColind,&__pyx_mstate_global->__pyx_n_u_csrValues,&__pyx_mstate_global->__pyx_n_u_csrRowOffsetsType,&__pyx_mstate_global->__pyx_n_u_csrColIndType,&__pyx_mstate_global->__pyx_n_u_idxBase,&__pyx_mstate_global->__pyx_n_u_valueType,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 4714, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 4714, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 4714, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 4714, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 4714, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 4714, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4714, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4714, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4714, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4714, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4714, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "createCsr", 0) < (0)) __PYX_ERR(0, 4714, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 10; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("createCsr", 1, 10, 10, i); __PYX_ERR(0, 4714, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 10)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4714, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4714, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4714, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4714, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4714, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 4714, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 4714, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 4714, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 4714, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 4714, __pyx_L3_error)
    }
    __pyx_v_rows = __Pyx_PyLong_As_int64_t(values[0]); if (unlikely((__pyx_v_rows == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4714, __pyx_L3_error)
    __pyx_v_cols = __Pyx_PyLong_As_int64_t(values[1]); if (unlikely((__pyx_v_cols == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4714, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyLong_As_int64_t(values[2]); if (unlikely((__pyx_v_nnz == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4714, __pyx_L3_error)
    __pyx_v_csrRowOffsets = PyLong_AsSsize_t(values[3]); if (unlikely((__pyx_v_csrRowOffsets == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4715, __pyx_L3_error)
    __pyx_v_csrColind = PyLong_AsSsize_t(values[4]); if (unlikely((__pyx_v_csrColind == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4715, __pyx_L3_error)
    __pyx_v_csrValues = PyLong_AsSsize_t(values[5]); if (unlikely((__pyx_v_csrValues == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4716, __pyx_L3_error)
    __pyx_v_csrRowOffsetsType = __Pyx_PyLong_As_cusparseIndexType_t(values[6]); if (unlikely((__pyx_v_csrRowOffsetsType == ((cusparseIndexType_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4716, __pyx_L3_error)
    __pyx_v_csrColIndType = __Pyx_PyLong_As_cusparseIndexType_t(values[7]); if (unlikely((__pyx_v_csrColIndType == ((cusparseIndexType_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4717, __pyx_L3_error)
    __pyx_v_idxBase = __Pyx_PyLong_As_cusparseIndexBase_t(values[8]); if (unlikely((__pyx_v_idxBase == ((cusparseIndexBase_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4717, __pyx_L3_error)
    __pyx_v_valueType = __Pyx_PyLong_As_cudaDataType(values[9]); if (unlikely((__pyx_v_valueType == ((cudaDataType)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4718, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("createCsr", 1, 10, 10, __pyx_nargs); __PYX_ERR(0, 4714, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.createCsr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_502createCsr(__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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_502createCsr(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
  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("createCsr", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(__pyx_t_1 == ((size_t)-1L) && PyErr_Occurred())) __PYX_ERR(0, 4714, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyLong_FromSize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4714, __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_backends.cuda.libs.cusparse.createCsr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy_backends/cuda/libs/cusparse.pyx":4727
 *     return <size_t>desc
 * 
 * cpdef size_t createCsc(int64_t rows, int64_t cols, int64_t nnz,             # <<<<<<<<<<<<<<
 *                        intptr_t cscColOffsets, intptr_t cscRowInd,
 *                        intptr_t cscValues, IndexType cscColOffsetsType,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_505createCsc(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static size_t __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_createCsc(int64_t __pyx_v_rows, int64_t __pyx_v_cols, int64_t __pyx_v_nnz, intptr_t __pyx_v_cscColOffsets, intptr_t __pyx_v_cscRowInd, intptr_t __pyx_v_cscValues, cusparseIndexType_t __pyx_v_cscColOffsetsType, cusparseIndexType_t __pyx_v_cscRowIndType, 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("createCsc", 0);

  /* "cupy_backends/cuda/libs/cusparse.pyx":4733
 *                        DataType valueType) except? -1:
 *     cdef SpMatDescr desc
 *     status = cusparseCreateCsc(&desc, rows, cols, nnz,             # <<<<<<<<<<<<<<
 *                                <void*>cscColOffsets, <void*>cscRowInd,
 *                                <void*>cscValues, cscColOffsetsType,
*/
  __pyx_v_status = __pyx_v_13cupy_backends_4cuda_4libs_8cusparse_cusparseCreateCsc((&__pyx_v_desc), __pyx_v_rows, __pyx_v_cols, __pyx_v_nnz, ((void *)__pyx_v_cscColOffsets), ((void *)__pyx_v_cscRowInd), ((void *)__pyx_v_cscValues), __pyx_v_cscColOffsetsType, __pyx_v_cscRowIndType, __pyx_v_idxBase, __pyx_v_valueType);

  /* "cupy_backends/cuda/libs/cusparse.pyx":4737
 *                                <void*>cscValues, cscColOffsetsType,
 *                                cscRowIndType, idxBase, valueType)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return <size_t>desc
 * 
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4737, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":4738
 *                                cscRowIndType, idxBase, valueType)
 *     check_status(status)
 *     return <size_t>desc             # <<<<<<<<<<<<<<
 * 
 * cpdef void destroySpMat(size_t desc) except *:
*/
  __pyx_r = ((size_t)__pyx_v_desc);
  goto __pyx_L0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":4727
 *     return <size_t>desc
 * 
 * cpdef size_t createCsc(int64_t rows, int64_t cols, int64_t nnz,             # <<<<<<<<<<<<<<
 *                        intptr_t cscColOffsets, intptr_t cscRowInd,
 *                        intptr_t cscValues, IndexType cscColOffsetsType,
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.createCsc", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1L;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_505createCsc(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_504createCsc, "createCsc(int64_t rows, int64_t cols, int64_t nnz, intptr_t cscColOffsets, intptr_t cscRowInd, intptr_t cscValues, IndexType cscColOffsetsType, IndexType cscRowIndType, IndexBase idxBase, DataType valueType) -> size_t");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_505createCsc(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  int64_t __pyx_v_rows;
  int64_t __pyx_v_cols;
  int64_t __pyx_v_nnz;
  intptr_t __pyx_v_cscColOffsets;
  intptr_t __pyx_v_cscRowInd;
  intptr_t __pyx_v_cscValues;
  cusparseIndexType_t __pyx_v_cscColOffsetsType;
  cusparseIndexType_t __pyx_v_cscRowIndType;
  cusparseIndexBase_t __pyx_v_idxBase;
  cudaDataType __pyx_v_valueType;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("createCsc (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_rows,&__pyx_mstate_global->__pyx_n_u_cols,&__pyx_mstate_global->__pyx_n_u_nnz,&__pyx_mstate_global->__pyx_n_u_cscColOffsets,&__pyx_mstate_global->__pyx_n_u_cscRowInd,&__pyx_mstate_global->__pyx_n_u_cscValues,&__pyx_mstate_global->__pyx_n_u_cscColOffsetsType,&__pyx_mstate_global->__pyx_n_u_cscRowIndType,&__pyx_mstate_global->__pyx_n_u_idxBase,&__pyx_mstate_global->__pyx_n_u_valueType,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 4727, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 4727, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 4727, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 4727, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 4727, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 4727, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4727, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4727, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4727, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4727, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4727, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "createCsc", 0) < (0)) __PYX_ERR(0, 4727, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 10; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("createCsc", 1, 10, 10, i); __PYX_ERR(0, 4727, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 10)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4727, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4727, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4727, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4727, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4727, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 4727, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 4727, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 4727, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 4727, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 4727, __pyx_L3_error)
    }
    __pyx_v_rows = __Pyx_PyLong_As_int64_t(values[0]); if (unlikely((__pyx_v_rows == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4727, __pyx_L3_error)
    __pyx_v_cols = __Pyx_PyLong_As_int64_t(values[1]); if (unlikely((__pyx_v_cols == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4727, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyLong_As_int64_t(values[2]); if (unlikely((__pyx_v_nnz == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4727, __pyx_L3_error)
    __pyx_v_cscColOffsets = PyLong_AsSsize_t(values[3]); if (unlikely((__pyx_v_cscColOffsets == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4728, __pyx_L3_error)
    __pyx_v_cscRowInd = PyLong_AsSsize_t(values[4]); if (unlikely((__pyx_v_cscRowInd == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4728, __pyx_L3_error)
    __pyx_v_cscValues = PyLong_AsSsize_t(values[5]); if (unlikely((__pyx_v_cscValues == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4729, __pyx_L3_error)
    __pyx_v_cscColOffsetsType = __Pyx_PyLong_As_cusparseIndexType_t(values[6]); if (unlikely((__pyx_v_cscColOffsetsType == ((cusparseIndexType_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4729, __pyx_L3_error)
    __pyx_v_cscRowIndType = __Pyx_PyLong_As_cusparseIndexType_t(values[7]); if (unlikely((__pyx_v_cscRowIndType == ((cusparseIndexType_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4730, __pyx_L3_error)
    __pyx_v_idxBase = __Pyx_PyLong_As_cusparseIndexBase_t(values[8]); if (unlikely((__pyx_v_idxBase == ((cusparseIndexBase_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4730, __pyx_L3_error)
    __pyx_v_valueType = __Pyx_PyLong_As_cudaDataType(values[9]); if (unlikely((__pyx_v_valueType == ((cudaDataType)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4731, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("createCsc", 1, 10, 10, __pyx_nargs); __PYX_ERR(0, 4727, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.createCsc", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_504createCsc(__pyx_self, __pyx_v_rows, __pyx_v_cols, __pyx_v_nnz, __pyx_v_cscColOffsets, __pyx_v_cscRowInd, __pyx_v_cscValues, __pyx_v_cscColOffsetsType, __pyx_v_cscRowIndType, __pyx_v_idxBase, __pyx_v_valueType);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_504createCsc(CYTHON_UNUSED PyObject *__pyx_self, int64_t __pyx_v_rows, int64_t __pyx_v_cols, int64_t __pyx_v_nnz, intptr_t __pyx_v_cscColOffsets, intptr_t __pyx_v_cscRowInd, intptr_t __pyx_v_cscValues, cusparseIndexType_t __pyx_v_cscColOffsetsType, cusparseIndexType_t __pyx_v_cscRowIndType, 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("createCsc", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_createCsc(__pyx_v_rows, __pyx_v_cols, __pyx_v_nnz, __pyx_v_cscColOffsets, __pyx_v_cscRowInd, __pyx_v_cscValues, __pyx_v_cscColOffsetsType, __pyx_v_cscRowIndType, __pyx_v_idxBase, __pyx_v_valueType, 1); if (unlikely(__pyx_t_1 == ((size_t)-1L) && PyErr_Occurred())) __PYX_ERR(0, 4727, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyLong_FromSize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4727, __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_backends.cuda.libs.cusparse.createCsc", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy_backends/cuda/libs/cusparse.pyx":4740
 *     return <size_t>desc
 * 
 * cpdef void destroySpMat(size_t desc) except *:             # <<<<<<<<<<<<<<
 *     status = cusparseDestroySpMat(<SpMatDescr>desc)
 *     check_status(status)
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_507destroySpMat(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_destroySpMat(size_t __pyx_v_desc, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  __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_backends/cuda/libs/cusparse.pyx":4741
 * 
 * cpdef void destroySpMat(size_t desc) except *:
 *     status = cusparseDestroySpMat(<SpMatDescr>desc)             # <<<<<<<<<<<<<<
 *     check_status(status)
 * 
*/
  __pyx_v_status = cusparseDestroySpMat(((cusparseSpMatDescr_t)__pyx_v_desc));

  /* "cupy_backends/cuda/libs/cusparse.pyx":4742
 * cpdef void destroySpMat(size_t desc) except *:
 *     status = cusparseDestroySpMat(<SpMatDescr>desc)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef CooAttributes cooGet(size_t desc):
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4742, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":4740
 *     return <size_t>desc
 * 
 * cpdef void destroySpMat(size_t desc) except *:             # <<<<<<<<<<<<<<
 *     status = cusparseDestroySpMat(<SpMatDescr>desc)
 *     check_status(status)
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.destroySpMat", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_507destroySpMat(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_506destroySpMat, "destroySpMat(size_t desc) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_507destroySpMat(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  size_t __pyx_v_desc;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("destroySpMat (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_desc,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 4740, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4740, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "destroySpMat", 0) < (0)) __PYX_ERR(0, 4740, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("destroySpMat", 1, 1, 1, i); __PYX_ERR(0, 4740, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4740, __pyx_L3_error)
    }
    __pyx_v_desc = __Pyx_PyLong_As_size_t(values[0]); if (unlikely((__pyx_v_desc == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4740, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("destroySpMat", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 4740, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.destroySpMat", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_506destroySpMat(__pyx_self, __pyx_v_desc);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_506destroySpMat(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_f_13cupy_backends_4cuda_4libs_8cusparse_destroySpMat(__pyx_v_desc, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4740, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4740, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":4744
 *     check_status(status)
 * 
 * cpdef CooAttributes cooGet(size_t desc):             # <<<<<<<<<<<<<<
 *     cdef int64_t rows, cols, nnz
 *     cdef intptr_t rowInd, colInd, values,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_509cooGet(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CooAttributes *__pyx_f_13cupy_backends_4cuda_4libs_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;
  struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CooAttributes *__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;
  size_t __pyx_t_12;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("cooGet", 0);

  /* "cupy_backends/cuda/libs/cusparse.pyx":4750
 *     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_backends/cuda/libs/cusparse.pyx":4753
 *                             <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_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4753, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":4754
 *                             &idxType, &idxBase, &valueType)
 *     check_status(status)
 *     return CooAttributes(rows, cols, nnz, rowInd, colInd, values,             # <<<<<<<<<<<<<<
 *                          idxType, idxBase, valueType)
 * 
*/
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_2 = NULL;
  __pyx_t_3 = __Pyx_PyLong_From_int64_t(__pyx_v_rows); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4754, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyLong_From_int64_t(__pyx_v_cols); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4754, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyLong_From_int64_t(__pyx_v_nnz); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4754, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyLong_FromSsize_t(__pyx_v_rowInd); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4754, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = PyLong_FromSsize_t(__pyx_v_colInd); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4754, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = PyLong_FromSsize_t(__pyx_v_values); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4754, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);

  /* "cupy_backends/cuda/libs/cusparse.pyx":4755
 *     check_status(status)
 *     return CooAttributes(rows, cols, nnz, rowInd, colInd, values,
 *                          idxType, idxBase, valueType)             # <<<<<<<<<<<<<<
 * 
 * cpdef CooAoSAttributes cooAoSGet(size_t desc):
*/
  __pyx_t_9 = __Pyx_PyLong_From_cusparseIndexType_t(__pyx_v_idxType); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4755, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_10 = __Pyx_PyLong_From_cusparseIndexBase_t(__pyx_v_idxBase); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4755, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_11 = __Pyx_PyLong_From_cudaDataType(__pyx_v_valueType); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4755, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_12 = 1;
  {
    PyObject *__pyx_callargs[10] = {__pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_10, __pyx_t_11};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_13cupy_backends_4cuda_4libs_8cusparse_CooAttributes, __pyx_callargs+__pyx_t_12, (10-__pyx_t_12) | (__pyx_t_12*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4754, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_r = ((struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CooAttributes *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":4744
 *     check_status(status)
 * 
 * cpdef CooAttributes 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_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.cooGet", __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_13cupy_backends_4cuda_4libs_8cusparse_509cooGet(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_508cooGet, "cooGet(size_t desc) -> CooAttributes");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_509cooGet(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  size_t __pyx_v_desc;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("cooGet (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_desc,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 4744, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4744, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "cooGet", 0) < (0)) __PYX_ERR(0, 4744, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("cooGet", 1, 1, 1, i); __PYX_ERR(0, 4744, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4744, __pyx_L3_error)
    }
    __pyx_v_desc = __Pyx_PyLong_As_size_t(values[0]); if (unlikely((__pyx_v_desc == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4744, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("cooGet", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 4744, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.cooGet", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_508cooGet(__pyx_self, __pyx_v_desc);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_508cooGet(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 = ((PyObject *)__pyx_f_13cupy_backends_4cuda_4libs_8cusparse_cooGet(__pyx_v_desc, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4744, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":4757
 *                          idxType, idxBase, valueType)
 * 
 * cpdef CooAoSAttributes cooAoSGet(size_t desc):             # <<<<<<<<<<<<<<
 *     cdef int64_t rows, cols, nnz
 *     cdef intptr_t ind, values,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_511cooAoSGet(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CooAoSAttributes *__pyx_f_13cupy_backends_4cuda_4libs_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;
  struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CooAoSAttributes *__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;
  size_t __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("cooAoSGet", 0);

  /* "cupy_backends/cuda/libs/cusparse.pyx":4763
 *     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_backends/cuda/libs/cusparse.pyx":4766
 *                                <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_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4766, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":4767
 *                                &idxType, &idxBase, &valueType)
 *     check_status(status)
 *     return CooAoSAttributes(rows, cols, nnz, ind, values,             # <<<<<<<<<<<<<<
 *                             idxType, idxBase, valueType)
 * 
*/
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_2 = NULL;
  __pyx_t_3 = __Pyx_PyLong_From_int64_t(__pyx_v_rows); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4767, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyLong_From_int64_t(__pyx_v_cols); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4767, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyLong_From_int64_t(__pyx_v_nnz); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4767, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyLong_FromSsize_t(__pyx_v_ind); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4767, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = PyLong_FromSsize_t(__pyx_v_values); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4767, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);

  /* "cupy_backends/cuda/libs/cusparse.pyx":4768
 *     check_status(status)
 *     return CooAoSAttributes(rows, cols, nnz, ind, values,
 *                             idxType, idxBase, valueType)             # <<<<<<<<<<<<<<
 * 
 * cpdef CsrAttributes csrGet(size_t desc):
*/
  __pyx_t_8 = __Pyx_PyLong_From_cusparseIndexType_t(__pyx_v_idxType); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4768, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_9 = __Pyx_PyLong_From_cusparseIndexBase_t(__pyx_v_idxBase); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4768, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_10 = __Pyx_PyLong_From_cudaDataType(__pyx_v_valueType); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4768, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_11 = 1;
  {
    PyObject *__pyx_callargs[9] = {__pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_10};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_13cupy_backends_4cuda_4libs_8cusparse_CooAoSAttributes, __pyx_callargs+__pyx_t_11, (9-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4767, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_r = ((struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CooAoSAttributes *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":4757
 *                          idxType, idxBase, valueType)
 * 
 * cpdef CooAoSAttributes 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_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.cooAoSGet", __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_13cupy_backends_4cuda_4libs_8cusparse_511cooAoSGet(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_510cooAoSGet, "cooAoSGet(size_t desc) -> CooAoSAttributes");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_511cooAoSGet(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  size_t __pyx_v_desc;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("cooAoSGet (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_desc,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 4757, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4757, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "cooAoSGet", 0) < (0)) __PYX_ERR(0, 4757, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("cooAoSGet", 1, 1, 1, i); __PYX_ERR(0, 4757, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4757, __pyx_L3_error)
    }
    __pyx_v_desc = __Pyx_PyLong_As_size_t(values[0]); if (unlikely((__pyx_v_desc == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4757, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("cooAoSGet", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 4757, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.cooAoSGet", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_510cooAoSGet(__pyx_self, __pyx_v_desc);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_510cooAoSGet(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 = ((PyObject *)__pyx_f_13cupy_backends_4cuda_4libs_8cusparse_cooAoSGet(__pyx_v_desc, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4757, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":4770
 *                             idxType, idxBase, valueType)
 * 
 * cpdef CsrAttributes csrGet(size_t desc):             # <<<<<<<<<<<<<<
 *     cdef int64_t rows, cols, nnz
 *     cdef intptr_t rowOffsets, colInd, values,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_513csrGet(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CsrAttributes *__pyx_f_13cupy_backends_4cuda_4libs_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;
  struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CsrAttributes *__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;
  PyObject *__pyx_t_12 = NULL;
  size_t __pyx_t_13;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("csrGet", 0);

  /* "cupy_backends/cuda/libs/cusparse.pyx":4776
 *     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_backends/cuda/libs/cusparse.pyx":4780
 *                             <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_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4780, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":4781
 *                             &idxBase, &valueType)
 *     check_status(status)
 *     return CsrAttributes(rows, cols, nnz, rowOffsets, colInd, values,             # <<<<<<<<<<<<<<
 *                          rowOffsetsType, colIndType, idxBase, valueType)
 * 
*/
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_2 = NULL;
  __pyx_t_3 = __Pyx_PyLong_From_int64_t(__pyx_v_rows); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4781, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyLong_From_int64_t(__pyx_v_cols); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4781, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyLong_From_int64_t(__pyx_v_nnz); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4781, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyLong_FromSsize_t(__pyx_v_rowOffsets); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4781, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = PyLong_FromSsize_t(__pyx_v_colInd); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4781, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = PyLong_FromSsize_t(__pyx_v_values); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4781, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);

  /* "cupy_backends/cuda/libs/cusparse.pyx":4782
 *     check_status(status)
 *     return CsrAttributes(rows, cols, nnz, rowOffsets, colInd, values,
 *                          rowOffsetsType, colIndType, idxBase, valueType)             # <<<<<<<<<<<<<<
 * 
 * cpdef void csrSetPointers(
*/
  __pyx_t_9 = __Pyx_PyLong_From_cusparseIndexType_t(__pyx_v_rowOffsetsType); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4782, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_10 = __Pyx_PyLong_From_cusparseIndexType_t(__pyx_v_colIndType); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4782, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_11 = __Pyx_PyLong_From_cusparseIndexBase_t(__pyx_v_idxBase); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4782, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_12 = __Pyx_PyLong_From_cudaDataType(__pyx_v_valueType); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 4782, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_13 = 1;
  {
    PyObject *__pyx_callargs[11] = {__pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_10, __pyx_t_11, __pyx_t_12};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_13cupy_backends_4cuda_4libs_8cusparse_CsrAttributes, __pyx_callargs+__pyx_t_13, (11-__pyx_t_13) | (__pyx_t_13*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4781, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_r = ((struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CsrAttributes *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":4770
 *                             idxType, idxBase, valueType)
 * 
 * cpdef CsrAttributes 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_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.csrGet", __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_13cupy_backends_4cuda_4libs_8cusparse_513csrGet(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_512csrGet, "csrGet(size_t desc) -> CsrAttributes");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_513csrGet(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  size_t __pyx_v_desc;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("csrGet (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_desc,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 4770, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4770, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "csrGet", 0) < (0)) __PYX_ERR(0, 4770, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("csrGet", 1, 1, 1, i); __PYX_ERR(0, 4770, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4770, __pyx_L3_error)
    }
    __pyx_v_desc = __Pyx_PyLong_As_size_t(values[0]); if (unlikely((__pyx_v_desc == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4770, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("csrGet", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 4770, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.csrGet", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_512csrGet(__pyx_self, __pyx_v_desc);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_512csrGet(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 = ((PyObject *)__pyx_f_13cupy_backends_4cuda_4libs_8cusparse_csrGet(__pyx_v_desc, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4770, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":4784
 *                          rowOffsetsType, colIndType, idxBase, valueType)
 * 
 * cpdef void csrSetPointers(             # <<<<<<<<<<<<<<
 *         size_t desc, size_t csrRowOffsets, size_t csrColInd,
 *         size_t csrValues) except *:
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_515csrSetPointers(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_csrSetPointers(size_t __pyx_v_desc, size_t __pyx_v_csrRowOffsets, size_t __pyx_v_csrColInd, size_t __pyx_v_csrValues, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("csrSetPointers", 0);

  /* "cupy_backends/cuda/libs/cusparse.pyx":4787
 *         size_t desc, size_t csrRowOffsets, size_t csrColInd,
 *         size_t csrValues) except *:
 *     status = cusparseCsrSetPointers(<SpMatDescr>desc, <void*>csrRowOffsets,             # <<<<<<<<<<<<<<
 *                                     <void*>csrColInd, <void*>csrValues)
 *     check_status(status)
*/
  __pyx_v_status = cusparseCsrSetPointers(((cusparseSpMatDescr_t)__pyx_v_desc), ((void *)__pyx_v_csrRowOffsets), ((void *)__pyx_v_csrColInd), ((void *)__pyx_v_csrValues));

  /* "cupy_backends/cuda/libs/cusparse.pyx":4789
 *     status = cusparseCsrSetPointers(<SpMatDescr>desc, <void*>csrRowOffsets,
 *                                     <void*>csrColInd, <void*>csrValues)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef int spMatGetFormat(size_t desc) except? -1:
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4789, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":4784
 *                          rowOffsetsType, colIndType, idxBase, valueType)
 * 
 * cpdef void csrSetPointers(             # <<<<<<<<<<<<<<
 *         size_t desc, size_t csrRowOffsets, size_t csrColInd,
 *         size_t csrValues) except *:
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.csrSetPointers", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_515csrSetPointers(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_514csrSetPointers, "csrSetPointers(size_t desc, size_t csrRowOffsets, size_t csrColInd, size_t csrValues) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_515csrSetPointers(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  size_t __pyx_v_desc;
  size_t __pyx_v_csrRowOffsets;
  size_t __pyx_v_csrColInd;
  size_t __pyx_v_csrValues;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[4] = {0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("csrSetPointers (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_desc,&__pyx_mstate_global->__pyx_n_u_csrRowOffsets,&__pyx_mstate_global->__pyx_n_u_csrColInd,&__pyx_mstate_global->__pyx_n_u_csrValues,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 4784, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4784, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4784, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4784, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4784, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "csrSetPointers", 0) < (0)) __PYX_ERR(0, 4784, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 4; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("csrSetPointers", 1, 4, 4, i); __PYX_ERR(0, 4784, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 4)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4784, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4784, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4784, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4784, __pyx_L3_error)
    }
    __pyx_v_desc = __Pyx_PyLong_As_size_t(values[0]); if (unlikely((__pyx_v_desc == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4785, __pyx_L3_error)
    __pyx_v_csrRowOffsets = __Pyx_PyLong_As_size_t(values[1]); if (unlikely((__pyx_v_csrRowOffsets == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4785, __pyx_L3_error)
    __pyx_v_csrColInd = __Pyx_PyLong_As_size_t(values[2]); if (unlikely((__pyx_v_csrColInd == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4785, __pyx_L3_error)
    __pyx_v_csrValues = __Pyx_PyLong_As_size_t(values[3]); if (unlikely((__pyx_v_csrValues == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4786, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("csrSetPointers", 1, 4, 4, __pyx_nargs); __PYX_ERR(0, 4784, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.csrSetPointers", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_514csrSetPointers(__pyx_self, __pyx_v_desc, __pyx_v_csrRowOffsets, __pyx_v_csrColInd, __pyx_v_csrValues);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_514csrSetPointers(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_desc, size_t __pyx_v_csrRowOffsets, size_t __pyx_v_csrColInd, size_t __pyx_v_csrValues) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("csrSetPointers", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_csrSetPointers(__pyx_v_desc, __pyx_v_csrRowOffsets, __pyx_v_csrColInd, __pyx_v_csrValues, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4784, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4784, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":4791
 *     check_status(status)
 * 
 * cpdef int spMatGetFormat(size_t desc) except? -1:             # <<<<<<<<<<<<<<
 *     cdef Format format
 *     status = cusparseSpMatGetFormat(<SpMatDescr>desc, &format)
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_517spMatGetFormat(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static int __pyx_f_13cupy_backends_4cuda_4libs_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_backends/cuda/libs/cusparse.pyx":4793
 * cpdef int spMatGetFormat(size_t desc) except? -1:
 *     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_backends/cuda/libs/cusparse.pyx":4794
 *     cdef Format format
 *     status = cusparseSpMatGetFormat(<SpMatDescr>desc, &format)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return <int>format
 * 
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4794, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":4795
 *     status = cusparseSpMatGetFormat(<SpMatDescr>desc, &format)
 *     check_status(status)
 *     return <int>format             # <<<<<<<<<<<<<<
 * 
 * cpdef int spMatGetIndexBase(size_t desc) except? -1:
*/
  __pyx_r = ((int)__pyx_v_format);
  goto __pyx_L0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":4791
 *     check_status(status)
 * 
 * cpdef int spMatGetFormat(size_t desc) except? -1:             # <<<<<<<<<<<<<<
 *     cdef Format format
 *     status = cusparseSpMatGetFormat(<SpMatDescr>desc, &format)
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.spMatGetFormat", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_517spMatGetFormat(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_516spMatGetFormat, "spMatGetFormat(size_t desc) -> int");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_517spMatGetFormat(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  size_t __pyx_v_desc;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("spMatGetFormat (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_desc,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 4791, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4791, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "spMatGetFormat", 0) < (0)) __PYX_ERR(0, 4791, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("spMatGetFormat", 1, 1, 1, i); __PYX_ERR(0, 4791, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4791, __pyx_L3_error)
    }
    __pyx_v_desc = __Pyx_PyLong_As_size_t(values[0]); if (unlikely((__pyx_v_desc == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4791, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("spMatGetFormat", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 4791, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.spMatGetFormat", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_516spMatGetFormat(__pyx_self, __pyx_v_desc);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_516spMatGetFormat(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_desc) {
  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("spMatGetFormat", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_spMatGetFormat(__pyx_v_desc, 1); if (unlikely(__pyx_t_1 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4791, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4791, __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_backends.cuda.libs.cusparse.spMatGetFormat", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy_backends/cuda/libs/cusparse.pyx":4797
 *     return <int>format
 * 
 * cpdef int spMatGetIndexBase(size_t desc) except? -1:             # <<<<<<<<<<<<<<
 *     cdef IndexBase idxBase
 *     status = cusparseSpMatGetIndexBase(<SpMatDescr>desc, &idxBase)
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_519spMatGetIndexBase(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static int __pyx_f_13cupy_backends_4cuda_4libs_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_backends/cuda/libs/cusparse.pyx":4799
 * cpdef int spMatGetIndexBase(size_t desc) except? -1:
 *     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_backends/cuda/libs/cusparse.pyx":4800
 *     cdef IndexBase idxBase
 *     status = cusparseSpMatGetIndexBase(<SpMatDescr>desc, &idxBase)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return <int>idxBase
 * 
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4800, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":4801
 *     status = cusparseSpMatGetIndexBase(<SpMatDescr>desc, &idxBase)
 *     check_status(status)
 *     return <int>idxBase             # <<<<<<<<<<<<<<
 * 
 * cpdef intptr_t spMatGetValues(size_t desc) except? -1:
*/
  __pyx_r = ((int)__pyx_v_idxBase);
  goto __pyx_L0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":4797
 *     return <int>format
 * 
 * cpdef int spMatGetIndexBase(size_t desc) except? -1:             # <<<<<<<<<<<<<<
 *     cdef IndexBase idxBase
 *     status = cusparseSpMatGetIndexBase(<SpMatDescr>desc, &idxBase)
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.spMatGetIndexBase", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_519spMatGetIndexBase(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_518spMatGetIndexBase, "spMatGetIndexBase(size_t desc) -> int");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_519spMatGetIndexBase(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  size_t __pyx_v_desc;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("spMatGetIndexBase (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_desc,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 4797, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4797, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "spMatGetIndexBase", 0) < (0)) __PYX_ERR(0, 4797, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("spMatGetIndexBase", 1, 1, 1, i); __PYX_ERR(0, 4797, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4797, __pyx_L3_error)
    }
    __pyx_v_desc = __Pyx_PyLong_As_size_t(values[0]); if (unlikely((__pyx_v_desc == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4797, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("spMatGetIndexBase", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 4797, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.spMatGetIndexBase", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_518spMatGetIndexBase(__pyx_self, __pyx_v_desc);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_518spMatGetIndexBase(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_desc) {
  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("spMatGetIndexBase", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_spMatGetIndexBase(__pyx_v_desc, 1); if (unlikely(__pyx_t_1 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4797, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4797, __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_backends.cuda.libs.cusparse.spMatGetIndexBase", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy_backends/cuda/libs/cusparse.pyx":4803
 *     return <int>idxBase
 * 
 * cpdef intptr_t spMatGetValues(size_t desc) except? -1:             # <<<<<<<<<<<<<<
 *     cdef intptr_t values
 *     status = cusparseSpMatGetValues(<SpMatDescr>desc, <void**>&values)
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_521spMatGetValues(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static intptr_t __pyx_f_13cupy_backends_4cuda_4libs_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_backends/cuda/libs/cusparse.pyx":4805
 * cpdef intptr_t spMatGetValues(size_t desc) except? -1:
 *     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_backends/cuda/libs/cusparse.pyx":4806
 *     cdef intptr_t values
 *     status = cusparseSpMatGetValues(<SpMatDescr>desc, <void**>&values)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return values
 * 
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4806, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":4807
 *     status = cusparseSpMatGetValues(<SpMatDescr>desc, <void**>&values)
 *     check_status(status)
 *     return values             # <<<<<<<<<<<<<<
 * 
 * cpdef void spMatSetValues(size_t desc, intptr_t values) except *:
*/
  __pyx_r = __pyx_v_values;
  goto __pyx_L0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":4803
 *     return <int>idxBase
 * 
 * cpdef intptr_t spMatGetValues(size_t desc) except? -1:             # <<<<<<<<<<<<<<
 *     cdef intptr_t values
 *     status = cusparseSpMatGetValues(<SpMatDescr>desc, <void**>&values)
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.spMatGetValues", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1L;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_521spMatGetValues(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_520spMatGetValues, "spMatGetValues(size_t desc) -> intptr_t");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_521spMatGetValues(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  size_t __pyx_v_desc;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("spMatGetValues (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_desc,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 4803, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4803, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "spMatGetValues", 0) < (0)) __PYX_ERR(0, 4803, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("spMatGetValues", 1, 1, 1, i); __PYX_ERR(0, 4803, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4803, __pyx_L3_error)
    }
    __pyx_v_desc = __Pyx_PyLong_As_size_t(values[0]); if (unlikely((__pyx_v_desc == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4803, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("spMatGetValues", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 4803, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.spMatGetValues", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_520spMatGetValues(__pyx_self, __pyx_v_desc);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_520spMatGetValues(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_desc) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  intptr_t __pyx_t_1;
  PyObject *__pyx_t_2 = 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 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_spMatGetValues(__pyx_v_desc, 1); if (unlikely(__pyx_t_1 == ((intptr_t)-1L) && PyErr_Occurred())) __PYX_ERR(0, 4803, __pyx_L1_error)
  __pyx_t_2 = PyLong_FromSsize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4803, __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_backends.cuda.libs.cusparse.spMatGetValues", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy_backends/cuda/libs/cusparse.pyx":4809
 *     return values
 * 
 * cpdef void spMatSetValues(size_t desc, intptr_t values) except *:             # <<<<<<<<<<<<<<
 *     status = cusparseSpMatSetValues(<SpMatDescr>desc, <void*>values)
 *     check_status(status)
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_523spMatSetValues(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_spMatSetValues(size_t __pyx_v_desc, intptr_t __pyx_v_values, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  __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_backends/cuda/libs/cusparse.pyx":4810
 * 
 * cpdef void spMatSetValues(size_t desc, intptr_t values) except *:
 *     status = cusparseSpMatSetValues(<SpMatDescr>desc, <void*>values)             # <<<<<<<<<<<<<<
 *     check_status(status)
 * 
*/
  __pyx_v_status = cusparseSpMatSetValues(((cusparseSpMatDescr_t)__pyx_v_desc), ((void *)__pyx_v_values));

  /* "cupy_backends/cuda/libs/cusparse.pyx":4811
 * cpdef void spMatSetValues(size_t desc, intptr_t values) except *:
 *     status = cusparseSpMatSetValues(<SpMatDescr>desc, <void*>values)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef void spMatGetSize(
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4811, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":4809
 *     return values
 * 
 * cpdef void spMatSetValues(size_t desc, intptr_t values) except *:             # <<<<<<<<<<<<<<
 *     status = cusparseSpMatSetValues(<SpMatDescr>desc, <void*>values)
 *     check_status(status)
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.spMatSetValues", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_523spMatSetValues(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_522spMatSetValues, "spMatSetValues(size_t desc, intptr_t values) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_523spMatSetValues(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  size_t __pyx_v_desc;
  intptr_t __pyx_v_values;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("spMatSetValues (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_desc,&__pyx_mstate_global->__pyx_n_u_values,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 4809, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4809, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4809, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "spMatSetValues", 0) < (0)) __PYX_ERR(0, 4809, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("spMatSetValues", 1, 2, 2, i); __PYX_ERR(0, 4809, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4809, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4809, __pyx_L3_error)
    }
    __pyx_v_desc = __Pyx_PyLong_As_size_t(values[0]); if (unlikely((__pyx_v_desc == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4809, __pyx_L3_error)
    __pyx_v_values = PyLong_AsSsize_t(values[1]); if (unlikely((__pyx_v_values == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4809, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("spMatSetValues", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 4809, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.spMatSetValues", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_522spMatSetValues(__pyx_self, __pyx_v_desc, __pyx_v_values);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_522spMatSetValues(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_f_13cupy_backends_4cuda_4libs_8cusparse_spMatSetValues(__pyx_v_desc, __pyx_v_values, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4809, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4809, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":4813
 *     check_status(status)
 * 
 * cpdef void spMatGetSize(             # <<<<<<<<<<<<<<
 *         size_t desc, size_t rows, size_t cols, size_t nnz) except *:
 *     status = cusparseSpMatGetSize(<SpMatDescr>desc, <int64_t*>rows,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_525spMatGetSize(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_spMatGetSize(size_t __pyx_v_desc, size_t __pyx_v_rows, size_t __pyx_v_cols, size_t __pyx_v_nnz, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("spMatGetSize", 0);

  /* "cupy_backends/cuda/libs/cusparse.pyx":4815
 * cpdef void spMatGetSize(
 *         size_t desc, size_t rows, size_t cols, size_t nnz) except *:
 *     status = cusparseSpMatGetSize(<SpMatDescr>desc, <int64_t*>rows,             # <<<<<<<<<<<<<<
 *                                   <int64_t*>cols, <int64_t*>nnz)
 *     check_status(status)
*/
  __pyx_v_status = cusparseSpMatGetSize(((cusparseSpMatDescr_t)__pyx_v_desc), ((int64_t *)__pyx_v_rows), ((int64_t *)__pyx_v_cols), ((int64_t *)__pyx_v_nnz));

  /* "cupy_backends/cuda/libs/cusparse.pyx":4817
 *     status = cusparseSpMatGetSize(<SpMatDescr>desc, <int64_t*>rows,
 *                                   <int64_t*>cols, <int64_t*>nnz)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef int spMatGetStridedBatch(size_t desc) except? -1:
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4817, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":4813
 *     check_status(status)
 * 
 * cpdef void spMatGetSize(             # <<<<<<<<<<<<<<
 *         size_t desc, size_t rows, size_t cols, size_t nnz) except *:
 *     status = cusparseSpMatGetSize(<SpMatDescr>desc, <int64_t*>rows,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.spMatGetSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_525spMatGetSize(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_524spMatGetSize, "spMatGetSize(size_t desc, size_t rows, size_t cols, size_t nnz) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_525spMatGetSize(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  size_t __pyx_v_desc;
  size_t __pyx_v_rows;
  size_t __pyx_v_cols;
  size_t __pyx_v_nnz;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[4] = {0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("spMatGetSize (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_desc,&__pyx_mstate_global->__pyx_n_u_rows,&__pyx_mstate_global->__pyx_n_u_cols,&__pyx_mstate_global->__pyx_n_u_nnz,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 4813, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4813, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4813, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4813, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4813, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "spMatGetSize", 0) < (0)) __PYX_ERR(0, 4813, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 4; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("spMatGetSize", 1, 4, 4, i); __PYX_ERR(0, 4813, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 4)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4813, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4813, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4813, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4813, __pyx_L3_error)
    }
    __pyx_v_desc = __Pyx_PyLong_As_size_t(values[0]); if (unlikely((__pyx_v_desc == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4814, __pyx_L3_error)
    __pyx_v_rows = __Pyx_PyLong_As_size_t(values[1]); if (unlikely((__pyx_v_rows == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4814, __pyx_L3_error)
    __pyx_v_cols = __Pyx_PyLong_As_size_t(values[2]); if (unlikely((__pyx_v_cols == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4814, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyLong_As_size_t(values[3]); if (unlikely((__pyx_v_nnz == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4814, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("spMatGetSize", 1, 4, 4, __pyx_nargs); __PYX_ERR(0, 4813, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.spMatGetSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_524spMatGetSize(__pyx_self, __pyx_v_desc, __pyx_v_rows, __pyx_v_cols, __pyx_v_nnz);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_524spMatGetSize(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_desc, size_t __pyx_v_rows, size_t __pyx_v_cols, size_t __pyx_v_nnz) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("spMatGetSize", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_spMatGetSize(__pyx_v_desc, __pyx_v_rows, __pyx_v_cols, __pyx_v_nnz, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4813, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4813, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":4819
 *     check_status(status)
 * 
 * cpdef int spMatGetStridedBatch(size_t desc) except? -1:             # <<<<<<<<<<<<<<
 *     cdef int batchCount
 *     status = cusparseSpMatGetStridedBatch(<SpMatDescr>desc, &batchCount)
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_527spMatGetStridedBatch(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static int __pyx_f_13cupy_backends_4cuda_4libs_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_backends/cuda/libs/cusparse.pyx":4821
 * cpdef int spMatGetStridedBatch(size_t desc) except? -1:
 *     cdef 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_backends/cuda/libs/cusparse.pyx":4822
 *     cdef int batchCount
 *     status = cusparseSpMatGetStridedBatch(<SpMatDescr>desc, &batchCount)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return batchCount
 * 
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4822, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":4823
 *     status = cusparseSpMatGetStridedBatch(<SpMatDescr>desc, &batchCount)
 *     check_status(status)
 *     return batchCount             # <<<<<<<<<<<<<<
 * 
 * cpdef void spMatSetStridedBatch(size_t desc, int batchCount) except *:
*/
  __pyx_r = __pyx_v_batchCount;
  goto __pyx_L0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":4819
 *     check_status(status)
 * 
 * cpdef int spMatGetStridedBatch(size_t desc) except? -1:             # <<<<<<<<<<<<<<
 *     cdef int batchCount
 *     status = cusparseSpMatGetStridedBatch(<SpMatDescr>desc, &batchCount)
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.spMatGetStridedBatch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_527spMatGetStridedBatch(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_526spMatGetStridedBatch, "spMatGetStridedBatch(size_t desc) -> int");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_527spMatGetStridedBatch(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  size_t __pyx_v_desc;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("spMatGetStridedBatch (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_desc,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 4819, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4819, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "spMatGetStridedBatch", 0) < (0)) __PYX_ERR(0, 4819, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("spMatGetStridedBatch", 1, 1, 1, i); __PYX_ERR(0, 4819, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4819, __pyx_L3_error)
    }
    __pyx_v_desc = __Pyx_PyLong_As_size_t(values[0]); if (unlikely((__pyx_v_desc == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4819, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("spMatGetStridedBatch", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 4819, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.spMatGetStridedBatch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_526spMatGetStridedBatch(__pyx_self, __pyx_v_desc);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_526spMatGetStridedBatch(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_desc) {
  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("spMatGetStridedBatch", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_spMatGetStridedBatch(__pyx_v_desc, 1); if (unlikely(__pyx_t_1 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4819, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4819, __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_backends.cuda.libs.cusparse.spMatGetStridedBatch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy_backends/cuda/libs/cusparse.pyx":4825
 *     return batchCount
 * 
 * cpdef void spMatSetStridedBatch(size_t desc, int batchCount) except *:             # <<<<<<<<<<<<<<
 *     status = cusparseSpMatSetStridedBatch(<SpMatDescr>desc, batchCount)
 *     check_status(status)
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_529spMatSetStridedBatch(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_spMatSetStridedBatch(size_t __pyx_v_desc, int __pyx_v_batchCount, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  __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_backends/cuda/libs/cusparse.pyx":4826
 * 
 * cpdef void spMatSetStridedBatch(size_t desc, int batchCount) except *:
 *     status = cusparseSpMatSetStridedBatch(<SpMatDescr>desc, batchCount)             # <<<<<<<<<<<<<<
 *     check_status(status)
 * 
*/
  __pyx_v_status = cusparseSpMatSetStridedBatch(((cusparseSpMatDescr_t)__pyx_v_desc), __pyx_v_batchCount);

  /* "cupy_backends/cuda/libs/cusparse.pyx":4827
 * cpdef void spMatSetStridedBatch(size_t desc, int batchCount) except *:
 *     status = cusparseSpMatSetStridedBatch(<SpMatDescr>desc, batchCount)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * ############################################################
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4827, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":4825
 *     return batchCount
 * 
 * cpdef void spMatSetStridedBatch(size_t desc, int batchCount) except *:             # <<<<<<<<<<<<<<
 *     status = cusparseSpMatSetStridedBatch(<SpMatDescr>desc, batchCount)
 *     check_status(status)
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.spMatSetStridedBatch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_529spMatSetStridedBatch(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_528spMatSetStridedBatch, "spMatSetStridedBatch(size_t desc, int batchCount) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_529spMatSetStridedBatch(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  size_t __pyx_v_desc;
  int __pyx_v_batchCount;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("spMatSetStridedBatch (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_desc,&__pyx_mstate_global->__pyx_n_u_batchCount,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 4825, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4825, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4825, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "spMatSetStridedBatch", 0) < (0)) __PYX_ERR(0, 4825, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("spMatSetStridedBatch", 1, 2, 2, i); __PYX_ERR(0, 4825, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4825, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4825, __pyx_L3_error)
    }
    __pyx_v_desc = __Pyx_PyLong_As_size_t(values[0]); if (unlikely((__pyx_v_desc == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4825, __pyx_L3_error)
    __pyx_v_batchCount = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_batchCount == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4825, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("spMatSetStridedBatch", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 4825, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.spMatSetStridedBatch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_528spMatSetStridedBatch(__pyx_self, __pyx_v_desc, __pyx_v_batchCount);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_528spMatSetStridedBatch(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_f_13cupy_backends_4cuda_4libs_8cusparse_spMatSetStridedBatch(__pyx_v_desc, __pyx_v_batchCount, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4825, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4825, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":4832
 * # Dense Vector APIs
 * 
 * cpdef size_t createDnVec(int64_t size, intptr_t values,             # <<<<<<<<<<<<<<
 *                          DataType valueType) except? -1:
 *     cdef DnVecDescr desc
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_531createDnVec(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static size_t __pyx_f_13cupy_backends_4cuda_4libs_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_backends/cuda/libs/cusparse.pyx":4835
 *                          DataType valueType) except? -1:
 *     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_backends/cuda/libs/cusparse.pyx":4836
 *     cdef DnVecDescr desc
 *     status = cusparseCreateDnVec(&desc, size, <void*>values, valueType)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return <size_t>desc
 * 
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4836, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":4837
 *     status = cusparseCreateDnVec(&desc, size, <void*>values, valueType)
 *     check_status(status)
 *     return <size_t>desc             # <<<<<<<<<<<<<<
 * 
 * cpdef void destroyDnVec(size_t desc) except *:
*/
  __pyx_r = ((size_t)__pyx_v_desc);
  goto __pyx_L0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":4832
 * # Dense Vector APIs
 * 
 * cpdef size_t createDnVec(int64_t size, intptr_t values,             # <<<<<<<<<<<<<<
 *                          DataType valueType) except? -1:
 *     cdef DnVecDescr desc
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.createDnVec", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1L;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_531createDnVec(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_530createDnVec, "createDnVec(int64_t size, intptr_t values, DataType valueType) -> size_t");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_531createDnVec(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  int64_t __pyx_v_size;
  intptr_t __pyx_v_values;
  cudaDataType __pyx_v_valueType;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("createDnVec (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_size,&__pyx_mstate_global->__pyx_n_u_values,&__pyx_mstate_global->__pyx_n_u_valueType,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 4832, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4832, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4832, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4832, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "createDnVec", 0) < (0)) __PYX_ERR(0, 4832, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("createDnVec", 1, 3, 3, i); __PYX_ERR(0, 4832, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4832, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4832, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4832, __pyx_L3_error)
    }
    __pyx_v_size = __Pyx_PyLong_As_int64_t(values[0]); if (unlikely((__pyx_v_size == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4832, __pyx_L3_error)
    __pyx_v_values = PyLong_AsSsize_t(values[1]); if (unlikely((__pyx_v_values == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4832, __pyx_L3_error)
    __pyx_v_valueType = __Pyx_PyLong_As_cudaDataType(values[2]); if (unlikely((__pyx_v_valueType == ((cudaDataType)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4833, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("createDnVec", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 4832, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.createDnVec", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_530createDnVec(__pyx_self, __pyx_v_size, __pyx_v_values, __pyx_v_valueType);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_530createDnVec(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_13cupy_backends_4cuda_4libs_8cusparse_createDnVec(__pyx_v_size, __pyx_v_values, __pyx_v_valueType, 1); if (unlikely(__pyx_t_1 == ((size_t)-1L) && PyErr_Occurred())) __PYX_ERR(0, 4832, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyLong_FromSize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4832, __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_backends.cuda.libs.cusparse.createDnVec", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy_backends/cuda/libs/cusparse.pyx":4839
 *     return <size_t>desc
 * 
 * cpdef void destroyDnVec(size_t desc) except *:             # <<<<<<<<<<<<<<
 *     status = cusparseDestroyDnVec(<DnVecDescr>desc)
 *     check_status(status)
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_533destroyDnVec(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_destroyDnVec(size_t __pyx_v_desc, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  __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_backends/cuda/libs/cusparse.pyx":4840
 * 
 * cpdef void destroyDnVec(size_t desc) except *:
 *     status = cusparseDestroyDnVec(<DnVecDescr>desc)             # <<<<<<<<<<<<<<
 *     check_status(status)
 * 
*/
  __pyx_v_status = cusparseDestroyDnVec(((cusparseDnVecDescr_t)__pyx_v_desc));

  /* "cupy_backends/cuda/libs/cusparse.pyx":4841
 * cpdef void destroyDnVec(size_t desc) except *:
 *     status = cusparseDestroyDnVec(<DnVecDescr>desc)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef DnVecAttributes dnVecGet(size_t desc):
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4841, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":4839
 *     return <size_t>desc
 * 
 * cpdef void destroyDnVec(size_t desc) except *:             # <<<<<<<<<<<<<<
 *     status = cusparseDestroyDnVec(<DnVecDescr>desc)
 *     check_status(status)
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.destroyDnVec", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_533destroyDnVec(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_532destroyDnVec, "destroyDnVec(size_t desc) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_533destroyDnVec(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  size_t __pyx_v_desc;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("destroyDnVec (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_desc,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 4839, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4839, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "destroyDnVec", 0) < (0)) __PYX_ERR(0, 4839, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("destroyDnVec", 1, 1, 1, i); __PYX_ERR(0, 4839, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4839, __pyx_L3_error)
    }
    __pyx_v_desc = __Pyx_PyLong_As_size_t(values[0]); if (unlikely((__pyx_v_desc == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4839, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("destroyDnVec", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 4839, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.destroyDnVec", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_532destroyDnVec(__pyx_self, __pyx_v_desc);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_532destroyDnVec(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_f_13cupy_backends_4cuda_4libs_8cusparse_destroyDnVec(__pyx_v_desc, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4839, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4839, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":4843
 *     check_status(status)
 * 
 * cpdef DnVecAttributes dnVecGet(size_t desc):             # <<<<<<<<<<<<<<
 *     cdef int64_t size
 *     cdef intptr_t values
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_535dnVecGet(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_DnVecAttributes *__pyx_f_13cupy_backends_4cuda_4libs_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_13cupy_backends_4cuda_4libs_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;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dnVecGet", 0);

  /* "cupy_backends/cuda/libs/cusparse.pyx":4847
 *     cdef intptr_t 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_backends/cuda/libs/cusparse.pyx":4849
 *     status = cusparseDnVecGet(<DnVecDescr>desc, &size, <void**>&values,
 *                               &valueType)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return DnVecAttributes(size, values, valueType)
 * 
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4849, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":4850
 *                               &valueType)
 *     check_status(status)
 *     return DnVecAttributes(size, values, valueType)             # <<<<<<<<<<<<<<
 * 
 * cpdef intptr_t dnVecGetValues(size_t desc) except? -1:
*/
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_2 = NULL;
  __pyx_t_3 = __Pyx_PyLong_From_int64_t(__pyx_v_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4850, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyLong_FromSsize_t(__pyx_v_values); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4850, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyLong_From_cudaDataType(__pyx_v_valueType); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4850, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = 1;
  {
    PyObject *__pyx_callargs[4] = {__pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_t_5};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_13cupy_backends_4cuda_4libs_8cusparse_DnVecAttributes, __pyx_callargs+__pyx_t_6, (4-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4850, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_r = ((struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_DnVecAttributes *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":4843
 *     check_status(status)
 * 
 * cpdef DnVecAttributes dnVecGet(size_t desc):             # <<<<<<<<<<<<<<
 *     cdef int64_t size
 *     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_AddTraceback("cupy_backends.cuda.libs.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_13cupy_backends_4cuda_4libs_8cusparse_535dnVecGet(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_534dnVecGet, "dnVecGet(size_t desc) -> DnVecAttributes");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_535dnVecGet(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  size_t __pyx_v_desc;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dnVecGet (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_desc,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 4843, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4843, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "dnVecGet", 0) < (0)) __PYX_ERR(0, 4843, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("dnVecGet", 1, 1, 1, i); __PYX_ERR(0, 4843, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4843, __pyx_L3_error)
    }
    __pyx_v_desc = __Pyx_PyLong_As_size_t(values[0]); if (unlikely((__pyx_v_desc == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4843, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("dnVecGet", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 4843, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.dnVecGet", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_534dnVecGet(__pyx_self, __pyx_v_desc);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_534dnVecGet(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_13cupy_backends_4cuda_4libs_8cusparse_dnVecGet(__pyx_v_desc, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4843, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":4852
 *     return DnVecAttributes(size, values, valueType)
 * 
 * cpdef intptr_t dnVecGetValues(size_t desc) except? -1:             # <<<<<<<<<<<<<<
 *     cdef intptr_t values
 *     status = cusparseDnVecGetValues(<DnVecDescr>desc, <void**>&values)
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_537dnVecGetValues(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static intptr_t __pyx_f_13cupy_backends_4cuda_4libs_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_backends/cuda/libs/cusparse.pyx":4854
 * cpdef intptr_t dnVecGetValues(size_t desc) except? -1:
 *     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_backends/cuda/libs/cusparse.pyx":4855
 *     cdef intptr_t values
 *     status = cusparseDnVecGetValues(<DnVecDescr>desc, <void**>&values)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return values
 * 
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4855, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":4856
 *     status = cusparseDnVecGetValues(<DnVecDescr>desc, <void**>&values)
 *     check_status(status)
 *     return values             # <<<<<<<<<<<<<<
 * 
 * cpdef void dnVecSetValues(size_t desc, intptr_t values) except *:
*/
  __pyx_r = __pyx_v_values;
  goto __pyx_L0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":4852
 *     return DnVecAttributes(size, values, valueType)
 * 
 * cpdef intptr_t dnVecGetValues(size_t desc) except? -1:             # <<<<<<<<<<<<<<
 *     cdef intptr_t values
 *     status = cusparseDnVecGetValues(<DnVecDescr>desc, <void**>&values)
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.dnVecGetValues", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1L;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_537dnVecGetValues(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_536dnVecGetValues, "dnVecGetValues(size_t desc) -> intptr_t");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_537dnVecGetValues(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  size_t __pyx_v_desc;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dnVecGetValues (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_desc,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 4852, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4852, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "dnVecGetValues", 0) < (0)) __PYX_ERR(0, 4852, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("dnVecGetValues", 1, 1, 1, i); __PYX_ERR(0, 4852, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4852, __pyx_L3_error)
    }
    __pyx_v_desc = __Pyx_PyLong_As_size_t(values[0]); if (unlikely((__pyx_v_desc == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4852, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("dnVecGetValues", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 4852, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.dnVecGetValues", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_536dnVecGetValues(__pyx_self, __pyx_v_desc);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_536dnVecGetValues(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_desc) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  intptr_t __pyx_t_1;
  PyObject *__pyx_t_2 = 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 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_dnVecGetValues(__pyx_v_desc, 1); if (unlikely(__pyx_t_1 == ((intptr_t)-1L) && PyErr_Occurred())) __PYX_ERR(0, 4852, __pyx_L1_error)
  __pyx_t_2 = PyLong_FromSsize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4852, __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_backends.cuda.libs.cusparse.dnVecGetValues", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy_backends/cuda/libs/cusparse.pyx":4858
 *     return values
 * 
 * cpdef void dnVecSetValues(size_t desc, intptr_t values) except *:             # <<<<<<<<<<<<<<
 *     status = cusparseDnVecSetValues(<DnVecDescr>desc, <void*>values)
 *     check_status(status)
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_539dnVecSetValues(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_dnVecSetValues(size_t __pyx_v_desc, intptr_t __pyx_v_values, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  __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_backends/cuda/libs/cusparse.pyx":4859
 * 
 * cpdef void dnVecSetValues(size_t desc, intptr_t values) except *:
 *     status = cusparseDnVecSetValues(<DnVecDescr>desc, <void*>values)             # <<<<<<<<<<<<<<
 *     check_status(status)
 * 
*/
  __pyx_v_status = cusparseDnVecSetValues(((cusparseDnVecDescr_t)__pyx_v_desc), ((void *)__pyx_v_values));

  /* "cupy_backends/cuda/libs/cusparse.pyx":4860
 * cpdef void dnVecSetValues(size_t desc, intptr_t values) except *:
 *     status = cusparseDnVecSetValues(<DnVecDescr>desc, <void*>values)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * ############################################################
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4860, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":4858
 *     return values
 * 
 * cpdef void dnVecSetValues(size_t desc, intptr_t values) except *:             # <<<<<<<<<<<<<<
 *     status = cusparseDnVecSetValues(<DnVecDescr>desc, <void*>values)
 *     check_status(status)
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.dnVecSetValues", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_539dnVecSetValues(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_538dnVecSetValues, "dnVecSetValues(size_t desc, intptr_t values) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_539dnVecSetValues(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  size_t __pyx_v_desc;
  intptr_t __pyx_v_values;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dnVecSetValues (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_desc,&__pyx_mstate_global->__pyx_n_u_values,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 4858, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4858, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4858, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "dnVecSetValues", 0) < (0)) __PYX_ERR(0, 4858, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("dnVecSetValues", 1, 2, 2, i); __PYX_ERR(0, 4858, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4858, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4858, __pyx_L3_error)
    }
    __pyx_v_desc = __Pyx_PyLong_As_size_t(values[0]); if (unlikely((__pyx_v_desc == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4858, __pyx_L3_error)
    __pyx_v_values = PyLong_AsSsize_t(values[1]); if (unlikely((__pyx_v_values == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4858, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("dnVecSetValues", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 4858, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.dnVecSetValues", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_538dnVecSetValues(__pyx_self, __pyx_v_desc, __pyx_v_values);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_538dnVecSetValues(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_f_13cupy_backends_4cuda_4libs_8cusparse_dnVecSetValues(__pyx_v_desc, __pyx_v_values, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4858, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4858, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":4865
 * # Dense Matrix APIs
 * 
 * cpdef size_t createDnMat(int64_t rows, int64_t cols, int64_t ld,             # <<<<<<<<<<<<<<
 *                          intptr_t values, DataType valueType,
 *                          Order order) except? -1:
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_541createDnMat(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static size_t __pyx_f_13cupy_backends_4cuda_4libs_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_backends/cuda/libs/cusparse.pyx":4869
 *                          Order order) except? -1:
 *     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_backends/cuda/libs/cusparse.pyx":4871
 *     status = cusparseCreateDnMat(&desc, rows, cols, ld, <void*>values,
 *                                  valueType, order)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return <size_t>desc
 * 
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4871, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":4872
 *                                  valueType, order)
 *     check_status(status)
 *     return <size_t>desc             # <<<<<<<<<<<<<<
 * 
 * cpdef void destroyDnMat(size_t desc) except *:
*/
  __pyx_r = ((size_t)__pyx_v_desc);
  goto __pyx_L0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":4865
 * # Dense Matrix APIs
 * 
 * cpdef size_t createDnMat(int64_t rows, int64_t cols, int64_t ld,             # <<<<<<<<<<<<<<
 *                          intptr_t values, DataType valueType,
 *                          Order order) except? -1:
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.createDnMat", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1L;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_541createDnMat(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_540createDnMat, "createDnMat(int64_t rows, int64_t cols, int64_t ld, intptr_t values, DataType valueType, Order order) -> size_t");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_541createDnMat(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[6] = {0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("createDnMat (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_rows,&__pyx_mstate_global->__pyx_n_u_cols,&__pyx_mstate_global->__pyx_n_u_ld,&__pyx_mstate_global->__pyx_n_u_values,&__pyx_mstate_global->__pyx_n_u_valueType,&__pyx_mstate_global->__pyx_n_u_order,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 4865, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 4865, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4865, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4865, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4865, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4865, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4865, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "createDnMat", 0) < (0)) __PYX_ERR(0, 4865, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 6; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("createDnMat", 1, 6, 6, i); __PYX_ERR(0, 4865, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 6)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4865, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4865, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4865, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4865, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4865, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 4865, __pyx_L3_error)
    }
    __pyx_v_rows = __Pyx_PyLong_As_int64_t(values[0]); if (unlikely((__pyx_v_rows == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4865, __pyx_L3_error)
    __pyx_v_cols = __Pyx_PyLong_As_int64_t(values[1]); if (unlikely((__pyx_v_cols == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4865, __pyx_L3_error)
    __pyx_v_ld = __Pyx_PyLong_As_int64_t(values[2]); if (unlikely((__pyx_v_ld == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4865, __pyx_L3_error)
    __pyx_v_values = PyLong_AsSsize_t(values[3]); if (unlikely((__pyx_v_values == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4866, __pyx_L3_error)
    __pyx_v_valueType = __Pyx_PyLong_As_cudaDataType(values[4]); if (unlikely((__pyx_v_valueType == ((cudaDataType)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4866, __pyx_L3_error)
    __pyx_v_order = __Pyx_PyLong_As_cusparseOrder_t(values[5]); if (unlikely((__pyx_v_order == ((cusparseOrder_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4867, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("createDnMat", 1, 6, 6, __pyx_nargs); __PYX_ERR(0, 4865, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.createDnMat", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_540createDnMat(__pyx_self, __pyx_v_rows, __pyx_v_cols, __pyx_v_ld, __pyx_v_values, __pyx_v_valueType, __pyx_v_order);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_540createDnMat(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
  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("createDnMat", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_createDnMat(__pyx_v_rows, __pyx_v_cols, __pyx_v_ld, __pyx_v_values, __pyx_v_valueType, __pyx_v_order, 1); if (unlikely(__pyx_t_1 == ((size_t)-1L) && PyErr_Occurred())) __PYX_ERR(0, 4865, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyLong_FromSize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4865, __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_backends.cuda.libs.cusparse.createDnMat", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy_backends/cuda/libs/cusparse.pyx":4874
 *     return <size_t>desc
 * 
 * cpdef void destroyDnMat(size_t desc) except *:             # <<<<<<<<<<<<<<
 *     status = cusparseDestroyDnMat(<DnMatDescr>desc)
 *     check_status(status)
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_543destroyDnMat(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_destroyDnMat(size_t __pyx_v_desc, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  __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_backends/cuda/libs/cusparse.pyx":4875
 * 
 * cpdef void destroyDnMat(size_t desc) except *:
 *     status = cusparseDestroyDnMat(<DnMatDescr>desc)             # <<<<<<<<<<<<<<
 *     check_status(status)
 * 
*/
  __pyx_v_status = cusparseDestroyDnMat(((cusparseDnMatDescr_t)__pyx_v_desc));

  /* "cupy_backends/cuda/libs/cusparse.pyx":4876
 * cpdef void destroyDnMat(size_t desc) except *:
 *     status = cusparseDestroyDnMat(<DnMatDescr>desc)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef DnMatAttributes dnMatGet(size_t desc):
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4876, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":4874
 *     return <size_t>desc
 * 
 * cpdef void destroyDnMat(size_t desc) except *:             # <<<<<<<<<<<<<<
 *     status = cusparseDestroyDnMat(<DnMatDescr>desc)
 *     check_status(status)
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.destroyDnMat", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_543destroyDnMat(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_542destroyDnMat, "destroyDnMat(size_t desc) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_543destroyDnMat(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  size_t __pyx_v_desc;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("destroyDnMat (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_desc,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 4874, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4874, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "destroyDnMat", 0) < (0)) __PYX_ERR(0, 4874, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("destroyDnMat", 1, 1, 1, i); __PYX_ERR(0, 4874, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4874, __pyx_L3_error)
    }
    __pyx_v_desc = __Pyx_PyLong_As_size_t(values[0]); if (unlikely((__pyx_v_desc == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4874, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("destroyDnMat", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 4874, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.destroyDnMat", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_542destroyDnMat(__pyx_self, __pyx_v_desc);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_542destroyDnMat(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_f_13cupy_backends_4cuda_4libs_8cusparse_destroyDnMat(__pyx_v_desc, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4874, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4874, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":4878
 *     check_status(status)
 * 
 * cpdef DnMatAttributes dnMatGet(size_t desc):             # <<<<<<<<<<<<<<
 *     cdef int64_t rows, cols, ld
 *     cdef intptr_t values,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_545dnMatGet(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_DnMatAttributes *__pyx_f_13cupy_backends_4cuda_4libs_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;
  struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_DnMatAttributes *__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;
  size_t __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dnMatGet", 0);

  /* "cupy_backends/cuda/libs/cusparse.pyx":4883
 *     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_backends/cuda/libs/cusparse.pyx":4885
 *     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_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4885, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":4886
 *                               <void**>&values, &valueType, &order)
 *     check_status(status)
 *     return DnMatAttributes(rows, cols, ld, values, valueType, order)             # <<<<<<<<<<<<<<
 * 
 * cpdef intptr_t dnMatGetValues(size_t desc) except? -1:
*/
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_2 = NULL;
  __pyx_t_3 = __Pyx_PyLong_From_int64_t(__pyx_v_rows); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4886, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyLong_From_int64_t(__pyx_v_cols); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4886, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyLong_From_int64_t(__pyx_v_ld); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4886, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyLong_FromSsize_t(__pyx_v_values); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4886, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = __Pyx_PyLong_From_cudaDataType(__pyx_v_valueType); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4886, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = __Pyx_PyLong_From_cusparseOrder_t(__pyx_v_order); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4886, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_9 = 1;
  {
    PyObject *__pyx_callargs[7] = {__pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_t_7, __pyx_t_8};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_13cupy_backends_4cuda_4libs_8cusparse_DnMatAttributes, __pyx_callargs+__pyx_t_9, (7-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4886, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_r = ((struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_DnMatAttributes *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":4878
 *     check_status(status)
 * 
 * cpdef DnMatAttributes 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_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.dnMatGet", __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_13cupy_backends_4cuda_4libs_8cusparse_545dnMatGet(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_544dnMatGet, "dnMatGet(size_t desc) -> DnMatAttributes");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_545dnMatGet(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  size_t __pyx_v_desc;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dnMatGet (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_desc,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 4878, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4878, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "dnMatGet", 0) < (0)) __PYX_ERR(0, 4878, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("dnMatGet", 1, 1, 1, i); __PYX_ERR(0, 4878, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4878, __pyx_L3_error)
    }
    __pyx_v_desc = __Pyx_PyLong_As_size_t(values[0]); if (unlikely((__pyx_v_desc == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4878, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("dnMatGet", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 4878, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.dnMatGet", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_544dnMatGet(__pyx_self, __pyx_v_desc);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_544dnMatGet(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 = ((PyObject *)__pyx_f_13cupy_backends_4cuda_4libs_8cusparse_dnMatGet(__pyx_v_desc, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4878, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":4888
 *     return DnMatAttributes(rows, cols, ld, values, valueType, order)
 * 
 * cpdef intptr_t dnMatGetValues(size_t desc) except? -1:             # <<<<<<<<<<<<<<
 *     cdef intptr_t values
 *     status = cusparseDnMatGetValues(<DnMatDescr>desc, <void**>&values)
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_547dnMatGetValues(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static intptr_t __pyx_f_13cupy_backends_4cuda_4libs_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_backends/cuda/libs/cusparse.pyx":4890
 * cpdef intptr_t dnMatGetValues(size_t desc) except? -1:
 *     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_backends/cuda/libs/cusparse.pyx":4891
 *     cdef intptr_t values
 *     status = cusparseDnMatGetValues(<DnMatDescr>desc, <void**>&values)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return values
 * 
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4891, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":4892
 *     status = cusparseDnMatGetValues(<DnMatDescr>desc, <void**>&values)
 *     check_status(status)
 *     return values             # <<<<<<<<<<<<<<
 * 
 * cpdef void dnMatSetValues(size_t desc, intptr_t values) except *:
*/
  __pyx_r = __pyx_v_values;
  goto __pyx_L0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":4888
 *     return DnMatAttributes(rows, cols, ld, values, valueType, order)
 * 
 * cpdef intptr_t dnMatGetValues(size_t desc) except? -1:             # <<<<<<<<<<<<<<
 *     cdef intptr_t values
 *     status = cusparseDnMatGetValues(<DnMatDescr>desc, <void**>&values)
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.dnMatGetValues", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1L;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_547dnMatGetValues(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_546dnMatGetValues, "dnMatGetValues(size_t desc) -> intptr_t");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_547dnMatGetValues(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  size_t __pyx_v_desc;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dnMatGetValues (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_desc,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 4888, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4888, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "dnMatGetValues", 0) < (0)) __PYX_ERR(0, 4888, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("dnMatGetValues", 1, 1, 1, i); __PYX_ERR(0, 4888, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4888, __pyx_L3_error)
    }
    __pyx_v_desc = __Pyx_PyLong_As_size_t(values[0]); if (unlikely((__pyx_v_desc == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4888, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("dnMatGetValues", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 4888, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.dnMatGetValues", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_546dnMatGetValues(__pyx_self, __pyx_v_desc);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_546dnMatGetValues(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_desc) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  intptr_t __pyx_t_1;
  PyObject *__pyx_t_2 = 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 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_dnMatGetValues(__pyx_v_desc, 1); if (unlikely(__pyx_t_1 == ((intptr_t)-1L) && PyErr_Occurred())) __PYX_ERR(0, 4888, __pyx_L1_error)
  __pyx_t_2 = PyLong_FromSsize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4888, __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_backends.cuda.libs.cusparse.dnMatGetValues", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy_backends/cuda/libs/cusparse.pyx":4894
 *     return values
 * 
 * cpdef void dnMatSetValues(size_t desc, intptr_t values) except *:             # <<<<<<<<<<<<<<
 *     status = cusparseDnMatSetValues(<DnMatDescr>desc, <void*>values)
 *     check_status(status)
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_549dnMatSetValues(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_dnMatSetValues(size_t __pyx_v_desc, intptr_t __pyx_v_values, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  __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_backends/cuda/libs/cusparse.pyx":4895
 * 
 * cpdef void dnMatSetValues(size_t desc, intptr_t values) except *:
 *     status = cusparseDnMatSetValues(<DnMatDescr>desc, <void*>values)             # <<<<<<<<<<<<<<
 *     check_status(status)
 * 
*/
  __pyx_v_status = cusparseDnMatSetValues(((cusparseDnMatDescr_t)__pyx_v_desc), ((void *)__pyx_v_values));

  /* "cupy_backends/cuda/libs/cusparse.pyx":4896
 * cpdef void dnMatSetValues(size_t desc, intptr_t values) except *:
 *     status = cusparseDnMatSetValues(<DnMatDescr>desc, <void*>values)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef DnMatBatchAttributes dnMatGetStridedBatch(size_t desc):
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4896, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":4894
 *     return values
 * 
 * cpdef void dnMatSetValues(size_t desc, intptr_t values) except *:             # <<<<<<<<<<<<<<
 *     status = cusparseDnMatSetValues(<DnMatDescr>desc, <void*>values)
 *     check_status(status)
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.dnMatSetValues", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_549dnMatSetValues(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_548dnMatSetValues, "dnMatSetValues(size_t desc, intptr_t values) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_549dnMatSetValues(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  size_t __pyx_v_desc;
  intptr_t __pyx_v_values;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dnMatSetValues (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_desc,&__pyx_mstate_global->__pyx_n_u_values,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 4894, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4894, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4894, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "dnMatSetValues", 0) < (0)) __PYX_ERR(0, 4894, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("dnMatSetValues", 1, 2, 2, i); __PYX_ERR(0, 4894, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4894, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4894, __pyx_L3_error)
    }
    __pyx_v_desc = __Pyx_PyLong_As_size_t(values[0]); if (unlikely((__pyx_v_desc == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4894, __pyx_L3_error)
    __pyx_v_values = PyLong_AsSsize_t(values[1]); if (unlikely((__pyx_v_values == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4894, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("dnMatSetValues", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 4894, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.dnMatSetValues", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_548dnMatSetValues(__pyx_self, __pyx_v_desc, __pyx_v_values);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_548dnMatSetValues(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_f_13cupy_backends_4cuda_4libs_8cusparse_dnMatSetValues(__pyx_v_desc, __pyx_v_values, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4894, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4894, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":4898
 *     check_status(status)
 * 
 * cpdef DnMatBatchAttributes dnMatGetStridedBatch(size_t desc):             # <<<<<<<<<<<<<<
 *     cdef int batchCount
 *     cdef int64_t batchStride
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_551dnMatGetStridedBatch(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_DnMatBatchAttributes *__pyx_f_13cupy_backends_4cuda_4libs_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_13cupy_backends_4cuda_4libs_8cusparse_DnMatBatchAttributes *__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;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dnMatGetStridedBatch", 0);

  /* "cupy_backends/cuda/libs/cusparse.pyx":4901
 *     cdef int batchCount
 *     cdef 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_backends/cuda/libs/cusparse.pyx":4903
 *     status = cusparseDnMatGetStridedBatch(<DnMatDescr>desc, &batchCount,
 *                                           &batchStride)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return DnMatBatchAttributes(batchCount, batchStride)
 * 
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4903, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":4904
 *                                           &batchStride)
 *     check_status(status)
 *     return DnMatBatchAttributes(batchCount, batchStride)             # <<<<<<<<<<<<<<
 * 
 * cpdef void dnMatSetStridedBatch(
*/
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_2 = NULL;
  __pyx_t_3 = __Pyx_PyLong_From_int(__pyx_v_batchCount); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4904, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyLong_From_int64_t(__pyx_v_batchStride); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4904, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = 1;
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_t_3, __pyx_t_4};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_13cupy_backends_4cuda_4libs_8cusparse_DnMatBatchAttributes, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4904, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_r = ((struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_DnMatBatchAttributes *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":4898
 *     check_status(status)
 * 
 * cpdef DnMatBatchAttributes dnMatGetStridedBatch(size_t desc):             # <<<<<<<<<<<<<<
 *     cdef int batchCount
 *     cdef 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_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.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_13cupy_backends_4cuda_4libs_8cusparse_551dnMatGetStridedBatch(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_550dnMatGetStridedBatch, "dnMatGetStridedBatch(size_t desc) -> DnMatBatchAttributes");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_551dnMatGetStridedBatch(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  size_t __pyx_v_desc;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dnMatGetStridedBatch (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_desc,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 4898, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4898, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "dnMatGetStridedBatch", 0) < (0)) __PYX_ERR(0, 4898, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("dnMatGetStridedBatch", 1, 1, 1, i); __PYX_ERR(0, 4898, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4898, __pyx_L3_error)
    }
    __pyx_v_desc = __Pyx_PyLong_As_size_t(values[0]); if (unlikely((__pyx_v_desc == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4898, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("dnMatGetStridedBatch", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 4898, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.dnMatGetStridedBatch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_550dnMatGetStridedBatch(__pyx_self, __pyx_v_desc);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_550dnMatGetStridedBatch(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_13cupy_backends_4cuda_4libs_8cusparse_dnMatGetStridedBatch(__pyx_v_desc, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4898, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":4906
 *     return DnMatBatchAttributes(batchCount, batchStride)
 * 
 * cpdef void dnMatSetStridedBatch(             # <<<<<<<<<<<<<<
 *         size_t desc, int batchCount, int64_t batchStride) except *:
 *     status = cusparseDnMatSetStridedBatch(<DnMatDescr>desc, batchCount,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_553dnMatSetStridedBatch(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_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;
  __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_backends/cuda/libs/cusparse.pyx":4908
 * cpdef void dnMatSetStridedBatch(
 *         size_t desc, int batchCount, int64_t batchStride) except *:
 *     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_backends/cuda/libs/cusparse.pyx":4910
 *     status = cusparseDnMatSetStridedBatch(<DnMatDescr>desc, batchCount,
 *                                           batchStride)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * ############################################################
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4910, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":4906
 *     return DnMatBatchAttributes(batchCount, batchStride)
 * 
 * cpdef void dnMatSetStridedBatch(             # <<<<<<<<<<<<<<
 *         size_t desc, int batchCount, int64_t batchStride) except *:
 *     status = cusparseDnMatSetStridedBatch(<DnMatDescr>desc, batchCount,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.dnMatSetStridedBatch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_553dnMatSetStridedBatch(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_552dnMatSetStridedBatch, "dnMatSetStridedBatch(size_t desc, int batchCount, int64_t batchStride) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_553dnMatSetStridedBatch(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  size_t __pyx_v_desc;
  int __pyx_v_batchCount;
  int64_t __pyx_v_batchStride;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dnMatSetStridedBatch (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_desc,&__pyx_mstate_global->__pyx_n_u_batchCount,&__pyx_mstate_global->__pyx_n_u_batchStride,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 4906, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4906, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4906, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4906, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "dnMatSetStridedBatch", 0) < (0)) __PYX_ERR(0, 4906, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("dnMatSetStridedBatch", 1, 3, 3, i); __PYX_ERR(0, 4906, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4906, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4906, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4906, __pyx_L3_error)
    }
    __pyx_v_desc = __Pyx_PyLong_As_size_t(values[0]); if (unlikely((__pyx_v_desc == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4907, __pyx_L3_error)
    __pyx_v_batchCount = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_batchCount == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4907, __pyx_L3_error)
    __pyx_v_batchStride = __Pyx_PyLong_As_int64_t(values[2]); if (unlikely((__pyx_v_batchStride == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4907, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("dnMatSetStridedBatch", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 4906, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.dnMatSetStridedBatch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_552dnMatSetStridedBatch(__pyx_self, __pyx_v_desc, __pyx_v_batchCount, __pyx_v_batchStride);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_552dnMatSetStridedBatch(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_f_13cupy_backends_4cuda_4libs_8cusparse_dnMatSetStridedBatch(__pyx_v_desc, __pyx_v_batchCount, __pyx_v_batchStride, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4906, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4906, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":4915
 * # Generic API Functions
 * 
 * cpdef size_t spVV_bufferSize(intptr_t handle, Operation opX,             # <<<<<<<<<<<<<<
 *                              size_t vecX, size_t vecY,
 *                              intptr_t result, DataType computeType) except? -1:
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_555spVV_bufferSize(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static size_t __pyx_f_13cupy_backends_4cuda_4libs_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_backends/cuda/libs/cusparse.pyx":4919
 *                              intptr_t result, DataType computeType) except? -1:
 *     cdef 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_backends/cuda/libs/cusparse.pyx":4922
 *                                      <SpVecDescr>vecX, <DnVecDescr>vecY,
 *                                      <void*>result, computeType, &bufferSize)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return bufferSize
 * 
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4922, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":4923
 *                                      <void*>result, computeType, &bufferSize)
 *     check_status(status)
 *     return bufferSize             # <<<<<<<<<<<<<<
 * 
 * cpdef void spVV(
*/
  __pyx_r = __pyx_v_bufferSize;
  goto __pyx_L0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":4915
 * # Generic API Functions
 * 
 * cpdef size_t spVV_bufferSize(intptr_t handle, Operation opX,             # <<<<<<<<<<<<<<
 *                              size_t vecX, size_t vecY,
 *                              intptr_t result, DataType computeType) except? -1:
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.spVV_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1L;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_555spVV_bufferSize(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_554spVV_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_13cupy_backends_4cuda_4libs_8cusparse_555spVV_bufferSize(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[6] = {0,0,0,0,0,0};
  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);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_opX,&__pyx_mstate_global->__pyx_n_u_vecX,&__pyx_mstate_global->__pyx_n_u_vecY,&__pyx_mstate_global->__pyx_n_u_result,&__pyx_mstate_global->__pyx_n_u_computeType,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 4915, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 4915, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4915, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4915, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4915, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4915, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4915, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "spVV_bufferSize", 0) < (0)) __PYX_ERR(0, 4915, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 6; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("spVV_bufferSize", 1, 6, 6, i); __PYX_ERR(0, 4915, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 6)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4915, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4915, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4915, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4915, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4915, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 4915, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4915, __pyx_L3_error)
    __pyx_v_opX = __Pyx_PyLong_As_cusparseOperation_t(values[1]); if (unlikely((__pyx_v_opX == ((cusparseOperation_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4915, __pyx_L3_error)
    __pyx_v_vecX = __Pyx_PyLong_As_size_t(values[2]); if (unlikely((__pyx_v_vecX == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4916, __pyx_L3_error)
    __pyx_v_vecY = __Pyx_PyLong_As_size_t(values[3]); if (unlikely((__pyx_v_vecY == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4916, __pyx_L3_error)
    __pyx_v_result = PyLong_AsSsize_t(values[4]); if (unlikely((__pyx_v_result == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4917, __pyx_L3_error)
    __pyx_v_computeType = __Pyx_PyLong_As_cudaDataType(values[5]); if (unlikely((__pyx_v_computeType == ((cudaDataType)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4917, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("spVV_bufferSize", 1, 6, 6, __pyx_nargs); __PYX_ERR(0, 4915, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.spVV_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_554spVV_bufferSize(__pyx_self, __pyx_v_handle, __pyx_v_opX, __pyx_v_vecX, __pyx_v_vecY, __pyx_v_result, __pyx_v_computeType);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_554spVV_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
  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("spVV_bufferSize", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_spVV_bufferSize(__pyx_v_handle, __pyx_v_opX, __pyx_v_vecX, __pyx_v_vecY, __pyx_v_result, __pyx_v_computeType, 1); if (unlikely(__pyx_t_1 == ((size_t)-1L) && PyErr_Occurred())) __PYX_ERR(0, 4915, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyLong_FromSize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4915, __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_backends.cuda.libs.cusparse.spVV_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy_backends/cuda/libs/cusparse.pyx":4925
 *     return bufferSize
 * 
 * cpdef void spVV(             # <<<<<<<<<<<<<<
 *         intptr_t handle, Operation opX, size_t vecX, size_t vecY,
 *         intptr_t result, DataType computeType,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_557spVV(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_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;
  __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_backends/cuda/libs/cusparse.pyx":4929
 *         intptr_t result, DataType computeType,
 *         intptr_t externalBuffer) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     status = cusparseSpVV(<Handle>handle, opX, <SpVecDescr>vecX,
 *                           <DnVecDescr>vecY, <void*>result, computeType,
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4929, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":4930
 *         intptr_t externalBuffer) except *:
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":4933
 *                           <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_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4933, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":4925
 *     return bufferSize
 * 
 * cpdef void spVV(             # <<<<<<<<<<<<<<
 *         intptr_t handle, Operation opX, size_t vecX, size_t vecY,
 *         intptr_t result, DataType computeType,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.spVV", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_557spVV(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_556spVV, "spVV(intptr_t handle, Operation opX, size_t vecX, size_t vecY, intptr_t result, DataType computeType, intptr_t externalBuffer) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_557spVV(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[7] = {0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("spVV (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_opX,&__pyx_mstate_global->__pyx_n_u_vecX,&__pyx_mstate_global->__pyx_n_u_vecY,&__pyx_mstate_global->__pyx_n_u_result,&__pyx_mstate_global->__pyx_n_u_computeType,&__pyx_mstate_global->__pyx_n_u_externalBuffer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 4925, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 4925, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 4925, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4925, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4925, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4925, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4925, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4925, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "spVV", 0) < (0)) __PYX_ERR(0, 4925, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 7; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("spVV", 1, 7, 7, i); __PYX_ERR(0, 4925, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 7)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4925, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4925, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4925, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4925, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4925, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 4925, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 4925, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4926, __pyx_L3_error)
    __pyx_v_opX = __Pyx_PyLong_As_cusparseOperation_t(values[1]); if (unlikely((__pyx_v_opX == ((cusparseOperation_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4926, __pyx_L3_error)
    __pyx_v_vecX = __Pyx_PyLong_As_size_t(values[2]); if (unlikely((__pyx_v_vecX == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4926, __pyx_L3_error)
    __pyx_v_vecY = __Pyx_PyLong_As_size_t(values[3]); if (unlikely((__pyx_v_vecY == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4926, __pyx_L3_error)
    __pyx_v_result = PyLong_AsSsize_t(values[4]); if (unlikely((__pyx_v_result == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4927, __pyx_L3_error)
    __pyx_v_computeType = __Pyx_PyLong_As_cudaDataType(values[5]); if (unlikely((__pyx_v_computeType == ((cudaDataType)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4927, __pyx_L3_error)
    __pyx_v_externalBuffer = PyLong_AsSsize_t(values[6]); if (unlikely((__pyx_v_externalBuffer == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4928, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("spVV", 1, 7, 7, __pyx_nargs); __PYX_ERR(0, 4925, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.spVV", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_556spVV(__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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_556spVV(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_f_13cupy_backends_4cuda_4libs_8cusparse_spVV(__pyx_v_handle, __pyx_v_opX, __pyx_v_vecX, __pyx_v_vecY, __pyx_v_result, __pyx_v_computeType, __pyx_v_externalBuffer, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4925, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4925, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":4935
 *     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,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_559spMV_bufferSize(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static size_t __pyx_f_13cupy_backends_4cuda_4libs_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_backends/cuda/libs/cusparse.pyx":4940
 *                              SpMVAlg alg) except? -1:
 *     cdef 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_backends/cuda/libs/cusparse.pyx":4944
 *                                      <void*>beta, <DnVecDescr>vecY,
 *                                      computeType, alg, &bufferSize)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return bufferSize
 * 
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4944, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":4945
 *                                      computeType, alg, &bufferSize)
 *     check_status(status)
 *     return bufferSize             # <<<<<<<<<<<<<<
 * 
 * cpdef void spMV(
*/
  __pyx_r = __pyx_v_bufferSize;
  goto __pyx_L0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":4935
 *     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,
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.spMV_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1L;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_559spMV_bufferSize(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_558spMV_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_13cupy_backends_4cuda_4libs_8cusparse_559spMV_bufferSize(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
  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);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_opA,&__pyx_mstate_global->__pyx_n_u_alpha,&__pyx_mstate_global->__pyx_n_u_matA,&__pyx_mstate_global->__pyx_n_u_vecX,&__pyx_mstate_global->__pyx_n_u_beta,&__pyx_mstate_global->__pyx_n_u_vecY,&__pyx_mstate_global->__pyx_n_u_computeType,&__pyx_mstate_global->__pyx_n_u_alg,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 4935, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 4935, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 4935, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 4935, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 4935, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4935, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4935, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4935, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4935, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4935, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "spMV_bufferSize", 0) < (0)) __PYX_ERR(0, 4935, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 9; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("spMV_bufferSize", 1, 9, 9, i); __PYX_ERR(0, 4935, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 9)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4935, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4935, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4935, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4935, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4935, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 4935, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 4935, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 4935, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 4935, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4935, __pyx_L3_error)
    __pyx_v_opA = __Pyx_PyLong_As_cusparseOperation_t(values[1]); if (unlikely((__pyx_v_opA == ((cusparseOperation_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4935, __pyx_L3_error)
    __pyx_v_alpha = PyLong_AsSsize_t(values[2]); if (unlikely((__pyx_v_alpha == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4935, __pyx_L3_error)
    __pyx_v_matA = __Pyx_PyLong_As_size_t(values[3]); if (unlikely((__pyx_v_matA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4936, __pyx_L3_error)
    __pyx_v_vecX = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_vecX == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4936, __pyx_L3_error)
    __pyx_v_beta = PyLong_AsSsize_t(values[5]); if (unlikely((__pyx_v_beta == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4936, __pyx_L3_error)
    __pyx_v_vecY = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_vecY == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4937, __pyx_L3_error)
    __pyx_v_computeType = __Pyx_PyLong_As_cudaDataType(values[7]); if (unlikely((__pyx_v_computeType == ((cudaDataType)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4937, __pyx_L3_error)
    __pyx_v_alg = __Pyx_PyLong_As_cusparseSpMVAlg_t(values[8]); if (unlikely((__pyx_v_alg == ((cusparseSpMVAlg_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4938, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("spMV_bufferSize", 1, 9, 9, __pyx_nargs); __PYX_ERR(0, 4935, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.spMV_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_558spMV_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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_558spMV_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
  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("spMV_bufferSize", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(__pyx_t_1 == ((size_t)-1L) && PyErr_Occurred())) __PYX_ERR(0, 4935, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyLong_FromSize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4935, __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_backends.cuda.libs.cusparse.spMV_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy_backends/cuda/libs/cusparse.pyx":4947
 *     return bufferSize
 * 
 * cpdef void spMV(             # <<<<<<<<<<<<<<
 *         intptr_t handle, Operation opA, intptr_t alpha, size_t matA,
 *         size_t vecX, intptr_t beta, size_t vecY, DataType computeType,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_561spMV(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_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;
  __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_backends/cuda/libs/cusparse.pyx":4951
 *         size_t vecX, intptr_t beta, size_t vecY, DataType computeType,
 *         SpMVAlg alg, intptr_t externalBuffer) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     status = cusparseSpMV(<Handle>handle, opA, <void*>alpha, <SpMatDescr>matA,
 *                           <DnVecDescr>vecX, <void*>beta, <DnVecDescr>vecY,
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4951, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":4952
 *         SpMVAlg alg, intptr_t externalBuffer) except *:
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":4955
 *                           <DnVecDescr>vecX, <void*>beta, <DnVecDescr>vecY,
 *                           computeType, alg, <void*>externalBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef size_t spSM_createDescr() except? -1:
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4955, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":4947
 *     return bufferSize
 * 
 * cpdef void spMV(             # <<<<<<<<<<<<<<
 *         intptr_t handle, Operation opA, intptr_t alpha, size_t matA,
 *         size_t vecX, intptr_t beta, size_t vecY, DataType computeType,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.spMV", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_561spMV(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_560spMV, "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) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_561spMV(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("spMV (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_opA,&__pyx_mstate_global->__pyx_n_u_alpha,&__pyx_mstate_global->__pyx_n_u_matA,&__pyx_mstate_global->__pyx_n_u_vecX,&__pyx_mstate_global->__pyx_n_u_beta,&__pyx_mstate_global->__pyx_n_u_vecY,&__pyx_mstate_global->__pyx_n_u_computeType,&__pyx_mstate_global->__pyx_n_u_alg,&__pyx_mstate_global->__pyx_n_u_externalBuffer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 4947, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 4947, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 4947, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 4947, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 4947, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 4947, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4947, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4947, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4947, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4947, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4947, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "spMV", 0) < (0)) __PYX_ERR(0, 4947, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 10; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("spMV", 1, 10, 10, i); __PYX_ERR(0, 4947, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 10)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4947, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4947, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4947, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4947, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4947, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 4947, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 4947, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 4947, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 4947, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 4947, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4948, __pyx_L3_error)
    __pyx_v_opA = __Pyx_PyLong_As_cusparseOperation_t(values[1]); if (unlikely((__pyx_v_opA == ((cusparseOperation_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4948, __pyx_L3_error)
    __pyx_v_alpha = PyLong_AsSsize_t(values[2]); if (unlikely((__pyx_v_alpha == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4948, __pyx_L3_error)
    __pyx_v_matA = __Pyx_PyLong_As_size_t(values[3]); if (unlikely((__pyx_v_matA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4948, __pyx_L3_error)
    __pyx_v_vecX = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_vecX == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4949, __pyx_L3_error)
    __pyx_v_beta = PyLong_AsSsize_t(values[5]); if (unlikely((__pyx_v_beta == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4949, __pyx_L3_error)
    __pyx_v_vecY = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_vecY == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4949, __pyx_L3_error)
    __pyx_v_computeType = __Pyx_PyLong_As_cudaDataType(values[7]); if (unlikely((__pyx_v_computeType == ((cudaDataType)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4949, __pyx_L3_error)
    __pyx_v_alg = __Pyx_PyLong_As_cusparseSpMVAlg_t(values[8]); if (unlikely((__pyx_v_alg == ((cusparseSpMVAlg_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4950, __pyx_L3_error)
    __pyx_v_externalBuffer = PyLong_AsSsize_t(values[9]); if (unlikely((__pyx_v_externalBuffer == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4950, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("spMV", 1, 10, 10, __pyx_nargs); __PYX_ERR(0, 4947, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.spMV", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_560spMV(__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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_560spMV(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_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4947, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4947, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":4957
 *     check_status(status)
 * 
 * cpdef size_t spSM_createDescr() except? -1:             # <<<<<<<<<<<<<<
 *     cdef SpSMDescr descr
 *     status = cusparseSpSM_createDescr(&descr)
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_563spSM_createDescr(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static size_t __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_spSM_createDescr(CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseSpSMDescr_t __pyx_v_descr;
  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("spSM_createDescr", 0);

  /* "cupy_backends/cuda/libs/cusparse.pyx":4959
 * cpdef size_t spSM_createDescr() except? -1:
 *     cdef SpSMDescr descr
 *     status = cusparseSpSM_createDescr(&descr)             # <<<<<<<<<<<<<<
 *     check_status(status)
 *     return <size_t>descr
*/
  __pyx_v_status = __pyx_v_13cupy_backends_4cuda_4libs_8cusparse_cusparseSpSM_createDescr((&__pyx_v_descr));

  /* "cupy_backends/cuda/libs/cusparse.pyx":4960
 *     cdef SpSMDescr descr
 *     status = cusparseSpSM_createDescr(&descr)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return <size_t>descr
 * 
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4960, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":4961
 *     status = cusparseSpSM_createDescr(&descr)
 *     check_status(status)
 *     return <size_t>descr             # <<<<<<<<<<<<<<
 * 
 * cpdef void spSM_destroyDescr(size_t descr) except *:
*/
  __pyx_r = ((size_t)__pyx_v_descr);
  goto __pyx_L0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":4957
 *     check_status(status)
 * 
 * cpdef size_t spSM_createDescr() except? -1:             # <<<<<<<<<<<<<<
 *     cdef SpSMDescr descr
 *     status = cusparseSpSM_createDescr(&descr)
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.spSM_createDescr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1L;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_563spSM_createDescr(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_562spSM_createDescr, "spSM_createDescr() -> size_t");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_563spSM_createDescr(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("spSM_createDescr (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_562spSM_createDescr(__pyx_self);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_562spSM_createDescr(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("spSM_createDescr", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_spSM_createDescr(1); if (unlikely(__pyx_t_1 == ((size_t)-1L) && PyErr_Occurred())) __PYX_ERR(0, 4957, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyLong_FromSize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4957, __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_backends.cuda.libs.cusparse.spSM_createDescr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy_backends/cuda/libs/cusparse.pyx":4963
 *     return <size_t>descr
 * 
 * cpdef void spSM_destroyDescr(size_t descr) except *:             # <<<<<<<<<<<<<<
 *     status = cusparseSpSM_destroyDescr(<SpSMDescr>descr)
 *     check_status(status)
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_565spSM_destroyDescr(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_spSM_destroyDescr(size_t __pyx_v_descr, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("spSM_destroyDescr", 0);

  /* "cupy_backends/cuda/libs/cusparse.pyx":4964
 * 
 * cpdef void spSM_destroyDescr(size_t descr) except *:
 *     status = cusparseSpSM_destroyDescr(<SpSMDescr>descr)             # <<<<<<<<<<<<<<
 *     check_status(status)
 * 
*/
  __pyx_v_status = __pyx_v_13cupy_backends_4cuda_4libs_8cusparse_cusparseSpSM_destroyDescr(((cusparseSpSMDescr_t)__pyx_v_descr));

  /* "cupy_backends/cuda/libs/cusparse.pyx":4965
 * cpdef void spSM_destroyDescr(size_t descr) except *:
 *     status = cusparseSpSM_destroyDescr(<SpSMDescr>descr)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef size_t spSM_bufferSize(intptr_t handle, Operation opA, Operation opB,
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4965, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":4963
 *     return <size_t>descr
 * 
 * cpdef void spSM_destroyDescr(size_t descr) except *:             # <<<<<<<<<<<<<<
 *     status = cusparseSpSM_destroyDescr(<SpSMDescr>descr)
 *     check_status(status)
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.spSM_destroyDescr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_565spSM_destroyDescr(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_564spSM_destroyDescr, "spSM_destroyDescr(size_t descr) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_565spSM_destroyDescr(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  size_t __pyx_v_descr;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("spSM_destroyDescr (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_descr,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 4963, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4963, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "spSM_destroyDescr", 0) < (0)) __PYX_ERR(0, 4963, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("spSM_destroyDescr", 1, 1, 1, i); __PYX_ERR(0, 4963, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4963, __pyx_L3_error)
    }
    __pyx_v_descr = __Pyx_PyLong_As_size_t(values[0]); if (unlikely((__pyx_v_descr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4963, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("spSM_destroyDescr", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 4963, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.spSM_destroyDescr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_564spSM_destroyDescr(__pyx_self, __pyx_v_descr);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_564spSM_destroyDescr(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("spSM_destroyDescr", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_spSM_destroyDescr(__pyx_v_descr, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4963, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4963, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":4967
 *     check_status(status)
 * 
 * cpdef size_t spSM_bufferSize(intptr_t handle, Operation opA, Operation opB,             # <<<<<<<<<<<<<<
 *                              intptr_t alpha, size_t matA, size_t matB,
 *                              size_t matC, DataType computeType, SpSMAlg alg,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_567spSM_bufferSize(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static size_t __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_spSM_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, size_t __pyx_v_matC, cudaDataType __pyx_v_computeType, cusparseSpSMAlg_t __pyx_v_alg, size_t __pyx_v_spsmDescr, 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("spSM_bufferSize", 0);

  /* "cupy_backends/cuda/libs/cusparse.pyx":4972
 *                              size_t spsmDescr) except? -1:
 *     cdef size_t bufferSize
 *     status = cusparseSpSM_bufferSize(<Handle>handle, opA, opB, <void*>alpha,             # <<<<<<<<<<<<<<
 *                                      <SpMatDescr>matA, <DnMatDescr>matB,
 *                                      <DnMatDescr>matC, computeType, alg,
*/
  __pyx_v_status = __pyx_v_13cupy_backends_4cuda_4libs_8cusparse_cusparseSpSM_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), ((cusparseDnMatDescr_t)__pyx_v_matC), __pyx_v_computeType, __pyx_v_alg, ((cusparseSpSMDescr_t)__pyx_v_spsmDescr), (&__pyx_v_bufferSize));

  /* "cupy_backends/cuda/libs/cusparse.pyx":4976
 *                                      <DnMatDescr>matC, computeType, alg,
 *                                      <SpSMDescr>spsmDescr, &bufferSize)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return bufferSize
 * 
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4976, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":4977
 *                                      <SpSMDescr>spsmDescr, &bufferSize)
 *     check_status(status)
 *     return bufferSize             # <<<<<<<<<<<<<<
 * 
 * cpdef void spSM_analysis(
*/
  __pyx_r = __pyx_v_bufferSize;
  goto __pyx_L0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":4967
 *     check_status(status)
 * 
 * cpdef size_t spSM_bufferSize(intptr_t handle, Operation opA, Operation opB,             # <<<<<<<<<<<<<<
 *                              intptr_t alpha, size_t matA, size_t matB,
 *                              size_t matC, DataType computeType, SpSMAlg alg,
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.spSM_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1L;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_567spSM_bufferSize(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_566spSM_bufferSize, "spSM_bufferSize(intptr_t handle, Operation opA, Operation opB, intptr_t alpha, size_t matA, size_t matB, size_t matC, DataType computeType, SpSMAlg alg, size_t spsmDescr) -> size_t");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_567spSM_bufferSize(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  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;
  size_t __pyx_v_matC;
  cudaDataType __pyx_v_computeType;
  cusparseSpSMAlg_t __pyx_v_alg;
  size_t __pyx_v_spsmDescr;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("spSM_bufferSize (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_opA,&__pyx_mstate_global->__pyx_n_u_opB,&__pyx_mstate_global->__pyx_n_u_alpha,&__pyx_mstate_global->__pyx_n_u_matA,&__pyx_mstate_global->__pyx_n_u_matB,&__pyx_mstate_global->__pyx_n_u_matC,&__pyx_mstate_global->__pyx_n_u_computeType,&__pyx_mstate_global->__pyx_n_u_alg,&__pyx_mstate_global->__pyx_n_u_spsmDescr,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 4967, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 4967, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 4967, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 4967, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 4967, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 4967, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4967, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4967, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4967, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4967, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4967, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "spSM_bufferSize", 0) < (0)) __PYX_ERR(0, 4967, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 10; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("spSM_bufferSize", 1, 10, 10, i); __PYX_ERR(0, 4967, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 10)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4967, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4967, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4967, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4967, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4967, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 4967, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 4967, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 4967, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 4967, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 4967, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4967, __pyx_L3_error)
    __pyx_v_opA = __Pyx_PyLong_As_cusparseOperation_t(values[1]); if (unlikely((__pyx_v_opA == ((cusparseOperation_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4967, __pyx_L3_error)
    __pyx_v_opB = __Pyx_PyLong_As_cusparseOperation_t(values[2]); if (unlikely((__pyx_v_opB == ((cusparseOperation_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4967, __pyx_L3_error)
    __pyx_v_alpha = PyLong_AsSsize_t(values[3]); if (unlikely((__pyx_v_alpha == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4968, __pyx_L3_error)
    __pyx_v_matA = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_matA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4968, __pyx_L3_error)
    __pyx_v_matB = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_matB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4968, __pyx_L3_error)
    __pyx_v_matC = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_matC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4969, __pyx_L3_error)
    __pyx_v_computeType = __Pyx_PyLong_As_cudaDataType(values[7]); if (unlikely((__pyx_v_computeType == ((cudaDataType)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4969, __pyx_L3_error)
    __pyx_v_alg = __Pyx_PyLong_As_cusparseSpSMAlg_t(values[8]); if (unlikely((__pyx_v_alg == ((cusparseSpSMAlg_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4969, __pyx_L3_error)
    __pyx_v_spsmDescr = __Pyx_PyLong_As_size_t(values[9]); if (unlikely((__pyx_v_spsmDescr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4970, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("spSM_bufferSize", 1, 10, 10, __pyx_nargs); __PYX_ERR(0, 4967, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.spSM_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_566spSM_bufferSize(__pyx_self, __pyx_v_handle, __pyx_v_opA, __pyx_v_opB, __pyx_v_alpha, __pyx_v_matA, __pyx_v_matB, __pyx_v_matC, __pyx_v_computeType, __pyx_v_alg, __pyx_v_spsmDescr);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_566spSM_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, size_t __pyx_v_matC, cudaDataType __pyx_v_computeType, cusparseSpSMAlg_t __pyx_v_alg, size_t __pyx_v_spsmDescr) {
  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("spSM_bufferSize", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_spSM_bufferSize(__pyx_v_handle, __pyx_v_opA, __pyx_v_opB, __pyx_v_alpha, __pyx_v_matA, __pyx_v_matB, __pyx_v_matC, __pyx_v_computeType, __pyx_v_alg, __pyx_v_spsmDescr, 1); if (unlikely(__pyx_t_1 == ((size_t)-1L) && PyErr_Occurred())) __PYX_ERR(0, 4967, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyLong_FromSize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4967, __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_backends.cuda.libs.cusparse.spSM_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy_backends/cuda/libs/cusparse.pyx":4979
 *     return bufferSize
 * 
 * cpdef void spSM_analysis(             # <<<<<<<<<<<<<<
 *         intptr_t handle, Operation opA, Operation opB,
 *         intptr_t alpha, size_t matA, size_t matB, size_t matC,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_569spSM_analysis(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_spSM_analysis(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, size_t __pyx_v_matC, cudaDataType __pyx_v_computeType, cusparseSpSMAlg_t __pyx_v_alg, size_t __pyx_v_spsmDescr, intptr_t __pyx_v_externalBuffer, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("spSM_analysis", 0);

  /* "cupy_backends/cuda/libs/cusparse.pyx":4984
 *         DataType computeType, SpSMAlg alg, size_t spsmDescr,
 *         intptr_t externalBuffer) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     status = cusparseSpSM_analysis(<Handle> handle, opA, opB, <void*>alpha,
 *                                    <SpMatDescr>matA, <DnMatDescr>matB,
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4984, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":4985
 *         intptr_t externalBuffer) except *:
 *     _setStream(handle)
 *     status = cusparseSpSM_analysis(<Handle> handle, opA, opB, <void*>alpha,             # <<<<<<<<<<<<<<
 *                                    <SpMatDescr>matA, <DnMatDescr>matB,
 *                                    <DnMatDescr>matC, computeType, alg,
*/
  __pyx_v_status = __pyx_v_13cupy_backends_4cuda_4libs_8cusparse_cusparseSpSM_analysis(((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), ((cusparseDnMatDescr_t)__pyx_v_matC), __pyx_v_computeType, __pyx_v_alg, ((cusparseSpSMDescr_t)__pyx_v_spsmDescr), ((void *)__pyx_v_externalBuffer));

  /* "cupy_backends/cuda/libs/cusparse.pyx":4989
 *                                    <DnMatDescr>matC, computeType, alg,
 *                                    <SpSMDescr>spsmDescr, <void*>externalBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef void spSM_solve(
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4989, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":4979
 *     return bufferSize
 * 
 * cpdef void spSM_analysis(             # <<<<<<<<<<<<<<
 *         intptr_t handle, Operation opA, Operation opB,
 *         intptr_t alpha, size_t matA, size_t matB, size_t matC,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.spSM_analysis", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_569spSM_analysis(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_568spSM_analysis, "spSM_analysis(intptr_t handle, Operation opA, Operation opB, intptr_t alpha, size_t matA, size_t matB, size_t matC, DataType computeType, SpSMAlg alg, size_t spsmDescr, intptr_t externalBuffer) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_569spSM_analysis(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  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;
  size_t __pyx_v_matC;
  cudaDataType __pyx_v_computeType;
  cusparseSpSMAlg_t __pyx_v_alg;
  size_t __pyx_v_spsmDescr;
  intptr_t __pyx_v_externalBuffer;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[11] = {0,0,0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("spSM_analysis (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_opA,&__pyx_mstate_global->__pyx_n_u_opB,&__pyx_mstate_global->__pyx_n_u_alpha,&__pyx_mstate_global->__pyx_n_u_matA,&__pyx_mstate_global->__pyx_n_u_matB,&__pyx_mstate_global->__pyx_n_u_matC,&__pyx_mstate_global->__pyx_n_u_computeType,&__pyx_mstate_global->__pyx_n_u_alg,&__pyx_mstate_global->__pyx_n_u_spsmDescr,&__pyx_mstate_global->__pyx_n_u_externalBuffer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 4979, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 11:
        values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 4979, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 4979, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 4979, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 4979, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 4979, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 4979, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4979, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4979, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4979, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4979, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4979, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "spSM_analysis", 0) < (0)) __PYX_ERR(0, 4979, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 11; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("spSM_analysis", 1, 11, 11, i); __PYX_ERR(0, 4979, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 11)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4979, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4979, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4979, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4979, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4979, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 4979, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 4979, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 4979, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 4979, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 4979, __pyx_L3_error)
      values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 4979, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4980, __pyx_L3_error)
    __pyx_v_opA = __Pyx_PyLong_As_cusparseOperation_t(values[1]); if (unlikely((__pyx_v_opA == ((cusparseOperation_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4980, __pyx_L3_error)
    __pyx_v_opB = __Pyx_PyLong_As_cusparseOperation_t(values[2]); if (unlikely((__pyx_v_opB == ((cusparseOperation_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4980, __pyx_L3_error)
    __pyx_v_alpha = PyLong_AsSsize_t(values[3]); if (unlikely((__pyx_v_alpha == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4981, __pyx_L3_error)
    __pyx_v_matA = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_matA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4981, __pyx_L3_error)
    __pyx_v_matB = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_matB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4981, __pyx_L3_error)
    __pyx_v_matC = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_matC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4981, __pyx_L3_error)
    __pyx_v_computeType = __Pyx_PyLong_As_cudaDataType(values[7]); if (unlikely((__pyx_v_computeType == ((cudaDataType)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4982, __pyx_L3_error)
    __pyx_v_alg = __Pyx_PyLong_As_cusparseSpSMAlg_t(values[8]); if (unlikely((__pyx_v_alg == ((cusparseSpSMAlg_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4982, __pyx_L3_error)
    __pyx_v_spsmDescr = __Pyx_PyLong_As_size_t(values[9]); if (unlikely((__pyx_v_spsmDescr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4982, __pyx_L3_error)
    __pyx_v_externalBuffer = PyLong_AsSsize_t(values[10]); if (unlikely((__pyx_v_externalBuffer == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4983, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("spSM_analysis", 1, 11, 11, __pyx_nargs); __PYX_ERR(0, 4979, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.spSM_analysis", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_568spSM_analysis(__pyx_self, __pyx_v_handle, __pyx_v_opA, __pyx_v_opB, __pyx_v_alpha, __pyx_v_matA, __pyx_v_matB, __pyx_v_matC, __pyx_v_computeType, __pyx_v_alg, __pyx_v_spsmDescr, __pyx_v_externalBuffer);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_568spSM_analysis(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, size_t __pyx_v_matC, cudaDataType __pyx_v_computeType, cusparseSpSMAlg_t __pyx_v_alg, size_t __pyx_v_spsmDescr, 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("spSM_analysis", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_spSM_analysis(__pyx_v_handle, __pyx_v_opA, __pyx_v_opB, __pyx_v_alpha, __pyx_v_matA, __pyx_v_matB, __pyx_v_matC, __pyx_v_computeType, __pyx_v_alg, __pyx_v_spsmDescr, __pyx_v_externalBuffer, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4979, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4979, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":4991
 *     check_status(status)
 * 
 * cpdef void spSM_solve(             # <<<<<<<<<<<<<<
 *         intptr_t handle, Operation opA, Operation opB, intptr_t alpha,
 *         size_t matA, size_t matB, size_t matC, DataType computeType,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_571spSM_solve(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_spSM_solve(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, size_t __pyx_v_matC, cudaDataType __pyx_v_computeType, cusparseSpSMAlg_t __pyx_v_alg, size_t __pyx_v_spsmDescr, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_13cupy_backends_4cuda_4libs_8cusparse_spSM_solve *__pyx_optional_args) {
  cusparseStatus_t __pyx_v_status;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("spSM_solve", 0);
  if (__pyx_optional_args) {
  }

  /* "cupy_backends/cuda/libs/cusparse.pyx":4995
 *         size_t matA, size_t matB, size_t matC, DataType computeType,
 *         SpSMAlg alg, size_t spsmDescr, intptr_t externalBuffer=0) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     IF CUPY_HIP_VERSION > 0:
 *         # hipsparseSpSM_solve has the extra `externalBuffer` parameter that
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4995, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":5005
 *                                     <void*>externalBuffer)
 *     ELSE:
 *         status = cusparseSpSM_solve(<Handle> handle, opA, opB, <void*>alpha,             # <<<<<<<<<<<<<<
 *                                     <SpMatDescr>matA, <DnMatDescr>matB,
 *                                     <DnMatDescr>matC, computeType, alg,
*/
  __pyx_v_status = __pyx_v_13cupy_backends_4cuda_4libs_8cusparse_cusparseSpSM_solve(((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), ((cusparseDnMatDescr_t)__pyx_v_matC), __pyx_v_computeType, __pyx_v_alg, ((cusparseSpSMDescr_t)__pyx_v_spsmDescr));

  /* "cupy_backends/cuda/libs/cusparse.pyx":5009
 *                                     <DnMatDescr>matC, computeType, alg,
 *                                     <SpSMDescr>spsmDescr)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef size_t spMM_bufferSize(intptr_t handle, Operation opA, Operation opB,
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5009, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":4991
 *     check_status(status)
 * 
 * cpdef void spSM_solve(             # <<<<<<<<<<<<<<
 *         intptr_t handle, Operation opA, Operation opB, intptr_t alpha,
 *         size_t matA, size_t matB, size_t matC, DataType computeType,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.spSM_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_571spSM_solve(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_570spSM_solve, "spSM_solve(intptr_t handle, Operation opA, Operation opB, intptr_t alpha, size_t matA, size_t matB, size_t matC, DataType computeType, SpSMAlg alg, size_t spsmDescr, intptr_t externalBuffer=0) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_571spSM_solve(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  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;
  size_t __pyx_v_matC;
  cudaDataType __pyx_v_computeType;
  cusparseSpSMAlg_t __pyx_v_alg;
  size_t __pyx_v_spsmDescr;
  intptr_t __pyx_v_externalBuffer;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[11] = {0,0,0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("spSM_solve (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_opA,&__pyx_mstate_global->__pyx_n_u_opB,&__pyx_mstate_global->__pyx_n_u_alpha,&__pyx_mstate_global->__pyx_n_u_matA,&__pyx_mstate_global->__pyx_n_u_matB,&__pyx_mstate_global->__pyx_n_u_matC,&__pyx_mstate_global->__pyx_n_u_computeType,&__pyx_mstate_global->__pyx_n_u_alg,&__pyx_mstate_global->__pyx_n_u_spsmDescr,&__pyx_mstate_global->__pyx_n_u_externalBuffer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 4991, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 11:
        values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 4991, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 4991, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 4991, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 4991, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 4991, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 4991, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4991, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4991, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4991, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4991, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4991, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "spSM_solve", 0) < (0)) __PYX_ERR(0, 4991, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 10; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("spSM_solve", 0, 10, 11, i); __PYX_ERR(0, 4991, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case 11:
        values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 4991, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 4991, __pyx_L3_error)
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 4991, __pyx_L3_error)
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 4991, __pyx_L3_error)
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 4991, __pyx_L3_error)
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 4991, __pyx_L3_error)
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4991, __pyx_L3_error)
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4991, __pyx_L3_error)
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4991, __pyx_L3_error)
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4991, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4991, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4992, __pyx_L3_error)
    __pyx_v_opA = __Pyx_PyLong_As_cusparseOperation_t(values[1]); if (unlikely((__pyx_v_opA == ((cusparseOperation_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4992, __pyx_L3_error)
    __pyx_v_opB = __Pyx_PyLong_As_cusparseOperation_t(values[2]); if (unlikely((__pyx_v_opB == ((cusparseOperation_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4992, __pyx_L3_error)
    __pyx_v_alpha = PyLong_AsSsize_t(values[3]); if (unlikely((__pyx_v_alpha == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4992, __pyx_L3_error)
    __pyx_v_matA = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_matA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4993, __pyx_L3_error)
    __pyx_v_matB = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_matB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4993, __pyx_L3_error)
    __pyx_v_matC = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_matC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4993, __pyx_L3_error)
    __pyx_v_computeType = __Pyx_PyLong_As_cudaDataType(values[7]); if (unlikely((__pyx_v_computeType == ((cudaDataType)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4993, __pyx_L3_error)
    __pyx_v_alg = __Pyx_PyLong_As_cusparseSpSMAlg_t(values[8]); if (unlikely((__pyx_v_alg == ((cusparseSpSMAlg_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4994, __pyx_L3_error)
    __pyx_v_spsmDescr = __Pyx_PyLong_As_size_t(values[9]); if (unlikely((__pyx_v_spsmDescr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4994, __pyx_L3_error)
    if (values[10]) {
      __pyx_v_externalBuffer = PyLong_AsSsize_t(values[10]); if (unlikely((__pyx_v_externalBuffer == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4994, __pyx_L3_error)
    } else {
      __pyx_v_externalBuffer = ((intptr_t)0);
    }
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("spSM_solve", 0, 10, 11, __pyx_nargs); __PYX_ERR(0, 4991, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.spSM_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_570spSM_solve(__pyx_self, __pyx_v_handle, __pyx_v_opA, __pyx_v_opB, __pyx_v_alpha, __pyx_v_matA, __pyx_v_matB, __pyx_v_matC, __pyx_v_computeType, __pyx_v_alg, __pyx_v_spsmDescr, __pyx_v_externalBuffer);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_570spSM_solve(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, size_t __pyx_v_matC, cudaDataType __pyx_v_computeType, cusparseSpSMAlg_t __pyx_v_alg, size_t __pyx_v_spsmDescr, intptr_t __pyx_v_externalBuffer) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  struct __pyx_opt_args_13cupy_backends_4cuda_4libs_8cusparse_spSM_solve __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("spSM_solve", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1.__pyx_n = 1;
  __pyx_t_1.externalBuffer = __pyx_v_externalBuffer;
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_spSM_solve(__pyx_v_handle, __pyx_v_opA, __pyx_v_opB, __pyx_v_alpha, __pyx_v_matA, __pyx_v_matB, __pyx_v_matC, __pyx_v_computeType, __pyx_v_alg, __pyx_v_spsmDescr, 1, &__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4991, __pyx_L1_error)
  __pyx_t_2 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4991, __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_backends.cuda.libs.cusparse.spSM_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy_backends/cuda/libs/cusparse.pyx":5011
 *     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_13cupy_backends_4cuda_4libs_8cusparse_573spMM_bufferSize(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static size_t __pyx_f_13cupy_backends_4cuda_4libs_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_backends/cuda/libs/cusparse.pyx":5016
 *                              SpMMAlg alg) except? -1:
 *     cdef 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_backends/cuda/libs/cusparse.pyx":5020
 *                                      <void*>beta, <DnMatDescr>matC,
 *                                      computeType, alg, &bufferSize)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return bufferSize
 * 
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5020, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":5021
 *                                      computeType, alg, &bufferSize)
 *     check_status(status)
 *     return bufferSize             # <<<<<<<<<<<<<<
 * 
 * cpdef void spMM(
*/
  __pyx_r = __pyx_v_bufferSize;
  goto __pyx_L0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":5011
 *     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_AddTraceback("cupy_backends.cuda.libs.cusparse.spMM_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1L;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_573spMM_bufferSize(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_572spMM_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_13cupy_backends_4cuda_4libs_8cusparse_573spMM_bufferSize(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0};
  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);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_opA,&__pyx_mstate_global->__pyx_n_u_opB,&__pyx_mstate_global->__pyx_n_u_alpha,&__pyx_mstate_global->__pyx_n_u_matA,&__pyx_mstate_global->__pyx_n_u_matB,&__pyx_mstate_global->__pyx_n_u_beta,&__pyx_mstate_global->__pyx_n_u_matC,&__pyx_mstate_global->__pyx_n_u_computeType,&__pyx_mstate_global->__pyx_n_u_alg,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 5011, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 5011, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 5011, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 5011, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 5011, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 5011, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 5011, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 5011, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 5011, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 5011, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 5011, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "spMM_bufferSize", 0) < (0)) __PYX_ERR(0, 5011, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 10; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("spMM_bufferSize", 1, 10, 10, i); __PYX_ERR(0, 5011, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 10)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 5011, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 5011, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 5011, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 5011, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 5011, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 5011, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 5011, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 5011, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 5011, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 5011, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 5011, __pyx_L3_error)
    __pyx_v_opA = __Pyx_PyLong_As_cusparseOperation_t(values[1]); if (unlikely((__pyx_v_opA == ((cusparseOperation_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 5011, __pyx_L3_error)
    __pyx_v_opB = __Pyx_PyLong_As_cusparseOperation_t(values[2]); if (unlikely((__pyx_v_opB == ((cusparseOperation_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 5011, __pyx_L3_error)
    __pyx_v_alpha = PyLong_AsSsize_t(values[3]); if (unlikely((__pyx_v_alpha == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 5012, __pyx_L3_error)
    __pyx_v_matA = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_matA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 5012, __pyx_L3_error)
    __pyx_v_matB = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_matB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 5012, __pyx_L3_error)
    __pyx_v_beta = PyLong_AsSsize_t(values[6]); if (unlikely((__pyx_v_beta == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 5013, __pyx_L3_error)
    __pyx_v_matC = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_matC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 5013, __pyx_L3_error)
    __pyx_v_computeType = __Pyx_PyLong_As_cudaDataType(values[8]); if (unlikely((__pyx_v_computeType == ((cudaDataType)-1)) && PyErr_Occurred())) __PYX_ERR(0, 5013, __pyx_L3_error)
    __pyx_v_alg = __Pyx_PyLong_As_cusparseSpMMAlg_t(values[9]); if (unlikely((__pyx_v_alg == ((cusparseSpMMAlg_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 5014, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("spMM_bufferSize", 1, 10, 10, __pyx_nargs); __PYX_ERR(0, 5011, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.spMM_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_572spMM_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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_572spMM_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
  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("spMM_bufferSize", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(__pyx_t_1 == ((size_t)-1L) && PyErr_Occurred())) __PYX_ERR(0, 5011, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyLong_FromSize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5011, __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_backends.cuda.libs.cusparse.spMM_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy_backends/cuda/libs/cusparse.pyx":5023
 *     return bufferSize
 * 
 * cpdef void spMM(             # <<<<<<<<<<<<<<
 *         intptr_t handle, Operation opA, Operation opB, intptr_t alpha,
 *         size_t matA, size_t matB, intptr_t beta, size_t matC,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_575spMM(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_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;
  __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_backends/cuda/libs/cusparse.pyx":5027
 *         size_t matA, size_t matB, intptr_t beta, size_t matC,
 *         DataType computeType, SpMMAlg alg, intptr_t externalBuffer) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     status = cusparseSpMM(<Handle>handle, opA, opB, <void*>alpha,
 *                           <SpMatDescr>matA, <DnMatDescr>matB, <void*>beta,
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 5027, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":5028
 *         DataType computeType, SpMMAlg alg, intptr_t externalBuffer) except *:
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":5032
 *                           <DnMatDescr>matC, computeType, alg,
 *                           <void*>externalBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef size_t constrainedGeMM_bufferSize(intptr_t handle, Operation opA,
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5032, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":5023
 *     return bufferSize
 * 
 * cpdef void spMM(             # <<<<<<<<<<<<<<
 *         intptr_t handle, Operation opA, Operation opB, intptr_t alpha,
 *         size_t matA, size_t matB, intptr_t beta, size_t matC,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.spMM", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_575spMM(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_574spMM, "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) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_575spMM(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[11] = {0,0,0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("spMM (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_opA,&__pyx_mstate_global->__pyx_n_u_opB,&__pyx_mstate_global->__pyx_n_u_alpha,&__pyx_mstate_global->__pyx_n_u_matA,&__pyx_mstate_global->__pyx_n_u_matB,&__pyx_mstate_global->__pyx_n_u_beta,&__pyx_mstate_global->__pyx_n_u_matC,&__pyx_mstate_global->__pyx_n_u_computeType,&__pyx_mstate_global->__pyx_n_u_alg,&__pyx_mstate_global->__pyx_n_u_externalBuffer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 5023, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 11:
        values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 5023, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 5023, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 5023, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 5023, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 5023, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 5023, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 5023, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 5023, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 5023, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 5023, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 5023, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "spMM", 0) < (0)) __PYX_ERR(0, 5023, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 11; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("spMM", 1, 11, 11, i); __PYX_ERR(0, 5023, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 11)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 5023, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 5023, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 5023, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 5023, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 5023, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 5023, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 5023, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 5023, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 5023, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 5023, __pyx_L3_error)
      values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 5023, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 5024, __pyx_L3_error)
    __pyx_v_opA = __Pyx_PyLong_As_cusparseOperation_t(values[1]); if (unlikely((__pyx_v_opA == ((cusparseOperation_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 5024, __pyx_L3_error)
    __pyx_v_opB = __Pyx_PyLong_As_cusparseOperation_t(values[2]); if (unlikely((__pyx_v_opB == ((cusparseOperation_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 5024, __pyx_L3_error)
    __pyx_v_alpha = PyLong_AsSsize_t(values[3]); if (unlikely((__pyx_v_alpha == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 5024, __pyx_L3_error)
    __pyx_v_matA = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_matA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 5025, __pyx_L3_error)
    __pyx_v_matB = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_matB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 5025, __pyx_L3_error)
    __pyx_v_beta = PyLong_AsSsize_t(values[6]); if (unlikely((__pyx_v_beta == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 5025, __pyx_L3_error)
    __pyx_v_matC = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_matC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 5025, __pyx_L3_error)
    __pyx_v_computeType = __Pyx_PyLong_As_cudaDataType(values[8]); if (unlikely((__pyx_v_computeType == ((cudaDataType)-1)) && PyErr_Occurred())) __PYX_ERR(0, 5026, __pyx_L3_error)
    __pyx_v_alg = __Pyx_PyLong_As_cusparseSpMMAlg_t(values[9]); if (unlikely((__pyx_v_alg == ((cusparseSpMMAlg_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 5026, __pyx_L3_error)
    __pyx_v_externalBuffer = PyLong_AsSsize_t(values[10]); if (unlikely((__pyx_v_externalBuffer == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 5026, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("spMM", 1, 11, 11, __pyx_nargs); __PYX_ERR(0, 5023, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.spMM", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_574spMM(__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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_574spMM(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_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 5023, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5023, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":5034
 *     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_13cupy_backends_4cuda_4libs_8cusparse_577constrainedGeMM_bufferSize(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static size_t __pyx_f_13cupy_backends_4cuda_4libs_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_backends/cuda/libs/cusparse.pyx":5040
 *                                         DataType computeType) except? -1:
 *     cdef 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_backends/cuda/libs/cusparse.pyx":5044
 *         <DnMatDescr>matB, <void*>beta, <SpMatDescr>matC, computeType,
 *         &bufferSize)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return bufferSize
 * 
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5044, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":5045
 *         &bufferSize)
 *     check_status(status)
 *     return bufferSize             # <<<<<<<<<<<<<<
 * 
 * cpdef void constrainedGeMM(
*/
  __pyx_r = __pyx_v_bufferSize;
  goto __pyx_L0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":5034
 *     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_AddTraceback("cupy_backends.cuda.libs.cusparse.constrainedGeMM_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1L;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_577constrainedGeMM_bufferSize(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_576constrainedGeMM_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_13cupy_backends_4cuda_4libs_8cusparse_577constrainedGeMM_bufferSize(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
  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);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_opA,&__pyx_mstate_global->__pyx_n_u_opB,&__pyx_mstate_global->__pyx_n_u_alpha,&__pyx_mstate_global->__pyx_n_u_matA,&__pyx_mstate_global->__pyx_n_u_matB,&__pyx_mstate_global->__pyx_n_u_beta,&__pyx_mstate_global->__pyx_n_u_matC,&__pyx_mstate_global->__pyx_n_u_computeType,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 5034, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 5034, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 5034, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 5034, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 5034, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 5034, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 5034, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 5034, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 5034, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 5034, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "constrainedGeMM_bufferSize", 0) < (0)) __PYX_ERR(0, 5034, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 9; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("constrainedGeMM_bufferSize", 1, 9, 9, i); __PYX_ERR(0, 5034, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 9)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 5034, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 5034, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 5034, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 5034, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 5034, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 5034, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 5034, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 5034, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 5034, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 5034, __pyx_L3_error)
    __pyx_v_opA = __Pyx_PyLong_As_cusparseOperation_t(values[1]); if (unlikely((__pyx_v_opA == ((cusparseOperation_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 5034, __pyx_L3_error)
    __pyx_v_opB = __Pyx_PyLong_As_cusparseOperation_t(values[2]); if (unlikely((__pyx_v_opB == ((cusparseOperation_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 5035, __pyx_L3_error)
    __pyx_v_alpha = PyLong_AsSsize_t(values[3]); if (unlikely((__pyx_v_alpha == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 5035, __pyx_L3_error)
    __pyx_v_matA = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_matA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 5036, __pyx_L3_error)
    __pyx_v_matB = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_matB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 5036, __pyx_L3_error)
    __pyx_v_beta = PyLong_AsSsize_t(values[6]); if (unlikely((__pyx_v_beta == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 5037, __pyx_L3_error)
    __pyx_v_matC = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_matC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 5037, __pyx_L3_error)
    __pyx_v_computeType = __Pyx_PyLong_As_cudaDataType(values[8]); if (unlikely((__pyx_v_computeType == ((cudaDataType)-1)) && PyErr_Occurred())) __PYX_ERR(0, 5038, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("constrainedGeMM_bufferSize", 1, 9, 9, __pyx_nargs); __PYX_ERR(0, 5034, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.constrainedGeMM_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_576constrainedGeMM_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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_576constrainedGeMM_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
  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("constrainedGeMM_bufferSize", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(__pyx_t_1 == ((size_t)-1L) && PyErr_Occurred())) __PYX_ERR(0, 5034, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyLong_FromSize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5034, __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_backends.cuda.libs.cusparse.constrainedGeMM_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy_backends/cuda/libs/cusparse.pyx":5047
 *     return bufferSize
 * 
 * cpdef void constrainedGeMM(             # <<<<<<<<<<<<<<
 *         intptr_t handle, Operation opA, Operation opB,
 *         intptr_t alpha, size_t matA, size_t matB, intptr_t beta,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_579constrainedGeMM(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_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;
  __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_backends/cuda/libs/cusparse.pyx":5052
 *         size_t matC, DataType computeType,
 *         intptr_t externalBuffer) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     status = cusparseConstrainedGeMM(
 *         <Handle>handle, opA, opB, <void*>alpha, <DnMatDescr>matA,
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 5052, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":5053
 *         intptr_t externalBuffer) except *:
 *     _setStream(handle)
 *     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_backends/cuda/libs/cusparse.pyx":5057
 *         <DnMatDescr>matB, <void*>beta, <SpMatDescr>matC, computeType,
 *         <void*>externalBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef size_t spGEMM_createDescr() except? -1:
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5057, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":5047
 *     return bufferSize
 * 
 * cpdef void constrainedGeMM(             # <<<<<<<<<<<<<<
 *         intptr_t handle, Operation opA, Operation opB,
 *         intptr_t alpha, size_t matA, size_t matB, intptr_t beta,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.constrainedGeMM", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_579constrainedGeMM(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_578constrainedGeMM, "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) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_579constrainedGeMM(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("constrainedGeMM (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_opA,&__pyx_mstate_global->__pyx_n_u_opB,&__pyx_mstate_global->__pyx_n_u_alpha,&__pyx_mstate_global->__pyx_n_u_matA,&__pyx_mstate_global->__pyx_n_u_matB,&__pyx_mstate_global->__pyx_n_u_beta,&__pyx_mstate_global->__pyx_n_u_matC,&__pyx_mstate_global->__pyx_n_u_computeType,&__pyx_mstate_global->__pyx_n_u_externalBuffer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 5047, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 5047, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 5047, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 5047, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 5047, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 5047, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 5047, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 5047, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 5047, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 5047, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 5047, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "constrainedGeMM", 0) < (0)) __PYX_ERR(0, 5047, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 10; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("constrainedGeMM", 1, 10, 10, i); __PYX_ERR(0, 5047, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 10)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 5047, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 5047, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 5047, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 5047, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 5047, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 5047, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 5047, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 5047, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 5047, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 5047, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 5048, __pyx_L3_error)
    __pyx_v_opA = __Pyx_PyLong_As_cusparseOperation_t(values[1]); if (unlikely((__pyx_v_opA == ((cusparseOperation_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 5048, __pyx_L3_error)
    __pyx_v_opB = __Pyx_PyLong_As_cusparseOperation_t(values[2]); if (unlikely((__pyx_v_opB == ((cusparseOperation_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 5048, __pyx_L3_error)
    __pyx_v_alpha = PyLong_AsSsize_t(values[3]); if (unlikely((__pyx_v_alpha == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 5049, __pyx_L3_error)
    __pyx_v_matA = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_matA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 5049, __pyx_L3_error)
    __pyx_v_matB = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_matB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 5049, __pyx_L3_error)
    __pyx_v_beta = PyLong_AsSsize_t(values[6]); if (unlikely((__pyx_v_beta == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 5049, __pyx_L3_error)
    __pyx_v_matC = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_matC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 5050, __pyx_L3_error)
    __pyx_v_computeType = __Pyx_PyLong_As_cudaDataType(values[8]); if (unlikely((__pyx_v_computeType == ((cudaDataType)-1)) && PyErr_Occurred())) __PYX_ERR(0, 5050, __pyx_L3_error)
    __pyx_v_externalBuffer = PyLong_AsSsize_t(values[9]); if (unlikely((__pyx_v_externalBuffer == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 5051, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("constrainedGeMM", 1, 10, 10, __pyx_nargs); __PYX_ERR(0, 5047, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.constrainedGeMM", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_578constrainedGeMM(__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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_578constrainedGeMM(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_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 5047, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5047, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":5059
 *     check_status(status)
 * 
 * cpdef size_t spGEMM_createDescr() except? -1:             # <<<<<<<<<<<<<<
 *     cdef SpGEMMDescr descr
 *     status = cusparseSpGEMM_createDescr(&descr)
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_581spGEMM_createDescr(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static size_t __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_spGEMM_createDescr(CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseSpGEMMDescr_t __pyx_v_descr;
  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("spGEMM_createDescr", 0);

  /* "cupy_backends/cuda/libs/cusparse.pyx":5061
 * cpdef size_t spGEMM_createDescr() except? -1:
 *     cdef SpGEMMDescr descr
 *     status = cusparseSpGEMM_createDescr(&descr)             # <<<<<<<<<<<<<<
 *     check_status(status)
 *     return <size_t>descr
*/
  __pyx_v_status = cusparseSpGEMM_createDescr((&__pyx_v_descr));

  /* "cupy_backends/cuda/libs/cusparse.pyx":5062
 *     cdef SpGEMMDescr descr
 *     status = cusparseSpGEMM_createDescr(&descr)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return <size_t>descr
 * 
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5062, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":5063
 *     status = cusparseSpGEMM_createDescr(&descr)
 *     check_status(status)
 *     return <size_t>descr             # <<<<<<<<<<<<<<
 * 
 * cpdef void spGEMM_destroyDescr(size_t descr) except *:
*/
  __pyx_r = ((size_t)__pyx_v_descr);
  goto __pyx_L0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":5059
 *     check_status(status)
 * 
 * cpdef size_t spGEMM_createDescr() except? -1:             # <<<<<<<<<<<<<<
 *     cdef SpGEMMDescr descr
 *     status = cusparseSpGEMM_createDescr(&descr)
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.spGEMM_createDescr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1L;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_581spGEMM_createDescr(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_580spGEMM_createDescr, "spGEMM_createDescr() -> size_t");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_581spGEMM_createDescr(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("spGEMM_createDescr (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_580spGEMM_createDescr(__pyx_self);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_580spGEMM_createDescr(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("spGEMM_createDescr", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_spGEMM_createDescr(1); if (unlikely(__pyx_t_1 == ((size_t)-1L) && PyErr_Occurred())) __PYX_ERR(0, 5059, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyLong_FromSize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5059, __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_backends.cuda.libs.cusparse.spGEMM_createDescr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy_backends/cuda/libs/cusparse.pyx":5065
 *     return <size_t>descr
 * 
 * cpdef void spGEMM_destroyDescr(size_t descr) except *:             # <<<<<<<<<<<<<<
 *     status = cusparseSpGEMM_destroyDescr(<SpGEMMDescr>descr)
 *     check_status(status)
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_583spGEMM_destroyDescr(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_spGEMM_destroyDescr(size_t __pyx_v_descr, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("spGEMM_destroyDescr", 0);

  /* "cupy_backends/cuda/libs/cusparse.pyx":5066
 * 
 * cpdef void spGEMM_destroyDescr(size_t descr) except *:
 *     status = cusparseSpGEMM_destroyDescr(<SpGEMMDescr>descr)             # <<<<<<<<<<<<<<
 *     check_status(status)
 * 
*/
  __pyx_v_status = cusparseSpGEMM_destroyDescr(((cusparseSpGEMMDescr_t)__pyx_v_descr));

  /* "cupy_backends/cuda/libs/cusparse.pyx":5067
 * cpdef void spGEMM_destroyDescr(size_t descr) except *:
 *     status = cusparseSpGEMM_destroyDescr(<SpGEMMDescr>descr)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef size_t spGEMM_workEstimation(
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5067, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":5065
 *     return <size_t>descr
 * 
 * cpdef void spGEMM_destroyDescr(size_t descr) except *:             # <<<<<<<<<<<<<<
 *     status = cusparseSpGEMM_destroyDescr(<SpGEMMDescr>descr)
 *     check_status(status)
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.spGEMM_destroyDescr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_583spGEMM_destroyDescr(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_582spGEMM_destroyDescr, "spGEMM_destroyDescr(size_t descr) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_583spGEMM_destroyDescr(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  size_t __pyx_v_descr;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("spGEMM_destroyDescr (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_descr,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 5065, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 5065, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "spGEMM_destroyDescr", 0) < (0)) __PYX_ERR(0, 5065, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("spGEMM_destroyDescr", 1, 1, 1, i); __PYX_ERR(0, 5065, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 5065, __pyx_L3_error)
    }
    __pyx_v_descr = __Pyx_PyLong_As_size_t(values[0]); if (unlikely((__pyx_v_descr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 5065, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("spGEMM_destroyDescr", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 5065, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.spGEMM_destroyDescr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_582spGEMM_destroyDescr(__pyx_self, __pyx_v_descr);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_582spGEMM_destroyDescr(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("spGEMM_destroyDescr", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_spGEMM_destroyDescr(__pyx_v_descr, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 5065, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5065, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":5069
 *     check_status(status)
 * 
 * cpdef size_t spGEMM_workEstimation(             # <<<<<<<<<<<<<<
 *         intptr_t handle, Operation opA, Operation opB, intptr_t alpha,
 *         size_t matA, size_t matB, intptr_t beta, size_t matC,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_585spGEMM_workEstimation(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static size_t __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_spGEMM_workEstimation(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_v_alg, size_t __pyx_v_spgemmDescr, size_t __pyx_v_bufferSize, intptr_t __pyx_v_externalBuffer1, CYTHON_UNUSED int __pyx_skip_dispatch) {
  size_t __pyx_v_bufferSize1;
  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("spGEMM_workEstimation", 0);

  /* "cupy_backends/cuda/libs/cusparse.pyx":5074
 *         DataType computeType, int alg, size_t spgemmDescr,
 *         size_t bufferSize, intptr_t externalBuffer1) except? -1:
 *     cdef size_t bufferSize1 = bufferSize             # <<<<<<<<<<<<<<
 *     status = cusparseSpGEMM_workEstimation(
 *         <Handle>handle, opA, opB, <const void*>alpha, <SpMatDescr>matA,
*/
  __pyx_v_bufferSize1 = __pyx_v_bufferSize;

  /* "cupy_backends/cuda/libs/cusparse.pyx":5075
 *         size_t bufferSize, intptr_t externalBuffer1) except? -1:
 *     cdef size_t bufferSize1 = bufferSize
 *     status = cusparseSpGEMM_workEstimation(             # <<<<<<<<<<<<<<
 *         <Handle>handle, opA, opB, <const void*>alpha, <SpMatDescr>matA,
 *         <SpMatDescr>matB, <const void*>beta, <SpMatDescr>matC, computeType,
*/
  __pyx_v_status = cusparseSpGEMM_workEstimation(((cusparseHandle_t)__pyx_v_handle), __pyx_v_opA, __pyx_v_opB, ((void const *)__pyx_v_alpha), ((cusparseSpMatDescr_t)__pyx_v_matA), ((cusparseSpMatDescr_t)__pyx_v_matB), ((void const *)__pyx_v_beta), ((cusparseSpMatDescr_t)__pyx_v_matC), __pyx_v_computeType, ((cusparseSpGEMMAlg_t)__pyx_v_alg), ((cusparseSpGEMMDescr_t)__pyx_v_spgemmDescr), (&__pyx_v_bufferSize1), ((void *)__pyx_v_externalBuffer1));

  /* "cupy_backends/cuda/libs/cusparse.pyx":5080
 *         <SpGEMMAlg>alg, <SpGEMMDescr>spgemmDescr, &bufferSize1,
 *         <void*>externalBuffer1)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return bufferSize1
 * 
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5080, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":5081
 *         <void*>externalBuffer1)
 *     check_status(status)
 *     return bufferSize1             # <<<<<<<<<<<<<<
 * 
 * cpdef size_t spGEMM_compute(
*/
  __pyx_r = __pyx_v_bufferSize1;
  goto __pyx_L0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":5069
 *     check_status(status)
 * 
 * cpdef size_t spGEMM_workEstimation(             # <<<<<<<<<<<<<<
 *         intptr_t handle, Operation opA, Operation opB, intptr_t alpha,
 *         size_t matA, size_t matB, intptr_t beta, size_t matC,
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.spGEMM_workEstimation", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1L;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_585spGEMM_workEstimation(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_584spGEMM_workEstimation, "spGEMM_workEstimation(intptr_t handle, Operation opA, Operation opB, intptr_t alpha, size_t matA, size_t matB, intptr_t beta, size_t matC, DataType computeType, int alg, size_t spgemmDescr, size_t bufferSize, intptr_t externalBuffer1) -> size_t");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_585spGEMM_workEstimation(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  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_v_alg;
  size_t __pyx_v_spgemmDescr;
  size_t __pyx_v_bufferSize;
  intptr_t __pyx_v_externalBuffer1;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[13] = {0,0,0,0,0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("spGEMM_workEstimation (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_opA,&__pyx_mstate_global->__pyx_n_u_opB,&__pyx_mstate_global->__pyx_n_u_alpha,&__pyx_mstate_global->__pyx_n_u_matA,&__pyx_mstate_global->__pyx_n_u_matB,&__pyx_mstate_global->__pyx_n_u_beta,&__pyx_mstate_global->__pyx_n_u_matC,&__pyx_mstate_global->__pyx_n_u_computeType,&__pyx_mstate_global->__pyx_n_u_alg,&__pyx_mstate_global->__pyx_n_u_spgemmDescr,&__pyx_mstate_global->__pyx_n_u_bufferSize,&__pyx_mstate_global->__pyx_n_u_externalBuffer1,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 5069, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 13:
        values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 5069, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 12:
        values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 5069, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 11:
        values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 5069, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 5069, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 5069, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 5069, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 5069, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 5069, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 5069, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 5069, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 5069, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 5069, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 5069, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "spGEMM_workEstimation", 0) < (0)) __PYX_ERR(0, 5069, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 13; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("spGEMM_workEstimation", 1, 13, 13, i); __PYX_ERR(0, 5069, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 13)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 5069, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 5069, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 5069, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 5069, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 5069, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 5069, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 5069, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 5069, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 5069, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 5069, __pyx_L3_error)
      values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 5069, __pyx_L3_error)
      values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 5069, __pyx_L3_error)
      values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 5069, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 5070, __pyx_L3_error)
    __pyx_v_opA = __Pyx_PyLong_As_cusparseOperation_t(values[1]); if (unlikely((__pyx_v_opA == ((cusparseOperation_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 5070, __pyx_L3_error)
    __pyx_v_opB = __Pyx_PyLong_As_cusparseOperation_t(values[2]); if (unlikely((__pyx_v_opB == ((cusparseOperation_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 5070, __pyx_L3_error)
    __pyx_v_alpha = PyLong_AsSsize_t(values[3]); if (unlikely((__pyx_v_alpha == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 5070, __pyx_L3_error)
    __pyx_v_matA = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_matA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 5071, __pyx_L3_error)
    __pyx_v_matB = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_matB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 5071, __pyx_L3_error)
    __pyx_v_beta = PyLong_AsSsize_t(values[6]); if (unlikely((__pyx_v_beta == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 5071, __pyx_L3_error)
    __pyx_v_matC = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_matC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 5071, __pyx_L3_error)
    __pyx_v_computeType = __Pyx_PyLong_As_cudaDataType(values[8]); if (unlikely((__pyx_v_computeType == ((cudaDataType)-1)) && PyErr_Occurred())) __PYX_ERR(0, 5072, __pyx_L3_error)
    __pyx_v_alg = __Pyx_PyLong_As_int(values[9]); if (unlikely((__pyx_v_alg == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 5072, __pyx_L3_error)
    __pyx_v_spgemmDescr = __Pyx_PyLong_As_size_t(values[10]); if (unlikely((__pyx_v_spgemmDescr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 5072, __pyx_L3_error)
    __pyx_v_bufferSize = __Pyx_PyLong_As_size_t(values[11]); if (unlikely((__pyx_v_bufferSize == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 5073, __pyx_L3_error)
    __pyx_v_externalBuffer1 = PyLong_AsSsize_t(values[12]); if (unlikely((__pyx_v_externalBuffer1 == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 5073, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("spGEMM_workEstimation", 1, 13, 13, __pyx_nargs); __PYX_ERR(0, 5069, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.spGEMM_workEstimation", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_584spGEMM_workEstimation(__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_spgemmDescr, __pyx_v_bufferSize, __pyx_v_externalBuffer1);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_584spGEMM_workEstimation(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, int __pyx_v_alg, size_t __pyx_v_spgemmDescr, size_t __pyx_v_bufferSize, intptr_t __pyx_v_externalBuffer1) {
  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("spGEMM_workEstimation", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_spGEMM_workEstimation(__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_spgemmDescr, __pyx_v_bufferSize, __pyx_v_externalBuffer1, 1); if (unlikely(__pyx_t_1 == ((size_t)-1L) && PyErr_Occurred())) __PYX_ERR(0, 5069, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyLong_FromSize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5069, __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_backends.cuda.libs.cusparse.spGEMM_workEstimation", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy_backends/cuda/libs/cusparse.pyx":5083
 *     return bufferSize1
 * 
 * cpdef size_t spGEMM_compute(             # <<<<<<<<<<<<<<
 *         intptr_t handle, Operation opA, Operation opB, intptr_t alpha,
 *         size_t matA, size_t matB, intptr_t beta, size_t matC,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_587spGEMM_compute(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static size_t __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_spGEMM_compute(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_v_alg, size_t __pyx_v_spgemmDescr, size_t __pyx_v_bufferSize, intptr_t __pyx_v_externalBuffer2, CYTHON_UNUSED int __pyx_skip_dispatch) {
  size_t __pyx_v_bufferSize2;
  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("spGEMM_compute", 0);

  /* "cupy_backends/cuda/libs/cusparse.pyx":5088
 *         DataType computeType, int alg, size_t spgemmDescr,
 *         size_t bufferSize, intptr_t externalBuffer2) except? -1:
 *     cdef size_t bufferSize2 = bufferSize             # <<<<<<<<<<<<<<
 *     status = cusparseSpGEMM_compute(
 *         <Handle>handle, opA, opB, <const void*>alpha, <SpMatDescr>matA,
*/
  __pyx_v_bufferSize2 = __pyx_v_bufferSize;

  /* "cupy_backends/cuda/libs/cusparse.pyx":5089
 *         size_t bufferSize, intptr_t externalBuffer2) except? -1:
 *     cdef size_t bufferSize2 = bufferSize
 *     status = cusparseSpGEMM_compute(             # <<<<<<<<<<<<<<
 *         <Handle>handle, opA, opB, <const void*>alpha, <SpMatDescr>matA,
 *         <SpMatDescr>matB, <const void*>beta, <SpMatDescr>matC, computeType,
*/
  __pyx_v_status = cusparseSpGEMM_compute(((cusparseHandle_t)__pyx_v_handle), __pyx_v_opA, __pyx_v_opB, ((void const *)__pyx_v_alpha), ((cusparseSpMatDescr_t)__pyx_v_matA), ((cusparseSpMatDescr_t)__pyx_v_matB), ((void const *)__pyx_v_beta), ((cusparseSpMatDescr_t)__pyx_v_matC), __pyx_v_computeType, ((cusparseSpGEMMAlg_t)__pyx_v_alg), ((cusparseSpGEMMDescr_t)__pyx_v_spgemmDescr), (&__pyx_v_bufferSize2), ((void *)__pyx_v_externalBuffer2));

  /* "cupy_backends/cuda/libs/cusparse.pyx":5094
 *         <SpGEMMAlg>alg, <SpGEMMDescr>spgemmDescr, &bufferSize2,
 *         <void*>externalBuffer2)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return bufferSize2
 * 
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5094, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":5095
 *         <void*>externalBuffer2)
 *     check_status(status)
 *     return bufferSize2             # <<<<<<<<<<<<<<
 * 
 * cpdef void spGEMM_copy(
*/
  __pyx_r = __pyx_v_bufferSize2;
  goto __pyx_L0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":5083
 *     return bufferSize1
 * 
 * cpdef size_t spGEMM_compute(             # <<<<<<<<<<<<<<
 *         intptr_t handle, Operation opA, Operation opB, intptr_t alpha,
 *         size_t matA, size_t matB, intptr_t beta, size_t matC,
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.spGEMM_compute", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1L;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_587spGEMM_compute(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_586spGEMM_compute, "spGEMM_compute(intptr_t handle, Operation opA, Operation opB, intptr_t alpha, size_t matA, size_t matB, intptr_t beta, size_t matC, DataType computeType, int alg, size_t spgemmDescr, size_t bufferSize, intptr_t externalBuffer2) -> size_t");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_587spGEMM_compute(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  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_v_alg;
  size_t __pyx_v_spgemmDescr;
  size_t __pyx_v_bufferSize;
  intptr_t __pyx_v_externalBuffer2;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[13] = {0,0,0,0,0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("spGEMM_compute (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_opA,&__pyx_mstate_global->__pyx_n_u_opB,&__pyx_mstate_global->__pyx_n_u_alpha,&__pyx_mstate_global->__pyx_n_u_matA,&__pyx_mstate_global->__pyx_n_u_matB,&__pyx_mstate_global->__pyx_n_u_beta,&__pyx_mstate_global->__pyx_n_u_matC,&__pyx_mstate_global->__pyx_n_u_computeType,&__pyx_mstate_global->__pyx_n_u_alg,&__pyx_mstate_global->__pyx_n_u_spgemmDescr,&__pyx_mstate_global->__pyx_n_u_bufferSize,&__pyx_mstate_global->__pyx_n_u_externalBuffer2,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 5083, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 13:
        values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 5083, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 12:
        values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 5083, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 11:
        values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 5083, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 5083, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 5083, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 5083, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 5083, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 5083, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 5083, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 5083, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 5083, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 5083, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 5083, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "spGEMM_compute", 0) < (0)) __PYX_ERR(0, 5083, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 13; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("spGEMM_compute", 1, 13, 13, i); __PYX_ERR(0, 5083, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 13)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 5083, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 5083, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 5083, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 5083, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 5083, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 5083, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 5083, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 5083, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 5083, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 5083, __pyx_L3_error)
      values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 5083, __pyx_L3_error)
      values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 5083, __pyx_L3_error)
      values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 5083, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 5084, __pyx_L3_error)
    __pyx_v_opA = __Pyx_PyLong_As_cusparseOperation_t(values[1]); if (unlikely((__pyx_v_opA == ((cusparseOperation_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 5084, __pyx_L3_error)
    __pyx_v_opB = __Pyx_PyLong_As_cusparseOperation_t(values[2]); if (unlikely((__pyx_v_opB == ((cusparseOperation_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 5084, __pyx_L3_error)
    __pyx_v_alpha = PyLong_AsSsize_t(values[3]); if (unlikely((__pyx_v_alpha == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 5084, __pyx_L3_error)
    __pyx_v_matA = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_matA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 5085, __pyx_L3_error)
    __pyx_v_matB = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_matB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 5085, __pyx_L3_error)
    __pyx_v_beta = PyLong_AsSsize_t(values[6]); if (unlikely((__pyx_v_beta == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 5085, __pyx_L3_error)
    __pyx_v_matC = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_matC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 5085, __pyx_L3_error)
    __pyx_v_computeType = __Pyx_PyLong_As_cudaDataType(values[8]); if (unlikely((__pyx_v_computeType == ((cudaDataType)-1)) && PyErr_Occurred())) __PYX_ERR(0, 5086, __pyx_L3_error)
    __pyx_v_alg = __Pyx_PyLong_As_int(values[9]); if (unlikely((__pyx_v_alg == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 5086, __pyx_L3_error)
    __pyx_v_spgemmDescr = __Pyx_PyLong_As_size_t(values[10]); if (unlikely((__pyx_v_spgemmDescr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 5086, __pyx_L3_error)
    __pyx_v_bufferSize = __Pyx_PyLong_As_size_t(values[11]); if (unlikely((__pyx_v_bufferSize == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 5087, __pyx_L3_error)
    __pyx_v_externalBuffer2 = PyLong_AsSsize_t(values[12]); if (unlikely((__pyx_v_externalBuffer2 == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 5087, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("spGEMM_compute", 1, 13, 13, __pyx_nargs); __PYX_ERR(0, 5083, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.spGEMM_compute", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_586spGEMM_compute(__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_spgemmDescr, __pyx_v_bufferSize, __pyx_v_externalBuffer2);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_586spGEMM_compute(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, int __pyx_v_alg, size_t __pyx_v_spgemmDescr, size_t __pyx_v_bufferSize, intptr_t __pyx_v_externalBuffer2) {
  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("spGEMM_compute", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_spGEMM_compute(__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_spgemmDescr, __pyx_v_bufferSize, __pyx_v_externalBuffer2, 1); if (unlikely(__pyx_t_1 == ((size_t)-1L) && PyErr_Occurred())) __PYX_ERR(0, 5083, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyLong_FromSize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5083, __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_backends.cuda.libs.cusparse.spGEMM_compute", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy_backends/cuda/libs/cusparse.pyx":5097
 *     return bufferSize2
 * 
 * cpdef void spGEMM_copy(             # <<<<<<<<<<<<<<
 *         intptr_t handle, Operation opA, Operation opB, intptr_t alpha,
 *         size_t matA, size_t matB, intptr_t beta, size_t matC,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_589spGEMM_copy(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_spGEMM_copy(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_v_alg, size_t __pyx_v_spgemmDescr, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("spGEMM_copy", 0);

  /* "cupy_backends/cuda/libs/cusparse.pyx":5101
 *         size_t matA, size_t matB, intptr_t beta, size_t matC,
 *         DataType computeType, int alg, size_t spgemmDescr) except *:
 *     status = cusparseSpGEMM_copy(             # <<<<<<<<<<<<<<
 *         <Handle>handle, opA, opB, <const void*>alpha, <SpMatDescr>matA,
 *         <SpMatDescr>matB, <const void*>beta, <SpMatDescr>matC, computeType,
*/
  __pyx_v_status = cusparseSpGEMM_copy(((cusparseHandle_t)__pyx_v_handle), __pyx_v_opA, __pyx_v_opB, ((void const *)__pyx_v_alpha), ((cusparseSpMatDescr_t)__pyx_v_matA), ((cusparseSpMatDescr_t)__pyx_v_matB), ((void const *)__pyx_v_beta), ((cusparseSpMatDescr_t)__pyx_v_matC), __pyx_v_computeType, ((cusparseSpGEMMAlg_t)__pyx_v_alg), ((cusparseSpGEMMDescr_t)__pyx_v_spgemmDescr));

  /* "cupy_backends/cuda/libs/cusparse.pyx":5105
 *         <SpMatDescr>matB, <const void*>beta, <SpMatDescr>matC, computeType,
 *         <SpGEMMAlg>alg, <SpGEMMDescr>spgemmDescr)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef size_t spGEAM_createDescr() except? 0:
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5105, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":5097
 *     return bufferSize2
 * 
 * cpdef void spGEMM_copy(             # <<<<<<<<<<<<<<
 *         intptr_t handle, Operation opA, Operation opB, intptr_t alpha,
 *         size_t matA, size_t matB, intptr_t beta, size_t matC,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.spGEMM_copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_589spGEMM_copy(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_588spGEMM_copy, "spGEMM_copy(intptr_t handle, Operation opA, Operation opB, intptr_t alpha, size_t matA, size_t matB, intptr_t beta, size_t matC, DataType computeType, int alg, size_t spgemmDescr) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_589spGEMM_copy(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  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_v_alg;
  size_t __pyx_v_spgemmDescr;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[11] = {0,0,0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("spGEMM_copy (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_opA,&__pyx_mstate_global->__pyx_n_u_opB,&__pyx_mstate_global->__pyx_n_u_alpha,&__pyx_mstate_global->__pyx_n_u_matA,&__pyx_mstate_global->__pyx_n_u_matB,&__pyx_mstate_global->__pyx_n_u_beta,&__pyx_mstate_global->__pyx_n_u_matC,&__pyx_mstate_global->__pyx_n_u_computeType,&__pyx_mstate_global->__pyx_n_u_alg,&__pyx_mstate_global->__pyx_n_u_spgemmDescr,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 5097, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 11:
        values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 5097, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 5097, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 5097, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 5097, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 5097, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 5097, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 5097, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 5097, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 5097, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 5097, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 5097, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "spGEMM_copy", 0) < (0)) __PYX_ERR(0, 5097, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 11; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("spGEMM_copy", 1, 11, 11, i); __PYX_ERR(0, 5097, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 11)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 5097, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 5097, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 5097, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 5097, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 5097, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 5097, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 5097, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 5097, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 5097, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 5097, __pyx_L3_error)
      values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 5097, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 5098, __pyx_L3_error)
    __pyx_v_opA = __Pyx_PyLong_As_cusparseOperation_t(values[1]); if (unlikely((__pyx_v_opA == ((cusparseOperation_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 5098, __pyx_L3_error)
    __pyx_v_opB = __Pyx_PyLong_As_cusparseOperation_t(values[2]); if (unlikely((__pyx_v_opB == ((cusparseOperation_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 5098, __pyx_L3_error)
    __pyx_v_alpha = PyLong_AsSsize_t(values[3]); if (unlikely((__pyx_v_alpha == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 5098, __pyx_L3_error)
    __pyx_v_matA = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_matA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 5099, __pyx_L3_error)
    __pyx_v_matB = __Pyx_PyLong_As_size_t(values[5]); if (unlikely((__pyx_v_matB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 5099, __pyx_L3_error)
    __pyx_v_beta = PyLong_AsSsize_t(values[6]); if (unlikely((__pyx_v_beta == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 5099, __pyx_L3_error)
    __pyx_v_matC = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_matC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 5099, __pyx_L3_error)
    __pyx_v_computeType = __Pyx_PyLong_As_cudaDataType(values[8]); if (unlikely((__pyx_v_computeType == ((cudaDataType)-1)) && PyErr_Occurred())) __PYX_ERR(0, 5100, __pyx_L3_error)
    __pyx_v_alg = __Pyx_PyLong_As_int(values[9]); if (unlikely((__pyx_v_alg == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 5100, __pyx_L3_error)
    __pyx_v_spgemmDescr = __Pyx_PyLong_As_size_t(values[10]); if (unlikely((__pyx_v_spgemmDescr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 5100, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("spGEMM_copy", 1, 11, 11, __pyx_nargs); __PYX_ERR(0, 5097, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.spGEMM_copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_588spGEMM_copy(__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_spgemmDescr);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_588spGEMM_copy(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, int __pyx_v_alg, size_t __pyx_v_spgemmDescr) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("spGEMM_copy", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_spGEMM_copy(__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_spgemmDescr, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 5097, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5097, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":5107
 *     check_status(status)
 * 
 * cpdef size_t spGEAM_createDescr() except? 0:             # <<<<<<<<<<<<<<
 *     cdef SpGEAMDescr descr
 *     status = cusparseSpGEAM_createDescr(&descr)
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_591spGEAM_createDescr(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static size_t __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_spGEAM_createDescr(CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseSpGEAMDescr_t __pyx_v_descr;
  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("spGEAM_createDescr", 0);

  /* "cupy_backends/cuda/libs/cusparse.pyx":5109
 * cpdef size_t spGEAM_createDescr() except? 0:
 *     cdef SpGEAMDescr descr
 *     status = cusparseSpGEAM_createDescr(&descr)             # <<<<<<<<<<<<<<
 *     check_status(status)
 *     return <size_t>descr
*/
  __pyx_v_status = __pyx_v_13cupy_backends_4cuda_4libs_8cusparse_cusparseSpGEAM_createDescr((&__pyx_v_descr));

  /* "cupy_backends/cuda/libs/cusparse.pyx":5110
 *     cdef SpGEAMDescr descr
 *     status = cusparseSpGEAM_createDescr(&descr)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return <size_t>descr
 * 
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5110, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":5111
 *     status = cusparseSpGEAM_createDescr(&descr)
 *     check_status(status)
 *     return <size_t>descr             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_r = ((size_t)__pyx_v_descr);
  goto __pyx_L0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":5107
 *     check_status(status)
 * 
 * cpdef size_t spGEAM_createDescr() except? 0:             # <<<<<<<<<<<<<<
 *     cdef SpGEAMDescr descr
 *     status = cusparseSpGEAM_createDescr(&descr)
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.spGEAM_createDescr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_591spGEAM_createDescr(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_590spGEAM_createDescr, "spGEAM_createDescr() -> size_t");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_591spGEAM_createDescr(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("spGEAM_createDescr (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_590spGEAM_createDescr(__pyx_self);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_590spGEAM_createDescr(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("spGEAM_createDescr", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_spGEAM_createDescr(1); if (unlikely(__pyx_t_1 == ((size_t)0) && PyErr_Occurred())) __PYX_ERR(0, 5107, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyLong_FromSize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5107, __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_backends.cuda.libs.cusparse.spGEAM_createDescr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy_backends/cuda/libs/cusparse.pyx":5114
 * 
 * 
 * cpdef void spGEAM_destroyDescr(size_t descr) except *:             # <<<<<<<<<<<<<<
 *     status = cusparseSpGEAM_destroyDescr(<SpGEAMDescr>descr)
 *     check_status(status)
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_593spGEAM_destroyDescr(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_spGEAM_destroyDescr(size_t __pyx_v_descr, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("spGEAM_destroyDescr", 0);

  /* "cupy_backends/cuda/libs/cusparse.pyx":5115
 * 
 * cpdef void spGEAM_destroyDescr(size_t descr) except *:
 *     status = cusparseSpGEAM_destroyDescr(<SpGEAMDescr>descr)             # <<<<<<<<<<<<<<
 *     check_status(status)
 * 
*/
  __pyx_v_status = __pyx_v_13cupy_backends_4cuda_4libs_8cusparse_cusparseSpGEAM_destroyDescr(((cusparseSpGEAMDescr_t)__pyx_v_descr));

  /* "cupy_backends/cuda/libs/cusparse.pyx":5116
 * cpdef void spGEAM_destroyDescr(size_t descr) except *:
 *     status = cusparseSpGEAM_destroyDescr(<SpGEAMDescr>descr)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5116, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":5114
 * 
 * 
 * cpdef void spGEAM_destroyDescr(size_t descr) except *:             # <<<<<<<<<<<<<<
 *     status = cusparseSpGEAM_destroyDescr(<SpGEAMDescr>descr)
 *     check_status(status)
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.spGEAM_destroyDescr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_593spGEAM_destroyDescr(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_592spGEAM_destroyDescr, "spGEAM_destroyDescr(size_t descr) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_593spGEAM_destroyDescr(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  size_t __pyx_v_descr;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("spGEAM_destroyDescr (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_descr,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 5114, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 5114, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "spGEAM_destroyDescr", 0) < (0)) __PYX_ERR(0, 5114, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("spGEAM_destroyDescr", 1, 1, 1, i); __PYX_ERR(0, 5114, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 5114, __pyx_L3_error)
    }
    __pyx_v_descr = __Pyx_PyLong_As_size_t(values[0]); if (unlikely((__pyx_v_descr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 5114, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("spGEAM_destroyDescr", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 5114, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.spGEAM_destroyDescr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_592spGEAM_destroyDescr(__pyx_self, __pyx_v_descr);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_592spGEAM_destroyDescr(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("spGEAM_destroyDescr", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_spGEAM_destroyDescr(__pyx_v_descr, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 5114, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5114, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":5119
 * 
 * 
 * cpdef size_t spGEAM_bufferSize(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int opA, int opB,
 *         intptr_t alpha, size_t matA, intptr_t beta, size_t matB,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_595spGEAM_bufferSize(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static size_t __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_spGEAM_bufferSize(intptr_t __pyx_v_handle, int __pyx_v_opA, int __pyx_v_opB, intptr_t __pyx_v_alpha, size_t __pyx_v_matA, intptr_t __pyx_v_beta, size_t __pyx_v_matB, size_t __pyx_v_matC, cudaDataType __pyx_v_computeType, int __pyx_v_alg, size_t __pyx_v_spgeamDescr, 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("spGEAM_bufferSize", 0);

  /* "cupy_backends/cuda/libs/cusparse.pyx":5125
 *         size_t spgeamDescr) except? -1:
 *     cdef size_t bufferSize
 *     status = cusparseSpGEAM_bufferSize(             # <<<<<<<<<<<<<<
 *         <Handle>handle, <Operation>opA, <Operation>opB,
 *         <const void*>alpha, <SpMatDescr>matA,
*/
  __pyx_v_status = __pyx_v_13cupy_backends_4cuda_4libs_8cusparse_cusparseSpGEAM_bufferSize(((cusparseHandle_t)__pyx_v_handle), ((cusparseOperation_t)__pyx_v_opA), ((cusparseOperation_t)__pyx_v_opB), ((void const *)__pyx_v_alpha), ((cusparseSpMatDescr_t)__pyx_v_matA), ((void const *)__pyx_v_beta), ((cusparseSpMatDescr_t)__pyx_v_matB), ((cusparseSpMatDescr_t)__pyx_v_matC), __pyx_v_computeType, ((cusparseSpGEAMAlg_t)__pyx_v_alg), ((cusparseSpGEAMDescr_t)__pyx_v_spgeamDescr), (&__pyx_v_bufferSize));

  /* "cupy_backends/cuda/libs/cusparse.pyx":5131
 *         <SpMatDescr>matC, computeType, <SpGEAMAlg>alg,
 *         <SpGEAMDescr>spgeamDescr, &bufferSize)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return bufferSize
 * 
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5131, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":5132
 *         <SpGEAMDescr>spgeamDescr, &bufferSize)
 *     check_status(status)
 *     return bufferSize             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_r = __pyx_v_bufferSize;
  goto __pyx_L0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":5119
 * 
 * 
 * cpdef size_t spGEAM_bufferSize(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int opA, int opB,
 *         intptr_t alpha, size_t matA, intptr_t beta, size_t matB,
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.spGEAM_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1L;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_595spGEAM_bufferSize(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_594spGEAM_bufferSize, "spGEAM_bufferSize(intptr_t handle, int opA, int opB, intptr_t alpha, size_t matA, intptr_t beta, size_t matB, size_t matC, DataType computeType, int alg, size_t spgeamDescr) -> size_t");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_595spGEAM_bufferSize(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_t __pyx_v_handle;
  int __pyx_v_opA;
  int __pyx_v_opB;
  intptr_t __pyx_v_alpha;
  size_t __pyx_v_matA;
  intptr_t __pyx_v_beta;
  size_t __pyx_v_matB;
  size_t __pyx_v_matC;
  cudaDataType __pyx_v_computeType;
  int __pyx_v_alg;
  size_t __pyx_v_spgeamDescr;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[11] = {0,0,0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("spGEAM_bufferSize (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_opA,&__pyx_mstate_global->__pyx_n_u_opB,&__pyx_mstate_global->__pyx_n_u_alpha,&__pyx_mstate_global->__pyx_n_u_matA,&__pyx_mstate_global->__pyx_n_u_beta,&__pyx_mstate_global->__pyx_n_u_matB,&__pyx_mstate_global->__pyx_n_u_matC,&__pyx_mstate_global->__pyx_n_u_computeType,&__pyx_mstate_global->__pyx_n_u_alg,&__pyx_mstate_global->__pyx_n_u_spgeamDescr,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 5119, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 11:
        values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 5119, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 5119, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 5119, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 5119, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 5119, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 5119, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 5119, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 5119, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 5119, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 5119, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 5119, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "spGEAM_bufferSize", 0) < (0)) __PYX_ERR(0, 5119, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 11; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("spGEAM_bufferSize", 1, 11, 11, i); __PYX_ERR(0, 5119, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 11)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 5119, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 5119, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 5119, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 5119, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 5119, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 5119, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 5119, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 5119, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 5119, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 5119, __pyx_L3_error)
      values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 5119, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 5120, __pyx_L3_error)
    __pyx_v_opA = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_opA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 5120, __pyx_L3_error)
    __pyx_v_opB = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_opB == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 5120, __pyx_L3_error)
    __pyx_v_alpha = PyLong_AsSsize_t(values[3]); if (unlikely((__pyx_v_alpha == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 5121, __pyx_L3_error)
    __pyx_v_matA = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_matA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 5121, __pyx_L3_error)
    __pyx_v_beta = PyLong_AsSsize_t(values[5]); if (unlikely((__pyx_v_beta == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 5121, __pyx_L3_error)
    __pyx_v_matB = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_matB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 5121, __pyx_L3_error)
    __pyx_v_matC = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_matC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 5122, __pyx_L3_error)
    __pyx_v_computeType = __Pyx_PyLong_As_cudaDataType(values[8]); if (unlikely((__pyx_v_computeType == ((cudaDataType)-1)) && PyErr_Occurred())) __PYX_ERR(0, 5122, __pyx_L3_error)
    __pyx_v_alg = __Pyx_PyLong_As_int(values[9]); if (unlikely((__pyx_v_alg == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 5122, __pyx_L3_error)
    __pyx_v_spgeamDescr = __Pyx_PyLong_As_size_t(values[10]); if (unlikely((__pyx_v_spgeamDescr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 5123, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("spGEAM_bufferSize", 1, 11, 11, __pyx_nargs); __PYX_ERR(0, 5119, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.spGEAM_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_594spGEAM_bufferSize(__pyx_self, __pyx_v_handle, __pyx_v_opA, __pyx_v_opB, __pyx_v_alpha, __pyx_v_matA, __pyx_v_beta, __pyx_v_matB, __pyx_v_matC, __pyx_v_computeType, __pyx_v_alg, __pyx_v_spgeamDescr);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_594spGEAM_bufferSize(CYTHON_UNUSED PyObject *__pyx_self, intptr_t __pyx_v_handle, int __pyx_v_opA, int __pyx_v_opB, intptr_t __pyx_v_alpha, size_t __pyx_v_matA, intptr_t __pyx_v_beta, size_t __pyx_v_matB, size_t __pyx_v_matC, cudaDataType __pyx_v_computeType, int __pyx_v_alg, size_t __pyx_v_spgeamDescr) {
  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("spGEAM_bufferSize", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_spGEAM_bufferSize(__pyx_v_handle, __pyx_v_opA, __pyx_v_opB, __pyx_v_alpha, __pyx_v_matA, __pyx_v_beta, __pyx_v_matB, __pyx_v_matC, __pyx_v_computeType, __pyx_v_alg, __pyx_v_spgeamDescr, 1); if (unlikely(__pyx_t_1 == ((size_t)-1L) && PyErr_Occurred())) __PYX_ERR(0, 5119, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyLong_FromSize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5119, __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_backends.cuda.libs.cusparse.spGEAM_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy_backends/cuda/libs/cusparse.pyx":5135
 * 
 * 
 * cpdef void spGEAM_nnz(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int opA, int opB,
 *         intptr_t alpha, size_t matA, intptr_t beta, size_t matB,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_597spGEAM_nnz(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_spGEAM_nnz(intptr_t __pyx_v_handle, int __pyx_v_opA, int __pyx_v_opB, intptr_t __pyx_v_alpha, size_t __pyx_v_matA, intptr_t __pyx_v_beta, size_t __pyx_v_matB, size_t __pyx_v_matC, cudaDataType __pyx_v_computeType, int __pyx_v_alg, size_t __pyx_v_spgeamDescr, intptr_t __pyx_v_externalBuffer, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("spGEAM_nnz", 0);

  /* "cupy_backends/cuda/libs/cusparse.pyx":5140
 *         size_t matC, DataType computeType, int alg,
 *         size_t spgeamDescr, intptr_t externalBuffer) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     status = cusparseSpGEAM_nnz(
 *         <Handle>handle, <Operation>opA, <Operation>opB,
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 5140, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":5141
 *         size_t spgeamDescr, intptr_t externalBuffer) except *:
 *     _setStream(handle)
 *     status = cusparseSpGEAM_nnz(             # <<<<<<<<<<<<<<
 *         <Handle>handle, <Operation>opA, <Operation>opB,
 *         <const void*>alpha, <SpMatDescr>matA,
*/
  __pyx_v_status = __pyx_v_13cupy_backends_4cuda_4libs_8cusparse_cusparseSpGEAM_nnz(((cusparseHandle_t)__pyx_v_handle), ((cusparseOperation_t)__pyx_v_opA), ((cusparseOperation_t)__pyx_v_opB), ((void const *)__pyx_v_alpha), ((cusparseSpMatDescr_t)__pyx_v_matA), ((void const *)__pyx_v_beta), ((cusparseSpMatDescr_t)__pyx_v_matB), ((cusparseSpMatDescr_t)__pyx_v_matC), __pyx_v_computeType, ((cusparseSpGEAMAlg_t)__pyx_v_alg), ((cusparseSpGEAMDescr_t)__pyx_v_spgeamDescr), ((void *)__pyx_v_externalBuffer));

  /* "cupy_backends/cuda/libs/cusparse.pyx":5147
 *         <SpMatDescr>matC, computeType, <SpGEAMAlg>alg,
 *         <SpGEAMDescr>spgeamDescr, <void*>externalBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5147, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":5135
 * 
 * 
 * cpdef void spGEAM_nnz(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int opA, int opB,
 *         intptr_t alpha, size_t matA, intptr_t beta, size_t matB,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.spGEAM_nnz", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_597spGEAM_nnz(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_596spGEAM_nnz, "spGEAM_nnz(intptr_t handle, int opA, int opB, intptr_t alpha, size_t matA, intptr_t beta, size_t matB, size_t matC, DataType computeType, int alg, size_t spgeamDescr, intptr_t externalBuffer) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_597spGEAM_nnz(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_t __pyx_v_handle;
  int __pyx_v_opA;
  int __pyx_v_opB;
  intptr_t __pyx_v_alpha;
  size_t __pyx_v_matA;
  intptr_t __pyx_v_beta;
  size_t __pyx_v_matB;
  size_t __pyx_v_matC;
  cudaDataType __pyx_v_computeType;
  int __pyx_v_alg;
  size_t __pyx_v_spgeamDescr;
  intptr_t __pyx_v_externalBuffer;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[12] = {0,0,0,0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("spGEAM_nnz (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_opA,&__pyx_mstate_global->__pyx_n_u_opB,&__pyx_mstate_global->__pyx_n_u_alpha,&__pyx_mstate_global->__pyx_n_u_matA,&__pyx_mstate_global->__pyx_n_u_beta,&__pyx_mstate_global->__pyx_n_u_matB,&__pyx_mstate_global->__pyx_n_u_matC,&__pyx_mstate_global->__pyx_n_u_computeType,&__pyx_mstate_global->__pyx_n_u_alg,&__pyx_mstate_global->__pyx_n_u_spgeamDescr,&__pyx_mstate_global->__pyx_n_u_externalBuffer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 5135, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 12:
        values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 5135, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 11:
        values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 5135, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 5135, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 5135, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 5135, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 5135, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 5135, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 5135, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 5135, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 5135, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 5135, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 5135, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "spGEAM_nnz", 0) < (0)) __PYX_ERR(0, 5135, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 12; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("spGEAM_nnz", 1, 12, 12, i); __PYX_ERR(0, 5135, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 12)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 5135, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 5135, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 5135, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 5135, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 5135, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 5135, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 5135, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 5135, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 5135, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 5135, __pyx_L3_error)
      values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 5135, __pyx_L3_error)
      values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 5135, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 5136, __pyx_L3_error)
    __pyx_v_opA = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_opA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 5136, __pyx_L3_error)
    __pyx_v_opB = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_opB == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 5136, __pyx_L3_error)
    __pyx_v_alpha = PyLong_AsSsize_t(values[3]); if (unlikely((__pyx_v_alpha == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 5137, __pyx_L3_error)
    __pyx_v_matA = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_matA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 5137, __pyx_L3_error)
    __pyx_v_beta = PyLong_AsSsize_t(values[5]); if (unlikely((__pyx_v_beta == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 5137, __pyx_L3_error)
    __pyx_v_matB = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_matB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 5137, __pyx_L3_error)
    __pyx_v_matC = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_matC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 5138, __pyx_L3_error)
    __pyx_v_computeType = __Pyx_PyLong_As_cudaDataType(values[8]); if (unlikely((__pyx_v_computeType == ((cudaDataType)-1)) && PyErr_Occurred())) __PYX_ERR(0, 5138, __pyx_L3_error)
    __pyx_v_alg = __Pyx_PyLong_As_int(values[9]); if (unlikely((__pyx_v_alg == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 5138, __pyx_L3_error)
    __pyx_v_spgeamDescr = __Pyx_PyLong_As_size_t(values[10]); if (unlikely((__pyx_v_spgeamDescr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 5139, __pyx_L3_error)
    __pyx_v_externalBuffer = PyLong_AsSsize_t(values[11]); if (unlikely((__pyx_v_externalBuffer == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 5139, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("spGEAM_nnz", 1, 12, 12, __pyx_nargs); __PYX_ERR(0, 5135, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.spGEAM_nnz", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_596spGEAM_nnz(__pyx_self, __pyx_v_handle, __pyx_v_opA, __pyx_v_opB, __pyx_v_alpha, __pyx_v_matA, __pyx_v_beta, __pyx_v_matB, __pyx_v_matC, __pyx_v_computeType, __pyx_v_alg, __pyx_v_spgeamDescr, __pyx_v_externalBuffer);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_596spGEAM_nnz(CYTHON_UNUSED PyObject *__pyx_self, intptr_t __pyx_v_handle, int __pyx_v_opA, int __pyx_v_opB, intptr_t __pyx_v_alpha, size_t __pyx_v_matA, intptr_t __pyx_v_beta, size_t __pyx_v_matB, size_t __pyx_v_matC, cudaDataType __pyx_v_computeType, int __pyx_v_alg, size_t __pyx_v_spgeamDescr, 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("spGEAM_nnz", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_spGEAM_nnz(__pyx_v_handle, __pyx_v_opA, __pyx_v_opB, __pyx_v_alpha, __pyx_v_matA, __pyx_v_beta, __pyx_v_matB, __pyx_v_matC, __pyx_v_computeType, __pyx_v_alg, __pyx_v_spgeamDescr, __pyx_v_externalBuffer, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 5135, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5135, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":5150
 * 
 * 
 * cpdef void spGEAM(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int opA, int opB,
 *         intptr_t alpha, size_t matA, intptr_t beta, size_t matB,
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_599spGEAM(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_spGEAM(intptr_t __pyx_v_handle, int __pyx_v_opA, int __pyx_v_opB, intptr_t __pyx_v_alpha, size_t __pyx_v_matA, intptr_t __pyx_v_beta, size_t __pyx_v_matB, size_t __pyx_v_matC, cudaDataType __pyx_v_computeType, int __pyx_v_alg, size_t __pyx_v_spgeamDescr, intptr_t __pyx_v_externalBuffer, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("spGEAM", 0);

  /* "cupy_backends/cuda/libs/cusparse.pyx":5155
 *         size_t matC, DataType computeType, int alg,
 *         size_t spgeamDescr, intptr_t externalBuffer) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     status = cusparseSpGEAM_fn(
 *         <Handle>handle, <Operation>opA, <Operation>opB,
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 5155, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":5156
 *         size_t spgeamDescr, intptr_t externalBuffer) except *:
 *     _setStream(handle)
 *     status = cusparseSpGEAM_fn(             # <<<<<<<<<<<<<<
 *         <Handle>handle, <Operation>opA, <Operation>opB,
 *         <const void*>alpha, <SpMatDescr>matA,
*/
  __pyx_v_status = __pyx_v_13cupy_backends_4cuda_4libs_8cusparse_cusparseSpGEAM_fn(((cusparseHandle_t)__pyx_v_handle), ((cusparseOperation_t)__pyx_v_opA), ((cusparseOperation_t)__pyx_v_opB), ((void const *)__pyx_v_alpha), ((cusparseSpMatDescr_t)__pyx_v_matA), ((void const *)__pyx_v_beta), ((cusparseSpMatDescr_t)__pyx_v_matB), ((cusparseSpMatDescr_t)__pyx_v_matC), __pyx_v_computeType, ((cusparseSpGEAMAlg_t)__pyx_v_alg), ((cusparseSpGEAMDescr_t)__pyx_v_spgeamDescr), ((void *)__pyx_v_externalBuffer));

  /* "cupy_backends/cuda/libs/cusparse.pyx":5162
 *         <SpMatDescr>matC, computeType, <SpGEAMAlg>alg,
 *         <SpGEAMDescr>spgeamDescr, <void*>externalBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5162, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":5150
 * 
 * 
 * cpdef void spGEAM(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int opA, int opB,
 *         intptr_t alpha, size_t matA, intptr_t beta, size_t matB,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.spGEAM", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_599spGEAM(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_598spGEAM, "spGEAM(intptr_t handle, int opA, int opB, intptr_t alpha, size_t matA, intptr_t beta, size_t matB, size_t matC, DataType computeType, int alg, size_t spgeamDescr, intptr_t externalBuffer) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_599spGEAM(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_t __pyx_v_handle;
  int __pyx_v_opA;
  int __pyx_v_opB;
  intptr_t __pyx_v_alpha;
  size_t __pyx_v_matA;
  intptr_t __pyx_v_beta;
  size_t __pyx_v_matB;
  size_t __pyx_v_matC;
  cudaDataType __pyx_v_computeType;
  int __pyx_v_alg;
  size_t __pyx_v_spgeamDescr;
  intptr_t __pyx_v_externalBuffer;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[12] = {0,0,0,0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("spGEAM (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_opA,&__pyx_mstate_global->__pyx_n_u_opB,&__pyx_mstate_global->__pyx_n_u_alpha,&__pyx_mstate_global->__pyx_n_u_matA,&__pyx_mstate_global->__pyx_n_u_beta,&__pyx_mstate_global->__pyx_n_u_matB,&__pyx_mstate_global->__pyx_n_u_matC,&__pyx_mstate_global->__pyx_n_u_computeType,&__pyx_mstate_global->__pyx_n_u_alg,&__pyx_mstate_global->__pyx_n_u_spgeamDescr,&__pyx_mstate_global->__pyx_n_u_externalBuffer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 5150, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 12:
        values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 5150, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 11:
        values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 5150, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 5150, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 5150, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 5150, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 5150, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 5150, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 5150, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 5150, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 5150, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 5150, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 5150, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "spGEAM", 0) < (0)) __PYX_ERR(0, 5150, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 12; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("spGEAM", 1, 12, 12, i); __PYX_ERR(0, 5150, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 12)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 5150, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 5150, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 5150, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 5150, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 5150, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 5150, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 5150, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 5150, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 5150, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 5150, __pyx_L3_error)
      values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 5150, __pyx_L3_error)
      values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 5150, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 5151, __pyx_L3_error)
    __pyx_v_opA = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_opA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 5151, __pyx_L3_error)
    __pyx_v_opB = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_opB == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 5151, __pyx_L3_error)
    __pyx_v_alpha = PyLong_AsSsize_t(values[3]); if (unlikely((__pyx_v_alpha == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 5152, __pyx_L3_error)
    __pyx_v_matA = __Pyx_PyLong_As_size_t(values[4]); if (unlikely((__pyx_v_matA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 5152, __pyx_L3_error)
    __pyx_v_beta = PyLong_AsSsize_t(values[5]); if (unlikely((__pyx_v_beta == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 5152, __pyx_L3_error)
    __pyx_v_matB = __Pyx_PyLong_As_size_t(values[6]); if (unlikely((__pyx_v_matB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 5152, __pyx_L3_error)
    __pyx_v_matC = __Pyx_PyLong_As_size_t(values[7]); if (unlikely((__pyx_v_matC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 5153, __pyx_L3_error)
    __pyx_v_computeType = __Pyx_PyLong_As_cudaDataType(values[8]); if (unlikely((__pyx_v_computeType == ((cudaDataType)-1)) && PyErr_Occurred())) __PYX_ERR(0, 5153, __pyx_L3_error)
    __pyx_v_alg = __Pyx_PyLong_As_int(values[9]); if (unlikely((__pyx_v_alg == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 5153, __pyx_L3_error)
    __pyx_v_spgeamDescr = __Pyx_PyLong_As_size_t(values[10]); if (unlikely((__pyx_v_spgeamDescr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 5154, __pyx_L3_error)
    __pyx_v_externalBuffer = PyLong_AsSsize_t(values[11]); if (unlikely((__pyx_v_externalBuffer == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 5154, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("spGEAM", 1, 12, 12, __pyx_nargs); __PYX_ERR(0, 5150, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.spGEAM", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_598spGEAM(__pyx_self, __pyx_v_handle, __pyx_v_opA, __pyx_v_opB, __pyx_v_alpha, __pyx_v_matA, __pyx_v_beta, __pyx_v_matB, __pyx_v_matC, __pyx_v_computeType, __pyx_v_alg, __pyx_v_spgeamDescr, __pyx_v_externalBuffer);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_598spGEAM(CYTHON_UNUSED PyObject *__pyx_self, intptr_t __pyx_v_handle, int __pyx_v_opA, int __pyx_v_opB, intptr_t __pyx_v_alpha, size_t __pyx_v_matA, intptr_t __pyx_v_beta, size_t __pyx_v_matB, size_t __pyx_v_matC, cudaDataType __pyx_v_computeType, int __pyx_v_alg, size_t __pyx_v_spgeamDescr, 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("spGEAM", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_spGEAM(__pyx_v_handle, __pyx_v_opA, __pyx_v_opB, __pyx_v_alpha, __pyx_v_matA, __pyx_v_beta, __pyx_v_matB, __pyx_v_matC, __pyx_v_computeType, __pyx_v_alg, __pyx_v_spgeamDescr, __pyx_v_externalBuffer, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 5150, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5150, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":5165
 * 
 * 
 * cpdef void gather(intptr_t handle, size_t vecY, size_t vecX) except *:             # <<<<<<<<<<<<<<
 *     status = cusparseGather(<Handle>handle, <DnVecDescr>vecY, <SpVecDescr>vecX)
 *     check_status(status)
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_601gather(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_gather(intptr_t __pyx_v_handle, size_t __pyx_v_vecY, size_t __pyx_v_vecX, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("gather", 0);

  /* "cupy_backends/cuda/libs/cusparse.pyx":5166
 * 
 * cpdef void gather(intptr_t handle, size_t vecY, size_t vecX) except *:
 *     status = cusparseGather(<Handle>handle, <DnVecDescr>vecY, <SpVecDescr>vecX)             # <<<<<<<<<<<<<<
 *     check_status(status)
 * 
*/
  __pyx_v_status = cusparseGather(((cusparseHandle_t)__pyx_v_handle), ((cusparseDnVecDescr_t)__pyx_v_vecY), ((cusparseSpVecDescr_t)__pyx_v_vecX));

  /* "cupy_backends/cuda/libs/cusparse.pyx":5167
 * cpdef void gather(intptr_t handle, size_t vecY, size_t vecX) except *:
 *     status = cusparseGather(<Handle>handle, <DnVecDescr>vecY, <SpVecDescr>vecX)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef size_t sparseToDense_bufferSize(intptr_t handle, size_t matA,
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5167, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":5165
 * 
 * 
 * cpdef void gather(intptr_t handle, size_t vecY, size_t vecX) except *:             # <<<<<<<<<<<<<<
 *     status = cusparseGather(<Handle>handle, <DnVecDescr>vecY, <SpVecDescr>vecX)
 *     check_status(status)
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.gather", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_601gather(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_600gather, "gather(intptr_t handle, size_t vecY, size_t vecX) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_601gather(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_t __pyx_v_handle;
  size_t __pyx_v_vecY;
  size_t __pyx_v_vecX;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("gather (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_vecY,&__pyx_mstate_global->__pyx_n_u_vecX,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 5165, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 5165, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 5165, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 5165, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "gather", 0) < (0)) __PYX_ERR(0, 5165, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("gather", 1, 3, 3, i); __PYX_ERR(0, 5165, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 5165, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 5165, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 5165, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 5165, __pyx_L3_error)
    __pyx_v_vecY = __Pyx_PyLong_As_size_t(values[1]); if (unlikely((__pyx_v_vecY == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 5165, __pyx_L3_error)
    __pyx_v_vecX = __Pyx_PyLong_As_size_t(values[2]); if (unlikely((__pyx_v_vecX == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 5165, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("gather", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 5165, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.gather", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_600gather(__pyx_self, __pyx_v_handle, __pyx_v_vecY, __pyx_v_vecX);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_600gather(CYTHON_UNUSED PyObject *__pyx_self, intptr_t __pyx_v_handle, size_t __pyx_v_vecY, size_t __pyx_v_vecX) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("gather", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_gather(__pyx_v_handle, __pyx_v_vecY, __pyx_v_vecX, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 5165, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5165, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":5169
 *     check_status(status)
 * 
 * cpdef size_t sparseToDense_bufferSize(intptr_t handle, size_t matA,             # <<<<<<<<<<<<<<
 *                                       size_t matB, int alg) except? -1:
 *     cdef size_t bufferSize
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_603sparseToDense_bufferSize(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static size_t __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_sparseToDense_bufferSize(intptr_t __pyx_v_handle, size_t __pyx_v_matA, size_t __pyx_v_matB, int __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("sparseToDense_bufferSize", 0);

  /* "cupy_backends/cuda/libs/cusparse.pyx":5172
 *                                       size_t matB, int alg) except? -1:
 *     cdef size_t bufferSize
 *     status = cusparseSparseToDense_bufferSize(             # <<<<<<<<<<<<<<
 *         <Handle>handle, <SpMatDescr>matA, <DnMatDescr>matB,
 *         <cusparseSparseToDenseAlg_t>alg, &bufferSize)
*/
  __pyx_v_status = __pyx_v_13cupy_backends_4cuda_4libs_8cusparse_cusparseSparseToDense_bufferSize(((cusparseHandle_t)__pyx_v_handle), ((cusparseSpMatDescr_t)__pyx_v_matA), ((cusparseDnMatDescr_t)__pyx_v_matB), ((cusparseSparseToDenseAlg_t)__pyx_v_alg), (&__pyx_v_bufferSize));

  /* "cupy_backends/cuda/libs/cusparse.pyx":5175
 *         <Handle>handle, <SpMatDescr>matA, <DnMatDescr>matB,
 *         <cusparseSparseToDenseAlg_t>alg, &bufferSize)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return bufferSize
 * 
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5175, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":5176
 *         <cusparseSparseToDenseAlg_t>alg, &bufferSize)
 *     check_status(status)
 *     return bufferSize             # <<<<<<<<<<<<<<
 * 
 * cpdef void sparseToDense(
*/
  __pyx_r = __pyx_v_bufferSize;
  goto __pyx_L0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":5169
 *     check_status(status)
 * 
 * cpdef size_t sparseToDense_bufferSize(intptr_t handle, size_t matA,             # <<<<<<<<<<<<<<
 *                                       size_t matB, int alg) except? -1:
 *     cdef size_t bufferSize
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.sparseToDense_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1L;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_603sparseToDense_bufferSize(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_602sparseToDense_bufferSize, "sparseToDense_bufferSize(intptr_t handle, size_t matA, size_t matB, int alg) -> size_t");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_603sparseToDense_bufferSize(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_t __pyx_v_handle;
  size_t __pyx_v_matA;
  size_t __pyx_v_matB;
  int __pyx_v_alg;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[4] = {0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("sparseToDense_bufferSize (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_matA,&__pyx_mstate_global->__pyx_n_u_matB,&__pyx_mstate_global->__pyx_n_u_alg,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 5169, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 5169, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 5169, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 5169, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 5169, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "sparseToDense_bufferSize", 0) < (0)) __PYX_ERR(0, 5169, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 4; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("sparseToDense_bufferSize", 1, 4, 4, i); __PYX_ERR(0, 5169, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 4)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 5169, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 5169, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 5169, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 5169, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 5169, __pyx_L3_error)
    __pyx_v_matA = __Pyx_PyLong_As_size_t(values[1]); if (unlikely((__pyx_v_matA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 5169, __pyx_L3_error)
    __pyx_v_matB = __Pyx_PyLong_As_size_t(values[2]); if (unlikely((__pyx_v_matB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 5170, __pyx_L3_error)
    __pyx_v_alg = __Pyx_PyLong_As_int(values[3]); if (unlikely((__pyx_v_alg == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 5170, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("sparseToDense_bufferSize", 1, 4, 4, __pyx_nargs); __PYX_ERR(0, 5169, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.sparseToDense_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_602sparseToDense_bufferSize(__pyx_self, __pyx_v_handle, __pyx_v_matA, __pyx_v_matB, __pyx_v_alg);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_602sparseToDense_bufferSize(CYTHON_UNUSED PyObject *__pyx_self, intptr_t __pyx_v_handle, size_t __pyx_v_matA, size_t __pyx_v_matB, int __pyx_v_alg) {
  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("sparseToDense_bufferSize", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_sparseToDense_bufferSize(__pyx_v_handle, __pyx_v_matA, __pyx_v_matB, __pyx_v_alg, 1); if (unlikely(__pyx_t_1 == ((size_t)-1L) && PyErr_Occurred())) __PYX_ERR(0, 5169, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyLong_FromSize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5169, __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_backends.cuda.libs.cusparse.sparseToDense_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy_backends/cuda/libs/cusparse.pyx":5178
 *     return bufferSize
 * 
 * cpdef void sparseToDense(             # <<<<<<<<<<<<<<
 *         intptr_t handle, size_t matA, size_t matB, int alg,
 *         intptr_t buffer) except *:
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_605sparseToDense(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_sparseToDense(intptr_t __pyx_v_handle, size_t __pyx_v_matA, size_t __pyx_v_matB, int __pyx_v_alg, intptr_t __pyx_v_buffer, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("sparseToDense", 0);

  /* "cupy_backends/cuda/libs/cusparse.pyx":5181
 *         intptr_t handle, size_t matA, size_t matB, int alg,
 *         intptr_t buffer) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     status = cusparseSparseToDense(
 *         <Handle>handle, <SpMatDescr>matA, <DnMatDescr>matB,
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 5181, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":5182
 *         intptr_t buffer) except *:
 *     _setStream(handle)
 *     status = cusparseSparseToDense(             # <<<<<<<<<<<<<<
 *         <Handle>handle, <SpMatDescr>matA, <DnMatDescr>matB,
 *         <cusparseSparseToDenseAlg_t>alg, <void*>buffer)
*/
  __pyx_v_status = __pyx_v_13cupy_backends_4cuda_4libs_8cusparse_cusparseSparseToDense(((cusparseHandle_t)__pyx_v_handle), ((cusparseSpMatDescr_t)__pyx_v_matA), ((cusparseDnMatDescr_t)__pyx_v_matB), ((cusparseSparseToDenseAlg_t)__pyx_v_alg), ((void *)__pyx_v_buffer));

  /* "cupy_backends/cuda/libs/cusparse.pyx":5185
 *         <Handle>handle, <SpMatDescr>matA, <DnMatDescr>matB,
 *         <cusparseSparseToDenseAlg_t>alg, <void*>buffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef size_t denseToSparse_bufferSize(intptr_t handle, size_t matA,
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5185, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":5178
 *     return bufferSize
 * 
 * cpdef void sparseToDense(             # <<<<<<<<<<<<<<
 *         intptr_t handle, size_t matA, size_t matB, int alg,
 *         intptr_t buffer) except *:
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.sparseToDense", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_605sparseToDense(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_604sparseToDense, "sparseToDense(intptr_t handle, size_t matA, size_t matB, int alg, intptr_t buffer) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_605sparseToDense(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_t __pyx_v_handle;
  size_t __pyx_v_matA;
  size_t __pyx_v_matB;
  int __pyx_v_alg;
  intptr_t __pyx_v_buffer;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[5] = {0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("sparseToDense (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_matA,&__pyx_mstate_global->__pyx_n_u_matB,&__pyx_mstate_global->__pyx_n_u_alg,&__pyx_mstate_global->__pyx_n_u_buffer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 5178, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 5178, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 5178, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 5178, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 5178, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 5178, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "sparseToDense", 0) < (0)) __PYX_ERR(0, 5178, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 5; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("sparseToDense", 1, 5, 5, i); __PYX_ERR(0, 5178, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 5)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 5178, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 5178, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 5178, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 5178, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 5178, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 5179, __pyx_L3_error)
    __pyx_v_matA = __Pyx_PyLong_As_size_t(values[1]); if (unlikely((__pyx_v_matA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 5179, __pyx_L3_error)
    __pyx_v_matB = __Pyx_PyLong_As_size_t(values[2]); if (unlikely((__pyx_v_matB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 5179, __pyx_L3_error)
    __pyx_v_alg = __Pyx_PyLong_As_int(values[3]); if (unlikely((__pyx_v_alg == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 5179, __pyx_L3_error)
    __pyx_v_buffer = PyLong_AsSsize_t(values[4]); if (unlikely((__pyx_v_buffer == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 5180, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("sparseToDense", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 5178, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.sparseToDense", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_604sparseToDense(__pyx_self, __pyx_v_handle, __pyx_v_matA, __pyx_v_matB, __pyx_v_alg, __pyx_v_buffer);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_604sparseToDense(CYTHON_UNUSED PyObject *__pyx_self, intptr_t __pyx_v_handle, size_t __pyx_v_matA, size_t __pyx_v_matB, int __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("sparseToDense", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_sparseToDense(__pyx_v_handle, __pyx_v_matA, __pyx_v_matB, __pyx_v_alg, __pyx_v_buffer, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 5178, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5178, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":5187
 *     check_status(status)
 * 
 * cpdef size_t denseToSparse_bufferSize(intptr_t handle, size_t matA,             # <<<<<<<<<<<<<<
 *                                       size_t matB, int alg) except? -1:
 *     cdef size_t bufferSize
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_607denseToSparse_bufferSize(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static size_t __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_denseToSparse_bufferSize(intptr_t __pyx_v_handle, size_t __pyx_v_matA, size_t __pyx_v_matB, int __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("denseToSparse_bufferSize", 0);

  /* "cupy_backends/cuda/libs/cusparse.pyx":5190
 *                                       size_t matB, int alg) except? -1:
 *     cdef size_t bufferSize
 *     status = cusparseDenseToSparse_bufferSize(             # <<<<<<<<<<<<<<
 *         <Handle>handle, <DnMatDescr>matA, <SpMatDescr>matB,
 *         <cusparseDenseToSparseAlg_t>alg, &bufferSize)
*/
  __pyx_v_status = __pyx_v_13cupy_backends_4cuda_4libs_8cusparse_cusparseDenseToSparse_bufferSize(((cusparseHandle_t)__pyx_v_handle), ((cusparseDnMatDescr_t)__pyx_v_matA), ((cusparseSpMatDescr_t)__pyx_v_matB), ((cusparseDenseToSparseAlg_t)__pyx_v_alg), (&__pyx_v_bufferSize));

  /* "cupy_backends/cuda/libs/cusparse.pyx":5193
 *         <Handle>handle, <DnMatDescr>matA, <SpMatDescr>matB,
 *         <cusparseDenseToSparseAlg_t>alg, &bufferSize)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return bufferSize
 * 
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5193, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":5194
 *         <cusparseDenseToSparseAlg_t>alg, &bufferSize)
 *     check_status(status)
 *     return bufferSize             # <<<<<<<<<<<<<<
 * 
 * cpdef void denseToSparse_analysis(
*/
  __pyx_r = __pyx_v_bufferSize;
  goto __pyx_L0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":5187
 *     check_status(status)
 * 
 * cpdef size_t denseToSparse_bufferSize(intptr_t handle, size_t matA,             # <<<<<<<<<<<<<<
 *                                       size_t matB, int alg) except? -1:
 *     cdef size_t bufferSize
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.denseToSparse_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1L;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_607denseToSparse_bufferSize(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_606denseToSparse_bufferSize, "denseToSparse_bufferSize(intptr_t handle, size_t matA, size_t matB, int alg) -> size_t");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_607denseToSparse_bufferSize(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_t __pyx_v_handle;
  size_t __pyx_v_matA;
  size_t __pyx_v_matB;
  int __pyx_v_alg;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[4] = {0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("denseToSparse_bufferSize (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_matA,&__pyx_mstate_global->__pyx_n_u_matB,&__pyx_mstate_global->__pyx_n_u_alg,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 5187, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 5187, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 5187, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 5187, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 5187, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "denseToSparse_bufferSize", 0) < (0)) __PYX_ERR(0, 5187, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 4; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("denseToSparse_bufferSize", 1, 4, 4, i); __PYX_ERR(0, 5187, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 4)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 5187, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 5187, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 5187, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 5187, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 5187, __pyx_L3_error)
    __pyx_v_matA = __Pyx_PyLong_As_size_t(values[1]); if (unlikely((__pyx_v_matA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 5187, __pyx_L3_error)
    __pyx_v_matB = __Pyx_PyLong_As_size_t(values[2]); if (unlikely((__pyx_v_matB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 5188, __pyx_L3_error)
    __pyx_v_alg = __Pyx_PyLong_As_int(values[3]); if (unlikely((__pyx_v_alg == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 5188, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("denseToSparse_bufferSize", 1, 4, 4, __pyx_nargs); __PYX_ERR(0, 5187, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.denseToSparse_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_606denseToSparse_bufferSize(__pyx_self, __pyx_v_handle, __pyx_v_matA, __pyx_v_matB, __pyx_v_alg);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_606denseToSparse_bufferSize(CYTHON_UNUSED PyObject *__pyx_self, intptr_t __pyx_v_handle, size_t __pyx_v_matA, size_t __pyx_v_matB, int __pyx_v_alg) {
  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("denseToSparse_bufferSize", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_denseToSparse_bufferSize(__pyx_v_handle, __pyx_v_matA, __pyx_v_matB, __pyx_v_alg, 1); if (unlikely(__pyx_t_1 == ((size_t)-1L) && PyErr_Occurred())) __PYX_ERR(0, 5187, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyLong_FromSize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5187, __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_backends.cuda.libs.cusparse.denseToSparse_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy_backends/cuda/libs/cusparse.pyx":5196
 *     return bufferSize
 * 
 * cpdef void denseToSparse_analysis(             # <<<<<<<<<<<<<<
 *         intptr_t handle, size_t matA, size_t matB,
 *         int alg, intptr_t buffer) except *:
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_609denseToSparse_analysis(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_denseToSparse_analysis(intptr_t __pyx_v_handle, size_t __pyx_v_matA, size_t __pyx_v_matB, int __pyx_v_alg, intptr_t __pyx_v_buffer, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("denseToSparse_analysis", 0);

  /* "cupy_backends/cuda/libs/cusparse.pyx":5199
 *         intptr_t handle, size_t matA, size_t matB,
 *         int alg, intptr_t buffer) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     status = cusparseDenseToSparse_analysis(
 *         <Handle>handle, <DnMatDescr>matA, <SpMatDescr>matB,
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 5199, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":5200
 *         int alg, intptr_t buffer) except *:
 *     _setStream(handle)
 *     status = cusparseDenseToSparse_analysis(             # <<<<<<<<<<<<<<
 *         <Handle>handle, <DnMatDescr>matA, <SpMatDescr>matB,
 *         <cusparseDenseToSparseAlg_t>alg, <void*>buffer)
*/
  __pyx_v_status = __pyx_v_13cupy_backends_4cuda_4libs_8cusparse_cusparseDenseToSparse_analysis(((cusparseHandle_t)__pyx_v_handle), ((cusparseDnMatDescr_t)__pyx_v_matA), ((cusparseSpMatDescr_t)__pyx_v_matB), ((cusparseDenseToSparseAlg_t)__pyx_v_alg), ((void *)__pyx_v_buffer));

  /* "cupy_backends/cuda/libs/cusparse.pyx":5203
 *         <Handle>handle, <DnMatDescr>matA, <SpMatDescr>matB,
 *         <cusparseDenseToSparseAlg_t>alg, <void*>buffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef void denseToSparse_convert(
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5203, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":5196
 *     return bufferSize
 * 
 * cpdef void denseToSparse_analysis(             # <<<<<<<<<<<<<<
 *         intptr_t handle, size_t matA, size_t matB,
 *         int alg, intptr_t buffer) except *:
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.denseToSparse_analysis", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_609denseToSparse_analysis(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_608denseToSparse_analysis, "denseToSparse_analysis(intptr_t handle, size_t matA, size_t matB, int alg, intptr_t buffer) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_609denseToSparse_analysis(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_t __pyx_v_handle;
  size_t __pyx_v_matA;
  size_t __pyx_v_matB;
  int __pyx_v_alg;
  intptr_t __pyx_v_buffer;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[5] = {0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("denseToSparse_analysis (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_matA,&__pyx_mstate_global->__pyx_n_u_matB,&__pyx_mstate_global->__pyx_n_u_alg,&__pyx_mstate_global->__pyx_n_u_buffer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 5196, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 5196, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 5196, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 5196, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 5196, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 5196, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "denseToSparse_analysis", 0) < (0)) __PYX_ERR(0, 5196, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 5; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("denseToSparse_analysis", 1, 5, 5, i); __PYX_ERR(0, 5196, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 5)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 5196, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 5196, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 5196, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 5196, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 5196, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 5197, __pyx_L3_error)
    __pyx_v_matA = __Pyx_PyLong_As_size_t(values[1]); if (unlikely((__pyx_v_matA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 5197, __pyx_L3_error)
    __pyx_v_matB = __Pyx_PyLong_As_size_t(values[2]); if (unlikely((__pyx_v_matB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 5197, __pyx_L3_error)
    __pyx_v_alg = __Pyx_PyLong_As_int(values[3]); if (unlikely((__pyx_v_alg == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 5198, __pyx_L3_error)
    __pyx_v_buffer = PyLong_AsSsize_t(values[4]); if (unlikely((__pyx_v_buffer == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 5198, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("denseToSparse_analysis", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 5196, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.denseToSparse_analysis", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_608denseToSparse_analysis(__pyx_self, __pyx_v_handle, __pyx_v_matA, __pyx_v_matB, __pyx_v_alg, __pyx_v_buffer);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_608denseToSparse_analysis(CYTHON_UNUSED PyObject *__pyx_self, intptr_t __pyx_v_handle, size_t __pyx_v_matA, size_t __pyx_v_matB, int __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("denseToSparse_analysis", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_denseToSparse_analysis(__pyx_v_handle, __pyx_v_matA, __pyx_v_matB, __pyx_v_alg, __pyx_v_buffer, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 5196, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5196, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":5205
 *     check_status(status)
 * 
 * cpdef void denseToSparse_convert(             # <<<<<<<<<<<<<<
 *         intptr_t handle, size_t matA, size_t matB,
 *         int alg, intptr_t buffer) except *:
*/

static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_611denseToSparse_convert(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_denseToSparse_convert(intptr_t __pyx_v_handle, size_t __pyx_v_matA, size_t __pyx_v_matB, int __pyx_v_alg, intptr_t __pyx_v_buffer, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("denseToSparse_convert", 0);

  /* "cupy_backends/cuda/libs/cusparse.pyx":5208
 *         intptr_t handle, size_t matA, size_t matB,
 *         int alg, intptr_t buffer) except *:
 *     _setStream(handle)             # <<<<<<<<<<<<<<
 *     status = cusparseDenseToSparse_convert(
 *         <Handle>handle, <DnMatDescr>matA, <SpMatDescr>matB,
*/
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse__setStream(__pyx_v_handle); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 5208, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":5209
 *         int alg, intptr_t buffer) except *:
 *     _setStream(handle)
 *     status = cusparseDenseToSparse_convert(             # <<<<<<<<<<<<<<
 *         <Handle>handle, <DnMatDescr>matA, <SpMatDescr>matB,
 *         <cusparseDenseToSparseAlg_t>alg, <void*>buffer)
*/
  __pyx_v_status = __pyx_v_13cupy_backends_4cuda_4libs_8cusparse_cusparseDenseToSparse_convert(((cusparseHandle_t)__pyx_v_handle), ((cusparseDnMatDescr_t)__pyx_v_matA), ((cusparseSpMatDescr_t)__pyx_v_matB), ((cusparseDenseToSparseAlg_t)__pyx_v_alg), ((void *)__pyx_v_buffer));

  /* "cupy_backends/cuda/libs/cusparse.pyx":5212
 *         <Handle>handle, <DnMatDescr>matA, <SpMatDescr>matB,
 *         <cusparseDenseToSparseAlg_t>alg, <void*>buffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * # CSR2CSC
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5212, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":5205
 *     check_status(status)
 * 
 * cpdef void denseToSparse_convert(             # <<<<<<<<<<<<<<
 *         intptr_t handle, size_t matA, size_t matB,
 *         int alg, intptr_t buffer) except *:
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.denseToSparse_convert", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_611denseToSparse_convert(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_610denseToSparse_convert, "denseToSparse_convert(intptr_t handle, size_t matA, size_t matB, int alg, intptr_t buffer) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_611denseToSparse_convert(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  intptr_t __pyx_v_handle;
  size_t __pyx_v_matA;
  size_t __pyx_v_matB;
  int __pyx_v_alg;
  intptr_t __pyx_v_buffer;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[5] = {0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("denseToSparse_convert (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_matA,&__pyx_mstate_global->__pyx_n_u_matB,&__pyx_mstate_global->__pyx_n_u_alg,&__pyx_mstate_global->__pyx_n_u_buffer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 5205, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 5205, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 5205, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 5205, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 5205, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 5205, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "denseToSparse_convert", 0) < (0)) __PYX_ERR(0, 5205, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 5; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("denseToSparse_convert", 1, 5, 5, i); __PYX_ERR(0, 5205, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 5)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 5205, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 5205, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 5205, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 5205, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 5205, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 5206, __pyx_L3_error)
    __pyx_v_matA = __Pyx_PyLong_As_size_t(values[1]); if (unlikely((__pyx_v_matA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 5206, __pyx_L3_error)
    __pyx_v_matB = __Pyx_PyLong_As_size_t(values[2]); if (unlikely((__pyx_v_matB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 5206, __pyx_L3_error)
    __pyx_v_alg = __Pyx_PyLong_As_int(values[3]); if (unlikely((__pyx_v_alg == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 5207, __pyx_L3_error)
    __pyx_v_buffer = PyLong_AsSsize_t(values[4]); if (unlikely((__pyx_v_buffer == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 5207, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("denseToSparse_convert", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 5205, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.denseToSparse_convert", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_610denseToSparse_convert(__pyx_self, __pyx_v_handle, __pyx_v_matA, __pyx_v_matB, __pyx_v_alg, __pyx_v_buffer);

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

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_610denseToSparse_convert(CYTHON_UNUSED PyObject *__pyx_self, intptr_t __pyx_v_handle, size_t __pyx_v_matA, size_t __pyx_v_matB, int __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("denseToSparse_convert", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_denseToSparse_convert(__pyx_v_handle, __pyx_v_matA, __pyx_v_matB, __pyx_v_alg, __pyx_v_buffer, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 5205, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5205, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cupy_backends/cuda/libs/cusparse.pyx":5215
 * 
 * # 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_13cupy_backends_4cuda_4libs_8cusparse_613csr2cscEx2_bufferSize(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static size_t __pyx_f_13cupy_backends_4cuda_4libs_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_backends/cuda/libs/cusparse.pyx":5221
 *         Action copyValues, IndexBase idxBase, Csr2CscAlg alg) except? -1:
 *     cdef 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_backends/cuda/libs/cusparse.pyx":5225
 *         <const int*>csrColInd, <void*>cscVal, <int*>cscColPtr, <int*>cscRowInd,
 *         valType, copyValues, idxBase, alg, &bufferSize)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return bufferSize
 * 
*/
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5225, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":5226
 *         valType, copyValues, idxBase, alg, &bufferSize)
 *     check_status(status)
 *     return bufferSize             # <<<<<<<<<<<<<<
 * 
 * cpdef void csr2cscEx2(
*/
  __pyx_r = __pyx_v_bufferSize;
  goto __pyx_L0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":5215
 * 
 * # 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_AddTraceback("cupy_backends.cuda.libs.cusparse.csr2cscEx2_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1L;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_613csr2cscEx2_bufferSize(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_612csr2cscEx2_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_13cupy_backends_4cuda_4libs_8cusparse_613csr2cscEx2_bufferSize(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[14] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0};
  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);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_n,&__pyx_mstate_global->__pyx_n_u_nnz,&__pyx_mstate_global->__pyx_n_u_csrVal,&__pyx_mstate_global->__pyx_n_u_csrRowPtr,&__pyx_mstate_global->__pyx_n_u_csrColInd,&__pyx_mstate_global->__pyx_n_u_cscVal,&__pyx_mstate_global->__pyx_n_u_cscColPtr,&__pyx_mstate_global->__pyx_n_u_cscRowInd,&__pyx_mstate_global->__pyx_n_u_valType,&__pyx_mstate_global->__pyx_n_u_copyValues,&__pyx_mstate_global->__pyx_n_u_idxBase,&__pyx_mstate_global->__pyx_n_u_alg,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 5215, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 14:
        values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 5215, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 13:
        values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 5215, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 12:
        values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 5215, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 11:
        values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 5215, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 5215, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 5215, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 5215, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 5215, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 5215, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 5215, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 5215, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 5215, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 5215, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 5215, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "csr2cscEx2_bufferSize", 0) < (0)) __PYX_ERR(0, 5215, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 14; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("csr2cscEx2_bufferSize", 1, 14, 14, i); __PYX_ERR(0, 5215, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 14)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 5215, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 5215, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 5215, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 5215, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 5215, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 5215, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 5215, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 5215, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 5215, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 5215, __pyx_L3_error)
      values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 5215, __pyx_L3_error)
      values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 5215, __pyx_L3_error)
      values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 5215, __pyx_L3_error)
      values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 5215, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 5216, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 5216, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 5216, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyLong_As_int(values[3]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 5216, __pyx_L3_error)
    __pyx_v_csrVal = PyLong_AsSsize_t(values[4]); if (unlikely((__pyx_v_csrVal == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 5216, __pyx_L3_error)
    __pyx_v_csrRowPtr = PyLong_AsSsize_t(values[5]); if (unlikely((__pyx_v_csrRowPtr == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 5217, __pyx_L3_error)
    __pyx_v_csrColInd = PyLong_AsSsize_t(values[6]); if (unlikely((__pyx_v_csrColInd == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 5217, __pyx_L3_error)
    __pyx_v_cscVal = PyLong_AsSsize_t(values[7]); if (unlikely((__pyx_v_cscVal == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 5217, __pyx_L3_error)
    __pyx_v_cscColPtr = PyLong_AsSsize_t(values[8]); if (unlikely((__pyx_v_cscColPtr == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 5218, __pyx_L3_error)
    __pyx_v_cscRowInd = PyLong_AsSsize_t(values[9]); if (unlikely((__pyx_v_cscRowInd == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 5218, __pyx_L3_error)
    __pyx_v_valType = __Pyx_PyLong_As_cudaDataType(values[10]); if (unlikely((__pyx_v_valType == ((cudaDataType)-1)) && PyErr_Occurred())) __PYX_ERR(0, 5218, __pyx_L3_error)
    __pyx_v_copyValues = __Pyx_PyLong_As_cusparseAction_t(values[11]); if (unlikely((__pyx_v_copyValues == ((cusparseAction_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 5219, __pyx_L3_error)
    __pyx_v_idxBase = __Pyx_PyLong_As_cusparseIndexBase_t(values[12]); if (unlikely((__pyx_v_idxBase == ((cusparseIndexBase_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 5219, __pyx_L3_error)
    __pyx_v_alg = __Pyx_PyLong_As_cusparseCsr2CscAlg_t(values[13]); if (unlikely((__pyx_v_alg == ((cusparseCsr2CscAlg_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 5219, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("csr2cscEx2_bufferSize", 1, 14, 14, __pyx_nargs); __PYX_ERR(0, 5215, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.csr2cscEx2_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_612csr2cscEx2_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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_612csr2cscEx2_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
  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("csr2cscEx2_bufferSize", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(__pyx_t_1 == ((size_t)-1L) && PyErr_Occurred())) __PYX_ERR(0, 5215, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyLong_FromSize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5215, __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_backends.cuda.libs.cusparse.csr2cscEx2_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy_backends/cuda/libs/cusparse.pyx":5228
 *     return bufferSize
 * 
 * cpdef void 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_13cupy_backends_4cuda_4libs_8cusparse_615csr2cscEx2(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_13cupy_backends_4cuda_4libs_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;
  __Pyx_RefNannyDeclarations
  intptr_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("csr2cscEx2", 0);

  /* "cupy_backends/cuda/libs/cusparse.pyx":5234
 *         Action copyValues, IndexBase idxBase, Csr2CscAlg alg,
 *         intptr_t buffer) except *:
 *     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_13cupy_backends_4cuda_6stream_get_current_stream_ptr(); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 5234, __pyx_L1_error)
  __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_setStream(__pyx_v_handle, __pyx_t_1, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 5234, __pyx_L1_error)

  /* "cupy_backends/cuda/libs/cusparse.pyx":5235
 *         intptr_t buffer) except *:
 *     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_backends/cuda/libs/cusparse.pyx":5239
 *         <const int*>csrColInd, <void*>cscVal, <int*>cscColPtr, <int*>cscRowInd,
 *         valType, copyValues, idxBase, alg, <void*>buffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
*/
  __pyx_t_2 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5239, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":5228
 *     return bufferSize
 * 
 * cpdef void 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 */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.csr2cscEx2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_615csr2cscEx2(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_614csr2cscEx2, "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) -> void");
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_615csr2cscEx2(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[15] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("csr2cscEx2 (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_n,&__pyx_mstate_global->__pyx_n_u_nnz,&__pyx_mstate_global->__pyx_n_u_csrVal,&__pyx_mstate_global->__pyx_n_u_csrRowPtr,&__pyx_mstate_global->__pyx_n_u_csrColInd,&__pyx_mstate_global->__pyx_n_u_cscVal,&__pyx_mstate_global->__pyx_n_u_cscColPtr,&__pyx_mstate_global->__pyx_n_u_cscRowInd,&__pyx_mstate_global->__pyx_n_u_valType,&__pyx_mstate_global->__pyx_n_u_copyValues,&__pyx_mstate_global->__pyx_n_u_idxBase,&__pyx_mstate_global->__pyx_n_u_alg,&__pyx_mstate_global->__pyx_n_u_buffer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 5228, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 15:
        values[14] = __Pyx_ArgRef_FASTCALL(__pyx_args, 14);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 5228, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 14:
        values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 5228, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 13:
        values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 5228, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 12:
        values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 5228, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 11:
        values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 5228, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 5228, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 5228, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 5228, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 5228, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 5228, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 5228, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 5228, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 5228, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 5228, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 5228, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "csr2cscEx2", 0) < (0)) __PYX_ERR(0, 5228, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 15; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("csr2cscEx2", 1, 15, 15, i); __PYX_ERR(0, 5228, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 15)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 5228, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 5228, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 5228, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 5228, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 5228, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 5228, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 5228, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 5228, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 5228, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 5228, __pyx_L3_error)
      values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 5228, __pyx_L3_error)
      values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 5228, __pyx_L3_error)
      values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 5228, __pyx_L3_error)
      values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 5228, __pyx_L3_error)
      values[14] = __Pyx_ArgRef_FASTCALL(__pyx_args, 14);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 5228, __pyx_L3_error)
    }
    __pyx_v_handle = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 5229, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 5229, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 5229, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyLong_As_int(values[3]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 5229, __pyx_L3_error)
    __pyx_v_csrVal = PyLong_AsSsize_t(values[4]); if (unlikely((__pyx_v_csrVal == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 5229, __pyx_L3_error)
    __pyx_v_csrRowPtr = PyLong_AsSsize_t(values[5]); if (unlikely((__pyx_v_csrRowPtr == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 5230, __pyx_L3_error)
    __pyx_v_csrColInd = PyLong_AsSsize_t(values[6]); if (unlikely((__pyx_v_csrColInd == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 5230, __pyx_L3_error)
    __pyx_v_cscVal = PyLong_AsSsize_t(values[7]); if (unlikely((__pyx_v_cscVal == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 5230, __pyx_L3_error)
    __pyx_v_cscColPtr = PyLong_AsSsize_t(values[8]); if (unlikely((__pyx_v_cscColPtr == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 5231, __pyx_L3_error)
    __pyx_v_cscRowInd = PyLong_AsSsize_t(values[9]); if (unlikely((__pyx_v_cscRowInd == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 5231, __pyx_L3_error)
    __pyx_v_valType = __Pyx_PyLong_As_cudaDataType(values[10]); if (unlikely((__pyx_v_valType == ((cudaDataType)-1)) && PyErr_Occurred())) __PYX_ERR(0, 5231, __pyx_L3_error)
    __pyx_v_copyValues = __Pyx_PyLong_As_cusparseAction_t(values[11]); if (unlikely((__pyx_v_copyValues == ((cusparseAction_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 5232, __pyx_L3_error)
    __pyx_v_idxBase = __Pyx_PyLong_As_cusparseIndexBase_t(values[12]); if (unlikely((__pyx_v_idxBase == ((cusparseIndexBase_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 5232, __pyx_L3_error)
    __pyx_v_alg = __Pyx_PyLong_As_cusparseCsr2CscAlg_t(values[13]); if (unlikely((__pyx_v_alg == ((cusparseCsr2CscAlg_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 5232, __pyx_L3_error)
    __pyx_v_buffer = PyLong_AsSsize_t(values[14]); if (unlikely((__pyx_v_buffer == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 5233, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("csr2cscEx2", 1, 15, 15, __pyx_nargs); __PYX_ERR(0, 5228, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.csr2cscEx2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_614csr2cscEx2(__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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_614csr2cscEx2(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_f_13cupy_backends_4cuda_4libs_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, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 5228, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5228, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "(tree fragment)":4
 *     int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1
 *     int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1
 * def __pyx_unpickle_SpVecAttributes(__pyx_type, long __pyx_checksum, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xb0bf926, 0x397dff7, 0x7f92e3a, b'idx, idxBase, idxType, nnz, size, valueType, values')
*/

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_617__pyx_unpickle_SpVecAttributes(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_616__pyx_unpickle_SpVecAttributes, "__pyx_unpickle_SpVecAttributes(__pyx_type, long __pyx_checksum, tuple __pyx_state)");
static PyMethodDef __pyx_mdef_13cupy_backends_4cuda_4libs_8cusparse_617__pyx_unpickle_SpVecAttributes = {"__pyx_unpickle_SpVecAttributes", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_617__pyx_unpickle_SpVecAttributes, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_616__pyx_unpickle_SpVecAttributes};
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_617__pyx_unpickle_SpVecAttributes(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v___pyx_type = 0;
  long __pyx_v___pyx_checksum;
  PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,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);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_type,&__pyx_mstate_global->__pyx_n_u_pyx_checksum,&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(2, 4, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(2, 4, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(2, 4, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(2, 4, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__pyx_unpickle_SpVecAttributes", 0) < (0)) __PYX_ERR(2, 4, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_SpVecAttributes", 1, 3, 3, i); __PYX_ERR(2, 4, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(2, 4, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(2, 4, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(2, 4, __pyx_L3_error)
    }
    __pyx_v___pyx_type = values[0];
    __pyx_v___pyx_checksum = __Pyx_PyLong_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(2, 4, __pyx_L3_error)
    __pyx_v___pyx_state = ((PyObject*)values[2]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_SpVecAttributes", 1, 3, 3, __pyx_nargs); __PYX_ERR(2, 4, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.__pyx_unpickle_SpVecAttributes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v___pyx_state), (&PyTuple_Type), 1, "__pyx_state", 1))) __PYX_ERR(2, 4, __pyx_L1_error)
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_616__pyx_unpickle_SpVecAttributes(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_616__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_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_unpickle_SpVecAttributes", 0);

  /* "(tree fragment)":6
 * def __pyx_unpickle_SpVecAttributes(__pyx_type, long __pyx_checksum, tuple __pyx_state):
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xb0bf926, 0x397dff7, 0x7f92e3a, b'idx, idxBase, idxType, nnz, size, valueType, values')             # <<<<<<<<<<<<<<
 *     __pyx_result = SpVecAttributes.__new__(__pyx_type)
 *     if __pyx_state is not None:
*/
  __pyx_t_1 = __Pyx_CheckUnpickleChecksum(__pyx_v___pyx_checksum, 0xb0bf926, 0x397dff7, 0x7f92e3a, __pyx_k_idx_idxBase_idxType_nnz_size_val); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(2, 6, __pyx_L1_error)

  /* "(tree fragment)":7
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xb0bf926, 0x397dff7, 0x7f92e3a, b'idx, idxBase, idxType, nnz, size, valueType, values')
 *     __pyx_result = SpVecAttributes.__new__(__pyx_type)             # <<<<<<<<<<<<<<
 *     if __pyx_state is not None:
 *         __pyx_unpickle_SpVecAttributes__set_state(<SpVecAttributes> __pyx_result, __pyx_state)
*/
  __pyx_t_3 = ((PyObject *)__pyx_mstate_global->__pyx_ptype_13cupy_backends_4cuda_4libs_8cusparse_SpVecAttributes);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_4 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v___pyx_type};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_new, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_v___pyx_result = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "(tree fragment)":8
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xb0bf926, 0x397dff7, 0x7f92e3a, b'idx, idxBase, idxType, nnz, size, valueType, values')
 *     __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_5 = (__pyx_v___pyx_state != ((PyObject*)Py_None));
  if (__pyx_t_5) {

    /* "(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, __pyx_state: tuple):
*/
    if (unlikely(__pyx_v___pyx_state == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "cannot pass None into a C function argument that is declared 'not None'");
      __PYX_ERR(2, 9, __pyx_L1_error)
    }
    __pyx_t_2 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse___pyx_unpickle_SpVecAttributes__set_state(((struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_SpVecAttributes *)__pyx_v___pyx_result), __pyx_v___pyx_state); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "(tree fragment)":8
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xb0bf926, 0x397dff7, 0x7f92e3a, b'idx, idxBase, idxType, nnz, size, valueType, values')
 *     __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, __pyx_state: tuple):
 *     __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)":4
 *     int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1
 *     int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1
 * def __pyx_unpickle_SpVecAttributes(__pyx_type, long __pyx_checksum, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xb0bf926, 0x397dff7, 0x7f92e3a, b'idx, idxBase, idxType, nnz, size, valueType, values')
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.__pyx_unpickle_SpVecAttributes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __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, __pyx_state: tuple):             # <<<<<<<<<<<<<<
 *     __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_UpdateUnpickledDict(__pyx_result, __pyx_state, 7)
*/

static PyObject *__pyx_f_13cupy_backends_4cuda_4libs_8cusparse___pyx_unpickle_SpVecAttributes__set_state(struct __pyx_obj_13cupy_backends_4cuda_4libs_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;
  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, __pyx_state: tuple):
 *     __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_UpdateUnpickledDict(__pyx_result, __pyx_state, 7)
*/
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyLong_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;
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyLong_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;
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyLong_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;
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 3, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = __Pyx_PyLong_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;
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 4, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = __Pyx_PyLong_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;
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 5, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = __Pyx_PyLong_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;
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 6, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyLong_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, __pyx_state: tuple):
 *     __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_UpdateUnpickledDict(__pyx_result, __pyx_state, 7)             # <<<<<<<<<<<<<<
*/
  __pyx_t_7 = __Pyx_UpdateUnpickledDict(((PyObject *)__pyx_v___pyx_result), __pyx_v___pyx_state, 7); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(2, 13, __pyx_L1_error)

  /* "(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, __pyx_state: tuple):             # <<<<<<<<<<<<<<
 *     __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_UpdateUnpickledDict(__pyx_result, __pyx_state, 7)
*/

  /* 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_backends.cuda.libs.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)":4
 *     int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1
 *     int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1
 * def __pyx_unpickle_CooAttributes(__pyx_type, long __pyx_checksum, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe806e52, 0x436c2de, 0x41fb826, b'colIdx, cols, idxBase, idxType, nnz, rowIdx, rows, valueType, values')
*/

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_619__pyx_unpickle_CooAttributes(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_618__pyx_unpickle_CooAttributes, "__pyx_unpickle_CooAttributes(__pyx_type, long __pyx_checksum, tuple __pyx_state)");
static PyMethodDef __pyx_mdef_13cupy_backends_4cuda_4libs_8cusparse_619__pyx_unpickle_CooAttributes = {"__pyx_unpickle_CooAttributes", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_619__pyx_unpickle_CooAttributes, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_618__pyx_unpickle_CooAttributes};
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_619__pyx_unpickle_CooAttributes(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v___pyx_type = 0;
  long __pyx_v___pyx_checksum;
  PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,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);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_type,&__pyx_mstate_global->__pyx_n_u_pyx_checksum,&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(2, 4, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(2, 4, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(2, 4, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(2, 4, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__pyx_unpickle_CooAttributes", 0) < (0)) __PYX_ERR(2, 4, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_CooAttributes", 1, 3, 3, i); __PYX_ERR(2, 4, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(2, 4, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(2, 4, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(2, 4, __pyx_L3_error)
    }
    __pyx_v___pyx_type = values[0];
    __pyx_v___pyx_checksum = __Pyx_PyLong_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(2, 4, __pyx_L3_error)
    __pyx_v___pyx_state = ((PyObject*)values[2]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_CooAttributes", 1, 3, 3, __pyx_nargs); __PYX_ERR(2, 4, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.__pyx_unpickle_CooAttributes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v___pyx_state), (&PyTuple_Type), 1, "__pyx_state", 1))) __PYX_ERR(2, 4, __pyx_L1_error)
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_618__pyx_unpickle_CooAttributes(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_618__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_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_unpickle_CooAttributes", 0);

  /* "(tree fragment)":6
 * def __pyx_unpickle_CooAttributes(__pyx_type, long __pyx_checksum, tuple __pyx_state):
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe806e52, 0x436c2de, 0x41fb826, b'colIdx, cols, idxBase, idxType, nnz, rowIdx, rows, valueType, values')             # <<<<<<<<<<<<<<
 *     __pyx_result = CooAttributes.__new__(__pyx_type)
 *     if __pyx_state is not None:
*/
  __pyx_t_1 = __Pyx_CheckUnpickleChecksum(__pyx_v___pyx_checksum, 0xe806e52, 0x436c2de, 0x41fb826, __pyx_k_colIdx_cols_idxBase_idxType_nnz); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(2, 6, __pyx_L1_error)

  /* "(tree fragment)":7
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe806e52, 0x436c2de, 0x41fb826, b'colIdx, cols, idxBase, idxType, nnz, rowIdx, rows, valueType, values')
 *     __pyx_result = CooAttributes.__new__(__pyx_type)             # <<<<<<<<<<<<<<
 *     if __pyx_state is not None:
 *         __pyx_unpickle_CooAttributes__set_state(<CooAttributes> __pyx_result, __pyx_state)
*/
  __pyx_t_3 = ((PyObject *)__pyx_mstate_global->__pyx_ptype_13cupy_backends_4cuda_4libs_8cusparse_CooAttributes);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_4 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v___pyx_type};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_new, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_v___pyx_result = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "(tree fragment)":8
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe806e52, 0x436c2de, 0x41fb826, b'colIdx, cols, idxBase, idxType, nnz, rowIdx, rows, valueType, values')
 *     __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_5 = (__pyx_v___pyx_state != ((PyObject*)Py_None));
  if (__pyx_t_5) {

    /* "(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, __pyx_state: tuple):
*/
    if (unlikely(__pyx_v___pyx_state == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "cannot pass None into a C function argument that is declared 'not None'");
      __PYX_ERR(2, 9, __pyx_L1_error)
    }
    __pyx_t_2 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse___pyx_unpickle_CooAttributes__set_state(((struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CooAttributes *)__pyx_v___pyx_result), __pyx_v___pyx_state); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "(tree fragment)":8
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe806e52, 0x436c2de, 0x41fb826, b'colIdx, cols, idxBase, idxType, nnz, rowIdx, rows, valueType, values')
 *     __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, __pyx_state: tuple):
 *     __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)":4
 *     int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1
 *     int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1
 * def __pyx_unpickle_CooAttributes(__pyx_type, long __pyx_checksum, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe806e52, 0x436c2de, 0x41fb826, b'colIdx, cols, idxBase, idxType, nnz, rowIdx, rows, valueType, values')
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.__pyx_unpickle_CooAttributes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __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, __pyx_state: tuple):             # <<<<<<<<<<<<<<
 *     __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_UpdateUnpickledDict(__pyx_result, __pyx_state, 9)
*/

static PyObject *__pyx_f_13cupy_backends_4cuda_4libs_8cusparse___pyx_unpickle_CooAttributes__set_state(struct __pyx_obj_13cupy_backends_4cuda_4libs_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;
  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, __pyx_state: tuple):
 *     __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_UpdateUnpickledDict(__pyx_result, __pyx_state, 9)
*/
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyLong_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;
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyLong_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;
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyLong_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;
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 3, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = __Pyx_PyLong_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;
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 4, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyLong_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;
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 5, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyLong_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;
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 6, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyLong_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;
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 7, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = __Pyx_PyLong_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;
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 8, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyLong_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, __pyx_state: tuple):
 *     __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_UpdateUnpickledDict(__pyx_result, __pyx_state, 9)             # <<<<<<<<<<<<<<
*/
  __pyx_t_7 = __Pyx_UpdateUnpickledDict(((PyObject *)__pyx_v___pyx_result), __pyx_v___pyx_state, 9); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(2, 13, __pyx_L1_error)

  /* "(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, __pyx_state: tuple):             # <<<<<<<<<<<<<<
 *     __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_UpdateUnpickledDict(__pyx_result, __pyx_state, 9)
*/

  /* 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_backends.cuda.libs.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)":4
 *     int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1
 *     int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1
 * def __pyx_unpickle_CooAoSAttributes(__pyx_type, long __pyx_checksum, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0x5aa1e50, 0x11ade4a, 0xd3613df, b'cols, idxBase, idxType, ind, nnz, rows, valueType, values')
*/

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_621__pyx_unpickle_CooAoSAttributes(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_620__pyx_unpickle_CooAoSAttributes, "__pyx_unpickle_CooAoSAttributes(__pyx_type, long __pyx_checksum, tuple __pyx_state)");
static PyMethodDef __pyx_mdef_13cupy_backends_4cuda_4libs_8cusparse_621__pyx_unpickle_CooAoSAttributes = {"__pyx_unpickle_CooAoSAttributes", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_621__pyx_unpickle_CooAoSAttributes, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_620__pyx_unpickle_CooAoSAttributes};
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_621__pyx_unpickle_CooAoSAttributes(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v___pyx_type = 0;
  long __pyx_v___pyx_checksum;
  PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,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);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_type,&__pyx_mstate_global->__pyx_n_u_pyx_checksum,&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(2, 4, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(2, 4, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(2, 4, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(2, 4, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__pyx_unpickle_CooAoSAttributes", 0) < (0)) __PYX_ERR(2, 4, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_CooAoSAttributes", 1, 3, 3, i); __PYX_ERR(2, 4, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(2, 4, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(2, 4, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(2, 4, __pyx_L3_error)
    }
    __pyx_v___pyx_type = values[0];
    __pyx_v___pyx_checksum = __Pyx_PyLong_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(2, 4, __pyx_L3_error)
    __pyx_v___pyx_state = ((PyObject*)values[2]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_CooAoSAttributes", 1, 3, 3, __pyx_nargs); __PYX_ERR(2, 4, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.__pyx_unpickle_CooAoSAttributes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v___pyx_state), (&PyTuple_Type), 1, "__pyx_state", 1))) __PYX_ERR(2, 4, __pyx_L1_error)
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_620__pyx_unpickle_CooAoSAttributes(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_620__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_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_unpickle_CooAoSAttributes", 0);

  /* "(tree fragment)":6
 * def __pyx_unpickle_CooAoSAttributes(__pyx_type, long __pyx_checksum, tuple __pyx_state):
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0x5aa1e50, 0x11ade4a, 0xd3613df, b'cols, idxBase, idxType, ind, nnz, rows, valueType, values')             # <<<<<<<<<<<<<<
 *     __pyx_result = CooAoSAttributes.__new__(__pyx_type)
 *     if __pyx_state is not None:
*/
  __pyx_t_1 = __Pyx_CheckUnpickleChecksum(__pyx_v___pyx_checksum, 0x5aa1e50, 0x11ade4a, 0xd3613df, __pyx_k_cols_idxBase_idxType_ind_nnz_row); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(2, 6, __pyx_L1_error)

  /* "(tree fragment)":7
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0x5aa1e50, 0x11ade4a, 0xd3613df, b'cols, idxBase, idxType, ind, nnz, rows, valueType, values')
 *     __pyx_result = CooAoSAttributes.__new__(__pyx_type)             # <<<<<<<<<<<<<<
 *     if __pyx_state is not None:
 *         __pyx_unpickle_CooAoSAttributes__set_state(<CooAoSAttributes> __pyx_result, __pyx_state)
*/
  __pyx_t_3 = ((PyObject *)__pyx_mstate_global->__pyx_ptype_13cupy_backends_4cuda_4libs_8cusparse_CooAoSAttributes);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_4 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v___pyx_type};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_new, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_v___pyx_result = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "(tree fragment)":8
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0x5aa1e50, 0x11ade4a, 0xd3613df, b'cols, idxBase, idxType, ind, nnz, rows, valueType, values')
 *     __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_5 = (__pyx_v___pyx_state != ((PyObject*)Py_None));
  if (__pyx_t_5) {

    /* "(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, __pyx_state: tuple):
*/
    if (unlikely(__pyx_v___pyx_state == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "cannot pass None into a C function argument that is declared 'not None'");
      __PYX_ERR(2, 9, __pyx_L1_error)
    }
    __pyx_t_2 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse___pyx_unpickle_CooAoSAttributes__set_state(((struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CooAoSAttributes *)__pyx_v___pyx_result), __pyx_v___pyx_state); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "(tree fragment)":8
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0x5aa1e50, 0x11ade4a, 0xd3613df, b'cols, idxBase, idxType, ind, nnz, rows, valueType, values')
 *     __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, __pyx_state: tuple):
 *     __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)":4
 *     int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1
 *     int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1
 * def __pyx_unpickle_CooAoSAttributes(__pyx_type, long __pyx_checksum, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0x5aa1e50, 0x11ade4a, 0xd3613df, b'cols, idxBase, idxType, ind, nnz, rows, valueType, values')
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.__pyx_unpickle_CooAoSAttributes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __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, __pyx_state: tuple):             # <<<<<<<<<<<<<<
 *     __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_UpdateUnpickledDict(__pyx_result, __pyx_state, 8)
*/

static PyObject *__pyx_f_13cupy_backends_4cuda_4libs_8cusparse___pyx_unpickle_CooAoSAttributes__set_state(struct __pyx_obj_13cupy_backends_4cuda_4libs_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;
  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, __pyx_state: tuple):
 *     __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_UpdateUnpickledDict(__pyx_result, __pyx_state, 8)
*/
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyLong_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;
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyLong_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;
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyLong_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;
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 3, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = PyLong_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;
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 4, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyLong_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;
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 5, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyLong_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;
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 6, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = __Pyx_PyLong_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;
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 7, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = PyLong_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, __pyx_state: tuple):
 *     __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_UpdateUnpickledDict(__pyx_result, __pyx_state, 8)             # <<<<<<<<<<<<<<
*/
  __pyx_t_7 = __Pyx_UpdateUnpickledDict(((PyObject *)__pyx_v___pyx_result), __pyx_v___pyx_state, 8); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(2, 13, __pyx_L1_error)

  /* "(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, __pyx_state: tuple):             # <<<<<<<<<<<<<<
 *     __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_UpdateUnpickledDict(__pyx_result, __pyx_state, 8)
*/

  /* 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_backends.cuda.libs.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)":4
 *     int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1
 *     int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1
 * def __pyx_unpickle_CsrAttributes(__pyx_type, long __pyx_checksum, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0x29b438a, 0x9252b94, 0x09bcd38, b'colIdx, colIdxType, cols, idxBase, nnz, rowOffsetType, rowOffsets, rows, valueType, values')
*/

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_623__pyx_unpickle_CsrAttributes(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_622__pyx_unpickle_CsrAttributes, "__pyx_unpickle_CsrAttributes(__pyx_type, long __pyx_checksum, tuple __pyx_state)");
static PyMethodDef __pyx_mdef_13cupy_backends_4cuda_4libs_8cusparse_623__pyx_unpickle_CsrAttributes = {"__pyx_unpickle_CsrAttributes", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_623__pyx_unpickle_CsrAttributes, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_622__pyx_unpickle_CsrAttributes};
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_623__pyx_unpickle_CsrAttributes(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v___pyx_type = 0;
  long __pyx_v___pyx_checksum;
  PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,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);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_type,&__pyx_mstate_global->__pyx_n_u_pyx_checksum,&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(2, 4, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(2, 4, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(2, 4, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(2, 4, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__pyx_unpickle_CsrAttributes", 0) < (0)) __PYX_ERR(2, 4, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_CsrAttributes", 1, 3, 3, i); __PYX_ERR(2, 4, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(2, 4, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(2, 4, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(2, 4, __pyx_L3_error)
    }
    __pyx_v___pyx_type = values[0];
    __pyx_v___pyx_checksum = __Pyx_PyLong_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(2, 4, __pyx_L3_error)
    __pyx_v___pyx_state = ((PyObject*)values[2]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_CsrAttributes", 1, 3, 3, __pyx_nargs); __PYX_ERR(2, 4, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.__pyx_unpickle_CsrAttributes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v___pyx_state), (&PyTuple_Type), 1, "__pyx_state", 1))) __PYX_ERR(2, 4, __pyx_L1_error)
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_622__pyx_unpickle_CsrAttributes(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_622__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_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_unpickle_CsrAttributes", 0);

  /* "(tree fragment)":6
 * def __pyx_unpickle_CsrAttributes(__pyx_type, long __pyx_checksum, tuple __pyx_state):
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0x29b438a, 0x9252b94, 0x09bcd38, b'colIdx, colIdxType, cols, idxBase, nnz, rowOffsetType, rowOffsets, rows, valueType, values')             # <<<<<<<<<<<<<<
 *     __pyx_result = CsrAttributes.__new__(__pyx_type)
 *     if __pyx_state is not None:
*/
  __pyx_t_1 = __Pyx_CheckUnpickleChecksum(__pyx_v___pyx_checksum, 0x29b438a, 0x9252b94, 0x09bcd38, __pyx_k_colIdx_colIdxType_cols_idxBase_n); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(2, 6, __pyx_L1_error)

  /* "(tree fragment)":7
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0x29b438a, 0x9252b94, 0x09bcd38, b'colIdx, colIdxType, cols, idxBase, nnz, rowOffsetType, rowOffsets, rows, valueType, values')
 *     __pyx_result = CsrAttributes.__new__(__pyx_type)             # <<<<<<<<<<<<<<
 *     if __pyx_state is not None:
 *         __pyx_unpickle_CsrAttributes__set_state(<CsrAttributes> __pyx_result, __pyx_state)
*/
  __pyx_t_3 = ((PyObject *)__pyx_mstate_global->__pyx_ptype_13cupy_backends_4cuda_4libs_8cusparse_CsrAttributes);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_4 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v___pyx_type};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_new, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_v___pyx_result = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "(tree fragment)":8
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0x29b438a, 0x9252b94, 0x09bcd38, b'colIdx, colIdxType, cols, idxBase, nnz, rowOffsetType, rowOffsets, rows, valueType, values')
 *     __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_5 = (__pyx_v___pyx_state != ((PyObject*)Py_None));
  if (__pyx_t_5) {

    /* "(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, __pyx_state: tuple):
*/
    if (unlikely(__pyx_v___pyx_state == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "cannot pass None into a C function argument that is declared 'not None'");
      __PYX_ERR(2, 9, __pyx_L1_error)
    }
    __pyx_t_2 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse___pyx_unpickle_CsrAttributes__set_state(((struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CsrAttributes *)__pyx_v___pyx_result), __pyx_v___pyx_state); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "(tree fragment)":8
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0x29b438a, 0x9252b94, 0x09bcd38, b'colIdx, colIdxType, cols, idxBase, nnz, rowOffsetType, rowOffsets, rows, valueType, values')
 *     __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, __pyx_state: tuple):
 *     __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)":4
 *     int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1
 *     int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1
 * def __pyx_unpickle_CsrAttributes(__pyx_type, long __pyx_checksum, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0x29b438a, 0x9252b94, 0x09bcd38, b'colIdx, colIdxType, cols, idxBase, nnz, rowOffsetType, rowOffsets, rows, valueType, values')
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.__pyx_unpickle_CsrAttributes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __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, __pyx_state: tuple):             # <<<<<<<<<<<<<<
 *     __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_UpdateUnpickledDict(__pyx_result, __pyx_state, 10)
*/

static PyObject *__pyx_f_13cupy_backends_4cuda_4libs_8cusparse___pyx_unpickle_CsrAttributes__set_state(struct __pyx_obj_13cupy_backends_4cuda_4libs_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;
  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, __pyx_state: tuple):
 *     __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_UpdateUnpickledDict(__pyx_result, __pyx_state, 10)
*/
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyLong_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;
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyLong_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;
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyLong_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;
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 3, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = __Pyx_PyLong_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;
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 4, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyLong_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;
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 5, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyLong_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;
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 6, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyLong_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;
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 7, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyLong_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;
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 8, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = __Pyx_PyLong_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;
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 9, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyLong_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, __pyx_state: tuple):
 *     __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_UpdateUnpickledDict(__pyx_result, __pyx_state, 10)             # <<<<<<<<<<<<<<
*/
  __pyx_t_7 = __Pyx_UpdateUnpickledDict(((PyObject *)__pyx_v___pyx_result), __pyx_v___pyx_state, 10); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(2, 13, __pyx_L1_error)

  /* "(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, __pyx_state: tuple):             # <<<<<<<<<<<<<<
 *     __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_UpdateUnpickledDict(__pyx_result, __pyx_state, 10)
*/

  /* 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_backends.cuda.libs.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)":4
 *     int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1
 *     int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1
 * def __pyx_unpickle_DnVecAttributes(__pyx_type, long __pyx_checksum, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0x4ea9d53, 0x27bcb7a, 0xcbbe7db, b'size, valueType, values')
*/

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_625__pyx_unpickle_DnVecAttributes(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_624__pyx_unpickle_DnVecAttributes, "__pyx_unpickle_DnVecAttributes(__pyx_type, long __pyx_checksum, tuple __pyx_state)");
static PyMethodDef __pyx_mdef_13cupy_backends_4cuda_4libs_8cusparse_625__pyx_unpickle_DnVecAttributes = {"__pyx_unpickle_DnVecAttributes", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_625__pyx_unpickle_DnVecAttributes, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_624__pyx_unpickle_DnVecAttributes};
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_625__pyx_unpickle_DnVecAttributes(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v___pyx_type = 0;
  long __pyx_v___pyx_checksum;
  PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,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);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_type,&__pyx_mstate_global->__pyx_n_u_pyx_checksum,&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(2, 4, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(2, 4, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(2, 4, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(2, 4, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__pyx_unpickle_DnVecAttributes", 0) < (0)) __PYX_ERR(2, 4, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_DnVecAttributes", 1, 3, 3, i); __PYX_ERR(2, 4, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(2, 4, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(2, 4, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(2, 4, __pyx_L3_error)
    }
    __pyx_v___pyx_type = values[0];
    __pyx_v___pyx_checksum = __Pyx_PyLong_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(2, 4, __pyx_L3_error)
    __pyx_v___pyx_state = ((PyObject*)values[2]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_DnVecAttributes", 1, 3, 3, __pyx_nargs); __PYX_ERR(2, 4, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.__pyx_unpickle_DnVecAttributes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v___pyx_state), (&PyTuple_Type), 1, "__pyx_state", 1))) __PYX_ERR(2, 4, __pyx_L1_error)
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_624__pyx_unpickle_DnVecAttributes(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_624__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_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_unpickle_DnVecAttributes", 0);

  /* "(tree fragment)":6
 * def __pyx_unpickle_DnVecAttributes(__pyx_type, long __pyx_checksum, tuple __pyx_state):
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0x4ea9d53, 0x27bcb7a, 0xcbbe7db, b'size, valueType, values')             # <<<<<<<<<<<<<<
 *     __pyx_result = DnVecAttributes.__new__(__pyx_type)
 *     if __pyx_state is not None:
*/
  __pyx_t_1 = __Pyx_CheckUnpickleChecksum(__pyx_v___pyx_checksum, 0x4ea9d53, 0x27bcb7a, 0xcbbe7db, __pyx_k_size_valueType_values); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(2, 6, __pyx_L1_error)

  /* "(tree fragment)":7
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0x4ea9d53, 0x27bcb7a, 0xcbbe7db, b'size, valueType, values')
 *     __pyx_result = DnVecAttributes.__new__(__pyx_type)             # <<<<<<<<<<<<<<
 *     if __pyx_state is not None:
 *         __pyx_unpickle_DnVecAttributes__set_state(<DnVecAttributes> __pyx_result, __pyx_state)
*/
  __pyx_t_3 = ((PyObject *)__pyx_mstate_global->__pyx_ptype_13cupy_backends_4cuda_4libs_8cusparse_DnVecAttributes);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_4 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v___pyx_type};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_new, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_v___pyx_result = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "(tree fragment)":8
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0x4ea9d53, 0x27bcb7a, 0xcbbe7db, b'size, valueType, values')
 *     __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_5 = (__pyx_v___pyx_state != ((PyObject*)Py_None));
  if (__pyx_t_5) {

    /* "(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, __pyx_state: tuple):
*/
    if (unlikely(__pyx_v___pyx_state == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "cannot pass None into a C function argument that is declared 'not None'");
      __PYX_ERR(2, 9, __pyx_L1_error)
    }
    __pyx_t_2 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse___pyx_unpickle_DnVecAttributes__set_state(((struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_DnVecAttributes *)__pyx_v___pyx_result), __pyx_v___pyx_state); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "(tree fragment)":8
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0x4ea9d53, 0x27bcb7a, 0xcbbe7db, b'size, valueType, values')
 *     __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, __pyx_state: tuple):
 *     __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)":4
 *     int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1
 *     int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1
 * def __pyx_unpickle_DnVecAttributes(__pyx_type, long __pyx_checksum, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0x4ea9d53, 0x27bcb7a, 0xcbbe7db, b'size, valueType, values')
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.__pyx_unpickle_DnVecAttributes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __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, __pyx_state: tuple):             # <<<<<<<<<<<<<<
 *     __pyx_result.size = __pyx_state[0]; __pyx_result.valueType = __pyx_state[1]; __pyx_result.values = __pyx_state[2]
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 3)
*/

static PyObject *__pyx_f_13cupy_backends_4cuda_4libs_8cusparse___pyx_unpickle_DnVecAttributes__set_state(struct __pyx_obj_13cupy_backends_4cuda_4libs_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;
  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, __pyx_state: tuple):
 *     __pyx_result.size = __pyx_state[0]; __pyx_result.valueType = __pyx_state[1]; __pyx_result.values = __pyx_state[2]             # <<<<<<<<<<<<<<
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 3)
*/
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyLong_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;
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyLong_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;
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = PyLong_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, __pyx_state: tuple):
 *     __pyx_result.size = __pyx_state[0]; __pyx_result.valueType = __pyx_state[1]; __pyx_result.values = __pyx_state[2]
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 3)             # <<<<<<<<<<<<<<
*/
  __pyx_t_5 = __Pyx_UpdateUnpickledDict(((PyObject *)__pyx_v___pyx_result), __pyx_v___pyx_state, 3); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(2, 13, __pyx_L1_error)

  /* "(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, __pyx_state: tuple):             # <<<<<<<<<<<<<<
 *     __pyx_result.size = __pyx_state[0]; __pyx_result.valueType = __pyx_state[1]; __pyx_result.values = __pyx_state[2]
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 3)
*/

  /* 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_backends.cuda.libs.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)":4
 *     int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1
 *     int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1
 * def __pyx_unpickle_DnMatAttributes(__pyx_type, long __pyx_checksum, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0x4b0530a, 0x52d7d5d, 0x9d3053a, b'cols, ld, order, rows, valueType, values')
*/

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_627__pyx_unpickle_DnMatAttributes(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_626__pyx_unpickle_DnMatAttributes, "__pyx_unpickle_DnMatAttributes(__pyx_type, long __pyx_checksum, tuple __pyx_state)");
static PyMethodDef __pyx_mdef_13cupy_backends_4cuda_4libs_8cusparse_627__pyx_unpickle_DnMatAttributes = {"__pyx_unpickle_DnMatAttributes", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_627__pyx_unpickle_DnMatAttributes, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_626__pyx_unpickle_DnMatAttributes};
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_627__pyx_unpickle_DnMatAttributes(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v___pyx_type = 0;
  long __pyx_v___pyx_checksum;
  PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,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);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_type,&__pyx_mstate_global->__pyx_n_u_pyx_checksum,&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(2, 4, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(2, 4, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(2, 4, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(2, 4, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__pyx_unpickle_DnMatAttributes", 0) < (0)) __PYX_ERR(2, 4, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_DnMatAttributes", 1, 3, 3, i); __PYX_ERR(2, 4, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(2, 4, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(2, 4, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(2, 4, __pyx_L3_error)
    }
    __pyx_v___pyx_type = values[0];
    __pyx_v___pyx_checksum = __Pyx_PyLong_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(2, 4, __pyx_L3_error)
    __pyx_v___pyx_state = ((PyObject*)values[2]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_DnMatAttributes", 1, 3, 3, __pyx_nargs); __PYX_ERR(2, 4, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.__pyx_unpickle_DnMatAttributes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v___pyx_state), (&PyTuple_Type), 1, "__pyx_state", 1))) __PYX_ERR(2, 4, __pyx_L1_error)
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_626__pyx_unpickle_DnMatAttributes(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_626__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_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_unpickle_DnMatAttributes", 0);

  /* "(tree fragment)":6
 * def __pyx_unpickle_DnMatAttributes(__pyx_type, long __pyx_checksum, tuple __pyx_state):
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0x4b0530a, 0x52d7d5d, 0x9d3053a, b'cols, ld, order, rows, valueType, values')             # <<<<<<<<<<<<<<
 *     __pyx_result = DnMatAttributes.__new__(__pyx_type)
 *     if __pyx_state is not None:
*/
  __pyx_t_1 = __Pyx_CheckUnpickleChecksum(__pyx_v___pyx_checksum, 0x4b0530a, 0x52d7d5d, 0x9d3053a, __pyx_k_cols_ld_order_rows_valueType_val); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(2, 6, __pyx_L1_error)

  /* "(tree fragment)":7
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0x4b0530a, 0x52d7d5d, 0x9d3053a, b'cols, ld, order, rows, valueType, values')
 *     __pyx_result = DnMatAttributes.__new__(__pyx_type)             # <<<<<<<<<<<<<<
 *     if __pyx_state is not None:
 *         __pyx_unpickle_DnMatAttributes__set_state(<DnMatAttributes> __pyx_result, __pyx_state)
*/
  __pyx_t_3 = ((PyObject *)__pyx_mstate_global->__pyx_ptype_13cupy_backends_4cuda_4libs_8cusparse_DnMatAttributes);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_4 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v___pyx_type};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_new, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_v___pyx_result = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "(tree fragment)":8
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0x4b0530a, 0x52d7d5d, 0x9d3053a, b'cols, ld, order, rows, valueType, values')
 *     __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_5 = (__pyx_v___pyx_state != ((PyObject*)Py_None));
  if (__pyx_t_5) {

    /* "(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, __pyx_state: tuple):
*/
    if (unlikely(__pyx_v___pyx_state == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "cannot pass None into a C function argument that is declared 'not None'");
      __PYX_ERR(2, 9, __pyx_L1_error)
    }
    __pyx_t_2 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse___pyx_unpickle_DnMatAttributes__set_state(((struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_DnMatAttributes *)__pyx_v___pyx_result), __pyx_v___pyx_state); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "(tree fragment)":8
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0x4b0530a, 0x52d7d5d, 0x9d3053a, b'cols, ld, order, rows, valueType, values')
 *     __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, __pyx_state: tuple):
 *     __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)":4
 *     int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1
 *     int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1
 * def __pyx_unpickle_DnMatAttributes(__pyx_type, long __pyx_checksum, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0x4b0530a, 0x52d7d5d, 0x9d3053a, b'cols, ld, order, rows, valueType, values')
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.__pyx_unpickle_DnMatAttributes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __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, __pyx_state: tuple):             # <<<<<<<<<<<<<<
 *     __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_UpdateUnpickledDict(__pyx_result, __pyx_state, 6)
*/

static PyObject *__pyx_f_13cupy_backends_4cuda_4libs_8cusparse___pyx_unpickle_DnMatAttributes__set_state(struct __pyx_obj_13cupy_backends_4cuda_4libs_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;
  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, __pyx_state: tuple):
 *     __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_UpdateUnpickledDict(__pyx_result, __pyx_state, 6)
*/
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyLong_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;
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyLong_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;
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyLong_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;
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 3, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyLong_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;
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 4, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyLong_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;
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 5, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = PyLong_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, __pyx_state: tuple):
 *     __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_UpdateUnpickledDict(__pyx_result, __pyx_state, 6)             # <<<<<<<<<<<<<<
*/
  __pyx_t_6 = __Pyx_UpdateUnpickledDict(((PyObject *)__pyx_v___pyx_result), __pyx_v___pyx_state, 6); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(2, 13, __pyx_L1_error)

  /* "(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, __pyx_state: tuple):             # <<<<<<<<<<<<<<
 *     __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_UpdateUnpickledDict(__pyx_result, __pyx_state, 6)
*/

  /* 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_backends.cuda.libs.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)":4
 *     int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1
 *     int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1
 * def __pyx_unpickle_DnMatBatchAttributes(__pyx_type, long __pyx_checksum, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0x250cbad, 0xf6c1cfb, 0xb66dd58, b'count, stride')
*/

/* Python wrapper */
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_629__pyx_unpickle_DnMatBatchAttributes(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_628__pyx_unpickle_DnMatBatchAttributes, "__pyx_unpickle_DnMatBatchAttributes(__pyx_type, long __pyx_checksum, tuple __pyx_state)");
static PyMethodDef __pyx_mdef_13cupy_backends_4cuda_4libs_8cusparse_629__pyx_unpickle_DnMatBatchAttributes = {"__pyx_unpickle_DnMatBatchAttributes", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_629__pyx_unpickle_DnMatBatchAttributes, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_628__pyx_unpickle_DnMatBatchAttributes};
static PyObject *__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_629__pyx_unpickle_DnMatBatchAttributes(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v___pyx_type = 0;
  long __pyx_v___pyx_checksum;
  PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,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);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_type,&__pyx_mstate_global->__pyx_n_u_pyx_checksum,&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(2, 4, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(2, 4, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(2, 4, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(2, 4, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__pyx_unpickle_DnMatBatchAttributes", 0) < (0)) __PYX_ERR(2, 4, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_DnMatBatchAttributes", 1, 3, 3, i); __PYX_ERR(2, 4, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(2, 4, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(2, 4, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(2, 4, __pyx_L3_error)
    }
    __pyx_v___pyx_type = values[0];
    __pyx_v___pyx_checksum = __Pyx_PyLong_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(2, 4, __pyx_L3_error)
    __pyx_v___pyx_state = ((PyObject*)values[2]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_DnMatBatchAttributes", 1, 3, 3, __pyx_nargs); __PYX_ERR(2, 4, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.__pyx_unpickle_DnMatBatchAttributes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v___pyx_state), (&PyTuple_Type), 1, "__pyx_state", 1))) __PYX_ERR(2, 4, __pyx_L1_error)
  __pyx_r = __pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_628__pyx_unpickle_DnMatBatchAttributes(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cupy_backends_4cuda_4libs_8cusparse_628__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_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_unpickle_DnMatBatchAttributes", 0);

  /* "(tree fragment)":6
 * def __pyx_unpickle_DnMatBatchAttributes(__pyx_type, long __pyx_checksum, tuple __pyx_state):
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0x250cbad, 0xf6c1cfb, 0xb66dd58, b'count, stride')             # <<<<<<<<<<<<<<
 *     __pyx_result = DnMatBatchAttributes.__new__(__pyx_type)
 *     if __pyx_state is not None:
*/
  __pyx_t_1 = __Pyx_CheckUnpickleChecksum(__pyx_v___pyx_checksum, 0x250cbad, 0xf6c1cfb, 0xb66dd58, __pyx_k_count_stride); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(2, 6, __pyx_L1_error)

  /* "(tree fragment)":7
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0x250cbad, 0xf6c1cfb, 0xb66dd58, b'count, stride')
 *     __pyx_result = DnMatBatchAttributes.__new__(__pyx_type)             # <<<<<<<<<<<<<<
 *     if __pyx_state is not None:
 *         __pyx_unpickle_DnMatBatchAttributes__set_state(<DnMatBatchAttributes> __pyx_result, __pyx_state)
*/
  __pyx_t_3 = ((PyObject *)__pyx_mstate_global->__pyx_ptype_13cupy_backends_4cuda_4libs_8cusparse_DnMatBatchAttributes);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_4 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v___pyx_type};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_new, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_v___pyx_result = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "(tree fragment)":8
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0x250cbad, 0xf6c1cfb, 0xb66dd58, b'count, stride')
 *     __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_5 = (__pyx_v___pyx_state != ((PyObject*)Py_None));
  if (__pyx_t_5) {

    /* "(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, __pyx_state: tuple):
*/
    if (unlikely(__pyx_v___pyx_state == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "cannot pass None into a C function argument that is declared 'not None'");
      __PYX_ERR(2, 9, __pyx_L1_error)
    }
    __pyx_t_2 = __pyx_f_13cupy_backends_4cuda_4libs_8cusparse___pyx_unpickle_DnMatBatchAttributes__set_state(((struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_DnMatBatchAttributes *)__pyx_v___pyx_result), __pyx_v___pyx_state); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "(tree fragment)":8
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0x250cbad, 0xf6c1cfb, 0xb66dd58, b'count, stride')
 *     __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, __pyx_state: tuple):
 *     __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)":4
 *     int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1
 *     int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1
 * def __pyx_unpickle_DnMatBatchAttributes(__pyx_type, long __pyx_checksum, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0x250cbad, 0xf6c1cfb, 0xb66dd58, b'count, stride')
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cupy_backends.cuda.libs.cusparse.__pyx_unpickle_DnMatBatchAttributes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __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, __pyx_state: tuple):             # <<<<<<<<<<<<<<
 *     __pyx_result.count = __pyx_state[0]; __pyx_result.stride = __pyx_state[1]
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 2)
*/

static PyObject *__pyx_f_13cupy_backends_4cuda_4libs_8cusparse___pyx_unpickle_DnMatBatchAttributes__set_state(struct __pyx_obj_13cupy_backends_4cuda_4libs_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_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, __pyx_state: tuple):
 *     __pyx_result.count = __pyx_state[0]; __pyx_result.stride = __pyx_state[1]             # <<<<<<<<<<<<<<
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 2)
*/
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyLong_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;
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyLong_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, __pyx_state: tuple):
 *     __pyx_result.count = __pyx_state[0]; __pyx_result.stride = __pyx_state[1]
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 2)             # <<<<<<<<<<<<<<
*/
  __pyx_t_2 = __Pyx_UpdateUnpickledDict(((PyObject *)__pyx_v___pyx_result), __pyx_v___pyx_state, 2); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(2, 13, __pyx_L1_error)

  /* "(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, __pyx_state: tuple):             # <<<<<<<<<<<<<<
 *     __pyx_result.count = __pyx_state[0]; __pyx_result.stride = __pyx_state[1]
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 2)
*/

  /* 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_backends.cuda.libs.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;
}
/* #### Code section: module_exttypes ### */

static PyObject *__pyx_tp_new_13cupy_backends_4cuda_4libs_8cusparse_SpVecAttributes(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  o = __Pyx_AllocateExtensionType(t, 0);
  if (unlikely(!o)) return 0;
  return o;
}

static void __pyx_tp_dealloc_13cupy_backends_4cuda_4libs_8cusparse_SpVecAttributes(PyObject *o) {
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_13cupy_backends_4cuda_4libs_8cusparse_SpVecAttributes) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyTypeObject *tp = Py_TYPE(o);
  #if CYTHON_USE_TYPE_SLOTS
  (*tp->tp_free)(o);
  #else
  {
    freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
    if (tp_free) tp_free(o);
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  Py_DECREF(tp);
  #endif
}

static PyObject *__pyx_getprop_13cupy_backends_4cuda_4libs_8cusparse_15SpVecAttributes_size(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_15SpVecAttributes_4size_1__get__(o);
}

static int __pyx_setprop_13cupy_backends_4cuda_4libs_8cusparse_15SpVecAttributes_size(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_15SpVecAttributes_4size_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_13cupy_backends_4cuda_4libs_8cusparse_15SpVecAttributes_nnz(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_15SpVecAttributes_3nnz_1__get__(o);
}

static int __pyx_setprop_13cupy_backends_4cuda_4libs_8cusparse_15SpVecAttributes_nnz(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_15SpVecAttributes_3nnz_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_13cupy_backends_4cuda_4libs_8cusparse_15SpVecAttributes_idx(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_15SpVecAttributes_3idx_1__get__(o);
}

static int __pyx_setprop_13cupy_backends_4cuda_4libs_8cusparse_15SpVecAttributes_idx(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_15SpVecAttributes_3idx_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_13cupy_backends_4cuda_4libs_8cusparse_15SpVecAttributes_values(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_15SpVecAttributes_6values_1__get__(o);
}

static int __pyx_setprop_13cupy_backends_4cuda_4libs_8cusparse_15SpVecAttributes_values(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_15SpVecAttributes_6values_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_13cupy_backends_4cuda_4libs_8cusparse_15SpVecAttributes_idxType(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_15SpVecAttributes_7idxType_1__get__(o);
}

static int __pyx_setprop_13cupy_backends_4cuda_4libs_8cusparse_15SpVecAttributes_idxType(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_15SpVecAttributes_7idxType_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_13cupy_backends_4cuda_4libs_8cusparse_15SpVecAttributes_idxBase(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_15SpVecAttributes_7idxBase_1__get__(o);
}

static int __pyx_setprop_13cupy_backends_4cuda_4libs_8cusparse_15SpVecAttributes_idxBase(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_15SpVecAttributes_7idxBase_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_13cupy_backends_4cuda_4libs_8cusparse_15SpVecAttributes_valueType(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_15SpVecAttributes_9valueType_1__get__(o);
}

static int __pyx_setprop_13cupy_backends_4cuda_4libs_8cusparse_15SpVecAttributes_valueType(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_15SpVecAttributes_9valueType_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyMethodDef __pyx_methods_13cupy_backends_4cuda_4libs_8cusparse_SpVecAttributes[] = {
  {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_15SpVecAttributes_3__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_15SpVecAttributes_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_15SpVecAttributes_5__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_15SpVecAttributes_4__setstate_cython__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_13cupy_backends_4cuda_4libs_8cusparse_SpVecAttributes[] = {
  {"size", __pyx_getprop_13cupy_backends_4cuda_4libs_8cusparse_15SpVecAttributes_size, __pyx_setprop_13cupy_backends_4cuda_4libs_8cusparse_15SpVecAttributes_size, PyDoc_STR("size: 'int64_t'"), 0},
  {"nnz", __pyx_getprop_13cupy_backends_4cuda_4libs_8cusparse_15SpVecAttributes_nnz, __pyx_setprop_13cupy_backends_4cuda_4libs_8cusparse_15SpVecAttributes_nnz, PyDoc_STR("nnz: 'int64_t'"), 0},
  {"idx", __pyx_getprop_13cupy_backends_4cuda_4libs_8cusparse_15SpVecAttributes_idx, __pyx_setprop_13cupy_backends_4cuda_4libs_8cusparse_15SpVecAttributes_idx, PyDoc_STR("idx: 'intptr_t'"), 0},
  {"values", __pyx_getprop_13cupy_backends_4cuda_4libs_8cusparse_15SpVecAttributes_values, __pyx_setprop_13cupy_backends_4cuda_4libs_8cusparse_15SpVecAttributes_values, PyDoc_STR("values: 'intptr_t'"), 0},
  {"idxType", __pyx_getprop_13cupy_backends_4cuda_4libs_8cusparse_15SpVecAttributes_idxType, __pyx_setprop_13cupy_backends_4cuda_4libs_8cusparse_15SpVecAttributes_idxType, PyDoc_STR("idxType: 'IndexType'"), 0},
  {"idxBase", __pyx_getprop_13cupy_backends_4cuda_4libs_8cusparse_15SpVecAttributes_idxBase, __pyx_setprop_13cupy_backends_4cuda_4libs_8cusparse_15SpVecAttributes_idxBase, PyDoc_STR("idxBase: 'IndexBase'"), 0},
  {"valueType", __pyx_getprop_13cupy_backends_4cuda_4libs_8cusparse_15SpVecAttributes_valueType, __pyx_setprop_13cupy_backends_4cuda_4libs_8cusparse_15SpVecAttributes_valueType, PyDoc_STR("valueType: 'DataType'"), 0},
  {0, 0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_13cupy_backends_4cuda_4libs_8cusparse_SpVecAttributes_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_13cupy_backends_4cuda_4libs_8cusparse_SpVecAttributes},
  {Py_tp_doc, (void *)PyDoc_STR("SpVecAttributes(int64_t size, int64_t nnz, intptr_t idx, intptr_t values, IndexType idxType, IndexBase idxBase, DataType valueType)")},
  {Py_tp_methods, (void *)__pyx_methods_13cupy_backends_4cuda_4libs_8cusparse_SpVecAttributes},
  {Py_tp_getset, (void *)__pyx_getsets_13cupy_backends_4cuda_4libs_8cusparse_SpVecAttributes},
  {Py_tp_init, (void *)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_15SpVecAttributes_1__init__},
  {Py_tp_new, (void *)__pyx_tp_new_13cupy_backends_4cuda_4libs_8cusparse_SpVecAttributes},
  {0, 0},
};
static PyType_Spec __pyx_type_13cupy_backends_4cuda_4libs_8cusparse_SpVecAttributes_spec = {
  "cupy_backends.cuda.libs.cusparse.SpVecAttributes",
  sizeof(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_SpVecAttributes),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
  __pyx_type_13cupy_backends_4cuda_4libs_8cusparse_SpVecAttributes_slots,
};
#else

static PyTypeObject __pyx_type_13cupy_backends_4cuda_4libs_8cusparse_SpVecAttributes = {
  PyVarObject_HEAD_INIT(0, 0)
  "cupy_backends.cuda.libs.cusparse.""SpVecAttributes", /*tp_name*/
  sizeof(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_SpVecAttributes), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_13cupy_backends_4cuda_4libs_8cusparse_SpVecAttributes, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  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*/
  PyDoc_STR("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_13cupy_backends_4cuda_4libs_8cusparse_SpVecAttributes, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_13cupy_backends_4cuda_4libs_8cusparse_SpVecAttributes, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_15SpVecAttributes_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_13cupy_backends_4cuda_4libs_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 CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

static PyObject *__pyx_tp_new_13cupy_backends_4cuda_4libs_8cusparse_CooAttributes(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  o = __Pyx_AllocateExtensionType(t, 0);
  if (unlikely(!o)) return 0;
  return o;
}

static void __pyx_tp_dealloc_13cupy_backends_4cuda_4libs_8cusparse_CooAttributes(PyObject *o) {
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_13cupy_backends_4cuda_4libs_8cusparse_CooAttributes) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyTypeObject *tp = Py_TYPE(o);
  #if CYTHON_USE_TYPE_SLOTS
  (*tp->tp_free)(o);
  #else
  {
    freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
    if (tp_free) tp_free(o);
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  Py_DECREF(tp);
  #endif
}

static PyObject *__pyx_getprop_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_rows(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_4rows_1__get__(o);
}

static int __pyx_setprop_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_rows(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_4rows_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_cols(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_4cols_1__get__(o);
}

static int __pyx_setprop_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_cols(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_4cols_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_nnz(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_3nnz_1__get__(o);
}

static int __pyx_setprop_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_nnz(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_3nnz_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_rowIdx(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_6rowIdx_1__get__(o);
}

static int __pyx_setprop_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_rowIdx(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_6rowIdx_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_colIdx(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_6colIdx_1__get__(o);
}

static int __pyx_setprop_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_colIdx(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_6colIdx_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_values(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_6values_1__get__(o);
}

static int __pyx_setprop_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_values(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_6values_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_idxType(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_7idxType_1__get__(o);
}

static int __pyx_setprop_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_idxType(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_7idxType_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_idxBase(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_7idxBase_1__get__(o);
}

static int __pyx_setprop_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_idxBase(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_7idxBase_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_valueType(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_9valueType_1__get__(o);
}

static int __pyx_setprop_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_valueType(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_9valueType_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyMethodDef __pyx_methods_13cupy_backends_4cuda_4libs_8cusparse_CooAttributes[] = {
  {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_3__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_5__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_4__setstate_cython__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_13cupy_backends_4cuda_4libs_8cusparse_CooAttributes[] = {
  {"rows", __pyx_getprop_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_rows, __pyx_setprop_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_rows, PyDoc_STR("rows: 'int64_t'"), 0},
  {"cols", __pyx_getprop_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_cols, __pyx_setprop_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_cols, PyDoc_STR("cols: 'int64_t'"), 0},
  {"nnz", __pyx_getprop_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_nnz, __pyx_setprop_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_nnz, PyDoc_STR("nnz: 'int64_t'"), 0},
  {"rowIdx", __pyx_getprop_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_rowIdx, __pyx_setprop_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_rowIdx, PyDoc_STR("rowIdx: 'intptr_t'"), 0},
  {"colIdx", __pyx_getprop_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_colIdx, __pyx_setprop_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_colIdx, PyDoc_STR("colIdx: 'intptr_t'"), 0},
  {"values", __pyx_getprop_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_values, __pyx_setprop_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_values, PyDoc_STR("values: 'intptr_t'"), 0},
  {"idxType", __pyx_getprop_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_idxType, __pyx_setprop_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_idxType, PyDoc_STR("idxType: 'IndexType'"), 0},
  {"idxBase", __pyx_getprop_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_idxBase, __pyx_setprop_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_idxBase, PyDoc_STR("idxBase: 'IndexBase'"), 0},
  {"valueType", __pyx_getprop_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_valueType, __pyx_setprop_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_valueType, PyDoc_STR("valueType: 'DataType'"), 0},
  {0, 0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_13cupy_backends_4cuda_4libs_8cusparse_CooAttributes_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_13cupy_backends_4cuda_4libs_8cusparse_CooAttributes},
  {Py_tp_doc, (void *)PyDoc_STR("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)")},
  {Py_tp_methods, (void *)__pyx_methods_13cupy_backends_4cuda_4libs_8cusparse_CooAttributes},
  {Py_tp_getset, (void *)__pyx_getsets_13cupy_backends_4cuda_4libs_8cusparse_CooAttributes},
  {Py_tp_init, (void *)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_1__init__},
  {Py_tp_new, (void *)__pyx_tp_new_13cupy_backends_4cuda_4libs_8cusparse_CooAttributes},
  {0, 0},
};
static PyType_Spec __pyx_type_13cupy_backends_4cuda_4libs_8cusparse_CooAttributes_spec = {
  "cupy_backends.cuda.libs.cusparse.CooAttributes",
  sizeof(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CooAttributes),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
  __pyx_type_13cupy_backends_4cuda_4libs_8cusparse_CooAttributes_slots,
};
#else

static PyTypeObject __pyx_type_13cupy_backends_4cuda_4libs_8cusparse_CooAttributes = {
  PyVarObject_HEAD_INIT(0, 0)
  "cupy_backends.cuda.libs.cusparse.""CooAttributes", /*tp_name*/
  sizeof(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CooAttributes), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_13cupy_backends_4cuda_4libs_8cusparse_CooAttributes, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  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*/
  PyDoc_STR("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_13cupy_backends_4cuda_4libs_8cusparse_CooAttributes, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_13cupy_backends_4cuda_4libs_8cusparse_CooAttributes, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_13CooAttributes_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_13cupy_backends_4cuda_4libs_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 CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

static PyObject *__pyx_tp_new_13cupy_backends_4cuda_4libs_8cusparse_CooAoSAttributes(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  o = __Pyx_AllocateExtensionType(t, 0);
  if (unlikely(!o)) return 0;
  return o;
}

static void __pyx_tp_dealloc_13cupy_backends_4cuda_4libs_8cusparse_CooAoSAttributes(PyObject *o) {
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_13cupy_backends_4cuda_4libs_8cusparse_CooAoSAttributes) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyTypeObject *tp = Py_TYPE(o);
  #if CYTHON_USE_TYPE_SLOTS
  (*tp->tp_free)(o);
  #else
  {
    freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
    if (tp_free) tp_free(o);
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  Py_DECREF(tp);
  #endif
}

static PyObject *__pyx_getprop_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_rows(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_4rows_1__get__(o);
}

static int __pyx_setprop_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_rows(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_4rows_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_cols(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_4cols_1__get__(o);
}

static int __pyx_setprop_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_cols(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_4cols_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_nnz(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_3nnz_1__get__(o);
}

static int __pyx_setprop_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_nnz(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_3nnz_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_ind(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_3ind_1__get__(o);
}

static int __pyx_setprop_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_ind(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_3ind_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_values(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_6values_1__get__(o);
}

static int __pyx_setprop_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_values(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_6values_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_idxType(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_7idxType_1__get__(o);
}

static int __pyx_setprop_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_idxType(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_7idxType_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_idxBase(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_7idxBase_1__get__(o);
}

static int __pyx_setprop_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_idxBase(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_7idxBase_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_valueType(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_9valueType_1__get__(o);
}

static int __pyx_setprop_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_valueType(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_9valueType_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyMethodDef __pyx_methods_13cupy_backends_4cuda_4libs_8cusparse_CooAoSAttributes[] = {
  {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_3__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_5__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_4__setstate_cython__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_13cupy_backends_4cuda_4libs_8cusparse_CooAoSAttributes[] = {
  {"rows", __pyx_getprop_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_rows, __pyx_setprop_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_rows, PyDoc_STR("rows: 'int64_t'"), 0},
  {"cols", __pyx_getprop_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_cols, __pyx_setprop_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_cols, PyDoc_STR("cols: 'int64_t'"), 0},
  {"nnz", __pyx_getprop_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_nnz, __pyx_setprop_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_nnz, PyDoc_STR("nnz: 'int64_t'"), 0},
  {"ind", __pyx_getprop_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_ind, __pyx_setprop_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_ind, PyDoc_STR("ind: 'intptr_t'"), 0},
  {"values", __pyx_getprop_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_values, __pyx_setprop_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_values, PyDoc_STR("values: 'intptr_t'"), 0},
  {"idxType", __pyx_getprop_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_idxType, __pyx_setprop_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_idxType, PyDoc_STR("idxType: 'IndexType'"), 0},
  {"idxBase", __pyx_getprop_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_idxBase, __pyx_setprop_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_idxBase, PyDoc_STR("idxBase: 'IndexBase'"), 0},
  {"valueType", __pyx_getprop_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_valueType, __pyx_setprop_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_valueType, PyDoc_STR("valueType: 'DataType'"), 0},
  {0, 0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_13cupy_backends_4cuda_4libs_8cusparse_CooAoSAttributes_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_13cupy_backends_4cuda_4libs_8cusparse_CooAoSAttributes},
  {Py_tp_doc, (void *)PyDoc_STR("CooAoSAttributes(int64_t rows, int64_t cols, int64_t nnz, intptr_t ind, intptr_t values, IndexType idxType, IndexBase idxBase, DataType valueType)")},
  {Py_tp_methods, (void *)__pyx_methods_13cupy_backends_4cuda_4libs_8cusparse_CooAoSAttributes},
  {Py_tp_getset, (void *)__pyx_getsets_13cupy_backends_4cuda_4libs_8cusparse_CooAoSAttributes},
  {Py_tp_init, (void *)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_1__init__},
  {Py_tp_new, (void *)__pyx_tp_new_13cupy_backends_4cuda_4libs_8cusparse_CooAoSAttributes},
  {0, 0},
};
static PyType_Spec __pyx_type_13cupy_backends_4cuda_4libs_8cusparse_CooAoSAttributes_spec = {
  "cupy_backends.cuda.libs.cusparse.CooAoSAttributes",
  sizeof(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CooAoSAttributes),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
  __pyx_type_13cupy_backends_4cuda_4libs_8cusparse_CooAoSAttributes_slots,
};
#else

static PyTypeObject __pyx_type_13cupy_backends_4cuda_4libs_8cusparse_CooAoSAttributes = {
  PyVarObject_HEAD_INIT(0, 0)
  "cupy_backends.cuda.libs.cusparse.""CooAoSAttributes", /*tp_name*/
  sizeof(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CooAoSAttributes), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_13cupy_backends_4cuda_4libs_8cusparse_CooAoSAttributes, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  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*/
  PyDoc_STR("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_13cupy_backends_4cuda_4libs_8cusparse_CooAoSAttributes, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_13cupy_backends_4cuda_4libs_8cusparse_CooAoSAttributes, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_16CooAoSAttributes_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_13cupy_backends_4cuda_4libs_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 CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

static PyObject *__pyx_tp_new_13cupy_backends_4cuda_4libs_8cusparse_CsrAttributes(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  o = __Pyx_AllocateExtensionType(t, 0);
  if (unlikely(!o)) return 0;
  return o;
}

static void __pyx_tp_dealloc_13cupy_backends_4cuda_4libs_8cusparse_CsrAttributes(PyObject *o) {
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_13cupy_backends_4cuda_4libs_8cusparse_CsrAttributes) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyTypeObject *tp = Py_TYPE(o);
  #if CYTHON_USE_TYPE_SLOTS
  (*tp->tp_free)(o);
  #else
  {
    freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
    if (tp_free) tp_free(o);
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  Py_DECREF(tp);
  #endif
}

static PyObject *__pyx_getprop_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_rows(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_4rows_1__get__(o);
}

static int __pyx_setprop_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_rows(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_4rows_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_cols(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_4cols_1__get__(o);
}

static int __pyx_setprop_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_cols(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_4cols_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_nnz(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_3nnz_1__get__(o);
}

static int __pyx_setprop_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_nnz(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_3nnz_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_rowOffsets(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_10rowOffsets_1__get__(o);
}

static int __pyx_setprop_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_rowOffsets(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_10rowOffsets_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_colIdx(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_6colIdx_1__get__(o);
}

static int __pyx_setprop_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_colIdx(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_6colIdx_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_values(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_6values_1__get__(o);
}

static int __pyx_setprop_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_values(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_6values_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_rowOffsetType(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_13rowOffsetType_1__get__(o);
}

static int __pyx_setprop_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_rowOffsetType(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_13rowOffsetType_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_colIdxType(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_10colIdxType_1__get__(o);
}

static int __pyx_setprop_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_colIdxType(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_10colIdxType_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_idxBase(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_7idxBase_1__get__(o);
}

static int __pyx_setprop_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_idxBase(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_7idxBase_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_valueType(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_9valueType_1__get__(o);
}

static int __pyx_setprop_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_valueType(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_9valueType_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyMethodDef __pyx_methods_13cupy_backends_4cuda_4libs_8cusparse_CsrAttributes[] = {
  {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_3__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_5__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_4__setstate_cython__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_13cupy_backends_4cuda_4libs_8cusparse_CsrAttributes[] = {
  {"rows", __pyx_getprop_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_rows, __pyx_setprop_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_rows, PyDoc_STR("rows: 'int64_t'"), 0},
  {"cols", __pyx_getprop_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_cols, __pyx_setprop_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_cols, PyDoc_STR("cols: 'int64_t'"), 0},
  {"nnz", __pyx_getprop_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_nnz, __pyx_setprop_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_nnz, PyDoc_STR("nnz: 'int64_t'"), 0},
  {"rowOffsets", __pyx_getprop_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_rowOffsets, __pyx_setprop_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_rowOffsets, PyDoc_STR("rowOffsets: 'intptr_t'"), 0},
  {"colIdx", __pyx_getprop_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_colIdx, __pyx_setprop_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_colIdx, PyDoc_STR("colIdx: 'intptr_t'"), 0},
  {"values", __pyx_getprop_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_values, __pyx_setprop_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_values, PyDoc_STR("values: 'intptr_t'"), 0},
  {"rowOffsetType", __pyx_getprop_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_rowOffsetType, __pyx_setprop_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_rowOffsetType, PyDoc_STR("rowOffsetType: 'IndexType'"), 0},
  {"colIdxType", __pyx_getprop_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_colIdxType, __pyx_setprop_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_colIdxType, PyDoc_STR("colIdxType: 'IndexType'"), 0},
  {"idxBase", __pyx_getprop_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_idxBase, __pyx_setprop_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_idxBase, PyDoc_STR("idxBase: 'IndexBase'"), 0},
  {"valueType", __pyx_getprop_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_valueType, __pyx_setprop_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_valueType, PyDoc_STR("valueType: 'DataType'"), 0},
  {0, 0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_13cupy_backends_4cuda_4libs_8cusparse_CsrAttributes_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_13cupy_backends_4cuda_4libs_8cusparse_CsrAttributes},
  {Py_tp_doc, (void *)PyDoc_STR("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)")},
  {Py_tp_methods, (void *)__pyx_methods_13cupy_backends_4cuda_4libs_8cusparse_CsrAttributes},
  {Py_tp_getset, (void *)__pyx_getsets_13cupy_backends_4cuda_4libs_8cusparse_CsrAttributes},
  {Py_tp_init, (void *)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_1__init__},
  {Py_tp_new, (void *)__pyx_tp_new_13cupy_backends_4cuda_4libs_8cusparse_CsrAttributes},
  {0, 0},
};
static PyType_Spec __pyx_type_13cupy_backends_4cuda_4libs_8cusparse_CsrAttributes_spec = {
  "cupy_backends.cuda.libs.cusparse.CsrAttributes",
  sizeof(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CsrAttributes),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
  __pyx_type_13cupy_backends_4cuda_4libs_8cusparse_CsrAttributes_slots,
};
#else

static PyTypeObject __pyx_type_13cupy_backends_4cuda_4libs_8cusparse_CsrAttributes = {
  PyVarObject_HEAD_INIT(0, 0)
  "cupy_backends.cuda.libs.cusparse.""CsrAttributes", /*tp_name*/
  sizeof(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_CsrAttributes), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_13cupy_backends_4cuda_4libs_8cusparse_CsrAttributes, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  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*/
  PyDoc_STR("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_13cupy_backends_4cuda_4libs_8cusparse_CsrAttributes, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_13cupy_backends_4cuda_4libs_8cusparse_CsrAttributes, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_13CsrAttributes_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_13cupy_backends_4cuda_4libs_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 CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

static PyObject *__pyx_tp_new_13cupy_backends_4cuda_4libs_8cusparse_DnVecAttributes(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  o = __Pyx_AllocateExtensionType(t, 0);
  if (unlikely(!o)) return 0;
  return o;
}

static void __pyx_tp_dealloc_13cupy_backends_4cuda_4libs_8cusparse_DnVecAttributes(PyObject *o) {
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_13cupy_backends_4cuda_4libs_8cusparse_DnVecAttributes) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyTypeObject *tp = Py_TYPE(o);
  #if CYTHON_USE_TYPE_SLOTS
  (*tp->tp_free)(o);
  #else
  {
    freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
    if (tp_free) tp_free(o);
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  Py_DECREF(tp);
  #endif
}

static PyObject *__pyx_getprop_13cupy_backends_4cuda_4libs_8cusparse_15DnVecAttributes_size(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_15DnVecAttributes_4size_1__get__(o);
}

static int __pyx_setprop_13cupy_backends_4cuda_4libs_8cusparse_15DnVecAttributes_size(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_15DnVecAttributes_4size_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_13cupy_backends_4cuda_4libs_8cusparse_15DnVecAttributes_values(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_15DnVecAttributes_6values_1__get__(o);
}

static int __pyx_setprop_13cupy_backends_4cuda_4libs_8cusparse_15DnVecAttributes_values(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_15DnVecAttributes_6values_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_13cupy_backends_4cuda_4libs_8cusparse_15DnVecAttributes_valueType(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_15DnVecAttributes_9valueType_1__get__(o);
}

static int __pyx_setprop_13cupy_backends_4cuda_4libs_8cusparse_15DnVecAttributes_valueType(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_15DnVecAttributes_9valueType_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyMethodDef __pyx_methods_13cupy_backends_4cuda_4libs_8cusparse_DnVecAttributes[] = {
  {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_15DnVecAttributes_3__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_15DnVecAttributes_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_15DnVecAttributes_5__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_15DnVecAttributes_4__setstate_cython__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_13cupy_backends_4cuda_4libs_8cusparse_DnVecAttributes[] = {
  {"size", __pyx_getprop_13cupy_backends_4cuda_4libs_8cusparse_15DnVecAttributes_size, __pyx_setprop_13cupy_backends_4cuda_4libs_8cusparse_15DnVecAttributes_size, PyDoc_STR("size: 'int64_t'"), 0},
  {"values", __pyx_getprop_13cupy_backends_4cuda_4libs_8cusparse_15DnVecAttributes_values, __pyx_setprop_13cupy_backends_4cuda_4libs_8cusparse_15DnVecAttributes_values, PyDoc_STR("values: 'intptr_t'"), 0},
  {"valueType", __pyx_getprop_13cupy_backends_4cuda_4libs_8cusparse_15DnVecAttributes_valueType, __pyx_setprop_13cupy_backends_4cuda_4libs_8cusparse_15DnVecAttributes_valueType, PyDoc_STR("valueType: 'DataType'"), 0},
  {0, 0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_13cupy_backends_4cuda_4libs_8cusparse_DnVecAttributes_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_13cupy_backends_4cuda_4libs_8cusparse_DnVecAttributes},
  {Py_tp_doc, (void *)PyDoc_STR("DnVecAttributes(int64_t size, intptr_t values, DataType valueType)")},
  {Py_tp_methods, (void *)__pyx_methods_13cupy_backends_4cuda_4libs_8cusparse_DnVecAttributes},
  {Py_tp_getset, (void *)__pyx_getsets_13cupy_backends_4cuda_4libs_8cusparse_DnVecAttributes},
  {Py_tp_init, (void *)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_15DnVecAttributes_1__init__},
  {Py_tp_new, (void *)__pyx_tp_new_13cupy_backends_4cuda_4libs_8cusparse_DnVecAttributes},
  {0, 0},
};
static PyType_Spec __pyx_type_13cupy_backends_4cuda_4libs_8cusparse_DnVecAttributes_spec = {
  "cupy_backends.cuda.libs.cusparse.DnVecAttributes",
  sizeof(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_DnVecAttributes),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
  __pyx_type_13cupy_backends_4cuda_4libs_8cusparse_DnVecAttributes_slots,
};
#else

static PyTypeObject __pyx_type_13cupy_backends_4cuda_4libs_8cusparse_DnVecAttributes = {
  PyVarObject_HEAD_INIT(0, 0)
  "cupy_backends.cuda.libs.cusparse.""DnVecAttributes", /*tp_name*/
  sizeof(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_DnVecAttributes), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_13cupy_backends_4cuda_4libs_8cusparse_DnVecAttributes, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  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*/
  PyDoc_STR("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_13cupy_backends_4cuda_4libs_8cusparse_DnVecAttributes, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_13cupy_backends_4cuda_4libs_8cusparse_DnVecAttributes, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_15DnVecAttributes_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_13cupy_backends_4cuda_4libs_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 CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

static PyObject *__pyx_tp_new_13cupy_backends_4cuda_4libs_8cusparse_DnMatAttributes(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  o = __Pyx_AllocateExtensionType(t, 0);
  if (unlikely(!o)) return 0;
  return o;
}

static void __pyx_tp_dealloc_13cupy_backends_4cuda_4libs_8cusparse_DnMatAttributes(PyObject *o) {
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_13cupy_backends_4cuda_4libs_8cusparse_DnMatAttributes) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyTypeObject *tp = Py_TYPE(o);
  #if CYTHON_USE_TYPE_SLOTS
  (*tp->tp_free)(o);
  #else
  {
    freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
    if (tp_free) tp_free(o);
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  Py_DECREF(tp);
  #endif
}

static PyObject *__pyx_getprop_13cupy_backends_4cuda_4libs_8cusparse_15DnMatAttributes_rows(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_15DnMatAttributes_4rows_1__get__(o);
}

static int __pyx_setprop_13cupy_backends_4cuda_4libs_8cusparse_15DnMatAttributes_rows(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_15DnMatAttributes_4rows_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_13cupy_backends_4cuda_4libs_8cusparse_15DnMatAttributes_cols(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_15DnMatAttributes_4cols_1__get__(o);
}

static int __pyx_setprop_13cupy_backends_4cuda_4libs_8cusparse_15DnMatAttributes_cols(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_15DnMatAttributes_4cols_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_13cupy_backends_4cuda_4libs_8cusparse_15DnMatAttributes_ld(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_15DnMatAttributes_2ld_1__get__(o);
}

static int __pyx_setprop_13cupy_backends_4cuda_4libs_8cusparse_15DnMatAttributes_ld(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_15DnMatAttributes_2ld_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_13cupy_backends_4cuda_4libs_8cusparse_15DnMatAttributes_values(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_15DnMatAttributes_6values_1__get__(o);
}

static int __pyx_setprop_13cupy_backends_4cuda_4libs_8cusparse_15DnMatAttributes_values(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_15DnMatAttributes_6values_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_13cupy_backends_4cuda_4libs_8cusparse_15DnMatAttributes_valueType(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_15DnMatAttributes_9valueType_1__get__(o);
}

static int __pyx_setprop_13cupy_backends_4cuda_4libs_8cusparse_15DnMatAttributes_valueType(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_15DnMatAttributes_9valueType_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_13cupy_backends_4cuda_4libs_8cusparse_15DnMatAttributes_order(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_15DnMatAttributes_5order_1__get__(o);
}

static int __pyx_setprop_13cupy_backends_4cuda_4libs_8cusparse_15DnMatAttributes_order(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_15DnMatAttributes_5order_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyMethodDef __pyx_methods_13cupy_backends_4cuda_4libs_8cusparse_DnMatAttributes[] = {
  {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_15DnMatAttributes_3__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_15DnMatAttributes_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_15DnMatAttributes_5__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_15DnMatAttributes_4__setstate_cython__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_13cupy_backends_4cuda_4libs_8cusparse_DnMatAttributes[] = {
  {"rows", __pyx_getprop_13cupy_backends_4cuda_4libs_8cusparse_15DnMatAttributes_rows, __pyx_setprop_13cupy_backends_4cuda_4libs_8cusparse_15DnMatAttributes_rows, PyDoc_STR("rows: 'int64_t'"), 0},
  {"cols", __pyx_getprop_13cupy_backends_4cuda_4libs_8cusparse_15DnMatAttributes_cols, __pyx_setprop_13cupy_backends_4cuda_4libs_8cusparse_15DnMatAttributes_cols, PyDoc_STR("cols: 'int64_t'"), 0},
  {"ld", __pyx_getprop_13cupy_backends_4cuda_4libs_8cusparse_15DnMatAttributes_ld, __pyx_setprop_13cupy_backends_4cuda_4libs_8cusparse_15DnMatAttributes_ld, PyDoc_STR("ld: 'int64_t'"), 0},
  {"values", __pyx_getprop_13cupy_backends_4cuda_4libs_8cusparse_15DnMatAttributes_values, __pyx_setprop_13cupy_backends_4cuda_4libs_8cusparse_15DnMatAttributes_values, PyDoc_STR("values: 'intptr_t'"), 0},
  {"valueType", __pyx_getprop_13cupy_backends_4cuda_4libs_8cusparse_15DnMatAttributes_valueType, __pyx_setprop_13cupy_backends_4cuda_4libs_8cusparse_15DnMatAttributes_valueType, PyDoc_STR("valueType: 'DataType'"), 0},
  {"order", __pyx_getprop_13cupy_backends_4cuda_4libs_8cusparse_15DnMatAttributes_order, __pyx_setprop_13cupy_backends_4cuda_4libs_8cusparse_15DnMatAttributes_order, PyDoc_STR("order: 'Order'"), 0},
  {0, 0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_13cupy_backends_4cuda_4libs_8cusparse_DnMatAttributes_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_13cupy_backends_4cuda_4libs_8cusparse_DnMatAttributes},
  {Py_tp_doc, (void *)PyDoc_STR("DnMatAttributes(int64_t rows, int64_t cols, int64_t ld, intptr_t values, DataType valueType, Order order)")},
  {Py_tp_methods, (void *)__pyx_methods_13cupy_backends_4cuda_4libs_8cusparse_DnMatAttributes},
  {Py_tp_getset, (void *)__pyx_getsets_13cupy_backends_4cuda_4libs_8cusparse_DnMatAttributes},
  {Py_tp_init, (void *)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_15DnMatAttributes_1__init__},
  {Py_tp_new, (void *)__pyx_tp_new_13cupy_backends_4cuda_4libs_8cusparse_DnMatAttributes},
  {0, 0},
};
static PyType_Spec __pyx_type_13cupy_backends_4cuda_4libs_8cusparse_DnMatAttributes_spec = {
  "cupy_backends.cuda.libs.cusparse.DnMatAttributes",
  sizeof(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_DnMatAttributes),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
  __pyx_type_13cupy_backends_4cuda_4libs_8cusparse_DnMatAttributes_slots,
};
#else

static PyTypeObject __pyx_type_13cupy_backends_4cuda_4libs_8cusparse_DnMatAttributes = {
  PyVarObject_HEAD_INIT(0, 0)
  "cupy_backends.cuda.libs.cusparse.""DnMatAttributes", /*tp_name*/
  sizeof(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_DnMatAttributes), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_13cupy_backends_4cuda_4libs_8cusparse_DnMatAttributes, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  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*/
  PyDoc_STR("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_13cupy_backends_4cuda_4libs_8cusparse_DnMatAttributes, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_13cupy_backends_4cuda_4libs_8cusparse_DnMatAttributes, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_15DnMatAttributes_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_13cupy_backends_4cuda_4libs_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 CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

static PyObject *__pyx_tp_new_13cupy_backends_4cuda_4libs_8cusparse_DnMatBatchAttributes(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  o = __Pyx_AllocateExtensionType(t, 0);
  if (unlikely(!o)) return 0;
  return o;
}

static void __pyx_tp_dealloc_13cupy_backends_4cuda_4libs_8cusparse_DnMatBatchAttributes(PyObject *o) {
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_13cupy_backends_4cuda_4libs_8cusparse_DnMatBatchAttributes) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyTypeObject *tp = Py_TYPE(o);
  #if CYTHON_USE_TYPE_SLOTS
  (*tp->tp_free)(o);
  #else
  {
    freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
    if (tp_free) tp_free(o);
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  Py_DECREF(tp);
  #endif
}

static PyObject *__pyx_getprop_13cupy_backends_4cuda_4libs_8cusparse_20DnMatBatchAttributes_count(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_20DnMatBatchAttributes_5count_1__get__(o);
}

static int __pyx_setprop_13cupy_backends_4cuda_4libs_8cusparse_20DnMatBatchAttributes_count(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_20DnMatBatchAttributes_5count_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_13cupy_backends_4cuda_4libs_8cusparse_20DnMatBatchAttributes_stride(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_20DnMatBatchAttributes_6stride_1__get__(o);
}

static int __pyx_setprop_13cupy_backends_4cuda_4libs_8cusparse_20DnMatBatchAttributes_stride(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_20DnMatBatchAttributes_6stride_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyMethodDef __pyx_methods_13cupy_backends_4cuda_4libs_8cusparse_DnMatBatchAttributes[] = {
  {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_20DnMatBatchAttributes_3__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_20DnMatBatchAttributes_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_20DnMatBatchAttributes_5__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_20DnMatBatchAttributes_4__setstate_cython__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_13cupy_backends_4cuda_4libs_8cusparse_DnMatBatchAttributes[] = {
  {"count", __pyx_getprop_13cupy_backends_4cuda_4libs_8cusparse_20DnMatBatchAttributes_count, __pyx_setprop_13cupy_backends_4cuda_4libs_8cusparse_20DnMatBatchAttributes_count, PyDoc_STR("count: 'int'"), 0},
  {"stride", __pyx_getprop_13cupy_backends_4cuda_4libs_8cusparse_20DnMatBatchAttributes_stride, __pyx_setprop_13cupy_backends_4cuda_4libs_8cusparse_20DnMatBatchAttributes_stride, PyDoc_STR("stride: 'int64_t'"), 0},
  {0, 0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_13cupy_backends_4cuda_4libs_8cusparse_DnMatBatchAttributes_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_13cupy_backends_4cuda_4libs_8cusparse_DnMatBatchAttributes},
  {Py_tp_doc, (void *)PyDoc_STR("DnMatBatchAttributes(int count, int64_t stride)")},
  {Py_tp_methods, (void *)__pyx_methods_13cupy_backends_4cuda_4libs_8cusparse_DnMatBatchAttributes},
  {Py_tp_getset, (void *)__pyx_getsets_13cupy_backends_4cuda_4libs_8cusparse_DnMatBatchAttributes},
  {Py_tp_init, (void *)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_20DnMatBatchAttributes_1__init__},
  {Py_tp_new, (void *)__pyx_tp_new_13cupy_backends_4cuda_4libs_8cusparse_DnMatBatchAttributes},
  {0, 0},
};
static PyType_Spec __pyx_type_13cupy_backends_4cuda_4libs_8cusparse_DnMatBatchAttributes_spec = {
  "cupy_backends.cuda.libs.cusparse.DnMatBatchAttributes",
  sizeof(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_DnMatBatchAttributes),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
  __pyx_type_13cupy_backends_4cuda_4libs_8cusparse_DnMatBatchAttributes_slots,
};
#else

static PyTypeObject __pyx_type_13cupy_backends_4cuda_4libs_8cusparse_DnMatBatchAttributes = {
  PyVarObject_HEAD_INIT(0, 0)
  "cupy_backends.cuda.libs.cusparse.""DnMatBatchAttributes", /*tp_name*/
  sizeof(struct __pyx_obj_13cupy_backends_4cuda_4libs_8cusparse_DnMatBatchAttributes), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_13cupy_backends_4cuda_4libs_8cusparse_DnMatBatchAttributes, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  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*/
  PyDoc_STR("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_13cupy_backends_4cuda_4libs_8cusparse_DnMatBatchAttributes, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_13cupy_backends_4cuda_4libs_8cusparse_DnMatBatchAttributes, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  __pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_20DnMatBatchAttributes_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_13cupy_backends_4cuda_4libs_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 CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

static PyMethodDef __pyx_methods[] = {
  {"check_status", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_1check_status, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_check_status},
  {"getVersion", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_3getVersion, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_2getVersion},
  {"create", (PyCFunction)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_7create, METH_NOARGS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_6create},
  {"createMatDescr", (PyCFunction)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_9createMatDescr, METH_NOARGS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_8createMatDescr},
  {"destroy", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_11destroy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_10destroy},
  {"destroyMatDescr", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_13destroyMatDescr, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_12destroyMatDescr},
  {"setMatIndexBase", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_15setMatIndexBase, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_14setMatIndexBase},
  {"setMatType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_17setMatType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_16setMatType},
  {"setMatFillMode", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_19setMatFillMode, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_18setMatFillMode},
  {"setMatDiagType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_21setMatDiagType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_20setMatDiagType},
  {"setPointerMode", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_23setPointerMode, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_22setPointerMode},
  {"spMatSetAttribute", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_25spMatSetAttribute, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_24spMatSetAttribute},
  {"setStream", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_27setStream, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_26setStream},
  {"getStream", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_29getStream, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_28getStream},
  {"sgthr", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_31sgthr, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_30sgthr},
  {"dgthr", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_33dgthr, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_32dgthr},
  {"cgthr", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_35cgthr, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_34cgthr},
  {"zgthr", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_37zgthr, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_36zgthr},
  {"scsrmv", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_39scsrmv, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_38scsrmv},
  {"dcsrmv", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_41dcsrmv, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_40dcsrmv},
  {"ccsrmv", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_43ccsrmv, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_42ccsrmv},
  {"zcsrmv", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_45zcsrmv, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_44zcsrmv},
  {"csrmvEx_bufferSize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_47csrmvEx_bufferSize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_46csrmvEx_bufferSize},
  {"csrmvEx", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_49csrmvEx, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_48csrmvEx},
  {"createCsrsv2Info", (PyCFunction)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_51createCsrsv2Info, METH_NOARGS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_50createCsrsv2Info},
  {"destroyCsrsv2Info", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_53destroyCsrsv2Info, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_52destroyCsrsv2Info},
  {"scsrsv2_bufferSize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_55scsrsv2_bufferSize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_54scsrsv2_bufferSize},
  {"dcsrsv2_bufferSize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_57dcsrsv2_bufferSize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_56dcsrsv2_bufferSize},
  {"ccsrsv2_bufferSize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_59ccsrsv2_bufferSize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_58ccsrsv2_bufferSize},
  {"zcsrsv2_bufferSize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_61zcsrsv2_bufferSize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_60zcsrsv2_bufferSize},
  {"scsrsv2_analysis", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_63scsrsv2_analysis, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_62scsrsv2_analysis},
  {"dcsrsv2_analysis", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_65dcsrsv2_analysis, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_64dcsrsv2_analysis},
  {"ccsrsv2_analysis", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_67ccsrsv2_analysis, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_66ccsrsv2_analysis},
  {"zcsrsv2_analysis", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_69zcsrsv2_analysis, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_68zcsrsv2_analysis},
  {"scsrsv2_solve", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_71scsrsv2_solve, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_70scsrsv2_solve},
  {"dcsrsv2_solve", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_73dcsrsv2_solve, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_72dcsrsv2_solve},
  {"ccsrsv2_solve", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_75ccsrsv2_solve, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_74ccsrsv2_solve},
  {"zcsrsv2_solve", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_77zcsrsv2_solve, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_76zcsrsv2_solve},
  {"xcsrsv2_zeroPivot", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_79xcsrsv2_zeroPivot, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_78xcsrsv2_zeroPivot},
  {"scsrmm", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_81scsrmm, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_80scsrmm},
  {"dcsrmm", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_83dcsrmm, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_82dcsrmm},
  {"ccsrmm", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_85ccsrmm, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_84ccsrmm},
  {"zcsrmm", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_87zcsrmm, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_86zcsrmm},
  {"scsrmm2", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_89scsrmm2, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_88scsrmm2},
  {"dcsrmm2", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_91dcsrmm2, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_90dcsrmm2},
  {"ccsrmm2", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_93ccsrmm2, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_92ccsrmm2},
  {"zcsrmm2", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_95zcsrmm2, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_94zcsrmm2},
  {"createCsrsm2Info", (PyCFunction)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_97createCsrsm2Info, METH_NOARGS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_96createCsrsm2Info},
  {"destroyCsrsm2Info", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_99destroyCsrsm2Info, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_98destroyCsrsm2Info},
  {"scsrsm2_bufferSizeExt", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_101scsrsm2_bufferSizeExt, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_100scsrsm2_bufferSizeExt},
  {"dcsrsm2_bufferSizeExt", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_103dcsrsm2_bufferSizeExt, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_102dcsrsm2_bufferSizeExt},
  {"ccsrsm2_bufferSizeExt", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_105ccsrsm2_bufferSizeExt, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_104ccsrsm2_bufferSizeExt},
  {"zcsrsm2_bufferSizeExt", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_107zcsrsm2_bufferSizeExt, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_106zcsrsm2_bufferSizeExt},
  {"scsrsm2_analysis", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_109scsrsm2_analysis, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_108scsrsm2_analysis},
  {"dcsrsm2_analysis", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_111dcsrsm2_analysis, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_110dcsrsm2_analysis},
  {"ccsrsm2_analysis", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_113ccsrsm2_analysis, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_112ccsrsm2_analysis},
  {"zcsrsm2_analysis", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_115zcsrsm2_analysis, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_114zcsrsm2_analysis},
  {"scsrsm2_solve", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_117scsrsm2_solve, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_116scsrsm2_solve},
  {"dcsrsm2_solve", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_119dcsrsm2_solve, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_118dcsrsm2_solve},
  {"ccsrsm2_solve", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_121ccsrsm2_solve, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_120ccsrsm2_solve},
  {"zcsrsm2_solve", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_123zcsrsm2_solve, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_122zcsrsm2_solve},
  {"xcsrsm2_zeroPivot", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_125xcsrsm2_zeroPivot, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_124xcsrsm2_zeroPivot},
  {"xcsrgeamNnz", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_127xcsrgeamNnz, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_126xcsrgeamNnz},
  {"scsrgeam", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_129scsrgeam, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_128scsrgeam},
  {"dcsrgeam", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_131dcsrgeam, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_130dcsrgeam},
  {"ccsrgeam", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_133ccsrgeam, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_132ccsrgeam},
  {"zcsrgeam", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_135zcsrgeam, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_134zcsrgeam},
  {"scsrgeam2_bufferSizeExt", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_137scsrgeam2_bufferSizeExt, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_136scsrgeam2_bufferSizeExt},
  {"dcsrgeam2_bufferSizeExt", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_139dcsrgeam2_bufferSizeExt, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_138dcsrgeam2_bufferSizeExt},
  {"ccsrgeam2_bufferSizeExt", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_141ccsrgeam2_bufferSizeExt, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_140ccsrgeam2_bufferSizeExt},
  {"zcsrgeam2_bufferSizeExt", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_143zcsrgeam2_bufferSizeExt, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_142zcsrgeam2_bufferSizeExt},
  {"xcsrgeam2Nnz", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_145xcsrgeam2Nnz, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_144xcsrgeam2Nnz},
  {"scsrgeam2", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_147scsrgeam2, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_146scsrgeam2},
  {"dcsrgeam2", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_149dcsrgeam2, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_148dcsrgeam2},
  {"ccsrgeam2", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_151ccsrgeam2, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_150ccsrgeam2},
  {"zcsrgeam2", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_153zcsrgeam2, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_152zcsrgeam2},
  {"xcsrgemmNnz", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_155xcsrgemmNnz, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_154xcsrgemmNnz},
  {"scsrgemm", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_157scsrgemm, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_156scsrgemm},
  {"dcsrgemm", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_159dcsrgemm, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_158dcsrgemm},
  {"ccsrgemm", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_161ccsrgemm, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_160ccsrgemm},
  {"zcsrgemm", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_163zcsrgemm, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_162zcsrgemm},
  {"createCsrgemm2Info", (PyCFunction)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_165createCsrgemm2Info, METH_NOARGS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_164createCsrgemm2Info},
  {"destroyCsrgemm2Info", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_167destroyCsrgemm2Info, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_166destroyCsrgemm2Info},
  {"scsrgemm2_bufferSizeExt", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_169scsrgemm2_bufferSizeExt, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_168scsrgemm2_bufferSizeExt},
  {"dcsrgemm2_bufferSizeExt", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_171dcsrgemm2_bufferSizeExt, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_170dcsrgemm2_bufferSizeExt},
  {"ccsrgemm2_bufferSizeExt", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_173ccsrgemm2_bufferSizeExt, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_172ccsrgemm2_bufferSizeExt},
  {"zcsrgemm2_bufferSizeExt", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_175zcsrgemm2_bufferSizeExt, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_174zcsrgemm2_bufferSizeExt},
  {"xcsrgemm2Nnz", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_177xcsrgemm2Nnz, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_176xcsrgemm2Nnz},
  {"scsrgemm2", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_179scsrgemm2, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_178scsrgemm2},
  {"dcsrgemm2", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_181dcsrgemm2, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_180dcsrgemm2},
  {"ccsrgemm2", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_183ccsrgemm2, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_182ccsrgemm2},
  {"zcsrgemm2", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_185zcsrgemm2, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_184zcsrgemm2},
  {"xcoo2csr", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_187xcoo2csr, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_186xcoo2csr},
  {"scsc2dense", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_189scsc2dense, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_188scsc2dense},
  {"dcsc2dense", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_191dcsc2dense, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_190dcsc2dense},
  {"ccsc2dense", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_193ccsc2dense, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_192ccsc2dense},
  {"zcsc2dense", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_195zcsc2dense, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_194zcsc2dense},
  {"xcsr2coo", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_197xcsr2coo, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_196xcsr2coo},
  {"scsr2csc", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_199scsr2csc, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_198scsr2csc},
  {"dcsr2csc", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_201dcsr2csc, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_200dcsr2csc},
  {"ccsr2csc", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_203ccsr2csc, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_202ccsr2csc},
  {"zcsr2csc", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_205zcsr2csc, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_204zcsr2csc},
  {"scsr2dense", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_207scsr2dense, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_206scsr2dense},
  {"dcsr2dense", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_209dcsr2dense, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_208dcsr2dense},
  {"ccsr2dense", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_211ccsr2dense, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_210ccsr2dense},
  {"zcsr2dense", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_213zcsr2dense, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_212zcsr2dense},
  {"snnz_compress", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_215snnz_compress, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_214snnz_compress},
  {"dnnz_compress", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_217dnnz_compress, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_216dnnz_compress},
  {"cnnz_compress", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_219cnnz_compress, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_218cnnz_compress},
  {"znnz_compress", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_221znnz_compress, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_220znnz_compress},
  {"scsr2csr_compress", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_223scsr2csr_compress, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_222scsr2csr_compress},
  {"dcsr2csr_compress", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_225dcsr2csr_compress, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_224dcsr2csr_compress},
  {"ccsr2csr_compress", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_227ccsr2csr_compress, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_226ccsr2csr_compress},
  {"zcsr2csr_compress", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_229zcsr2csr_compress, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_228zcsr2csr_compress},
  {"sdense2csc", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_231sdense2csc, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_230sdense2csc},
  {"ddense2csc", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_233ddense2csc, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_232ddense2csc},
  {"cdense2csc", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_235cdense2csc, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_234cdense2csc},
  {"zdense2csc", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_237zdense2csc, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_236zdense2csc},
  {"sdense2csr", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_239sdense2csr, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_238sdense2csr},
  {"ddense2csr", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_241ddense2csr, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_240ddense2csr},
  {"cdense2csr", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_243cdense2csr, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_242cdense2csr},
  {"zdense2csr", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_245zdense2csr, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_244zdense2csr},
  {"snnz", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_247snnz, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_246snnz},
  {"dnnz", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_249dnnz, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_248dnnz},
  {"cnnz", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_251cnnz, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_250cnnz},
  {"znnz", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_253znnz, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_252znnz},
  {"createIdentityPermutation", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_255createIdentityPermutation, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_254createIdentityPermutation},
  {"xcoosort_bufferSizeExt", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_257xcoosort_bufferSizeExt, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_256xcoosort_bufferSizeExt},
  {"xcoosortByRow", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_259xcoosortByRow, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_258xcoosortByRow},
  {"xcoosortByColumn", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_261xcoosortByColumn, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_260xcoosortByColumn},
  {"xcsrsort_bufferSizeExt", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_263xcsrsort_bufferSizeExt, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_262xcsrsort_bufferSizeExt},
  {"xcsrsort", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_265xcsrsort, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_264xcsrsort},
  {"xcscsort_bufferSizeExt", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_267xcscsort_bufferSizeExt, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_266xcscsort_bufferSizeExt},
  {"xcscsort", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_269xcscsort, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_268xcscsort},
  {"createCsrilu02Info", (PyCFunction)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_271createCsrilu02Info, METH_NOARGS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_270createCsrilu02Info},
  {"destroyCsrilu02Info", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_273destroyCsrilu02Info, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_272destroyCsrilu02Info},
  {"createBsrilu02Info", (PyCFunction)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_275createBsrilu02Info, METH_NOARGS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_274createBsrilu02Info},
  {"destroyBsrilu02Info", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_277destroyBsrilu02Info, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_276destroyBsrilu02Info},
  {"createCsric02Info", (PyCFunction)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_279createCsric02Info, METH_NOARGS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_278createCsric02Info},
  {"destroyCsric02Info", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_281destroyCsric02Info, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_280destroyCsric02Info},
  {"createBsric02Info", (PyCFunction)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_283createBsric02Info, METH_NOARGS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_282createBsric02Info},
  {"destroyBsric02Info", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_285destroyBsric02Info, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_284destroyBsric02Info},
  {"scsrilu02_numericBoost", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_287scsrilu02_numericBoost, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_286scsrilu02_numericBoost},
  {"dcsrilu02_numericBoost", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_289dcsrilu02_numericBoost, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_288dcsrilu02_numericBoost},
  {"ccsrilu02_numericBoost", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_291ccsrilu02_numericBoost, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_290ccsrilu02_numericBoost},
  {"zcsrilu02_numericBoost", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_293zcsrilu02_numericBoost, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_292zcsrilu02_numericBoost},
  {"xcsrilu02_zeroPivot", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_295xcsrilu02_zeroPivot, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_294xcsrilu02_zeroPivot},
  {"scsrilu02_bufferSize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_297scsrilu02_bufferSize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_296scsrilu02_bufferSize},
  {"dcsrilu02_bufferSize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_299dcsrilu02_bufferSize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_298dcsrilu02_bufferSize},
  {"ccsrilu02_bufferSize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_301ccsrilu02_bufferSize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_300ccsrilu02_bufferSize},
  {"zcsrilu02_bufferSize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_303zcsrilu02_bufferSize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_302zcsrilu02_bufferSize},
  {"scsrilu02_analysis", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_305scsrilu02_analysis, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_304scsrilu02_analysis},
  {"dcsrilu02_analysis", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_307dcsrilu02_analysis, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_306dcsrilu02_analysis},
  {"ccsrilu02_analysis", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_309ccsrilu02_analysis, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_308ccsrilu02_analysis},
  {"zcsrilu02_analysis", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_311zcsrilu02_analysis, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_310zcsrilu02_analysis},
  {"scsrilu02", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_313scsrilu02, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_312scsrilu02},
  {"dcsrilu02", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_315dcsrilu02, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_314dcsrilu02},
  {"ccsrilu02", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_317ccsrilu02, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_316ccsrilu02},
  {"zcsrilu02", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_319zcsrilu02, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_318zcsrilu02},
  {"sbsrilu02_numericBoost", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_321sbsrilu02_numericBoost, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_320sbsrilu02_numericBoost},
  {"dbsrilu02_numericBoost", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_323dbsrilu02_numericBoost, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_322dbsrilu02_numericBoost},
  {"cbsrilu02_numericBoost", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_325cbsrilu02_numericBoost, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_324cbsrilu02_numericBoost},
  {"zbsrilu02_numericBoost", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_327zbsrilu02_numericBoost, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_326zbsrilu02_numericBoost},
  {"xbsrilu02_zeroPivot", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_329xbsrilu02_zeroPivot, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_328xbsrilu02_zeroPivot},
  {"sbsrilu02_bufferSize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_331sbsrilu02_bufferSize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_330sbsrilu02_bufferSize},
  {"dbsrilu02_bufferSize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_333dbsrilu02_bufferSize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_332dbsrilu02_bufferSize},
  {"cbsrilu02_bufferSize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_335cbsrilu02_bufferSize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_334cbsrilu02_bufferSize},
  {"zbsrilu02_bufferSize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_337zbsrilu02_bufferSize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_336zbsrilu02_bufferSize},
  {"sbsrilu02_analysis", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_339sbsrilu02_analysis, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_338sbsrilu02_analysis},
  {"dbsrilu02_analysis", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_341dbsrilu02_analysis, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_340dbsrilu02_analysis},
  {"cbsrilu02_analysis", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_343cbsrilu02_analysis, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_342cbsrilu02_analysis},
  {"zbsrilu02_analysis", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_345zbsrilu02_analysis, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_344zbsrilu02_analysis},
  {"sbsrilu02", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_347sbsrilu02, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_346sbsrilu02},
  {"dbsrilu02", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_349dbsrilu02, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_348dbsrilu02},
  {"cbsrilu02", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_351cbsrilu02, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_350cbsrilu02},
  {"zbsrilu02", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_353zbsrilu02, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_352zbsrilu02},
  {"xcsric02_zeroPivot", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_355xcsric02_zeroPivot, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_354xcsric02_zeroPivot},
  {"scsric02_bufferSize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_357scsric02_bufferSize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_356scsric02_bufferSize},
  {"dcsric02_bufferSize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_359dcsric02_bufferSize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_358dcsric02_bufferSize},
  {"ccsric02_bufferSize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_361ccsric02_bufferSize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_360ccsric02_bufferSize},
  {"zcsric02_bufferSize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_363zcsric02_bufferSize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_362zcsric02_bufferSize},
  {"scsric02_analysis", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_365scsric02_analysis, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_364scsric02_analysis},
  {"dcsric02_analysis", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_367dcsric02_analysis, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_366dcsric02_analysis},
  {"ccsric02_analysis", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_369ccsric02_analysis, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_368ccsric02_analysis},
  {"zcsric02_analysis", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_371zcsric02_analysis, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_370zcsric02_analysis},
  {"scsric02", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_373scsric02, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_372scsric02},
  {"dcsric02", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_375dcsric02, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_374dcsric02},
  {"ccsric02", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_377ccsric02, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_376ccsric02},
  {"zcsric02", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_379zcsric02, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_378zcsric02},
  {"xbsric02_zeroPivot", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_381xbsric02_zeroPivot, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_380xbsric02_zeroPivot},
  {"sbsric02_bufferSize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_383sbsric02_bufferSize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_382sbsric02_bufferSize},
  {"dbsric02_bufferSize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_385dbsric02_bufferSize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_384dbsric02_bufferSize},
  {"cbsric02_bufferSize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_387cbsric02_bufferSize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_386cbsric02_bufferSize},
  {"zbsric02_bufferSize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_389zbsric02_bufferSize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_388zbsric02_bufferSize},
  {"sbsric02_analysis", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_391sbsric02_analysis, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_390sbsric02_analysis},
  {"dbsric02_analysis", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_393dbsric02_analysis, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_392dbsric02_analysis},
  {"cbsric02_analysis", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_395cbsric02_analysis, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_394cbsric02_analysis},
  {"zbsric02_analysis", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_397zbsric02_analysis, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_396zbsric02_analysis},
  {"sbsric02", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_399sbsric02, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_398sbsric02},
  {"dbsric02", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_401dbsric02, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_400dbsric02},
  {"cbsric02", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_403cbsric02, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_402cbsric02},
  {"zbsric02", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_405zbsric02, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_404zbsric02},
  {"sgtsv2_bufferSizeExt", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_407sgtsv2_bufferSizeExt, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_406sgtsv2_bufferSizeExt},
  {"dgtsv2_bufferSizeExt", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_409dgtsv2_bufferSizeExt, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_408dgtsv2_bufferSizeExt},
  {"cgtsv2_bufferSizeExt", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_411cgtsv2_bufferSizeExt, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_410cgtsv2_bufferSizeExt},
  {"zgtsv2_bufferSizeExt", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_413zgtsv2_bufferSizeExt, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_412zgtsv2_bufferSizeExt},
  {"sgtsv2", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_415sgtsv2, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_414sgtsv2},
  {"dgtsv2", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_417dgtsv2, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_416dgtsv2},
  {"cgtsv2", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_419cgtsv2, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_418cgtsv2},
  {"zgtsv2", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_421zgtsv2, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_420zgtsv2},
  {"sgtsv2_nopivot_bufferSizeExt", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_423sgtsv2_nopivot_bufferSizeExt, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_422sgtsv2_nopivot_bufferSizeExt},
  {"dgtsv2_nopivot_bufferSizeExt", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_425dgtsv2_nopivot_bufferSizeExt, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_424dgtsv2_nopivot_bufferSizeExt},
  {"cgtsv2_nopivot_bufferSizeExt", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_427cgtsv2_nopivot_bufferSizeExt, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_426cgtsv2_nopivot_bufferSizeExt},
  {"zgtsv2_nopivot_bufferSizeExt", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_429zgtsv2_nopivot_bufferSizeExt, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_428zgtsv2_nopivot_bufferSizeExt},
  {"sgtsv2_nopivot", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_431sgtsv2_nopivot, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_430sgtsv2_nopivot},
  {"dgtsv2_nopivot", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_433dgtsv2_nopivot, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_432dgtsv2_nopivot},
  {"cgtsv2_nopivot", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_435cgtsv2_nopivot, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_434cgtsv2_nopivot},
  {"zgtsv2_nopivot", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_437zgtsv2_nopivot, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_436zgtsv2_nopivot},
  {"sgtsv2StridedBatch_bufferSizeExt", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_439sgtsv2StridedBatch_bufferSizeExt, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_438sgtsv2StridedBatch_bufferSizeExt},
  {"dgtsv2StridedBatch_bufferSizeExt", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_441dgtsv2StridedBatch_bufferSizeExt, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_440dgtsv2StridedBatch_bufferSizeExt},
  {"cgtsv2StridedBatch_bufferSizeExt", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_443cgtsv2StridedBatch_bufferSizeExt, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_442cgtsv2StridedBatch_bufferSizeExt},
  {"zgtsv2StridedBatch_bufferSizeExt", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_445zgtsv2StridedBatch_bufferSizeExt, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_444zgtsv2StridedBatch_bufferSizeExt},
  {"sgtsv2StridedBatch", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_447sgtsv2StridedBatch, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_446sgtsv2StridedBatch},
  {"dgtsv2StridedBatch", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_449dgtsv2StridedBatch, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_448dgtsv2StridedBatch},
  {"cgtsv2StridedBatch", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_451cgtsv2StridedBatch, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_450cgtsv2StridedBatch},
  {"zgtsv2StridedBatch", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_453zgtsv2StridedBatch, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_452zgtsv2StridedBatch},
  {"sgtsvInterleavedBatch_bufferSizeExt", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_455sgtsvInterleavedBatch_bufferSizeExt, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_454sgtsvInterleavedBatch_bufferSizeExt},
  {"dgtsvInterleavedBatch_bufferSizeExt", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_457dgtsvInterleavedBatch_bufferSizeExt, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_456dgtsvInterleavedBatch_bufferSizeExt},
  {"cgtsvInterleavedBatch_bufferSizeExt", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_459cgtsvInterleavedBatch_bufferSizeExt, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_458cgtsvInterleavedBatch_bufferSizeExt},
  {"zgtsvInterleavedBatch_bufferSizeExt", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_461zgtsvInterleavedBatch_bufferSizeExt, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_460zgtsvInterleavedBatch_bufferSizeExt},
  {"sgtsvInterleavedBatch", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_463sgtsvInterleavedBatch, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_462sgtsvInterleavedBatch},
  {"dgtsvInterleavedBatch", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_465dgtsvInterleavedBatch, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_464dgtsvInterleavedBatch},
  {"cgtsvInterleavedBatch", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_467cgtsvInterleavedBatch, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_466cgtsvInterleavedBatch},
  {"zgtsvInterleavedBatch", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_469zgtsvInterleavedBatch, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_468zgtsvInterleavedBatch},
  {"sgpsvInterleavedBatch_bufferSizeExt", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_471sgpsvInterleavedBatch_bufferSizeExt, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_470sgpsvInterleavedBatch_bufferSizeExt},
  {"dgpsvInterleavedBatch_bufferSizeExt", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_473dgpsvInterleavedBatch_bufferSizeExt, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_472dgpsvInterleavedBatch_bufferSizeExt},
  {"cgpsvInterleavedBatch_bufferSizeExt", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_475cgpsvInterleavedBatch_bufferSizeExt, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_474cgpsvInterleavedBatch_bufferSizeExt},
  {"zgpsvInterleavedBatch_bufferSizeExt", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_477zgpsvInterleavedBatch_bufferSizeExt, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_476zgpsvInterleavedBatch_bufferSizeExt},
  {"sgpsvInterleavedBatch", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_479sgpsvInterleavedBatch, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_478sgpsvInterleavedBatch},
  {"dgpsvInterleavedBatch", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_481dgpsvInterleavedBatch, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_480dgpsvInterleavedBatch},
  {"cgpsvInterleavedBatch", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_483cgpsvInterleavedBatch, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_482cgpsvInterleavedBatch},
  {"zgpsvInterleavedBatch", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_485zgpsvInterleavedBatch, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_484zgpsvInterleavedBatch},
  {"createSpVec", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_487createSpVec, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_486createSpVec},
  {"destroySpVec", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_489destroySpVec, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_488destroySpVec},
  {"spVecGet", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_491spVecGet, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_490spVecGet},
  {"spVecGetIndexBase", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_493spVecGetIndexBase, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_492spVecGetIndexBase},
  {"spVecGetValues", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_495spVecGetValues, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_494spVecGetValues},
  {"spVecSetValues", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_497spVecSetValues, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_496spVecSetValues},
  {"createCoo", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_499createCoo, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_498createCoo},
  {"createCooAoS", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_501createCooAoS, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_500createCooAoS},
  {"createCsr", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_503createCsr, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_502createCsr},
  {"createCsc", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_505createCsc, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_504createCsc},
  {"destroySpMat", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_507destroySpMat, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_506destroySpMat},
  {"cooGet", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_509cooGet, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_508cooGet},
  {"cooAoSGet", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_511cooAoSGet, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_510cooAoSGet},
  {"csrGet", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_513csrGet, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_512csrGet},
  {"csrSetPointers", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_515csrSetPointers, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_514csrSetPointers},
  {"spMatGetFormat", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_517spMatGetFormat, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_516spMatGetFormat},
  {"spMatGetIndexBase", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_519spMatGetIndexBase, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_518spMatGetIndexBase},
  {"spMatGetValues", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_521spMatGetValues, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_520spMatGetValues},
  {"spMatSetValues", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_523spMatSetValues, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_522spMatSetValues},
  {"spMatGetSize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_525spMatGetSize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_524spMatGetSize},
  {"spMatGetStridedBatch", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_527spMatGetStridedBatch, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_526spMatGetStridedBatch},
  {"spMatSetStridedBatch", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_529spMatSetStridedBatch, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_528spMatSetStridedBatch},
  {"createDnVec", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_531createDnVec, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_530createDnVec},
  {"destroyDnVec", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_533destroyDnVec, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_532destroyDnVec},
  {"dnVecGet", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_535dnVecGet, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_534dnVecGet},
  {"dnVecGetValues", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_537dnVecGetValues, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_536dnVecGetValues},
  {"dnVecSetValues", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_539dnVecSetValues, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_538dnVecSetValues},
  {"createDnMat", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_541createDnMat, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_540createDnMat},
  {"destroyDnMat", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_543destroyDnMat, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_542destroyDnMat},
  {"dnMatGet", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_545dnMatGet, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_544dnMatGet},
  {"dnMatGetValues", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_547dnMatGetValues, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_546dnMatGetValues},
  {"dnMatSetValues", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_549dnMatSetValues, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_548dnMatSetValues},
  {"dnMatGetStridedBatch", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_551dnMatGetStridedBatch, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_550dnMatGetStridedBatch},
  {"dnMatSetStridedBatch", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_553dnMatSetStridedBatch, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_552dnMatSetStridedBatch},
  {"spVV_bufferSize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_555spVV_bufferSize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_554spVV_bufferSize},
  {"spVV", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_557spVV, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_556spVV},
  {"spMV_bufferSize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_559spMV_bufferSize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_558spMV_bufferSize},
  {"spMV", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_561spMV, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_560spMV},
  {"spSM_createDescr", (PyCFunction)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_563spSM_createDescr, METH_NOARGS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_562spSM_createDescr},
  {"spSM_destroyDescr", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_565spSM_destroyDescr, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_564spSM_destroyDescr},
  {"spSM_bufferSize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_567spSM_bufferSize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_566spSM_bufferSize},
  {"spSM_analysis", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_569spSM_analysis, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_568spSM_analysis},
  {"spSM_solve", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_571spSM_solve, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_570spSM_solve},
  {"spMM_bufferSize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_573spMM_bufferSize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_572spMM_bufferSize},
  {"spMM", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_575spMM, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_574spMM},
  {"constrainedGeMM_bufferSize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_577constrainedGeMM_bufferSize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_576constrainedGeMM_bufferSize},
  {"constrainedGeMM", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_579constrainedGeMM, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_578constrainedGeMM},
  {"spGEMM_createDescr", (PyCFunction)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_581spGEMM_createDescr, METH_NOARGS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_580spGEMM_createDescr},
  {"spGEMM_destroyDescr", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_583spGEMM_destroyDescr, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_582spGEMM_destroyDescr},
  {"spGEMM_workEstimation", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_585spGEMM_workEstimation, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_584spGEMM_workEstimation},
  {"spGEMM_compute", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_587spGEMM_compute, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_586spGEMM_compute},
  {"spGEMM_copy", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_589spGEMM_copy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_588spGEMM_copy},
  {"spGEAM_createDescr", (PyCFunction)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_591spGEAM_createDescr, METH_NOARGS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_590spGEAM_createDescr},
  {"spGEAM_destroyDescr", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_593spGEAM_destroyDescr, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_592spGEAM_destroyDescr},
  {"spGEAM_bufferSize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_595spGEAM_bufferSize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_594spGEAM_bufferSize},
  {"spGEAM_nnz", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_597spGEAM_nnz, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_596spGEAM_nnz},
  {"spGEAM", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_599spGEAM, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_598spGEAM},
  {"gather", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_601gather, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_600gather},
  {"sparseToDense_bufferSize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_603sparseToDense_bufferSize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_602sparseToDense_bufferSize},
  {"sparseToDense", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_605sparseToDense, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_604sparseToDense},
  {"denseToSparse_bufferSize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_607denseToSparse_bufferSize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_606denseToSparse_bufferSize},
  {"denseToSparse_analysis", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_609denseToSparse_analysis, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_608denseToSparse_analysis},
  {"denseToSparse_convert", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_611denseToSparse_convert, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_610denseToSparse_convert},
  {"csr2cscEx2_bufferSize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_613csr2cscEx2_bufferSize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_612csr2cscEx2_bufferSize},
  {"csr2cscEx2", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cupy_backends_4cuda_4libs_8cusparse_615csr2cscEx2, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_13cupy_backends_4cuda_4libs_8cusparse_614csr2cscEx2},
  {0, 0, 0, 0}
};
/* #### Code section: initfunc_declarations ### */
static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_InitConstants(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate); /*proto*/
/* #### Code section: init_module ### */

static int __Pyx_modinit_global_init_code(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  CYTHON_UNUSED_VAR(__pyx_mstate);
  __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
  /*--- Global init code ---*/
  __pyx_v_13cupy_backends_4cuda_4libs_8cusparse__libname = Py_None; Py_INCREF(Py_None);
  __pyx_v_13cupy_backends_4cuda_4libs_8cusparse__handle = Py_None; Py_INCREF(Py_None);
  __pyx_v_13cupy_backends_4cuda_4libs_8cusparse__lib = ((struct __pyx_obj_13cupy_backends_4cuda_9_softlink_SoftLink *)Py_None); Py_INCREF(Py_None);
  __pyx_v_13cupy_backends_4cuda_4libs_8cusparse_HIP_STATUS = ((PyObject*)Py_None); Py_INCREF(Py_None);
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_variable_export_code(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  CYTHON_UNUSED_VAR(__pyx_mstate);
  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
  /*--- Variable export code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_function_export_code(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  CYTHON_UNUSED_VAR(__pyx_mstate);
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
  /*--- Function export code ---*/
  {
    __pyx_t_1 = __Pyx_ApiExport_GetApiDict(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    const char * __pyx_export_signature = __Pyx_PyBytes_AsString(__pyx_mstate_global->__pyx_kp_b_intptr_t_int___pyx_skip_dispatch);
    #if !CYTHON_ASSUME_SAFE_MACROS
    if (unlikely(!__pyx_export_signature)) __PYX_ERR(0, 1, __pyx_L1_error)
    #endif
    const char * __pyx_export_name = __pyx_export_signature + 76;
    void (*const __pyx_export_pointers[])(void) = {(void (*)(void))&__pyx_f_13cupy_backends_4cuda_4libs_8cusparse_create, (void (*)(void))&__pyx_f_13cupy_backends_4cuda_4libs_8cusparse_destroy, (void (*)(void)) NULL};
    void (*const *__pyx_export_pointer)(void) = __pyx_export_pointers;
    const char *__pyx_export_current_signature = __pyx_export_signature;
    while (*__pyx_export_pointer) {
      if (__Pyx_ExportFunction(__pyx_t_1, __pyx_export_name, *__pyx_export_pointer, __pyx_export_current_signature) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
      ++__pyx_export_pointer;
      __pyx_export_name = strchr(__pyx_export_name, '\0') + 1;
      __pyx_export_signature = strchr(__pyx_export_signature, '\0') + 1;
      if (*__pyx_export_signature != '\0') __pyx_export_current_signature = __pyx_export_signature;
    }
    __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_type_init_code(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  CYTHON_UNUSED_VAR(__pyx_mstate);
  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 CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_13cupy_backends_4cuda_4libs_8cusparse_SpVecAttributes = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_13cupy_backends_4cuda_4libs_8cusparse_SpVecAttributes_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_13cupy_backends_4cuda_4libs_8cusparse_SpVecAttributes)) __PYX_ERR(0, 1431, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_13cupy_backends_4cuda_4libs_8cusparse_SpVecAttributes_spec, __pyx_mstate->__pyx_ptype_13cupy_backends_4cuda_4libs_8cusparse_SpVecAttributes) < (0)) __PYX_ERR(0, 1431, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_13cupy_backends_4cuda_4libs_8cusparse_SpVecAttributes = &__pyx_type_13cupy_backends_4cuda_4libs_8cusparse_SpVecAttributes;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_13cupy_backends_4cuda_4libs_8cusparse_SpVecAttributes) < (0)) __PYX_ERR(0, 1431, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_13cupy_backends_4cuda_4libs_8cusparse_SpVecAttributes);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_13cupy_backends_4cuda_4libs_8cusparse_SpVecAttributes->tp_dictoffset && __pyx_mstate->__pyx_ptype_13cupy_backends_4cuda_4libs_8cusparse_SpVecAttributes->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_13cupy_backends_4cuda_4libs_8cusparse_SpVecAttributes->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_SpVecAttributes, (PyObject *) __pyx_mstate->__pyx_ptype_13cupy_backends_4cuda_4libs_8cusparse_SpVecAttributes) < (0)) __PYX_ERR(0, 1431, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_13cupy_backends_4cuda_4libs_8cusparse_SpVecAttributes) < (0)) __PYX_ERR(0, 1431, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_13cupy_backends_4cuda_4libs_8cusparse_CooAttributes = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_13cupy_backends_4cuda_4libs_8cusparse_CooAttributes_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_13cupy_backends_4cuda_4libs_8cusparse_CooAttributes)) __PYX_ERR(0, 1445, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_13cupy_backends_4cuda_4libs_8cusparse_CooAttributes_spec, __pyx_mstate->__pyx_ptype_13cupy_backends_4cuda_4libs_8cusparse_CooAttributes) < (0)) __PYX_ERR(0, 1445, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_13cupy_backends_4cuda_4libs_8cusparse_CooAttributes = &__pyx_type_13cupy_backends_4cuda_4libs_8cusparse_CooAttributes;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_13cupy_backends_4cuda_4libs_8cusparse_CooAttributes) < (0)) __PYX_ERR(0, 1445, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_13cupy_backends_4cuda_4libs_8cusparse_CooAttributes);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_13cupy_backends_4cuda_4libs_8cusparse_CooAttributes->tp_dictoffset && __pyx_mstate->__pyx_ptype_13cupy_backends_4cuda_4libs_8cusparse_CooAttributes->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_13cupy_backends_4cuda_4libs_8cusparse_CooAttributes->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_CooAttributes, (PyObject *) __pyx_mstate->__pyx_ptype_13cupy_backends_4cuda_4libs_8cusparse_CooAttributes) < (0)) __PYX_ERR(0, 1445, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_13cupy_backends_4cuda_4libs_8cusparse_CooAttributes) < (0)) __PYX_ERR(0, 1445, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_13cupy_backends_4cuda_4libs_8cusparse_CooAoSAttributes = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_13cupy_backends_4cuda_4libs_8cusparse_CooAoSAttributes_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_13cupy_backends_4cuda_4libs_8cusparse_CooAoSAttributes)) __PYX_ERR(0, 1461, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_13cupy_backends_4cuda_4libs_8cusparse_CooAoSAttributes_spec, __pyx_mstate->__pyx_ptype_13cupy_backends_4cuda_4libs_8cusparse_CooAoSAttributes) < (0)) __PYX_ERR(0, 1461, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_13cupy_backends_4cuda_4libs_8cusparse_CooAoSAttributes = &__pyx_type_13cupy_backends_4cuda_4libs_8cusparse_CooAoSAttributes;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_13cupy_backends_4cuda_4libs_8cusparse_CooAoSAttributes) < (0)) __PYX_ERR(0, 1461, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_13cupy_backends_4cuda_4libs_8cusparse_CooAoSAttributes);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_13cupy_backends_4cuda_4libs_8cusparse_CooAoSAttributes->tp_dictoffset && __pyx_mstate->__pyx_ptype_13cupy_backends_4cuda_4libs_8cusparse_CooAoSAttributes->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_13cupy_backends_4cuda_4libs_8cusparse_CooAoSAttributes->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_CooAoSAttributes, (PyObject *) __pyx_mstate->__pyx_ptype_13cupy_backends_4cuda_4libs_8cusparse_CooAoSAttributes) < (0)) __PYX_ERR(0, 1461, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_13cupy_backends_4cuda_4libs_8cusparse_CooAoSAttributes) < (0)) __PYX_ERR(0, 1461, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_13cupy_backends_4cuda_4libs_8cusparse_CsrAttributes = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_13cupy_backends_4cuda_4libs_8cusparse_CsrAttributes_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_13cupy_backends_4cuda_4libs_8cusparse_CsrAttributes)) __PYX_ERR(0, 1476, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_13cupy_backends_4cuda_4libs_8cusparse_CsrAttributes_spec, __pyx_mstate->__pyx_ptype_13cupy_backends_4cuda_4libs_8cusparse_CsrAttributes) < (0)) __PYX_ERR(0, 1476, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_13cupy_backends_4cuda_4libs_8cusparse_CsrAttributes = &__pyx_type_13cupy_backends_4cuda_4libs_8cusparse_CsrAttributes;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_13cupy_backends_4cuda_4libs_8cusparse_CsrAttributes) < (0)) __PYX_ERR(0, 1476, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_13cupy_backends_4cuda_4libs_8cusparse_CsrAttributes);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_13cupy_backends_4cuda_4libs_8cusparse_CsrAttributes->tp_dictoffset && __pyx_mstate->__pyx_ptype_13cupy_backends_4cuda_4libs_8cusparse_CsrAttributes->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_13cupy_backends_4cuda_4libs_8cusparse_CsrAttributes->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_CsrAttributes, (PyObject *) __pyx_mstate->__pyx_ptype_13cupy_backends_4cuda_4libs_8cusparse_CsrAttributes) < (0)) __PYX_ERR(0, 1476, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_13cupy_backends_4cuda_4libs_8cusparse_CsrAttributes) < (0)) __PYX_ERR(0, 1476, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_13cupy_backends_4cuda_4libs_8cusparse_DnVecAttributes = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_13cupy_backends_4cuda_4libs_8cusparse_DnVecAttributes_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_13cupy_backends_4cuda_4libs_8cusparse_DnVecAttributes)) __PYX_ERR(0, 1494, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_13cupy_backends_4cuda_4libs_8cusparse_DnVecAttributes_spec, __pyx_mstate->__pyx_ptype_13cupy_backends_4cuda_4libs_8cusparse_DnVecAttributes) < (0)) __PYX_ERR(0, 1494, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_13cupy_backends_4cuda_4libs_8cusparse_DnVecAttributes = &__pyx_type_13cupy_backends_4cuda_4libs_8cusparse_DnVecAttributes;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_13cupy_backends_4cuda_4libs_8cusparse_DnVecAttributes) < (0)) __PYX_ERR(0, 1494, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_13cupy_backends_4cuda_4libs_8cusparse_DnVecAttributes);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_13cupy_backends_4cuda_4libs_8cusparse_DnVecAttributes->tp_dictoffset && __pyx_mstate->__pyx_ptype_13cupy_backends_4cuda_4libs_8cusparse_DnVecAttributes->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_13cupy_backends_4cuda_4libs_8cusparse_DnVecAttributes->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_DnVecAttributes, (PyObject *) __pyx_mstate->__pyx_ptype_13cupy_backends_4cuda_4libs_8cusparse_DnVecAttributes) < (0)) __PYX_ERR(0, 1494, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_13cupy_backends_4cuda_4libs_8cusparse_DnVecAttributes) < (0)) __PYX_ERR(0, 1494, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_13cupy_backends_4cuda_4libs_8cusparse_DnMatAttributes = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_13cupy_backends_4cuda_4libs_8cusparse_DnMatAttributes_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_13cupy_backends_4cuda_4libs_8cusparse_DnMatAttributes)) __PYX_ERR(0, 1502, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_13cupy_backends_4cuda_4libs_8cusparse_DnMatAttributes_spec, __pyx_mstate->__pyx_ptype_13cupy_backends_4cuda_4libs_8cusparse_DnMatAttributes) < (0)) __PYX_ERR(0, 1502, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_13cupy_backends_4cuda_4libs_8cusparse_DnMatAttributes = &__pyx_type_13cupy_backends_4cuda_4libs_8cusparse_DnMatAttributes;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_13cupy_backends_4cuda_4libs_8cusparse_DnMatAttributes) < (0)) __PYX_ERR(0, 1502, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_13cupy_backends_4cuda_4libs_8cusparse_DnMatAttributes);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_13cupy_backends_4cuda_4libs_8cusparse_DnMatAttributes->tp_dictoffset && __pyx_mstate->__pyx_ptype_13cupy_backends_4cuda_4libs_8cusparse_DnMatAttributes->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_13cupy_backends_4cuda_4libs_8cusparse_DnMatAttributes->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_DnMatAttributes, (PyObject *) __pyx_mstate->__pyx_ptype_13cupy_backends_4cuda_4libs_8cusparse_DnMatAttributes) < (0)) __PYX_ERR(0, 1502, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_13cupy_backends_4cuda_4libs_8cusparse_DnMatAttributes) < (0)) __PYX_ERR(0, 1502, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_13cupy_backends_4cuda_4libs_8cusparse_DnMatBatchAttributes = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_13cupy_backends_4cuda_4libs_8cusparse_DnMatBatchAttributes_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_13cupy_backends_4cuda_4libs_8cusparse_DnMatBatchAttributes)) __PYX_ERR(0, 1514, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_13cupy_backends_4cuda_4libs_8cusparse_DnMatBatchAttributes_spec, __pyx_mstate->__pyx_ptype_13cupy_backends_4cuda_4libs_8cusparse_DnMatBatchAttributes) < (0)) __PYX_ERR(0, 1514, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_13cupy_backends_4cuda_4libs_8cusparse_DnMatBatchAttributes = &__pyx_type_13cupy_backends_4cuda_4libs_8cusparse_DnMatBatchAttributes;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_13cupy_backends_4cuda_4libs_8cusparse_DnMatBatchAttributes) < (0)) __PYX_ERR(0, 1514, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_13cupy_backends_4cuda_4libs_8cusparse_DnMatBatchAttributes);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_13cupy_backends_4cuda_4libs_8cusparse_DnMatBatchAttributes->tp_dictoffset && __pyx_mstate->__pyx_ptype_13cupy_backends_4cuda_4libs_8cusparse_DnMatBatchAttributes->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_13cupy_backends_4cuda_4libs_8cusparse_DnMatBatchAttributes->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_DnMatBatchAttributes, (PyObject *) __pyx_mstate->__pyx_ptype_13cupy_backends_4cuda_4libs_8cusparse_DnMatBatchAttributes) < (0)) __PYX_ERR(0, 1514, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_13cupy_backends_4cuda_4libs_8cusparse_DnMatBatchAttributes) < (0)) __PYX_ERR(0, 1514, __pyx_L1_error)
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_modinit_type_import_code(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  CYTHON_UNUSED_VAR(__pyx_mstate);
  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_backends.cuda.api.runtime"); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_mstate->__pyx_ptype_13cupy_backends_4cuda_3api_7runtime_PointerAttributes = __Pyx_ImportType_3_2_5(__pyx_t_1, "cupy_backends.cuda.api.runtime", "PointerAttributes",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_13cupy_backends_4cuda_3api_7runtime_PointerAttributes), __PYX_GET_STRUCT_ALIGNMENT_3_2_5(struct __pyx_obj_13cupy_backends_4cuda_3api_7runtime_PointerAttributes),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_13cupy_backends_4cuda_3api_7runtime_PointerAttributes), __PYX_GET_STRUCT_ALIGNMENT_3_2_5(struct __pyx_obj_13cupy_backends_4cuda_3api_7runtime_PointerAttributes),
  #else
  sizeof(struct __pyx_obj_13cupy_backends_4cuda_3api_7runtime_PointerAttributes), __PYX_GET_STRUCT_ALIGNMENT_3_2_5(struct __pyx_obj_13cupy_backends_4cuda_3api_7runtime_PointerAttributes),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_5); if (!__pyx_mstate->__pyx_ptype_13cupy_backends_4cuda_3api_7runtime_PointerAttributes) __PYX_ERR(3, 8, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_13cupy_backends_4cuda_3api_7runtime_MemPoolProps = __Pyx_ImportType_3_2_5(__pyx_t_1, "cupy_backends.cuda.api.runtime", "MemPoolProps",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_13cupy_backends_4cuda_3api_7runtime_MemPoolProps), __PYX_GET_STRUCT_ALIGNMENT_3_2_5(struct __pyx_obj_13cupy_backends_4cuda_3api_7runtime_MemPoolProps),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_13cupy_backends_4cuda_3api_7runtime_MemPoolProps), __PYX_GET_STRUCT_ALIGNMENT_3_2_5(struct __pyx_obj_13cupy_backends_4cuda_3api_7runtime_MemPoolProps),
  #else
  sizeof(struct __pyx_obj_13cupy_backends_4cuda_3api_7runtime_MemPoolProps), __PYX_GET_STRUCT_ALIGNMENT_3_2_5(struct __pyx_obj_13cupy_backends_4cuda_3api_7runtime_MemPoolProps),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_5); if (!__pyx_mstate->__pyx_ptype_13cupy_backends_4cuda_3api_7runtime_MemPoolProps) __PYX_ERR(3, 15, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyImport_ImportModule("cupy_backends.cuda._softlink"); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_mstate->__pyx_ptype_13cupy_backends_4cuda_9_softlink_SoftLink = __Pyx_ImportType_3_2_5(__pyx_t_1, "cupy_backends.cuda._softlink", "SoftLink",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_13cupy_backends_4cuda_9_softlink_SoftLink), __PYX_GET_STRUCT_ALIGNMENT_3_2_5(struct __pyx_obj_13cupy_backends_4cuda_9_softlink_SoftLink),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_13cupy_backends_4cuda_9_softlink_SoftLink), __PYX_GET_STRUCT_ALIGNMENT_3_2_5(struct __pyx_obj_13cupy_backends_4cuda_9_softlink_SoftLink),
  #else
  sizeof(struct __pyx_obj_13cupy_backends_4cuda_9_softlink_SoftLink), __PYX_GET_STRUCT_ALIGNMENT_3_2_5(struct __pyx_obj_13cupy_backends_4cuda_9_softlink_SoftLink),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_5); if (!__pyx_mstate->__pyx_ptype_13cupy_backends_4cuda_9_softlink_SoftLink) __PYX_ERR(4, 3, __pyx_L1_error)
  __pyx_vtabptr_13cupy_backends_4cuda_9_softlink_SoftLink = (struct __pyx_vtabstruct_13cupy_backends_4cuda_9_softlink_SoftLink*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_13cupy_backends_4cuda_9_softlink_SoftLink); if (unlikely(!__pyx_vtabptr_13cupy_backends_4cuda_9_softlink_SoftLink)) __PYX_ERR(4, 3, __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(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  CYTHON_UNUSED_VAR(__pyx_mstate);
  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_backends.cuda.api.runtime"); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    const char * __pyx_import_signature = __Pyx_PyBytes_AsString(__pyx_mstate_global->__pyx_kp_b_int__is_hip_environment_deviceAt);
    #if !CYTHON_ASSUME_SAFE_MACROS
    if (unlikely(!__pyx_import_signature)) __PYX_ERR(0, 1, __pyx_L1_error)
    #endif
    const char * __pyx_import_name = __pyx_import_signature + 11;
    void **const __pyx_import_pointers[] = {(void **)&__pyx_vp_13cupy_backends_4cuda_3api_7runtime__is_hip_environment, (void **)&__pyx_vp_13cupy_backends_4cuda_3api_7runtime_deviceAttributeComputeCapabilityMajor, (void **)&__pyx_vp_13cupy_backends_4cuda_3api_7runtime_deviceAttributeComputeCapabilityMinor, (void **)&__pyx_vp_13cupy_backends_4cuda_3api_7runtime_errorContextIsDestroyed, (void **)&__pyx_vp_13cupy_backends_4cuda_3api_7runtime_errorInvalidResourceHandle, (void **)&__pyx_vp_13cupy_backends_4cuda_3api_7runtime_errorInvalidValue, (void **)&__pyx_vp_13cupy_backends_4cuda_3api_7runtime_errorMemoryAllocation, (void **)&__pyx_vp_13cupy_backends_4cuda_3api_7runtime_errorPeerAccessAlreadyEnabled, (void **) NULL};
    void **const *__pyx_import_pointer = __pyx_import_pointers;
    const char *__pyx_import_current_signature = __pyx_import_signature;
    while (*__pyx_import_pointer) {
      if (__Pyx_ImportVoidPtr_3_2_5(__pyx_t_1, __pyx_import_name, *__pyx_import_pointer, __pyx_import_current_signature) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
      ++__pyx_import_pointer;
      __pyx_import_name = strchr(__pyx_import_name, '\0') + 1;
      __pyx_import_signature = strchr(__pyx_import_signature, '\0') + 1;
      if (*__pyx_import_signature != '\0') __pyx_import_current_signature = __pyx_import_signature;
    }
    __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(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  CYTHON_UNUSED_VAR(__pyx_mstate);
  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_backends.cuda.api.runtime"); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    const char * __pyx_import_signature = __Pyx_PyBytes_AsString(__pyx_mstate_global->__pyx_kp_b_int_intptr_t_int___pyx_skip_disp);
    #if !CYTHON_ASSUME_SAFE_MACROS
    if (unlikely(!__pyx_import_signature)) __PYX_ERR(0, 1, __pyx_L1_error)
    #endif
    const char * __pyx_import_name = __pyx_import_signature + 40;
    void (**const __pyx_import_pointers[])(void) = {(void (**)(void))&__pyx_f_13cupy_backends_4cuda_3api_7runtime_streamIsCapturing, (void (**)(void)) NULL};
    void (**const *__pyx_import_pointer)(void) = __pyx_import_pointers;
    const char *__pyx_import_current_signature = __pyx_import_signature;
    while (*__pyx_import_pointer) {
      if (__Pyx_ImportFunction_3_2_5(__pyx_t_1, __pyx_import_name, *__pyx_import_pointer, __pyx_import_current_signature) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
      ++__pyx_import_pointer;
      __pyx_import_name = strchr(__pyx_import_name, '\0') + 1;
      __pyx_import_signature = strchr(__pyx_import_signature, '\0') + 1;
      if (*__pyx_import_signature != '\0') __pyx_import_current_signature = __pyx_import_signature;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  {
    __pyx_t_1 = PyImport_ImportModule("cupy_backends.cuda.stream"); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    const char * __pyx_import_signature = __Pyx_PyBytes_AsString(__pyx_mstate_global->__pyx_kp_b_intptr_t_void_get_current_stream);
    #if !CYTHON_ASSUME_SAFE_MACROS
    if (unlikely(!__pyx_import_signature)) __PYX_ERR(0, 1, __pyx_L1_error)
    #endif
    const char * __pyx_import_name = __pyx_import_signature + 16;
    void (**const __pyx_import_pointers[])(void) = {(void (**)(void))&__pyx_f_13cupy_backends_4cuda_6stream_get_current_stream_ptr, (void (**)(void)) NULL};
    void (**const *__pyx_import_pointer)(void) = __pyx_import_pointers;
    const char *__pyx_import_current_signature = __pyx_import_signature;
    while (*__pyx_import_pointer) {
      if (__Pyx_ImportFunction_3_2_5(__pyx_t_1, __pyx_import_name, *__pyx_import_pointer, __pyx_import_current_signature) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
      ++__pyx_import_pointer;
      __pyx_import_name = strchr(__pyx_import_name, '\0') + 1;
      __pyx_import_signature = strchr(__pyx_import_signature, '\0') + 1;
      if (*__pyx_import_signature != '\0') __pyx_import_current_signature = __pyx_import_signature;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_RefNannyFinishContext();
  return -1;
}

#if 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},
  #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
  {Py_mod_gil, __Pyx_FREETHREADING_COMPATIBLE},
  #endif
  #if PY_VERSION_HEX >= 0x030C0000 && CYTHON_USE_MODULE_STATE
  {Py_mod_multiple_interpreters, Py_MOD_MULTIPLE_INTERPRETERS_NOT_SUPPORTED},
  #endif
  {0, NULL}
};
#endif

#ifdef __cplusplus
namespace {
  struct PyModuleDef __pyx_moduledef =
  #else
  static struct PyModuleDef __pyx_moduledef =
  #endif
  {
      PyModuleDef_HEAD_INIT,
      "cusparse",
      0, /* m_doc */
    #if CYTHON_USE_MODULE_STATE
      sizeof(__pyx_mstatetype), /* m_size */
    #else
      (CYTHON_PEP489_MULTI_PHASE_INIT) ? 0 : -1, /* m_size */
    #endif
      __pyx_methods /* m_methods */,
    #if CYTHON_PEP489_MULTI_PHASE_INIT
      __pyx_moduledef_slots, /* m_slots */
    #else
      NULL, /* m_reload */
    #endif
    #if CYTHON_USE_MODULE_STATE
      __pyx_m_traverse, /* m_traverse */
      __pyx_m_clear, /* m_clear */
      NULL /* m_free */
    #else
      NULL, /* m_traverse */
      NULL, /* m_clear */
      NULL /* m_free */
    #endif
  };
  #ifdef __cplusplus
} /* anonymous namespace */
#endif

/* PyModInitFuncType */
#ifndef CYTHON_NO_PYINIT_EXPORT
  #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
#else
  #ifdef __cplusplus
  #define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
  #else
  #define __Pyx_PyMODINIT_FUNC PyObject *
  #endif
#endif

__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);
}
/* ModuleCreationPEP489 */
#if CYTHON_COMPILING_IN_LIMITED_API && (__PYX_LIMITED_VERSION_HEX < 0x03090000\
      || ((defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)) && __PYX_LIMITED_VERSION_HEX < 0x030A0000))
static PY_INT64_T __Pyx_GetCurrentInterpreterId(void) {
    {
        PyObject *module = PyImport_ImportModule("_interpreters"); // 3.13+ I think
        if (!module) {
            PyErr_Clear(); // just try the 3.8-3.12 version
            module = PyImport_ImportModule("_xxsubinterpreters");
            if (!module) goto bad;
        }
        PyObject *current = PyObject_CallMethod(module, "get_current", NULL);
        Py_DECREF(module);
        if (!current) goto bad;
        if (PyTuple_Check(current)) {
            PyObject *new_current = PySequence_GetItem(current, 0);
            Py_DECREF(current);
            current = new_current;
            if (!new_current) goto bad;
        }
        long long as_c_int = PyLong_AsLongLong(current);
        Py_DECREF(current);
        return as_c_int;
    }
  bad:
    PySys_WriteStderr("__Pyx_GetCurrentInterpreterId failed. Try setting the C define CYTHON_PEP489_MULTI_PHASE_INIT=0\n");
    return -1;
}
#endif
#if !CYTHON_USE_MODULE_STATE
static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
    static PY_INT64_T main_interpreter_id = -1;
#if CYTHON_COMPILING_IN_GRAAL && defined(GRAALPY_VERSION_NUM) && GRAALPY_VERSION_NUM > 0x19000000
    PY_INT64_T current_id = GraalPyInterpreterState_GetIDFromThreadState(PyThreadState_Get());
#elif CYTHON_COMPILING_IN_GRAAL
    PY_INT64_T current_id = PyInterpreterState_GetIDFromThreadState(PyThreadState_Get());
#elif CYTHON_COMPILING_IN_LIMITED_API && (__PYX_LIMITED_VERSION_HEX < 0x03090000\
      || ((defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)) && __PYX_LIMITED_VERSION_HEX < 0x030A0000))
    PY_INT64_T current_id = __Pyx_GetCurrentInterpreterId();
#elif CYTHON_COMPILING_IN_LIMITED_API
    PY_INT64_T current_id = PyInterpreterState_GetID(PyInterpreterState_Get());
#else
    PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
#endif
    if (unlikely(current_id == -1)) {
        return -1;
    }
    if (main_interpreter_id == -1) {
        main_interpreter_id = current_id;
        return 0;
    } else if (unlikely(main_interpreter_id != current_id)) {
        PyErr_SetString(
            PyExc_ImportError,
            "Interpreter change detected - this module can only be loaded into one interpreter per process.");
        return -1;
    }
    return 0;
}
#endif
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, PyModuleDef *def) {
    PyObject *module = NULL, *moddict, *modname;
    CYTHON_UNUSED_VAR(def);
    #if !CYTHON_USE_MODULE_STATE
    if (__Pyx_check_single_interpreter())
        return NULL;
    #endif
    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
{
  int stringtab_initialized = 0;
  #if CYTHON_USE_MODULE_STATE
  int pystate_addmodule_run = 0;
  #endif
  __pyx_mstatetype *__pyx_mstate = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  size_t __pyx_t_7;
  __pyx_t_13cupy_backends_4cuda_9_softlink_func_ptr __pyx_t_8;
  PyObject *__pyx_t_9 = 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;
  }
  #else
  if (__pyx_m) return __Pyx_NewRef(__pyx_m);
  #endif
  /*--- Module creation code ---*/
  #if CYTHON_PEP489_MULTI_PHASE_INIT
  __pyx_t_1 = __pyx_pyinit_module;
  Py_INCREF(__pyx_t_1);
  #else
  __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #if CYTHON_USE_MODULE_STATE
  {
    int add_module_result = __Pyx_State_AddModule(__pyx_t_1, &__pyx_moduledef);
    __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "cusparse" pseudovariable */
    if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
    pystate_addmodule_run = 1;
  }
  #else
  __pyx_m = __pyx_t_1;
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
  PyUnstable_Module_SetGIL(__pyx_m, Py_MOD_GIL_NOT_USED);
  #endif
  __pyx_mstate = __pyx_mstate_global;
  CYTHON_UNUSED_VAR(__pyx_t_1);
  __pyx_mstate->__pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_mstate->__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
  Py_INCREF(__pyx_mstate->__pyx_d);
  __pyx_mstate->__pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_mstate->__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_cython_runtime = __Pyx_PyImport_AddModuleRef("cython_runtime"); if (unlikely(!__pyx_mstate->__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_mstate->__pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  /* ImportRefnannyAPI */
  #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("PyInit_cusparse", 0);
  __Pyx_init_runtime_version();
  if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_mstate->__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_mstate->__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_mstate->__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
  /*--- Library function declarations ---*/
  /*--- Initialize various global constants etc. ---*/
  if (__Pyx_InitConstants(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
  stringtab_initialized = 1;
  if (__Pyx_InitGlobals() < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__pyx_module_is_main_cupy_backends__cuda__libs__cusparse) {
    if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_name, __pyx_mstate_global->__pyx_n_u_main) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
  }
  {
    PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
    if (!PyDict_GetItemString(modules, "cupy_backends.cuda.libs.cusparse")) {
      if (unlikely((PyDict_SetItemString(modules, "cupy_backends.cuda.libs.cusparse", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
    }
  }
  /*--- Builtin init code ---*/
  if (__Pyx_InitCachedBuiltins(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
  /*--- Constants init code ---*/
  if (__Pyx_InitCachedConstants(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_CreateCodeObjects(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
  /*--- Global type/function init code ---*/
  (void)__Pyx_modinit_global_init_code(__pyx_mstate);
  (void)__Pyx_modinit_variable_export_code(__pyx_mstate);
  if (unlikely((__Pyx_modinit_function_export_code(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
  if (unlikely((__Pyx_modinit_type_init_code(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
  if (unlikely((__Pyx_modinit_type_import_code(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
  if (unlikely((__Pyx_modinit_variable_import_code(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
  if (unlikely((__Pyx_modinit_function_import_code(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
  /*--- Execution code ---*/

  /* "cupy_backends/cuda/libs/cusparse.pyx":1
 * import sys as _sys  # no-cython-lint             # <<<<<<<<<<<<<<
 * cimport cython  # NOQA
 * 
*/
  __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_sys, 0, 0, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_t_2 = __pyx_t_1;
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_sys_2, __pyx_t_2) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":1377
 * # TODO(leofang): Since we already require CUDA 12.0+, these code can probably
 * # be removed entirely.
 * cdef object _libname = None             # <<<<<<<<<<<<<<
 * cdef object _handle = 0
 * IF 12000 <= CUPY_CUDA_VERSION:
*/
  __Pyx_INCREF(Py_None);
  __Pyx_XGOTREF(__pyx_v_13cupy_backends_4cuda_4libs_8cusparse__libname);
  __Pyx_DECREF_SET(__pyx_v_13cupy_backends_4cuda_4libs_8cusparse__libname, Py_None);
  __Pyx_GIVEREF(Py_None);

  /* "cupy_backends/cuda/libs/cusparse.pyx":1378
 * # be removed entirely.
 * cdef object _libname = None
 * cdef object _handle = 0             # <<<<<<<<<<<<<<
 * IF 12000 <= CUPY_CUDA_VERSION:
 *     # We let libname be None here to avoid loading the library twice,
*/
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0);
  __Pyx_XGOTREF(__pyx_v_13cupy_backends_4cuda_4libs_8cusparse__handle);
  __Pyx_DECREF_SET(__pyx_v_13cupy_backends_4cuda_4libs_8cusparse__handle, __pyx_mstate_global->__pyx_int_0);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_0);

  /* "cupy_backends/cuda/libs/cusparse.pyx":1382
 *     # We let libname be None here to avoid loading the library twice,
 *     # which could potentially be loading different versions of the library.
 *     from cuda import pathfinder             # <<<<<<<<<<<<<<
 *     loaded_dl = pathfinder.load_nvidia_dynamic_lib('cusparse')
 *     _handle = loaded_dl._handle_uint
*/
  {
    PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_pathfinder};
    __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_cuda, __pyx_imported_names, 1, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1382, __pyx_L1_error)
  }
  __pyx_t_2 = __pyx_t_1;
  __Pyx_GOTREF(__pyx_t_2);
  {
    PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_pathfinder};
    __pyx_t_3 = 0; {
      __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_2, __pyx_imported_names[__pyx_t_3]); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1382, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_imported_names[__pyx_t_3], __pyx_t_4) < (0)) __PYX_ERR(0, 1382, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":1383
 *     # which could potentially be loading different versions of the library.
 *     from cuda import pathfinder
 *     loaded_dl = pathfinder.load_nvidia_dynamic_lib('cusparse')             # <<<<<<<<<<<<<<
 *     _handle = loaded_dl._handle_uint
 * ELIF 0 < CUPY_HIP_VERSION:
*/
  __pyx_t_4 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_pathfinder); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1383, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_load_nvidia_dynamic_lib); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1383, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_7 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_n_u_cusparse};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1383, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_loaded_dl, __pyx_t_2) < (0)) __PYX_ERR(0, 1383, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":1384
 *     from cuda import pathfinder
 *     loaded_dl = pathfinder.load_nvidia_dynamic_lib('cusparse')
 *     _handle = loaded_dl._handle_uint             # <<<<<<<<<<<<<<
 * ELIF 0 < CUPY_HIP_VERSION:
 *     _libname = __file__
*/
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_loaded_dl); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1384, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_handle_uint); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1384, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_XGOTREF(__pyx_v_13cupy_backends_4cuda_4libs_8cusparse__handle);
  __Pyx_DECREF_SET(__pyx_v_13cupy_backends_4cuda_4libs_8cusparse__handle, __pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_t_6 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":1388
 *     _libname = __file__
 * 
 * cdef SoftLink _lib = SoftLink(_libname, 'cusparse', handle=_handle)             # <<<<<<<<<<<<<<
 * # cuSPARSE 11.6+ (CUDA 11.3.1+)
 * cdef f_type cusparseSpSM_createDescr = <f_type>_lib.get('SpSM_createDescr')
*/
  __pyx_t_2 = NULL;
  __pyx_t_7 = 1;
  {
    PyObject *__pyx_callargs[3 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_2, __pyx_v_13cupy_backends_4cuda_4libs_8cusparse__libname, __pyx_mstate_global->__pyx_n_u_cusparse};
    __pyx_t_4 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1388, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_handle, __pyx_v_13cupy_backends_4cuda_4libs_8cusparse__handle, __pyx_t_4, __pyx_callargs+3, 0) < (0)) __PYX_ERR(0, 1388, __pyx_L1_error)
    __pyx_t_6 = __Pyx_Object_Vectorcall_CallFromBuilder((PyObject*)__pyx_mstate_global->__pyx_ptype_13cupy_backends_4cuda_9_softlink_SoftLink, __pyx_callargs+__pyx_t_7, (3-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_4);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1388, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_6);
  }
  __Pyx_XGOTREF((PyObject *)__pyx_v_13cupy_backends_4cuda_4libs_8cusparse__lib);
  __Pyx_DECREF_SET(__pyx_v_13cupy_backends_4cuda_4libs_8cusparse__lib, ((struct __pyx_obj_13cupy_backends_4cuda_9_softlink_SoftLink *)__pyx_t_6));
  __Pyx_GIVEREF((PyObject *)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":1390
 * cdef SoftLink _lib = SoftLink(_libname, 'cusparse', handle=_handle)
 * # cuSPARSE 11.6+ (CUDA 11.3.1+)
 * cdef f_type cusparseSpSM_createDescr = <f_type>_lib.get('SpSM_createDescr')             # <<<<<<<<<<<<<<
 * cdef f_type cusparseSpSM_destroyDescr = <f_type>_lib.get('SpSM_destroyDescr')
 * cdef f_type cusparseSpSM_bufferSize = <f_type>_lib.get('SpSM_bufferSize')
*/
  __pyx_t_8 = ((struct __pyx_vtabstruct_13cupy_backends_4cuda_9_softlink_SoftLink *)__pyx_v_13cupy_backends_4cuda_4libs_8cusparse__lib->__pyx_vtab)->get(__pyx_v_13cupy_backends_4cuda_4libs_8cusparse__lib, __pyx_mstate_global->__pyx_n_u_SpSM_createDescr); if (unlikely(__pyx_t_8 == ((void *)NULL))) __PYX_ERR(0, 1390, __pyx_L1_error)
  __pyx_v_13cupy_backends_4cuda_4libs_8cusparse_cusparseSpSM_createDescr = ((__pyx_t_13cupy_backends_4cuda_4libs_8cusparse_f_type)__pyx_t_8);

  /* "cupy_backends/cuda/libs/cusparse.pyx":1391
 * # cuSPARSE 11.6+ (CUDA 11.3.1+)
 * cdef f_type cusparseSpSM_createDescr = <f_type>_lib.get('SpSM_createDescr')
 * cdef f_type cusparseSpSM_destroyDescr = <f_type>_lib.get('SpSM_destroyDescr')             # <<<<<<<<<<<<<<
 * cdef f_type cusparseSpSM_bufferSize = <f_type>_lib.get('SpSM_bufferSize')
 * cdef f_type cusparseSpSM_analysis = <f_type>_lib.get('SpSM_analysis')
*/
  __pyx_t_8 = ((struct __pyx_vtabstruct_13cupy_backends_4cuda_9_softlink_SoftLink *)__pyx_v_13cupy_backends_4cuda_4libs_8cusparse__lib->__pyx_vtab)->get(__pyx_v_13cupy_backends_4cuda_4libs_8cusparse__lib, __pyx_mstate_global->__pyx_n_u_SpSM_destroyDescr); if (unlikely(__pyx_t_8 == ((void *)NULL))) __PYX_ERR(0, 1391, __pyx_L1_error)
  __pyx_v_13cupy_backends_4cuda_4libs_8cusparse_cusparseSpSM_destroyDescr = ((__pyx_t_13cupy_backends_4cuda_4libs_8cusparse_f_type)__pyx_t_8);

  /* "cupy_backends/cuda/libs/cusparse.pyx":1392
 * cdef f_type cusparseSpSM_createDescr = <f_type>_lib.get('SpSM_createDescr')
 * cdef f_type cusparseSpSM_destroyDescr = <f_type>_lib.get('SpSM_destroyDescr')
 * cdef f_type cusparseSpSM_bufferSize = <f_type>_lib.get('SpSM_bufferSize')             # <<<<<<<<<<<<<<
 * cdef f_type cusparseSpSM_analysis = <f_type>_lib.get('SpSM_analysis')
 * cdef f_type cusparseSpSM_solve = <f_type>_lib.get('SpSM_solve')
*/
  __pyx_t_8 = ((struct __pyx_vtabstruct_13cupy_backends_4cuda_9_softlink_SoftLink *)__pyx_v_13cupy_backends_4cuda_4libs_8cusparse__lib->__pyx_vtab)->get(__pyx_v_13cupy_backends_4cuda_4libs_8cusparse__lib, __pyx_mstate_global->__pyx_n_u_SpSM_bufferSize); if (unlikely(__pyx_t_8 == ((void *)NULL))) __PYX_ERR(0, 1392, __pyx_L1_error)
  __pyx_v_13cupy_backends_4cuda_4libs_8cusparse_cusparseSpSM_bufferSize = ((__pyx_t_13cupy_backends_4cuda_4libs_8cusparse_f_type)__pyx_t_8);

  /* "cupy_backends/cuda/libs/cusparse.pyx":1393
 * cdef f_type cusparseSpSM_destroyDescr = <f_type>_lib.get('SpSM_destroyDescr')
 * cdef f_type cusparseSpSM_bufferSize = <f_type>_lib.get('SpSM_bufferSize')
 * cdef f_type cusparseSpSM_analysis = <f_type>_lib.get('SpSM_analysis')             # <<<<<<<<<<<<<<
 * cdef f_type cusparseSpSM_solve = <f_type>_lib.get('SpSM_solve')
 * # cuSPARSE 11.5+ (CUDA 11.3.0+)
*/
  __pyx_t_8 = ((struct __pyx_vtabstruct_13cupy_backends_4cuda_9_softlink_SoftLink *)__pyx_v_13cupy_backends_4cuda_4libs_8cusparse__lib->__pyx_vtab)->get(__pyx_v_13cupy_backends_4cuda_4libs_8cusparse__lib, __pyx_mstate_global->__pyx_n_u_SpSM_analysis); if (unlikely(__pyx_t_8 == ((void *)NULL))) __PYX_ERR(0, 1393, __pyx_L1_error)
  __pyx_v_13cupy_backends_4cuda_4libs_8cusparse_cusparseSpSM_analysis = ((__pyx_t_13cupy_backends_4cuda_4libs_8cusparse_f_type)__pyx_t_8);

  /* "cupy_backends/cuda/libs/cusparse.pyx":1394
 * cdef f_type cusparseSpSM_bufferSize = <f_type>_lib.get('SpSM_bufferSize')
 * cdef f_type cusparseSpSM_analysis = <f_type>_lib.get('SpSM_analysis')
 * cdef f_type cusparseSpSM_solve = <f_type>_lib.get('SpSM_solve')             # <<<<<<<<<<<<<<
 * # cuSPARSE 11.5+ (CUDA 11.3.0+)
 * cdef f_type cusparseSpMatSetAttribute = <f_type>_lib.get('SpMatSetAttribute')
*/
  __pyx_t_8 = ((struct __pyx_vtabstruct_13cupy_backends_4cuda_9_softlink_SoftLink *)__pyx_v_13cupy_backends_4cuda_4libs_8cusparse__lib->__pyx_vtab)->get(__pyx_v_13cupy_backends_4cuda_4libs_8cusparse__lib, __pyx_mstate_global->__pyx_n_u_SpSM_solve); if (unlikely(__pyx_t_8 == ((void *)NULL))) __PYX_ERR(0, 1394, __pyx_L1_error)
  __pyx_v_13cupy_backends_4cuda_4libs_8cusparse_cusparseSpSM_solve = ((__pyx_t_13cupy_backends_4cuda_4libs_8cusparse_f_type)__pyx_t_8);

  /* "cupy_backends/cuda/libs/cusparse.pyx":1396
 * cdef f_type cusparseSpSM_solve = <f_type>_lib.get('SpSM_solve')
 * # cuSPARSE 11.5+ (CUDA 11.3.0+)
 * cdef f_type cusparseSpMatSetAttribute = <f_type>_lib.get('SpMatSetAttribute')             # <<<<<<<<<<<<<<
 * # cuSPARSE 11.3.1+ (CUDA 11.2.0+)
 * cdef f_type cusparseCreateCsc = <f_type>_lib.get('CreateCsc')
*/
  __pyx_t_8 = ((struct __pyx_vtabstruct_13cupy_backends_4cuda_9_softlink_SoftLink *)__pyx_v_13cupy_backends_4cuda_4libs_8cusparse__lib->__pyx_vtab)->get(__pyx_v_13cupy_backends_4cuda_4libs_8cusparse__lib, __pyx_mstate_global->__pyx_n_u_SpMatSetAttribute); if (unlikely(__pyx_t_8 == ((void *)NULL))) __PYX_ERR(0, 1396, __pyx_L1_error)
  __pyx_v_13cupy_backends_4cuda_4libs_8cusparse_cusparseSpMatSetAttribute = ((__pyx_t_13cupy_backends_4cuda_4libs_8cusparse_f_type)__pyx_t_8);

  /* "cupy_backends/cuda/libs/cusparse.pyx":1398
 * cdef f_type cusparseSpMatSetAttribute = <f_type>_lib.get('SpMatSetAttribute')
 * # cuSPARSE 11.3.1+ (CUDA 11.2.0+)
 * cdef f_type cusparseCreateCsc = <f_type>_lib.get('CreateCsc')             # <<<<<<<<<<<<<<
 * # cuSPARSE 11.3+ (CUDA 11.1.1+)
 * # Note: CUDA 11.1.0 contains cuSPARSE 11.2.0.275
*/
  __pyx_t_8 = ((struct __pyx_vtabstruct_13cupy_backends_4cuda_9_softlink_SoftLink *)__pyx_v_13cupy_backends_4cuda_4libs_8cusparse__lib->__pyx_vtab)->get(__pyx_v_13cupy_backends_4cuda_4libs_8cusparse__lib, __pyx_mstate_global->__pyx_n_u_CreateCsc); if (unlikely(__pyx_t_8 == ((void *)NULL))) __PYX_ERR(0, 1398, __pyx_L1_error)
  __pyx_v_13cupy_backends_4cuda_4libs_8cusparse_cusparseCreateCsc = ((__pyx_t_13cupy_backends_4cuda_4libs_8cusparse_f_type)__pyx_t_8);

  /* "cupy_backends/cuda/libs/cusparse.pyx":1401
 * # cuSPARSE 11.3+ (CUDA 11.1.1+)
 * # Note: CUDA 11.1.0 contains cuSPARSE 11.2.0.275
 * cdef f_type cusparseSparseToDense_bufferSize = <f_type>_lib.get('SparseToDense_bufferSize')  # NOQA             # <<<<<<<<<<<<<<
 * cdef f_type cusparseSparseToDense = <f_type>_lib.get('SparseToDense')
 * cdef f_type cusparseDenseToSparse_bufferSize = <f_type>_lib.get('DenseToSparse_bufferSize')  # NOQA
*/
  __pyx_t_8 = ((struct __pyx_vtabstruct_13cupy_backends_4cuda_9_softlink_SoftLink *)__pyx_v_13cupy_backends_4cuda_4libs_8cusparse__lib->__pyx_vtab)->get(__pyx_v_13cupy_backends_4cuda_4libs_8cusparse__lib, __pyx_mstate_global->__pyx_n_u_SparseToDense_bufferSize); if (unlikely(__pyx_t_8 == ((void *)NULL))) __PYX_ERR(0, 1401, __pyx_L1_error)
  __pyx_v_13cupy_backends_4cuda_4libs_8cusparse_cusparseSparseToDense_bufferSize = ((__pyx_t_13cupy_backends_4cuda_4libs_8cusparse_f_type)__pyx_t_8);

  /* "cupy_backends/cuda/libs/cusparse.pyx":1402
 * # Note: CUDA 11.1.0 contains cuSPARSE 11.2.0.275
 * cdef f_type cusparseSparseToDense_bufferSize = <f_type>_lib.get('SparseToDense_bufferSize')  # NOQA
 * cdef f_type cusparseSparseToDense = <f_type>_lib.get('SparseToDense')             # <<<<<<<<<<<<<<
 * cdef f_type cusparseDenseToSparse_bufferSize = <f_type>_lib.get('DenseToSparse_bufferSize')  # NOQA
 * cdef f_type cusparseDenseToSparse_analysis = <f_type>_lib.get('DenseToSparse_analysis')  # NOQA
*/
  __pyx_t_8 = ((struct __pyx_vtabstruct_13cupy_backends_4cuda_9_softlink_SoftLink *)__pyx_v_13cupy_backends_4cuda_4libs_8cusparse__lib->__pyx_vtab)->get(__pyx_v_13cupy_backends_4cuda_4libs_8cusparse__lib, __pyx_mstate_global->__pyx_n_u_SparseToDense); if (unlikely(__pyx_t_8 == ((void *)NULL))) __PYX_ERR(0, 1402, __pyx_L1_error)
  __pyx_v_13cupy_backends_4cuda_4libs_8cusparse_cusparseSparseToDense = ((__pyx_t_13cupy_backends_4cuda_4libs_8cusparse_f_type)__pyx_t_8);

  /* "cupy_backends/cuda/libs/cusparse.pyx":1403
 * cdef f_type cusparseSparseToDense_bufferSize = <f_type>_lib.get('SparseToDense_bufferSize')  # NOQA
 * cdef f_type cusparseSparseToDense = <f_type>_lib.get('SparseToDense')
 * cdef f_type cusparseDenseToSparse_bufferSize = <f_type>_lib.get('DenseToSparse_bufferSize')  # NOQA             # <<<<<<<<<<<<<<
 * cdef f_type cusparseDenseToSparse_analysis = <f_type>_lib.get('DenseToSparse_analysis')  # NOQA
 * cdef f_type cusparseDenseToSparse_convert = <f_type>_lib.get('DenseToSparse_convert')  # NOQA
*/
  __pyx_t_8 = ((struct __pyx_vtabstruct_13cupy_backends_4cuda_9_softlink_SoftLink *)__pyx_v_13cupy_backends_4cuda_4libs_8cusparse__lib->__pyx_vtab)->get(__pyx_v_13cupy_backends_4cuda_4libs_8cusparse__lib, __pyx_mstate_global->__pyx_n_u_DenseToSparse_bufferSize); if (unlikely(__pyx_t_8 == ((void *)NULL))) __PYX_ERR(0, 1403, __pyx_L1_error)
  __pyx_v_13cupy_backends_4cuda_4libs_8cusparse_cusparseDenseToSparse_bufferSize = ((__pyx_t_13cupy_backends_4cuda_4libs_8cusparse_f_type)__pyx_t_8);

  /* "cupy_backends/cuda/libs/cusparse.pyx":1404
 * cdef f_type cusparseSparseToDense = <f_type>_lib.get('SparseToDense')
 * cdef f_type cusparseDenseToSparse_bufferSize = <f_type>_lib.get('DenseToSparse_bufferSize')  # NOQA
 * cdef f_type cusparseDenseToSparse_analysis = <f_type>_lib.get('DenseToSparse_analysis')  # NOQA             # <<<<<<<<<<<<<<
 * cdef f_type cusparseDenseToSparse_convert = <f_type>_lib.get('DenseToSparse_convert')  # NOQA
 * # TODO(eriknw): cuSPARSE--SpGEAM not yet in any public release.
*/
  __pyx_t_8 = ((struct __pyx_vtabstruct_13cupy_backends_4cuda_9_softlink_SoftLink *)__pyx_v_13cupy_backends_4cuda_4libs_8cusparse__lib->__pyx_vtab)->get(__pyx_v_13cupy_backends_4cuda_4libs_8cusparse__lib, __pyx_mstate_global->__pyx_n_u_DenseToSparse_analysis); if (unlikely(__pyx_t_8 == ((void *)NULL))) __PYX_ERR(0, 1404, __pyx_L1_error)
  __pyx_v_13cupy_backends_4cuda_4libs_8cusparse_cusparseDenseToSparse_analysis = ((__pyx_t_13cupy_backends_4cuda_4libs_8cusparse_f_type)__pyx_t_8);

  /* "cupy_backends/cuda/libs/cusparse.pyx":1405
 * cdef f_type cusparseDenseToSparse_bufferSize = <f_type>_lib.get('DenseToSparse_bufferSize')  # NOQA
 * cdef f_type cusparseDenseToSparse_analysis = <f_type>_lib.get('DenseToSparse_analysis')  # NOQA
 * cdef f_type cusparseDenseToSparse_convert = <f_type>_lib.get('DenseToSparse_convert')  # NOQA             # <<<<<<<<<<<<<<
 * # TODO(eriknw): cuSPARSE--SpGEAM not yet in any public release.
 * # Loaded via SoftLink; returns NULL on builds without SpGEAM.
*/
  __pyx_t_8 = ((struct __pyx_vtabstruct_13cupy_backends_4cuda_9_softlink_SoftLink *)__pyx_v_13cupy_backends_4cuda_4libs_8cusparse__lib->__pyx_vtab)->get(__pyx_v_13cupy_backends_4cuda_4libs_8cusparse__lib, __pyx_mstate_global->__pyx_n_u_DenseToSparse_convert); if (unlikely(__pyx_t_8 == ((void *)NULL))) __PYX_ERR(0, 1405, __pyx_L1_error)
  __pyx_v_13cupy_backends_4cuda_4libs_8cusparse_cusparseDenseToSparse_convert = ((__pyx_t_13cupy_backends_4cuda_4libs_8cusparse_f_type)__pyx_t_8);

  /* "cupy_backends/cuda/libs/cusparse.pyx":1408
 * # TODO(eriknw): cuSPARSE--SpGEAM not yet in any public release.
 * # Loaded via SoftLink; returns NULL on builds without SpGEAM.
 * cdef f_type cusparseSpGEAM_createDescr = <f_type>_lib.get('SpGEAM_createDescr')             # <<<<<<<<<<<<<<
 * cdef f_type cusparseSpGEAM_destroyDescr = (
 *     <f_type>_lib.get('SpGEAM_destroyDescr'))
*/
  __pyx_t_8 = ((struct __pyx_vtabstruct_13cupy_backends_4cuda_9_softlink_SoftLink *)__pyx_v_13cupy_backends_4cuda_4libs_8cusparse__lib->__pyx_vtab)->get(__pyx_v_13cupy_backends_4cuda_4libs_8cusparse__lib, __pyx_mstate_global->__pyx_n_u_SpGEAM_createDescr); if (unlikely(__pyx_t_8 == ((void *)NULL))) __PYX_ERR(0, 1408, __pyx_L1_error)
  __pyx_v_13cupy_backends_4cuda_4libs_8cusparse_cusparseSpGEAM_createDescr = ((__pyx_t_13cupy_backends_4cuda_4libs_8cusparse_f_type)__pyx_t_8);

  /* "cupy_backends/cuda/libs/cusparse.pyx":1410
 * cdef f_type cusparseSpGEAM_createDescr = <f_type>_lib.get('SpGEAM_createDescr')
 * cdef f_type cusparseSpGEAM_destroyDescr = (
 *     <f_type>_lib.get('SpGEAM_destroyDescr'))             # <<<<<<<<<<<<<<
 * cdef f_type cusparseSpGEAM_bufferSize = <f_type>_lib.get('SpGEAM_bufferSize')
 * cdef f_type cusparseSpGEAM_nnz = <f_type>_lib.get('SpGEAM_nnz')
*/
  __pyx_t_8 = ((struct __pyx_vtabstruct_13cupy_backends_4cuda_9_softlink_SoftLink *)__pyx_v_13cupy_backends_4cuda_4libs_8cusparse__lib->__pyx_vtab)->get(__pyx_v_13cupy_backends_4cuda_4libs_8cusparse__lib, __pyx_mstate_global->__pyx_n_u_SpGEAM_destroyDescr); if (unlikely(__pyx_t_8 == ((void *)NULL))) __PYX_ERR(0, 1410, __pyx_L1_error)
  __pyx_v_13cupy_backends_4cuda_4libs_8cusparse_cusparseSpGEAM_destroyDescr = ((__pyx_t_13cupy_backends_4cuda_4libs_8cusparse_f_type)__pyx_t_8);

  /* "cupy_backends/cuda/libs/cusparse.pyx":1411
 * cdef f_type cusparseSpGEAM_destroyDescr = (
 *     <f_type>_lib.get('SpGEAM_destroyDescr'))
 * cdef f_type cusparseSpGEAM_bufferSize = <f_type>_lib.get('SpGEAM_bufferSize')             # <<<<<<<<<<<<<<
 * cdef f_type cusparseSpGEAM_nnz = <f_type>_lib.get('SpGEAM_nnz')
 * cdef f_type cusparseSpGEAM_fn = <f_type>_lib.get('SpGEAM')
*/
  __pyx_t_8 = ((struct __pyx_vtabstruct_13cupy_backends_4cuda_9_softlink_SoftLink *)__pyx_v_13cupy_backends_4cuda_4libs_8cusparse__lib->__pyx_vtab)->get(__pyx_v_13cupy_backends_4cuda_4libs_8cusparse__lib, __pyx_mstate_global->__pyx_n_u_SpGEAM_bufferSize); if (unlikely(__pyx_t_8 == ((void *)NULL))) __PYX_ERR(0, 1411, __pyx_L1_error)
  __pyx_v_13cupy_backends_4cuda_4libs_8cusparse_cusparseSpGEAM_bufferSize = ((__pyx_t_13cupy_backends_4cuda_4libs_8cusparse_f_type)__pyx_t_8);

  /* "cupy_backends/cuda/libs/cusparse.pyx":1412
 *     <f_type>_lib.get('SpGEAM_destroyDescr'))
 * cdef f_type cusparseSpGEAM_bufferSize = <f_type>_lib.get('SpGEAM_bufferSize')
 * cdef f_type cusparseSpGEAM_nnz = <f_type>_lib.get('SpGEAM_nnz')             # <<<<<<<<<<<<<<
 * cdef f_type cusparseSpGEAM_fn = <f_type>_lib.get('SpGEAM')
 * 
*/
  __pyx_t_8 = ((struct __pyx_vtabstruct_13cupy_backends_4cuda_9_softlink_SoftLink *)__pyx_v_13cupy_backends_4cuda_4libs_8cusparse__lib->__pyx_vtab)->get(__pyx_v_13cupy_backends_4cuda_4libs_8cusparse__lib, __pyx_mstate_global->__pyx_n_u_SpGEAM_nnz); if (unlikely(__pyx_t_8 == ((void *)NULL))) __PYX_ERR(0, 1412, __pyx_L1_error)
  __pyx_v_13cupy_backends_4cuda_4libs_8cusparse_cusparseSpGEAM_nnz = ((__pyx_t_13cupy_backends_4cuda_4libs_8cusparse_f_type)__pyx_t_8);

  /* "cupy_backends/cuda/libs/cusparse.pyx":1413
 * cdef f_type cusparseSpGEAM_bufferSize = <f_type>_lib.get('SpGEAM_bufferSize')
 * cdef f_type cusparseSpGEAM_nnz = <f_type>_lib.get('SpGEAM_nnz')
 * cdef f_type cusparseSpGEAM_fn = <f_type>_lib.get('SpGEAM')             # <<<<<<<<<<<<<<
 * 
 * cdef dict HIP_STATUS = {
*/
  __pyx_t_8 = ((struct __pyx_vtabstruct_13cupy_backends_4cuda_9_softlink_SoftLink *)__pyx_v_13cupy_backends_4cuda_4libs_8cusparse__lib->__pyx_vtab)->get(__pyx_v_13cupy_backends_4cuda_4libs_8cusparse__lib, __pyx_mstate_global->__pyx_n_u_SpGEAM); if (unlikely(__pyx_t_8 == ((void *)NULL))) __PYX_ERR(0, 1413, __pyx_L1_error)
  __pyx_v_13cupy_backends_4cuda_4libs_8cusparse_cusparseSpGEAM_fn = ((__pyx_t_13cupy_backends_4cuda_4libs_8cusparse_f_type)__pyx_t_8);

  /* "cupy_backends/cuda/libs/cusparse.pyx":1416
 * 
 * cdef dict HIP_STATUS = {
 *     0: b'HIPSPARSE_STATUS_SUCCESS',             # <<<<<<<<<<<<<<
 *     1: b'HIPSPARSE_STATUS_NOT_INITIALIZED',
 *     2: b'HIPSPARSE_STATUS_ALLOC_FAILED',
*/
  __pyx_t_6 = __Pyx_PyDict_NewPresized(12); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1416, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_int_0, __pyx_mstate_global->__pyx_n_b_HIPSPARSE_STATUS_SUCCESS) < (0)) __PYX_ERR(0, 1416, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_int_1, __pyx_mstate_global->__pyx_n_b_HIPSPARSE_STATUS_NOT_INITIALIZED) < (0)) __PYX_ERR(0, 1416, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_int_2, __pyx_mstate_global->__pyx_n_b_HIPSPARSE_STATUS_ALLOC_FAILED) < (0)) __PYX_ERR(0, 1416, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_int_3, __pyx_mstate_global->__pyx_n_b_HIPSPARSE_STATUS_INVALID_VALUE) < (0)) __PYX_ERR(0, 1416, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_int_4, __pyx_mstate_global->__pyx_n_b_HIPSPARSE_STATUS_ARCH_MISMATCH) < (0)) __PYX_ERR(0, 1416, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_int_5, __pyx_mstate_global->__pyx_n_b_HIPSPARSE_STATUS_MAPPING_ERROR) < (0)) __PYX_ERR(0, 1416, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_int_6, __pyx_mstate_global->__pyx_n_b_HIPSPARSE_STATUS_EXECUTION_FAILE) < (0)) __PYX_ERR(0, 1416, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_int_7, __pyx_mstate_global->__pyx_n_b_HIPSPARSE_STATUS_INTERNAL_ERROR) < (0)) __PYX_ERR(0, 1416, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_int_8, __pyx_mstate_global->__pyx_n_b_HIPSPARSE_STATUS_MATRIX_TYPE_NOT) < (0)) __PYX_ERR(0, 1416, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_int_9, __pyx_mstate_global->__pyx_n_b_HIPSPARSE_STATUS_ZERO_PIVOT) < (0)) __PYX_ERR(0, 1416, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_int_10, __pyx_mstate_global->__pyx_n_b_HIPSPARSE_STATUS_NOT_SUPPORTED) < (0)) __PYX_ERR(0, 1416, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_int_11, __pyx_mstate_global->__pyx_n_b_HIPSPARSE_STATUS_INSUFFICIENT_RE) < (0)) __PYX_ERR(0, 1416, __pyx_L1_error)
  __Pyx_XGOTREF(__pyx_v_13cupy_backends_4cuda_4libs_8cusparse_HIP_STATUS);
  __Pyx_DECREF_SET(__pyx_v_13cupy_backends_4cuda_4libs_8cusparse_HIP_STATUS, ((PyObject*)__pyx_t_6));
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_t_6 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":1521
 * 
 * 
 * class CuSparseError(RuntimeError):             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self, Status status):
*/
  __pyx_t_6 = PyTuple_Pack(1, ((PyObject *)(((PyTypeObject*)PyExc_RuntimeError)))); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1521, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_4 = __Pyx_PEP560_update_bases(__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1521, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1521, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_4, __pyx_mstate_global->__pyx_n_u_CuSparseError, __pyx_mstate_global->__pyx_n_u_CuSparseError, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_cupy_backends_cuda_libs_cusparse, (PyObject *) NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1521, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__pyx_t_4 != __pyx_t_6) {
    if (unlikely((PyDict_SetItemString(__pyx_t_5, "__orig_bases__", __pyx_t_6) < 0))) __PYX_ERR(0, 1521, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1521, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);

  /* "cupy_backends/cuda/libs/cusparse.pyx":1523
 * class CuSparseError(RuntimeError):
 * 
 *     def __init__(self, Status status):             # <<<<<<<<<<<<<<
 *         self.status = status
 *         cdef bytes name
*/
  __pyx_t_9 = __Pyx_CyFunction_New(&__pyx_mdef_13cupy_backends_4cuda_4libs_8cusparse_13CuSparseError_1__init__, 0, __pyx_mstate_global->__pyx_n_u_CuSparseError___init, NULL, __pyx_mstate_global->__pyx_n_u_cupy_backends_cuda_libs_cusparse, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[0])); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1523, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_9);
  #endif
  PyList_Append(__pyx_t_6, __pyx_t_9);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_9) < (0)) __PYX_ERR(0, 1523, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":1535
 *         super().__init__(f'{name.decode()}: {msg.decode()}')
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         return (type(self), (self.status,))
 * 
*/
  __pyx_t_9 = __Pyx_CyFunction_New(&__pyx_mdef_13cupy_backends_4cuda_4libs_8cusparse_13CuSparseError_3__reduce__, 0, __pyx_mstate_global->__pyx_n_u_CuSparseError___reduce, NULL, __pyx_mstate_global->__pyx_n_u_cupy_backends_cuda_libs_cusparse, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1])); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1535, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_9);
  #endif
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_reduce, __pyx_t_9) < (0)) __PYX_ERR(0, 1535, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":1521
 * 
 * 
 * class CuSparseError(RuntimeError):             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self, Status status):
*/
  __pyx_t_9 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_CuSparseError, __pyx_t_4, __pyx_t_5, NULL, 0, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1521, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_9);
  #endif
  if (__Pyx_CyFunction_InitClassCell(__pyx_t_6, __pyx_t_9) < (0)) __PYX_ERR(0, 1521, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_CuSparseError, __pyx_t_9) < (0)) __PYX_ERR(0, 1521, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":1569
 * 
 * 
 * def get_build_version():             # <<<<<<<<<<<<<<
 *     return CUSPARSE_VERSION
 * 
*/
  __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_13cupy_backends_4cuda_4libs_8cusparse_5get_build_version, NULL, __pyx_mstate_global->__pyx_n_u_cupy_backends_cuda_libs_cusparse); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1569, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_get_build_version, __pyx_t_4) < (0)) __PYX_ERR(0, 1569, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "(tree fragment)":4
 *     int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1
 *     int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1
 * def __pyx_unpickle_SpVecAttributes(__pyx_type, long __pyx_checksum, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xb0bf926, 0x397dff7, 0x7f92e3a, b'idx, idxBase, idxType, nnz, size, valueType, values')
*/
  __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_13cupy_backends_4cuda_4libs_8cusparse_617__pyx_unpickle_SpVecAttributes, NULL, __pyx_mstate_global->__pyx_n_u_cupy_backends_cuda_libs_cusparse); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_SpVecAttributes, __pyx_t_4) < (0)) __PYX_ERR(2, 4, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "(tree fragment)":1
 * cdef extern from *:             # <<<<<<<<<<<<<<
 *     int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1
 *     int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1
*/
  __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_13cupy_backends_4cuda_4libs_8cusparse_619__pyx_unpickle_CooAttributes, NULL, __pyx_mstate_global->__pyx_n_u_cupy_backends_cuda_libs_cusparse); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_CooAttributes, __pyx_t_4) < (0)) __PYX_ERR(2, 4, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "(tree fragment)":4
 *     int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1
 *     int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1
 * def __pyx_unpickle_CooAoSAttributes(__pyx_type, long __pyx_checksum, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0x5aa1e50, 0x11ade4a, 0xd3613df, b'cols, idxBase, idxType, ind, nnz, rows, valueType, values')
*/
  __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_13cupy_backends_4cuda_4libs_8cusparse_621__pyx_unpickle_CooAoSAttributes, NULL, __pyx_mstate_global->__pyx_n_u_cupy_backends_cuda_libs_cusparse); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_CooAoSAttributes, __pyx_t_4) < (0)) __PYX_ERR(2, 4, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "(tree fragment)":1
 * cdef extern from *:             # <<<<<<<<<<<<<<
 *     int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1
 *     int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1
*/
  __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_13cupy_backends_4cuda_4libs_8cusparse_623__pyx_unpickle_CsrAttributes, NULL, __pyx_mstate_global->__pyx_n_u_cupy_backends_cuda_libs_cusparse); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_CsrAttributes, __pyx_t_4) < (0)) __PYX_ERR(2, 4, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "(tree fragment)":4
 *     int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1
 *     int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1
 * def __pyx_unpickle_DnVecAttributes(__pyx_type, long __pyx_checksum, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0x4ea9d53, 0x27bcb7a, 0xcbbe7db, b'size, valueType, values')
*/
  __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_13cupy_backends_4cuda_4libs_8cusparse_625__pyx_unpickle_DnVecAttributes, NULL, __pyx_mstate_global->__pyx_n_u_cupy_backends_cuda_libs_cusparse); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_DnVecAttributes, __pyx_t_4) < (0)) __PYX_ERR(2, 4, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "(tree fragment)":1
 * cdef extern from *:             # <<<<<<<<<<<<<<
 *     int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1
 *     int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1
*/
  __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_13cupy_backends_4cuda_4libs_8cusparse_627__pyx_unpickle_DnMatAttributes, NULL, __pyx_mstate_global->__pyx_n_u_cupy_backends_cuda_libs_cusparse); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_DnMatAttributes, __pyx_t_4) < (0)) __PYX_ERR(2, 4, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "(tree fragment)":4
 *     int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1
 *     int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1
 * def __pyx_unpickle_DnMatBatchAttributes(__pyx_type, long __pyx_checksum, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0x250cbad, 0xf6c1cfb, 0xb66dd58, b'count, stride')
*/
  __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_13cupy_backends_4cuda_4libs_8cusparse_629__pyx_unpickle_DnMatBatchAttributes, NULL, __pyx_mstate_global->__pyx_n_u_cupy_backends_cuda_libs_cusparse); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_DnMatBatchAttribu, __pyx_t_4) < (0)) __PYX_ERR(2, 4, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cupy_backends/cuda/libs/cusparse.pyx":1
 * import sys as _sys  # no-cython-lint             # <<<<<<<<<<<<<<
 * cimport cython  # NOQA
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_test, __pyx_t_4) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /*--- Wrapped vars code ---*/
  {
    PyObject* wrapped = __Pyx_PyLong_From___pyx_anon_enum(__pyx_e_13cupy_backends_4cuda_4libs_8cusparse_CUSPARSE_ACTION_NUMERIC);
    if (unlikely(!wrapped)) __PYX_ERR(1, 92, __pyx_L1_error)
    if (PyObject_SetAttrString(__pyx_m, "CUSPARSE_ACTION_NUMERIC", wrapped) < 0) __PYX_ERR(1, 92, __pyx_L1_error);
  }
  {
    PyObject* wrapped = __Pyx_PyLong_From___pyx_anon_enum(__pyx_e_13cupy_backends_4cuda_4libs_8cusparse_CUSPARSE_ACTION_SYMBOLIC);
    if (unlikely(!wrapped)) __PYX_ERR(1, 91, __pyx_L1_error)
    if (PyObject_SetAttrString(__pyx_m, "CUSPARSE_ACTION_SYMBOLIC", wrapped) < 0) __PYX_ERR(1, 91, __pyx_L1_error);
  }
  {
    PyObject* wrapped = __Pyx_PyLong_From___pyx_anon_enum(__pyx_e_13cupy_backends_4cuda_4libs_8cusparse_CUSPARSE_ALG_MERGE_PATH);
    if (unlikely(!wrapped)) __PYX_ERR(1, 122, __pyx_L1_error)
    if (PyObject_SetAttrString(__pyx_m, "CUSPARSE_ALG_MERGE_PATH", wrapped) < 0) __PYX_ERR(1, 122, __pyx_L1_error);
  }
  {
    PyObject* wrapped = __Pyx_PyLong_From___pyx_anon_enum(__pyx_e_13cupy_backends_4cuda_4libs_8cusparse_CUSPARSE_ALG_NAIVE);
    if (unlikely(!wrapped)) __PYX_ERR(1, 121, __pyx_L1_error)
    if (PyObject_SetAttrString(__pyx_m, "CUSPARSE_ALG_NAIVE", wrapped) < 0) __PYX_ERR(1, 121, __pyx_L1_error);
  }
  {
    PyObject* wrapped = __Pyx_PyLong_From___pyx_anon_enum(__pyx_e_13cupy_backends_4cuda_4libs_8cusparse_CUSPARSE_COOMM_ALG1);
    if (unlikely(!wrapped)) __PYX_ERR(1, 139, __pyx_L1_error)
    if (PyObject_SetAttrString(__pyx_m, "CUSPARSE_COOMM_ALG1", wrapped) < 0) __PYX_ERR(1, 139, __pyx_L1_error);
  }
  {
    PyObject* wrapped = __Pyx_PyLong_From___pyx_anon_enum(__pyx_e_13cupy_backends_4cuda_4libs_8cusparse_CUSPARSE_COOMM_ALG2);
    if (unlikely(!wrapped)) __PYX_ERR(1, 140, __pyx_L1_error)
    if (PyObject_SetAttrString(__pyx_m, "CUSPARSE_COOMM_ALG2", wrapped) < 0) __PYX_ERR(1, 140, __pyx_L1_error);
  }
  {
    PyObject* wrapped = __Pyx_PyLong_From___pyx_anon_enum(__pyx_e_13cupy_backends_4cuda_4libs_8cusparse_CUSPARSE_COOMM_ALG3);
    if (unlikely(!wrapped)) __PYX_ERR(1, 141, __pyx_L1_error)
    if (PyObject_SetAttrString(__pyx_m, "CUSPARSE_COOMM_ALG3", wrapped) < 0) __PYX_ERR(1, 141, __pyx_L1_error);
  }
  {
    PyObject* wrapped = __Pyx_PyLong_From___pyx_anon_enum(__pyx_e_13cupy_backends_4cuda_4libs_8cusparse_CUSPARSE_COOMV_ALG);
    if (unlikely(!wrapped)) __PYX_ERR(1, 134, __pyx_L1_error)
    if (PyObject_SetAttrString(__pyx_m, "CUSPARSE_COOMV_ALG", wrapped) < 0) __PYX_ERR(1, 134, __pyx_L1_error);
  }
  {
    PyObject* wrapped = __Pyx_PyLong_From___pyx_anon_enum(__pyx_e_13cupy_backends_4cuda_4libs_8cusparse_CUSPARSE_CSR2CSC_ALG1);
    if (unlikely(!wrapped)) __PYX_ERR(1, 153, __pyx_L1_error)
    if (PyObject_SetAttrString(__pyx_m, "CUSPARSE_CSR2CSC_ALG1", wrapped) < 0) __PYX_ERR(1, 153, __pyx_L1_error);
  }
  {
    PyObject* wrapped = __Pyx_PyLong_From___pyx_anon_enum(__pyx_e_13cupy_backends_4cuda_4libs_8cusparse_CUSPARSE_CSR2CSC_ALG2);
    if (unlikely(!wrapped)) __PYX_ERR(1, 154, __pyx_L1_error)
    if (PyObject_SetAttrString(__pyx_m, "CUSPARSE_CSR2CSC_ALG2", wrapped) < 0) __PYX_ERR(1, 154, __pyx_L1_error);
  }
  {
    PyObject* wrapped = __Pyx_PyLong_From___pyx_anon_enum(__pyx_e_13cupy_backends_4cuda_4libs_8cusparse_CUSPARSE_CSRMM_ALG1);
    if (unlikely(!wrapped)) __PYX_ERR(1, 142, __pyx_L1_error)
    if (PyObject_SetAttrString(__pyx_m, "CUSPARSE_CSRMM_ALG1", wrapped) < 0) __PYX_ERR(1, 142, __pyx_L1_error);
  }
  {
    PyObject* wrapped = __Pyx_PyLong_From___pyx_anon_enum(__pyx_e_13cupy_backends_4cuda_4libs_8cusparse_CUSPARSE_CSRMV_ALG1);
    if (unlikely(!wrapped)) __PYX_ERR(1, 135, __pyx_L1_error)
    if (PyObject_SetAttrString(__pyx_m, "CUSPARSE_CSRMV_ALG1", wrapped) < 0) __PYX_ERR(1, 135, __pyx_L1_error);
  }
  {
    PyObject* wrapped = __Pyx_PyLong_From___pyx_anon_enum(__pyx_e_13cupy_backends_4cuda_4libs_8cusparse_CUSPARSE_CSRMV_ALG2);
    if (unlikely(!wrapped)) __PYX_ERR(1, 136, __pyx_L1_error)
    if (PyObject_SetAttrString(__pyx_m, "CUSPARSE_CSRMV_ALG2", wrapped) < 0) __PYX_ERR(1, 136, __pyx_L1_error);
  }
  {
    PyObject* wrapped = __Pyx_PyLong_From___pyx_anon_enum(__pyx_e_13cupy_backends_4cuda_4libs_8cusparse_CUSPARSE_DENSETOSPARSE_ALG_DEFAULT);
    if (unlikely(!wrapped)) __PYX_ERR(1, 175, __pyx_L1_error)
    if (PyObject_SetAttrString(__pyx_m, "CUSPARSE_DENSETOSPARSE_ALG_DEFAULT", wrapped) < 0) __PYX_ERR(1, 175, __pyx_L1_error);
  }
  {
    PyObject* wrapped = __Pyx_PyLong_From___pyx_anon_enum(__pyx_e_13cupy_backends_4cuda_4libs_8cusparse_CUSPARSE_DIAG_TYPE_NON_UNIT);
    if (unlikely(!wrapped)) __PYX_ERR(1, 108, __pyx_L1_error)
    if (PyObject_SetAttrString(__pyx_m, "CUSPARSE_DIAG_TYPE_NON_UNIT", wrapped) < 0) __PYX_ERR(1, 108, __pyx_L1_error);
  }
  {
    PyObject* wrapped = __Pyx_PyLong_From___pyx_anon_enum(__pyx_e_13cupy_backends_4cuda_4libs_8cusparse_CUSPARSE_DIAG_TYPE_UNIT);
    if (unlikely(!wrapped)) __PYX_ERR(1, 109, __pyx_L1_error)
    if (PyObject_SetAttrString(__pyx_m, "CUSPARSE_DIAG_TYPE_UNIT", wrapped) < 0) __PYX_ERR(1, 109, __pyx_L1_error);
  }
  {
    PyObject* wrapped = __Pyx_PyLong_From___pyx_anon_enum(__pyx_e_13cupy_backends_4cuda_4libs_8cusparse_CUSPARSE_DIRECTION_COLUMN);
    if (unlikely(!wrapped)) __PYX_ERR(1, 116, __pyx_L1_error)
    if (PyObject_SetAttrString(__pyx_m, "CUSPARSE_DIRECTION_COLUMN", wrapped) < 0) __PYX_ERR(1, 116, __pyx_L1_error);
  }
  {
    PyObject* wrapped = __Pyx_PyLong_From___pyx_anon_enum(__pyx_e_13cupy_backends_4cuda_4libs_8cusparse_CUSPARSE_DIRECTION_ROW);
    if (unlikely(!wrapped)) __PYX_ERR(1, 115, __pyx_L1_error)
    if (PyObject_SetAttrString(__pyx_m, "CUSPARSE_DIRECTION_ROW", wrapped) < 0) __PYX_ERR(1, 115, __pyx_L1_error);
  }
  {
    PyObject* wrapped = __Pyx_PyLong_From___pyx_anon_enum(__pyx_e_13cupy_backends_4cuda_4libs_8cusparse_CUSPARSE_FILL_MODE_LOWER);
    if (unlikely(!wrapped)) __PYX_ERR(1, 104, __pyx_L1_error)
    if (PyObject_SetAttrString(__pyx_m, "CUSPARSE_FILL_MODE_LOWER", wrapped) < 0) __PYX_ERR(1, 104, __pyx_L1_error);
  }
  {
    PyObject* wrapped = __Pyx_PyLong_From___pyx_anon_enum(__pyx_e_13cupy_backends_4cuda_4libs_8cusparse_CUSPARSE_FILL_MODE_UPPER);
    if (unlikely(!wrapped)) __PYX_ERR(1, 105, __pyx_L1_error)
    if (PyObject_SetAttrString(__pyx_m, "CUSPARSE_FILL_MODE_UPPER", wrapped) < 0) __PYX_ERR(1, 105, __pyx_L1_error);
  }
  {
    PyObject* wrapped = __Pyx_PyLong_From___pyx_anon_enum(__pyx_e_13cupy_backends_4cuda_4libs_8cusparse_CUSPARSE_FORMAT_COO);
    if (unlikely(!wrapped)) __PYX_ERR(1, 127, __pyx_L1_error)
    if (PyObject_SetAttrString(__pyx_m, "CUSPARSE_FORMAT_COO", wrapped) < 0) __PYX_ERR(1, 127, __pyx_L1_error);
  }
  {
    PyObject* wrapped = __Pyx_PyLong_From___pyx_anon_enum(__pyx_e_13cupy_backends_4cuda_4libs_8cusparse_CUSPARSE_FORMAT_COO_AOS);
    if (unlikely(!wrapped)) __PYX_ERR(1, 128, __pyx_L1_error)
    if (PyObject_SetAttrString(__pyx_m, "CUSPARSE_FORMAT_COO_AOS", wrapped) < 0) __PYX_ERR(1, 128, __pyx_L1_error);
  }
  {
    PyObject* wrapped = __Pyx_PyLong_From___pyx_anon_enum(__pyx_e_13cupy_backends_4cuda_4libs_8cusparse_CUSPARSE_FORMAT_CSC);
    if (unlikely(!wrapped)) __PYX_ERR(1, 126, __pyx_L1_error)
    if (PyObject_SetAttrString(__pyx_m, "CUSPARSE_FORMAT_CSC", wrapped) < 0) __PYX_ERR(1, 126, __pyx_L1_error);
  }
  {
    PyObject* wrapped = __Pyx_PyLong_From___pyx_anon_enum(__pyx_e_13cupy_backends_4cuda_4libs_8cusparse_CUSPARSE_FORMAT_CSR);
    if (unlikely(!wrapped)) __PYX_ERR(1, 125, __pyx_L1_error)
    if (PyObject_SetAttrString(__pyx_m, "CUSPARSE_FORMAT_CSR", wrapped) < 0) __PYX_ERR(1, 125, __pyx_L1_error);
  }
  {
    PyObject* wrapped = __Pyx_PyLong_From___pyx_anon_enum(__pyx_e_13cupy_backends_4cuda_4libs_8cusparse_CUSPARSE_INDEX_16U);
    if (unlikely(!wrapped)) __PYX_ERR(1, 144, __pyx_L1_error)
    if (PyObject_SetAttrString(__pyx_m, "CUSPARSE_INDEX_16U", wrapped) < 0) __PYX_ERR(1, 144, __pyx_L1_error);
  }
  {
    PyObject* wrapped = __Pyx_PyLong_From___pyx_anon_enum(__pyx_e_13cupy_backends_4cuda_4libs_8cusparse_CUSPARSE_INDEX_32I);
    if (unlikely(!wrapped)) __PYX_ERR(1, 145, __pyx_L1_error)
    if (PyObject_SetAttrString(__pyx_m, "CUSPARSE_INDEX_32I", wrapped) < 0) __PYX_ERR(1, 145, __pyx_L1_error);
  }
  {
    PyObject* wrapped = __Pyx_PyLong_From___pyx_anon_enum(__pyx_e_13cupy_backends_4cuda_4libs_8cusparse_CUSPARSE_INDEX_64I);
    if (unlikely(!wrapped)) __PYX_ERR(1, 146, __pyx_L1_error)
    if (PyObject_SetAttrString(__pyx_m, "CUSPARSE_INDEX_64I", wrapped) < 0) __PYX_ERR(1, 146, __pyx_L1_error);
  }
  {
    PyObject* wrapped = __Pyx_PyLong_From___pyx_anon_enum(__pyx_e_13cupy_backends_4cuda_4libs_8cusparse_CUSPARSE_INDEX_BASE_ONE);
    if (unlikely(!wrapped)) __PYX_ERR(1, 96, __pyx_L1_error)
    if (PyObject_SetAttrString(__pyx_m, "CUSPARSE_INDEX_BASE_ONE", wrapped) < 0) __PYX_ERR(1, 96, __pyx_L1_error);
  }
  {
    PyObject* wrapped = __Pyx_PyLong_From___pyx_anon_enum(__pyx_e_13cupy_backends_4cuda_4libs_8cusparse_CUSPARSE_INDEX_BASE_ZERO);
    if (unlikely(!wrapped)) __PYX_ERR(1, 95, __pyx_L1_error)
    if (PyObject_SetAttrString(__pyx_m, "CUSPARSE_INDEX_BASE_ZERO", wrapped) < 0) __PYX_ERR(1, 95, __pyx_L1_error);
  }
  {
    PyObject* wrapped = __Pyx_PyLong_From___pyx_anon_enum(__pyx_e_13cupy_backends_4cuda_4libs_8cusparse_CUSPARSE_MATRIX_TYPE_GENERAL);
    if (unlikely(!wrapped)) __PYX_ERR(1, 98, __pyx_L1_error)
    if (PyObject_SetAttrString(__pyx_m, "CUSPARSE_MATRIX_TYPE_GENERAL", wrapped) < 0) __PYX_ERR(1, 98, __pyx_L1_error);
  }
  {
    PyObject* wrapped = __Pyx_PyLong_From___pyx_anon_enum(__pyx_e_13cupy_backends_4cuda_4libs_8cusparse_CUSPARSE_MATRIX_TYPE_HERMITIAN);
    if (unlikely(!wrapped)) __PYX_ERR(1, 100, __pyx_L1_error)
    if (PyObject_SetAttrString(__pyx_m, "CUSPARSE_MATRIX_TYPE_HERMITIAN", wrapped) < 0) __PYX_ERR(1, 100, __pyx_L1_error);
  }
  {
    PyObject* wrapped = __Pyx_PyLong_From___pyx_anon_enum(__pyx_e_13cupy_backends_4cuda_4libs_8cusparse_CUSPARSE_MATRIX_TYPE_SYMMETRIC);
    if (unlikely(!wrapped)) __PYX_ERR(1, 99, __pyx_L1_error)
    if (PyObject_SetAttrString(__pyx_m, "CUSPARSE_MATRIX_TYPE_SYMMETRIC", wrapped) < 0) __PYX_ERR(1, 99, __pyx_L1_error);
  }
  {
    PyObject* wrapped = __Pyx_PyLong_From___pyx_anon_enum(__pyx_e_13cupy_backends_4cuda_4libs_8cusparse_CUSPARSE_MATRIX_TYPE_TRIANGULAR);
    if (unlikely(!wrapped)) __PYX_ERR(1, 101, __pyx_L1_error)
    if (PyObject_SetAttrString(__pyx_m, "CUSPARSE_MATRIX_TYPE_TRIANGULAR", wrapped) < 0) __PYX_ERR(1, 101, __pyx_L1_error);
  }
  {
    PyObject* wrapped = __Pyx_PyLong_From___pyx_anon_enum(__pyx_e_13cupy_backends_4cuda_4libs_8cusparse_CUSPARSE_MM_ALG_DEFAULT);
    if (unlikely(!wrapped)) __PYX_ERR(1, 138, __pyx_L1_error)
    if (PyObject_SetAttrString(__pyx_m, "CUSPARSE_MM_ALG_DEFAULT", wrapped) < 0) __PYX_ERR(1, 138, __pyx_L1_error);
  }
  {
    PyObject* wrapped = __Pyx_PyLong_From___pyx_anon_enum(__pyx_e_13cupy_backends_4cuda_4libs_8cusparse_CUSPARSE_MV_ALG_DEFAULT);
    if (unlikely(!wrapped)) __PYX_ERR(1, 133, __pyx_L1_error)
    if (PyObject_SetAttrString(__pyx_m, "CUSPARSE_MV_ALG_DEFAULT", wrapped) < 0) __PYX_ERR(1, 133, __pyx_L1_error);
  }
  {
    PyObject* wrapped = __Pyx_PyLong_From___pyx_anon_enum(__pyx_e_13cupy_backends_4cuda_4libs_8cusparse_CUSPARSE_OPERATION_CONJUGATE_TRANSPOSE);
    if (unlikely(!wrapped)) __PYX_ERR(1, 113, __pyx_L1_error)
    if (PyObject_SetAttrString(__pyx_m, "CUSPARSE_OPERATION_CONJUGATE_TRANSPOSE", wrapped) < 0) __PYX_ERR(1, 113, __pyx_L1_error);
  }
  {
    PyObject* wrapped = __Pyx_PyLong_From___pyx_anon_enum(__pyx_e_13cupy_backends_4cuda_4libs_8cusparse_CUSPARSE_OPERATION_NON_TRANSPOSE);
    if (unlikely(!wrapped)) __PYX_ERR(1, 111, __pyx_L1_error)
    if (PyObject_SetAttrString(__pyx_m, "CUSPARSE_OPERATION_NON_TRANSPOSE", wrapped) < 0) __PYX_ERR(1, 111, __pyx_L1_error);
  }
  {
    PyObject* wrapped = __Pyx_PyLong_From___pyx_anon_enum(__pyx_e_13cupy_backends_4cuda_4libs_8cusparse_CUSPARSE_OPERATION_TRANSPOSE);
    if (unlikely(!wrapped)) __PYX_ERR(1, 112, __pyx_L1_error)
    if (PyObject_SetAttrString(__pyx_m, "CUSPARSE_OPERATION_TRANSPOSE", wrapped) < 0) __PYX_ERR(1, 112, __pyx_L1_error);
  }
  {
    PyObject* wrapped = __Pyx_PyLong_From___pyx_anon_enum(__pyx_e_13cupy_backends_4cuda_4libs_8cusparse_CUSPARSE_ORDER_COL);
    if (unlikely(!wrapped)) __PYX_ERR(1, 130, __pyx_L1_error)
    if (PyObject_SetAttrString(__pyx_m, "CUSPARSE_ORDER_COL", wrapped) < 0) __PYX_ERR(1, 130, __pyx_L1_error);
  }
  {
    PyObject* wrapped = __Pyx_PyLong_From___pyx_anon_enum(__pyx_e_13cupy_backends_4cuda_4libs_8cusparse_CUSPARSE_ORDER_ROW);
    if (unlikely(!wrapped)) __PYX_ERR(1, 131, __pyx_L1_error)
    if (PyObject_SetAttrString(__pyx_m, "CUSPARSE_ORDER_ROW", wrapped) < 0) __PYX_ERR(1, 131, __pyx_L1_error);
  }
  {
    PyObject* wrapped = __Pyx_PyLong_From___pyx_anon_enum(__pyx_e_13cupy_backends_4cuda_4libs_8cusparse_CUSPARSE_POINTER_MODE_DEVICE);
    if (unlikely(!wrapped)) __PYX_ERR(1, 89, __pyx_L1_error)
    if (PyObject_SetAttrString(__pyx_m, "CUSPARSE_POINTER_MODE_DEVICE", wrapped) < 0) __PYX_ERR(1, 89, __pyx_L1_error);
  }
  {
    PyObject* wrapped = __Pyx_PyLong_From___pyx_anon_enum(__pyx_e_13cupy_backends_4cuda_4libs_8cusparse_CUSPARSE_POINTER_MODE_HOST);
    if (unlikely(!wrapped)) __PYX_ERR(1, 88, __pyx_L1_error)
    if (PyObject_SetAttrString(__pyx_m, "CUSPARSE_POINTER_MODE_HOST", wrapped) < 0) __PYX_ERR(1, 88, __pyx_L1_error);
  }
  {
    PyObject* wrapped = __Pyx_PyLong_From___pyx_anon_enum(__pyx_e_13cupy_backends_4cuda_4libs_8cusparse_CUSPARSE_SOLVE_POLICY_NO_LEVEL);
    if (unlikely(!wrapped)) __PYX_ERR(1, 118, __pyx_L1_error)
    if (PyObject_SetAttrString(__pyx_m, "CUSPARSE_SOLVE_POLICY_NO_LEVEL", wrapped) < 0) __PYX_ERR(1, 118, __pyx_L1_error);
  }
  {
    PyObject* wrapped = __Pyx_PyLong_From___pyx_anon_enum(__pyx_e_13cupy_backends_4cuda_4libs_8cusparse_CUSPARSE_SOLVE_POLICY_USE_LEVEL);
    if (unlikely(!wrapped)) __PYX_ERR(1, 119, __pyx_L1_error)
    if (PyObject_SetAttrString(__pyx_m, "CUSPARSE_SOLVE_POLICY_USE_LEVEL", wrapped) < 0) __PYX_ERR(1, 119, __pyx_L1_error);
  }
  {
    PyObject* wrapped = __Pyx_PyLong_From___pyx_anon_enum(__pyx_e_13cupy_backends_4cuda_4libs_8cusparse_CUSPARSE_SPARSETODENSE_ALG_DEFAULT);
    if (unlikely(!wrapped)) __PYX_ERR(1, 172, __pyx_L1_error)
    if (PyObject_SetAttrString(__pyx_m, "CUSPARSE_SPARSETODENSE_ALG_DEFAULT", wrapped) < 0) __PYX_ERR(1, 172, __pyx_L1_error);
  }
  {
    PyObject* wrapped = __Pyx_PyLong_From___pyx_anon_enum(__pyx_e_13cupy_backends_4cuda_4libs_8cusparse_CUSPARSE_SPGEAM_ALG1);
    if (unlikely(!wrapped)) __PYX_ERR(1, 169, __pyx_L1_error)
    if (PyObject_SetAttrString(__pyx_m, "CUSPARSE_SPGEAM_ALG1", wrapped) < 0) __PYX_ERR(1, 169, __pyx_L1_error);
  }
  {
    PyObject* wrapped = __Pyx_PyLong_From___pyx_anon_enum(__pyx_e_13cupy_backends_4cuda_4libs_8cusparse_CUSPARSE_SPGEAM_ALG_DEFAULT);
    if (unlikely(!wrapped)) __PYX_ERR(1, 168, __pyx_L1_error)
    if (PyObject_SetAttrString(__pyx_m, "CUSPARSE_SPGEAM_ALG_DEFAULT", wrapped) < 0) __PYX_ERR(1, 168, __pyx_L1_error);
  }
  {
    PyObject* wrapped = __Pyx_PyLong_From___pyx_anon_enum(__pyx_e_13cupy_backends_4cuda_4libs_8cusparse_CUSPARSE_SPGEMM_ALG1);
    if (unlikely(!wrapped)) __PYX_ERR(1, 163, __pyx_L1_error)
    if (PyObject_SetAttrString(__pyx_m, "CUSPARSE_SPGEMM_ALG1", wrapped) < 0) __PYX_ERR(1, 163, __pyx_L1_error);
  }
  {
    PyObject* wrapped = __Pyx_PyLong_From___pyx_anon_enum(__pyx_e_13cupy_backends_4cuda_4libs_8cusparse_CUSPARSE_SPGEMM_ALG2);
    if (unlikely(!wrapped)) __PYX_ERR(1, 164, __pyx_L1_error)
    if (PyObject_SetAttrString(__pyx_m, "CUSPARSE_SPGEMM_ALG2", wrapped) < 0) __PYX_ERR(1, 164, __pyx_L1_error);
  }
  {
    PyObject* wrapped = __Pyx_PyLong_From___pyx_anon_enum(__pyx_e_13cupy_backends_4cuda_4libs_8cusparse_CUSPARSE_SPGEMM_ALG3);
    if (unlikely(!wrapped)) __PYX_ERR(1, 165, __pyx_L1_error)
    if (PyObject_SetAttrString(__pyx_m, "CUSPARSE_SPGEMM_ALG3", wrapped) < 0) __PYX_ERR(1, 165, __pyx_L1_error);
  }
  {
    PyObject* wrapped = __Pyx_PyLong_From___pyx_anon_enum(__pyx_e_13cupy_backends_4cuda_4libs_8cusparse_CUSPARSE_SPGEMM_CSR_ALG_DETERMINITIC);
    if (unlikely(!wrapped)) __PYX_ERR(1, 161, __pyx_L1_error)
    if (PyObject_SetAttrString(__pyx_m, "CUSPARSE_SPGEMM_CSR_ALG_DETERMINITIC", wrapped) < 0) __PYX_ERR(1, 161, __pyx_L1_error);
  }
  {
    PyObject* wrapped = __Pyx_PyLong_From___pyx_anon_enum(__pyx_e_13cupy_backends_4cuda_4libs_8cusparse_CUSPARSE_SPGEMM_CSR_ALG_NONDETERMINITIC);
    if (unlikely(!wrapped)) __PYX_ERR(1, 162, __pyx_L1_error)
    if (PyObject_SetAttrString(__pyx_m, "CUSPARSE_SPGEMM_CSR_ALG_NONDETERMINITIC", wrapped) < 0) __PYX_ERR(1, 162, __pyx_L1_error);
  }
  {
    PyObject* wrapped = __Pyx_PyLong_From___pyx_anon_enum(__pyx_e_13cupy_backends_4cuda_4libs_8cusparse_CUSPARSE_SPGEMM_DEFAULT);
    if (unlikely(!wrapped)) __PYX_ERR(1, 160, __pyx_L1_error)
    if (PyObject_SetAttrString(__pyx_m, "CUSPARSE_SPGEMM_DEFAULT", wrapped) < 0) __PYX_ERR(1, 160, __pyx_L1_error);
  }
  {
    PyObject* wrapped = __Pyx_PyLong_From___pyx_anon_enum(__pyx_e_13cupy_backends_4cuda_4libs_8cusparse_CUSPARSE_SPMAT_DIAG_TYPE);
    if (unlikely(!wrapped)) __PYX_ERR(1, 150, __pyx_L1_error)
    if (PyObject_SetAttrString(__pyx_m, "CUSPARSE_SPMAT_DIAG_TYPE", wrapped) < 0) __PYX_ERR(1, 150, __pyx_L1_error);
  }
  {
    PyObject* wrapped = __Pyx_PyLong_From___pyx_anon_enum(__pyx_e_13cupy_backends_4cuda_4libs_8cusparse_CUSPARSE_SPMAT_FILL_MODE);
    if (unlikely(!wrapped)) __PYX_ERR(1, 149, __pyx_L1_error)
    if (PyObject_SetAttrString(__pyx_m, "CUSPARSE_SPMAT_FILL_MODE", wrapped) < 0) __PYX_ERR(1, 149, __pyx_L1_error);
  }
  {
    PyObject* wrapped = __Pyx_PyLong_From___pyx_anon_enum(__pyx_e_13cupy_backends_4cuda_4libs_8cusparse_CUSPARSE_SPSM_ALG_DEFAULT);
    if (unlikely(!wrapped)) __PYX_ERR(1, 157, __pyx_L1_error)
    if (PyObject_SetAttrString(__pyx_m, "CUSPARSE_SPSM_ALG_DEFAULT", wrapped) < 0) __PYX_ERR(1, 157, __pyx_L1_error);
  }

  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_9);
  if (__pyx_m) {
    if (__pyx_mstate->__pyx_d && stringtab_initialized) {
      __Pyx_AddTraceback("init cupy_backends.cuda.libs.cusparse", __pyx_clineno, __pyx_lineno, __pyx_filename);
    }
    #if !CYTHON_USE_MODULE_STATE
    Py_CLEAR(__pyx_m);
    #else
    Py_DECREF(__pyx_m);
    if (pystate_addmodule_run) {
      PyObject *tp, *value, *tb;
      PyErr_Fetch(&tp, &value, &tb);
      PyState_RemoveModule(&__pyx_moduledef);
      PyErr_Restore(tp, value, tb);
    }
    #endif
  } else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_ImportError, "init cupy_backends.cuda.libs.cusparse");
  }
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #if CYTHON_PEP489_MULTI_PHASE_INIT
  return (__pyx_m != NULL) ? 0 : -1;
  #else
  return __pyx_m;
  #endif
}
/* #### Code section: pystring_table ### */
/* #### Code section: cached_builtins ### */

static int __Pyx_InitCachedBuiltins(__pyx_mstatetype *__pyx_mstate) {
  CYTHON_UNUSED_VAR(__pyx_mstate);
  __pyx_builtin_super = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_super); if (!__pyx_builtin_super) __PYX_ERR(0, 1533, __pyx_L1_error)

  /* Cached unbound methods */
  __pyx_mstate->__pyx_umethod_PyDict_Type_items.type = (PyObject*)&PyDict_Type;
  __pyx_mstate->__pyx_umethod_PyDict_Type_items.method_name = &__pyx_mstate->__pyx_n_u_items;
  __pyx_mstate->__pyx_umethod_PyDict_Type_pop.type = (PyObject*)&PyDict_Type;
  __pyx_mstate->__pyx_umethod_PyDict_Type_pop.method_name = &__pyx_mstate->__pyx_n_u_pop;
  __pyx_mstate->__pyx_umethod_PyDict_Type_values.type = (PyObject*)&PyDict_Type;
  __pyx_mstate->__pyx_umethod_PyDict_Type_values.method_name = &__pyx_mstate->__pyx_n_u_values;
  return 0;
  __pyx_L1_error:;
  return -1;
}
/* #### Code section: cached_constants ### */

static int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  CYTHON_UNUSED_VAR(__pyx_mstate);
  __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
  __Pyx_RefNannyFinishContext();
  return 0;
}
/* #### Code section: init_constants ### */

static int __Pyx_InitConstants(__pyx_mstatetype *__pyx_mstate) {
  CYTHON_UNUSED_VAR(__pyx_mstate);
  {
    const struct { const unsigned int length: 8; } index[] = {{2},{179},{1},{1},{8},{67},{36},{7},{6},{2},{9},{1},{1},{1},{16},{13},{9},{13},{13},{22},{24},{22},{24},{21},{15},{20},{15},{1},{20},{6},{17},{18},{19},{10},{17},{13},{15},{16},{17},{10},{15},{13},{24},{3},{4},{5},{9},{18},{9},{4},{10},{11},{4},{8},{8},{9},{15},{15},{12},{6},{10},{18},{6},{10},{4},{11},{9},{7},{10},{6},{9},{7},{9},{10},{5},{13},{17},{9},{10},{9},{10},{13},{16},{16},{13},{6},{7},{9},{9},{10},{10},{10},{10},{13},{9},{13},{17},{9},{10},{10},{10},{10},{16},{16},{13},{18},{6},{7},{11},{7},{7},{7},{9},{4},{32},{8},{1},{4},{4},{5},{6},{6},{6},{6},{8},{8},{4},{2},{7},{2},{2},{2},{12},{13},{14},{15},{15},{8},{8},{17},{12},{6},{12},{3},{7},{7},{8},{5},{8},{5},{3},{7},{4},{8},{13},{5},{1},{2},{3},{3},{3},{23},{9},{1},{8},{4},{4},{4},{2},{13},{4},{10},{15},{3},{1},{8},{4},{7},{3},{4},{4},{4},{9},{9},{15},{18},{4},{4},{3},{3},{3},{5},{9},{9},{6},{1},{7},{12},{10},{6},{3},{8},{11},{12},{14},{11},{10},{31},{28},{28},{30},{35},{30},{30},{14},{12},{10},{17},{13},{6},{6},{13},{10},{6},{4},{4},{12},{10},{12},{19},{4},{10},{11},{11},{9},{6},{6},{6},{5},{3},{4},{8},{3},{6},{6},{3},{6},{7},{9},{6},{4},{4},{9},{1},{4},{4},{5},{1},{5},{227},{57},{90},{38},{15},{73},{29},{30},{33},{39},{31},{30},{30},{42},{32},{30},{24},{27}};
    #if (CYTHON_COMPRESS_STRINGS) == 3 && __PYX_LIMITED_VERSION_HEX >= 0x030e0000 /* compression: zstd (1632 bytes) */
const char* const cstring = "(\265/\375`\373\014\2652\000\332LP\016<Pm\232\0030m\020E\314\214\231\235\237ow~\316\325\337\366\233L\221C\212\\}\224\315\266$r\212f&o\273e\273u\013b\372\267\355\271o\311\"\005B\256\220j\201\344\2648 \033\307\000\312\000\305\000\026{dJk\354\352c\332\332w\354\326$TR\032U\225:\344\034\342w\376z5\375\177*\371H\tA\223\347y\273\215\310\014\257\365~\233l\322\235~5\204\260\257:\010\376\"s\270\275Z6\253{\374T\316Y=\326\217L\251\267\303\264\376\\\347`\313\264>G\232\036'\252\250g\252\252s \\\307\355\275\265 \221\260\303\255`M\323~\316\202\215\330-\312\376}\031\343.p\236\335\211\234y\337\351\310w\036st\252\314\034\214\344H\234g\366N\354\207]/\007#\035g\367\205\356\252\356\370;\346\300\324yq\235\t\024&<\230\242\311\211\224\3375}w2\310\277\224\257\206\374\034o'\312\314g\220\363\233y\207_Z\234\n\001\233\327\037\2732|\277\357NY\323^{\336\210\025\363d\005\302\306H\210\020)\377\206y\303\255\343\325\347N\302w\375Z\333\330~\024h\362\320\267\277\357I$\320\344\251<\320\344i\n4y\250?\376\354\030\314\305\271\313&W\351rb\322\271\265y\216\335\322o\261\033\307\206\016n\006\375\251CR/JPB\025\365\013\256\246\275KyaM\341p\022^\373|\361\253>V\t]\354{\255s\354\257\222J'\221\355b\346\273\231\tWn\300\225\226\006J\257\252J\305\325\254<b\314$}\347G\2353\305U\236\350\302\2540L\375\206-\355]S6\331\324\332\3448#\343~'\277\225Hy\312\232(\035{tE\031\203\251\227\267gp\3436\031\327\316\205 v\255\341\307X\224\224\333\354\214D\226\375f\263\331\260\333\351\034Tvh\320p\254q\256p5\374\373f\235<\036W~k\236\371k\257\216a\313\033\323\335\027\303\2575\014dw\352\233G\037V\337\260\203[;\\\373\232YQo\0149\\\317X\261\352\034\2163=\3275\272\223\351\374v9\247\234\231{\2611\231\337\2573JsN~TjL9\231\362\231\32234^\357\322B\303\024\270/\255\210U\236(\223\307#v0o8Gn\222\302\272\317\027\006M\236\217\275Xk\030|\355\361\325\260\271\3066f\257m\277\326\304\366VB\367\340\365\340>\370 \207c\374\335\\bb;w\354\330\036\321\022;v\263\357$\326%C\232\332\205\2126@\033$K\262\250\3134aT\315\272XZ4i\260\232\206D]\260H\323\364T\"\214F\221.""\236\014\352BQQ\273x,TdU\021Da\\\252\210j\226%\222 \251\242\002\243\262H\226\213da@\221Fd\001YO\245\222*\315\002\242(\321\205\364T4\350rq\361\264\n\303z\254\252M\222E\207\017\003>T#\032\221\001\"\224\020\212\020\000!\331\007\365a\200@\010\004#\000F\030$\000\001`\244\203\310\002\n\020\024\023\"\024\200$\230\010\261!\031B*\200PL\204\210\3601Q@B\300\210\005\301\3601\201@\304\n\321\000y@\002\200\034 \020\342\361\320\232D\203'\361Zj\336%\211\006\323\373q8\016\276\321\237\014\234({\313\024>\356\354\334C\231\247u\022\302'\243\022\343\212\005;Z\2453\365:J\217).\375\206?J\216M%\207\255d\337\260\003\201c\250A-4\206hDDF\222$\225\306a\020\203Q\007aU\007r\252\024\252\210VDjD\244Ei\366\030\003\336K\227\3265\010\206\366\320\361\365\267VH6x)\361^\264?v\r^\343\310\023BO*hJ8\307\016{\363@P\232\337)?\363\227\001c\242\202t.S\256\230S\202\257\316X\2364RT\200@l5\003\301]\205O\253|W_\340\355\203\302\342{\200Ye\221E\310\234\311\330H0=\233\344\276\320\371E\243c_w\320\340\032lg\235\204\312\001\2460\236a\002\301]\017\003\322\354\262\027n\374\271\303@b\377\010\030\264t\220\350\216f\347on\213\020Bp\345F\236H\307\014\320\375\013=\233 \230\352\024a(\r\337\202\331)F/\303rZ\270=\021\371*\233\303\317%\374^\020\241>h\340u\336\020+6\n\260_\023$\036\023\364\003\354\224\246\037\220\245`\003\340\376\032\317\234F\316r]\035\212\002~Hf\277\274<\205\"\343\276u\323<\350\"*m\317\346\325\364p\033\204^\346\206X\236\373q\036\246;\344%we3\325,\247]2\372\303\026\344\021\023N\204e\251\237u\266\035\034\301\361\3252\341\376\262f`\253\215\257\023,\r\215\253\014\354 L\214\264\032\203\241\010\007\254\035\342\0066>\000\372T\246\023\232\025wU03\255?\350/<P\211~<S\367nU\033\352\204\274\210\034P\316\246\225]\240&$HWx|\257\356 \333\203\314]\355\215}=\271-<b[[\277\t:\010q\374\004\212\304<\020+\214\363F\000\034?\361b\320j\367z\256\031\0272\244m\311vx\274WZ\271\261}$\276\013\235\360\374\"\367PT\220\315=\025\3309'\001\217PisN\251\230\014,\215\261\007\220\227p\337<`\302\221\000s\344m\225vG\362_HNA\304/\312\303\213\004\223@\375<""\231(i\345\333Uv\3005\247l\210\234_\230d<L\027n\021\332^\216\264\314\233.7\3344\344\360*\237\315r\240\003Z)\207 \246\240`\206\334\r<R\253W\243{w(\234\022\031x\356i\033\030\354\217/\275)\3461\336\231\235%\326,4\331=\027\033\203\203Q\304\027\230PT\260\033\242[\266\252\3229\365\371\340\350\0268\0103\321!\360\254\263I)\202\374S\350\342\3542\310\343\307\377\264\314g.i\005\302\362\334\266M\355\035\250\022}\276\001\352\316\232/\037\005\320\200WsL\217H\3441\027\323\377\257;\247j\207\267\007'\305\270i\036\330\0335\220 \022?B\005U\253\241e\250\006";
    PyObject *data = __Pyx_DecompressString(cstring, 1632, 3);
    if (unlikely(!data)) __PYX_ERR(0, 1, __pyx_L1_error)
    const char* const bytes = __Pyx_PyBytes_AsString(data);
    #if !CYTHON_ASSUME_SAFE_MACROS
    if (likely(bytes)); else { Py_DECREF(data); __PYX_ERR(0, 1, __pyx_L1_error) }
    #endif
    #elif (CYTHON_COMPRESS_STRINGS) == 2 /* compression: bz2 (1839 bytes) */
const char* const cstring = "BZh91AY&SYv4S\"\000\000B\377\373\345\346x\000`\347\264P\277\367\377p\277\377\377\360@@@@@@@\000@@@\000@\000`\006\340\327\336\365\273\272\256\367\016\264\365\336\302\026\331Kf\370hF\242\237\251\206T\306\232\231\252y\252z\232z\2317\2522\032\006\200d\365\036\211\243\322yOS\324\366\2502&\246\206M\001\251O\325\032i\352y#OP\365\000\365\0004\000\000\001\240\032\232\247\2155\000P\365\017I\352z\200\320\001\352\014\230\206 \003@\031\0000\220I\210\323I\350\022m5O\023)\372\206S@\032\000\000\000\001\240\301\032\0324i\3514h\321\246\200\3202h442b\001\221\240\017S \221B&!\251\232\006\246SjfSjmCCA\246\200\320\000\000\000\3532m\337st\017{\006u\350\000\030\327\260\\\376[\375\333\270\224\312\332((\235m \316S\205\353\2469\217Nk04\2714i\354\3248\375\266\007\334\327\024\360k\266\250\313\274\366$q\305=n\262\303\002\317\323\214J:f\232\227\2104v\252\004m\247\353\347\305\242\364\217\370\216\312\274\251\237)\ns\255\004\t\004\240\026\275\371L\032\003CD3\030\350\340\335\204ln \275\253\274\316\366\240\252\252\252$\340\264}m\214A\321\233\036\367\251#{\276\375\335t&:\264\322%{\3479\215\206\001\340NF\340%6\205\265\301\217\246\002\257Y\250\303&hH\241,'!D\210\372\313<\212J\224\324g\343Q\244E_\217G\321C\347\340U\260\362_\314\306\3101d4Y\000-\373\344\321s\217\026R\034W7j\326r\317Y\260\231\024\326\302\354\370\347\342&\260'\276\013\253\202j\351\323\276\370r2\010mF\004\026\334\272\315z\2714\230\225\346snA\264\222I.\034\200\270g\276O\033Fb\207B\362Fnl\363\250\310xl8K^tD\022b\0148\361\205\250\027X\220\007f[\014\204\201D\031\240\200\331\\\035\240i\303\020\214\3102\031\274\231\374\255t\2500\212[\346\347\320\205\244\033v\345\320Dz6\200^$,\354\304\n\375\364\260\r6spl\211\236\032\034GM\365(\330\270\374\226\343\005\273\224\263-\346\220)\243S\022\020\177Ff\033\352\006\230+\\\220\3412\222\260\013\212w\335\234TxH\032&\253\233\225\302\367\343N\244Nl\025\375\253\225\244@\300L\250C\227]\262\312\267\021\322I$\364ae4\000\321\213\374\376\022\240\0034\373`\000\307\245\035jix\262\205'\355\363\331\341?O\032\250cj\365K\330PMs""\332\326\324\365v\335aB\204u!h`\316\n$5\036\005\036\014\031\362\001X\231\374\271\230\002\325j\264-(\220/2S\315\343\002c\t\253\231<\253l!\237Q\256\tQ\212E\2634U\207\032:Q\276\376\3116\024\017\334T\302\255\254\032}\2133m\311;\006\356\224\203C\307\230\350l\211\317\230\332n\016\320V\363CR\275M\266\203\031\230\324\340\201\300N\004&p\262\202\200\264\252\2528&\004\016\201J\350Td\024\265\360\"0L\354d\002\207\272`\201`\032A(p\347\224R\223\352\255\006m\000h\214\236\222m\277\215\3235';\332\036\236\257Das\2346\030\216\326\010\373\24024cZ\352\r\014\220\205\321\323\345\315UK+Z\322\2626(\234\370\323Q\230\335\207\365\237-\032i:TY0\336\326\323\005\024\331a\000\325l\303yQ\352:\244\r(\267\013#,\371VO,\262\347\3226\\\202\327\006Aj\331\311S\033\336\\\020\243\300\344aT\343\270%J\251\215yF\235sn\031\014\203\210\342\204\030\210R\2201[\t\242\252\343\023\335\275\251\007\016\312#I\250\322\254\271qE\342\000\334\217\267X\010\203c}\240\007\277\236\237ny\037\n\021\021\255\000\226\266\354\034\210\3070\035bvj\353z|)\237\3068\221\266\341\274,\334\205u\026Gr\0228c\001\365\221\276K@t'\212'*\360\010\r $\003\0347t:\320Qb\253w\254\267\205\216\264\311\205c\236\034'\241\243\236m\264\301\336\036\026\344<$B\371\020\364\202\377W\005\005\004,\316t\241q\234TS\002i\315@\232\204!\035R\310P\010\004\r\334\004\246N\327:k\0101N\314-m\033\303%\215\017\216\375S\276Pz\212\206+M\351H\340\215]\001\374\273O\013\206v\332\207\236yp\031\335'+%CY\312\346\260\273\300\210\313%\001\020ibqB\316\204\350\202!T\213\003\262\037>0\211\327\002\002\002\351\205\207\233\276\351\204\256\276\363\036[\235)uT\215&\035\366C\202XW\342\300\343\213\266\257\001o\177}\363\003]\035\366@y\317\\D\344\223\250\352\001\024 >\0145!\356\255\306\243\014\307\246\365.\342M\245&]\201GB\025D\335\225{2\313\0376\026\345\213\276\036$\341\2738\304\211U\240\023\032b\020\t\320+\221\241\006\327\272\\\234\\\243\014$\0246W\270[\275\003\2071n\263\242i\000\330\310<\017}\221\303\3021\272\345\t@\032Y\311\361oU7\036Z\200\345\3231\323\021r\307\333\3353\325\241\353\262\2545""\347k\256\332\033\033@\330\321Qz\264Fx\001,\201\250\227E\314\00345sU`\r\204M%\030\022\224\356\3615\313\334\024\357\004*(\253*\255\203\270T\203\313\364\217\302\203R\010\336\006\314\260\021\t2e1)0\"D\240Q.\001\tb\\\211\025\024P\353\257\240\006\315\005v\330g16\226P$\211\013X\307\025\332@\224\246\037\034p\315 \212\240\352\020l#bD0\003)\005*\210\3033\033\372\322\215\003\224\315[-TM\2007\310$\355\003Z =\203\213$\330\222\276X\201z\010\240\226\010+\356Cg-\201\020\267m\2776#*\001=\317\266\243\277z\255T\262\231RV\266\306\322\313\212\227\231\224\356I\314_uG\025\223c\215\224\004\007\201kW\326\331\006\2243(\020\321\027\244\247\317j\224\246\360\324\026\332\314\332\337\252\254\323 \022\211\310\224\334\263\000\312\010\004\356$E\266\334h\t\276v\333\240\010\332cE\302U8U5\302\230\007\"V\204i\342\222\274\031\004\017\201\321%<B\024U`\025\231 %\202\332,P\320\272\333\337\321\312\315\343\345\274i\001\212bM#|\024(+k\252)\3232s\3365P\\#e\252\010S\221B\342\221%\211e\231-A\214\263\335\312\224\240C\207\236]\227\020E0\177*\017j\003t\321%\246\302#:C\205\007\212y\030\324\210\341\311\266t\322cm\261\231\034\212\215\022/\335\272\001\177\237\"\014\302b\004\017\t\3650\272\363\226\340\000H\355f\035U7@\222rU\302@%\3158e$9\014O\342\356H\247\n\022\016\306\212d@";
    PyObject *data = __Pyx_DecompressString(cstring, 1839, 2);
    if (unlikely(!data)) __PYX_ERR(0, 1, __pyx_L1_error)
    const char* const bytes = __Pyx_PyBytes_AsString(data);
    #if !CYTHON_ASSUME_SAFE_MACROS
    if (likely(bytes)); else { Py_DECREF(data); __PYX_ERR(0, 1, __pyx_L1_error) }
    #endif
    #elif (CYTHON_COMPRESS_STRINGS) != 0 /* compression: zlib (1642 bytes) */
const char* const cstring = "x\332\215V\315n#7\022\366\000\213M\026p\200M\346\005:\247I\200\254\203\0049\004\271\004\255\226&\356\300\372Y\265<pr!(\222\262\030\267\310\036\222-\253\347\264\3079\372\350\343\034\347\230G\311q\216\373\010\373\010\373\221l\265~l#\021D\366WU\374\251*\026\253\370C2\322N$nI]\2225n\251U\"m\302E)\347\302P'\312&\261\316H\346\204\361\203T2\031L\376\365\335\367\337%T\361\304\210\337\004s6\261\365\234\225\324Za\023\275H\346\265,\235T\211k*a\317\222|\2214\272N\224\020<q:\2510n\177\202[\n\225X\341<H^P\245\264\243NjE0]\252\353\027\t\227\006\233\310\265\360\263_\322\322\212\263\263\037)\347\004#\005\243e\211Q\t\253\213I:-\006I:\311\023^\033\317\203\336\202\256\022F+W\033\341\315b\2651B9\330T+[W\2256NpVW\r\231Sv#\024\267_\263\232\323\257a\274G\266\242\006\273U\315\206KK\347\245\020\312\367\327L\332\210x\332\3132\255S]\244\016N\232\327NXO\357\010h\340DfYf\315\036\267.\302\312\003c\2649 \316\010\221J:B\216\271F\360\232\tB\372BY1\323QH\250\242ec\245=\344\316\353\305B\230B\276\021\207|\246\325Z\030\327WC\352v\312\004\262G\035[\356\363^\t\266#'\204L\232\rZ\037q@Fb\343\246bQT?\r\322a\354\367\266l\031,\030\336\027\226\231\226\303\005\316C7\373,\245\336\024\025v/\304N\237\242*\206\235]\201\330_\2738Z\2718^\027\014\253\3135\206\036X\020=0\323\301!\007\304\336\362\264\274\306_\323\262Z\322\320\371\000\246\266QL\3523\246\215\256\021\325\302\322\355\252sj\321\340\270L\327\312\005T@\304\305\\8\352\233\237?/5\273\351\313\325\\k\353\310\232\226sk\212\020w\231.s\305;r\252o'\316t\344+\214\014\232\355\364c\210t\201\370 \316P&|\3042,\3017\261\237a3 \313\364\252\202r\221\324q\223\010 \322\335@\035\331\330\265\003^\216mkxRW\315\026\3014\206\370\325\345x\261\3005\265\007DX+0\240{\007R\240v\341-\330\261\332)\235\017\332\361\235\023\332\301\235\027<\201O\354[\302+fMk\333\026\244\035\352u(\353P\277CQ\001O\3100\033{v\246\355\021\355\260x,\035H;\324\353P\326!\277\311\376\341\246\354\360twt\264e\217\360\2411\004'\230jZ\261\377\270\250\007`/~\262\370\351\307\217w\005R\326A\022;\363\2343\237\304\316\266Il""\373\345\234:\212+\303|3\241KC\337\013}\026\372>\227\364\332\333O\010\3677\036=F\225\370j\206\316\362\232\337\306\004HBX\213\r\326\3679\333\353\212\354 \014\356o/\304\355!\365\315!\371\355B\226\345Ps\354\263\250\025\226\276\026\216\370\352\301\t\022\225\365E\300\263,n\022\206\240\370p\354\330~j\251\234\344\033\374{\270\2062\206\265T\321\357R\215\324\033\251\242\323\245\202\233\244g\302\030a\245Z\350m\226%\322\222\356bK'V\366\246\344%\247%\237\227\234\225\232\242\310\254%\274Ax\243\350J2\002\247z\266\340\204\227+BV\024\327\021\275K\321zh\331j\016\032w?\2247\300`\035\372\032:\343\2672\232\240\002\031)\274\320^c6\026\026]/n\211O\213\370\247h=\264>\332D\370p\215\000Fu\000\314z\245@\316P4\313\276X\237\3434`28se\226VW\251\256z\272\272\3228joft\017@t\r\000|SU\3618\252\\!s\264\230\272\345\002\036\003\302=aM\245Q-\255\014\205\231TF \230\202=\250\215\004\005Vvx)\330\215\255W\221jO\316C\027\302\311\243ZU\222\335\300\035\307\225\363\021\361\223\262\375rz$;\252o\217I\217\312\335\203!\007\265\343HzTY\242t\355\302m\300\357uM\313x\226\273\242\335!\026\036X{\014\261\361\320\326%\316\342\026\271\331l\323\217\217\346\216\260&\234\026z\274\230\312\005!\340\265\001\003\304\305\202b\201\200[\207\357\341\355\226\026\005\304\372b\033\n\245\255\256\3614\352\340j\013m\0130\265\266\361\375dCI\303k\t7\262\261\3047\002\273\261\237\323P\233*\233\206\276\207\023\256+\244\027\201L\346\325_\373\344\324\001\273\026\354\n\355\227[mn\220\213\230\330l\020\212\033\304\337\306\307F\323\270p\201\335I\373\363ws)+\334\226\2654Z\255pkN\270X\343\nw\316\317b\251\313hE\347\262\224\256\031\322\337\264\371\363QRa\224\010\217/\344,\344\244\034/\250\360\212\020<\362s\005\245%\237\n\253k\303\304y\3109\007\242\220z#g(V\3324i\211J\037^\256\221;\021\002\371\036\t\307\246%\374\310\233A|2\302\304\344\013t\2253\304}\225x\262\275,7\260\026\017\315\312\007\347\227'\321\373\271\315\302\363\025\357\331\355\2340\373\3619k-\371_Z<>\242N\332\267\323ne\277\300\227'>\r\267Oe\022\325 \220\377'\375\360\361?\357\376v\227\336]\335""\317\336}\352\311\323\267?\337\321\377\375\375\344\037\247o\277\371p\372\374\356\207\373\177\337\323\017\247\237\335}\376\337\323\347\177<\177\361\356\365\373g \377\370\354\213\367\317\336\177\372\341\343O\336N\3376\367\317\356\237\337\367\337}\364n\375\276\370\375\243\337_\237\347\223\370v'\305,\235]\026$\275\270\030g\344e\232_\014\372\017\205\323\354\234\014\363b\230\316\262\363\007\322\301\325 \273\234\345\343\321S\323\363Qq\371\362e\236\345\203\321\214L\007\305\370r\232\r\212G\206\315\006\323QzA\006\323\351x\372\210\370Uz\221\367\t\372\313\301\003\3510\235L\362\321OO\314\205\342\323\374\212\314~\231\014\310h<#\305\345d2\236\316\036\321\325K\363Q>\313\261\327\257O\310\237\236]\\f\260\354\241i\277\016\246c2\311_\215g\377\007\226Pf\216";
    PyObject *data = __Pyx_DecompressString(cstring, 1642, 1);
    if (unlikely(!data)) __PYX_ERR(0, 1, __pyx_L1_error)
    const char* const bytes = __Pyx_PyBytes_AsString(data);
    #if !CYTHON_ASSUME_SAFE_MACROS
    if (likely(bytes)); else { Py_DECREF(data); __PYX_ERR(0, 1, __pyx_L1_error) }
    #endif
    #else /* compression: none (3579 bytes) */
const char* const bytes = ": Note that Cython is deliberately stricter than PEP-484 and rejects subclasses of builtin types. If you need to pass subclasses then set the 'annotation_typing' directive to False..?add_notecalling cuSPARSE API during stream capture is currently unsupportedcupy_backends/cuda/libs/cusparse.pyxdisableenablegcisenabledABCCooAoSAttributesCooAttributesCreateCscCsrAttributesCuSparseErrorCuSparseError.__init__CuSparseError.__reduce__DenseToSparse_analysisDenseToSparse_bufferSizeDenseToSparse_convertDnMatAttributesDnMatBatchAttributesDnVecAttributesP__Pyx_PyDict_NextRefSpGEAMSpGEAM_bufferSizeSpGEAM_createDescrSpGEAM_destroyDescrSpGEAM_nnzSpMatSetAttributeSpSM_analysisSpSM_bufferSizeSpSM_createDescrSpSM_destroyDescrSpSM_solveSpVecAttributesSparseToDenseSparseToDense_bufferSizealgalgoalphaalphatypeasyncio.coroutinesattributebasebatchCountbatchStridebetabetatypeblockDimboost_valbsrSortedColIndbsrSortedRowPtrbsrSortedValbufferbufferSizecline_in_tracebackcolIdxcolIdxTypecolscomputeTypecooColIndcooColscooIdxTypecooIndcooRowIndcooRowscooValuescopyValuescountcscColOffsetscscColOffsetsTypecscColPtrcscColPtrAcscRowIndcscRowIndAcscRowIndTypecscSortedColPtrAcscSortedRowIndAcscSortedValAcscValcscValAcscValuescsrColIndcsrColIndAcsrColIndBcsrColIndCcsrColIndDcsrColIndTypecsrColindcsrRowOffsetscsrRowOffsetsTypecsrRowPtrcsrRowPtrAcsrRowPtrBcsrRowPtrCcsrRowPtrDcsrSortedColIndAcsrSortedRowPtrAcsrSortedValAcsrSortedValA_valMcsrValcsrValAcsrValAtypecsrValBcsrValCcsrValDcsrValuescudacupy_backends.cuda.libs.cusparsecusparseddatadescdescrdescrAdescrBdescrCdescrDdiagType__dict__dirAdl__doc__dsdudwenable_boostexecutiontypeexternalBufferexternalBuffer1externalBuffer2fillMode__func__get_build_version__getstate__handle_handle_uintidxidxBaseidxTypeinColIndinNnzinRowPtrinValindindicesinfo__init___is_coroutineitemskldldaldbldcload_nvidia_dynamic_libloaded_dlm__main__matAmatBmatCmb__metaclass__mode__module____mro_entries__msgn__name__name__new__nnznnzAnnzBnnzDnnzPerColnnzPerRownnzPerRowColumnnnzTotalDevHo""stPtrnnzbnrhsopAopBopXorderoutColIndoutRowPtroutValppBufferpInputBufferpathfinderpolicypopposition__prepare____pyx_capi____pyx_checksum__pyx_state__pyx_type__pyx_unpickle_CooAoSAttributes__pyx_unpickle_CooAttributes__pyx_unpickle_CsrAttributes__pyx_unpickle_DnMatAttributes__pyx_unpickle_DnMatBatchAttributes__pyx_unpickle_DnVecAttributes__pyx_unpickle_SpVecAttributes__pyx_vtable____qualname____reduce____reduce_cython____reduce_ex__resultrowIdxrowOffsetTyperowOffsetsrowPtrrowsself__set_name__setdefault__setstate____setstate_cython__sizespMatDescrspgeamDescrspgemmDescrspsmDescrstatusstreamstridesupersys_sys__test__toltransAtransBtypupdatevalTypevalueTypevaluesvecXvecYworkspacexxIndxValxtypeyytypeint\000\000\000\000\000\000\000\000_is_hip_environment\000deviceAttributeComputeCapabilityMajor\000deviceAttributeComputeCapabilityMinor\000errorContextIsDestroyed\000errorInvalidResourceHandle\000errorInvalidValue\000errorMemoryAllocation\000errorPeerAccessAlreadyEnabledint (intptr_t, int __pyx_skip_dispatch)\000streamIsCapturingintptr_t (int __pyx_skip_dispatch)\000void (intptr_t, int __pyx_skip_dispatch)\000create\000destroyintptr_t (void)\000get_current_stream_ptr\200A\330\010\020\220\004\220A\220X\230T\240\021\200A\330\010\014\210J\220a\360\006\000\t\014\2101\330\014\023\220:\230Q\230a\330\014\022\220!\340\014\023\320\023'\240q\250\001\330\014\022\320\022(\250\001\250\021\330\010\r\210R\210y\230\001\230\023\230D\240\007\240v\250S\260\007\260qHIPSPARSE_STATUS_ALLOC_FAILEDHIPSPARSE_STATUS_ARCH_MISMATCHHIPSPARSE_STATUS_EXECUTION_FAILEDHIPSPARSE_STATUS_INSUFFICIENT_RESOURCESHIPSPARSE_STATUS_INTERNAL_ERRORHIPSPARSE_STATUS_INVALID_VALUEHIPSPARSE_STATUS_MAPPING_ERRORHIPSPARSE_STATUS_MATRIX_TYPE_NOT_SUPPORTEDHIPSPARSE_STATUS_NOT_INITIALIZEDHIPSPARSE_STATUS_NOT_SUPPORTEDHIPSPARSE_STATUS_SUCCESSHIPSPARSE_STATUS_ZERO_PIVOT";
    PyObject *data = NULL;
    CYTHON_UNUSED_VAR(__Pyx_DecompressString);
    #endif
    PyObject **stringtab = __pyx_mstate->__pyx_string_tab;
    Py_ssize_t pos = 0;
    for (int i = 0; i < 259; i++) {
      Py_ssize_t bytes_length = index[i].length;
      PyObject *string = PyUnicode_DecodeUTF8(bytes + pos, bytes_length, NULL);
      if (likely(string) && i >= 11) PyUnicode_InternInPlace(&string);
      if (unlikely(!string)) {
        Py_XDECREF(data);
        __PYX_ERR(0, 1, __pyx_L1_error)
      }
      stringtab[i] = string;
      pos += bytes_length;
    }
    for (int i = 259; i < 277; i++) {
      Py_ssize_t bytes_length = index[i].length;
      PyObject *string = PyBytes_FromStringAndSize(bytes + pos, bytes_length);
      stringtab[i] = string;
      pos += bytes_length;
      if (unlikely(!string)) {
        Py_XDECREF(data);
        __PYX_ERR(0, 1, __pyx_L1_error)
      }
    }
    Py_XDECREF(data);
    for (Py_ssize_t i = 0; i < 277; i++) {
      if (unlikely(PyObject_Hash(stringtab[i]) == -1)) {
        __PYX_ERR(0, 1, __pyx_L1_error)
      }
    }
    #if CYTHON_IMMORTAL_CONSTANTS
    {
      PyObject **table = stringtab + 259;
      for (Py_ssize_t i=0; i<18; ++i) {
        #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
        #if PY_VERSION_HEX < 0x030E0000
        if (_Py_IsOwnedByCurrentThread(table[i]) && Py_REFCNT(table[i]) == 1)
        #else
        if (PyUnstable_Object_IsUniquelyReferenced(table[i]))
        #endif
        {
          Py_SET_REFCNT(table[i], _Py_IMMORTAL_REFCNT_LOCAL);
        }
        #else
        Py_SET_REFCNT(table[i], _Py_IMMORTAL_INITIAL_REFCNT);
        #endif
      }
    }
    #endif
  }
  {
    PyObject **numbertab = __pyx_mstate->__pyx_number_tab + 0;
    int8_t const cint_constants_1[] = {0,1,2,3,4,5,6,7,8,9,10,11};
    int32_t const cint_constants_4[] = {38849453L,43729802L,78664458L,82484563L,95034960L,185334054L,243297874L};
    for (int i = 0; i < 19; i++) {
      numbertab[i] = PyLong_FromLong((i < 12 ? cint_constants_1[i - 0] : cint_constants_4[i - 12]));
      if (unlikely(!numbertab[i])) __PYX_ERR(0, 1, __pyx_L1_error)
    }
  }
  #if CYTHON_IMMORTAL_CONSTANTS
  {
    PyObject **table = __pyx_mstate->__pyx_number_tab;
    for (Py_ssize_t i=0; i<19; ++i) {
      #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
      #if PY_VERSION_HEX < 0x030E0000
      if (_Py_IsOwnedByCurrentThread(table[i]) && Py_REFCNT(table[i]) == 1)
      #else
      if (PyUnstable_Object_IsUniquelyReferenced(table[i]))
      #endif
      {
        Py_SET_REFCNT(table[i], _Py_IMMORTAL_REFCNT_LOCAL);
      }
      #else
      Py_SET_REFCNT(table[i], _Py_IMMORTAL_INITIAL_REFCNT);
      #endif
    }
  }
  #endif
  return 0;
  __pyx_L1_error:;
  return -1;
}
/* #### Code section: init_codeobjects ### */
typedef struct {
    unsigned int argcount : 2;
    unsigned int num_posonly_args : 1;
    unsigned int num_kwonly_args : 1;
    unsigned int nlocals : 3;
    unsigned int flags : 10;
    unsigned int first_line : 11;
} __Pyx_PyCode_New_function_description;
/* NewCodeObj.proto */
static PyObject* __Pyx_PyCode_New(
        const __Pyx_PyCode_New_function_description descr,
        PyObject * const *varnames,
        PyObject *filename,
        PyObject *funcname,
        PyObject *line_table,
        PyObject *tuple_dedup_map
);


static int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate) {
  PyObject* tuple_dedup_map = PyDict_New();
  if (unlikely(!tuple_dedup_map)) return -1;
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1523};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_status, __pyx_mstate->__pyx_n_u_name_2, __pyx_mstate->__pyx_n_u_msg};
    __pyx_mstate_global->__pyx_codeobj_tab[0] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cupy_backends_cuda_libs_cusparse_2, __pyx_mstate->__pyx_n_u_init, __pyx_mstate->__pyx_kp_b_iso88591_A_Ja_1_Qa_q_Ry_D_vS_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[0])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1535};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[1] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_cupy_backends_cuda_libs_cusparse_2, __pyx_mstate->__pyx_n_u_reduce, __pyx_mstate->__pyx_kp_b_iso88591_A_AXT, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1])) goto bad;
  }
  Py_DECREF(tuple_dedup_map);
  return 0;
  bad:
  Py_DECREF(tuple_dedup_map);
  return -1;
}
/* #### Code section: init_globals ### */

static int __Pyx_InitGlobals(void) {
  /* PythonCompatibility.init */
  if (likely(__Pyx_init_co_variables() == 0)); else
  
  if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)

  /* CommonTypesMetaclass.init */
  if (likely(__pyx_CommonTypesMetaclass_init(__pyx_m) == 0)); else
  
  if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)

  /* CachedMethodType.init */
  #if CYTHON_COMPILING_IN_LIMITED_API
  {
      PyObject *typesModule=NULL;
      typesModule = PyImport_ImportModule("types");
      if (typesModule) {
          __pyx_mstate_global->__Pyx_CachedMethodType = PyObject_GetAttrString(typesModule, "MethodType");
          Py_DECREF(typesModule);
      }
  } // error handling follows
  #endif
  
  if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)

  /* CythonFunctionShared.init */
  if (likely(__pyx_CyFunction_init(__pyx_m) == 0)); else
  
  if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)

  return 0;
  __pyx_L1_error:;
  return -1;
}
/* #### Code section: cleanup_globals ### */
/* #### Code section: cleanup_module ### */
/* #### Code section: main_method ### */
/* #### Code section: utility_code_pragmas ### */
#ifdef _MSC_VER
#pragma warning( push )
/* Warning 4127: conditional expression is constant
 * Cython uses constant conditional expressions to allow in inline functions to be optimized at
 * compile-time, so this warning is not useful
 */
#pragma warning( disable : 4127 )
#endif



/* #### Code section: utility_code_def ### */

/* --- Runtime support code --- */
/* Refnanny */
#if CYTHON_REFNANNY
static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
    PyObject *m = NULL, *p = NULL;
    void *r = NULL;
    m = PyImport_ImportModule(modname);
    if (!m) goto end;
    p = PyObject_GetAttrString(m, "RefNannyAPI");
    if (!p) goto end;
    r = PyLong_AsVoidPtr(p);
end:
    Py_XDECREF(p);
    Py_XDECREF(m);
    return (__Pyx_RefNannyAPIStruct *)r;
}
#endif

/* PyErrExceptionMatches (used by PyObjectGetAttrStrNoError) */
#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);
    for (i=0; i<n; i++) {
        if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
    }
    for (i=0; i<n; i++) {
        if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
    }
    return 0;
}
static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
    int result;
    PyObject *exc_type;
#if PY_VERSION_HEX >= 0x030C00A6
    PyObject *current_exception = tstate->current_exception;
    if (unlikely(!current_exception)) return 0;
    exc_type = (PyObject*) Py_TYPE(current_exception);
    if (exc_type == err) return 1;
#else
    exc_type = tstate->curexc_type;
    if (exc_type == err) return 1;
    if (unlikely(!exc_type)) return 0;
#endif
    #if CYTHON_AVOID_BORROWED_REFS
    Py_INCREF(exc_type);
    #endif
    if (unlikely(PyTuple_Check(err))) {
        result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
    } else {
        result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
    }
    #if CYTHON_AVOID_BORROWED_REFS
    Py_DECREF(exc_type);
    #endif
    return result;
}
#endif

/* PyErrFetchRestore (used by PyObjectGetAttrStrNoError) */
#if CYTHON_FAST_THREAD_STATE
static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
#if PY_VERSION_HEX >= 0x030C00A6
    PyObject *tmp_value;
    assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value)));
    if (value) {
        #if CYTHON_COMPILING_IN_CPYTHON
        if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb))
        #endif
            PyException_SetTraceback(value, tb);
    }
    tmp_value = tstate->current_exception;
    tstate->current_exception = value;
    Py_XDECREF(tmp_value);
    Py_XDECREF(type);
    Py_XDECREF(tb);
#else
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    tmp_type = tstate->curexc_type;
    tmp_value = tstate->curexc_value;
    tmp_tb = tstate->curexc_traceback;
    tstate->curexc_type = type;
    tstate->curexc_value = value;
    tstate->curexc_traceback = tb;
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
#endif
}
static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
#if PY_VERSION_HEX >= 0x030C00A6
    PyObject* exc_value;
    exc_value = tstate->current_exception;
    tstate->current_exception = 0;
    *value = exc_value;
    *type = NULL;
    *tb = NULL;
    if (exc_value) {
        *type = (PyObject*) Py_TYPE(exc_value);
        Py_INCREF(*type);
        #if CYTHON_COMPILING_IN_CPYTHON
        *tb = ((PyBaseExceptionObject*) exc_value)->traceback;
        Py_XINCREF(*tb);
        #else
        *tb = PyException_GetTraceback(exc_value);
        #endif
    }
#else
    *type = tstate->curexc_type;
    *value = tstate->curexc_value;
    *tb = tstate->curexc_traceback;
    tstate->curexc_type = 0;
    tstate->curexc_value = 0;
    tstate->curexc_traceback = 0;
#endif
}
#endif

/* PyObjectGetAttrStr (used by PyObjectGetAttrStrNoError) */
#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);
    return PyObject_GetAttr(obj, attr_name);
}
#endif

/* PyObjectGetAttrStrNoError (used by GetBuiltinName) */
#if __PYX_LIMITED_VERSION_HEX < 0x030d0000
static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
        __Pyx_PyErr_Clear();
}
#endif
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) {
    PyObject *result;
#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
    (void) PyObject_GetOptionalAttr(obj, attr_name, &result);
    return result;
#else
#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS
    PyTypeObject* tp = Py_TYPE(obj);
    if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) {
        return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1);
    }
#endif
    result = __Pyx_PyObject_GetAttrStr(obj, attr_name);
    if (unlikely(!result)) {
        __Pyx_PyObject_GetAttrStr_ClearAttributeError();
    }
    return result;
#endif
}

/* GetBuiltinName */
static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
    PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_mstate_global->__pyx_b, name);
    if (unlikely(!result) && !PyErr_Occurred()) {
        PyErr_Format(PyExc_NameError,
            "name '%U' is not defined", name);
    }
    return result;
}

/* TupleAndListFromArray (used by fastcall) */
#if !CYTHON_COMPILING_IN_CPYTHON && CYTHON_METH_FASTCALL
static CYTHON_INLINE PyObject *
__Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n)
{
    PyObject *res;
    Py_ssize_t i;
    if (n <= 0) {
        return __Pyx_NewRef(__pyx_mstate_global->__pyx_empty_tuple);
    }
    res = PyTuple_New(n);
    if (unlikely(res == NULL)) return NULL;
    for (i = 0; i < n; i++) {
        Py_INCREF(src[i]);
        if (unlikely(__Pyx_PyTuple_SET_ITEM(res, i, src[i]) < (0))) {
            Py_DECREF(res);
            return NULL;
        }
    }
    return res;
}
#elif CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) {
    PyObject *v;
    Py_ssize_t i;
    for (i = 0; i < length; i++) {
        v = dest[i] = src[i];
        Py_INCREF(v);
    }
}
static CYTHON_INLINE PyObject *
__Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n)
{
    PyObject *res;
    if (n <= 0) {
        return __Pyx_NewRef(__pyx_mstate_global->__pyx_empty_tuple);
    }
    res = PyTuple_New(n);
    if (unlikely(res == NULL)) return NULL;
    __Pyx_copy_object_array(src, ((PyTupleObject*)res)->ob_item, n);
    return res;
}
static CYTHON_INLINE PyObject *
__Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n)
{
    PyObject *res;
    if (n <= 0) {
        return PyList_New(0);
    }
    res = PyList_New(n);
    if (unlikely(res == NULL)) return NULL;
    __Pyx_copy_object_array(src, ((PyListObject*)res)->ob_item, n);
    return res;
}
#endif

/* BytesEquals (used by UnicodeEquals) */
static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_GRAAL ||\
        !(CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS)
    return PyObject_RichCompareBool(s1, s2, equals);
#else
    if (s1 == s2) {
        return (equals == Py_EQ);
    } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
        const char *ps1, *ps2;
        Py_ssize_t length = PyBytes_GET_SIZE(s1);
        if (length != PyBytes_GET_SIZE(s2))
            return (equals == Py_NE);
        ps1 = PyBytes_AS_STRING(s1);
        ps2 = PyBytes_AS_STRING(s2);
        if (ps1[0] != ps2[0]) {
            return (equals == Py_NE);
        } else if (length == 1) {
            return (equals == Py_EQ);
        } else {
            int result;
#if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000)
            Py_hash_t hash1, hash2;
            hash1 = ((PyBytesObject*)s1)->ob_shash;
            hash2 = ((PyBytesObject*)s2)->ob_shash;
            if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
                return (equals == Py_NE);
            }
#endif
            result = memcmp(ps1, ps2, (size_t)length);
            return (equals == Py_EQ) ? (result == 0) : (result != 0);
        }
    } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
        return (equals == Py_NE);
    } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
        return (equals == Py_NE);
    } else {
        int result;
        PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
        if (!py_result)
            return -1;
        result = __Pyx_PyObject_IsTrue(py_result);
        Py_DECREF(py_result);
        return result;
    }
#endif
}

/* UnicodeEquals (used by fastcall) */
static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_GRAAL
    return PyObject_RichCompareBool(s1, s2, equals);
#else
    int s1_is_unicode, s2_is_unicode;
    if (s1 == s2) {
        goto return_eq;
    }
    s1_is_unicode = PyUnicode_CheckExact(s1);
    s2_is_unicode = PyUnicode_CheckExact(s2);
    if (s1_is_unicode & s2_is_unicode) {
        Py_ssize_t length, length2;
        int kind;
        void *data1, *data2;
        #if !CYTHON_COMPILING_IN_LIMITED_API
        if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
            return -1;
        #endif
        length = __Pyx_PyUnicode_GET_LENGTH(s1);
        #if !CYTHON_ASSUME_SAFE_SIZE
        if (unlikely(length < 0)) return -1;
        #endif
        length2 = __Pyx_PyUnicode_GET_LENGTH(s2);
        #if !CYTHON_ASSUME_SAFE_SIZE
        if (unlikely(length2 < 0)) return -1;
        #endif
        if (length != length2) {
            goto return_ne;
        }
#if CYTHON_USE_UNICODE_INTERNALS
        {
            Py_hash_t hash1, hash2;
            hash1 = ((PyASCIIObject*)s1)->hash;
            hash2 = ((PyASCIIObject*)s2)->hash;
            if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
                goto return_ne;
            }
        }
#endif
        kind = __Pyx_PyUnicode_KIND(s1);
        if (kind != __Pyx_PyUnicode_KIND(s2)) {
            goto return_ne;
        }
        data1 = __Pyx_PyUnicode_DATA(s1);
        data2 = __Pyx_PyUnicode_DATA(s2);
        if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
            goto return_ne;
        } else if (length == 1) {
            goto return_eq;
        } else {
            int result = memcmp(data1, data2, (size_t)(length * kind));
            return (equals == Py_EQ) ? (result == 0) : (result != 0);
        }
    } else if ((s1 == Py_None) & s2_is_unicode) {
        goto return_ne;
    } else if ((s2 == Py_None) & s1_is_unicode) {
        goto return_ne;
    } else {
        int result;
        PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
        if (!py_result)
            return -1;
        result = __Pyx_PyObject_IsTrue(py_result);
        Py_DECREF(py_result);
        return result;
    }
return_eq:
    return (equals == Py_EQ);
return_ne:
    return (equals == Py_NE);
#endif
}

/* fastcall */
#if CYTHON_METH_FASTCALL
static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s)
{
    Py_ssize_t i, n = __Pyx_PyTuple_GET_SIZE(kwnames);
    #if !CYTHON_ASSUME_SAFE_SIZE
    if (unlikely(n == -1)) return NULL;
    #endif
    for (i = 0; i < n; i++)
    {
        PyObject *namei = __Pyx_PyTuple_GET_ITEM(kwnames, i);
        #if !CYTHON_ASSUME_SAFE_MACROS
        if (unlikely(!namei)) return NULL;
        #endif
        if (s == namei) return kwvalues[i];
    }
    for (i = 0; i < n; i++)
    {
        PyObject *namei = __Pyx_PyTuple_GET_ITEM(kwnames, i);
        #if !CYTHON_ASSUME_SAFE_MACROS
        if (unlikely(!namei)) return NULL;
        #endif
        int eq = __Pyx_PyUnicode_Equals(s, namei, Py_EQ);
        if (unlikely(eq != 0)) {
            if (unlikely(eq < 0)) return NULL;
            return kwvalues[i];
        }
    }
    return NULL;
}
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 || CYTHON_COMPILING_IN_LIMITED_API
CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) {
    Py_ssize_t i, nkwargs;
    PyObject *dict;
#if !CYTHON_ASSUME_SAFE_SIZE
    nkwargs = PyTuple_Size(kwnames);
    if (unlikely(nkwargs < 0)) return NULL;
#else
    nkwargs = PyTuple_GET_SIZE(kwnames);
#endif
    dict = PyDict_New();
    if (unlikely(!dict))
        return NULL;
    for (i=0; i<nkwargs; i++) {
#if !CYTHON_ASSUME_SAFE_MACROS
        PyObject *key = PyTuple_GetItem(kwnames, i);
        if (!key) goto bad;
#else
        PyObject *key = PyTuple_GET_ITEM(kwnames, i);
#endif
        if (unlikely(PyDict_SetItem(dict, key, kwvalues[i]) < 0))
            goto bad;
    }
    return dict;
bad:
    Py_DECREF(dict);
    return NULL;
}
#endif
#endif

/* PyObjectCall (used by PyObjectFastCall) */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
    PyObject *result;
    ternaryfunc call = Py_TYPE(func)->tp_call;
    if (unlikely(!call))
        return PyObject_Call(func, arg, kw);
    if (unlikely(Py_EnterRecursiveCall(" 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

/* PyObjectCallMethO (used by PyObjectFastCall) */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
    PyObject *self, *result;
    PyCFunction cfunc;
    cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func);
    self = __Pyx_CyOrPyCFunction_GET_SELF(func);
    if (unlikely(Py_EnterRecursiveCall(" 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

/* PyObjectFastCall (used by PyObjectCallOneArg) */
#if PY_VERSION_HEX < 0x03090000 || CYTHON_COMPILING_IN_LIMITED_API
static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject * const*args, size_t nargs, PyObject *kwargs) {
    PyObject *argstuple;
    PyObject *result = 0;
    size_t i;
    argstuple = PyTuple_New((Py_ssize_t)nargs);
    if (unlikely(!argstuple)) return NULL;
    for (i = 0; i < nargs; i++) {
        Py_INCREF(args[i]);
        if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) != (0)) goto bad;
    }
    result = __Pyx_PyObject_Call(func, argstuple, kwargs);
  bad:
    Py_DECREF(argstuple);
    return result;
}
#endif
#if CYTHON_VECTORCALL && !CYTHON_COMPILING_IN_LIMITED_API
  #if PY_VERSION_HEX < 0x03090000
    #define __Pyx_PyVectorcall_Function(callable) _PyVectorcall_Function(callable)
  #elif CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE vectorcallfunc __Pyx_PyVectorcall_Function(PyObject *callable) {
    PyTypeObject *tp = Py_TYPE(callable);
    #if defined(__Pyx_CyFunction_USED)
    if (__Pyx_CyFunction_CheckExact(callable)) {
        return __Pyx_CyFunction_func_vectorcall(callable);
    }
    #endif
    if (!PyType_HasFeature(tp, Py_TPFLAGS_HAVE_VECTORCALL)) {
        return NULL;
    }
    assert(PyCallable_Check(callable));
    Py_ssize_t offset = tp->tp_vectorcall_offset;
    assert(offset > 0);
    vectorcallfunc ptr;
    memcpy(&ptr, (char *) callable + offset, sizeof(ptr));
    return ptr;
}
  #else
    #define __Pyx_PyVectorcall_Function(callable) PyVectorcall_Function(callable)
  #endif
#endif
static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject *const *args, size_t _nargs, PyObject *kwargs) {
    Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs);
#if CYTHON_COMPILING_IN_CPYTHON
    if (nargs == 0 && kwargs == NULL) {
        if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_NOARGS))
            return __Pyx_PyObject_CallMethO(func, NULL);
    }
    else if (nargs == 1 && kwargs == NULL) {
        if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_O))
            return __Pyx_PyObject_CallMethO(func, args[0]);
    }
#endif
    if (kwargs == NULL) {
        #if CYTHON_VECTORCALL
          #if CYTHON_COMPILING_IN_LIMITED_API
            return PyObject_Vectorcall(func, args, _nargs, NULL);
          #else
            vectorcallfunc f = __Pyx_PyVectorcall_Function(func);
            if (f) {
                return f(func, args, _nargs, NULL);
            }
          #endif
        #endif
    }
    if (nargs == 0) {
        return __Pyx_PyObject_Call(func, __pyx_mstate_global->__pyx_empty_tuple, kwargs);
    }
    #if PY_VERSION_HEX >= 0x03090000 && !CYTHON_COMPILING_IN_LIMITED_API
    return PyObject_VectorcallDict(func, args, (size_t)nargs, kwargs);
    #else
    return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs);
    #endif
}

/* PyObjectCallOneArg (used by CallUnboundCMethod0) */
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
    PyObject *args[2] = {NULL, arg};
    return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
}

/* UnpackUnboundCMethod (used by CallUnboundCMethod0) */
#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030C0000
static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject *args, PyObject *kwargs) {
    PyObject *result;
    PyObject *selfless_args = PyTuple_GetSlice(args, 1, PyTuple_Size(args));
    if (unlikely(!selfless_args)) return NULL;
    result = PyObject_Call(method, selfless_args, kwargs);
    Py_DECREF(selfless_args);
    return result;
}
#elif CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03090000
static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) {
        return _PyObject_Vectorcall
            (method, args ? args+1 : NULL, nargs ? nargs-1 : 0, kwnames);
}
#else
static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) {
    return
#if PY_VERSION_HEX < 0x03090000
    _PyObject_Vectorcall
#else
    PyObject_Vectorcall
#endif
        (method, args ? args+1 : NULL, nargs ? (size_t) nargs-1 : 0, kwnames);
}
#endif
static PyMethodDef __Pyx_UnboundCMethod_Def = {
     "CythonUnboundCMethod",
     __PYX_REINTERPRET_FUNCION(PyCFunction, __Pyx_SelflessCall),
#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030C0000
     METH_VARARGS | METH_KEYWORDS,
#else
     METH_FASTCALL | METH_KEYWORDS,
#endif
     NULL
};
static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) {
    PyObject *method, *result=NULL;
    method = __Pyx_PyObject_GetAttrStr(target->type, *target->method_name);
    if (unlikely(!method))
        return -1;
    result = method;
#if CYTHON_COMPILING_IN_CPYTHON
    if (likely(__Pyx_TypeCheck(method, &PyMethodDescr_Type)))
    {
        PyMethodDescrObject *descr = (PyMethodDescrObject*) method;
        target->func = descr->d_method->ml_meth;
        target->flag = descr->d_method->ml_flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_STACKLESS);
    } else
#endif
#if CYTHON_COMPILING_IN_PYPY
#else
    if (PyCFunction_Check(method))
#endif
    {
        PyObject *self;
        int self_found;
#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
        self = PyObject_GetAttrString(method, "__self__");
        if (!self) {
            PyErr_Clear();
        }
#else
        self = PyCFunction_GET_SELF(method);
#endif
        self_found = (self && self != Py_None);
#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
        Py_XDECREF(self);
#endif
        if (self_found) {
            PyObject *unbound_method = PyCFunction_New(&__Pyx_UnboundCMethod_Def, method);
            if (unlikely(!unbound_method)) return -1;
            Py_DECREF(method);
            result = unbound_method;
        }
    }
#if !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    if (unlikely(target->method)) {
        Py_DECREF(result);
    } else
#endif
    target->method = result;
    return 0;
}

/* CallUnboundCMethod0 */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self) {
    int was_initialized = __Pyx_CachedCFunction_GetAndSetInitializing(cfunc);
    if (likely(was_initialized == 2 && cfunc->func)) {
        if (likely(cfunc->flag == METH_NOARGS))
            return __Pyx_CallCFunction(cfunc, self, NULL);
        if (likely(cfunc->flag == METH_FASTCALL))
            return __Pyx_CallCFunctionFast(cfunc, self, NULL, 0);
        if (cfunc->flag == (METH_FASTCALL | METH_KEYWORDS))
            return __Pyx_CallCFunctionFastWithKeywords(cfunc, self, NULL, 0, NULL);
        if (likely(cfunc->flag == (METH_VARARGS | METH_KEYWORDS)))
            return __Pyx_CallCFunctionWithKeywords(cfunc, self, __pyx_mstate_global->__pyx_empty_tuple, NULL);
        if (cfunc->flag == METH_VARARGS)
            return __Pyx_CallCFunction(cfunc, self, __pyx_mstate_global->__pyx_empty_tuple);
        return __Pyx__CallUnboundCMethod0(cfunc, self);
    }
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    else if (unlikely(was_initialized == 1)) {
        __Pyx_CachedCFunction tmp_cfunc = {
#ifndef __cplusplus
            0
#endif
        };
        tmp_cfunc.type = cfunc->type;
        tmp_cfunc.method_name = cfunc->method_name;
        return __Pyx__CallUnboundCMethod0(&tmp_cfunc, self);
    }
#endif
    PyObject *result = __Pyx__CallUnboundCMethod0(cfunc, self);
    __Pyx_CachedCFunction_SetFinishedInitializing(cfunc);
    return result;
}
#endif
static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self) {
    PyObject *result;
    if (unlikely(!cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL;
    result = __Pyx_PyObject_CallOneArg(cfunc->method, self);
    return result;
}

/* py_dict_items (used by OwnedDictNext) */
static CYTHON_INLINE PyObject* __Pyx_PyDict_Items(PyObject* d) {
    return __Pyx_CallUnboundCMethod0(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_items, d);
}

/* py_dict_values (used by OwnedDictNext) */
static CYTHON_INLINE PyObject* __Pyx_PyDict_Values(PyObject* d) {
    return __Pyx_CallUnboundCMethod0(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_values, d);
}

/* OwnedDictNext (used by ParseKeywordsImpl) */
#if CYTHON_AVOID_BORROWED_REFS
static int __Pyx_PyDict_NextRef(PyObject *p, PyObject **ppos, PyObject **pkey, PyObject **pvalue) {
    PyObject *next = NULL;
    if (!*ppos) {
        if (pvalue) {
            PyObject *dictview = pkey ? __Pyx_PyDict_Items(p) : __Pyx_PyDict_Values(p);
            if (unlikely(!dictview)) goto bad;
            *ppos = PyObject_GetIter(dictview);
            Py_DECREF(dictview);
        } else {
            *ppos = PyObject_GetIter(p);
        }
        if (unlikely(!*ppos)) goto bad;
    }
    next = PyIter_Next(*ppos);
    if (!next) {
        if (PyErr_Occurred()) goto bad;
        return 0;
    }
    if (pkey && pvalue) {
        *pkey = __Pyx_PySequence_ITEM(next, 0);
        if (unlikely(*pkey)) goto bad;
        *pvalue = __Pyx_PySequence_ITEM(next, 1);
        if (unlikely(*pvalue)) goto bad;
        Py_DECREF(next);
    } else if (pkey) {
        *pkey = next;
    } else {
        assert(pvalue);
        *pvalue = next;
    }
    return 1;
  bad:
    Py_XDECREF(next);
#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d0000
    PyErr_FormatUnraisable("Exception ignored in __Pyx_PyDict_NextRef");
#else
    PyErr_WriteUnraisable(__pyx_mstate_global->__pyx_n_u_Pyx_PyDict_NextRef);
#endif
    if (pkey) *pkey = NULL;
    if (pvalue) *pvalue = NULL;
    return 0;
}
#else // !CYTHON_AVOID_BORROWED_REFS
static int __Pyx_PyDict_NextRef(PyObject *p, Py_ssize_t *ppos, PyObject **pkey, PyObject **pvalue) {
    int result = PyDict_Next(p, ppos, pkey, pvalue);
    if (likely(result == 1)) {
        if (pkey) Py_INCREF(*pkey);
        if (pvalue) Py_INCREF(*pvalue);
    }
    return result;
}
#endif

/* RaiseDoubleKeywords (used by ParseKeywordsImpl) */
static void __Pyx_RaiseDoubleKeywordsError(
    const char* func_name,
    PyObject* kw_name)
{
    PyErr_Format(PyExc_TypeError,
        "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
}

/* CallUnboundCMethod2 */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2) {
    int was_initialized = __Pyx_CachedCFunction_GetAndSetInitializing(cfunc);
    if (likely(was_initialized == 2 && cfunc->func)) {
        PyObject *args[2] = {arg1, arg2};
        if (cfunc->flag == METH_FASTCALL) {
            return __Pyx_CallCFunctionFast(cfunc, self, args, 2);
        }
        if (cfunc->flag == (METH_FASTCALL | METH_KEYWORDS))
            return __Pyx_CallCFunctionFastWithKeywords(cfunc, self, args, 2, NULL);
    }
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    else if (unlikely(was_initialized == 1)) {
        __Pyx_CachedCFunction tmp_cfunc = {
#ifndef __cplusplus
            0
#endif
        };
        tmp_cfunc.type = cfunc->type;
        tmp_cfunc.method_name = cfunc->method_name;
        return __Pyx__CallUnboundCMethod2(&tmp_cfunc, self, arg1, arg2);
    }
#endif
    PyObject *result = __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2);
    __Pyx_CachedCFunction_SetFinishedInitializing(cfunc);
    return result;
}
#endif
static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2){
    if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL;
#if CYTHON_COMPILING_IN_CPYTHON
    if (cfunc->func && (cfunc->flag & METH_VARARGS)) {
        PyObject *result = NULL;
        PyObject *args = PyTuple_New(2);
        if (unlikely(!args)) return NULL;
        Py_INCREF(arg1);
        PyTuple_SET_ITEM(args, 0, arg1);
        Py_INCREF(arg2);
        PyTuple_SET_ITEM(args, 1, arg2);
        if (cfunc->flag & METH_KEYWORDS)
            result = __Pyx_CallCFunctionWithKeywords(cfunc, self, args, NULL);
        else
            result = __Pyx_CallCFunction(cfunc, self, args);
        Py_DECREF(args);
        return result;
    }
#endif
    {
        PyObject *args[4] = {NULL, self, arg1, arg2};
        return __Pyx_PyObject_FastCall(cfunc->method, args+1, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
    }
}

/* ParseKeywordsImpl (used by ParseKeywords) */
static int __Pyx_ValidateDuplicatePosArgs(
    PyObject *kwds,
    PyObject ** const argnames[],
    PyObject ** const *first_kw_arg,
    const char* function_name)
{
    PyObject ** const *name = argnames;
    while (name != first_kw_arg) {
        PyObject *key = **name;
        int found = PyDict_Contains(kwds, key);
        if (unlikely(found)) {
            if (found == 1) __Pyx_RaiseDoubleKeywordsError(function_name, key);
            goto bad;
        }
        name++;
    }
    return 0;
bad:
    return -1;
}
#if CYTHON_USE_UNICODE_INTERNALS
static CYTHON_INLINE int __Pyx_UnicodeKeywordsEqual(PyObject *s1, PyObject *s2) {
    int kind;
    Py_ssize_t len = PyUnicode_GET_LENGTH(s1);
    if (len != PyUnicode_GET_LENGTH(s2)) return 0;
    kind = PyUnicode_KIND(s1);
    if (kind != PyUnicode_KIND(s2)) return 0;
    const void *data1 = PyUnicode_DATA(s1);
    const void *data2 = PyUnicode_DATA(s2);
    return (memcmp(data1, data2, (size_t) len * (size_t) kind) == 0);
}
#endif
static int __Pyx_MatchKeywordArg_str(
    PyObject *key,
    PyObject ** const argnames[],
    PyObject ** const *first_kw_arg,
    size_t *index_found,
    const char *function_name)
{
    PyObject ** const *name;
    #if CYTHON_USE_UNICODE_INTERNALS
    Py_hash_t key_hash = ((PyASCIIObject*)key)->hash;
    if (unlikely(key_hash == -1)) {
        key_hash = PyObject_Hash(key);
        if (unlikely(key_hash == -1))
            goto bad;
    }
    #endif
    name = first_kw_arg;
    while (*name) {
        PyObject *name_str = **name;
        #if CYTHON_USE_UNICODE_INTERNALS
        if (key_hash == ((PyASCIIObject*)name_str)->hash && __Pyx_UnicodeKeywordsEqual(name_str, key)) {
            *index_found = (size_t) (name - argnames);
            return 1;
        }
        #else
        #if CYTHON_ASSUME_SAFE_SIZE
        if (PyUnicode_GET_LENGTH(name_str) == PyUnicode_GET_LENGTH(key))
        #endif
        {
            int cmp = PyUnicode_Compare(name_str, key);
            if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
            if (cmp == 0) {
                *index_found = (size_t) (name - argnames);
                return 1;
            }
        }
        #endif
        name++;
    }
    name = argnames;
    while (name != first_kw_arg) {
        PyObject *name_str = **name;
        #if CYTHON_USE_UNICODE_INTERNALS
        if (unlikely(key_hash == ((PyASCIIObject*)name_str)->hash)) {
            if (__Pyx_UnicodeKeywordsEqual(name_str, key))
                goto arg_passed_twice;
        }
        #else
        #if CYTHON_ASSUME_SAFE_SIZE
        if (PyUnicode_GET_LENGTH(name_str) == PyUnicode_GET_LENGTH(key))
        #endif
        {
            if (unlikely(name_str == key)) goto arg_passed_twice;
            int cmp = PyUnicode_Compare(name_str, key);
            if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
            if (cmp == 0) goto arg_passed_twice;
        }
        #endif
        name++;
    }
    return 0;
arg_passed_twice:
    __Pyx_RaiseDoubleKeywordsError(function_name, key);
    goto bad;
bad:
    return -1;
}
static int __Pyx_MatchKeywordArg_nostr(
    PyObject *key,
    PyObject ** const argnames[],
    PyObject ** const *first_kw_arg,
    size_t *index_found,
    const char *function_name)
{
    PyObject ** const *name;
    if (unlikely(!PyUnicode_Check(key))) goto invalid_keyword_type;
    name = first_kw_arg;
    while (*name) {
        int cmp = PyObject_RichCompareBool(**name, key, Py_EQ);
        if (cmp == 1) {
            *index_found = (size_t) (name - argnames);
            return 1;
        }
        if (unlikely(cmp == -1)) goto bad;
        name++;
    }
    name = argnames;
    while (name != first_kw_arg) {
        int cmp = PyObject_RichCompareBool(**name, key, Py_EQ);
        if (unlikely(cmp != 0)) {
            if (cmp == 1) goto arg_passed_twice;
            else goto bad;
        }
        name++;
    }
    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;
bad:
    return -1;
}
static CYTHON_INLINE int __Pyx_MatchKeywordArg(
    PyObject *key,
    PyObject ** const argnames[],
    PyObject ** const *first_kw_arg,
    size_t *index_found,
    const char *function_name)
{
    return likely(PyUnicode_CheckExact(key)) ?
        __Pyx_MatchKeywordArg_str(key, argnames, first_kw_arg, index_found, function_name) :
        __Pyx_MatchKeywordArg_nostr(key, argnames, first_kw_arg, index_found, function_name);
}
static void __Pyx_RejectUnknownKeyword(
    PyObject *kwds,
    PyObject ** const argnames[],
    PyObject ** const *first_kw_arg,
    const char *function_name)
{
    #if CYTHON_AVOID_BORROWED_REFS
    PyObject *pos = NULL;
    #else
    Py_ssize_t pos = 0;
    #endif
    PyObject *key = NULL;
    __Pyx_BEGIN_CRITICAL_SECTION(kwds);
    while (
        #if CYTHON_AVOID_BORROWED_REFS
        __Pyx_PyDict_NextRef(kwds, &pos, &key, NULL)
        #else
        PyDict_Next(kwds, &pos, &key, NULL)
        #endif
    ) {
        PyObject** const *name = first_kw_arg;
        while (*name && (**name != key)) name++;
        if (!*name) {
            size_t index_found = 0;
            int cmp = __Pyx_MatchKeywordArg(key, argnames, first_kw_arg, &index_found, function_name);
            if (cmp != 1) {
                if (cmp == 0) {
                    PyErr_Format(PyExc_TypeError,
                        "%s() got an unexpected keyword argument '%U'",
                        function_name, key);
                }
                #if CYTHON_AVOID_BORROWED_REFS
                Py_DECREF(key);
                #endif
                break;
            }
        }
        #if CYTHON_AVOID_BORROWED_REFS
        Py_DECREF(key);
        #endif
    }
    __Pyx_END_CRITICAL_SECTION();
    #if CYTHON_AVOID_BORROWED_REFS
    Py_XDECREF(pos);
    #endif
    assert(PyErr_Occurred());
}
static int __Pyx_ParseKeywordDict(
    PyObject *kwds,
    PyObject ** const argnames[],
    PyObject *values[],
    Py_ssize_t num_pos_args,
    Py_ssize_t num_kwargs,
    const char* function_name,
    int ignore_unknown_kwargs)
{
    PyObject** const *name;
    PyObject** const *first_kw_arg = argnames + num_pos_args;
    Py_ssize_t extracted = 0;
#if !CYTHON_COMPILING_IN_PYPY || defined(PyArg_ValidateKeywordArguments)
    if (unlikely(!PyArg_ValidateKeywordArguments(kwds))) return -1;
#endif
    name = first_kw_arg;
    while (*name && num_kwargs > extracted) {
        PyObject * key = **name;
        PyObject *value;
        int found = 0;
        #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
        found = PyDict_GetItemRef(kwds, key, &value);
        #else
        value = PyDict_GetItemWithError(kwds, key);
        if (value) {
            Py_INCREF(value);
            found = 1;
        } else {
            if (unlikely(PyErr_Occurred())) goto bad;
        }
        #endif
        if (found) {
            if (unlikely(found < 0)) goto bad;
            values[name-argnames] = value;
            extracted++;
        }
        name++;
    }
    if (num_kwargs > extracted) {
        if (ignore_unknown_kwargs) {
            if (unlikely(__Pyx_ValidateDuplicatePosArgs(kwds, argnames, first_kw_arg, function_name) == -1))
                goto bad;
        } else {
            __Pyx_RejectUnknownKeyword(kwds, argnames, first_kw_arg, function_name);
            goto bad;
        }
    }
    return 0;
bad:
    return -1;
}
static int __Pyx_ParseKeywordDictToDict(
    PyObject *kwds,
    PyObject ** const argnames[],
    PyObject *kwds2,
    PyObject *values[],
    Py_ssize_t num_pos_args,
    const char* function_name)
{
    PyObject** const *name;
    PyObject** const *first_kw_arg = argnames + num_pos_args;
    Py_ssize_t len;
#if !CYTHON_COMPILING_IN_PYPY || defined(PyArg_ValidateKeywordArguments)
    if (unlikely(!PyArg_ValidateKeywordArguments(kwds))) return -1;
#endif
    if (PyDict_Update(kwds2, kwds) < 0) goto bad;
    name = first_kw_arg;
    while (*name) {
        PyObject *key = **name;
        PyObject *value;
#if !CYTHON_COMPILING_IN_LIMITED_API && (PY_VERSION_HEX >= 0x030d00A2 || defined(PyDict_Pop))
        int found = PyDict_Pop(kwds2, key, &value);
        if (found) {
            if (unlikely(found < 0)) goto bad;
            values[name-argnames] = value;
        }
#elif __PYX_LIMITED_VERSION_HEX >= 0x030d0000
        int found = PyDict_GetItemRef(kwds2, key, &value);
        if (found) {
            if (unlikely(found < 0)) goto bad;
            values[name-argnames] = value;
            if (unlikely(PyDict_DelItem(kwds2, key) < 0)) goto bad;
        }
#else
    #if CYTHON_COMPILING_IN_CPYTHON
        value = _PyDict_Pop(kwds2, key, kwds2);
    #else
        value = __Pyx_CallUnboundCMethod2(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_pop, kwds2, key, kwds2);
    #endif
        if (value == kwds2) {
            Py_DECREF(value);
        } else {
            if (unlikely(!value)) goto bad;
            values[name-argnames] = value;
        }
#endif
        name++;
    }
    len = PyDict_Size(kwds2);
    if (len > 0) {
        return __Pyx_ValidateDuplicatePosArgs(kwds, argnames, first_kw_arg, function_name);
    } else if (unlikely(len == -1)) {
        goto bad;
    }
    return 0;
bad:
    return -1;
}
static int __Pyx_ParseKeywordsTuple(
    PyObject *kwds,
    PyObject * const *kwvalues,
    PyObject ** const argnames[],
    PyObject *kwds2,
    PyObject *values[],
    Py_ssize_t num_pos_args,
    Py_ssize_t num_kwargs,
    const char* function_name,
    int ignore_unknown_kwargs)
{
    PyObject *key = NULL;
    PyObject** const * name;
    PyObject** const *first_kw_arg = argnames + num_pos_args;
    for (Py_ssize_t pos = 0; pos < num_kwargs; pos++) {
#if CYTHON_AVOID_BORROWED_REFS
        key = __Pyx_PySequence_ITEM(kwds, pos);
#else
        key = __Pyx_PyTuple_GET_ITEM(kwds, pos);
#endif
#if !CYTHON_ASSUME_SAFE_MACROS
        if (unlikely(!key)) goto bad;
#endif
        name = first_kw_arg;
        while (*name && (**name != key)) name++;
        if (*name) {
            PyObject *value = kwvalues[pos];
            values[name-argnames] = __Pyx_NewRef(value);
        } else {
            size_t index_found = 0;
            int cmp = __Pyx_MatchKeywordArg(key, argnames, first_kw_arg, &index_found, function_name);
            if (cmp == 1) {
                PyObject *value = kwvalues[pos];
                values[index_found] = __Pyx_NewRef(value);
            } else {
                if (unlikely(cmp == -1)) goto bad;
                if (kwds2) {
                    PyObject *value = kwvalues[pos];
                    if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
                } else if (!ignore_unknown_kwargs) {
                    goto invalid_keyword;
                }
            }
        }
        #if CYTHON_AVOID_BORROWED_REFS
        Py_DECREF(key);
        key = NULL;
        #endif
    }
    return 0;
invalid_keyword:
    PyErr_Format(PyExc_TypeError,
        "%s() got an unexpected keyword argument '%U'",
        function_name, key);
    goto bad;
bad:
    #if CYTHON_AVOID_BORROWED_REFS
    Py_XDECREF(key);
    #endif
    return -1;
}

/* ParseKeywords */
static int __Pyx_ParseKeywords(
    PyObject *kwds,
    PyObject * const *kwvalues,
    PyObject ** const argnames[],
    PyObject *kwds2,
    PyObject *values[],
    Py_ssize_t num_pos_args,
    Py_ssize_t num_kwargs,
    const char* function_name,
    int ignore_unknown_kwargs)
{
    if (CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds)))
        return __Pyx_ParseKeywordsTuple(kwds, kwvalues, argnames, kwds2, values, num_pos_args, num_kwargs, function_name, ignore_unknown_kwargs);
    else if (kwds2)
        return __Pyx_ParseKeywordDictToDict(kwds, argnames, kwds2, values, num_pos_args, function_name);
    else
        return __Pyx_ParseKeywordDict(kwds, argnames, values, num_pos_args, num_kwargs, function_name, ignore_unknown_kwargs);
}

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

/* RejectKeywords */
static void __Pyx_RejectKeywords(const char* function_name, PyObject *kwds) {
    PyObject *key = NULL;
    if (CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds))) {
        key = __Pyx_PySequence_ITEM(kwds, 0);
    } else {
#if CYTHON_AVOID_BORROWED_REFS
        PyObject *pos = NULL;
#else
        Py_ssize_t pos = 0;
#endif
#if !CYTHON_COMPILING_IN_PYPY || defined(PyArg_ValidateKeywordArguments)
        if (unlikely(!PyArg_ValidateKeywordArguments(kwds))) return;
#endif
        __Pyx_PyDict_NextRef(kwds, &pos, &key, NULL);
#if CYTHON_AVOID_BORROWED_REFS
        Py_XDECREF(pos);
#endif
    }
    if (likely(key)) {
        PyErr_Format(PyExc_TypeError,
            "%s() got an unexpected keyword argument '%U'",
            function_name, key);
        Py_DECREF(key);
    }
}

/* GetAttr3 */
#if __PYX_LIMITED_VERSION_HEX < 0x030d0000
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;
}
#endif
static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) {
    PyObject *r;
#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
    int res = PyObject_GetOptionalAttr(o, n, &r);
    return (res != 0) ? r : __Pyx_NewRef(d);
#else
  #if CYTHON_USE_TYPE_SLOTS
    if (likely(PyUnicode_Check(n))) {
        r = __Pyx_PyObject_GetAttrStrNoError(o, n);
        if (unlikely(!r) && likely(!PyErr_Occurred())) {
            r = __Pyx_NewRef(d);
        }
        return r;
    }
  #endif
    r = PyObject_GetAttr(o, n);
    return (likely(r)) ? r : __Pyx_GetAttr3Default(d);
#endif
}

/* PyDictVersioning (used by GetModuleGlobalName) */
#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_COMPILING_IN_LIMITED_API
    if (unlikely(!__pyx_m)) {
        if (!PyErr_Occurred())
            PyErr_SetNone(PyExc_NameError);
        return NULL;
    }
    result = PyObject_GetAttr(__pyx_m, name);
    if (likely(result)) {
        return result;
    }
    PyErr_Clear();
#elif CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
    if (unlikely(__Pyx_PyDict_GetItemRef(__pyx_mstate_global->__pyx_d, name, &result) == -1)) PyErr_Clear();
    __PYX_UPDATE_DICT_CACHE(__pyx_mstate_global->__pyx_d, result, *dict_cached_value, *dict_version)
    if (likely(result)) {
        return result;
    }
#else
    result = _PyDict_GetItem_KnownHash(__pyx_mstate_global->__pyx_d, name, ((PyASCIIObject *) name)->hash);
    __PYX_UPDATE_DICT_CACHE(__pyx_mstate_global->__pyx_d, result, *dict_cached_value, *dict_version)
    if (likely(result)) {
        return __Pyx_NewRef(result);
    }
    PyErr_Clear();
#endif
    return __Pyx_GetBuiltinName(name);
}

/* RaiseUnexpectedTypeError */
static int
__Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj)
{
    __Pyx_TypeName obj_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(obj));
    PyErr_Format(PyExc_TypeError, "Expected %s, got " __Pyx_FMT_TYPENAME,
                 expected, obj_type_name);
    __Pyx_DECREF_TypeName(obj_type_name);
    return 0;
}

/* 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);
    return PyObject_SetAttr(obj, attr_name, value);
}
#endif

/* DictGetItem */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
    PyObject *value;
    if (unlikely(__Pyx_PyDict_GetItemRef(d, key, &value) == 0)) { // no value, no error
        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 value;
}
#endif

/* decode_c_bytes (used by decode_bytes) */
static CYTHON_INLINE PyObject* __Pyx_decode_c_bytes(
         const char* cstring, Py_ssize_t length, Py_ssize_t start, Py_ssize_t stop,
         const char* encoding, const char* errors,
         PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) {
    if (unlikely((start < 0) | (stop < 0))) {
        if (start < 0) {
            start += length;
            if (start < 0)
                start = 0;
        }
        if (stop < 0)
            stop += length;
    }
    if (stop > length)
        stop = length;
    if (unlikely(stop <= start))
        return __Pyx_NewRef(__pyx_mstate_global->__pyx_empty_unicode);
    length = stop - start;
    cstring += start;
    if (decode_func) {
        return decode_func(cstring, length, errors);
    } else {
        return PyUnicode_Decode(cstring, length, encoding, errors);
    }
}

/* JoinPyUnicode */
static PyObject* __Pyx_PyUnicode_Join(PyObject** values, Py_ssize_t value_count, Py_ssize_t result_ulength,
                                      Py_UCS4 max_char) {
#if CYTHON_USE_UNICODE_INTERNALS && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    PyObject *result_uval;
    int result_ukind, kind_shift;
    Py_ssize_t i, char_pos;
    void *result_udata;
    if (max_char > 1114111) max_char = 1114111;
    result_uval = PyUnicode_New(result_ulength, max_char);
    if (unlikely(!result_uval)) return NULL;
    result_ukind = (max_char <= 255) ? PyUnicode_1BYTE_KIND : (max_char <= 65535) ? PyUnicode_2BYTE_KIND : PyUnicode_4BYTE_KIND;
    kind_shift = (result_ukind == PyUnicode_4BYTE_KIND) ? 2 : result_ukind - 1;
    result_udata = PyUnicode_DATA(result_uval);
    assert(kind_shift == 2 || kind_shift == 1 || kind_shift == 0);
    if (unlikely((PY_SSIZE_T_MAX >> kind_shift) - result_ulength < 0))
        goto overflow;
    char_pos = 0;
    for (i=0; i < value_count; i++) {
        int ukind;
        Py_ssize_t ulength;
        void *udata;
        PyObject *uval = values[i];
        #if !CYTHON_COMPILING_IN_LIMITED_API
        if (__Pyx_PyUnicode_READY(uval) == (-1))
            goto bad;
        #endif
        ulength = __Pyx_PyUnicode_GET_LENGTH(uval);
        #if !CYTHON_ASSUME_SAFE_SIZE
        if (unlikely(ulength < 0)) goto bad;
        #endif
        if (unlikely(!ulength))
            continue;
        if (unlikely((PY_SSIZE_T_MAX >> kind_shift) - ulength < char_pos))
            goto overflow;
        ukind = __Pyx_PyUnicode_KIND(uval);
        udata = __Pyx_PyUnicode_DATA(uval);
        if (ukind == result_ukind) {
            memcpy((char *)result_udata + (char_pos << kind_shift), udata, (size_t) (ulength << kind_shift));
        } else {
            #if PY_VERSION_HEX >= 0x030d0000
            if (unlikely(PyUnicode_CopyCharacters(result_uval, char_pos, uval, 0, ulength) < 0)) goto bad;
            #elif CYTHON_COMPILING_IN_CPYTHON || defined(_PyUnicode_FastCopyCharacters)
            _PyUnicode_FastCopyCharacters(result_uval, char_pos, uval, 0, ulength);
            #else
            Py_ssize_t j;
            for (j=0; j < ulength; j++) {
                Py_UCS4 uchar = __Pyx_PyUnicode_READ(ukind, udata, j);
                __Pyx_PyUnicode_WRITE(result_ukind, result_udata, char_pos+j, uchar);
            }
            #endif
        }
        char_pos += ulength;
    }
    return result_uval;
overflow:
    PyErr_SetString(PyExc_OverflowError, "join() result is too long for a Python string");
bad:
    Py_DECREF(result_uval);
    return NULL;
#else
    Py_ssize_t i;
    PyObject *result = NULL;
    PyObject *value_tuple = PyTuple_New(value_count);
    if (unlikely(!value_tuple)) return NULL;
    CYTHON_UNUSED_VAR(max_char);
    CYTHON_UNUSED_VAR(result_ulength);
    for (i=0; i<value_count; i++) {
        Py_INCREF(values[i]);
        if (__Pyx_PyTuple_SET_ITEM(value_tuple, i, values[i]) != (0)) goto bad;
    }
    result = PyUnicode_Join(__pyx_mstate_global->__pyx_empty_unicode, value_tuple);
bad:
    Py_DECREF(value_tuple);
    return result;
#endif
}

/* PyObjectFastCallMethod */
#if !CYTHON_VECTORCALL || PY_VERSION_HEX < 0x03090000
static PyObject *__Pyx_PyObject_FastCallMethod(PyObject *name, PyObject *const *args, size_t nargsf) {
    PyObject *result;
    PyObject *attr = PyObject_GetAttr(args[0], name);
    if (unlikely(!attr))
        return NULL;
    result = __Pyx_PyObject_FastCall(attr, args+1, nargsf - 1);
    Py_DECREF(attr);
    return result;
}
#endif

/* RaiseException */
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
    PyObject* owned_instance = NULL;
    if (tb == Py_None) {
        tb = 0;
    } else if (tb && !PyTraceBack_Check(tb)) {
        PyErr_SetString(PyExc_TypeError,
            "raise: arg 3 must be a traceback or None");
        goto bad;
    }
    if (value == Py_None)
        value = 0;
    if (PyExceptionInstance_Check(type)) {
        if (value) {
            PyErr_SetString(PyExc_TypeError,
                "instance exception may not have a separate value");
            goto bad;
        }
        value = type;
        type = (PyObject*) Py_TYPE(value);
    } else if (PyExceptionClass_Check(type)) {
        PyObject *instance_class = NULL;
        if (value && PyExceptionInstance_Check(value)) {
            instance_class = (PyObject*) Py_TYPE(value);
            if (instance_class != type) {
                int is_subclass = PyObject_IsSubclass(instance_class, type);
                if (!is_subclass) {
                    instance_class = NULL;
                } else if (unlikely(is_subclass == -1)) {
                    goto bad;
                } else {
                    type = instance_class;
                }
            }
        }
        if (!instance_class) {
            PyObject *args;
            if (!value)
                args = PyTuple_New(0);
            else if (PyTuple_Check(value)) {
                Py_INCREF(value);
                args = value;
            } else
                args = PyTuple_Pack(1, value);
            if (!args)
                goto bad;
            owned_instance = PyObject_Call(type, args, NULL);
            Py_DECREF(args);
            if (!owned_instance)
                goto bad;
            value = owned_instance;
            if (!PyExceptionInstance_Check(value)) {
                PyErr_Format(PyExc_TypeError,
                             "calling %R should have returned an instance of "
                             "BaseException, not %R",
                             type, Py_TYPE(value));
                goto bad;
            }
        }
    } else {
        PyErr_SetString(PyExc_TypeError,
            "raise: exception class must be a subclass of BaseException");
        goto bad;
    }
    if (cause) {
        PyObject *fixed_cause;
        if (cause == Py_None) {
            fixed_cause = NULL;
        } else if (PyExceptionClass_Check(cause)) {
            fixed_cause = PyObject_CallObject(cause, NULL);
            if (fixed_cause == NULL)
                goto bad;
        } else if (PyExceptionInstance_Check(cause)) {
            fixed_cause = cause;
            Py_INCREF(fixed_cause);
        } else {
            PyErr_SetString(PyExc_TypeError,
                            "exception causes must derive from "
                            "BaseException");
            goto bad;
        }
        PyException_SetCause(value, fixed_cause);
    }
    PyErr_SetObject(type, value);
    if (tb) {
#if PY_VERSION_HEX >= 0x030C00A6
        PyException_SetTraceback(value, tb);
#elif CYTHON_FAST_THREAD_STATE
        PyThreadState *tstate = __Pyx_PyThreadState_Current;
        PyObject* tmp_tb = tstate->curexc_traceback;
        if (tb != tmp_tb) {
            Py_INCREF(tb);
            tstate->curexc_traceback = tb;
            Py_XDECREF(tmp_tb);
        }
#else
        PyObject *tmp_type, *tmp_value, *tmp_tb;
        PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
        Py_INCREF(tb);
        PyErr_Restore(tmp_type, tmp_value, tb);
        Py_XDECREF(tmp_tb);
#endif
    }
bad:
    Py_XDECREF(owned_instance);
    return;
}

/* ArgTypeTestFunc (used by ArgTypeTest) */
static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact)
{
    __Pyx_TypeName type_name;
    __Pyx_TypeName obj_type_name;
    PyObject *extra_info = __pyx_mstate_global->__pyx_empty_unicode;
    int from_annotation_subclass = 0;
    if (unlikely(!type)) {
        PyErr_SetString(PyExc_SystemError, "Missing type object");
        return 0;
    }
    else if (!exact) {
        if (likely(__Pyx_TypeCheck(obj, type))) return 1;
    } else if (exact == 2) {
        if (__Pyx_TypeCheck(obj, type)) {
            from_annotation_subclass = 1;
            extra_info = __pyx_mstate_global->__pyx_kp_u_Note_that_Cython_is_deliberately;
        }
    }
    type_name = __Pyx_PyType_GetFullyQualifiedName(type);
    obj_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(obj));
    PyErr_Format(PyExc_TypeError,
        "Argument '%.200s' has incorrect type (expected " __Pyx_FMT_TYPENAME
        ", got " __Pyx_FMT_TYPENAME ")"
#if __PYX_LIMITED_VERSION_HEX < 0x030C0000
        "%s%U"
#endif
        , name, type_name, obj_type_name
#if __PYX_LIMITED_VERSION_HEX < 0x030C0000
        , (from_annotation_subclass ? ". " : ""), extra_info
#endif
        );
#if __PYX_LIMITED_VERSION_HEX >= 0x030C0000
    if (exact == 2 && from_annotation_subclass) {
        PyObject *res;
        PyObject *vargs[2];
        vargs[0] = PyErr_GetRaisedException();
        vargs[1] = extra_info;
        res = PyObject_VectorcallMethod(__pyx_mstate_global->__pyx_kp_u_add_note, vargs, 2, NULL);
        Py_XDECREF(res);
        PyErr_SetRaisedException(vargs[0]);
    }
#endif
    __Pyx_DECREF_TypeName(type_name);
    __Pyx_DECREF_TypeName(obj_type_name);
    return 0;
}

/* GetItemInt */
static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
    PyObject *r;
    if (unlikely(!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,
                                                              int wraparound, int boundscheck, int unsafe_shared) {
    CYTHON_MAYBE_UNUSED_VAR(unsafe_shared);
#if CYTHON_ASSUME_SAFE_SIZE
    Py_ssize_t wrapped_i = i;
    if (wraparound & unlikely(i < 0)) {
        wrapped_i += PyList_GET_SIZE(o);
    }
    if ((CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS || !CYTHON_ASSUME_SAFE_MACROS)) {
        return __Pyx_PyList_GetItemRefFast(o, wrapped_i, unsafe_shared);
    } else
    if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) {
        return __Pyx_NewRef(PyList_GET_ITEM(o, wrapped_i));
    }
    return __Pyx_GetItemInt_Generic(o, PyLong_FromSsize_t(i));
#else
    (void)wraparound;
    (void)boundscheck;
    return PySequence_GetItem(o, i);
#endif
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
                                                              int wraparound, int boundscheck, int unsafe_shared) {
    CYTHON_MAYBE_UNUSED_VAR(unsafe_shared);
#if CYTHON_ASSUME_SAFE_SIZE && 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)))) {
        return __Pyx_NewRef(PyTuple_GET_ITEM(o, wrapped_i));
    }
    return __Pyx_GetItemInt_Generic(o, PyLong_FromSsize_t(i));
#else
    (void)wraparound;
    (void)boundscheck;
    return PySequence_GetItem(o, i);
#endif
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
                                                     int wraparound, int boundscheck, int unsafe_shared) {
    CYTHON_MAYBE_UNUSED_VAR(unsafe_shared);
#if CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE
    if (is_list || PyList_CheckExact(o)) {
        Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
        if ((CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS)) {
            return __Pyx_PyList_GetItemRefFast(o, n, unsafe_shared);
        } else if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) {
            return __Pyx_NewRef(PyList_GET_ITEM(o, n));
        }
    } else
    #if !CYTHON_AVOID_BORROWED_REFS
    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)))) {
            return __Pyx_NewRef(PyTuple_GET_ITEM(o, n));
        }
    } else
    #endif
#endif
#if CYTHON_USE_TYPE_SLOTS && !CYTHON_COMPILING_IN_PYPY
    {
        PyMappingMethods *mm = Py_TYPE(o)->tp_as_mapping;
        PySequenceMethods *sm = Py_TYPE(o)->tp_as_sequence;
        if (!is_list && mm && mm->mp_subscript) {
            PyObject *r, *key = PyLong_FromSsize_t(i);
            if (unlikely(!key)) return NULL;
            r = mm->mp_subscript(o, key);
            Py_DECREF(key);
            return r;
        }
        if (is_list || likely(sm && sm->sq_item)) {
            if (wraparound && unlikely(i < 0) && likely(sm->sq_length)) {
                Py_ssize_t l = sm->sq_length(o);
                if (likely(l >= 0)) {
                    i += l;
                } else {
                    if (!PyErr_ExceptionMatches(PyExc_OverflowError))
                        return NULL;
                    PyErr_Clear();
                }
            }
            return sm->sq_item(o, i);
        }
    }
#else
    if (is_list || !PyMapping_Check(o)) {
        return PySequence_GetItem(o, i);
    }
#endif
    (void)wraparound;
    (void)boundscheck;
    return __Pyx_GetItemInt_Generic(o, PyLong_FromSsize_t(i));
}

/* AllocateExtensionType */
static PyObject *__Pyx_AllocateExtensionType(PyTypeObject *t, int is_final) {
    if (is_final || likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) {
        allocfunc alloc_func = __Pyx_PyType_GetSlot(t, tp_alloc, allocfunc);
        return alloc_func(t, 0);
    } else {
        newfunc tp_new = __Pyx_PyType_TryGetSlot(&PyBaseObject_Type, tp_new, newfunc);
    #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
        if (!tp_new) {
            PyObject *new_str = PyUnicode_FromString("__new__");
            if (likely(new_str)) {
                PyObject *o = PyObject_CallMethodObjArgs((PyObject *)&PyBaseObject_Type, new_str, t, NULL);
                Py_DECREF(new_str);
                return o;
            } else
                return NULL;
        } else
    #endif
        return tp_new(t, __pyx_mstate_global->__pyx_empty_tuple, 0);
    }
}

/* FunctionExport */
static int __Pyx_ExportFunction(PyObject *api_dict, const char *name, void (*f)(void), const char *sig) {
    PyObject *cobj;
    union {
        void (*fp)(void);
        void *p;
    } tmp;
    tmp.fp = f;
    cobj = PyCapsule_New(tmp.p, sig, 0);
    if (!cobj)
        goto bad;
    if (PyDict_SetItemString(api_dict, name, cobj) < 0)
        goto bad;
    Py_DECREF(cobj);
    return 0;
bad:
    Py_XDECREF(cobj);
    return -1;
}

/* GetApiDict */
static PyObject *__Pyx_ApiExport_GetApiDict(void) {
    PyObject *d;
    if (__Pyx_PyDict_GetItemRef(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_pyx_capi, &d) == -1)
        return NULL;
    if (!d) {
        d = PyDict_New();
        if (!d)
            goto bad;
        if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_pyx_capi, d) < 0)
            goto bad;
    }
    return d;
bad:
    Py_XDECREF(d);
    return NULL;
}

/* LimitedApiGetTypeDict (used by SetItemOnTypeDict) */
#if CYTHON_COMPILING_IN_LIMITED_API
static Py_ssize_t __Pyx_GetTypeDictOffset(void) {
    PyObject *tp_dictoffset_o;
    Py_ssize_t tp_dictoffset;
    tp_dictoffset_o = PyObject_GetAttrString((PyObject*)(&PyType_Type), "__dictoffset__");
    if (unlikely(!tp_dictoffset_o)) return -1;
    tp_dictoffset = PyLong_AsSsize_t(tp_dictoffset_o);
    Py_DECREF(tp_dictoffset_o);
    if (unlikely(tp_dictoffset == 0)) {
        PyErr_SetString(
            PyExc_TypeError,
            "'type' doesn't have a dictoffset");
        return -1;
    } else if (unlikely(tp_dictoffset < 0)) {
        PyErr_SetString(
            PyExc_TypeError,
            "'type' has an unexpected negative dictoffset. "
            "Please report this as Cython bug");
        return -1;
    }
    return tp_dictoffset;
}
static PyObject *__Pyx_GetTypeDict(PyTypeObject *tp) {
    static Py_ssize_t tp_dictoffset = 0;
    if (unlikely(tp_dictoffset == 0)) {
        tp_dictoffset = __Pyx_GetTypeDictOffset();
        if (unlikely(tp_dictoffset == -1 && PyErr_Occurred())) {
            tp_dictoffset = 0; // try again next time?
            return NULL;
        }
    }
    return *(PyObject**)((char*)tp + tp_dictoffset);
}
#endif

/* SetItemOnTypeDict (used by FixUpExtensionType) */
static int __Pyx__SetItemOnTypeDict(PyTypeObject *tp, PyObject *k, PyObject *v) {
    int result;
    PyObject *tp_dict;
#if CYTHON_COMPILING_IN_LIMITED_API
    tp_dict = __Pyx_GetTypeDict(tp);
    if (unlikely(!tp_dict)) return -1;
#else
    tp_dict = tp->tp_dict;
#endif
    result = PyDict_SetItem(tp_dict, k, v);
    if (likely(!result)) {
        PyType_Modified(tp);
        if (unlikely(PyObject_HasAttr(v, __pyx_mstate_global->__pyx_n_u_set_name))) {
            PyObject *setNameResult = PyObject_CallMethodObjArgs(v, __pyx_mstate_global->__pyx_n_u_set_name,  (PyObject *) tp, k, NULL);
            if (!setNameResult) return -1;
            Py_DECREF(setNameResult);
        }
    }
    return result;
}

/* FixUpExtensionType */
static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) {
#if __PYX_LIMITED_VERSION_HEX > 0x030900B1
    CYTHON_UNUSED_VAR(spec);
    CYTHON_UNUSED_VAR(type);
    CYTHON_UNUSED_VAR(__Pyx__SetItemOnTypeDict);
#else
    const PyType_Slot *slot = spec->slots;
    int changed = 0;
#if !CYTHON_COMPILING_IN_LIMITED_API
    while (slot && slot->slot && slot->slot != Py_tp_members)
        slot++;
    if (slot && slot->slot == Py_tp_members) {
#if !CYTHON_COMPILING_IN_CPYTHON
        const
#endif  // !CYTHON_COMPILING_IN_CPYTHON)
            PyMemberDef *memb = (PyMemberDef*) slot->pfunc;
        while (memb && memb->name) {
            if (memb->name[0] == '_' && memb->name[1] == '_') {
                if (strcmp(memb->name, "__weaklistoffset__") == 0) {
                    assert(memb->type == T_PYSSIZET);
                    assert(memb->flags == READONLY);
                    type->tp_weaklistoffset = memb->offset;
                    changed = 1;
                }
                else if (strcmp(memb->name, "__dictoffset__") == 0) {
                    assert(memb->type == T_PYSSIZET);
                    assert(memb->flags == READONLY);
                    type->tp_dictoffset = memb->offset;
                    changed = 1;
                }
#if CYTHON_METH_FASTCALL
                else if (strcmp(memb->name, "__vectorcalloffset__") == 0) {
                    assert(memb->type == T_PYSSIZET);
                    assert(memb->flags == READONLY);
                    type->tp_vectorcall_offset = memb->offset;
                    changed = 1;
                }
#endif  // CYTHON_METH_FASTCALL
#if !CYTHON_COMPILING_IN_PYPY
                else if (strcmp(memb->name, "__module__") == 0) {
                    PyObject *descr;
                    assert(memb->type == T_OBJECT);
                    assert(memb->flags == 0 || memb->flags == READONLY);
                    descr = PyDescr_NewMember(type, memb);
                    if (unlikely(!descr))
                        return -1;
                    int set_item_result = PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr);
                    Py_DECREF(descr);
                    if (unlikely(set_item_result < 0)) {
                        return -1;
                    }
                    changed = 1;
                }
#endif  // !CYTHON_COMPILING_IN_PYPY
            }
            memb++;
        }
    }
#endif  // !CYTHON_COMPILING_IN_LIMITED_API
#if !CYTHON_COMPILING_IN_PYPY
    slot = spec->slots;
    while (slot && slot->slot && slot->slot != Py_tp_getset)
        slot++;
    if (slot && slot->slot == Py_tp_getset) {
        PyGetSetDef *getset = (PyGetSetDef*) slot->pfunc;
        while (getset && getset->name) {
            if (getset->name[0] == '_' && getset->name[1] == '_' && strcmp(getset->name, "__module__") == 0) {
                PyObject *descr = PyDescr_NewGetSet(type, getset);
                if (unlikely(!descr))
                    return -1;
                #if CYTHON_COMPILING_IN_LIMITED_API
                PyObject *pyname = PyUnicode_FromString(getset->name);
                if (unlikely(!pyname)) {
                    Py_DECREF(descr);
                    return -1;
                }
                int set_item_result = __Pyx_SetItemOnTypeDict(type, pyname, descr);
                Py_DECREF(pyname);
                #else
                CYTHON_UNUSED_VAR(__Pyx__SetItemOnTypeDict);
                int set_item_result = PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr);
                #endif
                Py_DECREF(descr);
                if (unlikely(set_item_result < 0)) {
                    return -1;
                }
                changed = 1;
            }
            ++getset;
        }
    }
#else
    CYTHON_UNUSED_VAR(__Pyx__SetItemOnTypeDict);
#endif  // !CYTHON_COMPILING_IN_PYPY
    if (changed)
        PyType_Modified(type);
#endif  // PY_VERSION_HEX > 0x030900B1
    return 0;
}

/* PyObjectCallNoArg (used by PyObjectCallMethod0) */
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
    PyObject *arg[2] = {NULL, NULL};
    return __Pyx_PyObject_FastCall(func, arg + 1, 0 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
}

/* PyObjectGetMethod (used by PyObjectCallMethod0) */
#if !(CYTHON_VECTORCALL && (__PYX_LIMITED_VERSION_HEX >= 0x030C0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x03090000)))
static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) {
    PyObject *attr;
#if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP
    __Pyx_TypeName type_name;
    PyTypeObject *tp = Py_TYPE(obj);
    PyObject *descr;
    descrgetfunc f = NULL;
    PyObject **dictptr, *dict;
    int meth_found = 0;
    assert (*method == NULL);
    if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) {
        attr = __Pyx_PyObject_GetAttrStr(obj, name);
        goto try_unpack;
    }
    if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) {
        return 0;
    }
    descr = _PyType_Lookup(tp, name);
    if (likely(descr != NULL)) {
        Py_INCREF(descr);
#if defined(Py_TPFLAGS_METHOD_DESCRIPTOR) && Py_TPFLAGS_METHOD_DESCRIPTOR
        if (__Pyx_PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_METHOD_DESCRIPTOR))
#else
        #ifdef __Pyx_CyFunction_USED
        if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr)))
        #else
        if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type)))
        #endif
#endif
        {
            meth_found = 1;
        } else {
            f = Py_TYPE(descr)->tp_descr_get;
            if (f != NULL && PyDescr_IsData(descr)) {
                attr = f(descr, obj, (PyObject *)Py_TYPE(obj));
                Py_DECREF(descr);
                goto try_unpack;
            }
        }
    }
    dictptr = _PyObject_GetDictPtr(obj);
    if (dictptr != NULL && (dict = *dictptr) != NULL) {
        Py_INCREF(dict);
        attr = __Pyx_PyDict_GetItemStr(dict, name);
        if (attr != NULL) {
            Py_INCREF(attr);
            Py_DECREF(dict);
            Py_XDECREF(descr);
            goto try_unpack;
        }
        Py_DECREF(dict);
    }
    if (meth_found) {
        *method = descr;
        return 1;
    }
    if (f != NULL) {
        attr = f(descr, obj, (PyObject *)Py_TYPE(obj));
        Py_DECREF(descr);
        goto try_unpack;
    }
    if (likely(descr != NULL)) {
        *method = descr;
        return 0;
    }
    type_name = __Pyx_PyType_GetFullyQualifiedName(tp);
    PyErr_Format(PyExc_AttributeError,
                 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'",
                 type_name, name);
    __Pyx_DECREF_TypeName(type_name);
    return 0;
#else
    attr = __Pyx_PyObject_GetAttrStr(obj, name);
    goto try_unpack;
#endif
try_unpack:
#if CYTHON_UNPACK_METHODS
    if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) {
        PyObject *function = PyMethod_GET_FUNCTION(attr);
        Py_INCREF(function);
        Py_DECREF(attr);
        *method = function;
        return 1;
    }
#endif
    *method = attr;
    return 0;
}
#endif

/* PyObjectCallMethod0 (used by PyType_Ready) */
static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) {
#if CYTHON_VECTORCALL && (__PYX_LIMITED_VERSION_HEX >= 0x030C0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x03090000))
    PyObject *args[1] = {obj};
    (void) __Pyx_PyObject_CallOneArg;
    (void) __Pyx_PyObject_CallNoArg;
    return PyObject_VectorcallMethod(method_name, args, 1 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL);
#else
    PyObject *method = NULL, *result = NULL;
    int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method);
    if (likely(is_method)) {
        result = __Pyx_PyObject_CallOneArg(method, obj);
        Py_DECREF(method);
        return result;
    }
    if (unlikely(!method)) goto bad;
    result = __Pyx_PyObject_CallNoArg(method);
    Py_DECREF(method);
bad:
    return result;
#endif
}

/* ValidateBasesTuple (used by PyType_Ready) */
#if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS
static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases) {
    Py_ssize_t i, n;
#if CYTHON_ASSUME_SAFE_SIZE
    n = PyTuple_GET_SIZE(bases);
#else
    n = PyTuple_Size(bases);
    if (unlikely(n < 0)) return -1;
#endif
    for (i = 1; i < n; i++)
    {
        PyTypeObject *b;
#if CYTHON_AVOID_BORROWED_REFS
        PyObject *b0 = PySequence_GetItem(bases, i);
        if (!b0) return -1;
#elif CYTHON_ASSUME_SAFE_MACROS
        PyObject *b0 = PyTuple_GET_ITEM(bases, i);
#else
        PyObject *b0 = PyTuple_GetItem(bases, i);
        if (!b0) return -1;
#endif
        b = (PyTypeObject*) b0;
        if (!__Pyx_PyType_HasFeature(b, Py_TPFLAGS_HEAPTYPE))
        {
            __Pyx_TypeName b_name = __Pyx_PyType_GetFullyQualifiedName(b);
            PyErr_Format(PyExc_TypeError,
                "base class '" __Pyx_FMT_TYPENAME "' is not a heap type", b_name);
            __Pyx_DECREF_TypeName(b_name);
#if CYTHON_AVOID_BORROWED_REFS
            Py_DECREF(b0);
#endif
            return -1;
        }
        if (dictoffset == 0)
        {
            Py_ssize_t b_dictoffset = 0;
#if CYTHON_USE_TYPE_SLOTS
            b_dictoffset = b->tp_dictoffset;
#else
            PyObject *py_b_dictoffset = PyObject_GetAttrString((PyObject*)b, "__dictoffset__");
            if (!py_b_dictoffset) goto dictoffset_return;
            b_dictoffset = PyLong_AsSsize_t(py_b_dictoffset);
            Py_DECREF(py_b_dictoffset);
            if (b_dictoffset == -1 && PyErr_Occurred()) goto dictoffset_return;
#endif
            if (b_dictoffset) {
                {
                    __Pyx_TypeName b_name = __Pyx_PyType_GetFullyQualifiedName(b);
                    PyErr_Format(PyExc_TypeError,
                        "extension type '%.200s' has no __dict__ slot, "
                        "but base type '" __Pyx_FMT_TYPENAME "' has: "
                        "either add 'cdef dict __dict__' to the extension type "
                        "or add '__slots__ = [...]' to the base type",
                        type_name, b_name);
                    __Pyx_DECREF_TypeName(b_name);
                }
#if !CYTHON_USE_TYPE_SLOTS
              dictoffset_return:
#endif
#if CYTHON_AVOID_BORROWED_REFS
                Py_DECREF(b0);
#endif
                return -1;
            }
        }
#if CYTHON_AVOID_BORROWED_REFS
        Py_DECREF(b0);
#endif
    }
    return 0;
}
#endif

/* PyType_Ready */
CYTHON_UNUSED static int __Pyx_PyType_HasMultipleInheritance(PyTypeObject *t) {
    while (t) {
        PyObject *bases = __Pyx_PyType_GetSlot(t, tp_bases, PyObject*);
        if (bases) {
            return 1;
        }
        t = __Pyx_PyType_GetSlot(t, tp_base, PyTypeObject*);
    }
    return 0;
}
static int __Pyx_PyType_Ready(PyTypeObject *t) {
#if CYTHON_USE_TYPE_SPECS || !CYTHON_COMPILING_IN_CPYTHON || defined(PYSTON_MAJOR_VERSION)
    (void)__Pyx_PyObject_CallMethod0;
#if CYTHON_USE_TYPE_SPECS
    (void)__Pyx_validate_bases_tuple;
#endif
    return PyType_Ready(t);
#else
    int r;
    if (!__Pyx_PyType_HasMultipleInheritance(t)) {
        return PyType_Ready(t);
    }
    PyObject *bases = __Pyx_PyType_GetSlot(t, tp_bases, PyObject*);
    if (bases && unlikely(__Pyx_validate_bases_tuple(t->tp_name, t->tp_dictoffset, bases) == -1))
        return -1;
#if !defined(PYSTON_MAJOR_VERSION)
    {
        int gc_was_enabled;
    #if PY_VERSION_HEX >= 0x030A00b1
        gc_was_enabled = PyGC_Disable();
        (void)__Pyx_PyObject_CallMethod0;
    #else
        PyObject *ret, *py_status;
        PyObject *gc = NULL;
        #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM+0 >= 0x07030400) &&\
                !CYTHON_COMPILING_IN_GRAAL
        gc = PyImport_GetModule(__pyx_mstate_global->__pyx_kp_u_gc);
        #endif
        if (unlikely(!gc)) gc = PyImport_Import(__pyx_mstate_global->__pyx_kp_u_gc);
        if (unlikely(!gc)) return -1;
        py_status = __Pyx_PyObject_CallMethod0(gc, __pyx_mstate_global->__pyx_kp_u_isenabled);
        if (unlikely(!py_status)) {
            Py_DECREF(gc);
            return -1;
        }
        gc_was_enabled = __Pyx_PyObject_IsTrue(py_status);
        Py_DECREF(py_status);
        if (gc_was_enabled > 0) {
            ret = __Pyx_PyObject_CallMethod0(gc, __pyx_mstate_global->__pyx_kp_u_disable);
            if (unlikely(!ret)) {
                Py_DECREF(gc);
                return -1;
            }
            Py_DECREF(ret);
        } else if (unlikely(gc_was_enabled == -1)) {
            Py_DECREF(gc);
            return -1;
        }
    #endif
        t->tp_flags |= Py_TPFLAGS_HEAPTYPE;
#if PY_VERSION_HEX >= 0x030A0000
        t->tp_flags |= Py_TPFLAGS_IMMUTABLETYPE;
#endif
#else
        (void)__Pyx_PyObject_CallMethod0;
#endif
    r = PyType_Ready(t);
#if !defined(PYSTON_MAJOR_VERSION)
        t->tp_flags &= ~Py_TPFLAGS_HEAPTYPE;
    #if PY_VERSION_HEX >= 0x030A00b1
        if (gc_was_enabled)
            PyGC_Enable();
    #else
        if (gc_was_enabled) {
            PyObject *tp, *v, *tb;
            PyErr_Fetch(&tp, &v, &tb);
            ret = __Pyx_PyObject_CallMethod0(gc, __pyx_mstate_global->__pyx_kp_u_enable);
            if (likely(ret || r == -1)) {
                Py_XDECREF(ret);
                PyErr_Restore(tp, v, tb);
            } else {
                Py_XDECREF(tp);
                Py_XDECREF(v);
                Py_XDECREF(tb);
                r = -1;
            }
        }
        Py_DECREF(gc);
    #endif
    }
#endif
    return r;
#endif
}

/* DelItemOnTypeDict (used by SetupReduce) */
static int __Pyx__DelItemOnTypeDict(PyTypeObject *tp, PyObject *k) {
    int result;
    PyObject *tp_dict;
#if CYTHON_COMPILING_IN_LIMITED_API
    tp_dict = __Pyx_GetTypeDict(tp);
    if (unlikely(!tp_dict)) return -1;
#else
    tp_dict = tp->tp_dict;
#endif
    result = PyDict_DelItem(tp_dict, k);
    if (likely(!result)) PyType_Modified(tp);
    return result;
}

/* SetupReduce */
static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
  int ret;
  PyObject *name_attr;
  name_attr = __Pyx_PyObject_GetAttrStrNoError(meth, __pyx_mstate_global->__pyx_n_u_name);
  if (likely(name_attr)) {
      ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
  } else {
      ret = -1;
  }
  if (unlikely(ret < 0)) {
      PyErr_Clear();
      ret = 0;
  }
  Py_XDECREF(name_attr);
  return ret;
}
static int __Pyx_setup_reduce(PyObject* type_obj) {
    int ret = 0;
    PyObject *object_reduce = NULL;
    PyObject *object_getstate = NULL;
    PyObject *object_reduce_ex = NULL;
    PyObject *reduce = NULL;
    PyObject *reduce_ex = NULL;
    PyObject *reduce_cython = NULL;
    PyObject *setstate = NULL;
    PyObject *setstate_cython = NULL;
    PyObject *getstate = NULL;
#if CYTHON_USE_PYTYPE_LOOKUP
    getstate = _PyType_Lookup((PyTypeObject*)type_obj, __pyx_mstate_global->__pyx_n_u_getstate);
#else
    getstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_mstate_global->__pyx_n_u_getstate);
    if (!getstate && PyErr_Occurred()) {
        goto __PYX_BAD;
    }
#endif
    if (getstate) {
#if CYTHON_USE_PYTYPE_LOOKUP
        object_getstate = _PyType_Lookup(&PyBaseObject_Type, __pyx_mstate_global->__pyx_n_u_getstate);
#else
        object_getstate = __Pyx_PyObject_GetAttrStrNoError((PyObject*)&PyBaseObject_Type, __pyx_mstate_global->__pyx_n_u_getstate);
        if (!object_getstate && PyErr_Occurred()) {
            goto __PYX_BAD;
        }
#endif
        if (object_getstate != getstate) {
            goto __PYX_GOOD;
        }
    }
#if CYTHON_USE_PYTYPE_LOOKUP
    object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_mstate_global->__pyx_n_u_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
#else
    object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_mstate_global->__pyx_n_u_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
#endif
    reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_mstate_global->__pyx_n_u_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_mstate_global->__pyx_n_u_reduce); if (!object_reduce) goto __PYX_BAD;
#else
        object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_mstate_global->__pyx_n_u_reduce); if (!object_reduce) goto __PYX_BAD;
#endif
        reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_mstate_global->__pyx_n_u_reduce); if (unlikely(!reduce)) goto __PYX_BAD;
        if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_mstate_global->__pyx_n_u_reduce_cython)) {
            reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_mstate_global->__pyx_n_u_reduce_cython);
            if (likely(reduce_cython)) {
                ret = __Pyx_SetItemOnTypeDict((PyTypeObject*)type_obj, __pyx_mstate_global->__pyx_n_u_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
                ret = __Pyx_DelItemOnTypeDict((PyTypeObject*)type_obj, __pyx_mstate_global->__pyx_n_u_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
            } else if (reduce == object_reduce || PyErr_Occurred()) {
                goto __PYX_BAD;
            }
            setstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_mstate_global->__pyx_n_u_setstate);
            if (!setstate) PyErr_Clear();
            if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_mstate_global->__pyx_n_u_setstate_cython)) {
                setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_mstate_global->__pyx_n_u_setstate_cython);
                if (likely(setstate_cython)) {
                    ret = __Pyx_SetItemOnTypeDict((PyTypeObject*)type_obj, __pyx_mstate_global->__pyx_n_u_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
                    ret = __Pyx_DelItemOnTypeDict((PyTypeObject*)type_obj, __pyx_mstate_global->__pyx_n_u_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
                } else if (!setstate || PyErr_Occurred()) {
                    goto __PYX_BAD;
                }
            }
            PyType_Modified((PyTypeObject*)type_obj);
        }
    }
    goto __PYX_GOOD;
__PYX_BAD:
    if (!PyErr_Occurred()) {
        __Pyx_TypeName type_obj_name =
            __Pyx_PyType_GetFullyQualifiedName((PyTypeObject*)type_obj);
        PyErr_Format(PyExc_RuntimeError,
            "Unable to initialize pickling for " __Pyx_FMT_TYPENAME, type_obj_name);
        __Pyx_DECREF_TypeName(type_obj_name);
    }
    ret = -1;
__PYX_GOOD:
#if !CYTHON_USE_PYTYPE_LOOKUP
    Py_XDECREF(object_reduce);
    Py_XDECREF(object_reduce_ex);
    Py_XDECREF(object_getstate);
    Py_XDECREF(getstate);
#endif
    Py_XDECREF(reduce);
    Py_XDECREF(reduce_ex);
    Py_XDECREF(reduce_cython);
    Py_XDECREF(setstate);
    Py_XDECREF(setstate_cython);
    return ret;
}

/* TypeImport */
#ifndef __PYX_HAVE_RT_ImportType_3_2_5
#define __PYX_HAVE_RT_ImportType_3_2_5
static PyTypeObject *__Pyx_ImportType_3_2_5(PyObject *module, const char *module_name, const char *class_name,
    size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_2_5 check_size)
{
    PyObject *result = 0;
    Py_ssize_t basicsize;
    Py_ssize_t itemsize;
#if defined(Py_LIMITED_API) || (defined(CYTHON_COMPILING_IN_LIMITED_API) && CYTHON_COMPILING_IN_LIMITED_API)
    PyObject *py_basicsize;
    PyObject *py_itemsize;
#endif
    result = PyObject_GetAttrString(module, class_name);
    if (!result)
        goto bad;
    if (!PyType_Check(result)) {
        PyErr_Format(PyExc_TypeError,
            "%.200s.%.200s is not a type object",
            module_name, class_name);
        goto bad;
    }
#if !( defined(Py_LIMITED_API) || (defined(CYTHON_COMPILING_IN_LIMITED_API) && CYTHON_COMPILING_IN_LIMITED_API) )
    basicsize = ((PyTypeObject *)result)->tp_basicsize;
    itemsize = ((PyTypeObject *)result)->tp_itemsize;
#else
    if (size == 0) {
        return (PyTypeObject *)result;
    }
    py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
    if (!py_basicsize)
        goto bad;
    basicsize = PyLong_AsSsize_t(py_basicsize);
    Py_DECREF(py_basicsize);
    py_basicsize = 0;
    if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
        goto bad;
    py_itemsize = PyObject_GetAttrString(result, "__itemsize__");
    if (!py_itemsize)
        goto bad;
    itemsize = PyLong_AsSsize_t(py_itemsize);
    Py_DECREF(py_itemsize);
    py_itemsize = 0;
    if (itemsize == (Py_ssize_t)-1 && PyErr_Occurred())
        goto bad;
#endif
    if (itemsize) {
        if (size % alignment) {
            alignment = size % alignment;
        }
        if (itemsize < (Py_ssize_t)alignment)
            itemsize = (Py_ssize_t)alignment;
    }
    if ((size_t)(basicsize + itemsize) < size) {
        PyErr_Format(PyExc_ValueError,
            "%.200s.%.200s size changed, may indicate binary incompatibility. "
            "Expected %zd from C header, got %zd from PyObject",
            module_name, class_name, size, basicsize+itemsize);
        goto bad;
    }
    if (check_size == __Pyx_ImportType_CheckSize_Error_3_2_5 &&
            ((size_t)basicsize > size || (size_t)(basicsize + itemsize) < size)) {
        PyErr_Format(PyExc_ValueError,
            "%.200s.%.200s size changed, may indicate binary incompatibility. "
            "Expected %zd from C header, got %zd-%zd from PyObject",
            module_name, class_name, size, basicsize, basicsize+itemsize);
        goto bad;
    }
    else if (check_size == __Pyx_ImportType_CheckSize_Warn_3_2_5 && (size_t)basicsize > size) {
        if (PyErr_WarnFormat(NULL, 0,
                "%.200s.%.200s size changed, may indicate binary incompatibility. "
                "Expected %zd from C header, got %zd from PyObject",
                module_name, class_name, size, basicsize) < 0) {
            goto bad;
        }
    }
    return (PyTypeObject *)result;
bad:
    Py_XDECREF(result);
    return NULL;
}
#endif

/* GetVTable */
static void* __Pyx_GetVtable(PyTypeObject *type) {
    void* ptr;
#if CYTHON_COMPILING_IN_LIMITED_API
    PyObject *ob = PyObject_GetAttr((PyObject *)type, __pyx_mstate_global->__pyx_n_u_pyx_vtable);
#else
    PyObject *ob = PyObject_GetItem(type->tp_dict, __pyx_mstate_global->__pyx_n_u_pyx_vtable);
#endif
    if (!ob)
        goto bad;
    ptr = PyCapsule_GetPointer(ob, 0);
    if (!ptr && !PyErr_Occurred())
        PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type");
    Py_DECREF(ob);
    return ptr;
bad:
    Py_XDECREF(ob);
    return NULL;
}

/* PxdImportShared (used by VoidPtrImport) */
#ifndef __PYX_HAVE_RT_ImportFromPxd_3_2_5
#define __PYX_HAVE_RT_ImportFromPxd_3_2_5
static int __Pyx_ImportFromPxd_3_2_5(PyObject *module, const char *name, void **p, const char *sig, const char *what) {
    PyObject *d = 0;
    PyObject *cobj = 0;
    d = PyObject_GetAttrString(module, "__pyx_capi__");
    if (!d)
        goto bad;
#if (defined(Py_LIMITED_API) && Py_LIMITED_API >= 0x030d0000) || (!defined(Py_LIMITED_API) && PY_VERSION_HEX >= 0x030d0000)
    PyDict_GetItemStringRef(d, name, &cobj);
#else
    cobj = PyDict_GetItemString(d, name);
    Py_XINCREF(cobj);
#endif
    if (!cobj) {
        PyErr_Format(PyExc_ImportError,
            "%.200s does not export expected C %.8s %.200s",
                PyModule_GetName(module), what, name);
        goto bad;
    }
    if (!PyCapsule_IsValid(cobj, sig)) {
        PyErr_Format(PyExc_TypeError,
            "C %.8s %.200s.%.200s has wrong signature (expected %.500s, got %.500s)",
             what, PyModule_GetName(module), name, sig, PyCapsule_GetName(cobj));
        goto bad;
    }
    *p = PyCapsule_GetPointer(cobj, sig);
    if (!(*p))
        goto bad;
    Py_DECREF(d);
    Py_DECREF(cobj);
    return 0;
bad:
    Py_XDECREF(d);
    Py_XDECREF(cobj);
    return -1;
}
#endif

/* VoidPtrImport */
#ifndef __PYX_HAVE_RT_ImportVoidPtr_3_2_5
#define __PYX_HAVE_RT_ImportVoidPtr_3_2_5
static int __Pyx_ImportVoidPtr_3_2_5(PyObject *module, const char *name, void **p, const char *sig) {
    return __Pyx_ImportFromPxd_3_2_5(module, name, p, sig, "variable");
}
#endif

/* FunctionImport */
#ifndef __PYX_HAVE_RT_ImportFunction_3_2_5
#define __PYX_HAVE_RT_ImportFunction_3_2_5
static int __Pyx_ImportFunction_3_2_5(PyObject *module, const char *funcname, void (**f)(void), const char *sig) {
    union {
        void (*fp)(void);
        void *p;
    } tmp;
    int result = __Pyx_ImportFromPxd_3_2_5(module, funcname, &tmp.p, sig, "function");
    if (result == 0) {
        *f = tmp.fp;
    }
    return result;
}
#endif

/* HasAttr (used by ImportImpl) */
#if __PYX_LIMITED_VERSION_HEX < 0x030d0000
static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) {
    PyObject *r;
    if (unlikely(!PyUnicode_Check(n))) {
        PyErr_SetString(PyExc_TypeError,
                        "hasattr(): attribute name must be string");
        return -1;
    }
    r = __Pyx_PyObject_GetAttrStrNoError(o, n);
    if (!r) {
        return (unlikely(PyErr_Occurred())) ? -1 : 0;
    } else {
        Py_DECREF(r);
        return 1;
    }
}
#endif

/* ImportImpl (used by Import) */
static int __Pyx__Import_GetModule(PyObject *qualname, PyObject **module) {
    PyObject *imported_module = PyImport_GetModule(qualname);
    if (unlikely(!imported_module)) {
        *module = NULL;
        if (PyErr_Occurred()) {
            return -1;
        }
        return 0;
    }
    *module = imported_module;
    return 1;
}
static int __Pyx__Import_Lookup(PyObject *qualname, PyObject *const *imported_names, Py_ssize_t len_imported_names, PyObject **module) {
    PyObject *imported_module;
    PyObject *top_level_package_name;
    Py_ssize_t i;
    int status, module_found;
    Py_ssize_t dot_index;
    module_found = __Pyx__Import_GetModule(qualname, &imported_module);
    if (unlikely(!module_found || module_found == -1)) {
        *module = NULL;
        return module_found;
    }
    if (imported_names) {
        for (i = 0; i < len_imported_names; i++) {
            PyObject *imported_name = imported_names[i];
#if __PYX_LIMITED_VERSION_HEX < 0x030d0000
            int has_imported_attribute = PyObject_HasAttr(imported_module, imported_name);
#else
            int has_imported_attribute = PyObject_HasAttrWithError(imported_module, imported_name);
            if (unlikely(has_imported_attribute == -1)) goto error;
#endif
            if (!has_imported_attribute) {
                goto not_found;
            }
        }
        *module = imported_module;
        return 1;
    }
    dot_index = PyUnicode_FindChar(qualname, '.', 0, PY_SSIZE_T_MAX, 1);
    if (dot_index == -1) {
        *module = imported_module;
        return 1;
    }
    if (unlikely(dot_index == -2)) goto error;
    top_level_package_name = PyUnicode_Substring(qualname, 0, dot_index);
    if (unlikely(!top_level_package_name)) goto error;
    Py_DECREF(imported_module);
    status = __Pyx__Import_GetModule(top_level_package_name, module);
    Py_DECREF(top_level_package_name);
    return status;
error:
    Py_DECREF(imported_module);
    *module = NULL;
    return -1;
not_found:
    Py_DECREF(imported_module);
    *module = NULL;
    return 0;
}
static PyObject *__Pyx__Import(PyObject *name, PyObject *const *imported_names, Py_ssize_t len_imported_names, PyObject *qualname, PyObject *moddict, int level) {
    PyObject *module = 0;
    PyObject *empty_dict = 0;
    PyObject *from_list = 0;
    int module_found;
    if (!qualname) {
        qualname = name;
    }
    module_found = __Pyx__Import_Lookup(qualname, imported_names, len_imported_names, &module);
    if (likely(module_found == 1)) {
        return module;
    } else if (unlikely(module_found == -1)) {
        return NULL;
    }
    empty_dict = PyDict_New();
    if (unlikely(!empty_dict))
        goto bad;
    if (imported_names) {
#if CYTHON_COMPILING_IN_CPYTHON
        from_list = __Pyx_PyList_FromArray(imported_names, len_imported_names);
        if (unlikely(!from_list))
            goto bad;
#else
        from_list = PyList_New(len_imported_names);
        if (unlikely(!from_list)) goto bad;
        for (Py_ssize_t i=0; i<len_imported_names; ++i) {
            if (PyList_SetItem(from_list, i, __Pyx_NewRef(imported_names[i])) < 0) goto bad;
        }
#endif
    }
    if (level == -1) {
        const char* package_sep = strchr(__Pyx_MODULE_NAME, '.');
        if (package_sep != (0)) {
            module = PyImport_ImportModuleLevelObject(
                name, moddict, empty_dict, from_list, 1);
            if (unlikely(!module)) {
                if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError)))
                    goto bad;
                PyErr_Clear();
            }
        }
        level = 0;
    }
    if (!module) {
        module = PyImport_ImportModuleLevelObject(
            name, moddict, empty_dict, from_list, level);
    }
bad:
    Py_XDECREF(from_list);
    Py_XDECREF(empty_dict);
    return module;
}

/* Import */
static PyObject *__Pyx_Import(PyObject *name, PyObject *const *imported_names, Py_ssize_t len_imported_names, PyObject *qualname, int level) {
    return __Pyx__Import(name, imported_names, len_imported_names, qualname, __pyx_mstate_global->__pyx_d, level);
}

/* ImportFrom */
static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
    PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
    if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
        const char* module_name_str = 0;
        PyObject* module_name = 0;
        PyObject* module_dot = 0;
        PyObject* full_name = 0;
        PyErr_Clear();
        module_name_str = PyModule_GetName(module);
        if (unlikely(!module_name_str)) { goto modbad; }
        module_name = PyUnicode_FromString(module_name_str);
        if (unlikely(!module_name)) { goto modbad; }
        module_dot = PyUnicode_Concat(module_name, __pyx_mstate_global->__pyx_kp_u__2);
        if (unlikely(!module_dot)) { goto modbad; }
        full_name = PyUnicode_Concat(module_dot, name);
        if (unlikely(!full_name)) { goto modbad; }
        #if (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM  < 0x07030400) ||\
                CYTHON_COMPILING_IN_GRAAL
        {
            PyObject *modules = PyImport_GetModuleDict();
            if (unlikely(!modules))
                goto modbad;
            value = PyObject_GetItem(modules, full_name);
        }
        #else
        value = PyImport_GetModule(full_name);
        #endif
      modbad:
        Py_XDECREF(full_name);
        Py_XDECREF(module_dot);
        Py_XDECREF(module_name);
    }
    if (unlikely(!value)) {
        PyErr_Format(PyExc_ImportError, "cannot import name %S", name);
    }
    return value;
}

/* PyObjectVectorCallKwBuilder */
#if CYTHON_VECTORCALL
static int __Pyx_VectorcallBuilder_AddArg(PyObject *key, PyObject *value, PyObject *builder, PyObject **args, int n) {
    (void)__Pyx_PyObject_FastCallDict;
    Py_INCREF(key);
    if (__Pyx_PyTuple_SET_ITEM(builder, n, key) != (0)) return -1;
    args[n] = value;
    return 0;
}
CYTHON_UNUSED static int __Pyx_VectorcallBuilder_AddArg_Check(PyObject *key, PyObject *value, PyObject *builder, PyObject **args, int n) {
    (void)__Pyx_VectorcallBuilder_AddArgStr;
    if (unlikely(!PyUnicode_Check(key))) {
        PyErr_SetString(PyExc_TypeError, "keywords must be strings");
        return -1;
    }
    return __Pyx_VectorcallBuilder_AddArg(key, value, builder, args, n);
}
static int __Pyx_VectorcallBuilder_AddArgStr(const char *key, PyObject *value, PyObject *builder, PyObject **args, int n) {
    PyObject *pyKey = PyUnicode_FromString(key);
    if (!pyKey) return -1;
    return __Pyx_VectorcallBuilder_AddArg(pyKey, value, builder, args, n);
}
#else // CYTHON_VECTORCALL
CYTHON_UNUSED static int __Pyx_VectorcallBuilder_AddArg_Check(PyObject *key, PyObject *value, PyObject *builder, CYTHON_UNUSED PyObject **args, CYTHON_UNUSED int n) {
    if (unlikely(!PyUnicode_Check(key))) {
        PyErr_SetString(PyExc_TypeError, "keywords must be strings");
        return -1;
    }
    return PyDict_SetItem(builder, key, value);
}
#endif

/* Py3UpdateBases */
static PyObject*
__Pyx_PEP560_update_bases(PyObject *bases)
{
    Py_ssize_t i, j, size_bases;
    PyObject *base = NULL, *meth, *new_base, *result, *new_bases = NULL;
#if CYTHON_ASSUME_SAFE_SIZE
    size_bases = PyTuple_GET_SIZE(bases);
#else
    size_bases = PyTuple_Size(bases);
    if (size_bases < 0) return NULL;
#endif
    for (i = 0; i < size_bases; i++) {
#if CYTHON_AVOID_BORROWED_REFS
        Py_CLEAR(base);
#endif
#if CYTHON_ASSUME_SAFE_MACROS
        base = PyTuple_GET_ITEM(bases, i);
#else
        base = PyTuple_GetItem(bases, i);
        if (!base) goto error;
#endif
#if CYTHON_AVOID_BORROWED_REFS
        Py_INCREF(base);
#endif
        if (PyType_Check(base)) {
            if (new_bases) {
                if (PyList_Append(new_bases, base) < 0) {
                    goto error;
                }
            }
            continue;
        }
        meth = __Pyx_PyObject_GetAttrStrNoError(base, __pyx_mstate_global->__pyx_n_u_mro_entries);
        if (!meth && PyErr_Occurred()) {
            goto error;
        }
        if (!meth) {
            if (new_bases) {
                if (PyList_Append(new_bases, base) < 0) {
                    goto error;
                }
            }
            continue;
        }
        new_base = __Pyx_PyObject_CallOneArg(meth, bases);
        Py_DECREF(meth);
        if (!new_base) {
            goto error;
        }
        if (!PyTuple_Check(new_base)) {
            PyErr_SetString(PyExc_TypeError,
                            "__mro_entries__ must return a tuple");
            Py_DECREF(new_base);
            goto error;
        }
        if (!new_bases) {
            if (!(new_bases = PyList_New(i))) {
                goto error;
            }
            for (j = 0; j < i; j++) {
                PyObject *base_from_list;
#if CYTHON_ASSUME_SAFE_MACROS
                base_from_list = PyTuple_GET_ITEM(bases, j);
                PyList_SET_ITEM(new_bases, j, base_from_list);
                Py_INCREF(base_from_list);
#else
                base_from_list = PyTuple_GetItem(bases, j);
                if (!base_from_list) goto error;
                Py_INCREF(base_from_list);
                if (PyList_SetItem(new_bases, j, base_from_list) < 0) goto error;
#endif
            }
        }
#if CYTHON_ASSUME_SAFE_SIZE
        j = PyList_GET_SIZE(new_bases);
#else
        j = PyList_Size(new_bases);
        if (j < 0) goto error;
#endif
        if (PyList_SetSlice(new_bases, j, j, new_base) < 0) {
            goto error;
        }
        Py_DECREF(new_base);
    }
    if (!new_bases) {
        Py_INCREF(bases);
        return bases;
    }
    result = PyList_AsTuple(new_bases);
    Py_DECREF(new_bases);
#if CYTHON_AVOID_BORROWED_REFS
    Py_XDECREF(base);
#endif
    return result;
error:
    Py_XDECREF(new_bases);
#if CYTHON_AVOID_BORROWED_REFS
    Py_XDECREF(base);
#endif
    return NULL;
}

/* CalculateMetaclass */
static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) {
    Py_ssize_t i, nbases;
#if CYTHON_ASSUME_SAFE_SIZE
    nbases = PyTuple_GET_SIZE(bases);
#else
    nbases = PyTuple_Size(bases);
    if (nbases < 0) return NULL;
#endif
    for (i=0; i < nbases; i++) {
        PyTypeObject *tmptype;
#if CYTHON_ASSUME_SAFE_MACROS
        PyObject *tmp = PyTuple_GET_ITEM(bases, i);
#else
        PyObject *tmp = PyTuple_GetItem(bases, i);
        if (!tmp) return NULL;
#endif
        tmptype = Py_TYPE(tmp);
        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) {
        metaclass = &PyType_Type;
    }
    Py_INCREF((PyObject*) metaclass);
    return (PyObject*) metaclass;
}

/* dict_setdefault (used by FetchCommonType) */
static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *key, PyObject *default_value) {
    PyObject* value;
#if __PYX_LIMITED_VERSION_HEX >= 0x030F0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4)
    PyDict_SetDefaultRef(d, key, default_value, &value);
#elif CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX >= 0x030C0000
    PyObject *args[] = {d, key, default_value};
    value = PyObject_VectorcallMethod(__pyx_mstate_global->__pyx_n_u_setdefault, args, 3 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL);
#elif CYTHON_COMPILING_IN_LIMITED_API
    value = PyObject_CallMethodObjArgs(d, __pyx_mstate_global->__pyx_n_u_setdefault, key, default_value, NULL);
#else
    value = PyDict_SetDefault(d, key, default_value);
    if (unlikely(!value)) return NULL;
    Py_INCREF(value);
#endif
    return value;
}

/* AddModuleRef (used by FetchSharedCythonModule) */
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
  static PyObject *__Pyx_PyImport_AddModuleObjectRef(PyObject *name) {
      PyObject *module_dict = PyImport_GetModuleDict();
      PyObject *m;
      if (PyMapping_GetOptionalItem(module_dict, name, &m) < 0) {
          return NULL;
      }
      if (m != NULL && PyModule_Check(m)) {
          return m;
      }
      Py_XDECREF(m);
      m = PyModule_NewObject(name);
      if (m == NULL)
          return NULL;
      if (PyDict_CheckExact(module_dict)) {
          PyObject *new_m;
          (void)PyDict_SetDefaultRef(module_dict, name, m, &new_m);
          Py_DECREF(m);
          return new_m;
      } else {
           if (PyObject_SetItem(module_dict, name, m) != 0) {
                Py_DECREF(m);
                return NULL;
            }
            return m;
      }
  }
  static PyObject *__Pyx_PyImport_AddModuleRef(const char *name) {
      PyObject *py_name = PyUnicode_FromString(name);
      if (!py_name) return NULL;
      PyObject *module = __Pyx_PyImport_AddModuleObjectRef(py_name);
      Py_DECREF(py_name);
      return module;
  }
#elif __PYX_LIMITED_VERSION_HEX >= 0x030d0000
  #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name)
#else
  static PyObject *__Pyx_PyImport_AddModuleRef(const char *name) {
      PyObject *module = PyImport_AddModule(name);
      Py_XINCREF(module);
      return module;
  }
#endif

/* FetchSharedCythonModule (used by FetchCommonType) */
static PyObject *__Pyx_FetchSharedCythonABIModule(void) {
    return __Pyx_PyImport_AddModuleRef(__PYX_ABI_MODULE_NAME);
}

/* FetchCommonType (used by CommonTypesMetaclass) */
#if __PYX_LIMITED_VERSION_HEX < 0x030C0000
static PyObject* __Pyx_PyType_FromMetaclass(PyTypeObject *metaclass, PyObject *module, PyType_Spec *spec, PyObject *bases) {
    PyObject *result = __Pyx_PyType_FromModuleAndSpec(module, spec, bases);
    if (result && metaclass) {
        PyObject *old_tp = (PyObject*)Py_TYPE(result);
    Py_INCREF((PyObject*)metaclass);
#if __PYX_LIMITED_VERSION_HEX >= 0x03090000
        Py_SET_TYPE(result, metaclass);
#else
        result->ob_type = metaclass;
#endif
        Py_DECREF(old_tp);
    }
    return result;
}
#else
#define __Pyx_PyType_FromMetaclass(me, mo, s, b) PyType_FromMetaclass(me, mo, s, b)
#endif
static int __Pyx_VerifyCachedType(PyObject *cached_type,
                               const char *name,
                               Py_ssize_t expected_basicsize) {
    Py_ssize_t basicsize;
    if (!PyType_Check(cached_type)) {
        PyErr_Format(PyExc_TypeError,
            "Shared Cython type %.200s is not a type object", name);
        return -1;
    }
    if (expected_basicsize == 0) {
        return 0; // size is inherited, nothing useful to check
    }
#if CYTHON_COMPILING_IN_LIMITED_API
    PyObject *py_basicsize;
    py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__");
    if (unlikely(!py_basicsize)) return -1;
    basicsize = PyLong_AsSsize_t(py_basicsize);
    Py_DECREF(py_basicsize);
    py_basicsize = NULL;
    if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred()) return -1;
#else
    basicsize = ((PyTypeObject*) cached_type)->tp_basicsize;
#endif
    if (basicsize != expected_basicsize) {
        PyErr_Format(PyExc_TypeError,
            "Shared Cython type %.200s has the wrong size, try recompiling",
            name);
        return -1;
    }
    return 0;
}
static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyTypeObject *metaclass, PyObject *module, PyType_Spec *spec, PyObject *bases) {
    PyObject *abi_module = NULL, *cached_type = NULL, *abi_module_dict, *new_cached_type, *py_object_name;
    int get_item_ref_result;
    const char* object_name = strrchr(spec->name, '.');
    object_name = object_name ? object_name+1 : spec->name;
    py_object_name = PyUnicode_FromString(object_name);
    if (!py_object_name) return NULL;
    abi_module = __Pyx_FetchSharedCythonABIModule();
    if (!abi_module) goto done;
    abi_module_dict = PyModule_GetDict(abi_module);
    if (!abi_module_dict) goto done;
    get_item_ref_result = __Pyx_PyDict_GetItemRef(abi_module_dict, py_object_name, &cached_type);
    if (get_item_ref_result == 1) {
        if (__Pyx_VerifyCachedType(
              cached_type,
              object_name,
              spec->basicsize) < 0) {
            goto bad;
        }
        goto done;
    } else if (unlikely(get_item_ref_result == -1)) {
        goto bad;
    }
    cached_type = __Pyx_PyType_FromMetaclass(
        metaclass,
        CYTHON_USE_MODULE_STATE ? module : abi_module,
        spec, bases);
    if (unlikely(!cached_type)) goto bad;
    if (unlikely(__Pyx_fix_up_extension_type_from_spec(spec, (PyTypeObject *) cached_type) < 0)) goto bad;
    new_cached_type = __Pyx_PyDict_SetDefault(abi_module_dict, py_object_name, cached_type);
    if (unlikely(new_cached_type != cached_type)) {
        if (unlikely(!new_cached_type)) goto bad;
        Py_DECREF(cached_type);
        cached_type = new_cached_type;
        if (__Pyx_VerifyCachedType(
                cached_type,
                object_name,
                spec->basicsize) < 0) {
            goto bad;
        }
        goto done;
    } else {
        Py_DECREF(new_cached_type);
    }
done:
    Py_XDECREF(abi_module);
    Py_DECREF(py_object_name);
    assert(cached_type == NULL || PyType_Check(cached_type));
    return (PyTypeObject *) cached_type;
bad:
    Py_XDECREF(cached_type);
    cached_type = NULL;
    goto done;
}

/* CommonTypesMetaclass (used by CythonFunctionShared) */
static PyObject* __pyx_CommonTypesMetaclass_get_module(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED void* context) {
    return PyUnicode_FromString(__PYX_ABI_MODULE_NAME);
}
#if __PYX_LIMITED_VERSION_HEX < 0x030A0000
static PyObject* __pyx_CommonTypesMetaclass_call(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED PyObject *args, CYTHON_UNUSED PyObject *kwds) {
    PyErr_SetString(PyExc_TypeError, "Cannot instantiate Cython internal types");
    return NULL;
}
static int __pyx_CommonTypesMetaclass_setattr(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED PyObject *attr, CYTHON_UNUSED PyObject *value) {
    PyErr_SetString(PyExc_TypeError, "Cython internal types are immutable");
    return -1;
}
#endif
static PyGetSetDef __pyx_CommonTypesMetaclass_getset[] = {
    {"__module__", __pyx_CommonTypesMetaclass_get_module, NULL, NULL, NULL},
    {0, 0, 0, 0, 0}
};
static PyType_Slot __pyx_CommonTypesMetaclass_slots[] = {
    {Py_tp_getset, (void *)__pyx_CommonTypesMetaclass_getset},
    #if __PYX_LIMITED_VERSION_HEX < 0x030A0000
    {Py_tp_call, (void*)__pyx_CommonTypesMetaclass_call},
    {Py_tp_new, (void*)__pyx_CommonTypesMetaclass_call},
    {Py_tp_setattro, (void*)__pyx_CommonTypesMetaclass_setattr},
    #endif
    {0, 0}
};
static PyType_Spec __pyx_CommonTypesMetaclass_spec = {
    __PYX_TYPE_MODULE_PREFIX "_common_types_metatype",
    0,
    0,
    Py_TPFLAGS_IMMUTABLETYPE |
    Py_TPFLAGS_DISALLOW_INSTANTIATION |
    Py_TPFLAGS_DEFAULT,
    __pyx_CommonTypesMetaclass_slots
};
static int __pyx_CommonTypesMetaclass_init(PyObject *module) {
    __pyx_mstatetype *mstate = __Pyx_PyModule_GetState(module);
    PyObject *bases = PyTuple_Pack(1, &PyType_Type);
    if (unlikely(!bases)) {
        return -1;
    }
    mstate->__pyx_CommonTypesMetaclassType = __Pyx_FetchCommonTypeFromSpec(NULL, module, &__pyx_CommonTypesMetaclass_spec, bases);
    Py_DECREF(bases);
    if (unlikely(mstate->__pyx_CommonTypesMetaclassType == NULL)) {
        return -1;
    }
    return 0;
}

/* CallTypeTraverse (used by CythonFunctionShared) */
#if !CYTHON_USE_TYPE_SPECS || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x03090000)
#else
static int __Pyx_call_type_traverse(PyObject *o, int always_call, visitproc visit, void *arg) {
    #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x03090000
    if (__Pyx_get_runtime_version() < 0x03090000) return 0;
    #endif
    if (!always_call) {
        PyTypeObject *base = __Pyx_PyObject_GetSlot(o, tp_base, PyTypeObject*);
        unsigned long flags = PyType_GetFlags(base);
        if (flags & Py_TPFLAGS_HEAPTYPE) {
            return 0;
        }
    }
    Py_VISIT((PyObject*)Py_TYPE(o));
    return 0;
}
#endif

/* PyMethodNew (used by CythonFunctionShared) */
#if CYTHON_COMPILING_IN_LIMITED_API
static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) {
    PyObject *result;
    CYTHON_UNUSED_VAR(typ);
    if (!self)
        return __Pyx_NewRef(func);
    #if __PYX_LIMITED_VERSION_HEX >= 0x030C0000
    {
        PyObject *args[] = {func, self};
        result = PyObject_Vectorcall(__pyx_mstate_global->__Pyx_CachedMethodType, args, 2, NULL);
    }
    #else
    result = PyObject_CallFunctionObjArgs(__pyx_mstate_global->__Pyx_CachedMethodType, func, self, NULL);
    #endif
    return result;
}
#else
static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) {
    CYTHON_UNUSED_VAR(typ);
    if (!self)
        return __Pyx_NewRef(func);
    return PyMethod_New(func, self);
}
#endif

/* PyVectorcallFastCallDict (used by CythonFunctionShared) */
#if CYTHON_METH_FASTCALL && CYTHON_VECTORCALL
static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw)
{
    PyObject *res = NULL;
    PyObject *kwnames;
    PyObject **newargs;
    PyObject **kwvalues;
    Py_ssize_t i;
    #if CYTHON_AVOID_BORROWED_REFS
    PyObject *pos;
    #else
    Py_ssize_t pos;
    #endif
    size_t j;
    PyObject *key, *value;
    unsigned long keys_are_strings;
    #if !CYTHON_ASSUME_SAFE_SIZE
    Py_ssize_t nkw = PyDict_Size(kw);
    if (unlikely(nkw == -1)) return NULL;
    #else
    Py_ssize_t nkw = PyDict_GET_SIZE(kw);
    #endif
    newargs = (PyObject **)PyMem_Malloc((nargs + (size_t)nkw) * sizeof(args[0]));
    if (unlikely(newargs == NULL)) {
        PyErr_NoMemory();
        return NULL;
    }
    for (j = 0; j < nargs; j++) newargs[j] = args[j];
    kwnames = PyTuple_New(nkw);
    if (unlikely(kwnames == NULL)) {
        PyMem_Free(newargs);
        return NULL;
    }
    kwvalues = newargs + nargs;
    pos = 0;
    i = 0;
    keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS;
    while (__Pyx_PyDict_NextRef(kw, &pos, &key, &value)) {
        keys_are_strings &=
        #if CYTHON_COMPILING_IN_LIMITED_API
            PyType_GetFlags(Py_TYPE(key));
        #else
            Py_TYPE(key)->tp_flags;
        #endif
        #if !CYTHON_ASSUME_SAFE_MACROS
        if (unlikely(PyTuple_SetItem(kwnames, i, key) < 0)) goto cleanup;
        #else
        PyTuple_SET_ITEM(kwnames, i, key);
        #endif
        kwvalues[i] = value;
        i++;
    }
    if (unlikely(!keys_are_strings)) {
        PyErr_SetString(PyExc_TypeError, "keywords must be strings");
        goto cleanup;
    }
    res = vc(func, newargs, nargs, kwnames);
cleanup:
    #if CYTHON_AVOID_BORROWED_REFS
    Py_DECREF(pos);
    #endif
    Py_DECREF(kwnames);
    for (i = 0; i < nkw; i++)
        Py_DECREF(kwvalues[i]);
    PyMem_Free(newargs);
    return res;
}
static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw)
{
    Py_ssize_t kw_size =
        likely(kw == NULL) ?
        0 :
#if !CYTHON_ASSUME_SAFE_SIZE
        PyDict_Size(kw);
#else
        PyDict_GET_SIZE(kw);
#endif
    if (kw_size == 0) {
        return vc(func, args, nargs, NULL);
    }
#if !CYTHON_ASSUME_SAFE_SIZE
    else if (unlikely(kw_size == -1)) {
        return NULL;
    }
#endif
    return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw);
}
#endif

/* CythonFunctionShared (used by CythonFunction) */
#if CYTHON_COMPILING_IN_LIMITED_API
static CYTHON_INLINE int __Pyx__IsSameCyOrCFunctionNoMethod(PyObject *func, void (*cfunc)(void)) {
    if (__Pyx_CyFunction_Check(func)) {
        return PyCFunction_GetFunction(((__pyx_CyFunctionObject*)func)->func) == (PyCFunction) cfunc;
    } else if (PyCFunction_Check(func)) {
        return PyCFunction_GetFunction(func) == (PyCFunction) cfunc;
    }
    return 0;
}
static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void (*cfunc)(void)) {
    if ((PyObject*)Py_TYPE(func) == __pyx_mstate_global->__Pyx_CachedMethodType) {
        int result;
        PyObject *newFunc = PyObject_GetAttr(func, __pyx_mstate_global->__pyx_n_u_func);
        if (unlikely(!newFunc)) {
            PyErr_Clear(); // It's only an optimization, so don't throw an error
            return 0;
        }
        result = __Pyx__IsSameCyOrCFunctionNoMethod(newFunc, cfunc);
        Py_DECREF(newFunc);
        return result;
    }
    return __Pyx__IsSameCyOrCFunctionNoMethod(func, cfunc);
}
#else
static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void (*cfunc)(void)) {
    if (PyMethod_Check(func)) {
        func = PyMethod_GET_FUNCTION(func);
    }
    return __Pyx_CyOrPyCFunction_Check(func) && __Pyx_CyOrPyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc;
}
#endif
static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj) {
#if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
    __Pyx_Py_XDECREF_SET(
        __Pyx_CyFunction_GetClassObj(f),
            ((classobj) ? __Pyx_NewRef(classobj) : NULL));
#else
    __Pyx_Py_XDECREF_SET(
        ((PyCMethodObject *) (f))->mm_class,
        (PyTypeObject*)((classobj) ? __Pyx_NewRef(classobj) : NULL));
#endif
}
static PyObject *
__Pyx_CyFunction_get_doc_locked(__pyx_CyFunctionObject *op)
{
    if (unlikely(op->func_doc == NULL)) {
#if CYTHON_COMPILING_IN_LIMITED_API
        op->func_doc = PyObject_GetAttrString(op->func, "__doc__");
        if (unlikely(!op->func_doc)) return NULL;
#else
        if (((PyCFunctionObject*)op)->m_ml->ml_doc) {
            op->func_doc = PyUnicode_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc);
            if (unlikely(op->func_doc == NULL))
                return NULL;
        } else {
            Py_INCREF(Py_None);
            return Py_None;
        }
#endif
    }
    Py_INCREF(op->func_doc);
    return op->func_doc;
}
static PyObject *
__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure) {
    PyObject *result;
    CYTHON_UNUSED_VAR(closure);
    __Pyx_BEGIN_CRITICAL_SECTION(op);
    result = __Pyx_CyFunction_get_doc_locked(op);
    __Pyx_END_CRITICAL_SECTION();
    return result;
}
static int
__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, void *context)
{
    CYTHON_UNUSED_VAR(context);
    if (value == NULL) {
        value = Py_None;
    }
    Py_INCREF(value);
    __Pyx_BEGIN_CRITICAL_SECTION(op);
    __Pyx_Py_XDECREF_SET(op->func_doc, value);
    __Pyx_END_CRITICAL_SECTION();
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_name_locked(__pyx_CyFunctionObject *op)
{
    if (unlikely(op->func_name == NULL)) {
#if CYTHON_COMPILING_IN_LIMITED_API
        op->func_name = PyObject_GetAttrString(op->func, "__name__");
#else
        op->func_name = PyUnicode_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name);
#endif
        if (unlikely(op->func_name == NULL))
            return NULL;
    }
    Py_INCREF(op->func_name);
    return op->func_name;
}
static PyObject *
__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context)
{
    PyObject *result = NULL;
    CYTHON_UNUSED_VAR(context);
    __Pyx_BEGIN_CRITICAL_SECTION(op);
    result = __Pyx_CyFunction_get_name_locked(op);
    __Pyx_END_CRITICAL_SECTION();
    return result;
}
static int
__Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, void *context)
{
    CYTHON_UNUSED_VAR(context);
    if (unlikely(value == NULL || !PyUnicode_Check(value))) {
        PyErr_SetString(PyExc_TypeError,
                        "__name__ must be set to a string object");
        return -1;
    }
    Py_INCREF(value);
    __Pyx_BEGIN_CRITICAL_SECTION(op);
    __Pyx_Py_XDECREF_SET(op->func_name, value);
    __Pyx_END_CRITICAL_SECTION();
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, void *context)
{
    CYTHON_UNUSED_VAR(context);
    PyObject *result;
    __Pyx_BEGIN_CRITICAL_SECTION(op);
    Py_INCREF(op->func_qualname);
    result = op->func_qualname;
    __Pyx_END_CRITICAL_SECTION();
    return result;
}
static int
__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, void *context)
{
    CYTHON_UNUSED_VAR(context);
    if (unlikely(value == NULL || !PyUnicode_Check(value))) {
        PyErr_SetString(PyExc_TypeError,
                        "__qualname__ must be set to a string object");
        return -1;
    }
    Py_INCREF(value);
    __Pyx_BEGIN_CRITICAL_SECTION(op);
    __Pyx_Py_XDECREF_SET(op->func_qualname, value);
    __Pyx_END_CRITICAL_SECTION();
    return 0;
}
#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
static PyObject *
__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context)
{
    CYTHON_UNUSED_VAR(context);
    if (unlikely(op->func_dict == NULL)) {
        op->func_dict = PyDict_New();
        if (unlikely(op->func_dict == NULL))
            return NULL;
    }
    Py_INCREF(op->func_dict);
    return op->func_dict;
}
#endif
static PyObject *
__Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, void *context)
{
    CYTHON_UNUSED_VAR(context);
    Py_INCREF(op->func_globals);
    return op->func_globals;
}
static PyObject *
__Pyx_CyFunction_get_closure(__pyx_CyFunctionObject *op, void *context)
{
    CYTHON_UNUSED_VAR(op);
    CYTHON_UNUSED_VAR(context);
    Py_INCREF(Py_None);
    return Py_None;
}
static PyObject *
__Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, void *context)
{
    PyObject* result = (op->func_code) ? op->func_code : Py_None;
    CYTHON_UNUSED_VAR(context);
    Py_INCREF(result);
    return result;
}
static int
__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) {
    int result = 0;
    PyObject *res = op->defaults_getter((PyObject *) op);
    if (unlikely(!res))
        return -1;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
    Py_INCREF(op->defaults_tuple);
    op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
    Py_INCREF(op->defaults_kwdict);
    #else
    op->defaults_tuple = __Pyx_PySequence_ITEM(res, 0);
    if (unlikely(!op->defaults_tuple)) result = -1;
    else {
        op->defaults_kwdict = __Pyx_PySequence_ITEM(res, 1);
        if (unlikely(!op->defaults_kwdict)) result = -1;
    }
    #endif
    Py_DECREF(res);
    return result;
}
static int
__Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) {
    CYTHON_UNUSED_VAR(context);
    if (!value) {
        value = Py_None;
    } else if (unlikely(value != Py_None && !PyTuple_Check(value))) {
        PyErr_SetString(PyExc_TypeError,
                        "__defaults__ must be set to a tuple object");
        return -1;
    }
    PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__defaults__ will not "
                 "currently affect the values used in function calls", 1);
    Py_INCREF(value);
    __Pyx_BEGIN_CRITICAL_SECTION(op);
    __Pyx_Py_XDECREF_SET(op->defaults_tuple, value);
    __Pyx_END_CRITICAL_SECTION();
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_defaults_locked(__pyx_CyFunctionObject *op) {
    PyObject* result = op->defaults_tuple;
    if (unlikely(!result)) {
        if (op->defaults_getter) {
            if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL;
            result = op->defaults_tuple;
        } else {
            result = Py_None;
        }
    }
    Py_INCREF(result);
    return result;
}
static PyObject *
__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, void *context) {
    PyObject* result = NULL;
    CYTHON_UNUSED_VAR(context);
    __Pyx_BEGIN_CRITICAL_SECTION(op);
    result = __Pyx_CyFunction_get_defaults_locked(op);
    __Pyx_END_CRITICAL_SECTION();
    return result;
}
static int
__Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) {
    CYTHON_UNUSED_VAR(context);
    if (!value) {
        value = Py_None;
    } else if (unlikely(value != Py_None && !PyDict_Check(value))) {
        PyErr_SetString(PyExc_TypeError,
                        "__kwdefaults__ must be set to a dict object");
        return -1;
    }
    PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__kwdefaults__ will not "
                 "currently affect the values used in function calls", 1);
    Py_INCREF(value);
    __Pyx_BEGIN_CRITICAL_SECTION(op);
    __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value);
    __Pyx_END_CRITICAL_SECTION();
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_kwdefaults_locked(__pyx_CyFunctionObject *op) {
    PyObject* result = op->defaults_kwdict;
    if (unlikely(!result)) {
        if (op->defaults_getter) {
            if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL;
            result = op->defaults_kwdict;
        } else {
            result = Py_None;
        }
    }
    Py_INCREF(result);
    return result;
}
static PyObject *
__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, void *context) {
    PyObject* result;
    CYTHON_UNUSED_VAR(context);
    __Pyx_BEGIN_CRITICAL_SECTION(op);
    result = __Pyx_CyFunction_get_kwdefaults_locked(op);
    __Pyx_END_CRITICAL_SECTION();
    return result;
}
static int
__Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, void *context) {
    CYTHON_UNUSED_VAR(context);
    if (!value || value == Py_None) {
        value = NULL;
    } else if (unlikely(!PyDict_Check(value))) {
        PyErr_SetString(PyExc_TypeError,
                        "__annotations__ must be set to a dict object");
        return -1;
    }
    Py_XINCREF(value);
    __Pyx_BEGIN_CRITICAL_SECTION(op);
    __Pyx_Py_XDECREF_SET(op->func_annotations, value);
    __Pyx_END_CRITICAL_SECTION();
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_annotations_locked(__pyx_CyFunctionObject *op) {
    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 PyObject *
__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, void *context) {
    PyObject *result;
    CYTHON_UNUSED_VAR(context);
    __Pyx_BEGIN_CRITICAL_SECTION(op);
    result = __Pyx_CyFunction_get_annotations_locked(op);
    __Pyx_END_CRITICAL_SECTION();
    return result;
}
static PyObject *
__Pyx_CyFunction_get_is_coroutine_value(__pyx_CyFunctionObject *op) {
    int is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE;
    if (is_coroutine) {
        PyObject *is_coroutine_value, *module, *fromlist, *marker = __pyx_mstate_global->__pyx_n_u_is_coroutine;
        fromlist = PyList_New(1);
        if (unlikely(!fromlist)) return NULL;
        Py_INCREF(marker);
#if CYTHON_ASSUME_SAFE_MACROS
        PyList_SET_ITEM(fromlist, 0, marker);
#else
        if (unlikely(PyList_SetItem(fromlist, 0, marker) < 0)) {
            Py_DECREF(fromlist);
            return NULL;
        }
#endif
        module = PyImport_ImportModuleLevelObject(__pyx_mstate_global->__pyx_n_u_asyncio_coroutines, NULL, NULL, fromlist, 0);
        Py_DECREF(fromlist);
        if (unlikely(!module)) goto ignore;
        is_coroutine_value = __Pyx_PyObject_GetAttrStr(module, marker);
        Py_DECREF(module);
        if (likely(is_coroutine_value)) {
            return is_coroutine_value;
        }
ignore:
        PyErr_Clear();
    }
    return __Pyx_PyBool_FromLong(is_coroutine);
}
static PyObject *
__Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) {
    PyObject *result;
    CYTHON_UNUSED_VAR(context);
    if (op->func_is_coroutine) {
        return __Pyx_NewRef(op->func_is_coroutine);
    }
    result = __Pyx_CyFunction_get_is_coroutine_value(op);
    if (unlikely(!result))
        return NULL;
    __Pyx_BEGIN_CRITICAL_SECTION(op);
    if (op->func_is_coroutine) {
        Py_DECREF(result);
        result = __Pyx_NewRef(op->func_is_coroutine);
    } else {
        op->func_is_coroutine = __Pyx_NewRef(result);
    }
    __Pyx_END_CRITICAL_SECTION();
    return result;
}
static void __Pyx_CyFunction_raise_argument_count_error(__pyx_CyFunctionObject *func, const char* message, Py_ssize_t size) {
#if CYTHON_COMPILING_IN_LIMITED_API
    PyObject *py_name = __Pyx_CyFunction_get_name(func, NULL);
    if (!py_name) return;
    PyErr_Format(PyExc_TypeError,
        "%.200S() %s (%" CYTHON_FORMAT_SSIZE_T "d given)",
        py_name, message, size);
    Py_DECREF(py_name);
#else
    const char* name = ((PyCFunctionObject*)func)->m_ml->ml_name;
    PyErr_Format(PyExc_TypeError,
        "%.200s() %s (%" CYTHON_FORMAT_SSIZE_T "d given)",
        name, message, size);
#endif
}
static void __Pyx_CyFunction_raise_type_error(__pyx_CyFunctionObject *func, const char* message) {
#if CYTHON_COMPILING_IN_LIMITED_API
    PyObject *py_name = __Pyx_CyFunction_get_name(func, NULL);
    if (!py_name) return;
    PyErr_Format(PyExc_TypeError,
        "%.200S() %s",
        py_name, message);
    Py_DECREF(py_name);
#else
    const char* name = ((PyCFunctionObject*)func)->m_ml->ml_name;
    PyErr_Format(PyExc_TypeError,
        "%.200s() %s",
        name, message);
#endif
}
#if CYTHON_COMPILING_IN_LIMITED_API
static PyObject *
__Pyx_CyFunction_get_module(__pyx_CyFunctionObject *op, void *context) {
    CYTHON_UNUSED_VAR(context);
    return PyObject_GetAttrString(op->func, "__module__");
}
static int
__Pyx_CyFunction_set_module(__pyx_CyFunctionObject *op, PyObject* value, void *context) {
    CYTHON_UNUSED_VAR(context);
    return PyObject_SetAttrString(op->func, "__module__", value);
}
#endif
static PyGetSetDef __pyx_CyFunction_getsets[] = {
    {"func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
    {"__doc__",  (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
    {"func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
    {"__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
    {"__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
    {"func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)PyObject_GenericSetDict, 0, 0},
    {"__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)PyObject_GenericSetDict, 0, 0},
#else
    {"func_dict", (getter)PyObject_GenericGetDict, (setter)PyObject_GenericSetDict, 0, 0},
    {"__dict__", (getter)PyObject_GenericGetDict, (setter)PyObject_GenericSetDict, 0, 0},
#endif
    {"func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
    {"__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
    {"func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
    {"__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
    {"func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
    {"__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
    {"func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
    {"__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
    {"__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
    {"__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
    {"_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0},
#if CYTHON_COMPILING_IN_LIMITED_API
    {"__module__", (getter)__Pyx_CyFunction_get_module, (setter)__Pyx_CyFunction_set_module, 0, 0},
#endif
    {0, 0, 0, 0, 0}
};
static PyMemberDef __pyx_CyFunction_members[] = {
#if !CYTHON_COMPILING_IN_LIMITED_API
    {"__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0},
#endif
#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
    {"__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0},
#endif
#if CYTHON_METH_FASTCALL
#if CYTHON_COMPILING_IN_LIMITED_API
    {"__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0},
#else
    {"__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0},
#endif
#if CYTHON_COMPILING_IN_LIMITED_API
    {"__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0},
#else
    {"__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0},
#endif
#endif
    {0, 0, 0,  0, 0}
};
static PyObject *
__Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, PyObject *args)
{
    PyObject *result = NULL;
    CYTHON_UNUSED_VAR(args);
    __Pyx_BEGIN_CRITICAL_SECTION(m);
    Py_INCREF(m->func_qualname);
    result = m->func_qualname;
    __Pyx_END_CRITICAL_SECTION();
    return result;
}
static PyMethodDef __pyx_CyFunction_methods[] = {
    {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
    {0, 0, 0, 0}
};
#if CYTHON_COMPILING_IN_LIMITED_API
#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
#else
#define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist)
#endif
static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname,
                                       PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
#if !CYTHON_COMPILING_IN_LIMITED_API
    PyCFunctionObject *cf = (PyCFunctionObject*) op;
#endif
    if (unlikely(op == NULL))
        return NULL;
#if CYTHON_COMPILING_IN_LIMITED_API
    op->func = PyCFunction_NewEx(ml, (PyObject*)op, module);
    if (unlikely(!op->func)) return NULL;
#endif
    op->flags = flags;
    __Pyx_CyFunction_weakreflist(op) = NULL;
#if !CYTHON_COMPILING_IN_LIMITED_API
    cf->m_ml = ml;
    cf->m_self = (PyObject *) op;
#endif
    Py_XINCREF(closure);
    op->func_closure = closure;
#if !CYTHON_COMPILING_IN_LIMITED_API
    Py_XINCREF(module);
    cf->m_module = module;
#endif
#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
    op->func_dict = NULL;
#endif
    op->func_name = NULL;
    Py_INCREF(qualname);
    op->func_qualname = qualname;
    op->func_doc = NULL;
#if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
    op->func_classobj = NULL;
#else
    ((PyCMethodObject*)op)->mm_class = NULL;
#endif
    op->func_globals = globals;
    Py_INCREF(op->func_globals);
    Py_XINCREF(code);
    op->func_code = code;
    op->defaults = NULL;
    op->defaults_tuple = NULL;
    op->defaults_kwdict = NULL;
    op->defaults_getter = NULL;
    op->func_annotations = NULL;
    op->func_is_coroutine = NULL;
#if CYTHON_METH_FASTCALL
    switch (ml->ml_flags & (METH_VARARGS | METH_FASTCALL | METH_NOARGS | METH_O | METH_KEYWORDS | METH_METHOD)) {
    case METH_NOARGS:
        __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_NOARGS;
        break;
    case METH_O:
        __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_O;
        break;
    case METH_METHOD | METH_FASTCALL | METH_KEYWORDS:
        __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD;
        break;
    case METH_FASTCALL | METH_KEYWORDS:
        __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS;
        break;
    case METH_VARARGS | METH_KEYWORDS:
        __Pyx_CyFunction_func_vectorcall(op) = NULL;
        break;
    default:
        PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction");
        Py_DECREF(op);
        return NULL;
    }
#endif
    return (PyObject *) op;
}
static int
__Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
{
    Py_CLEAR(m->func_closure);
#if CYTHON_COMPILING_IN_LIMITED_API
    Py_CLEAR(m->func);
#else
    Py_CLEAR(((PyCFunctionObject*)m)->m_module);
#endif
#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
    Py_CLEAR(m->func_dict);
#elif PY_VERSION_HEX < 0x030d0000
    _PyObject_ClearManagedDict((PyObject*)m);
#else
    PyObject_ClearManagedDict((PyObject*)m);
#endif
    Py_CLEAR(m->func_name);
    Py_CLEAR(m->func_qualname);
    Py_CLEAR(m->func_doc);
    Py_CLEAR(m->func_globals);
    Py_CLEAR(m->func_code);
#if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
    Py_CLEAR(__Pyx_CyFunction_GetClassObj(m));
#else
    {
        PyObject *cls = (PyObject*) ((PyCMethodObject *) (m))->mm_class;
        ((PyCMethodObject *) (m))->mm_class = NULL;
        Py_XDECREF(cls);
    }
#endif
    Py_CLEAR(m->defaults_tuple);
    Py_CLEAR(m->defaults_kwdict);
    Py_CLEAR(m->func_annotations);
    Py_CLEAR(m->func_is_coroutine);
    Py_CLEAR(m->defaults);
    return 0;
}
static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m)
{
    if (__Pyx_CyFunction_weakreflist(m) != NULL)
        PyObject_ClearWeakRefs((PyObject *) m);
    __Pyx_CyFunction_clear(m);
    __Pyx_PyHeapTypeObject_GC_Del(m);
}
static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
{
    PyObject_GC_UnTrack(m);
    __Pyx__CyFunction_dealloc(m);
}
static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg)
{
    {
        int e = __Pyx_call_type_traverse((PyObject*)m, 1, visit, arg);
        if (e) return e;
    }
    Py_VISIT(m->func_closure);
#if CYTHON_COMPILING_IN_LIMITED_API
    Py_VISIT(m->func);
#else
    Py_VISIT(((PyCFunctionObject*)m)->m_module);
#endif
#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
    Py_VISIT(m->func_dict);
#else
    {
        int e =
#if PY_VERSION_HEX < 0x030d0000
            _PyObject_VisitManagedDict
#else
            PyObject_VisitManagedDict
#endif
                ((PyObject*)m, visit, arg);
        if (e != 0) return e;
    }
#endif
    __Pyx_VISIT_CONST(m->func_name);
    __Pyx_VISIT_CONST(m->func_qualname);
    Py_VISIT(m->func_doc);
    Py_VISIT(m->func_globals);
    __Pyx_VISIT_CONST(m->func_code);
    Py_VISIT(__Pyx_CyFunction_GetClassObj(m));
    Py_VISIT(m->defaults_tuple);
    Py_VISIT(m->defaults_kwdict);
    Py_VISIT(m->func_annotations);
    Py_VISIT(m->func_is_coroutine);
    Py_VISIT(m->defaults);
    return 0;
}
static PyObject*
__Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
{
    PyObject *repr;
    __Pyx_BEGIN_CRITICAL_SECTION(op);
    repr = PyUnicode_FromFormat("<cyfunction %U at %p>",
                                op->func_qualname, (void *)op);
    __Pyx_END_CRITICAL_SECTION();
    return repr;
}
static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) {
#if CYTHON_COMPILING_IN_LIMITED_API
    PyObject *f = ((__pyx_CyFunctionObject*)func)->func;
    PyCFunction meth;
    int flags;
    meth = PyCFunction_GetFunction(f);
    if (unlikely(!meth)) return NULL;
    flags = PyCFunction_GetFlags(f);
    if (unlikely(flags < 0)) return NULL;
#else
    PyCFunctionObject* f = (PyCFunctionObject*)func;
    PyCFunction meth = f->m_ml->ml_meth;
    int flags = f->m_ml->ml_flags;
#endif
    Py_ssize_t size;
    switch (flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
    case METH_VARARGS:
        if (likely(kw == NULL || PyDict_Size(kw) == 0))
            return (*meth)(self, arg);
        break;
    case METH_VARARGS | METH_KEYWORDS:
        return (*(PyCFunctionWithKeywords)(void(*)(void))meth)(self, arg, kw);
    case METH_NOARGS:
        if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
#if CYTHON_ASSUME_SAFE_SIZE
            size = PyTuple_GET_SIZE(arg);
#else
            size = PyTuple_Size(arg);
            if (unlikely(size < 0)) return NULL;
#endif
            if (likely(size == 0))
                return (*meth)(self, NULL);
            __Pyx_CyFunction_raise_argument_count_error(
                (__pyx_CyFunctionObject*)func,
                "takes no arguments", size);
            return NULL;
        }
        break;
    case METH_O:
        if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
#if CYTHON_ASSUME_SAFE_SIZE
            size = PyTuple_GET_SIZE(arg);
#else
            size = PyTuple_Size(arg);
            if (unlikely(size < 0)) return NULL;
#endif
            if (likely(size == 1)) {
                PyObject *result, *arg0;
                #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                arg0 = PyTuple_GET_ITEM(arg, 0);
                #else
                arg0 = __Pyx_PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL;
                #endif
                result = (*meth)(self, arg0);
                #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
                Py_DECREF(arg0);
                #endif
                return result;
            }
            __Pyx_CyFunction_raise_argument_count_error(
                (__pyx_CyFunctionObject*)func,
                "takes exactly one argument", size);
            return NULL;
        }
        break;
    default:
        PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction");
        return NULL;
    }
    __Pyx_CyFunction_raise_type_error(
        (__pyx_CyFunctionObject*)func, "takes no keyword arguments");
    return NULL;
}
static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
    PyObject *self, *result;
#if CYTHON_COMPILING_IN_LIMITED_API
    self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)func)->func);
    if (unlikely(!self) && PyErr_Occurred()) return NULL;
#else
    self = ((PyCFunctionObject*)func)->m_self;
#endif
    result = __Pyx_CyFunction_CallMethod(func, self, arg, kw);
    return result;
}
static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
    PyObject *result;
    __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func;
#if CYTHON_METH_FASTCALL && CYTHON_VECTORCALL
     __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc);
    if (vc) {
#if CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE
        return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (size_t)PyTuple_GET_SIZE(args), kw);
#else
        (void) &__Pyx_PyVectorcall_FastCallDict;
        return PyVectorcall_Call(func, args, kw);
#endif
    }
#endif
    if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
        Py_ssize_t argc;
        PyObject *new_args;
        PyObject *self;
#if CYTHON_ASSUME_SAFE_SIZE
        argc = PyTuple_GET_SIZE(args);
#else
        argc = PyTuple_Size(args);
        if (unlikely(argc < 0)) return NULL;
#endif
        new_args = PyTuple_GetSlice(args, 1, argc);
        if (unlikely(!new_args))
            return NULL;
        self = PyTuple_GetItem(args, 0);
        if (unlikely(!self)) {
            Py_DECREF(new_args);
            PyErr_Format(PyExc_TypeError,
                         "unbound method %.200S() needs an argument",
                         cyfunc->func_qualname);
            return NULL;
        }
        result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw);
        Py_DECREF(new_args);
    } else {
        result = __Pyx_CyFunction_Call(func, args, kw);
    }
    return result;
}
#if CYTHON_METH_FASTCALL && CYTHON_VECTORCALL
static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames)
{
    int ret = 0;
    if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
        if (unlikely(nargs < 1)) {
            __Pyx_CyFunction_raise_type_error(
                cyfunc, "needs an argument");
            return -1;
        }
        ret = 1;
    }
    if (unlikely(kwnames) && unlikely(__Pyx_PyTuple_GET_SIZE(kwnames))) {
        __Pyx_CyFunction_raise_type_error(
            cyfunc, "takes no keyword arguments");
        return -1;
    }
    return ret;
}
static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
{
    __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func;
    Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
    PyObject *self;
#if CYTHON_COMPILING_IN_LIMITED_API
    PyCFunction meth = PyCFunction_GetFunction(cyfunc->func);
    if (unlikely(!meth)) return NULL;
#else
    PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth;
#endif
    switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) {
    case 1:
        self = args[0];
        args += 1;
        nargs -= 1;
        break;
    case 0:
#if CYTHON_COMPILING_IN_LIMITED_API
        self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)cyfunc)->func);
        if (unlikely(!self) && PyErr_Occurred()) return NULL;
#else
        self = ((PyCFunctionObject*)cyfunc)->m_self;
#endif
        break;
    default:
        return NULL;
    }
    if (unlikely(nargs != 0)) {
        __Pyx_CyFunction_raise_argument_count_error(
            cyfunc, "takes no arguments", nargs);
        return NULL;
    }
    return meth(self, NULL);
}
static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
{
    __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func;
    Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
    PyObject *self;
#if CYTHON_COMPILING_IN_LIMITED_API
    PyCFunction meth = PyCFunction_GetFunction(cyfunc->func);
    if (unlikely(!meth)) return NULL;
#else
    PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth;
#endif
    switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) {
    case 1:
        self = args[0];
        args += 1;
        nargs -= 1;
        break;
    case 0:
#if CYTHON_COMPILING_IN_LIMITED_API
        self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)cyfunc)->func);
        if (unlikely(!self) && PyErr_Occurred()) return NULL;
#else
        self = ((PyCFunctionObject*)cyfunc)->m_self;
#endif
        break;
    default:
        return NULL;
    }
    if (unlikely(nargs != 1)) {
        __Pyx_CyFunction_raise_argument_count_error(
            cyfunc, "takes exactly one argument", nargs);
        return NULL;
    }
    return meth(self, args[0]);
}
static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
{
    __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func;
    Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
    PyObject *self;
#if CYTHON_COMPILING_IN_LIMITED_API
    PyCFunction meth = PyCFunction_GetFunction(cyfunc->func);
    if (unlikely(!meth)) return NULL;
#else
    PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth;
#endif
    switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) {
    case 1:
        self = args[0];
        args += 1;
        nargs -= 1;
        break;
    case 0:
#if CYTHON_COMPILING_IN_LIMITED_API
        self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)cyfunc)->func);
        if (unlikely(!self) && PyErr_Occurred()) return NULL;
#else
        self = ((PyCFunctionObject*)cyfunc)->m_self;
#endif
        break;
    default:
        return NULL;
    }
    return ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))meth)(self, args, nargs, kwnames);
}
static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
{
    __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func;
    PyTypeObject *cls = (PyTypeObject *) __Pyx_CyFunction_GetClassObj(cyfunc);
    Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
    PyObject *self;
#if CYTHON_COMPILING_IN_LIMITED_API
    PyCFunction meth = PyCFunction_GetFunction(cyfunc->func);
    if (unlikely(!meth)) return NULL;
#else
    PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth;
#endif
    switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) {
    case 1:
        self = args[0];
        args += 1;
        nargs -= 1;
        break;
    case 0:
#if CYTHON_COMPILING_IN_LIMITED_API
        self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)cyfunc)->func);
        if (unlikely(!self) && PyErr_Occurred()) return NULL;
#else
        self = ((PyCFunctionObject*)cyfunc)->m_self;
#endif
        break;
    default:
        return NULL;
    }
    #if PY_VERSION_HEX < 0x030e00A6
    size_t nargs_value = (size_t) nargs;
    #else
    Py_ssize_t nargs_value = nargs;
    #endif
    return ((__Pyx_PyCMethod)(void(*)(void))meth)(self, cls, args, nargs_value, kwnames);
}
#endif
static PyType_Slot __pyx_CyFunctionType_slots[] = {
    {Py_tp_dealloc, (void *)__Pyx_CyFunction_dealloc},
    {Py_tp_repr, (void *)__Pyx_CyFunction_repr},
    {Py_tp_call, (void *)__Pyx_CyFunction_CallAsMethod},
    {Py_tp_traverse, (void *)__Pyx_CyFunction_traverse},
    {Py_tp_clear, (void *)__Pyx_CyFunction_clear},
    {Py_tp_methods, (void *)__pyx_CyFunction_methods},
    {Py_tp_members, (void *)__pyx_CyFunction_members},
    {Py_tp_getset, (void *)__pyx_CyFunction_getsets},
    {Py_tp_descr_get, (void *)__Pyx_PyMethod_New},
    {0, 0},
};
static PyType_Spec __pyx_CyFunctionType_spec = {
    __PYX_TYPE_MODULE_PREFIX "cython_function_or_method",
    sizeof(__pyx_CyFunctionObject),
    0,
#ifdef Py_TPFLAGS_METHOD_DESCRIPTOR
    Py_TPFLAGS_METHOD_DESCRIPTOR |
#endif
#if CYTHON_METH_FASTCALL
#if defined(Py_TPFLAGS_HAVE_VECTORCALL)
    Py_TPFLAGS_HAVE_VECTORCALL |
#elif defined(_Py_TPFLAGS_HAVE_VECTORCALL)
    _Py_TPFLAGS_HAVE_VECTORCALL |
#endif
#endif // CYTHON_METH_FASTCALL
#if PY_VERSION_HEX >= 0x030C0000 && !CYTHON_COMPILING_IN_LIMITED_API
    Py_TPFLAGS_MANAGED_DICT |
#endif
    Py_TPFLAGS_IMMUTABLETYPE | Py_TPFLAGS_DISALLOW_INSTANTIATION |
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE,
    __pyx_CyFunctionType_slots
};
static int __pyx_CyFunction_init(PyObject *module) {
    __pyx_mstatetype *mstate = __Pyx_PyModule_GetState(module);
    mstate->__pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(
        mstate->__pyx_CommonTypesMetaclassType, module, &__pyx_CyFunctionType_spec, NULL);
    if (unlikely(mstate->__pyx_CyFunctionType == NULL)) {
        return -1;
    }
    return 0;
}
static CYTHON_INLINE PyObject *__Pyx_CyFunction_InitDefaults(PyObject *func, PyTypeObject *defaults_type) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->defaults = PyObject_CallObject((PyObject*)defaults_type, NULL); // _PyObject_New(defaults_type);
    if (unlikely(!m->defaults))
        return NULL;
    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_mstate_global->__pyx_CyFunctionType),
        ml, flags, qualname, closure, module, globals, code
    );
    if (likely(op)) {
        PyObject_GC_Track(op);
    }
    return op;
}

/* PyObjectCall2Args (used by Py3ClassCreate) */
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) {
    PyObject *args[3] = {NULL, arg1, arg2};
    return __Pyx_PyObject_FastCall(function, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
}

/* PyObjectLookupSpecial (used by Py3ClassCreate) */
#if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE PyObject* __Pyx__PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name, int with_error) {
    PyObject *res;
    PyTypeObject *tp = Py_TYPE(obj);
    res = _PyType_Lookup(tp, attr_name);
    if (likely(res)) {
        descrgetfunc f = Py_TYPE(res)->tp_descr_get;
        if (!f) {
            Py_INCREF(res);
        } else {
            res = f(res, obj, (PyObject *)tp);
        }
    } else if (with_error) {
        PyErr_SetObject(PyExc_AttributeError, attr_name);
    }
    return res;
}
#endif

/* 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_GetAttrStrNoError(metaclass, __pyx_mstate_global->__pyx_n_u_prepare);
        if (prep) {
            PyObject *pargs[3] = {NULL, name, bases};
            ns = __Pyx_PyObject_FastCallDict(prep, pargs+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, mkw);
            Py_DECREF(prep);
        } else {
            if (unlikely(PyErr_Occurred()))
                return NULL;
            ns = PyDict_New();
        }
    } else {
        ns = PyDict_New();
    }
    if (unlikely(!ns))
        return NULL;
    if (unlikely(PyObject_SetItem(ns, __pyx_mstate_global->__pyx_n_u_module, modname) < 0)) goto bad;
    if (unlikely(PyObject_SetItem(ns, __pyx_mstate_global->__pyx_n_u_qualname, qualname) < 0)) goto bad;
    if (unlikely(doc && PyObject_SetItem(ns, __pyx_mstate_global->__pyx_n_u_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;
    PyObject *owned_metaclass = NULL;
    PyObject *margs[4] = {NULL, name, bases, dict};
    if (allow_py2_metaclass) {
        owned_metaclass = PyObject_GetItem(dict, __pyx_mstate_global->__pyx_n_u_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;
    }
    result = __Pyx_PyObject_FastCallDict(metaclass, margs+1, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, mkw);
    Py_XDECREF(owned_metaclass);
    return result;
}

/* CyFunctionClassCell */
static int __Pyx_CyFunction_InitClassCell(PyObject *cyfunctions, PyObject *classobj) {
    Py_ssize_t i, count = __Pyx_PyList_GET_SIZE(cyfunctions);
    #if !CYTHON_ASSUME_SAFE_SIZE
    if (unlikely(count < 0)) return -1;
    #endif
    for (i = 0; i < count; i++) {
        __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *)
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && !CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
            PyList_GET_ITEM(cyfunctions, i);
#else
            __Pyx_PySequence_ITEM(cyfunctions, i);
        if (unlikely(!m))
            return -1;
#endif
        __Pyx_CyFunction_SetClassObj(m, classobj);
#if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && !CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS)
        Py_DECREF((PyObject*)m);
#endif
    }
    return 0;
}

/* CLineInTraceback (used by AddTraceback) */
#if CYTHON_CLINE_IN_TRACEBACK && CYTHON_CLINE_IN_TRACEBACK_RUNTIME
#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
#define __Pyx_PyProbablyModule_GetDict(o) __Pyx_XNewRef(PyModule_GetDict(o))
#elif !CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
#define __Pyx_PyProbablyModule_GetDict(o) PyObject_GenericGetDict(o, NULL);
#else
PyObject* __Pyx_PyProbablyModule_GetDict(PyObject *o) {
    PyObject **dict_ptr = _PyObject_GetDictPtr(o);
    return dict_ptr ? __Pyx_XNewRef(*dict_ptr) : NULL;
}
#endif
static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) {
    PyObject *use_cline = NULL;
    PyObject *ptype, *pvalue, *ptraceback;
    PyObject *cython_runtime_dict;
    CYTHON_MAYBE_UNUSED_VAR(tstate);
    if (unlikely(!__pyx_mstate_global->__pyx_cython_runtime)) {
        return c_line;
    }
    __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
    cython_runtime_dict = __Pyx_PyProbablyModule_GetDict(__pyx_mstate_global->__pyx_cython_runtime);
    if (likely(cython_runtime_dict)) {
        __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
            use_cline, cython_runtime_dict,
            __Pyx_PyDict_SetDefault(cython_runtime_dict, __pyx_mstate_global->__pyx_n_u_cline_in_traceback, Py_False))
    }
    if (use_cline == NULL || use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
        c_line = 0;
    }
    Py_XDECREF(use_cline);
    Py_XDECREF(cython_runtime_dict);
    __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
    return c_line;
}
#endif

/* CodeObjectCache (used by AddTraceback) */
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 __Pyx_CachedCodeObjectType *__pyx__find_code_object(struct __Pyx_CodeObjectCache *code_cache, int code_line) {
    __Pyx_CachedCodeObjectType* code_object;
    int pos;
    if (unlikely(!code_line) || unlikely(!code_cache->entries)) {
        return NULL;
    }
    pos = __pyx_bisect_code_objects(code_cache->entries, code_cache->count, code_line);
    if (unlikely(pos >= code_cache->count) || unlikely(code_cache->entries[pos].code_line != code_line)) {
        return NULL;
    }
    code_object = code_cache->entries[pos].code_object;
    Py_INCREF(code_object);
    return code_object;
}
static __Pyx_CachedCodeObjectType *__pyx_find_code_object(int code_line) {
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && !CYTHON_ATOMICS
    (void)__pyx__find_code_object;
    return NULL; // Most implementation should have atomics. But otherwise, don't make it thread-safe, just miss.
#else
    struct __Pyx_CodeObjectCache *code_cache = &__pyx_mstate_global->__pyx_code_cache;
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    __pyx_nonatomic_int_type old_count = __pyx_atomic_incr_acq_rel(&code_cache->accessor_count);
    if (old_count < 0) {
        __pyx_atomic_decr_acq_rel(&code_cache->accessor_count);
        return NULL;
    }
#endif
    __Pyx_CachedCodeObjectType *result = __pyx__find_code_object(code_cache, code_line);
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    __pyx_atomic_decr_acq_rel(&code_cache->accessor_count);
#endif
    return result;
#endif
}
static void __pyx__insert_code_object(struct __Pyx_CodeObjectCache *code_cache, int code_line, __Pyx_CachedCodeObjectType* code_object)
{
    int pos, i;
    __Pyx_CodeObjectCacheEntry* entries = code_cache->entries;
    if (unlikely(!code_line)) {
        return;
    }
    if (unlikely(!entries)) {
        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
        if (likely(entries)) {
            code_cache->entries = entries;
            code_cache->max_count = 64;
            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(code_cache->entries, code_cache->count, code_line);
    if ((pos < code_cache->count) && unlikely(code_cache->entries[pos].code_line == code_line)) {
        __Pyx_CachedCodeObjectType* tmp = entries[pos].code_object;
        entries[pos].code_object = code_object;
        Py_INCREF(code_object);
        Py_DECREF(tmp);
        return;
    }
    if (code_cache->count == code_cache->max_count) {
        int new_max = code_cache->max_count + 64;
        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
            code_cache->entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry));
        if (unlikely(!entries)) {
            return;
        }
        code_cache->entries = entries;
        code_cache->max_count = new_max;
    }
    for (i=code_cache->count; i>pos; i--) {
        entries[i] = entries[i-1];
    }
    entries[pos].code_line = code_line;
    entries[pos].code_object = code_object;
    code_cache->count++;
    Py_INCREF(code_object);
}
static void __pyx_insert_code_object(int code_line, __Pyx_CachedCodeObjectType* code_object) {
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && !CYTHON_ATOMICS
    (void)__pyx__insert_code_object;
    return; // Most implementation should have atomics. But otherwise, don't make it thread-safe, just fail.
#else
    struct __Pyx_CodeObjectCache *code_cache = &__pyx_mstate_global->__pyx_code_cache;
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    __pyx_nonatomic_int_type expected = 0;
    if (!__pyx_atomic_int_cmp_exchange(&code_cache->accessor_count, &expected, INT_MIN)) {
        return;
    }
#endif
    __pyx__insert_code_object(code_cache, code_line, code_object);
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    __pyx_atomic_sub(&code_cache->accessor_count, INT_MIN);
#endif
#endif
}

/* AddTraceback */
#include "compile.h"
#include "frameobject.h"
#include "traceback.h"
#if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API && !defined(PYPY_VERSION)
  #ifndef Py_BUILD_CORE
    #define Py_BUILD_CORE 1
  #endif
  #include "internal/pycore_frame.h"
#endif
#if CYTHON_COMPILING_IN_LIMITED_API
static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict,
                                                       PyObject *firstlineno, PyObject *name) {
    PyObject *replace = NULL;
    if (unlikely(PyDict_SetItemString(scratch_dict, "co_firstlineno", firstlineno))) return NULL;
    if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL;
    replace = PyObject_GetAttrString(code, "replace");
    if (likely(replace)) {
        PyObject *result = PyObject_Call(replace, __pyx_mstate_global->__pyx_empty_tuple, scratch_dict);
        Py_DECREF(replace);
        return result;
    }
    PyErr_Clear();
    return NULL;
}
static void __Pyx_AddTraceback(const char *funcname, int c_line,
                               int py_line, const char *filename) {
    PyObject *code_object = NULL, *py_py_line = NULL, *py_funcname = NULL, *dict = NULL;
    PyObject *replace = NULL, *getframe = NULL, *frame = NULL;
    PyObject *exc_type, *exc_value, *exc_traceback;
    int success = 0;
    if (c_line) {
        c_line = __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line);
    }
    PyErr_Fetch(&exc_type, &exc_value, &exc_traceback);
    code_object = __pyx_find_code_object(c_line ? -c_line : py_line);
    if (!code_object) {
        code_object = Py_CompileString("_getframe()", filename, Py_eval_input);
        if (unlikely(!code_object)) goto bad;
        py_py_line = PyLong_FromLong(py_line);
        if (unlikely(!py_py_line)) goto bad;
        if (c_line) {
            py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
        } else {
            py_funcname = PyUnicode_FromString(funcname);
        }
        if (unlikely(!py_funcname)) goto bad;
        dict = PyDict_New();
        if (unlikely(!dict)) goto bad;
        {
            PyObject *old_code_object = code_object;
            code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname);
            Py_DECREF(old_code_object);
        }
        if (unlikely(!code_object)) goto bad;
        __pyx_insert_code_object(c_line ? -c_line : py_line, code_object);
    } else {
        dict = PyDict_New();
    }
    getframe = PySys_GetObject("_getframe");
    if (unlikely(!getframe)) goto bad;
    if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad;
    frame = PyEval_EvalCode(code_object, dict, dict);
    if (unlikely(!frame) || frame == Py_None) goto bad;
    success = 1;
  bad:
    PyErr_Restore(exc_type, exc_value, exc_traceback);
    Py_XDECREF(code_object);
    Py_XDECREF(py_py_line);
    Py_XDECREF(py_funcname);
    Py_XDECREF(dict);
    Py_XDECREF(replace);
    if (success) {
        PyTraceBack_Here(
            (struct _frame*)frame);
    }
    Py_XDECREF(frame);
}
#else
static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
            const char *funcname, int c_line,
            int py_line, const char *filename) {
    PyCodeObject *py_code = NULL;
    PyObject *py_funcname = NULL;
    if (c_line) {
        py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
        if (!py_funcname) goto bad;
        funcname = PyUnicode_AsUTF8(py_funcname);
        if (!funcname) goto bad;
    }
    py_code = PyCode_NewEmpty(filename, funcname, py_line);
    Py_XDECREF(py_funcname);
    return py_code;
bad:
    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;
    PyObject *ptype, *pvalue, *ptraceback;
    if (c_line) {
        c_line = __Pyx_CLineForTraceback(tstate, c_line);
    }
    py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
    if (!py_code) {
        __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
        py_code = __Pyx_CreateCodeObjectForTraceback(
            funcname, c_line, py_line, filename);
        if (!py_code) {
            /* If the code object creation fails, then we should clear the
               fetched exception references and propagate the new exception */
            Py_XDECREF(ptype);
            Py_XDECREF(pvalue);
            Py_XDECREF(ptraceback);
            goto bad;
        }
        __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
        __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
    }
    py_frame = PyFrame_New(
        tstate,            /*PyThreadState *tstate,*/
        py_code,           /*PyCodeObject *code,*/
        __pyx_mstate_global->__pyx_d,    /*PyObject *globals,*/
        0                  /*PyObject *locals*/
    );
    if (!py_frame) goto bad;
    __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
    PyTraceBack_Here(py_frame);
bad:
    Py_XDECREF(py_code);
    Py_XDECREF(py_frame);
}
#endif

/* Declarations */
#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
  #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 && (1) && (!0 || __cplusplus)
#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) && (a.real >= 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

/* 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;\
    }

/* CheckUnpickleChecksum */
static void __Pyx_RaiseUnpickleChecksumError(long checksum, long checksum1, long checksum2, long checksum3, const char *members) {
    PyObject *pickle_module = PyImport_ImportModule("pickle");
    if (unlikely(!pickle_module)) return;
    PyObject *pickle_error = PyObject_GetAttrString(pickle_module, "PickleError");
    Py_DECREF(pickle_module);
    if (unlikely(!pickle_error)) return;
    if (checksum2 == checksum1) {
        PyErr_Format(pickle_error, "Incompatible checksums (0x%x vs (0x%x) = (%s))",
            checksum, checksum1, members);
    } else if (checksum3 == checksum2) {
        PyErr_Format(pickle_error, "Incompatible checksums (0x%x vs (0x%x, 0x%x) = (%s))",
            checksum, checksum1, checksum2, members);
    } else {
        PyErr_Format(pickle_error, "Incompatible checksums (0x%x vs (0x%x, 0x%x, 0x%x) = (%s))",
            checksum, checksum1, checksum2, checksum3, members);
    }
    Py_DECREF(pickle_error);
}
static int __Pyx_CheckUnpickleChecksum(long checksum, long checksum1, long checksum2, long checksum3, const char *members) {
    int found = 0;
    found |= checksum1 == checksum;
    found |= checksum2 == checksum;
    found |= checksum3 == checksum;
    if (likely(found))
        return 0;
    __Pyx_RaiseUnpickleChecksumError(checksum, checksum1, checksum2, checksum3, members);
    return -1;
}

/* FromPy */
static __pyx_t_double_complex __Pyx_PyComplex_As___pyx_t_double_complex(PyObject* o) {
#if CYTHON_COMPILING_IN_LIMITED_API
    double real=-1.0, imag=-1.0;
    real = PyComplex_RealAsDouble(o);
    if (unlikely(real == -1.0 && PyErr_Occurred())) goto end;
    imag = PyComplex_ImagAsDouble(o);
  end:
    return __pyx_t_double_complex_from_parts(
        (double)real, (double)imag
    );
#else
    Py_complex cval;
#if !CYTHON_COMPILING_IN_PYPY && !CYTHON_COMPILING_IN_GRAAL
    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);
#endif
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_cusparseIndexBase_t(cusparseIndexBase_t value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const cusparseIndexBase_t neg_one = (cusparseIndexBase_t) -1, const_zero = (cusparseIndexBase_t) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(cusparseIndexBase_t) < sizeof(long)) {
            return PyLong_FromLong((long) value);
        } else if (sizeof(cusparseIndexBase_t) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#if !CYTHON_COMPILING_IN_PYPY
        } 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 PyLong_FromLong((long) value);
        } else if (sizeof(cusparseIndexBase_t) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
        }
    }
    {
        unsigned char *bytes = (unsigned char *)&value;
#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
        if (is_unsigned) {
            return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
        } else {
            return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
        }
#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
        int one = 1; int little = (int)*(unsigned char *)&one;
        return _PyLong_FromByteArray(bytes, sizeof(cusparseIndexBase_t),
                                     little, !is_unsigned);
#else
        int one = 1; int little = (int)*(unsigned char *)&one;
        PyObject *from_bytes, *result = NULL, *kwds = NULL;
        PyObject *py_bytes = NULL, *order_str = NULL;
        from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
        if (!from_bytes) return NULL;
        py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(cusparseIndexBase_t));
        if (!py_bytes) goto limited_bad;
        order_str = PyUnicode_FromString(little ? "little" : "big");
        if (!order_str) goto limited_bad;
        {
            PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
            if (!is_unsigned) {
                kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                if (!kwds) goto limited_bad;
                if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
            }
            result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
        }
        limited_bad:
        Py_XDECREF(kwds);
        Py_XDECREF(order_str);
        Py_XDECREF(py_bytes);
        Py_XDECREF(from_bytes);
        return result;
#endif
    }
}

/* CIntFromPy */
static CYTHON_INLINE cusparseIndexBase_t __Pyx_PyLong_As_cusparseIndexBase_t(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const cusparseIndexBase_t neg_one = (cusparseIndexBase_t) -1, const_zero = (cusparseIndexBase_t) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (unlikely(!PyLong_Check(x))) {
        cusparseIndexBase_t val;
        PyObject *tmp = __Pyx_PyNumber_Long(x);
        if (!tmp) return (cusparseIndexBase_t) -1;
        val = __Pyx_PyLong_As_cusparseIndexBase_t(tmp);
        Py_DECREF(tmp);
        return val;
    }
    if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
        if (unlikely(__Pyx_PyLong_IsNeg(x))) {
            goto raise_neg_overflow;
        } else if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(cusparseIndexBase_t, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_DigitCount(x)) {
                case 2:
                    if ((8 * sizeof(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 && PY_VERSION_HEX < 0x030C00A7
        if (unlikely(Py_SIZE(x) < 0)) {
            goto raise_neg_overflow;
        }
#else
        {
            int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
            if (unlikely(result < 0))
                return (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))
        } else if ((sizeof(cusparseIndexBase_t) <= sizeof(unsigned PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(cusparseIndexBase_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
        }
    } else {
#if CYTHON_USE_PYLONG_INTERNALS
        if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(cusparseIndexBase_t, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_SignedDigitCount(x)) {
                case -2:
                    if ((8 * sizeof(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))
        } else if ((sizeof(cusparseIndexBase_t) <= sizeof(PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(cusparseIndexBase_t, PY_LONG_LONG, PyLong_AsLongLong(x))
        }
    }
    {
        cusparseIndexBase_t val;
        int ret = -1;
#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
        Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
            x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
        if (unlikely(bytes_copied == -1)) {
        } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
            goto raise_overflow;
        } else {
            ret = 0;
        }
#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
        int one = 1; int is_little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&val;
        ret = _PyLong_AsByteArray((PyLongObject *)x,
                                    bytes, sizeof(val),
                                    is_little, !is_unsigned);
#else
        PyObject *v;
        PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
        int bits, remaining_bits, is_negative = 0;
        int chunk_size = (sizeof(long) < 8) ? 30 : 62;
        if (likely(PyLong_CheckExact(x))) {
            v = __Pyx_NewRef(x);
        } else {
            v = PyNumber_Long(x);
            if (unlikely(!v)) return (cusparseIndexBase_t) -1;
            assert(PyLong_CheckExact(v));
        }
        {
            int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
            if (unlikely(result < 0)) {
                Py_DECREF(v);
                return (cusparseIndexBase_t) -1;
            }
            is_negative = result == 1;
        }
        if (is_unsigned && unlikely(is_negative)) {
            Py_DECREF(v);
            goto raise_neg_overflow;
        } else if (is_negative) {
            stepval = PyNumber_Invert(v);
            Py_DECREF(v);
            if (unlikely(!stepval))
                return (cusparseIndexBase_t) -1;
        } else {
            stepval = v;
        }
        v = NULL;
        val = (cusparseIndexBase_t) 0;
        mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
        shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
        for (bits = 0; bits < (int) sizeof(cusparseIndexBase_t) * 8 - chunk_size; bits += chunk_size) {
            PyObject *tmp, *digit;
            long idigit;
            digit = PyNumber_And(stepval, mask);
            if (unlikely(!digit)) goto done;
            idigit = PyLong_AsLong(digit);
            Py_DECREF(digit);
            if (unlikely(idigit < 0)) goto done;
            val |= ((cusparseIndexBase_t) idigit) << bits;
            tmp = PyNumber_Rshift(stepval, shift);
            if (unlikely(!tmp)) goto done;
            Py_DECREF(stepval); stepval = tmp;
        }
        Py_DECREF(shift); shift = NULL;
        Py_DECREF(mask); mask = NULL;
        {
            long idigit = PyLong_AsLong(stepval);
            if (unlikely(idigit < 0)) goto done;
            remaining_bits = ((int) sizeof(cusparseIndexBase_t) * 8) - bits - (is_unsigned ? 0 : 1);
            if (unlikely(idigit >= (1L << remaining_bits)))
                goto raise_overflow;
            val |= ((cusparseIndexBase_t) idigit) << bits;
        }
        if (!is_unsigned) {
            if (unlikely(val & (((cusparseIndexBase_t) 1) << (sizeof(cusparseIndexBase_t) * 8 - 1))))
                goto raise_overflow;
            if (is_negative)
                val = ~val;
        }
        ret = 0;
    done:
        Py_XDECREF(shift);
        Py_XDECREF(mask);
        Py_XDECREF(stepval);
#endif
        if (unlikely(ret))
            return (cusparseIndexBase_t) -1;
        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;
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_cusparseIndexType_t(cusparseIndexType_t value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const cusparseIndexType_t neg_one = (cusparseIndexType_t) -1, const_zero = (cusparseIndexType_t) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(cusparseIndexType_t) < sizeof(long)) {
            return PyLong_FromLong((long) value);
        } else if (sizeof(cusparseIndexType_t) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#if !CYTHON_COMPILING_IN_PYPY
        } 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 PyLong_FromLong((long) value);
        } else if (sizeof(cusparseIndexType_t) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
        }
    }
    {
        unsigned char *bytes = (unsigned char *)&value;
#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
        if (is_unsigned) {
            return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
        } else {
            return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
        }
#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
        int one = 1; int little = (int)*(unsigned char *)&one;
        return _PyLong_FromByteArray(bytes, sizeof(cusparseIndexType_t),
                                     little, !is_unsigned);
#else
        int one = 1; int little = (int)*(unsigned char *)&one;
        PyObject *from_bytes, *result = NULL, *kwds = NULL;
        PyObject *py_bytes = NULL, *order_str = NULL;
        from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
        if (!from_bytes) return NULL;
        py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(cusparseIndexType_t));
        if (!py_bytes) goto limited_bad;
        order_str = PyUnicode_FromString(little ? "little" : "big");
        if (!order_str) goto limited_bad;
        {
            PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
            if (!is_unsigned) {
                kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                if (!kwds) goto limited_bad;
                if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
            }
            result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
        }
        limited_bad:
        Py_XDECREF(kwds);
        Py_XDECREF(order_str);
        Py_XDECREF(py_bytes);
        Py_XDECREF(from_bytes);
        return result;
#endif
    }
}

/* CIntFromPy */
static CYTHON_INLINE cusparseIndexType_t __Pyx_PyLong_As_cusparseIndexType_t(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const cusparseIndexType_t neg_one = (cusparseIndexType_t) -1, const_zero = (cusparseIndexType_t) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (unlikely(!PyLong_Check(x))) {
        cusparseIndexType_t val;
        PyObject *tmp = __Pyx_PyNumber_Long(x);
        if (!tmp) return (cusparseIndexType_t) -1;
        val = __Pyx_PyLong_As_cusparseIndexType_t(tmp);
        Py_DECREF(tmp);
        return val;
    }
    if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
        if (unlikely(__Pyx_PyLong_IsNeg(x))) {
            goto raise_neg_overflow;
        } else if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(cusparseIndexType_t, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_DigitCount(x)) {
                case 2:
                    if ((8 * sizeof(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 && PY_VERSION_HEX < 0x030C00A7
        if (unlikely(Py_SIZE(x) < 0)) {
            goto raise_neg_overflow;
        }
#else
        {
            int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
            if (unlikely(result < 0))
                return (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))
        } else if ((sizeof(cusparseIndexType_t) <= sizeof(unsigned PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(cusparseIndexType_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
        }
    } else {
#if CYTHON_USE_PYLONG_INTERNALS
        if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(cusparseIndexType_t, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_SignedDigitCount(x)) {
                case -2:
                    if ((8 * sizeof(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))
        } else if ((sizeof(cusparseIndexType_t) <= sizeof(PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(cusparseIndexType_t, PY_LONG_LONG, PyLong_AsLongLong(x))
        }
    }
    {
        cusparseIndexType_t val;
        int ret = -1;
#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
        Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
            x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
        if (unlikely(bytes_copied == -1)) {
        } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
            goto raise_overflow;
        } else {
            ret = 0;
        }
#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
        int one = 1; int is_little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&val;
        ret = _PyLong_AsByteArray((PyLongObject *)x,
                                    bytes, sizeof(val),
                                    is_little, !is_unsigned);
#else
        PyObject *v;
        PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
        int bits, remaining_bits, is_negative = 0;
        int chunk_size = (sizeof(long) < 8) ? 30 : 62;
        if (likely(PyLong_CheckExact(x))) {
            v = __Pyx_NewRef(x);
        } else {
            v = PyNumber_Long(x);
            if (unlikely(!v)) return (cusparseIndexType_t) -1;
            assert(PyLong_CheckExact(v));
        }
        {
            int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
            if (unlikely(result < 0)) {
                Py_DECREF(v);
                return (cusparseIndexType_t) -1;
            }
            is_negative = result == 1;
        }
        if (is_unsigned && unlikely(is_negative)) {
            Py_DECREF(v);
            goto raise_neg_overflow;
        } else if (is_negative) {
            stepval = PyNumber_Invert(v);
            Py_DECREF(v);
            if (unlikely(!stepval))
                return (cusparseIndexType_t) -1;
        } else {
            stepval = v;
        }
        v = NULL;
        val = (cusparseIndexType_t) 0;
        mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
        shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
        for (bits = 0; bits < (int) sizeof(cusparseIndexType_t) * 8 - chunk_size; bits += chunk_size) {
            PyObject *tmp, *digit;
            long idigit;
            digit = PyNumber_And(stepval, mask);
            if (unlikely(!digit)) goto done;
            idigit = PyLong_AsLong(digit);
            Py_DECREF(digit);
            if (unlikely(idigit < 0)) goto done;
            val |= ((cusparseIndexType_t) idigit) << bits;
            tmp = PyNumber_Rshift(stepval, shift);
            if (unlikely(!tmp)) goto done;
            Py_DECREF(stepval); stepval = tmp;
        }
        Py_DECREF(shift); shift = NULL;
        Py_DECREF(mask); mask = NULL;
        {
            long idigit = PyLong_AsLong(stepval);
            if (unlikely(idigit < 0)) goto done;
            remaining_bits = ((int) sizeof(cusparseIndexType_t) * 8) - bits - (is_unsigned ? 0 : 1);
            if (unlikely(idigit >= (1L << remaining_bits)))
                goto raise_overflow;
            val |= ((cusparseIndexType_t) idigit) << bits;
        }
        if (!is_unsigned) {
            if (unlikely(val & (((cusparseIndexType_t) 1) << (sizeof(cusparseIndexType_t) * 8 - 1))))
                goto raise_overflow;
            if (is_negative)
                val = ~val;
        }
        ret = 0;
    done:
        Py_XDECREF(shift);
        Py_XDECREF(mask);
        Py_XDECREF(stepval);
#endif
        if (unlikely(ret))
            return (cusparseIndexType_t) -1;
        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;
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_int64_t(int64_t value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const int64_t neg_one = (int64_t) -1, const_zero = (int64_t) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(int64_t) < sizeof(long)) {
            return PyLong_FromLong((long) value);
        } else if (sizeof(int64_t) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#if !CYTHON_COMPILING_IN_PYPY
        } 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 PyLong_FromLong((long) value);
        } else if (sizeof(int64_t) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
        }
    }
    {
        unsigned char *bytes = (unsigned char *)&value;
#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
        if (is_unsigned) {
            return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
        } else {
            return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
        }
#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
        int one = 1; int little = (int)*(unsigned char *)&one;
        return _PyLong_FromByteArray(bytes, sizeof(int64_t),
                                     little, !is_unsigned);
#else
        int one = 1; int little = (int)*(unsigned char *)&one;
        PyObject *from_bytes, *result = NULL, *kwds = NULL;
        PyObject *py_bytes = NULL, *order_str = NULL;
        from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
        if (!from_bytes) return NULL;
        py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int64_t));
        if (!py_bytes) goto limited_bad;
        order_str = PyUnicode_FromString(little ? "little" : "big");
        if (!order_str) goto limited_bad;
        {
            PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
            if (!is_unsigned) {
                kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                if (!kwds) goto limited_bad;
                if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
            }
            result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
        }
        limited_bad:
        Py_XDECREF(kwds);
        Py_XDECREF(order_str);
        Py_XDECREF(py_bytes);
        Py_XDECREF(from_bytes);
        return result;
#endif
    }
}

/* CIntFromPy */
static CYTHON_INLINE int64_t __Pyx_PyLong_As_int64_t(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const int64_t neg_one = (int64_t) -1, const_zero = (int64_t) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (unlikely(!PyLong_Check(x))) {
        int64_t val;
        PyObject *tmp = __Pyx_PyNumber_Long(x);
        if (!tmp) return (int64_t) -1;
        val = __Pyx_PyLong_As_int64_t(tmp);
        Py_DECREF(tmp);
        return val;
    }
    if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
        if (unlikely(__Pyx_PyLong_IsNeg(x))) {
            goto raise_neg_overflow;
        } else if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(int64_t, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_DigitCount(x)) {
                case 2:
                    if ((8 * sizeof(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 && PY_VERSION_HEX < 0x030C00A7
        if (unlikely(Py_SIZE(x) < 0)) {
            goto raise_neg_overflow;
        }
#else
        {
            int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
            if (unlikely(result < 0))
                return (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))
        } else if ((sizeof(int64_t) <= sizeof(unsigned PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(int64_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
        }
    } else {
#if CYTHON_USE_PYLONG_INTERNALS
        if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(int64_t, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_SignedDigitCount(x)) {
                case -2:
                    if ((8 * sizeof(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))
        } else if ((sizeof(int64_t) <= sizeof(PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(int64_t, PY_LONG_LONG, PyLong_AsLongLong(x))
        }
    }
    {
        int64_t val;
        int ret = -1;
#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
        Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
            x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
        if (unlikely(bytes_copied == -1)) {
        } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
            goto raise_overflow;
        } else {
            ret = 0;
        }
#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
        int one = 1; int is_little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&val;
        ret = _PyLong_AsByteArray((PyLongObject *)x,
                                    bytes, sizeof(val),
                                    is_little, !is_unsigned);
#else
        PyObject *v;
        PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
        int bits, remaining_bits, is_negative = 0;
        int chunk_size = (sizeof(long) < 8) ? 30 : 62;
        if (likely(PyLong_CheckExact(x))) {
            v = __Pyx_NewRef(x);
        } else {
            v = PyNumber_Long(x);
            if (unlikely(!v)) return (int64_t) -1;
            assert(PyLong_CheckExact(v));
        }
        {
            int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
            if (unlikely(result < 0)) {
                Py_DECREF(v);
                return (int64_t) -1;
            }
            is_negative = result == 1;
        }
        if (is_unsigned && unlikely(is_negative)) {
            Py_DECREF(v);
            goto raise_neg_overflow;
        } else if (is_negative) {
            stepval = PyNumber_Invert(v);
            Py_DECREF(v);
            if (unlikely(!stepval))
                return (int64_t) -1;
        } else {
            stepval = v;
        }
        v = NULL;
        val = (int64_t) 0;
        mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
        shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
        for (bits = 0; bits < (int) sizeof(int64_t) * 8 - chunk_size; bits += chunk_size) {
            PyObject *tmp, *digit;
            long idigit;
            digit = PyNumber_And(stepval, mask);
            if (unlikely(!digit)) goto done;
            idigit = PyLong_AsLong(digit);
            Py_DECREF(digit);
            if (unlikely(idigit < 0)) goto done;
            val |= ((int64_t) idigit) << bits;
            tmp = PyNumber_Rshift(stepval, shift);
            if (unlikely(!tmp)) goto done;
            Py_DECREF(stepval); stepval = tmp;
        }
        Py_DECREF(shift); shift = NULL;
        Py_DECREF(mask); mask = NULL;
        {
            long idigit = PyLong_AsLong(stepval);
            if (unlikely(idigit < 0)) goto done;
            remaining_bits = ((int) sizeof(int64_t) * 8) - bits - (is_unsigned ? 0 : 1);
            if (unlikely(idigit >= (1L << remaining_bits)))
                goto raise_overflow;
            val |= ((int64_t) idigit) << bits;
        }
        if (!is_unsigned) {
            if (unlikely(val & (((int64_t) 1) << (sizeof(int64_t) * 8 - 1))))
                goto raise_overflow;
            if (is_negative)
                val = ~val;
        }
        ret = 0;
    done:
        Py_XDECREF(shift);
        Py_XDECREF(mask);
        Py_XDECREF(stepval);
#endif
        if (unlikely(ret))
            return (int64_t) -1;
        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;
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_cudaDataType(cudaDataType value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const cudaDataType neg_one = (cudaDataType) -1, const_zero = (cudaDataType) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(cudaDataType) < sizeof(long)) {
            return PyLong_FromLong((long) value);
        } else if (sizeof(cudaDataType) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#if !CYTHON_COMPILING_IN_PYPY
        } 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 PyLong_FromLong((long) value);
        } else if (sizeof(cudaDataType) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
        }
    }
    {
        unsigned char *bytes = (unsigned char *)&value;
#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
        if (is_unsigned) {
            return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
        } else {
            return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
        }
#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
        int one = 1; int little = (int)*(unsigned char *)&one;
        return _PyLong_FromByteArray(bytes, sizeof(cudaDataType),
                                     little, !is_unsigned);
#else
        int one = 1; int little = (int)*(unsigned char *)&one;
        PyObject *from_bytes, *result = NULL, *kwds = NULL;
        PyObject *py_bytes = NULL, *order_str = NULL;
        from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
        if (!from_bytes) return NULL;
        py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(cudaDataType));
        if (!py_bytes) goto limited_bad;
        order_str = PyUnicode_FromString(little ? "little" : "big");
        if (!order_str) goto limited_bad;
        {
            PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
            if (!is_unsigned) {
                kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                if (!kwds) goto limited_bad;
                if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
            }
            result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
        }
        limited_bad:
        Py_XDECREF(kwds);
        Py_XDECREF(order_str);
        Py_XDECREF(py_bytes);
        Py_XDECREF(from_bytes);
        return result;
#endif
    }
}

/* CIntFromPy */
static CYTHON_INLINE cudaDataType __Pyx_PyLong_As_cudaDataType(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const cudaDataType neg_one = (cudaDataType) -1, const_zero = (cudaDataType) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (unlikely(!PyLong_Check(x))) {
        cudaDataType val;
        PyObject *tmp = __Pyx_PyNumber_Long(x);
        if (!tmp) return (cudaDataType) -1;
        val = __Pyx_PyLong_As_cudaDataType(tmp);
        Py_DECREF(tmp);
        return val;
    }
    if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
        if (unlikely(__Pyx_PyLong_IsNeg(x))) {
            goto raise_neg_overflow;
        } else if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(cudaDataType, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_DigitCount(x)) {
                case 2:
                    if ((8 * sizeof(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 && PY_VERSION_HEX < 0x030C00A7
        if (unlikely(Py_SIZE(x) < 0)) {
            goto raise_neg_overflow;
        }
#else
        {
            int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
            if (unlikely(result < 0))
                return (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))
        } else if ((sizeof(cudaDataType) <= sizeof(unsigned PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(cudaDataType, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
        }
    } else {
#if CYTHON_USE_PYLONG_INTERNALS
        if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(cudaDataType, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_SignedDigitCount(x)) {
                case -2:
                    if ((8 * sizeof(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))
        } else if ((sizeof(cudaDataType) <= sizeof(PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(cudaDataType, PY_LONG_LONG, PyLong_AsLongLong(x))
        }
    }
    {
        cudaDataType val;
        int ret = -1;
#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
        Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
            x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
        if (unlikely(bytes_copied == -1)) {
        } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
            goto raise_overflow;
        } else {
            ret = 0;
        }
#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
        int one = 1; int is_little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&val;
        ret = _PyLong_AsByteArray((PyLongObject *)x,
                                    bytes, sizeof(val),
                                    is_little, !is_unsigned);
#else
        PyObject *v;
        PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
        int bits, remaining_bits, is_negative = 0;
        int chunk_size = (sizeof(long) < 8) ? 30 : 62;
        if (likely(PyLong_CheckExact(x))) {
            v = __Pyx_NewRef(x);
        } else {
            v = PyNumber_Long(x);
            if (unlikely(!v)) return (cudaDataType) -1;
            assert(PyLong_CheckExact(v));
        }
        {
            int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
            if (unlikely(result < 0)) {
                Py_DECREF(v);
                return (cudaDataType) -1;
            }
            is_negative = result == 1;
        }
        if (is_unsigned && unlikely(is_negative)) {
            Py_DECREF(v);
            goto raise_neg_overflow;
        } else if (is_negative) {
            stepval = PyNumber_Invert(v);
            Py_DECREF(v);
            if (unlikely(!stepval))
                return (cudaDataType) -1;
        } else {
            stepval = v;
        }
        v = NULL;
        val = (cudaDataType) 0;
        mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
        shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
        for (bits = 0; bits < (int) sizeof(cudaDataType) * 8 - chunk_size; bits += chunk_size) {
            PyObject *tmp, *digit;
            long idigit;
            digit = PyNumber_And(stepval, mask);
            if (unlikely(!digit)) goto done;
            idigit = PyLong_AsLong(digit);
            Py_DECREF(digit);
            if (unlikely(idigit < 0)) goto done;
            val |= ((cudaDataType) idigit) << bits;
            tmp = PyNumber_Rshift(stepval, shift);
            if (unlikely(!tmp)) goto done;
            Py_DECREF(stepval); stepval = tmp;
        }
        Py_DECREF(shift); shift = NULL;
        Py_DECREF(mask); mask = NULL;
        {
            long idigit = PyLong_AsLong(stepval);
            if (unlikely(idigit < 0)) goto done;
            remaining_bits = ((int) sizeof(cudaDataType) * 8) - bits - (is_unsigned ? 0 : 1);
            if (unlikely(idigit >= (1L << remaining_bits)))
                goto raise_overflow;
            val |= ((cudaDataType) idigit) << bits;
        }
        if (!is_unsigned) {
            if (unlikely(val & (((cudaDataType) 1) << (sizeof(cudaDataType) * 8 - 1))))
                goto raise_overflow;
            if (is_negative)
                val = ~val;
        }
        ret = 0;
    done:
        Py_XDECREF(shift);
        Py_XDECREF(mask);
        Py_XDECREF(stepval);
#endif
        if (unlikely(ret))
            return (cudaDataType) -1;
        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;
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_cusparseOrder_t(cusparseOrder_t value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const cusparseOrder_t neg_one = (cusparseOrder_t) -1, const_zero = (cusparseOrder_t) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(cusparseOrder_t) < sizeof(long)) {
            return PyLong_FromLong((long) value);
        } else if (sizeof(cusparseOrder_t) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#if !CYTHON_COMPILING_IN_PYPY
        } 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 PyLong_FromLong((long) value);
        } else if (sizeof(cusparseOrder_t) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
        }
    }
    {
        unsigned char *bytes = (unsigned char *)&value;
#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
        if (is_unsigned) {
            return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
        } else {
            return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
        }
#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
        int one = 1; int little = (int)*(unsigned char *)&one;
        return _PyLong_FromByteArray(bytes, sizeof(cusparseOrder_t),
                                     little, !is_unsigned);
#else
        int one = 1; int little = (int)*(unsigned char *)&one;
        PyObject *from_bytes, *result = NULL, *kwds = NULL;
        PyObject *py_bytes = NULL, *order_str = NULL;
        from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
        if (!from_bytes) return NULL;
        py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(cusparseOrder_t));
        if (!py_bytes) goto limited_bad;
        order_str = PyUnicode_FromString(little ? "little" : "big");
        if (!order_str) goto limited_bad;
        {
            PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
            if (!is_unsigned) {
                kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                if (!kwds) goto limited_bad;
                if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
            }
            result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
        }
        limited_bad:
        Py_XDECREF(kwds);
        Py_XDECREF(order_str);
        Py_XDECREF(py_bytes);
        Py_XDECREF(from_bytes);
        return result;
#endif
    }
}

/* CIntFromPy */
static CYTHON_INLINE cusparseOrder_t __Pyx_PyLong_As_cusparseOrder_t(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const cusparseOrder_t neg_one = (cusparseOrder_t) -1, const_zero = (cusparseOrder_t) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (unlikely(!PyLong_Check(x))) {
        cusparseOrder_t val;
        PyObject *tmp = __Pyx_PyNumber_Long(x);
        if (!tmp) return (cusparseOrder_t) -1;
        val = __Pyx_PyLong_As_cusparseOrder_t(tmp);
        Py_DECREF(tmp);
        return val;
    }
    if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
        if (unlikely(__Pyx_PyLong_IsNeg(x))) {
            goto raise_neg_overflow;
        } else if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(cusparseOrder_t, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_DigitCount(x)) {
                case 2:
                    if ((8 * sizeof(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 && PY_VERSION_HEX < 0x030C00A7
        if (unlikely(Py_SIZE(x) < 0)) {
            goto raise_neg_overflow;
        }
#else
        {
            int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
            if (unlikely(result < 0))
                return (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))
        } else if ((sizeof(cusparseOrder_t) <= sizeof(unsigned PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(cusparseOrder_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
        }
    } else {
#if CYTHON_USE_PYLONG_INTERNALS
        if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(cusparseOrder_t, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_SignedDigitCount(x)) {
                case -2:
                    if ((8 * sizeof(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))
        } else if ((sizeof(cusparseOrder_t) <= sizeof(PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(cusparseOrder_t, PY_LONG_LONG, PyLong_AsLongLong(x))
        }
    }
    {
        cusparseOrder_t val;
        int ret = -1;
#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
        Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
            x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
        if (unlikely(bytes_copied == -1)) {
        } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
            goto raise_overflow;
        } else {
            ret = 0;
        }
#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
        int one = 1; int is_little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&val;
        ret = _PyLong_AsByteArray((PyLongObject *)x,
                                    bytes, sizeof(val),
                                    is_little, !is_unsigned);
#else
        PyObject *v;
        PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
        int bits, remaining_bits, is_negative = 0;
        int chunk_size = (sizeof(long) < 8) ? 30 : 62;
        if (likely(PyLong_CheckExact(x))) {
            v = __Pyx_NewRef(x);
        } else {
            v = PyNumber_Long(x);
            if (unlikely(!v)) return (cusparseOrder_t) -1;
            assert(PyLong_CheckExact(v));
        }
        {
            int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
            if (unlikely(result < 0)) {
                Py_DECREF(v);
                return (cusparseOrder_t) -1;
            }
            is_negative = result == 1;
        }
        if (is_unsigned && unlikely(is_negative)) {
            Py_DECREF(v);
            goto raise_neg_overflow;
        } else if (is_negative) {
            stepval = PyNumber_Invert(v);
            Py_DECREF(v);
            if (unlikely(!stepval))
                return (cusparseOrder_t) -1;
        } else {
            stepval = v;
        }
        v = NULL;
        val = (cusparseOrder_t) 0;
        mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
        shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
        for (bits = 0; bits < (int) sizeof(cusparseOrder_t) * 8 - chunk_size; bits += chunk_size) {
            PyObject *tmp, *digit;
            long idigit;
            digit = PyNumber_And(stepval, mask);
            if (unlikely(!digit)) goto done;
            idigit = PyLong_AsLong(digit);
            Py_DECREF(digit);
            if (unlikely(idigit < 0)) goto done;
            val |= ((cusparseOrder_t) idigit) << bits;
            tmp = PyNumber_Rshift(stepval, shift);
            if (unlikely(!tmp)) goto done;
            Py_DECREF(stepval); stepval = tmp;
        }
        Py_DECREF(shift); shift = NULL;
        Py_DECREF(mask); mask = NULL;
        {
            long idigit = PyLong_AsLong(stepval);
            if (unlikely(idigit < 0)) goto done;
            remaining_bits = ((int) sizeof(cusparseOrder_t) * 8) - bits - (is_unsigned ? 0 : 1);
            if (unlikely(idigit >= (1L << remaining_bits)))
                goto raise_overflow;
            val |= ((cusparseOrder_t) idigit) << bits;
        }
        if (!is_unsigned) {
            if (unlikely(val & (((cusparseOrder_t) 1) << (sizeof(cusparseOrder_t) * 8 - 1))))
                goto raise_overflow;
            if (is_negative)
                val = ~val;
        }
        ret = 0;
    done:
        Py_XDECREF(shift);
        Py_XDECREF(mask);
        Py_XDECREF(stepval);
#endif
        if (unlikely(ret))
            return (cusparseOrder_t) -1;
        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;
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_int(int value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const int neg_one = (int) -1, const_zero = (int) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(int) < sizeof(long)) {
            return PyLong_FromLong((long) value);
        } else if (sizeof(int) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#if !CYTHON_COMPILING_IN_PYPY
        } 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 PyLong_FromLong((long) value);
        } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
        }
    }
    {
        unsigned char *bytes = (unsigned char *)&value;
#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
        if (is_unsigned) {
            return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
        } else {
            return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
        }
#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
        int one = 1; int little = (int)*(unsigned char *)&one;
        return _PyLong_FromByteArray(bytes, sizeof(int),
                                     little, !is_unsigned);
#else
        int one = 1; int little = (int)*(unsigned char *)&one;
        PyObject *from_bytes, *result = NULL, *kwds = NULL;
        PyObject *py_bytes = NULL, *order_str = NULL;
        from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
        if (!from_bytes) return NULL;
        py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int));
        if (!py_bytes) goto limited_bad;
        order_str = PyUnicode_FromString(little ? "little" : "big");
        if (!order_str) goto limited_bad;
        {
            PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
            if (!is_unsigned) {
                kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                if (!kwds) goto limited_bad;
                if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
            }
            result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
        }
        limited_bad:
        Py_XDECREF(kwds);
        Py_XDECREF(order_str);
        Py_XDECREF(py_bytes);
        Py_XDECREF(from_bytes);
        return result;
#endif
    }
}

/* CIntFromPy */
static CYTHON_INLINE int __Pyx_PyLong_As_int(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const int neg_one = (int) -1, const_zero = (int) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (unlikely(!PyLong_Check(x))) {
        int val;
        PyObject *tmp = __Pyx_PyNumber_Long(x);
        if (!tmp) return (int) -1;
        val = __Pyx_PyLong_As_int(tmp);
        Py_DECREF(tmp);
        return val;
    }
    if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
        if (unlikely(__Pyx_PyLong_IsNeg(x))) {
            goto raise_neg_overflow;
        } else if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_DigitCount(x)) {
                case 2:
                    if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(int) >= 2 * PyLong_SHIFT)) {
                            return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(int) >= 3 * PyLong_SHIFT)) {
                            return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(int) >= 4 * PyLong_SHIFT)) {
                            return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
                        }
                    }
                    break;
            }
        }
#endif
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
        if (unlikely(Py_SIZE(x) < 0)) {
            goto raise_neg_overflow;
        }
#else
        {
            int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
            if (unlikely(result < 0))
                return (int) -1;
            if (unlikely(result == 1))
                goto raise_neg_overflow;
        }
#endif
        if ((sizeof(int) <= sizeof(unsigned long))) {
            __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
        } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
        }
    } else {
#if CYTHON_USE_PYLONG_INTERNALS
        if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_SignedDigitCount(x)) {
                case -2:
                    if ((8 * sizeof(int) - 1 > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) {
                            return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) {
                            return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) {
                            return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) {
                            return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) {
                            return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) {
                            return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
            }
        }
#endif
        if ((sizeof(int) <= sizeof(long))) {
            __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
        } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
        }
    }
    {
        int val;
        int ret = -1;
#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
        Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
            x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
        if (unlikely(bytes_copied == -1)) {
        } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
            goto raise_overflow;
        } else {
            ret = 0;
        }
#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
        int one = 1; int is_little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&val;
        ret = _PyLong_AsByteArray((PyLongObject *)x,
                                    bytes, sizeof(val),
                                    is_little, !is_unsigned);
#else
        PyObject *v;
        PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
        int bits, remaining_bits, is_negative = 0;
        int chunk_size = (sizeof(long) < 8) ? 30 : 62;
        if (likely(PyLong_CheckExact(x))) {
            v = __Pyx_NewRef(x);
        } else {
            v = PyNumber_Long(x);
            if (unlikely(!v)) return (int) -1;
            assert(PyLong_CheckExact(v));
        }
        {
            int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
            if (unlikely(result < 0)) {
                Py_DECREF(v);
                return (int) -1;
            }
            is_negative = result == 1;
        }
        if (is_unsigned && unlikely(is_negative)) {
            Py_DECREF(v);
            goto raise_neg_overflow;
        } else if (is_negative) {
            stepval = PyNumber_Invert(v);
            Py_DECREF(v);
            if (unlikely(!stepval))
                return (int) -1;
        } else {
            stepval = v;
        }
        v = NULL;
        val = (int) 0;
        mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
        shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
        for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) {
            PyObject *tmp, *digit;
            long idigit;
            digit = PyNumber_And(stepval, mask);
            if (unlikely(!digit)) goto done;
            idigit = PyLong_AsLong(digit);
            Py_DECREF(digit);
            if (unlikely(idigit < 0)) goto done;
            val |= ((int) idigit) << bits;
            tmp = PyNumber_Rshift(stepval, shift);
            if (unlikely(!tmp)) goto done;
            Py_DECREF(stepval); stepval = tmp;
        }
        Py_DECREF(shift); shift = NULL;
        Py_DECREF(mask); mask = NULL;
        {
            long idigit = PyLong_AsLong(stepval);
            if (unlikely(idigit < 0)) goto done;
            remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1);
            if (unlikely(idigit >= (1L << remaining_bits)))
                goto raise_overflow;
            val |= ((int) idigit) << bits;
        }
        if (!is_unsigned) {
            if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1))))
                goto raise_overflow;
            if (is_negative)
                val = ~val;
        }
        ret = 0;
    done:
        Py_XDECREF(shift);
        Py_XDECREF(mask);
        Py_XDECREF(stepval);
#endif
        if (unlikely(ret))
            return (int) -1;
        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 cusparseStatus_t __Pyx_PyLong_As_cusparseStatus_t(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const cusparseStatus_t neg_one = (cusparseStatus_t) -1, const_zero = (cusparseStatus_t) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (unlikely(!PyLong_Check(x))) {
        cusparseStatus_t val;
        PyObject *tmp = __Pyx_PyNumber_Long(x);
        if (!tmp) return (cusparseStatus_t) -1;
        val = __Pyx_PyLong_As_cusparseStatus_t(tmp);
        Py_DECREF(tmp);
        return val;
    }
    if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
        if (unlikely(__Pyx_PyLong_IsNeg(x))) {
            goto raise_neg_overflow;
        } else if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(cusparseStatus_t, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_DigitCount(x)) {
                case 2:
                    if ((8 * sizeof(cusparseStatus_t) > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(cusparseStatus_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(cusparseStatus_t) >= 2 * PyLong_SHIFT)) {
                            return (cusparseStatus_t) (((((cusparseStatus_t)digits[1]) << PyLong_SHIFT) | (cusparseStatus_t)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if ((8 * sizeof(cusparseStatus_t) > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(cusparseStatus_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(cusparseStatus_t) >= 3 * PyLong_SHIFT)) {
                            return (cusparseStatus_t) (((((((cusparseStatus_t)digits[2]) << PyLong_SHIFT) | (cusparseStatus_t)digits[1]) << PyLong_SHIFT) | (cusparseStatus_t)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if ((8 * sizeof(cusparseStatus_t) > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(cusparseStatus_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(cusparseStatus_t) >= 4 * PyLong_SHIFT)) {
                            return (cusparseStatus_t) (((((((((cusparseStatus_t)digits[3]) << PyLong_SHIFT) | (cusparseStatus_t)digits[2]) << PyLong_SHIFT) | (cusparseStatus_t)digits[1]) << PyLong_SHIFT) | (cusparseStatus_t)digits[0]));
                        }
                    }
                    break;
            }
        }
#endif
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
        if (unlikely(Py_SIZE(x) < 0)) {
            goto raise_neg_overflow;
        }
#else
        {
            int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
            if (unlikely(result < 0))
                return (cusparseStatus_t) -1;
            if (unlikely(result == 1))
                goto raise_neg_overflow;
        }
#endif
        if ((sizeof(cusparseStatus_t) <= sizeof(unsigned long))) {
            __PYX_VERIFY_RETURN_INT_EXC(cusparseStatus_t, unsigned long, PyLong_AsUnsignedLong(x))
        } else if ((sizeof(cusparseStatus_t) <= sizeof(unsigned PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(cusparseStatus_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
        }
    } else {
#if CYTHON_USE_PYLONG_INTERNALS
        if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(cusparseStatus_t, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_SignedDigitCount(x)) {
                case -2:
                    if ((8 * sizeof(cusparseStatus_t) - 1 > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(cusparseStatus_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(cusparseStatus_t) - 1 > 2 * PyLong_SHIFT)) {
                            return (cusparseStatus_t) (((cusparseStatus_t)-1)*(((((cusparseStatus_t)digits[1]) << PyLong_SHIFT) | (cusparseStatus_t)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if ((8 * sizeof(cusparseStatus_t) > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(cusparseStatus_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(cusparseStatus_t) - 1 > 2 * PyLong_SHIFT)) {
                            return (cusparseStatus_t) ((((((cusparseStatus_t)digits[1]) << PyLong_SHIFT) | (cusparseStatus_t)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if ((8 * sizeof(cusparseStatus_t) - 1 > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(cusparseStatus_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(cusparseStatus_t) - 1 > 3 * PyLong_SHIFT)) {
                            return (cusparseStatus_t) (((cusparseStatus_t)-1)*(((((((cusparseStatus_t)digits[2]) << PyLong_SHIFT) | (cusparseStatus_t)digits[1]) << PyLong_SHIFT) | (cusparseStatus_t)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if ((8 * sizeof(cusparseStatus_t) > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(cusparseStatus_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(cusparseStatus_t) - 1 > 3 * PyLong_SHIFT)) {
                            return (cusparseStatus_t) ((((((((cusparseStatus_t)digits[2]) << PyLong_SHIFT) | (cusparseStatus_t)digits[1]) << PyLong_SHIFT) | (cusparseStatus_t)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if ((8 * sizeof(cusparseStatus_t) - 1 > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(cusparseStatus_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(cusparseStatus_t) - 1 > 4 * PyLong_SHIFT)) {
                            return (cusparseStatus_t) (((cusparseStatus_t)-1)*(((((((((cusparseStatus_t)digits[3]) << PyLong_SHIFT) | (cusparseStatus_t)digits[2]) << PyLong_SHIFT) | (cusparseStatus_t)digits[1]) << PyLong_SHIFT) | (cusparseStatus_t)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if ((8 * sizeof(cusparseStatus_t) > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(cusparseStatus_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(cusparseStatus_t) - 1 > 4 * PyLong_SHIFT)) {
                            return (cusparseStatus_t) ((((((((((cusparseStatus_t)digits[3]) << PyLong_SHIFT) | (cusparseStatus_t)digits[2]) << PyLong_SHIFT) | (cusparseStatus_t)digits[1]) << PyLong_SHIFT) | (cusparseStatus_t)digits[0])));
                        }
                    }
                    break;
            }
        }
#endif
        if ((sizeof(cusparseStatus_t) <= sizeof(long))) {
            __PYX_VERIFY_RETURN_INT_EXC(cusparseStatus_t, long, PyLong_AsLong(x))
        } else if ((sizeof(cusparseStatus_t) <= sizeof(PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(cusparseStatus_t, PY_LONG_LONG, PyLong_AsLongLong(x))
        }
    }
    {
        cusparseStatus_t val;
        int ret = -1;
#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
        Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
            x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
        if (unlikely(bytes_copied == -1)) {
        } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
            goto raise_overflow;
        } else {
            ret = 0;
        }
#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
        int one = 1; int is_little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&val;
        ret = _PyLong_AsByteArray((PyLongObject *)x,
                                    bytes, sizeof(val),
                                    is_little, !is_unsigned);
#else
        PyObject *v;
        PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
        int bits, remaining_bits, is_negative = 0;
        int chunk_size = (sizeof(long) < 8) ? 30 : 62;
        if (likely(PyLong_CheckExact(x))) {
            v = __Pyx_NewRef(x);
        } else {
            v = PyNumber_Long(x);
            if (unlikely(!v)) return (cusparseStatus_t) -1;
            assert(PyLong_CheckExact(v));
        }
        {
            int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
            if (unlikely(result < 0)) {
                Py_DECREF(v);
                return (cusparseStatus_t) -1;
            }
            is_negative = result == 1;
        }
        if (is_unsigned && unlikely(is_negative)) {
            Py_DECREF(v);
            goto raise_neg_overflow;
        } else if (is_negative) {
            stepval = PyNumber_Invert(v);
            Py_DECREF(v);
            if (unlikely(!stepval))
                return (cusparseStatus_t) -1;
        } else {
            stepval = v;
        }
        v = NULL;
        val = (cusparseStatus_t) 0;
        mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
        shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
        for (bits = 0; bits < (int) sizeof(cusparseStatus_t) * 8 - chunk_size; bits += chunk_size) {
            PyObject *tmp, *digit;
            long idigit;
            digit = PyNumber_And(stepval, mask);
            if (unlikely(!digit)) goto done;
            idigit = PyLong_AsLong(digit);
            Py_DECREF(digit);
            if (unlikely(idigit < 0)) goto done;
            val |= ((cusparseStatus_t) idigit) << bits;
            tmp = PyNumber_Rshift(stepval, shift);
            if (unlikely(!tmp)) goto done;
            Py_DECREF(stepval); stepval = tmp;
        }
        Py_DECREF(shift); shift = NULL;
        Py_DECREF(mask); mask = NULL;
        {
            long idigit = PyLong_AsLong(stepval);
            if (unlikely(idigit < 0)) goto done;
            remaining_bits = ((int) sizeof(cusparseStatus_t) * 8) - bits - (is_unsigned ? 0 : 1);
            if (unlikely(idigit >= (1L << remaining_bits)))
                goto raise_overflow;
            val |= ((cusparseStatus_t) idigit) << bits;
        }
        if (!is_unsigned) {
            if (unlikely(val & (((cusparseStatus_t) 1) << (sizeof(cusparseStatus_t) * 8 - 1))))
                goto raise_overflow;
            if (is_negative)
                val = ~val;
        }
        ret = 0;
    done:
        Py_XDECREF(shift);
        Py_XDECREF(mask);
        Py_XDECREF(stepval);
#endif
        if (unlikely(ret))
            return (cusparseStatus_t) -1;
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to cusparseStatus_t");
    return (cusparseStatus_t) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to cusparseStatus_t");
    return (cusparseStatus_t) -1;
}

/* CIntFromPy */
static CYTHON_INLINE size_t __Pyx_PyLong_As_size_t(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const size_t neg_one = (size_t) -1, const_zero = (size_t) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (unlikely(!PyLong_Check(x))) {
        size_t val;
        PyObject *tmp = __Pyx_PyNumber_Long(x);
        if (!tmp) return (size_t) -1;
        val = __Pyx_PyLong_As_size_t(tmp);
        Py_DECREF(tmp);
        return val;
    }
    if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
        if (unlikely(__Pyx_PyLong_IsNeg(x))) {
            goto raise_neg_overflow;
        } else if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(size_t, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_DigitCount(x)) {
                case 2:
                    if ((8 * sizeof(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 && PY_VERSION_HEX < 0x030C00A7
        if (unlikely(Py_SIZE(x) < 0)) {
            goto raise_neg_overflow;
        }
#else
        {
            int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
            if (unlikely(result < 0))
                return (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))
        } else if ((sizeof(size_t) <= sizeof(unsigned PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(size_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
        }
    } else {
#if CYTHON_USE_PYLONG_INTERNALS
        if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(size_t, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_SignedDigitCount(x)) {
                case -2:
                    if ((8 * sizeof(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))
        } else if ((sizeof(size_t) <= sizeof(PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(size_t, PY_LONG_LONG, PyLong_AsLongLong(x))
        }
    }
    {
        size_t val;
        int ret = -1;
#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
        Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
            x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
        if (unlikely(bytes_copied == -1)) {
        } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
            goto raise_overflow;
        } else {
            ret = 0;
        }
#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
        int one = 1; int is_little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&val;
        ret = _PyLong_AsByteArray((PyLongObject *)x,
                                    bytes, sizeof(val),
                                    is_little, !is_unsigned);
#else
        PyObject *v;
        PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
        int bits, remaining_bits, is_negative = 0;
        int chunk_size = (sizeof(long) < 8) ? 30 : 62;
        if (likely(PyLong_CheckExact(x))) {
            v = __Pyx_NewRef(x);
        } else {
            v = PyNumber_Long(x);
            if (unlikely(!v)) return (size_t) -1;
            assert(PyLong_CheckExact(v));
        }
        {
            int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
            if (unlikely(result < 0)) {
                Py_DECREF(v);
                return (size_t) -1;
            }
            is_negative = result == 1;
        }
        if (is_unsigned && unlikely(is_negative)) {
            Py_DECREF(v);
            goto raise_neg_overflow;
        } else if (is_negative) {
            stepval = PyNumber_Invert(v);
            Py_DECREF(v);
            if (unlikely(!stepval))
                return (size_t) -1;
        } else {
            stepval = v;
        }
        v = NULL;
        val = (size_t) 0;
        mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
        shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
        for (bits = 0; bits < (int) sizeof(size_t) * 8 - chunk_size; bits += chunk_size) {
            PyObject *tmp, *digit;
            long idigit;
            digit = PyNumber_And(stepval, mask);
            if (unlikely(!digit)) goto done;
            idigit = PyLong_AsLong(digit);
            Py_DECREF(digit);
            if (unlikely(idigit < 0)) goto done;
            val |= ((size_t) idigit) << bits;
            tmp = PyNumber_Rshift(stepval, shift);
            if (unlikely(!tmp)) goto done;
            Py_DECREF(stepval); stepval = tmp;
        }
        Py_DECREF(shift); shift = NULL;
        Py_DECREF(mask); mask = NULL;
        {
            long idigit = PyLong_AsLong(stepval);
            if (unlikely(idigit < 0)) goto done;
            remaining_bits = ((int) sizeof(size_t) * 8) - bits - (is_unsigned ? 0 : 1);
            if (unlikely(idigit >= (1L << remaining_bits)))
                goto raise_overflow;
            val |= ((size_t) idigit) << bits;
        }
        if (!is_unsigned) {
            if (unlikely(val & (((size_t) 1) << (sizeof(size_t) * 8 - 1))))
                goto raise_overflow;
            if (is_negative)
                val = ~val;
        }
        ret = 0;
    done:
        Py_XDECREF(shift);
        Py_XDECREF(mask);
        Py_XDECREF(stepval);
#endif
        if (unlikely(ret))
            return (size_t) -1;
        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_PyLong_As_cusparseOperation_t(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const cusparseOperation_t neg_one = (cusparseOperation_t) -1, const_zero = (cusparseOperation_t) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (unlikely(!PyLong_Check(x))) {
        cusparseOperation_t val;
        PyObject *tmp = __Pyx_PyNumber_Long(x);
        if (!tmp) return (cusparseOperation_t) -1;
        val = __Pyx_PyLong_As_cusparseOperation_t(tmp);
        Py_DECREF(tmp);
        return val;
    }
    if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
        if (unlikely(__Pyx_PyLong_IsNeg(x))) {
            goto raise_neg_overflow;
        } else if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(cusparseOperation_t, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_DigitCount(x)) {
                case 2:
                    if ((8 * sizeof(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 && PY_VERSION_HEX < 0x030C00A7
        if (unlikely(Py_SIZE(x) < 0)) {
            goto raise_neg_overflow;
        }
#else
        {
            int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
            if (unlikely(result < 0))
                return (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))
        } else if ((sizeof(cusparseOperation_t) <= sizeof(unsigned PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(cusparseOperation_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
        }
    } else {
#if CYTHON_USE_PYLONG_INTERNALS
        if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(cusparseOperation_t, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_SignedDigitCount(x)) {
                case -2:
                    if ((8 * sizeof(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))
        } else if ((sizeof(cusparseOperation_t) <= sizeof(PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(cusparseOperation_t, PY_LONG_LONG, PyLong_AsLongLong(x))
        }
    }
    {
        cusparseOperation_t val;
        int ret = -1;
#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
        Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
            x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
        if (unlikely(bytes_copied == -1)) {
        } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
            goto raise_overflow;
        } else {
            ret = 0;
        }
#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
        int one = 1; int is_little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&val;
        ret = _PyLong_AsByteArray((PyLongObject *)x,
                                    bytes, sizeof(val),
                                    is_little, !is_unsigned);
#else
        PyObject *v;
        PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
        int bits, remaining_bits, is_negative = 0;
        int chunk_size = (sizeof(long) < 8) ? 30 : 62;
        if (likely(PyLong_CheckExact(x))) {
            v = __Pyx_NewRef(x);
        } else {
            v = PyNumber_Long(x);
            if (unlikely(!v)) return (cusparseOperation_t) -1;
            assert(PyLong_CheckExact(v));
        }
        {
            int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
            if (unlikely(result < 0)) {
                Py_DECREF(v);
                return (cusparseOperation_t) -1;
            }
            is_negative = result == 1;
        }
        if (is_unsigned && unlikely(is_negative)) {
            Py_DECREF(v);
            goto raise_neg_overflow;
        } else if (is_negative) {
            stepval = PyNumber_Invert(v);
            Py_DECREF(v);
            if (unlikely(!stepval))
                return (cusparseOperation_t) -1;
        } else {
            stepval = v;
        }
        v = NULL;
        val = (cusparseOperation_t) 0;
        mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
        shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
        for (bits = 0; bits < (int) sizeof(cusparseOperation_t) * 8 - chunk_size; bits += chunk_size) {
            PyObject *tmp, *digit;
            long idigit;
            digit = PyNumber_And(stepval, mask);
            if (unlikely(!digit)) goto done;
            idigit = PyLong_AsLong(digit);
            Py_DECREF(digit);
            if (unlikely(idigit < 0)) goto done;
            val |= ((cusparseOperation_t) idigit) << bits;
            tmp = PyNumber_Rshift(stepval, shift);
            if (unlikely(!tmp)) goto done;
            Py_DECREF(stepval); stepval = tmp;
        }
        Py_DECREF(shift); shift = NULL;
        Py_DECREF(mask); mask = NULL;
        {
            long idigit = PyLong_AsLong(stepval);
            if (unlikely(idigit < 0)) goto done;
            remaining_bits = ((int) sizeof(cusparseOperation_t) * 8) - bits - (is_unsigned ? 0 : 1);
            if (unlikely(idigit >= (1L << remaining_bits)))
                goto raise_overflow;
            val |= ((cusparseOperation_t) idigit) << bits;
        }
        if (!is_unsigned) {
            if (unlikely(val & (((cusparseOperation_t) 1) << (sizeof(cusparseOperation_t) * 8 - 1))))
                goto raise_overflow;
            if (is_negative)
                val = ~val;
        }
        ret = 0;
    done:
        Py_XDECREF(shift);
        Py_XDECREF(mask);
        Py_XDECREF(stepval);
#endif
        if (unlikely(ret))
            return (cusparseOperation_t) -1;
        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_PyLong_As_cusparseSpMVAlg_t(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const cusparseSpMVAlg_t neg_one = (cusparseSpMVAlg_t) -1, const_zero = (cusparseSpMVAlg_t) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (unlikely(!PyLong_Check(x))) {
        cusparseSpMVAlg_t val;
        PyObject *tmp = __Pyx_PyNumber_Long(x);
        if (!tmp) return (cusparseSpMVAlg_t) -1;
        val = __Pyx_PyLong_As_cusparseSpMVAlg_t(tmp);
        Py_DECREF(tmp);
        return val;
    }
    if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
        if (unlikely(__Pyx_PyLong_IsNeg(x))) {
            goto raise_neg_overflow;
        } else if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(cusparseSpMVAlg_t, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_DigitCount(x)) {
                case 2:
                    if ((8 * sizeof(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 && PY_VERSION_HEX < 0x030C00A7
        if (unlikely(Py_SIZE(x) < 0)) {
            goto raise_neg_overflow;
        }
#else
        {
            int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
            if (unlikely(result < 0))
                return (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))
        } else if ((sizeof(cusparseSpMVAlg_t) <= sizeof(unsigned PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(cusparseSpMVAlg_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
        }
    } else {
#if CYTHON_USE_PYLONG_INTERNALS
        if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(cusparseSpMVAlg_t, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_SignedDigitCount(x)) {
                case -2:
                    if ((8 * sizeof(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))
        } else if ((sizeof(cusparseSpMVAlg_t) <= sizeof(PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(cusparseSpMVAlg_t, PY_LONG_LONG, PyLong_AsLongLong(x))
        }
    }
    {
        cusparseSpMVAlg_t val;
        int ret = -1;
#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
        Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
            x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
        if (unlikely(bytes_copied == -1)) {
        } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
            goto raise_overflow;
        } else {
            ret = 0;
        }
#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
        int one = 1; int is_little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&val;
        ret = _PyLong_AsByteArray((PyLongObject *)x,
                                    bytes, sizeof(val),
                                    is_little, !is_unsigned);
#else
        PyObject *v;
        PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
        int bits, remaining_bits, is_negative = 0;
        int chunk_size = (sizeof(long) < 8) ? 30 : 62;
        if (likely(PyLong_CheckExact(x))) {
            v = __Pyx_NewRef(x);
        } else {
            v = PyNumber_Long(x);
            if (unlikely(!v)) return (cusparseSpMVAlg_t) -1;
            assert(PyLong_CheckExact(v));
        }
        {
            int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
            if (unlikely(result < 0)) {
                Py_DECREF(v);
                return (cusparseSpMVAlg_t) -1;
            }
            is_negative = result == 1;
        }
        if (is_unsigned && unlikely(is_negative)) {
            Py_DECREF(v);
            goto raise_neg_overflow;
        } else if (is_negative) {
            stepval = PyNumber_Invert(v);
            Py_DECREF(v);
            if (unlikely(!stepval))
                return (cusparseSpMVAlg_t) -1;
        } else {
            stepval = v;
        }
        v = NULL;
        val = (cusparseSpMVAlg_t) 0;
        mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
        shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
        for (bits = 0; bits < (int) sizeof(cusparseSpMVAlg_t) * 8 - chunk_size; bits += chunk_size) {
            PyObject *tmp, *digit;
            long idigit;
            digit = PyNumber_And(stepval, mask);
            if (unlikely(!digit)) goto done;
            idigit = PyLong_AsLong(digit);
            Py_DECREF(digit);
            if (unlikely(idigit < 0)) goto done;
            val |= ((cusparseSpMVAlg_t) idigit) << bits;
            tmp = PyNumber_Rshift(stepval, shift);
            if (unlikely(!tmp)) goto done;
            Py_DECREF(stepval); stepval = tmp;
        }
        Py_DECREF(shift); shift = NULL;
        Py_DECREF(mask); mask = NULL;
        {
            long idigit = PyLong_AsLong(stepval);
            if (unlikely(idigit < 0)) goto done;
            remaining_bits = ((int) sizeof(cusparseSpMVAlg_t) * 8) - bits - (is_unsigned ? 0 : 1);
            if (unlikely(idigit >= (1L << remaining_bits)))
                goto raise_overflow;
            val |= ((cusparseSpMVAlg_t) idigit) << bits;
        }
        if (!is_unsigned) {
            if (unlikely(val & (((cusparseSpMVAlg_t) 1) << (sizeof(cusparseSpMVAlg_t) * 8 - 1))))
                goto raise_overflow;
            if (is_negative)
                val = ~val;
        }
        ret = 0;
    done:
        Py_XDECREF(shift);
        Py_XDECREF(mask);
        Py_XDECREF(stepval);
#endif
        if (unlikely(ret))
            return (cusparseSpMVAlg_t) -1;
        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 cusparseSpSMAlg_t __Pyx_PyLong_As_cusparseSpSMAlg_t(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const cusparseSpSMAlg_t neg_one = (cusparseSpSMAlg_t) -1, const_zero = (cusparseSpSMAlg_t) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (unlikely(!PyLong_Check(x))) {
        cusparseSpSMAlg_t val;
        PyObject *tmp = __Pyx_PyNumber_Long(x);
        if (!tmp) return (cusparseSpSMAlg_t) -1;
        val = __Pyx_PyLong_As_cusparseSpSMAlg_t(tmp);
        Py_DECREF(tmp);
        return val;
    }
    if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
        if (unlikely(__Pyx_PyLong_IsNeg(x))) {
            goto raise_neg_overflow;
        } else if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(cusparseSpSMAlg_t, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_DigitCount(x)) {
                case 2:
                    if ((8 * sizeof(cusparseSpSMAlg_t) > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(cusparseSpSMAlg_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(cusparseSpSMAlg_t) >= 2 * PyLong_SHIFT)) {
                            return (cusparseSpSMAlg_t) (((((cusparseSpSMAlg_t)digits[1]) << PyLong_SHIFT) | (cusparseSpSMAlg_t)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if ((8 * sizeof(cusparseSpSMAlg_t) > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(cusparseSpSMAlg_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(cusparseSpSMAlg_t) >= 3 * PyLong_SHIFT)) {
                            return (cusparseSpSMAlg_t) (((((((cusparseSpSMAlg_t)digits[2]) << PyLong_SHIFT) | (cusparseSpSMAlg_t)digits[1]) << PyLong_SHIFT) | (cusparseSpSMAlg_t)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if ((8 * sizeof(cusparseSpSMAlg_t) > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(cusparseSpSMAlg_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(cusparseSpSMAlg_t) >= 4 * PyLong_SHIFT)) {
                            return (cusparseSpSMAlg_t) (((((((((cusparseSpSMAlg_t)digits[3]) << PyLong_SHIFT) | (cusparseSpSMAlg_t)digits[2]) << PyLong_SHIFT) | (cusparseSpSMAlg_t)digits[1]) << PyLong_SHIFT) | (cusparseSpSMAlg_t)digits[0]));
                        }
                    }
                    break;
            }
        }
#endif
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
        if (unlikely(Py_SIZE(x) < 0)) {
            goto raise_neg_overflow;
        }
#else
        {
            int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
            if (unlikely(result < 0))
                return (cusparseSpSMAlg_t) -1;
            if (unlikely(result == 1))
                goto raise_neg_overflow;
        }
#endif
        if ((sizeof(cusparseSpSMAlg_t) <= sizeof(unsigned long))) {
            __PYX_VERIFY_RETURN_INT_EXC(cusparseSpSMAlg_t, unsigned long, PyLong_AsUnsignedLong(x))
        } else if ((sizeof(cusparseSpSMAlg_t) <= sizeof(unsigned PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(cusparseSpSMAlg_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
        }
    } else {
#if CYTHON_USE_PYLONG_INTERNALS
        if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(cusparseSpSMAlg_t, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_SignedDigitCount(x)) {
                case -2:
                    if ((8 * sizeof(cusparseSpSMAlg_t) - 1 > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(cusparseSpSMAlg_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(cusparseSpSMAlg_t) - 1 > 2 * PyLong_SHIFT)) {
                            return (cusparseSpSMAlg_t) (((cusparseSpSMAlg_t)-1)*(((((cusparseSpSMAlg_t)digits[1]) << PyLong_SHIFT) | (cusparseSpSMAlg_t)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if ((8 * sizeof(cusparseSpSMAlg_t) > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(cusparseSpSMAlg_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(cusparseSpSMAlg_t) - 1 > 2 * PyLong_SHIFT)) {
                            return (cusparseSpSMAlg_t) ((((((cusparseSpSMAlg_t)digits[1]) << PyLong_SHIFT) | (cusparseSpSMAlg_t)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if ((8 * sizeof(cusparseSpSMAlg_t) - 1 > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(cusparseSpSMAlg_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(cusparseSpSMAlg_t) - 1 > 3 * PyLong_SHIFT)) {
                            return (cusparseSpSMAlg_t) (((cusparseSpSMAlg_t)-1)*(((((((cusparseSpSMAlg_t)digits[2]) << PyLong_SHIFT) | (cusparseSpSMAlg_t)digits[1]) << PyLong_SHIFT) | (cusparseSpSMAlg_t)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if ((8 * sizeof(cusparseSpSMAlg_t) > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(cusparseSpSMAlg_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(cusparseSpSMAlg_t) - 1 > 3 * PyLong_SHIFT)) {
                            return (cusparseSpSMAlg_t) ((((((((cusparseSpSMAlg_t)digits[2]) << PyLong_SHIFT) | (cusparseSpSMAlg_t)digits[1]) << PyLong_SHIFT) | (cusparseSpSMAlg_t)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if ((8 * sizeof(cusparseSpSMAlg_t) - 1 > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(cusparseSpSMAlg_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(cusparseSpSMAlg_t) - 1 > 4 * PyLong_SHIFT)) {
                            return (cusparseSpSMAlg_t) (((cusparseSpSMAlg_t)-1)*(((((((((cusparseSpSMAlg_t)digits[3]) << PyLong_SHIFT) | (cusparseSpSMAlg_t)digits[2]) << PyLong_SHIFT) | (cusparseSpSMAlg_t)digits[1]) << PyLong_SHIFT) | (cusparseSpSMAlg_t)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if ((8 * sizeof(cusparseSpSMAlg_t) > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(cusparseSpSMAlg_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(cusparseSpSMAlg_t) - 1 > 4 * PyLong_SHIFT)) {
                            return (cusparseSpSMAlg_t) ((((((((((cusparseSpSMAlg_t)digits[3]) << PyLong_SHIFT) | (cusparseSpSMAlg_t)digits[2]) << PyLong_SHIFT) | (cusparseSpSMAlg_t)digits[1]) << PyLong_SHIFT) | (cusparseSpSMAlg_t)digits[0])));
                        }
                    }
                    break;
            }
        }
#endif
        if ((sizeof(cusparseSpSMAlg_t) <= sizeof(long))) {
            __PYX_VERIFY_RETURN_INT_EXC(cusparseSpSMAlg_t, long, PyLong_AsLong(x))
        } else if ((sizeof(cusparseSpSMAlg_t) <= sizeof(PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(cusparseSpSMAlg_t, PY_LONG_LONG, PyLong_AsLongLong(x))
        }
    }
    {
        cusparseSpSMAlg_t val;
        int ret = -1;
#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
        Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
            x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
        if (unlikely(bytes_copied == -1)) {
        } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
            goto raise_overflow;
        } else {
            ret = 0;
        }
#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
        int one = 1; int is_little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&val;
        ret = _PyLong_AsByteArray((PyLongObject *)x,
                                    bytes, sizeof(val),
                                    is_little, !is_unsigned);
#else
        PyObject *v;
        PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
        int bits, remaining_bits, is_negative = 0;
        int chunk_size = (sizeof(long) < 8) ? 30 : 62;
        if (likely(PyLong_CheckExact(x))) {
            v = __Pyx_NewRef(x);
        } else {
            v = PyNumber_Long(x);
            if (unlikely(!v)) return (cusparseSpSMAlg_t) -1;
            assert(PyLong_CheckExact(v));
        }
        {
            int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
            if (unlikely(result < 0)) {
                Py_DECREF(v);
                return (cusparseSpSMAlg_t) -1;
            }
            is_negative = result == 1;
        }
        if (is_unsigned && unlikely(is_negative)) {
            Py_DECREF(v);
            goto raise_neg_overflow;
        } else if (is_negative) {
            stepval = PyNumber_Invert(v);
            Py_DECREF(v);
            if (unlikely(!stepval))
                return (cusparseSpSMAlg_t) -1;
        } else {
            stepval = v;
        }
        v = NULL;
        val = (cusparseSpSMAlg_t) 0;
        mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
        shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
        for (bits = 0; bits < (int) sizeof(cusparseSpSMAlg_t) * 8 - chunk_size; bits += chunk_size) {
            PyObject *tmp, *digit;
            long idigit;
            digit = PyNumber_And(stepval, mask);
            if (unlikely(!digit)) goto done;
            idigit = PyLong_AsLong(digit);
            Py_DECREF(digit);
            if (unlikely(idigit < 0)) goto done;
            val |= ((cusparseSpSMAlg_t) idigit) << bits;
            tmp = PyNumber_Rshift(stepval, shift);
            if (unlikely(!tmp)) goto done;
            Py_DECREF(stepval); stepval = tmp;
        }
        Py_DECREF(shift); shift = NULL;
        Py_DECREF(mask); mask = NULL;
        {
            long idigit = PyLong_AsLong(stepval);
            if (unlikely(idigit < 0)) goto done;
            remaining_bits = ((int) sizeof(cusparseSpSMAlg_t) * 8) - bits - (is_unsigned ? 0 : 1);
            if (unlikely(idigit >= (1L << remaining_bits)))
                goto raise_overflow;
            val |= ((cusparseSpSMAlg_t) idigit) << bits;
        }
        if (!is_unsigned) {
            if (unlikely(val & (((cusparseSpSMAlg_t) 1) << (sizeof(cusparseSpSMAlg_t) * 8 - 1))))
                goto raise_overflow;
            if (is_negative)
                val = ~val;
        }
        ret = 0;
    done:
        Py_XDECREF(shift);
        Py_XDECREF(mask);
        Py_XDECREF(stepval);
#endif
        if (unlikely(ret))
            return (cusparseSpSMAlg_t) -1;
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to cusparseSpSMAlg_t");
    return (cusparseSpSMAlg_t) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to cusparseSpSMAlg_t");
    return (cusparseSpSMAlg_t) -1;
}

/* CIntFromPy */
static CYTHON_INLINE cusparseSpMMAlg_t __Pyx_PyLong_As_cusparseSpMMAlg_t(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const cusparseSpMMAlg_t neg_one = (cusparseSpMMAlg_t) -1, const_zero = (cusparseSpMMAlg_t) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (unlikely(!PyLong_Check(x))) {
        cusparseSpMMAlg_t val;
        PyObject *tmp = __Pyx_PyNumber_Long(x);
        if (!tmp) return (cusparseSpMMAlg_t) -1;
        val = __Pyx_PyLong_As_cusparseSpMMAlg_t(tmp);
        Py_DECREF(tmp);
        return val;
    }
    if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
        if (unlikely(__Pyx_PyLong_IsNeg(x))) {
            goto raise_neg_overflow;
        } else if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(cusparseSpMMAlg_t, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_DigitCount(x)) {
                case 2:
                    if ((8 * sizeof(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 && PY_VERSION_HEX < 0x030C00A7
        if (unlikely(Py_SIZE(x) < 0)) {
            goto raise_neg_overflow;
        }
#else
        {
            int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
            if (unlikely(result < 0))
                return (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))
        } else if ((sizeof(cusparseSpMMAlg_t) <= sizeof(unsigned PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(cusparseSpMMAlg_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
        }
    } else {
#if CYTHON_USE_PYLONG_INTERNALS
        if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(cusparseSpMMAlg_t, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_SignedDigitCount(x)) {
                case -2:
                    if ((8 * sizeof(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))
        } else if ((sizeof(cusparseSpMMAlg_t) <= sizeof(PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(cusparseSpMMAlg_t, PY_LONG_LONG, PyLong_AsLongLong(x))
        }
    }
    {
        cusparseSpMMAlg_t val;
        int ret = -1;
#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
        Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
            x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
        if (unlikely(bytes_copied == -1)) {
        } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
            goto raise_overflow;
        } else {
            ret = 0;
        }
#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
        int one = 1; int is_little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&val;
        ret = _PyLong_AsByteArray((PyLongObject *)x,
                                    bytes, sizeof(val),
                                    is_little, !is_unsigned);
#else
        PyObject *v;
        PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
        int bits, remaining_bits, is_negative = 0;
        int chunk_size = (sizeof(long) < 8) ? 30 : 62;
        if (likely(PyLong_CheckExact(x))) {
            v = __Pyx_NewRef(x);
        } else {
            v = PyNumber_Long(x);
            if (unlikely(!v)) return (cusparseSpMMAlg_t) -1;
            assert(PyLong_CheckExact(v));
        }
        {
            int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
            if (unlikely(result < 0)) {
                Py_DECREF(v);
                return (cusparseSpMMAlg_t) -1;
            }
            is_negative = result == 1;
        }
        if (is_unsigned && unlikely(is_negative)) {
            Py_DECREF(v);
            goto raise_neg_overflow;
        } else if (is_negative) {
            stepval = PyNumber_Invert(v);
            Py_DECREF(v);
            if (unlikely(!stepval))
                return (cusparseSpMMAlg_t) -1;
        } else {
            stepval = v;
        }
        v = NULL;
        val = (cusparseSpMMAlg_t) 0;
        mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
        shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
        for (bits = 0; bits < (int) sizeof(cusparseSpMMAlg_t) * 8 - chunk_size; bits += chunk_size) {
            PyObject *tmp, *digit;
            long idigit;
            digit = PyNumber_And(stepval, mask);
            if (unlikely(!digit)) goto done;
            idigit = PyLong_AsLong(digit);
            Py_DECREF(digit);
            if (unlikely(idigit < 0)) goto done;
            val |= ((cusparseSpMMAlg_t) idigit) << bits;
            tmp = PyNumber_Rshift(stepval, shift);
            if (unlikely(!tmp)) goto done;
            Py_DECREF(stepval); stepval = tmp;
        }
        Py_DECREF(shift); shift = NULL;
        Py_DECREF(mask); mask = NULL;
        {
            long idigit = PyLong_AsLong(stepval);
            if (unlikely(idigit < 0)) goto done;
            remaining_bits = ((int) sizeof(cusparseSpMMAlg_t) * 8) - bits - (is_unsigned ? 0 : 1);
            if (unlikely(idigit >= (1L << remaining_bits)))
                goto raise_overflow;
            val |= ((cusparseSpMMAlg_t) idigit) << bits;
        }
        if (!is_unsigned) {
            if (unlikely(val & (((cusparseSpMMAlg_t) 1) << (sizeof(cusparseSpMMAlg_t) * 8 - 1))))
                goto raise_overflow;
            if (is_negative)
                val = ~val;
        }
        ret = 0;
    done:
        Py_XDECREF(shift);
        Py_XDECREF(mask);
        Py_XDECREF(stepval);
#endif
        if (unlikely(ret))
            return (cusparseSpMMAlg_t) -1;
        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_PyLong_As_cusparseAction_t(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const cusparseAction_t neg_one = (cusparseAction_t) -1, const_zero = (cusparseAction_t) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (unlikely(!PyLong_Check(x))) {
        cusparseAction_t val;
        PyObject *tmp = __Pyx_PyNumber_Long(x);
        if (!tmp) return (cusparseAction_t) -1;
        val = __Pyx_PyLong_As_cusparseAction_t(tmp);
        Py_DECREF(tmp);
        return val;
    }
    if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
        if (unlikely(__Pyx_PyLong_IsNeg(x))) {
            goto raise_neg_overflow;
        } else if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(cusparseAction_t, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_DigitCount(x)) {
                case 2:
                    if ((8 * sizeof(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 && PY_VERSION_HEX < 0x030C00A7
        if (unlikely(Py_SIZE(x) < 0)) {
            goto raise_neg_overflow;
        }
#else
        {
            int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
            if (unlikely(result < 0))
                return (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))
        } else if ((sizeof(cusparseAction_t) <= sizeof(unsigned PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(cusparseAction_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
        }
    } else {
#if CYTHON_USE_PYLONG_INTERNALS
        if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(cusparseAction_t, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_SignedDigitCount(x)) {
                case -2:
                    if ((8 * sizeof(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))
        } else if ((sizeof(cusparseAction_t) <= sizeof(PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(cusparseAction_t, PY_LONG_LONG, PyLong_AsLongLong(x))
        }
    }
    {
        cusparseAction_t val;
        int ret = -1;
#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
        Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
            x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
        if (unlikely(bytes_copied == -1)) {
        } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
            goto raise_overflow;
        } else {
            ret = 0;
        }
#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
        int one = 1; int is_little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&val;
        ret = _PyLong_AsByteArray((PyLongObject *)x,
                                    bytes, sizeof(val),
                                    is_little, !is_unsigned);
#else
        PyObject *v;
        PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
        int bits, remaining_bits, is_negative = 0;
        int chunk_size = (sizeof(long) < 8) ? 30 : 62;
        if (likely(PyLong_CheckExact(x))) {
            v = __Pyx_NewRef(x);
        } else {
            v = PyNumber_Long(x);
            if (unlikely(!v)) return (cusparseAction_t) -1;
            assert(PyLong_CheckExact(v));
        }
        {
            int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
            if (unlikely(result < 0)) {
                Py_DECREF(v);
                return (cusparseAction_t) -1;
            }
            is_negative = result == 1;
        }
        if (is_unsigned && unlikely(is_negative)) {
            Py_DECREF(v);
            goto raise_neg_overflow;
        } else if (is_negative) {
            stepval = PyNumber_Invert(v);
            Py_DECREF(v);
            if (unlikely(!stepval))
                return (cusparseAction_t) -1;
        } else {
            stepval = v;
        }
        v = NULL;
        val = (cusparseAction_t) 0;
        mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
        shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
        for (bits = 0; bits < (int) sizeof(cusparseAction_t) * 8 - chunk_size; bits += chunk_size) {
            PyObject *tmp, *digit;
            long idigit;
            digit = PyNumber_And(stepval, mask);
            if (unlikely(!digit)) goto done;
            idigit = PyLong_AsLong(digit);
            Py_DECREF(digit);
            if (unlikely(idigit < 0)) goto done;
            val |= ((cusparseAction_t) idigit) << bits;
            tmp = PyNumber_Rshift(stepval, shift);
            if (unlikely(!tmp)) goto done;
            Py_DECREF(stepval); stepval = tmp;
        }
        Py_DECREF(shift); shift = NULL;
        Py_DECREF(mask); mask = NULL;
        {
            long idigit = PyLong_AsLong(stepval);
            if (unlikely(idigit < 0)) goto done;
            remaining_bits = ((int) sizeof(cusparseAction_t) * 8) - bits - (is_unsigned ? 0 : 1);
            if (unlikely(idigit >= (1L << remaining_bits)))
                goto raise_overflow;
            val |= ((cusparseAction_t) idigit) << bits;
        }
        if (!is_unsigned) {
            if (unlikely(val & (((cusparseAction_t) 1) << (sizeof(cusparseAction_t) * 8 - 1))))
                goto raise_overflow;
            if (is_negative)
                val = ~val;
        }
        ret = 0;
    done:
        Py_XDECREF(shift);
        Py_XDECREF(mask);
        Py_XDECREF(stepval);
#endif
        if (unlikely(ret))
            return (cusparseAction_t) -1;
        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_PyLong_As_cusparseCsr2CscAlg_t(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const cusparseCsr2CscAlg_t neg_one = (cusparseCsr2CscAlg_t) -1, const_zero = (cusparseCsr2CscAlg_t) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (unlikely(!PyLong_Check(x))) {
        cusparseCsr2CscAlg_t val;
        PyObject *tmp = __Pyx_PyNumber_Long(x);
        if (!tmp) return (cusparseCsr2CscAlg_t) -1;
        val = __Pyx_PyLong_As_cusparseCsr2CscAlg_t(tmp);
        Py_DECREF(tmp);
        return val;
    }
    if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
        if (unlikely(__Pyx_PyLong_IsNeg(x))) {
            goto raise_neg_overflow;
        } else if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(cusparseCsr2CscAlg_t, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_DigitCount(x)) {
                case 2:
                    if ((8 * sizeof(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 && PY_VERSION_HEX < 0x030C00A7
        if (unlikely(Py_SIZE(x) < 0)) {
            goto raise_neg_overflow;
        }
#else
        {
            int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
            if (unlikely(result < 0))
                return (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))
        } else if ((sizeof(cusparseCsr2CscAlg_t) <= sizeof(unsigned PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(cusparseCsr2CscAlg_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
        }
    } else {
#if CYTHON_USE_PYLONG_INTERNALS
        if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(cusparseCsr2CscAlg_t, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_SignedDigitCount(x)) {
                case -2:
                    if ((8 * sizeof(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))
        } else if ((sizeof(cusparseCsr2CscAlg_t) <= sizeof(PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(cusparseCsr2CscAlg_t, PY_LONG_LONG, PyLong_AsLongLong(x))
        }
    }
    {
        cusparseCsr2CscAlg_t val;
        int ret = -1;
#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
        Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
            x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
        if (unlikely(bytes_copied == -1)) {
        } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
            goto raise_overflow;
        } else {
            ret = 0;
        }
#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
        int one = 1; int is_little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&val;
        ret = _PyLong_AsByteArray((PyLongObject *)x,
                                    bytes, sizeof(val),
                                    is_little, !is_unsigned);
#else
        PyObject *v;
        PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
        int bits, remaining_bits, is_negative = 0;
        int chunk_size = (sizeof(long) < 8) ? 30 : 62;
        if (likely(PyLong_CheckExact(x))) {
            v = __Pyx_NewRef(x);
        } else {
            v = PyNumber_Long(x);
            if (unlikely(!v)) return (cusparseCsr2CscAlg_t) -1;
            assert(PyLong_CheckExact(v));
        }
        {
            int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
            if (unlikely(result < 0)) {
                Py_DECREF(v);
                return (cusparseCsr2CscAlg_t) -1;
            }
            is_negative = result == 1;
        }
        if (is_unsigned && unlikely(is_negative)) {
            Py_DECREF(v);
            goto raise_neg_overflow;
        } else if (is_negative) {
            stepval = PyNumber_Invert(v);
            Py_DECREF(v);
            if (unlikely(!stepval))
                return (cusparseCsr2CscAlg_t) -1;
        } else {
            stepval = v;
        }
        v = NULL;
        val = (cusparseCsr2CscAlg_t) 0;
        mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
        shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
        for (bits = 0; bits < (int) sizeof(cusparseCsr2CscAlg_t) * 8 - chunk_size; bits += chunk_size) {
            PyObject *tmp, *digit;
            long idigit;
            digit = PyNumber_And(stepval, mask);
            if (unlikely(!digit)) goto done;
            idigit = PyLong_AsLong(digit);
            Py_DECREF(digit);
            if (unlikely(idigit < 0)) goto done;
            val |= ((cusparseCsr2CscAlg_t) idigit) << bits;
            tmp = PyNumber_Rshift(stepval, shift);
            if (unlikely(!tmp)) goto done;
            Py_DECREF(stepval); stepval = tmp;
        }
        Py_DECREF(shift); shift = NULL;
        Py_DECREF(mask); mask = NULL;
        {
            long idigit = PyLong_AsLong(stepval);
            if (unlikely(idigit < 0)) goto done;
            remaining_bits = ((int) sizeof(cusparseCsr2CscAlg_t) * 8) - bits - (is_unsigned ? 0 : 1);
            if (unlikely(idigit >= (1L << remaining_bits)))
                goto raise_overflow;
            val |= ((cusparseCsr2CscAlg_t) idigit) << bits;
        }
        if (!is_unsigned) {
            if (unlikely(val & (((cusparseCsr2CscAlg_t) 1) << (sizeof(cusparseCsr2CscAlg_t) * 8 - 1))))
                goto raise_overflow;
            if (is_negative)
                val = ~val;
        }
        ret = 0;
    done:
        Py_XDECREF(shift);
        Py_XDECREF(mask);
        Py_XDECREF(stepval);
#endif
        if (unlikely(ret))
            return (cusparseCsr2CscAlg_t) -1;
        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_PyLong_As_long(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const long neg_one = (long) -1, const_zero = (long) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (unlikely(!PyLong_Check(x))) {
        long val;
        PyObject *tmp = __Pyx_PyNumber_Long(x);
        if (!tmp) return (long) -1;
        val = __Pyx_PyLong_As_long(tmp);
        Py_DECREF(tmp);
        return val;
    }
    if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
        if (unlikely(__Pyx_PyLong_IsNeg(x))) {
            goto raise_neg_overflow;
        } else if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_DigitCount(x)) {
                case 2:
                    if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(long) >= 2 * PyLong_SHIFT)) {
                            return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(long) >= 3 * PyLong_SHIFT)) {
                            return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(long) >= 4 * PyLong_SHIFT)) {
                            return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                        }
                    }
                    break;
            }
        }
#endif
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
        if (unlikely(Py_SIZE(x) < 0)) {
            goto raise_neg_overflow;
        }
#else
        {
            int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
            if (unlikely(result < 0))
                return (long) -1;
            if (unlikely(result == 1))
                goto raise_neg_overflow;
        }
#endif
        if ((sizeof(long) <= sizeof(unsigned long))) {
            __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
        } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
        }
    } else {
#if CYTHON_USE_PYLONG_INTERNALS
        if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_SignedDigitCount(x)) {
                case -2:
                    if ((8 * sizeof(long) - 1 > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) {
                            return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) {
                            return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) {
                            return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) {
                            return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) {
                            return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) {
                            return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
            }
        }
#endif
        if ((sizeof(long) <= sizeof(long))) {
            __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
        } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
        }
    }
    {
        long val;
        int ret = -1;
#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
        Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
            x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
        if (unlikely(bytes_copied == -1)) {
        } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
            goto raise_overflow;
        } else {
            ret = 0;
        }
#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
        int one = 1; int is_little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&val;
        ret = _PyLong_AsByteArray((PyLongObject *)x,
                                    bytes, sizeof(val),
                                    is_little, !is_unsigned);
#else
        PyObject *v;
        PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
        int bits, remaining_bits, is_negative = 0;
        int chunk_size = (sizeof(long) < 8) ? 30 : 62;
        if (likely(PyLong_CheckExact(x))) {
            v = __Pyx_NewRef(x);
        } else {
            v = PyNumber_Long(x);
            if (unlikely(!v)) return (long) -1;
            assert(PyLong_CheckExact(v));
        }
        {
            int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
            if (unlikely(result < 0)) {
                Py_DECREF(v);
                return (long) -1;
            }
            is_negative = result == 1;
        }
        if (is_unsigned && unlikely(is_negative)) {
            Py_DECREF(v);
            goto raise_neg_overflow;
        } else if (is_negative) {
            stepval = PyNumber_Invert(v);
            Py_DECREF(v);
            if (unlikely(!stepval))
                return (long) -1;
        } else {
            stepval = v;
        }
        v = NULL;
        val = (long) 0;
        mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
        shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
        for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) {
            PyObject *tmp, *digit;
            long idigit;
            digit = PyNumber_And(stepval, mask);
            if (unlikely(!digit)) goto done;
            idigit = PyLong_AsLong(digit);
            Py_DECREF(digit);
            if (unlikely(idigit < 0)) goto done;
            val |= ((long) idigit) << bits;
            tmp = PyNumber_Rshift(stepval, shift);
            if (unlikely(!tmp)) goto done;
            Py_DECREF(stepval); stepval = tmp;
        }
        Py_DECREF(shift); shift = NULL;
        Py_DECREF(mask); mask = NULL;
        {
            long idigit = PyLong_AsLong(stepval);
            if (unlikely(idigit < 0)) goto done;
            remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1);
            if (unlikely(idigit >= (1L << remaining_bits)))
                goto raise_overflow;
            val |= ((long) idigit) << bits;
        }
        if (!is_unsigned) {
            if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1))))
                goto raise_overflow;
            if (is_negative)
                val = ~val;
        }
        ret = 0;
    done:
        Py_XDECREF(shift);
        Py_XDECREF(mask);
        Py_XDECREF(stepval);
#endif
        if (unlikely(ret))
            return (long) -1;
        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;
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_cusparseStatus_t(cusparseStatus_t value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const cusparseStatus_t neg_one = (cusparseStatus_t) -1, const_zero = (cusparseStatus_t) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(cusparseStatus_t) < sizeof(long)) {
            return PyLong_FromLong((long) value);
        } else if (sizeof(cusparseStatus_t) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#if !CYTHON_COMPILING_IN_PYPY
        } else if (sizeof(cusparseStatus_t) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(cusparseStatus_t) <= sizeof(long)) {
            return PyLong_FromLong((long) value);
        } else if (sizeof(cusparseStatus_t) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
        }
    }
    {
        unsigned char *bytes = (unsigned char *)&value;
#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
        if (is_unsigned) {
            return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
        } else {
            return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
        }
#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
        int one = 1; int little = (int)*(unsigned char *)&one;
        return _PyLong_FromByteArray(bytes, sizeof(cusparseStatus_t),
                                     little, !is_unsigned);
#else
        int one = 1; int little = (int)*(unsigned char *)&one;
        PyObject *from_bytes, *result = NULL, *kwds = NULL;
        PyObject *py_bytes = NULL, *order_str = NULL;
        from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
        if (!from_bytes) return NULL;
        py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(cusparseStatus_t));
        if (!py_bytes) goto limited_bad;
        order_str = PyUnicode_FromString(little ? "little" : "big");
        if (!order_str) goto limited_bad;
        {
            PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
            if (!is_unsigned) {
                kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                if (!kwds) goto limited_bad;
                if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
            }
            result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
        }
        limited_bad:
        Py_XDECREF(kwds);
        Py_XDECREF(order_str);
        Py_XDECREF(py_bytes);
        Py_XDECREF(from_bytes);
        return result;
#endif
    }
}

/* CIntFromPy */
static CYTHON_INLINE cusparseMatrixType_t __Pyx_PyLong_As_cusparseMatrixType_t(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const cusparseMatrixType_t neg_one = (cusparseMatrixType_t) -1, const_zero = (cusparseMatrixType_t) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (unlikely(!PyLong_Check(x))) {
        cusparseMatrixType_t val;
        PyObject *tmp = __Pyx_PyNumber_Long(x);
        if (!tmp) return (cusparseMatrixType_t) -1;
        val = __Pyx_PyLong_As_cusparseMatrixType_t(tmp);
        Py_DECREF(tmp);
        return val;
    }
    if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
        if (unlikely(__Pyx_PyLong_IsNeg(x))) {
            goto raise_neg_overflow;
        } else if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(cusparseMatrixType_t, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_DigitCount(x)) {
                case 2:
                    if ((8 * sizeof(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 && PY_VERSION_HEX < 0x030C00A7
        if (unlikely(Py_SIZE(x) < 0)) {
            goto raise_neg_overflow;
        }
#else
        {
            int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
            if (unlikely(result < 0))
                return (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))
        } else if ((sizeof(cusparseMatrixType_t) <= sizeof(unsigned PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(cusparseMatrixType_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
        }
    } else {
#if CYTHON_USE_PYLONG_INTERNALS
        if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(cusparseMatrixType_t, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_SignedDigitCount(x)) {
                case -2:
                    if ((8 * sizeof(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))
        } else if ((sizeof(cusparseMatrixType_t) <= sizeof(PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(cusparseMatrixType_t, PY_LONG_LONG, PyLong_AsLongLong(x))
        }
    }
    {
        cusparseMatrixType_t val;
        int ret = -1;
#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
        Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
            x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
        if (unlikely(bytes_copied == -1)) {
        } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
            goto raise_overflow;
        } else {
            ret = 0;
        }
#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
        int one = 1; int is_little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&val;
        ret = _PyLong_AsByteArray((PyLongObject *)x,
                                    bytes, sizeof(val),
                                    is_little, !is_unsigned);
#else
        PyObject *v;
        PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
        int bits, remaining_bits, is_negative = 0;
        int chunk_size = (sizeof(long) < 8) ? 30 : 62;
        if (likely(PyLong_CheckExact(x))) {
            v = __Pyx_NewRef(x);
        } else {
            v = PyNumber_Long(x);
            if (unlikely(!v)) return (cusparseMatrixType_t) -1;
            assert(PyLong_CheckExact(v));
        }
        {
            int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
            if (unlikely(result < 0)) {
                Py_DECREF(v);
                return (cusparseMatrixType_t) -1;
            }
            is_negative = result == 1;
        }
        if (is_unsigned && unlikely(is_negative)) {
            Py_DECREF(v);
            goto raise_neg_overflow;
        } else if (is_negative) {
            stepval = PyNumber_Invert(v);
            Py_DECREF(v);
            if (unlikely(!stepval))
                return (cusparseMatrixType_t) -1;
        } else {
            stepval = v;
        }
        v = NULL;
        val = (cusparseMatrixType_t) 0;
        mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
        shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
        for (bits = 0; bits < (int) sizeof(cusparseMatrixType_t) * 8 - chunk_size; bits += chunk_size) {
            PyObject *tmp, *digit;
            long idigit;
            digit = PyNumber_And(stepval, mask);
            if (unlikely(!digit)) goto done;
            idigit = PyLong_AsLong(digit);
            Py_DECREF(digit);
            if (unlikely(idigit < 0)) goto done;
            val |= ((cusparseMatrixType_t) idigit) << bits;
            tmp = PyNumber_Rshift(stepval, shift);
            if (unlikely(!tmp)) goto done;
            Py_DECREF(stepval); stepval = tmp;
        }
        Py_DECREF(shift); shift = NULL;
        Py_DECREF(mask); mask = NULL;
        {
            long idigit = PyLong_AsLong(stepval);
            if (unlikely(idigit < 0)) goto done;
            remaining_bits = ((int) sizeof(cusparseMatrixType_t) * 8) - bits - (is_unsigned ? 0 : 1);
            if (unlikely(idigit >= (1L << remaining_bits)))
                goto raise_overflow;
            val |= ((cusparseMatrixType_t) idigit) << bits;
        }
        if (!is_unsigned) {
            if (unlikely(val & (((cusparseMatrixType_t) 1) << (sizeof(cusparseMatrixType_t) * 8 - 1))))
                goto raise_overflow;
            if (is_negative)
                val = ~val;
        }
        ret = 0;
    done:
        Py_XDECREF(shift);
        Py_XDECREF(mask);
        Py_XDECREF(stepval);
#endif
        if (unlikely(ret))
            return (cusparseMatrixType_t) -1;
        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;
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_long(long value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const long neg_one = (long) -1, const_zero = (long) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(long) < sizeof(long)) {
            return PyLong_FromLong((long) value);
        } else if (sizeof(long) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#if !CYTHON_COMPILING_IN_PYPY
        } 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 PyLong_FromLong((long) value);
        } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
        }
    }
    {
        unsigned char *bytes = (unsigned char *)&value;
#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
        if (is_unsigned) {
            return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
        } else {
            return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
        }
#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
        int one = 1; int little = (int)*(unsigned char *)&one;
        return _PyLong_FromByteArray(bytes, sizeof(long),
                                     little, !is_unsigned);
#else
        int one = 1; int little = (int)*(unsigned char *)&one;
        PyObject *from_bytes, *result = NULL, *kwds = NULL;
        PyObject *py_bytes = NULL, *order_str = NULL;
        from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
        if (!from_bytes) return NULL;
        py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long));
        if (!py_bytes) goto limited_bad;
        order_str = PyUnicode_FromString(little ? "little" : "big");
        if (!order_str) goto limited_bad;
        {
            PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
            if (!is_unsigned) {
                kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                if (!kwds) goto limited_bad;
                if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
            }
            result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
        }
        limited_bad:
        Py_XDECREF(kwds);
        Py_XDECREF(order_str);
        Py_XDECREF(py_bytes);
        Py_XDECREF(from_bytes);
        return result;
#endif
    }
}

/* PyObjectCallMethod1 */
#if !(CYTHON_VECTORCALL && (__PYX_LIMITED_VERSION_HEX >= 0x030C0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x03090000)))
static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) {
    PyObject *result = __Pyx_PyObject_CallOneArg(method, arg);
    Py_DECREF(method);
    return result;
}
#endif
static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) {
#if CYTHON_VECTORCALL && (__PYX_LIMITED_VERSION_HEX >= 0x030C0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x03090000))
    PyObject *args[2] = {obj, arg};
    (void) __Pyx_PyObject_CallOneArg;
    (void) __Pyx_PyObject_Call2Args;
    return PyObject_VectorcallMethod(method_name, args, 2 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL);
#else
    PyObject *method = NULL, *result;
    int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method);
    if (likely(is_method)) {
        result = __Pyx_PyObject_Call2Args(method, obj, arg);
        Py_DECREF(method);
        return result;
    }
    if (unlikely(!method)) return NULL;
    return __Pyx__PyObject_CallMethod1(method, arg);
#endif
}

/* UpdateUnpickledDict */
static int __Pyx__UpdateUnpickledDict(PyObject *obj, PyObject *state, Py_ssize_t index) {
    PyObject *state_dict = __Pyx_PySequence_ITEM(state, index);
    if (unlikely(!state_dict)) {
        return -1;
    }
    int non_empty = PyObject_IsTrue(state_dict);
    if (non_empty == 0) {
        Py_DECREF(state_dict);
        return 0;
    } else if (unlikely(non_empty == -1)) {
        return -1;
    }
    PyObject *dict;
    #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
    dict = PyObject_GetAttrString(obj, "__dict__");
    #else
    dict = PyObject_GenericGetDict(obj, NULL);
    #endif
    if (unlikely(!dict)) {
        Py_DECREF(state_dict);
        return -1;
    }
    int result;
    if (likely(PyDict_CheckExact(dict))) {
        result = PyDict_Update(dict, state_dict);
    } else {
        PyObject *obj_result = __Pyx_PyObject_CallMethod1(dict, __pyx_mstate_global->__pyx_n_u_update, state_dict);
        if (likely(obj_result)) {
            Py_DECREF(obj_result);
            result = 0;
        } else {
            result = -1;
        }
    }
    Py_DECREF(state_dict);
    Py_DECREF(dict);
    return result;
}
static int __Pyx_UpdateUnpickledDict(PyObject *obj, PyObject *state, Py_ssize_t index) {
    Py_ssize_t state_size = __Pyx_PyTuple_GET_SIZE(state);
    #if !CYTHON_ASSUME_SAFE_SIZE
    if (unlikely(state_size == -1)) return -1;
    #endif
    if (state_size <= index) {
        return 0;
    }
    return __Pyx__UpdateUnpickledDict(obj, state, index);
}

/* FormatTypeName */
#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
static __Pyx_TypeName
__Pyx_PyType_GetFullyQualifiedName(PyTypeObject* tp)
{
    PyObject *module = NULL, *name = NULL, *result = NULL;
    #if __PYX_LIMITED_VERSION_HEX < 0x030b0000
    name = __Pyx_PyObject_GetAttrStr((PyObject *)tp,
                                               __pyx_mstate_global->__pyx_n_u_qualname);
    #else
    name = PyType_GetQualName(tp);
    #endif
    if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) goto bad;
    module = __Pyx_PyObject_GetAttrStr((PyObject *)tp,
                                               __pyx_mstate_global->__pyx_n_u_module);
    if (unlikely(module == NULL) || unlikely(!PyUnicode_Check(module))) goto bad;
    if (PyUnicode_CompareWithASCIIString(module, "builtins") == 0) {
        result = name;
        name = NULL;
        goto done;
    }
    result = PyUnicode_FromFormat("%U.%U", module, name);
    if (unlikely(result == NULL)) goto bad;
  done:
    Py_XDECREF(name);
    Py_XDECREF(module);
    return result;
  bad:
    PyErr_Clear();
    if (name) {
        result = name;
        name = NULL;
    } else {
        result = __Pyx_NewRef(__pyx_mstate_global->__pyx_kp_u__3);
    }
    goto done;
}
#endif

/* FastTypeChecks */
#if CYTHON_COMPILING_IN_CPYTHON
static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
    while (a) {
        a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*);
        if (a == b)
            return 1;
    }
    return b == &PyBaseObject_Type;
}
static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
    PyObject *mro;
    if (a == b) return 1;
    mro = a->tp_mro;
    if (likely(mro)) {
        Py_ssize_t i, n;
        n = PyTuple_GET_SIZE(mro);
        for (i = 0; i < n; i++) {
            if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
                return 1;
        }
        return 0;
    }
    return __Pyx_InBases(a, b);
}
static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) {
    PyObject *mro;
    if (cls == a || cls == b) return 1;
    mro = cls->tp_mro;
    if (likely(mro)) {
        Py_ssize_t i, n;
        n = PyTuple_GET_SIZE(mro);
        for (i = 0; i < n; i++) {
            PyObject *base = PyTuple_GET_ITEM(mro, i);
            if (base == (PyObject *)a || base == (PyObject *)b)
                return 1;
        }
        return 0;
    }
    return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b);
}
static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
    if (exc_type1) {
        return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2);
    } else {
        return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
    }
}
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);
    for (i=0; i<n; i++) {
        if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
    }
    for (i=0; i<n; i++) {
        PyObject *t = PyTuple_GET_ITEM(tuple, i);
        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

/* GetRuntimeVersion */
#if __PYX_LIMITED_VERSION_HEX < 0x030b0000
void __Pyx_init_runtime_version(void) {
    if (__Pyx_cached_runtime_version == 0) {
        const char* rt_version = Py_GetVersion();
        unsigned long version = 0;
        unsigned long factor = 0x01000000UL;
        unsigned int digit = 0;
        int i = 0;
        while (factor) {
            while ('0' <= rt_version[i] && rt_version[i] <= '9') {
                digit = digit * 10 + (unsigned int) (rt_version[i] - '0');
                ++i;
            }
            version += factor * digit;
            if (rt_version[i] != '.')
                break;
            digit = 0;
            factor >>= 8;
            ++i;
        }
        __Pyx_cached_runtime_version = version;
    }
}
#endif
static unsigned long __Pyx_get_runtime_version(void) {
#if __PYX_LIMITED_VERSION_HEX >= 0x030b0000
    return Py_Version & ~0xFFUL;
#else
    return __Pyx_cached_runtime_version;
#endif
}

/* CheckBinaryVersion */
static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer) {
    const unsigned long MAJOR_MINOR = 0xFFFF0000UL;
    if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR))
        return 0;
    if (likely(allow_newer && (rt_version & MAJOR_MINOR) > (ct_version & MAJOR_MINOR)))
        return 1;
    {
        char message[200];
        PyOS_snprintf(message, sizeof(message),
                      "compile time Python version %d.%d "
                      "of module '%.100s' "
                      "%s "
                      "runtime version %d.%d",
                       (int) (ct_version >> 24), (int) ((ct_version >> 16) & 0xFF),
                       __Pyx_MODULE_NAME,
                       (allow_newer) ? "was newer than" : "does not match",
                       (int) (rt_version >> 24), (int) ((rt_version >> 16) & 0xFF)
       );
        return PyErr_WarnEx(NULL, message, 1);
    }
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From___pyx_anon_enum(int value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const int neg_one = (int) -1, const_zero = (int) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(int) < sizeof(long)) {
            return PyLong_FromLong((long) value);
        } else if (sizeof(int) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#if !CYTHON_COMPILING_IN_PYPY
        } 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 PyLong_FromLong((long) value);
        } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
        }
    }
    {
        unsigned char *bytes = (unsigned char *)&value;
#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
        if (is_unsigned) {
            return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
        } else {
            return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
        }
#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
        int one = 1; int little = (int)*(unsigned char *)&one;
        return _PyLong_FromByteArray(bytes, sizeof(int),
                                     little, !is_unsigned);
#else
        int one = 1; int little = (int)*(unsigned char *)&one;
        PyObject *from_bytes, *result = NULL, *kwds = NULL;
        PyObject *py_bytes = NULL, *order_str = NULL;
        from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
        if (!from_bytes) return NULL;
        py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int));
        if (!py_bytes) goto limited_bad;
        order_str = PyUnicode_FromString(little ? "little" : "big");
        if (!order_str) goto limited_bad;
        {
            PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
            if (!is_unsigned) {
                kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                if (!kwds) goto limited_bad;
                if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
            }
            result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
        }
        limited_bad:
        Py_XDECREF(kwds);
        Py_XDECREF(order_str);
        Py_XDECREF(py_bytes);
        Py_XDECREF(from_bytes);
        return result;
#endif
    }
}

/* NewCodeObj */
#if CYTHON_COMPILING_IN_LIMITED_API
    static PyObject* __Pyx__PyCode_New(int a, int p, int k, int l, int s, int f,
                                       PyObject *code, PyObject *c, PyObject* n, PyObject *v,
                                       PyObject *fv, PyObject *cell, PyObject* fn,
                                       PyObject *name, int fline, PyObject *lnos) {
        PyObject *exception_table = NULL;
        PyObject *types_module=NULL, *code_type=NULL, *result=NULL;
        #if __PYX_LIMITED_VERSION_HEX < 0x030b0000
        PyObject *version_info;
        PyObject *py_minor_version = NULL;
        #endif
        long minor_version = 0;
        PyObject *type, *value, *traceback;
        PyErr_Fetch(&type, &value, &traceback);
        #if __PYX_LIMITED_VERSION_HEX >= 0x030b0000
        minor_version = 11;
        #else
        if (!(version_info = PySys_GetObject("version_info"))) goto end;
        if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end;
        minor_version = PyLong_AsLong(py_minor_version);
        Py_DECREF(py_minor_version);
        if (minor_version == -1 && PyErr_Occurred()) goto end;
        #endif
        if (!(types_module = PyImport_ImportModule("types"))) goto end;
        if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end;
        if (minor_version <= 7) {
            (void)p;
            result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOOO", a, k, l, s, f, code,
                          c, n, v, fn, name, fline, lnos, fv, cell);
        } else if (minor_version <= 10) {
            result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOOO", a,p, k, l, s, f, code,
                          c, n, v, fn, name, fline, lnos, fv, cell);
        } else {
            if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end;
            result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOOOO", a,p, k, l, s, f, code,
                          c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell);
        }
    end:
        Py_XDECREF(code_type);
        Py_XDECREF(exception_table);
        Py_XDECREF(types_module);
        if (type) {
            PyErr_Restore(type, value, traceback);
        }
        return result;
    }
#elif PY_VERSION_HEX >= 0x030B0000
  static PyCodeObject* __Pyx__PyCode_New(int a, int p, int k, int l, int s, int f,
                                         PyObject *code, PyObject *c, PyObject* n, PyObject *v,
                                         PyObject *fv, PyObject *cell, PyObject* fn,
                                         PyObject *name, int fline, PyObject *lnos) {
    PyCodeObject *result;
    result =
      #if PY_VERSION_HEX >= 0x030C0000
        PyUnstable_Code_NewWithPosOnlyArgs
      #else
        PyCode_NewWithPosOnlyArgs
      #endif
        (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, __pyx_mstate_global->__pyx_empty_bytes);
    #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030c00A1
    if (likely(result))
        result->_co_firsttraceable = 0;
    #endif
    return result;
  }
#elif !CYTHON_COMPILING_IN_PYPY
  #define __Pyx__PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
          PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
#else
  #define __Pyx__PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
          PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
#endif
static PyObject* __Pyx_PyCode_New(
        const __Pyx_PyCode_New_function_description descr,
        PyObject * const *varnames,
        PyObject *filename,
        PyObject *funcname,
        PyObject *line_table,
        PyObject *tuple_dedup_map
) {
    PyObject *code_obj = NULL, *varnames_tuple_dedup = NULL, *code_bytes = NULL;
    Py_ssize_t var_count = (Py_ssize_t) descr.nlocals;
    PyObject *varnames_tuple = PyTuple_New(var_count);
    if (unlikely(!varnames_tuple)) return NULL;
    for (Py_ssize_t i=0; i < var_count; i++) {
        Py_INCREF(varnames[i]);
        if (__Pyx_PyTuple_SET_ITEM(varnames_tuple, i, varnames[i]) != (0)) goto done;
    }
    #if CYTHON_COMPILING_IN_LIMITED_API
    varnames_tuple_dedup = PyDict_GetItem(tuple_dedup_map, varnames_tuple);
    if (!varnames_tuple_dedup) {
        if (unlikely(PyDict_SetItem(tuple_dedup_map, varnames_tuple, varnames_tuple) < 0)) goto done;
        varnames_tuple_dedup = varnames_tuple;
    }
    #else
    varnames_tuple_dedup = PyDict_SetDefault(tuple_dedup_map, varnames_tuple, varnames_tuple);
    if (unlikely(!varnames_tuple_dedup)) goto done;
    #endif
    #if CYTHON_AVOID_BORROWED_REFS
    Py_INCREF(varnames_tuple_dedup);
    #endif
    if (__PYX_LIMITED_VERSION_HEX >= (0x030b0000) && line_table != NULL && !CYTHON_COMPILING_IN_GRAAL) {
        Py_ssize_t line_table_length = __Pyx_PyBytes_GET_SIZE(line_table);
        #if !CYTHON_ASSUME_SAFE_SIZE
        if (unlikely(line_table_length == -1)) goto done;
        #endif
        Py_ssize_t code_len = (line_table_length * 2 + 4) & ~3LL;
        code_bytes = PyBytes_FromStringAndSize(NULL, code_len);
        if (unlikely(!code_bytes)) goto done;
        char* c_code_bytes = PyBytes_AsString(code_bytes);
        if (unlikely(!c_code_bytes)) goto done;
        memset(c_code_bytes, 0, (size_t) code_len);
    }
    code_obj = (PyObject*) __Pyx__PyCode_New(
        (int) descr.argcount,
        (int) descr.num_posonly_args,
        (int) descr.num_kwonly_args,
        (int) descr.nlocals,
        0,
        (int) descr.flags,
        code_bytes ? code_bytes : __pyx_mstate_global->__pyx_empty_bytes,
        __pyx_mstate_global->__pyx_empty_tuple,
        __pyx_mstate_global->__pyx_empty_tuple,
        varnames_tuple_dedup,
        __pyx_mstate_global->__pyx_empty_tuple,
        __pyx_mstate_global->__pyx_empty_tuple,
        filename,
        funcname,
        (int) descr.first_line,
        (__PYX_LIMITED_VERSION_HEX >= (0x030b0000) && line_table) ? line_table : __pyx_mstate_global->__pyx_empty_bytes
    );
done:
    Py_XDECREF(code_bytes);
    #if CYTHON_AVOID_BORROWED_REFS
    Py_XDECREF(varnames_tuple_dedup);
    #endif
    Py_DECREF(varnames_tuple);
    return code_obj;
}

/* DecompressString */
static PyObject *__Pyx_DecompressString(const char *s, Py_ssize_t length, int algo) {
    PyObject *module = NULL, *decompress, *compressed_bytes, *decompressed;
    const char* module_name = algo == 3 ? "compression.zstd" : algo == 2 ? "bz2" : "zlib";
    PyObject *methodname = PyUnicode_FromString("decompress");
    if (unlikely(!methodname)) return NULL;
    #if __PYX_LIMITED_VERSION_HEX >= 0x030e0000
    if (algo == 3) {
        PyObject *fromlist = Py_BuildValue("[O]", methodname);
        if (unlikely(!fromlist)) goto bad;
        module = PyImport_ImportModuleLevel("compression.zstd", NULL, NULL, fromlist, 0);
        Py_DECREF(fromlist);
    } else
    #endif
        module = PyImport_ImportModule(module_name);
    if (unlikely(!module)) goto import_failed;
    decompress = PyObject_GetAttr(module, methodname);
    if (unlikely(!decompress)) goto import_failed;
    {
        #ifdef __cplusplus
            char *memview_bytes = const_cast<char*>(s);
        #else
            #if defined(__clang__)
              #pragma clang diagnostic push
              #pragma clang diagnostic ignored "-Wcast-qual"
            #elif !defined(__INTEL_COMPILER) && defined(__GNUC__)
              #pragma GCC diagnostic push
              #pragma GCC diagnostic ignored "-Wcast-qual"
            #endif
            char *memview_bytes = (char*) s;
            #if defined(__clang__)
              #pragma clang diagnostic pop
            #elif !defined(__INTEL_COMPILER) && defined(__GNUC__)
              #pragma GCC diagnostic pop
            #endif
        #endif
        #if CYTHON_COMPILING_IN_LIMITED_API && !defined(PyBUF_READ)
        int memview_flags = 0x100;
        #else
        int memview_flags = PyBUF_READ;
        #endif
        compressed_bytes = PyMemoryView_FromMemory(memview_bytes, length, memview_flags);
    }
    if (unlikely(!compressed_bytes)) {
        Py_DECREF(decompress);
        goto bad;
    }
    decompressed = PyObject_CallFunctionObjArgs(decompress, compressed_bytes, NULL);
    Py_DECREF(compressed_bytes);
    Py_DECREF(decompress);
    Py_DECREF(module);
    Py_DECREF(methodname);
    return decompressed;
import_failed:
    PyErr_Format(PyExc_ImportError,
        "Failed to import '%.20s.decompress' - cannot initialise module strings. "
        "String compression was configured with the C macro 'CYTHON_COMPRESS_STRINGS=%d'.",
        module_name, algo);
bad:
    Py_XDECREF(module);
    Py_DECREF(methodname);
    return NULL;
}

#include <string.h>
static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s) {
    size_t len = strlen(s);
    if (unlikely(len > (size_t) PY_SSIZE_T_MAX)) {
        PyErr_SetString(PyExc_OverflowError, "byte string is too long");
        return -1;
    }
    return (Py_ssize_t) len;
}
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
    Py_ssize_t len = __Pyx_ssize_strlen(c_str);
    if (unlikely(len < 0)) return NULL;
    return __Pyx_PyUnicode_FromStringAndSize(c_str, len);
}
static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char* c_str) {
    Py_ssize_t len = __Pyx_ssize_strlen(c_str);
    if (unlikely(len < 0)) return NULL;
    return PyByteArray_FromStringAndSize(c_str, len);
}
static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
    Py_ssize_t ignore;
    return __Pyx_PyObject_AsStringAndSize(o, &ignore);
}
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_UTF8
static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
    if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
#if CYTHON_COMPILING_IN_LIMITED_API
    {
        const char* result;
        Py_ssize_t unicode_length;
        CYTHON_MAYBE_UNUSED_VAR(unicode_length); // only for __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
        #if __PYX_LIMITED_VERSION_HEX < 0x030A0000
        if (unlikely(PyArg_Parse(o, "s#", &result, length) < 0)) return NULL;
        #else
        result = PyUnicode_AsUTF8AndSize(o, length);
        #endif
        #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
        unicode_length = PyUnicode_GetLength(o);
        if (unlikely(unicode_length < 0)) return NULL;
        if (unlikely(unicode_length != *length)) {
            PyUnicode_AsASCIIString(o);
            return NULL;
        }
        #endif
        return result;
    }
#else
#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_UTF8
    if (PyUnicode_Check(o)) {
        return __Pyx_PyUnicode_AsStringAndSize(o, length);
    } else
#endif
    if (PyByteArray_Check(o)) {
#if (CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS) || (CYTHON_COMPILING_IN_PYPY && (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)))
        *length = PyByteArray_GET_SIZE(o);
        return PyByteArray_AS_STRING(o);
#else
        *length = PyByteArray_Size(o);
        if (*length == -1) return NULL;
        return PyByteArray_AsString(o);
#endif
    } else
    {
        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_LongWrongResultType(PyObject* result) {
    __Pyx_TypeName result_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(result));
    if (PyLong_Check(result)) {
        if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
                "__int__ returned non-int (type " __Pyx_FMT_TYPENAME ").  "
                "The ability to return an instance of a strict subclass of int is deprecated, "
                "and may be removed in a future version of Python.",
                result_type_name)) {
            __Pyx_DECREF_TypeName(result_type_name);
            Py_DECREF(result);
            return NULL;
        }
        __Pyx_DECREF_TypeName(result_type_name);
        return result;
    }
    PyErr_Format(PyExc_TypeError,
                 "__int__ returned non-int (type " __Pyx_FMT_TYPENAME ")",
                 result_type_name);
    __Pyx_DECREF_TypeName(result_type_name);
    Py_DECREF(result);
    return NULL;
}
static CYTHON_INLINE PyObject* __Pyx_PyNumber_Long(PyObject* x) {
#if CYTHON_USE_TYPE_SLOTS
  PyNumberMethods *m;
#endif
  PyObject *res = NULL;
  if (likely(PyLong_Check(x)))
      return __Pyx_NewRef(x);
#if CYTHON_USE_TYPE_SLOTS
  m = Py_TYPE(x)->tp_as_number;
  if (likely(m && m->nb_int)) {
      res = m->nb_int(x);
  }
#else
  if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
      res = PyNumber_Long(x);
  }
#endif
  if (likely(res)) {
      if (unlikely(!PyLong_CheckExact(res))) {
          return __Pyx_PyNumber_LongWrongResultType(res);
      }
  }
  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 (likely(PyLong_CheckExact(b))) {
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(__Pyx_PyLong_IsCompact(b))) {
        return __Pyx_PyLong_CompactValue(b);
    } else {
      const digit* digits = __Pyx_PyLong_Digits(b);
      const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(b);
      switch (size) {
         case 2:
           if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -2:
           if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case 3:
           if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -3:
           if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case 4:
           if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -4:
           if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
      }
    }
    #endif
    return PyLong_AsSsize_t(b);
  }
  x = PyNumber_Index(b);
  if (!x) return -1;
  ival = PyLong_AsSsize_t(x);
  Py_DECREF(x);
  return ival;
}
static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) {
  if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) {
    return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o);
  } else {
    Py_ssize_t ival;
    PyObject *x;
    x = PyNumber_Index(o);
    if (!x) return -1;
    ival = PyLong_AsLong(x);
    Py_DECREF(x);
    return ival;
  }
}
static CYTHON_INLINE PyObject *__Pyx_Owned_Py_None(int b) {
    CYTHON_UNUSED_VAR(b);
    return __Pyx_NewRef(Py_None);
}
static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
  return __Pyx_NewRef(b ? Py_True: Py_False);
}
static CYTHON_INLINE PyObject * __Pyx_PyLong_FromSize_t(size_t ival) {
    return PyLong_FromSize_t(ival);
}


/* MultiPhaseInitModuleState */
#if CYTHON_PEP489_MULTI_PHASE_INIT && CYTHON_USE_MODULE_STATE
#ifndef CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
#if (CYTHON_COMPILING_IN_LIMITED_API || PY_VERSION_HEX >= 0x030C0000)
  #define CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE 1
#else
  #define CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE 0
#endif
#endif
#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE && !CYTHON_ATOMICS
#error "Module state with PEP489 requires atomics. Currently that's one of\
 C11, C++11, gcc atomic intrinsics or MSVC atomic intrinsics"
#endif
#if !CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
#define __Pyx_ModuleStateLookup_Lock()
#define __Pyx_ModuleStateLookup_Unlock()
#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d0000
static PyMutex __Pyx_ModuleStateLookup_mutex = {0};
#define __Pyx_ModuleStateLookup_Lock() PyMutex_Lock(&__Pyx_ModuleStateLookup_mutex)
#define __Pyx_ModuleStateLookup_Unlock() PyMutex_Unlock(&__Pyx_ModuleStateLookup_mutex)
#elif defined(__cplusplus) && __cplusplus >= 201103L
#include <mutex>
static std::mutex __Pyx_ModuleStateLookup_mutex;
#define __Pyx_ModuleStateLookup_Lock() __Pyx_ModuleStateLookup_mutex.lock()
#define __Pyx_ModuleStateLookup_Unlock() __Pyx_ModuleStateLookup_mutex.unlock()
#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ > 201112L) && !defined(__STDC_NO_THREADS__)
#include <threads.h>
static mtx_t __Pyx_ModuleStateLookup_mutex;
static once_flag __Pyx_ModuleStateLookup_mutex_once_flag = ONCE_FLAG_INIT;
static void __Pyx_ModuleStateLookup_initialize_mutex(void) {
    mtx_init(&__Pyx_ModuleStateLookup_mutex, mtx_plain);
}
#define __Pyx_ModuleStateLookup_Lock()\
  call_once(&__Pyx_ModuleStateLookup_mutex_once_flag, __Pyx_ModuleStateLookup_initialize_mutex);\
  mtx_lock(&__Pyx_ModuleStateLookup_mutex)
#define __Pyx_ModuleStateLookup_Unlock() mtx_unlock(&__Pyx_ModuleStateLookup_mutex)
#elif defined(HAVE_PTHREAD_H)
#include <pthread.h>
static pthread_mutex_t __Pyx_ModuleStateLookup_mutex = PTHREAD_MUTEX_INITIALIZER;
#define __Pyx_ModuleStateLookup_Lock() pthread_mutex_lock(&__Pyx_ModuleStateLookup_mutex)
#define __Pyx_ModuleStateLookup_Unlock() pthread_mutex_unlock(&__Pyx_ModuleStateLookup_mutex)
#elif defined(_WIN32)
#include <Windows.h>  // synchapi.h on its own doesn't work
static SRWLOCK __Pyx_ModuleStateLookup_mutex = SRWLOCK_INIT;
#define __Pyx_ModuleStateLookup_Lock() AcquireSRWLockExclusive(&__Pyx_ModuleStateLookup_mutex)
#define __Pyx_ModuleStateLookup_Unlock() ReleaseSRWLockExclusive(&__Pyx_ModuleStateLookup_mutex)
#else
#error "No suitable lock available for CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE.\
 Requires C standard >= C11, or C++ standard >= C++11,\
 or pthreads, or the Windows 32 API, or Python >= 3.13."
#endif
typedef struct {
    int64_t id;
    PyObject *module;
} __Pyx_InterpreterIdAndModule;
typedef struct {
    char interpreter_id_as_index;
    Py_ssize_t count;
    Py_ssize_t allocated;
    __Pyx_InterpreterIdAndModule table[1];
} __Pyx_ModuleStateLookupData;
#define __PYX_MODULE_STATE_LOOKUP_SMALL_SIZE 32
#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
static __pyx_atomic_int_type __Pyx_ModuleStateLookup_read_counter = 0;
#endif
#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
static __pyx_atomic_ptr_type __Pyx_ModuleStateLookup_data = 0;
#else
static __Pyx_ModuleStateLookupData* __Pyx_ModuleStateLookup_data = NULL;
#endif
static __Pyx_InterpreterIdAndModule* __Pyx_State_FindModuleStateLookupTableLowerBound(
        __Pyx_InterpreterIdAndModule* table,
        Py_ssize_t count,
        int64_t interpreterId) {
    __Pyx_InterpreterIdAndModule* begin = table;
    __Pyx_InterpreterIdAndModule* end = begin + count;
    if (begin->id == interpreterId) {
        return begin;
    }
    while ((end - begin) > __PYX_MODULE_STATE_LOOKUP_SMALL_SIZE) {
        __Pyx_InterpreterIdAndModule* halfway = begin + (end - begin)/2;
        if (halfway->id == interpreterId) {
            return halfway;
        }
        if (halfway->id < interpreterId) {
            begin = halfway;
        } else {
            end = halfway;
        }
    }
    for (; begin < end; ++begin) {
        if (begin->id >= interpreterId) return begin;
    }
    return begin;
}
static PyObject *__Pyx_State_FindModule(CYTHON_UNUSED void* dummy) {
    int64_t interpreter_id = PyInterpreterState_GetID(__Pyx_PyInterpreterState_Get());
    if (interpreter_id == -1) return NULL;
#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
    __Pyx_ModuleStateLookupData* data = (__Pyx_ModuleStateLookupData*)__pyx_atomic_pointer_load_relaxed(&__Pyx_ModuleStateLookup_data);
    {
        __pyx_atomic_incr_acq_rel(&__Pyx_ModuleStateLookup_read_counter);
        if (likely(data)) {
            __Pyx_ModuleStateLookupData* new_data = (__Pyx_ModuleStateLookupData*)__pyx_atomic_pointer_load_acquire(&__Pyx_ModuleStateLookup_data);
            if (likely(data == new_data)) {
                goto read_finished;
            }
        }
        __pyx_atomic_decr_acq_rel(&__Pyx_ModuleStateLookup_read_counter);
        __Pyx_ModuleStateLookup_Lock();
        __pyx_atomic_incr_relaxed(&__Pyx_ModuleStateLookup_read_counter);
        data = (__Pyx_ModuleStateLookupData*)__pyx_atomic_pointer_load_relaxed(&__Pyx_ModuleStateLookup_data);
        __Pyx_ModuleStateLookup_Unlock();
    }
  read_finished:;
#else
    __Pyx_ModuleStateLookupData* data = __Pyx_ModuleStateLookup_data;
#endif
    __Pyx_InterpreterIdAndModule* found = NULL;
    if (unlikely(!data)) goto end;
    if (data->interpreter_id_as_index) {
        if (interpreter_id < data->count) {
            found = data->table+interpreter_id;
        }
    } else {
        found = __Pyx_State_FindModuleStateLookupTableLowerBound(
            data->table, data->count, interpreter_id);
    }
  end:
    {
        PyObject *result=NULL;
        if (found && found->id == interpreter_id) {
            result = found->module;
        }
#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
        __pyx_atomic_decr_acq_rel(&__Pyx_ModuleStateLookup_read_counter);
#endif
        return result;
    }
}
#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
static void __Pyx_ModuleStateLookup_wait_until_no_readers(void) {
    while (__pyx_atomic_load(&__Pyx_ModuleStateLookup_read_counter) != 0);
}
#else
#define __Pyx_ModuleStateLookup_wait_until_no_readers()
#endif
static int __Pyx_State_AddModuleInterpIdAsIndex(__Pyx_ModuleStateLookupData **old_data, PyObject* module, int64_t interpreter_id) {
    Py_ssize_t to_allocate = (*old_data)->allocated;
    while (to_allocate <= interpreter_id) {
        if (to_allocate == 0) to_allocate = 1;
        else to_allocate *= 2;
    }
    __Pyx_ModuleStateLookupData *new_data = *old_data;
    if (to_allocate != (*old_data)->allocated) {
         new_data = (__Pyx_ModuleStateLookupData *)realloc(
            *old_data,
            sizeof(__Pyx_ModuleStateLookupData)+(to_allocate-1)*sizeof(__Pyx_InterpreterIdAndModule));
        if (!new_data) {
            PyErr_NoMemory();
            return -1;
        }
        for (Py_ssize_t i = new_data->allocated; i < to_allocate; ++i) {
            new_data->table[i].id = i;
            new_data->table[i].module = NULL;
        }
        new_data->allocated = to_allocate;
    }
    new_data->table[interpreter_id].module = module;
    if (new_data->count < interpreter_id+1) {
        new_data->count = interpreter_id+1;
    }
    *old_data = new_data;
    return 0;
}
static void __Pyx_State_ConvertFromInterpIdAsIndex(__Pyx_ModuleStateLookupData *data) {
    __Pyx_InterpreterIdAndModule *read = data->table;
    __Pyx_InterpreterIdAndModule *write = data->table;
    __Pyx_InterpreterIdAndModule *end = read + data->count;
    for (; read<end; ++read) {
        if (read->module) {
            write->id = read->id;
            write->module = read->module;
            ++write;
        }
    }
    data->count = write - data->table;
    for (; write<end; ++write) {
        write->id = 0;
        write->module = NULL;
    }
    data->interpreter_id_as_index = 0;
}
static int __Pyx_State_AddModule(PyObject* module, CYTHON_UNUSED void* dummy) {
    int64_t interpreter_id = PyInterpreterState_GetID(__Pyx_PyInterpreterState_Get());
    if (interpreter_id == -1) return -1;
    int result = 0;
    __Pyx_ModuleStateLookup_Lock();
#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
    __Pyx_ModuleStateLookupData *old_data = (__Pyx_ModuleStateLookupData *)
            __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, 0);
#else
    __Pyx_ModuleStateLookupData *old_data = __Pyx_ModuleStateLookup_data;
#endif
    __Pyx_ModuleStateLookupData *new_data = old_data;
    if (!new_data) {
        new_data = (__Pyx_ModuleStateLookupData *)calloc(1, sizeof(__Pyx_ModuleStateLookupData));
        if (!new_data) {
            result = -1;
            PyErr_NoMemory();
            goto end;
        }
        new_data->allocated = 1;
        new_data->interpreter_id_as_index = 1;
    }
    __Pyx_ModuleStateLookup_wait_until_no_readers();
    if (new_data->interpreter_id_as_index) {
        if (interpreter_id < __PYX_MODULE_STATE_LOOKUP_SMALL_SIZE) {
            result = __Pyx_State_AddModuleInterpIdAsIndex(&new_data, module, interpreter_id);
            goto end;
        }
        __Pyx_State_ConvertFromInterpIdAsIndex(new_data);
    }
    {
        Py_ssize_t insert_at = 0;
        {
            __Pyx_InterpreterIdAndModule* lower_bound = __Pyx_State_FindModuleStateLookupTableLowerBound(
                new_data->table, new_data->count, interpreter_id);
            assert(lower_bound);
            insert_at = lower_bound - new_data->table;
            if (unlikely(insert_at < new_data->count && lower_bound->id == interpreter_id)) {
                lower_bound->module = module;
                goto end;  // already in table, nothing more to do
            }
        }
        if (new_data->count+1 >= new_data->allocated) {
            Py_ssize_t to_allocate = (new_data->count+1)*2;
            new_data =
                (__Pyx_ModuleStateLookupData*)realloc(
                    new_data,
                    sizeof(__Pyx_ModuleStateLookupData) +
                    (to_allocate-1)*sizeof(__Pyx_InterpreterIdAndModule));
            if (!new_data) {
                result = -1;
                new_data = old_data;
                PyErr_NoMemory();
                goto end;
            }
            new_data->allocated = to_allocate;
        }
        ++new_data->count;
        int64_t last_id = interpreter_id;
        PyObject *last_module = module;
        for (Py_ssize_t i=insert_at; i<new_data->count; ++i) {
            int64_t current_id = new_data->table[i].id;
            new_data->table[i].id = last_id;
            last_id = current_id;
            PyObject *current_module = new_data->table[i].module;
            new_data->table[i].module = last_module;
            last_module = current_module;
        }
    }
  end:
#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
    __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, new_data);
#else
    __Pyx_ModuleStateLookup_data = new_data;
#endif
    __Pyx_ModuleStateLookup_Unlock();
    return result;
}
static int __Pyx_State_RemoveModule(CYTHON_UNUSED void* dummy) {
    int64_t interpreter_id = PyInterpreterState_GetID(__Pyx_PyInterpreterState_Get());
    if (interpreter_id == -1) return -1;
    __Pyx_ModuleStateLookup_Lock();
#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
    __Pyx_ModuleStateLookupData *data = (__Pyx_ModuleStateLookupData *)
            __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, 0);
#else
    __Pyx_ModuleStateLookupData *data = __Pyx_ModuleStateLookup_data;
#endif
    if (data->interpreter_id_as_index) {
        if (interpreter_id < data->count) {
            data->table[interpreter_id].module = NULL;
        }
        goto done;
    }
    {
        __Pyx_ModuleStateLookup_wait_until_no_readers();
        __Pyx_InterpreterIdAndModule* lower_bound = __Pyx_State_FindModuleStateLookupTableLowerBound(
            data->table, data->count, interpreter_id);
        if (!lower_bound) goto done;
        if (lower_bound->id != interpreter_id) goto done;
        __Pyx_InterpreterIdAndModule *end = data->table+data->count;
        for (;lower_bound<end-1; ++lower_bound) {
            lower_bound->id = (lower_bound+1)->id;
            lower_bound->module = (lower_bound+1)->module;
        }
    }
    --data->count;
    if (data->count == 0) {
        free(data);
        data = NULL;
    }
  done:
#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
    __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, data);
#else
    __Pyx_ModuleStateLookup_data = data;
#endif
    __Pyx_ModuleStateLookup_Unlock();
    return 0;
}
#endif

/* #### Code section: utility_code_pragmas_end ### */
#ifdef _MSC_VER
#pragma warning( pop )
#endif



/* #### Code section: end ### */
#endif /* Py_PYTHON_H */
