Skip to main content

singe_cusparse_sys/
sys_12709.rs

1/* automatically generated by rust-bindgen 0.72.1 */
2
3#[repr(C)]
4#[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)]
5pub struct __BindgenBitfieldUnit<Storage> {
6    storage: Storage,
7}
8impl<Storage> __BindgenBitfieldUnit<Storage> {
9    #[inline]
10    pub const fn new(storage: Storage) -> Self {
11        Self { storage }
12    }
13}
14impl<Storage> __BindgenBitfieldUnit<Storage>
15where
16    Storage: AsRef<[u8]> + AsMut<[u8]>,
17{
18    #[inline]
19    fn extract_bit(byte: u8, index: usize) -> bool {
20        let bit_index = if cfg!(target_endian = "big") {
21            7 - (index % 8)
22        } else {
23            index % 8
24        };
25        let mask = 1 << bit_index;
26        byte & mask == mask
27    }
28    #[inline]
29    pub fn get_bit(&self, index: usize) -> bool {
30        debug_assert!(index / 8 < self.storage.as_ref().len());
31        let byte_index = index / 8;
32        let byte = self.storage.as_ref()[byte_index];
33        Self::extract_bit(byte, index)
34    }
35    #[inline]
36    pub unsafe fn raw_get_bit(this: *const Self, index: usize) -> bool {
37        debug_assert!(index / 8 < core::mem::size_of::< Storage > ());
38        let byte_index = index / 8;
39        let byte = unsafe {
40            *(core::ptr::addr_of!((* this).storage) as *const u8)
41                .offset(byte_index as isize)
42        };
43        Self::extract_bit(byte, index)
44    }
45    #[inline]
46    fn change_bit(byte: u8, index: usize, val: bool) -> u8 {
47        let bit_index = if cfg!(target_endian = "big") {
48            7 - (index % 8)
49        } else {
50            index % 8
51        };
52        let mask = 1 << bit_index;
53        if val { byte | mask } else { byte & !mask }
54    }
55    #[inline]
56    pub fn set_bit(&mut self, index: usize, val: bool) {
57        debug_assert!(index / 8 < self.storage.as_ref().len());
58        let byte_index = index / 8;
59        let byte = &mut self.storage.as_mut()[byte_index];
60        *byte = Self::change_bit(*byte, index, val);
61    }
62    #[inline]
63    pub unsafe fn raw_set_bit(this: *mut Self, index: usize, val: bool) {
64        debug_assert!(index / 8 < core::mem::size_of::< Storage > ());
65        let byte_index = index / 8;
66        let byte = unsafe {
67            (core::ptr::addr_of_mut!((* this).storage) as *mut u8)
68                .offset(byte_index as isize)
69        };
70        unsafe { *byte = Self::change_bit(*byte, index, val) };
71    }
72    #[inline]
73    pub fn get(&self, bit_offset: usize, bit_width: u8) -> u64 {
74        debug_assert!(bit_width <= 64);
75        debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
76        debug_assert!(
77            (bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len()
78        );
79        let mut val = 0;
80        for i in 0..(bit_width as usize) {
81            if self.get_bit(i + bit_offset) {
82                let index = if cfg!(target_endian = "big") {
83                    bit_width as usize - 1 - i
84                } else {
85                    i
86                };
87                val |= 1 << index;
88            }
89        }
90        val
91    }
92    #[inline]
93    pub unsafe fn raw_get(this: *const Self, bit_offset: usize, bit_width: u8) -> u64 {
94        debug_assert!(bit_width <= 64);
95        debug_assert!(bit_offset / 8 < core::mem::size_of::< Storage > ());
96        debug_assert!(
97            (bit_offset + (bit_width as usize)) / 8 <= core::mem::size_of::< Storage > ()
98        );
99        let mut val = 0;
100        for i in 0..(bit_width as usize) {
101            if unsafe { Self::raw_get_bit(this, i + bit_offset) } {
102                let index = if cfg!(target_endian = "big") {
103                    bit_width as usize - 1 - i
104                } else {
105                    i
106                };
107                val |= 1 << index;
108            }
109        }
110        val
111    }
112    #[inline]
113    pub fn set(&mut self, bit_offset: usize, bit_width: u8, val: u64) {
114        debug_assert!(bit_width <= 64);
115        debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
116        debug_assert!(
117            (bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len()
118        );
119        for i in 0..(bit_width as usize) {
120            let mask = 1 << i;
121            let val_bit_is_set = val & mask == mask;
122            let index = if cfg!(target_endian = "big") {
123                bit_width as usize - 1 - i
124            } else {
125                i
126            };
127            self.set_bit(index + bit_offset, val_bit_is_set);
128        }
129    }
130    #[inline]
131    pub unsafe fn raw_set(this: *mut Self, bit_offset: usize, bit_width: u8, val: u64) {
132        debug_assert!(bit_width <= 64);
133        debug_assert!(bit_offset / 8 < core::mem::size_of::< Storage > ());
134        debug_assert!(
135            (bit_offset + (bit_width as usize)) / 8 <= core::mem::size_of::< Storage > ()
136        );
137        for i in 0..(bit_width as usize) {
138            let mask = 1 << i;
139            let val_bit_is_set = val & mask == mask;
140            let index = if cfg!(target_endian = "big") {
141                bit_width as usize - 1 - i
142            } else {
143                i
144            };
145            unsafe { Self::raw_set_bit(this, index + bit_offset, val_bit_is_set) };
146        }
147    }
148}
149pub const CUSPARSE_VER_MAJOR: u32 = 12;
150pub const CUSPARSE_VER_MINOR: u32 = 7;
151pub const CUSPARSE_VER_PATCH: u32 = 9;
152pub const CUSPARSE_VER_BUILD: u32 = 17;
153pub const CUSPARSE_VERSION: u32 = 12709;
154pub type __uint64_t = ::core::ffi::c_ulong;
155pub type __off_t = ::core::ffi::c_long;
156pub type __off64_t = ::core::ffi::c_long;
157#[repr(C)]
158#[repr(align(8))]
159#[derive(Debug, Default, Copy, Clone, PartialOrd, PartialEq)]
160pub struct float2 {
161    pub x: f32,
162    pub y: f32,
163}
164#[repr(C)]
165#[repr(align(16))]
166#[derive(Debug, Default, Copy, Clone, PartialOrd, PartialEq)]
167pub struct double2 {
168    pub x: f64,
169    pub y: f64,
170}
171pub type cuFloatComplex = float2;
172pub type cuDoubleComplex = double2;
173pub type cuComplex = cuFloatComplex;
174pub type size_t = ::core::ffi::c_ulong;
175#[repr(C)]
176#[derive(Debug, Copy, Clone)]
177pub struct CUstream_st {
178    _unused: [u8; 0],
179}
180pub type FILE = _IO_FILE;
181#[repr(C)]
182#[derive(Debug, Copy, Clone)]
183pub struct _IO_marker {
184    _unused: [u8; 0],
185}
186#[repr(C)]
187#[derive(Debug, Copy, Clone)]
188pub struct _IO_codecvt {
189    _unused: [u8; 0],
190}
191#[repr(C)]
192#[derive(Debug, Copy, Clone)]
193pub struct _IO_wide_data {
194    _unused: [u8; 0],
195}
196pub type _IO_lock_t = ::core::ffi::c_void;
197#[repr(C)]
198#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
199pub struct _IO_FILE {
200    pub _flags: ::core::ffi::c_int,
201    pub _IO_read_ptr: *mut ::core::ffi::c_char,
202    pub _IO_read_end: *mut ::core::ffi::c_char,
203    pub _IO_read_base: *mut ::core::ffi::c_char,
204    pub _IO_write_base: *mut ::core::ffi::c_char,
205    pub _IO_write_ptr: *mut ::core::ffi::c_char,
206    pub _IO_write_end: *mut ::core::ffi::c_char,
207    pub _IO_buf_base: *mut ::core::ffi::c_char,
208    pub _IO_buf_end: *mut ::core::ffi::c_char,
209    pub _IO_save_base: *mut ::core::ffi::c_char,
210    pub _IO_backup_base: *mut ::core::ffi::c_char,
211    pub _IO_save_end: *mut ::core::ffi::c_char,
212    pub _markers: *mut _IO_marker,
213    pub _chain: *mut _IO_FILE,
214    pub _fileno: ::core::ffi::c_int,
215    pub _bitfield_align_1: [u32; 0],
216    pub _bitfield_1: __BindgenBitfieldUnit<[u8; 3usize]>,
217    pub _short_backupbuf: [::core::ffi::c_char; 1usize],
218    pub _old_offset: __off_t,
219    pub _cur_column: ::core::ffi::c_ushort,
220    pub _vtable_offset: ::core::ffi::c_schar,
221    pub _shortbuf: [::core::ffi::c_char; 1usize],
222    pub _lock: *mut _IO_lock_t,
223    pub _offset: __off64_t,
224    pub _codecvt: *mut _IO_codecvt,
225    pub _wide_data: *mut _IO_wide_data,
226    pub _freeres_list: *mut _IO_FILE,
227    pub _freeres_buf: *mut ::core::ffi::c_void,
228    pub _prevchain: *mut *mut _IO_FILE,
229    pub _mode: ::core::ffi::c_int,
230    pub _unused3: ::core::ffi::c_int,
231    pub _total_written: __uint64_t,
232    pub _unused2: [::core::ffi::c_char; 8usize],
233}
234impl Default for _IO_FILE {
235    fn default() -> Self {
236        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
237        unsafe {
238            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
239            s.assume_init()
240        }
241    }
242}
243impl _IO_FILE {
244    #[inline]
245    pub fn _flags2(&self) -> ::core::ffi::c_int {
246        unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 24u8) as u32) }
247    }
248    #[inline]
249    pub fn set__flags2(&mut self, val: ::core::ffi::c_int) {
250        unsafe {
251            let val: u32 = ::core::mem::transmute(val);
252            self._bitfield_1.set(0usize, 24u8, val as u64)
253        }
254    }
255    #[inline]
256    pub unsafe fn _flags2_raw(this: *const Self) -> ::core::ffi::c_int {
257        unsafe {
258            ::core::mem::transmute(
259                <__BindgenBitfieldUnit<
260                    [u8; 3usize],
261                >>::raw_get(::core::ptr::addr_of!((* this)._bitfield_1), 0usize, 24u8)
262                    as u32,
263            )
264        }
265    }
266    #[inline]
267    pub unsafe fn set__flags2_raw(this: *mut Self, val: ::core::ffi::c_int) {
268        unsafe {
269            let val: u32 = ::core::mem::transmute(val);
270            <__BindgenBitfieldUnit<
271                [u8; 3usize],
272            >>::raw_set(
273                ::core::ptr::addr_of_mut!((* this)._bitfield_1),
274                0usize,
275                24u8,
276                val as u64,
277            )
278        }
279    }
280    #[inline]
281    pub fn new_bitfield_1(
282        _flags2: ::core::ffi::c_int,
283    ) -> __BindgenBitfieldUnit<[u8; 3usize]> {
284        let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 3usize]> = Default::default();
285        __bindgen_bitfield_unit
286            .set(
287                0usize,
288                24u8,
289                {
290                    let _flags2: u32 = unsafe { ::core::mem::transmute(_flags2) };
291                    _flags2 as u64
292                },
293            );
294        __bindgen_bitfield_unit
295    }
296}
297#[repr(C)]
298#[derive(Debug, Copy, Clone)]
299pub struct cusparseContext {
300    _unused: [u8; 0],
301}
302/// This is a pointer type to an opaque cuSPARSE context, which the user must initialize by calling prior to calling [`cusparseCreate`] any other library function. The handle created and returned by [`cusparseCreate`] must be passed to every cuSPARSE function.
303pub type cusparseHandle_t = *mut cusparseContext;
304#[repr(C)]
305#[derive(Debug, Copy, Clone)]
306pub struct cusparseMatDescr {
307    _unused: [u8; 0],
308}
309/// This structure is used to describe the shape and properties of a matrix.
310pub type cusparseMatDescr_t = *mut cusparseMatDescr;
311#[repr(C)]
312#[derive(Debug, Copy, Clone)]
313pub struct bsrsv2Info {
314    _unused: [u8; 0],
315}
316pub type bsrsv2Info_t = *mut bsrsv2Info;
317#[repr(C)]
318#[derive(Debug, Copy, Clone)]
319pub struct bsrsm2Info {
320    _unused: [u8; 0],
321}
322pub type bsrsm2Info_t = *mut bsrsm2Info;
323#[repr(C)]
324#[derive(Debug, Copy, Clone)]
325pub struct csric02Info {
326    _unused: [u8; 0],
327}
328pub type csric02Info_t = *mut csric02Info;
329#[repr(C)]
330#[derive(Debug, Copy, Clone)]
331pub struct bsric02Info {
332    _unused: [u8; 0],
333}
334pub type bsric02Info_t = *mut bsric02Info;
335#[repr(C)]
336#[derive(Debug, Copy, Clone)]
337pub struct csrilu02Info {
338    _unused: [u8; 0],
339}
340pub type csrilu02Info_t = *mut csrilu02Info;
341#[repr(C)]
342#[derive(Debug, Copy, Clone)]
343pub struct bsrilu02Info {
344    _unused: [u8; 0],
345}
346pub type bsrilu02Info_t = *mut bsrilu02Info;
347#[repr(C)]
348#[derive(Debug, Copy, Clone)]
349pub struct csru2csrInfo {
350    _unused: [u8; 0],
351}
352pub type csru2csrInfo_t = *mut csru2csrInfo;
353#[repr(C)]
354#[derive(Debug, Copy, Clone)]
355pub struct cusparseColorInfo {
356    _unused: [u8; 0],
357}
358/// This is a pointer type to an opaque structure holding the information used in `csrcolor()`.
359#[deprecated]
360pub type cusparseColorInfo_t = *mut cusparseColorInfo;
361#[repr(C)]
362#[derive(Debug, Copy, Clone)]
363pub struct pruneInfo {
364    _unused: [u8; 0],
365}
366pub type pruneInfo_t = *mut pruneInfo;
367/// This data type represents the status returned by the library functions and it can have the following values.
368#[repr(u32)]
369#[derive(
370    Debug,
371    Copy,
372    Clone,
373    Hash,
374    PartialOrd,
375    Ord,
376    PartialEq,
377    Eq,
378    TryFromPrimitive,
379    IntoPrimitive,
380)]
381pub enum cusparseStatus_t {
382    /// The operation completed successfully.
383    CUSPARSE_STATUS_SUCCESS = 0,
384    /// The cuSPARSE library was not initialized. This is usually caused by the lack of a prior call, an error in the CUDA Runtime API called by the cuSPARSE routine, or an error in the hardware setup
385    ///
386    /// **To correct:** call [`cusparseCreate`] prior to the function call; and check that the hardware, an appropriate version of the driver, and the cuSPARSE library are correctly installed  The error also applies to generic APIs (cuSPARSE Generic APIs) for indicating a matrix/vector descriptor not initialized.
387    CUSPARSE_STATUS_NOT_INITIALIZED = 1,
388    /// Resource allocation failed inside the cuSPARSE library. This is usually caused by a device memory allocation (`cudaMalloc()`) or by a host memory allocation failure
389    ///
390    /// **To correct:** prior to the function call, deallocate previously allocated memory as much as possible.
391    CUSPARSE_STATUS_ALLOC_FAILED = 2,
392    /// An unsupported value or parameter was passed to the function (a negative vector size, for example)
393    ///
394    /// **To correct:** ensure that all the parameters being passed have valid values.
395    CUSPARSE_STATUS_INVALID_VALUE = 3,
396    /// The function requires a feature absent from the device architecture
397    ///
398    /// **To correct:** compile and run the application on a device with appropriate compute capability.
399    CUSPARSE_STATUS_ARCH_MISMATCH = 4,
400    CUSPARSE_STATUS_MAPPING_ERROR = 5,
401    /// The GPU program failed to execute. This is often caused by a launch failure of the kernel on the GPU, which can be caused by multiple reasons
402    ///
403    /// **To correct:** check that the hardware, an appropriate version of the driver, and the cuSPARSE library are correctly installed.
404    CUSPARSE_STATUS_EXECUTION_FAILED = 6,
405    /// An internal cuSPARSE operation failed
406    ///
407    /// **To correct:** check that the hardware, an appropriate version of the driver, and the cuSPARSE library are correctly installed. Also, check that the memory passed as a parameter to the routine is not being deallocated prior to the routine completion.
408    CUSPARSE_STATUS_INTERNAL_ERROR = 7,
409    /// The matrix type is not supported by this function. This is usually caused by passing an invalid matrix descriptor to the function
410    ///
411    /// **To correct:** check that the fields in `cusparseMatDescr_t descrA` were set correctly.
412    CUSPARSE_STATUS_MATRIX_TYPE_NOT_SUPPORTED = 8,
413    CUSPARSE_STATUS_ZERO_PIVOT = 9,
414    /// The operation or data type combination is currently not supported by the function.
415    CUSPARSE_STATUS_NOT_SUPPORTED = 10,
416    /// The resources for the computation, such as GPU global or shared memory, are not sufficient to complete the operation. The error can also indicate that the current computation mode (e.g. bit size of sparse matrix indices) does not allow to handle the given input.
417    CUSPARSE_STATUS_INSUFFICIENT_RESOURCES = 11,
418}
419/// This type indicates whether the scalar values are passed by reference on the host or device. It is important to point out that if several scalar values are passed by reference in the function call, all of them will conform to the same single pointer mode. The pointer mode can be set and retrieved using [`cusparseSetPointerMode`] and [`cusparseGetPointerMode`] routines, respectively.
420#[repr(u32)]
421#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
422pub enum cusparsePointerMode_t {
423    /// The scalars are passed by reference on the host.
424    CUSPARSE_POINTER_MODE_HOST = 0,
425    /// The scalars are passed by reference on the device.
426    CUSPARSE_POINTER_MODE_DEVICE = 1,
427}
428/// This type indicates whether the operation is performed only on indices or on data and indices.
429#[repr(u32)]
430#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
431pub enum cusparseAction_t {
432    /// the operation is performed only on indices.
433    CUSPARSE_ACTION_SYMBOLIC = 0,
434    /// the operation is performed on data and indices.
435    CUSPARSE_ACTION_NUMERIC = 1,
436}
437/// This type indicates the type of matrix stored in sparse storage. Notice that for symmetric, Hermitian and triangular matrices only their lower or upper part is assumed to be stored.
438///
439/// The whole idea of matrix type and fill mode is to keep minimum storage for symmetric/Hermitian matrix, and also to take advantage of symmetric property on SpMV (Sparse Matrix Vector multiplication). To compute `y=A*x` when `A` is symmetric and only lower triangular part is stored, two steps are needed. First step is to compute `y=(L+D)*x` and second step is to compute `y=L^T*x + y`. Given the fact that the transpose operation `y=L^T*x` is 10x slower than non-transpose version `y=L*x`, the symmetric property does not show up any performance gain. It is better for the user to extend the symmetric matrix to a general matrix and apply `y=A*x` with matrix type [`cusparseMatrixType_t::CUSPARSE_MATRIX_TYPE_GENERAL`].
440///
441/// In general, SpMV, preconditioners (incomplete Cholesky or incomplete LU) and triangular solver are combined together in iterative solvers, for example PCG and GMRES. If the user always uses general matrix (instead of symmetric matrix), there is no need to support other than general matrix in preconditioners. Therefore the new routines, `\[bsr|csr\]sv2` (triangular solver), `\[bsr|csr\]ilu02` (incomplete LU) and `\[bsr|csr\]ic02` (incomplete Cholesky), only support matrix type [`cusparseMatrixType_t::CUSPARSE_MATRIX_TYPE_GENERAL`].
442#[repr(u32)]
443#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
444pub enum cusparseMatrixType_t {
445    /// the matrix is general.
446    CUSPARSE_MATRIX_TYPE_GENERAL = 0,
447    /// the matrix is symmetric.
448    CUSPARSE_MATRIX_TYPE_SYMMETRIC = 1,
449    /// the matrix is Hermitian.
450    CUSPARSE_MATRIX_TYPE_HERMITIAN = 2,
451    /// the matrix is triangular.
452    CUSPARSE_MATRIX_TYPE_TRIANGULAR = 3,
453}
454/// This type indicates if the lower or upper part of a matrix is stored in sparse storage.
455#[repr(u32)]
456#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
457pub enum cusparseFillMode_t {
458    /// The lower triangular part is stored.
459    CUSPARSE_FILL_MODE_LOWER = 0,
460    /// The upper triangular part is stored.
461    CUSPARSE_FILL_MODE_UPPER = 1,
462}
463/// This type indicates if the matrix diagonal entries are unity. The diagonal elements are always assumed to be present, but if [`cusparseDiagType_t::CUSPARSE_DIAG_TYPE_UNIT`] is passed to an API routine, then the routine assumes that all diagonal entries are unity and will not read or modify those entries. Note that in this case the routine assumes the diagonal entries are equal to one, regardless of what those entries are actually set to in memory.
464#[repr(u32)]
465#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
466pub enum cusparseDiagType_t {
467    /// The matrix diagonal has non-unit elements.
468    CUSPARSE_DIAG_TYPE_NON_UNIT = 0,
469    /// The matrix diagonal has unit elements.
470    CUSPARSE_DIAG_TYPE_UNIT = 1,
471}
472/// This type indicates if the base of the matrix indices is zero or one.
473#[repr(u32)]
474#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
475pub enum cusparseIndexBase_t {
476    /// The base index is zero (C compatibility).
477    CUSPARSE_INDEX_BASE_ZERO = 0,
478    /// The base index is one (Fortran compatibility).
479    CUSPARSE_INDEX_BASE_ONE = 1,
480}
481/// This type indicates which operations is applied to the related input (e.g. sparse matrix, or vector).
482#[repr(u32)]
483#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
484pub enum cusparseOperation_t {
485    /// The non-transpose operation is selected.
486    CUSPARSE_OPERATION_NON_TRANSPOSE = 0,
487    /// The transpose operation is selected.
488    CUSPARSE_OPERATION_TRANSPOSE = 1,
489    /// The conjugate transpose operation is selected.
490    CUSPARSE_OPERATION_CONJUGATE_TRANSPOSE = 2,
491}
492/// This type indicates whether the elements of a dense matrix should be parsed by rows or by columns (assuming column-major storage in memory of the dense matrix) in function cusparse\[S|D|C|Z\]nnz. Besides storage format of blocks in BSR format is also controlled by this type.
493#[repr(u32)]
494#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
495pub enum cusparseDirection_t {
496    /// The matrix should be parsed by rows.
497    CUSPARSE_DIRECTION_ROW = 0,
498    /// The matrix should be parsed by columns.
499    CUSPARSE_DIRECTION_COLUMN = 1,
500}
501/// This type indicates whether level information is generated and used in `csrsv2, csric02, csrilu02, bsrsv2, bsric02 and bsrilu02`.
502#[deprecated]
503#[repr(u32)]
504#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
505pub enum cusparseSolvePolicy_t {
506    /// no level information is generated and used.
507    #[deprecated]
508    CUSPARSE_SOLVE_POLICY_NO_LEVEL = 0,
509    /// generate and use level information.
510    #[deprecated]
511    CUSPARSE_SOLVE_POLICY_USE_LEVEL = 1,
512}
513#[repr(u32)]
514#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
515pub enum cusparseColorAlg_t {
516    CUSPARSE_COLOR_ALG0 = 0,
517    CUSPARSE_COLOR_ALG1 = 1,
518}
519unsafe extern "C" {
520    /// This function initializes the cuSPARSE library and creates a handle on the cuSPARSE context. It must be called before any other cuSPARSE API function is invoked. It allocates hardware resources necessary for accessing the GPU.
521    ///
522    /// # Parameters
523    ///
524    /// - `handle`: The pointer to the handle to the cuSPARSE context.
525    pub fn cusparseCreate(handle: *mut cusparseHandle_t) -> cusparseStatus_t;
526}
527unsafe extern "C" {
528    /// This function releases CPU-side resources used by the cuSPARSE library. The release of GPU-side resources may be deferred until the application shuts down.
529    ///
530    /// # Parameters
531    ///
532    /// - `handle`: The handle to the cuSPARSE context.
533    pub fn cusparseDestroy(handle: cusparseHandle_t) -> cusparseStatus_t;
534}
535unsafe extern "C" {
536    /// This function returns the version number of the cuSPARSE library.
537    ///
538    /// # Parameters
539    ///
540    /// - `handle`: cuSPARSE handle.
541    /// - `version`: The version number of the library.
542    pub fn cusparseGetVersion(
543        handle: cusparseHandle_t,
544        version: *mut ::core::ffi::c_int,
545    ) -> cusparseStatus_t;
546}
547unsafe extern "C" {
548    /// The function returns the value of the requested property. Refer to [`libraryPropertyType`] for supported types.
549    ///
550    /// [`libraryPropertyType`] (defined in `library_types.h`).
551    ///
552    /// # Parameters
553    ///
554    /// - `value`: Value of the requested property.
555    pub fn cusparseGetProperty(
556        type_: libraryPropertyType,
557        value: *mut ::core::ffi::c_int,
558    ) -> cusparseStatus_t;
559}
560unsafe extern "C" {
561    /// The function returns the string representation of an error code enum name. If the error code is not recognized, “unrecognized error code” is returned.
562    ///
563    /// # Parameters
564    ///
565    /// - `status`: Error code to convert to string.
566    pub fn cusparseGetErrorName(status: cusparseStatus_t) -> *const ::core::ffi::c_char;
567}
568unsafe extern "C" {
569    /// # Parameters
570    ///
571    /// - `status`: Error code to convert to string.
572    pub fn cusparseGetErrorString(
573        status: cusparseStatus_t,
574    ) -> *const ::core::ffi::c_char;
575}
576unsafe extern "C" {
577    /// This function sets the stream to be used by the cuSPARSE library to execute its routines.
578    ///
579    /// # Parameters
580    ///
581    /// - `handle`: The handle to the cuSPARSE context.
582    /// - `streamId`: The stream to be used by the library.
583    pub fn cusparseSetStream(
584        handle: cusparseHandle_t,
585        streamId: cudaStream_t,
586    ) -> cusparseStatus_t;
587}
588unsafe extern "C" {
589    /// This function gets the cuSPARSE library stream, which is being used to to execute all calls to the cuSPARSE library functions. If the cuSPARSE library stream is not set, all kernels use the default NULL stream.
590    ///
591    /// # Parameters
592    ///
593    /// - `handle`: The handle to the cuSPARSE context.
594    /// - `streamId`: The stream used by the library.
595    pub fn cusparseGetStream(
596        handle: cusparseHandle_t,
597        streamId: *mut cudaStream_t,
598    ) -> cusparseStatus_t;
599}
600unsafe extern "C" {
601    /// This function obtains the pointer mode used by the cuSPARSE library. Please see the section on the [`cusparsePointerMode_t`] type for more details.
602    ///
603    /// # Parameters
604    ///
605    /// - `handle`: The handle to the cuSPARSE context.
606    /// - `mode`: One of the enumerated pointer mode types.
607    pub fn cusparseGetPointerMode(
608        handle: cusparseHandle_t,
609        mode: *mut cusparsePointerMode_t,
610    ) -> cusparseStatus_t;
611}
612unsafe extern "C" {
613    /// This function sets the pointer mode used by the cuSPARSE library. The `default` is for the values to be passed by reference on the host. Please see the section on the `cublasPointerMode_t` type for more details.
614    ///
615    /// # Parameters
616    ///
617    /// - `handle`: The handle to the cuSPARSE context.
618    /// - `mode`: One of the enumerated pointer mode types.
619    pub fn cusparseSetPointerMode(
620        handle: cusparseHandle_t,
621        mode: cusparsePointerMode_t,
622    ) -> cusparseStatus_t;
623}
624pub type cusparseLoggerCallback_t = ::core::option::Option<
625    unsafe extern "C" fn(
626        logLevel: ::core::ffi::c_int,
627        functionName: *const ::core::ffi::c_char,
628        message: *const ::core::ffi::c_char,
629    ),
630>;
631unsafe extern "C" {
632    /// `Experimental`: The function sets the logging callback function.
633    ///
634    /// where [`cusparseLoggerCallback_t`] has the following signature.
635    pub fn cusparseLoggerSetCallback(
636        callback: cusparseLoggerCallback_t,
637    ) -> cusparseStatus_t;
638}
639unsafe extern "C" {
640    /// `Experimental`: The function sets the logging output file. Note: once registered using this function call, the provided file handle must not be closed unless the function is called again to switch to a different file handle.
641    ///
642    /// # Parameters
643    ///
644    /// - `file`: Pointer to an open file. File should have write permission.
645    pub fn cusparseLoggerSetFile(file: *mut FILE) -> cusparseStatus_t;
646}
647unsafe extern "C" {
648    /// `Experimental`: The function opens a logging output file in the given path.
649    ///
650    /// # Parameters
651    ///
652    /// - `logFile`: Path of the logging output file.
653    pub fn cusparseLoggerOpenFile(
654        logFile: *const ::core::ffi::c_char,
655    ) -> cusparseStatus_t;
656}
657unsafe extern "C" {
658    /// `Experimental`: The function sets the value of the logging level. path.
659    ///
660    /// # Parameters
661    ///
662    /// - `level`: Value of the logging level.
663    pub fn cusparseLoggerSetLevel(level: ::core::ffi::c_int) -> cusparseStatus_t;
664}
665unsafe extern "C" {
666    /// `Experimental`: The function sets the value of the logging mask.
667    ///
668    /// # Parameters
669    ///
670    /// - `mask`: Value of the logging mask.
671    pub fn cusparseLoggerSetMask(mask: ::core::ffi::c_int) -> cusparseStatus_t;
672}
673unsafe extern "C" {
674    pub fn cusparseLoggerForceDisable() -> cusparseStatus_t;
675}
676unsafe extern "C" {
677    /// This function initializes the matrix descriptor. It sets the fields `MatrixType` and `IndexBase` to the `default` values [`cusparseMatrixType_t::CUSPARSE_MATRIX_TYPE_GENERAL`] and [`cusparseIndexBase_t::CUSPARSE_INDEX_BASE_ZERO`], respectively, while leaving other fields uninitialized.
678    ///
679    /// # Parameters
680    ///
681    /// - `descrA`: the pointer to the matrix descriptor.
682    pub fn cusparseCreateMatDescr(descrA: *mut cusparseMatDescr_t) -> cusparseStatus_t;
683}
684unsafe extern "C" {
685    /// This function releases the memory allocated for the matrix descriptor.
686    ///
687    /// # Parameters
688    ///
689    /// - `descrA`: the matrix descriptor.
690    pub fn cusparseDestroyMatDescr(descrA: cusparseMatDescr_t) -> cusparseStatus_t;
691}
692unsafe extern "C" {
693    /// This function sets the `MatrixType` field of the matrix descriptor `descrA`.
694    ///
695    /// # Parameters
696    ///
697    /// - `descrA`: the matrix descriptor.
698    pub fn cusparseSetMatType(
699        descrA: cusparseMatDescr_t,
700        type_: cusparseMatrixType_t,
701    ) -> cusparseStatus_t;
702}
703unsafe extern "C" {
704    /// This function returns the `MatrixType` field of the matrix descriptor `descrA`.
705    ///
706    /// # Parameters
707    ///
708    /// - `descrA`: the matrix descriptor.
709    pub fn cusparseGetMatType(descrA: cusparseMatDescr_t) -> cusparseMatrixType_t;
710}
711unsafe extern "C" {
712    /// This function sets the `FillMode` field of the matrix descriptor `descrA`.
713    ///
714    /// # Parameters
715    ///
716    /// - `descrA`: the matrix descriptor.
717    pub fn cusparseSetMatFillMode(
718        descrA: cusparseMatDescr_t,
719        fillMode: cusparseFillMode_t,
720    ) -> cusparseStatus_t;
721}
722unsafe extern "C" {
723    /// This function returns the `FillMode` field of the matrix descriptor `descrA`.
724    ///
725    /// # Parameters
726    ///
727    /// - `descrA`: the matrix descriptor.
728    pub fn cusparseGetMatFillMode(descrA: cusparseMatDescr_t) -> cusparseFillMode_t;
729}
730unsafe extern "C" {
731    /// This function sets the `DiagType` field of the matrix descriptor `descrA`.
732    ///
733    /// # Parameters
734    ///
735    /// - `descrA`: the matrix descriptor.
736    pub fn cusparseSetMatDiagType(
737        descrA: cusparseMatDescr_t,
738        diagType: cusparseDiagType_t,
739    ) -> cusparseStatus_t;
740}
741unsafe extern "C" {
742    /// This function returns the `DiagType` field of the matrix descriptor `descrA`.
743    ///
744    /// # Parameters
745    ///
746    /// - `descrA`: the matrix descriptor.
747    pub fn cusparseGetMatDiagType(descrA: cusparseMatDescr_t) -> cusparseDiagType_t;
748}
749unsafe extern "C" {
750    /// This function sets the `IndexBase` field of the matrix descriptor `descrA`.
751    ///
752    /// # Parameters
753    ///
754    /// - `descrA`: the matrix descriptor.
755    pub fn cusparseSetMatIndexBase(
756        descrA: cusparseMatDescr_t,
757        base: cusparseIndexBase_t,
758    ) -> cusparseStatus_t;
759}
760unsafe extern "C" {
761    /// This function returns the `IndexBase` field of the matrix descriptor `descrA`.
762    ///
763    /// # Parameters
764    ///
765    /// - `descrA`: the matrix descriptor.
766    pub fn cusparseGetMatIndexBase(descrA: cusparseMatDescr_t) -> cusparseIndexBase_t;
767}
768unsafe extern "C" {
769    /// This function creates and initializes the solve and analysis structure of incomplete Cholesky to `default` values.
770    ///
771    /// # Parameters
772    ///
773    /// - `info`: the pointer to the solve and analysis structure of incomplete Cholesky.
774    #[deprecated]
775    pub fn cusparseCreateCsric02Info(info: *mut csric02Info_t) -> cusparseStatus_t;
776}
777unsafe extern "C" {
778    /// This function destroys and releases any memory required by the structure.
779    ///
780    /// # Parameters
781    ///
782    /// - `info`: the solve `(csric02_solve)` and analysis `(csric02_analysis)` structure.
783    #[deprecated]
784    pub fn cusparseDestroyCsric02Info(info: csric02Info_t) -> cusparseStatus_t;
785}
786unsafe extern "C" {
787    /// This function creates and initializes the solve and analysis structure of block incomplete Cholesky to `default` values.
788    ///
789    /// # Parameters
790    ///
791    /// - `info`: the pointer to the solve and analysis structure of block incomplete Cholesky.
792    #[deprecated]
793    pub fn cusparseCreateBsric02Info(info: *mut bsric02Info_t) -> cusparseStatus_t;
794}
795unsafe extern "C" {
796    /// This function destroys and releases any memory required by the structure.
797    ///
798    /// # Parameters
799    ///
800    /// - `info`: the solve `(bsric02_solve)` and analysis `(bsric02_analysis)` structure.
801    #[deprecated]
802    pub fn cusparseDestroyBsric02Info(info: bsric02Info_t) -> cusparseStatus_t;
803}
804unsafe extern "C" {
805    /// This function creates and initializes the solve and analysis structure of incomplete LU to `default` values.
806    ///
807    /// # Parameters
808    ///
809    /// - `info`: the pointer to the solve and analysis structure of incomplete LU.
810    #[deprecated]
811    pub fn cusparseCreateCsrilu02Info(info: *mut csrilu02Info_t) -> cusparseStatus_t;
812}
813unsafe extern "C" {
814    /// This function destroys and releases any memory required by the structure.
815    ///
816    /// # Parameters
817    ///
818    /// - `info`: the solve `(csrilu02_solve)` and analysis `(csrilu02_analysis)` structure.
819    #[deprecated]
820    pub fn cusparseDestroyCsrilu02Info(info: csrilu02Info_t) -> cusparseStatus_t;
821}
822unsafe extern "C" {
823    /// This function creates and initializes the solve and analysis structure of block incomplete LU to `default` values.
824    ///
825    /// # Parameters
826    ///
827    /// - `info`: the pointer to the solve and analysis structure of block incomplete LU.
828    #[deprecated]
829    pub fn cusparseCreateBsrilu02Info(info: *mut bsrilu02Info_t) -> cusparseStatus_t;
830}
831unsafe extern "C" {
832    /// This function destroys and releases any memory required by the structure.
833    ///
834    /// # Parameters
835    ///
836    /// - `info`: the solve `(bsrilu02_solve)` and analysis `(bsrilu02_analysis)` structure.
837    #[deprecated]
838    pub fn cusparseDestroyBsrilu02Info(info: bsrilu02Info_t) -> cusparseStatus_t;
839}
840unsafe extern "C" {
841    /// This function creates and initializes the solve and analysis structure of bsrsv2 to `default` values.
842    ///
843    /// # Parameters
844    ///
845    /// - `info`: the pointer to the solve and analysis structure of bsrsv2.
846    #[deprecated]
847    pub fn cusparseCreateBsrsv2Info(info: *mut bsrsv2Info_t) -> cusparseStatus_t;
848}
849unsafe extern "C" {
850    /// This function destroys and releases any memory required by the structure.
851    ///
852    /// # Parameters
853    ///
854    /// - `info`: the solve `(bsrsv2_solve)` and analysis `(bsrsv2_analysis)` structure.
855    #[deprecated]
856    pub fn cusparseDestroyBsrsv2Info(info: bsrsv2Info_t) -> cusparseStatus_t;
857}
858unsafe extern "C" {
859    /// This function creates and initializes the solve and analysis structure of bsrsm2 to `default` values.
860    ///
861    /// # Parameters
862    ///
863    /// - `info`: the pointer to the solve and analysis structure of bsrsm2.
864    #[deprecated]
865    pub fn cusparseCreateBsrsm2Info(info: *mut bsrsm2Info_t) -> cusparseStatus_t;
866}
867unsafe extern "C" {
868    /// This function destroys and releases any memory required by the structure.
869    ///
870    /// # Parameters
871    ///
872    /// - `info`: the solve `(bsrsm2_solve)` and analysis `(bsrsm2_analysis)` structure.
873    #[deprecated]
874    pub fn cusparseDestroyBsrsm2Info(info: bsrsm2Info_t) -> cusparseStatus_t;
875}
876unsafe extern "C" {
877    pub fn cusparseCreateCsru2csrInfo(info: *mut csru2csrInfo_t) -> cusparseStatus_t;
878}
879unsafe extern "C" {
880    pub fn cusparseDestroyCsru2csrInfo(info: csru2csrInfo_t) -> cusparseStatus_t;
881}
882unsafe extern "C" {
883    /// This function creates and initializes the [`cusparseColorInfo_t`] structure to `default` values.
884    ///
885    /// # Parameters
886    ///
887    /// - `info`: the pointer to the [`cusparseColorInfo_t`] structure.
888    #[deprecated]
889    pub fn cusparseCreateColorInfo(info: *mut cusparseColorInfo_t) -> cusparseStatus_t;
890}
891unsafe extern "C" {
892    /// This function destroys and releases any memory required by the structure.
893    ///
894    /// # Parameters
895    ///
896    /// - `info`: the pointer to the structure of `csrcolor()`.
897    #[deprecated]
898    pub fn cusparseDestroyColorInfo(info: cusparseColorInfo_t) -> cusparseStatus_t;
899}
900unsafe extern "C" {
901    /// This function creates and initializes structure of `prune` to `default` values.
902    ///
903    /// # Parameters
904    ///
905    /// - `info`: the pointer to the structure of `prune`.
906    #[deprecated]
907    pub fn cusparseCreatePruneInfo(info: *mut pruneInfo_t) -> cusparseStatus_t;
908}
909unsafe extern "C" {
910    /// This function destroys and releases any memory required by the structure.
911    ///
912    /// # Parameters
913    ///
914    /// - `info`: the structure of `prune`.
915    #[deprecated]
916    pub fn cusparseDestroyPruneInfo(info: pruneInfo_t) -> cusparseStatus_t;
917}
918unsafe extern "C" {
919    /// This function performs the matrix-vector operation
920    ///
921    /// `A` is an $m \times n$ dense matrix and a sparse vector `x` that is defined in a sparse storage format by the two arrays `xVal, xInd` of length `nnz`, and `y` is a dense vector; $\alpha \\;$ and $\beta \\;$ are scalars; and:
922    /// $$
923    /// \operatorname{op}(A) =
924    /// \begin{cases}
925    /// A & \text{if } trans = \text{CUSPARSE_OPERATION_NON_TRANSPOSE} \\
926    /// A^T & \text{if } trans = \text{CUSPARSE_OPERATION_TRANSPOSE}
927    /// \end{cases}
928    /// $$
929    ///
930    /// * The routine supports asynchronous execution
931    /// * The routine supports CUDA graph capture
932    ///
933    /// The function `cusparse&lt;t>gemvi_bufferSize()` returns the size of buffer used in `cusparse&lt;t>gemvi()`.
934    pub fn cusparseSgemvi(
935        handle: cusparseHandle_t,
936        transA: cusparseOperation_t,
937        m: ::core::ffi::c_int,
938        n: ::core::ffi::c_int,
939        alpha: *const f32,
940        A: *const f32,
941        lda: ::core::ffi::c_int,
942        nnz: ::core::ffi::c_int,
943        xVal: *const f32,
944        xInd: *const ::core::ffi::c_int,
945        beta: *const f32,
946        y: *mut f32,
947        idxBase: cusparseIndexBase_t,
948        pBuffer: *mut ::core::ffi::c_void,
949    ) -> cusparseStatus_t;
950}
951unsafe extern "C" {
952    pub fn cusparseSgemvi_bufferSize(
953        handle: cusparseHandle_t,
954        transA: cusparseOperation_t,
955        m: ::core::ffi::c_int,
956        n: ::core::ffi::c_int,
957        nnz: ::core::ffi::c_int,
958        pBufferSize: *mut ::core::ffi::c_int,
959    ) -> cusparseStatus_t;
960}
961unsafe extern "C" {
962    /// This function performs the matrix-vector operation
963    ///
964    /// `A` is an $m \times n$ dense matrix and a sparse vector `x` that is defined in a sparse storage format by the two arrays `xVal, xInd` of length `nnz`, and `y` is a dense vector; $\alpha \\;$ and $\beta \\;$ are scalars; and:
965    /// $$
966    /// \operatorname{op}(A) =
967    /// \begin{cases}
968    /// A & \text{if } trans = \text{CUSPARSE_OPERATION_NON_TRANSPOSE} \\
969    /// A^T & \text{if } trans = \text{CUSPARSE_OPERATION_TRANSPOSE}
970    /// \end{cases}
971    /// $$
972    ///
973    /// * The routine supports asynchronous execution
974    /// * The routine supports CUDA graph capture
975    ///
976    /// The function `cusparse&lt;t>gemvi_bufferSize()` returns the size of buffer used in `cusparse&lt;t>gemvi()`.
977    pub fn cusparseDgemvi(
978        handle: cusparseHandle_t,
979        transA: cusparseOperation_t,
980        m: ::core::ffi::c_int,
981        n: ::core::ffi::c_int,
982        alpha: *const f64,
983        A: *const f64,
984        lda: ::core::ffi::c_int,
985        nnz: ::core::ffi::c_int,
986        xVal: *const f64,
987        xInd: *const ::core::ffi::c_int,
988        beta: *const f64,
989        y: *mut f64,
990        idxBase: cusparseIndexBase_t,
991        pBuffer: *mut ::core::ffi::c_void,
992    ) -> cusparseStatus_t;
993}
994unsafe extern "C" {
995    pub fn cusparseDgemvi_bufferSize(
996        handle: cusparseHandle_t,
997        transA: cusparseOperation_t,
998        m: ::core::ffi::c_int,
999        n: ::core::ffi::c_int,
1000        nnz: ::core::ffi::c_int,
1001        pBufferSize: *mut ::core::ffi::c_int,
1002    ) -> cusparseStatus_t;
1003}
1004unsafe extern "C" {
1005    /// This function performs the matrix-vector operation
1006    ///
1007    /// `A` is an $m \times n$ dense matrix and a sparse vector `x` that is defined in a sparse storage format by the two arrays `xVal, xInd` of length `nnz`, and `y` is a dense vector; $\alpha \\;$ and $\beta \\;$ are scalars; and:
1008    /// $$
1009    /// \operatorname{op}(A) =
1010    /// \begin{cases}
1011    /// A & \text{if } trans = \text{CUSPARSE_OPERATION_NON_TRANSPOSE} \\
1012    /// A^T & \text{if } trans = \text{CUSPARSE_OPERATION_TRANSPOSE}
1013    /// \end{cases}
1014    /// $$
1015    ///
1016    /// * The routine supports asynchronous execution
1017    /// * The routine supports CUDA graph capture
1018    ///
1019    /// The function `cusparse&lt;t>gemvi_bufferSize()` returns the size of buffer used in `cusparse&lt;t>gemvi()`.
1020    pub fn cusparseCgemvi(
1021        handle: cusparseHandle_t,
1022        transA: cusparseOperation_t,
1023        m: ::core::ffi::c_int,
1024        n: ::core::ffi::c_int,
1025        alpha: *const cuComplex,
1026        A: *const cuComplex,
1027        lda: ::core::ffi::c_int,
1028        nnz: ::core::ffi::c_int,
1029        xVal: *const cuComplex,
1030        xInd: *const ::core::ffi::c_int,
1031        beta: *const cuComplex,
1032        y: *mut cuComplex,
1033        idxBase: cusparseIndexBase_t,
1034        pBuffer: *mut ::core::ffi::c_void,
1035    ) -> cusparseStatus_t;
1036}
1037unsafe extern "C" {
1038    pub fn cusparseCgemvi_bufferSize(
1039        handle: cusparseHandle_t,
1040        transA: cusparseOperation_t,
1041        m: ::core::ffi::c_int,
1042        n: ::core::ffi::c_int,
1043        nnz: ::core::ffi::c_int,
1044        pBufferSize: *mut ::core::ffi::c_int,
1045    ) -> cusparseStatus_t;
1046}
1047unsafe extern "C" {
1048    /// This function performs the matrix-vector operation
1049    ///
1050    /// `A` is an $m \times n$ dense matrix and a sparse vector `x` that is defined in a sparse storage format by the two arrays `xVal, xInd` of length `nnz`, and `y` is a dense vector; $\alpha \\;$ and $\beta \\;$ are scalars; and:
1051    /// $$
1052    /// \operatorname{op}(A) =
1053    /// \begin{cases}
1054    /// A & \text{if } trans = \text{CUSPARSE_OPERATION_NON_TRANSPOSE} \\
1055    /// A^T & \text{if } trans = \text{CUSPARSE_OPERATION_TRANSPOSE}
1056    /// \end{cases}
1057    /// $$
1058    ///
1059    /// * The routine supports asynchronous execution
1060    /// * The routine supports CUDA graph capture
1061    ///
1062    /// The function `cusparse&lt;t>gemvi_bufferSize()` returns the size of buffer used in `cusparse&lt;t>gemvi()`.
1063    pub fn cusparseZgemvi(
1064        handle: cusparseHandle_t,
1065        transA: cusparseOperation_t,
1066        m: ::core::ffi::c_int,
1067        n: ::core::ffi::c_int,
1068        alpha: *const cuDoubleComplex,
1069        A: *const cuDoubleComplex,
1070        lda: ::core::ffi::c_int,
1071        nnz: ::core::ffi::c_int,
1072        xVal: *const cuDoubleComplex,
1073        xInd: *const ::core::ffi::c_int,
1074        beta: *const cuDoubleComplex,
1075        y: *mut cuDoubleComplex,
1076        idxBase: cusparseIndexBase_t,
1077        pBuffer: *mut ::core::ffi::c_void,
1078    ) -> cusparseStatus_t;
1079}
1080unsafe extern "C" {
1081    pub fn cusparseZgemvi_bufferSize(
1082        handle: cusparseHandle_t,
1083        transA: cusparseOperation_t,
1084        m: ::core::ffi::c_int,
1085        n: ::core::ffi::c_int,
1086        nnz: ::core::ffi::c_int,
1087        pBufferSize: *mut ::core::ffi::c_int,
1088    ) -> cusparseStatus_t;
1089}
1090unsafe extern "C" {
1091    /// This function performs the matrix-vector operation
1092    ///
1093    /// where $A\text{ is an }(mb \ast blockDim) \times (nb \ast blockDim)$ sparse matrix that is defined in BSR storage format by the three arrays `bsrVal`, `bsrRowPtr`, and `bsrColInd`); `x` and `y` are vectors; $\alpha\text{ and }\beta$ are scalars; and:
1094    /// $$
1095    /// \operatorname{op}(A) =
1096    /// \begin{cases}
1097    /// A & \text{if } trans = \text{CUSPARSE_OPERATION_NON_TRANSPOSE} \\
1098    /// A^T & \text{if } trans = \text{CUSPARSE_OPERATION_TRANSPOSE} \\
1099    /// A^H & \text{if } trans = \text{CUSPARSE_OPERATION_CONJUGATE_TRANSPOSE}
1100    /// \end{cases}
1101    /// $$
1102    ///
1103    /// `bsrmv()` has the following properties:
1104    ///
1105    /// * The routine requires no extra storage.
1106    /// * The routine supports asynchronous execution.
1107    /// * The routine supports CUDA graph capture.
1108    ///
1109    /// Several comments on `bsrmv()`:
1110    ///
1111    /// * Only `blockDim > 1` is supported
1112    /// * Only [`cusparseOperation_t::CUSPARSE_OPERATION_NON_TRANSPOSE`] is supported, that is
1113    ///
1114    /// * Only [`cusparseMatrixType_t::CUSPARSE_MATRIX_TYPE_GENERAL`] is supported.
1115    /// * The size of vector `x` should be $(nb \ast blockDim)$ at least, and the size of vector `y` should be $(mb \ast blockDim)$ at least; otherwise, the kernel may return [`cusparseStatus_t::CUSPARSE_STATUS_EXECUTION_FAILED`] because of an out-of-bounds array.
1116    ///
1117    /// For example, suppose the user has a CSR format and wants to try `bsrmv()`, the following code demonstrates how to use `csr2bsr()` conversion and `bsrmv()` multiplication in single precision.
1118    pub fn cusparseSbsrmv(
1119        handle: cusparseHandle_t,
1120        dirA: cusparseDirection_t,
1121        transA: cusparseOperation_t,
1122        mb: ::core::ffi::c_int,
1123        nb: ::core::ffi::c_int,
1124        nnzb: ::core::ffi::c_int,
1125        alpha: *const f32,
1126        descrA: cusparseMatDescr_t,
1127        bsrSortedValA: *const f32,
1128        bsrSortedRowPtrA: *const ::core::ffi::c_int,
1129        bsrSortedColIndA: *const ::core::ffi::c_int,
1130        blockDim: ::core::ffi::c_int,
1131        x: *const f32,
1132        beta: *const f32,
1133        y: *mut f32,
1134    ) -> cusparseStatus_t;
1135}
1136unsafe extern "C" {
1137    /// This function performs the matrix-vector operation
1138    ///
1139    /// where $A\text{ is an }(mb \ast blockDim) \times (nb \ast blockDim)$ sparse matrix that is defined in BSR storage format by the three arrays `bsrVal`, `bsrRowPtr`, and `bsrColInd`); `x` and `y` are vectors; $\alpha\text{ and }\beta$ are scalars; and:
1140    /// $$
1141    /// \operatorname{op}(A) =
1142    /// \begin{cases}
1143    /// A & \text{if } trans = \text{CUSPARSE_OPERATION_NON_TRANSPOSE} \\
1144    /// A^T & \text{if } trans = \text{CUSPARSE_OPERATION_TRANSPOSE} \\
1145    /// A^H & \text{if } trans = \text{CUSPARSE_OPERATION_CONJUGATE_TRANSPOSE}
1146    /// \end{cases}
1147    /// $$
1148    ///
1149    /// `bsrmv()` has the following properties:
1150    ///
1151    /// * The routine requires no extra storage.
1152    /// * The routine supports asynchronous execution.
1153    /// * The routine supports CUDA graph capture.
1154    ///
1155    /// Several comments on `bsrmv()`:
1156    ///
1157    /// * Only `blockDim > 1` is supported
1158    /// * Only [`cusparseOperation_t::CUSPARSE_OPERATION_NON_TRANSPOSE`] is supported, that is
1159    ///
1160    /// * Only [`cusparseMatrixType_t::CUSPARSE_MATRIX_TYPE_GENERAL`] is supported.
1161    /// * The size of vector `x` should be $(nb \ast blockDim)$ at least, and the size of vector `y` should be $(mb \ast blockDim)$ at least; otherwise, the kernel may return [`cusparseStatus_t::CUSPARSE_STATUS_EXECUTION_FAILED`] because of an out-of-bounds array.
1162    ///
1163    /// For example, suppose the user has a CSR format and wants to try `bsrmv()`, the following code demonstrates how to use `csr2bsr()` conversion and `bsrmv()` multiplication in single precision.
1164    pub fn cusparseDbsrmv(
1165        handle: cusparseHandle_t,
1166        dirA: cusparseDirection_t,
1167        transA: cusparseOperation_t,
1168        mb: ::core::ffi::c_int,
1169        nb: ::core::ffi::c_int,
1170        nnzb: ::core::ffi::c_int,
1171        alpha: *const f64,
1172        descrA: cusparseMatDescr_t,
1173        bsrSortedValA: *const f64,
1174        bsrSortedRowPtrA: *const ::core::ffi::c_int,
1175        bsrSortedColIndA: *const ::core::ffi::c_int,
1176        blockDim: ::core::ffi::c_int,
1177        x: *const f64,
1178        beta: *const f64,
1179        y: *mut f64,
1180    ) -> cusparseStatus_t;
1181}
1182unsafe extern "C" {
1183    /// This function performs the matrix-vector operation
1184    ///
1185    /// where $A\text{ is an }(mb \ast blockDim) \times (nb \ast blockDim)$ sparse matrix that is defined in BSR storage format by the three arrays `bsrVal`, `bsrRowPtr`, and `bsrColInd`); `x` and `y` are vectors; $\alpha\text{ and }\beta$ are scalars; and:
1186    /// $$
1187    /// \operatorname{op}(A) =
1188    /// \begin{cases}
1189    /// A & \text{if } trans = \text{CUSPARSE_OPERATION_NON_TRANSPOSE} \\
1190    /// A^T & \text{if } trans = \text{CUSPARSE_OPERATION_TRANSPOSE} \\
1191    /// A^H & \text{if } trans = \text{CUSPARSE_OPERATION_CONJUGATE_TRANSPOSE}
1192    /// \end{cases}
1193    /// $$
1194    ///
1195    /// `bsrmv()` has the following properties:
1196    ///
1197    /// * The routine requires no extra storage.
1198    /// * The routine supports asynchronous execution.
1199    /// * The routine supports CUDA graph capture.
1200    ///
1201    /// Several comments on `bsrmv()`:
1202    ///
1203    /// * Only `blockDim > 1` is supported
1204    /// * Only [`cusparseOperation_t::CUSPARSE_OPERATION_NON_TRANSPOSE`] is supported, that is
1205    ///
1206    /// * Only [`cusparseMatrixType_t::CUSPARSE_MATRIX_TYPE_GENERAL`] is supported.
1207    /// * The size of vector `x` should be $(nb \ast blockDim)$ at least, and the size of vector `y` should be $(mb \ast blockDim)$ at least; otherwise, the kernel may return [`cusparseStatus_t::CUSPARSE_STATUS_EXECUTION_FAILED`] because of an out-of-bounds array.
1208    ///
1209    /// For example, suppose the user has a CSR format and wants to try `bsrmv()`, the following code demonstrates how to use `csr2bsr()` conversion and `bsrmv()` multiplication in single precision.
1210    pub fn cusparseCbsrmv(
1211        handle: cusparseHandle_t,
1212        dirA: cusparseDirection_t,
1213        transA: cusparseOperation_t,
1214        mb: ::core::ffi::c_int,
1215        nb: ::core::ffi::c_int,
1216        nnzb: ::core::ffi::c_int,
1217        alpha: *const cuComplex,
1218        descrA: cusparseMatDescr_t,
1219        bsrSortedValA: *const cuComplex,
1220        bsrSortedRowPtrA: *const ::core::ffi::c_int,
1221        bsrSortedColIndA: *const ::core::ffi::c_int,
1222        blockDim: ::core::ffi::c_int,
1223        x: *const cuComplex,
1224        beta: *const cuComplex,
1225        y: *mut cuComplex,
1226    ) -> cusparseStatus_t;
1227}
1228unsafe extern "C" {
1229    /// This function performs the matrix-vector operation
1230    ///
1231    /// where $A\text{ is an }(mb \ast blockDim) \times (nb \ast blockDim)$ sparse matrix that is defined in BSR storage format by the three arrays `bsrVal`, `bsrRowPtr`, and `bsrColInd`); `x` and `y` are vectors; $\alpha\text{ and }\beta$ are scalars; and:
1232    /// $$
1233    /// \operatorname{op}(A) =
1234    /// \begin{cases}
1235    /// A & \text{if } trans = \text{CUSPARSE_OPERATION_NON_TRANSPOSE} \\
1236    /// A^T & \text{if } trans = \text{CUSPARSE_OPERATION_TRANSPOSE} \\
1237    /// A^H & \text{if } trans = \text{CUSPARSE_OPERATION_CONJUGATE_TRANSPOSE}
1238    /// \end{cases}
1239    /// $$
1240    ///
1241    /// `bsrmv()` has the following properties:
1242    ///
1243    /// * The routine requires no extra storage.
1244    /// * The routine supports asynchronous execution.
1245    /// * The routine supports CUDA graph capture.
1246    ///
1247    /// Several comments on `bsrmv()`:
1248    ///
1249    /// * Only `blockDim > 1` is supported
1250    /// * Only [`cusparseOperation_t::CUSPARSE_OPERATION_NON_TRANSPOSE`] is supported, that is
1251    ///
1252    /// * Only [`cusparseMatrixType_t::CUSPARSE_MATRIX_TYPE_GENERAL`] is supported.
1253    /// * The size of vector `x` should be $(nb \ast blockDim)$ at least, and the size of vector `y` should be $(mb \ast blockDim)$ at least; otherwise, the kernel may return [`cusparseStatus_t::CUSPARSE_STATUS_EXECUTION_FAILED`] because of an out-of-bounds array.
1254    ///
1255    /// For example, suppose the user has a CSR format and wants to try `bsrmv()`, the following code demonstrates how to use `csr2bsr()` conversion and `bsrmv()` multiplication in single precision.
1256    pub fn cusparseZbsrmv(
1257        handle: cusparseHandle_t,
1258        dirA: cusparseDirection_t,
1259        transA: cusparseOperation_t,
1260        mb: ::core::ffi::c_int,
1261        nb: ::core::ffi::c_int,
1262        nnzb: ::core::ffi::c_int,
1263        alpha: *const cuDoubleComplex,
1264        descrA: cusparseMatDescr_t,
1265        bsrSortedValA: *const cuDoubleComplex,
1266        bsrSortedRowPtrA: *const ::core::ffi::c_int,
1267        bsrSortedColIndA: *const ::core::ffi::c_int,
1268        blockDim: ::core::ffi::c_int,
1269        x: *const cuDoubleComplex,
1270        beta: *const cuDoubleComplex,
1271        y: *mut cuDoubleComplex,
1272    ) -> cusparseStatus_t;
1273}
1274unsafe extern "C" {
1275    /// This function performs a `bsrmv` and a mask operation
1276    ///
1277    /// where $A\text{ is an }(mb \ast blockDim) \times (nb \ast blockDim)$ sparse matrix that is defined in BSRX storage format by the four arrays `bsrVal`, `bsrRowPtr`, `bsrEndPtr`, and `bsrColInd`); `x` and `y` are vectors; $\alpha\text{~and~}\beta$ are scalars; and:
1278    /// $$
1279    /// \operatorname{op}(A) =
1280    /// \begin{cases}
1281    /// A & \text{if } trans = \text{CUSPARSE_OPERATION_NON_TRANSPOSE} \\
1282    /// A^T & \text{if } trans = \text{CUSPARSE_OPERATION_TRANSPOSE} \\
1283    /// A^H & \text{if } trans = \text{CUSPARSE_OPERATION_CONJUGATE_TRANSPOSE}
1284    /// \end{cases}
1285    /// $$
1286    ///
1287    /// The mask operation is defined by array `bsrMaskPtr` which contains updated block row indices of $y$. If row $i$ is not specified in `bsrMaskPtr`, then `bsrxmv()` does not touch row block $i$ of $A$ and $y$.
1288    ///
1289    /// For example, consider the $2 \times 3$ block matrix $A$:
1290    ///
1291    /// and its one-based BSR format (three vector form) is:
1292    ///
1293    /// Suppose we want to do the following `bsrmv` operation on a matrix $\bar{A}$ which is slightly different from $A$.
1294    ///
1295    /// We don’t need to create another BSR format for the new matrix $\bar{A}$, all that we should do is to keep `bsrVal` and `bsrColInd` unchanged, but modify `bsrRowPtr` and add an additional array `bsrEndPtr` which points to the last nonzero elements per row of $\bar{A}$ plus 1.
1296    ///
1297    /// For example, the following `bsrRowPtr` and `bsrEndPtr` can represent matrix $\bar{A}$:
1298    ///
1299    /// Further we can use a mask operator (specified by array `bsrMaskPtr`) to update particular block row indices of $y$ only because $y_{1}$ is never changed. In this case, `bsrMaskPtr`$=$ \[2\] and `sizeOfMask`=1.
1300    ///
1301    /// The mask operator is equivalent to the following operation:
1302    ///
1303    /// If a block row is not present in the `bsrMaskPtr`, then no calculation is performed on that row, and the corresponding value in `y` is unmodified. The question mark “?” is used to inidcate row blocks not in `bsrMaskPtr`.
1304    ///
1305    /// In this case, first row block is not present in `bsrMaskPtr`, so `bsrRowPtr\[0\]` and `bsrEndPtr\[0\]` are not touched also.
1306    ///
1307    /// `bsrxmv()` has the following properties:
1308    ///
1309    /// * The routine requires no extra storage.
1310    /// * The routine supports asynchronous execution.
1311    /// * The routine supports CUDA graph capture.
1312    ///
1313    /// A couple of comments on `bsrxmv()`:
1314    ///
1315    /// * Only `blockDim > 1` is supported
1316    /// * Only [`cusparseOperation_t::CUSPARSE_OPERATION_NON_TRANSPOSE`] and [`cusparseMatrixType_t::CUSPARSE_MATRIX_TYPE_GENERAL`] are supported.
1317    /// * Parameters `bsrMaskPtr`, `bsrRowPtr`, `bsrEndPtr` and `bsrColInd` are consistent with base index, either one-based or zero-based. The above example is one-based.
1318    pub fn cusparseSbsrxmv(
1319        handle: cusparseHandle_t,
1320        dirA: cusparseDirection_t,
1321        transA: cusparseOperation_t,
1322        sizeOfMask: ::core::ffi::c_int,
1323        mb: ::core::ffi::c_int,
1324        nb: ::core::ffi::c_int,
1325        nnzb: ::core::ffi::c_int,
1326        alpha: *const f32,
1327        descrA: cusparseMatDescr_t,
1328        bsrSortedValA: *const f32,
1329        bsrSortedMaskPtrA: *const ::core::ffi::c_int,
1330        bsrSortedRowPtrA: *const ::core::ffi::c_int,
1331        bsrSortedEndPtrA: *const ::core::ffi::c_int,
1332        bsrSortedColIndA: *const ::core::ffi::c_int,
1333        blockDim: ::core::ffi::c_int,
1334        x: *const f32,
1335        beta: *const f32,
1336        y: *mut f32,
1337    ) -> cusparseStatus_t;
1338}
1339unsafe extern "C" {
1340    /// This function performs a `bsrmv` and a mask operation
1341    ///
1342    /// where $A\text{ is an }(mb \ast blockDim) \times (nb \ast blockDim)$ sparse matrix that is defined in BSRX storage format by the four arrays `bsrVal`, `bsrRowPtr`, `bsrEndPtr`, and `bsrColInd`); `x` and `y` are vectors; $\alpha\text{~and~}\beta$ are scalars; and:
1343    /// $$
1344    /// \operatorname{op}(A) =
1345    /// \begin{cases}
1346    /// A & \text{if } trans = \text{CUSPARSE_OPERATION_NON_TRANSPOSE} \\
1347    /// A^T & \text{if } trans = \text{CUSPARSE_OPERATION_TRANSPOSE} \\
1348    /// A^H & \text{if } trans = \text{CUSPARSE_OPERATION_CONJUGATE_TRANSPOSE}
1349    /// \end{cases}
1350    /// $$
1351    ///
1352    /// The mask operation is defined by array `bsrMaskPtr` which contains updated block row indices of $y$. If row $i$ is not specified in `bsrMaskPtr`, then `bsrxmv()` does not touch row block $i$ of $A$ and $y$.
1353    ///
1354    /// For example, consider the $2 \times 3$ block matrix $A$:
1355    ///
1356    /// and its one-based BSR format (three vector form) is:
1357    ///
1358    /// Suppose we want to do the following `bsrmv` operation on a matrix $\bar{A}$ which is slightly different from $A$.
1359    ///
1360    /// We don’t need to create another BSR format for the new matrix $\bar{A}$, all that we should do is to keep `bsrVal` and `bsrColInd` unchanged, but modify `bsrRowPtr` and add an additional array `bsrEndPtr` which points to the last nonzero elements per row of $\bar{A}$ plus 1.
1361    ///
1362    /// For example, the following `bsrRowPtr` and `bsrEndPtr` can represent matrix $\bar{A}$:
1363    ///
1364    /// Further we can use a mask operator (specified by array `bsrMaskPtr`) to update particular block row indices of $y$ only because $y_{1}$ is never changed. In this case, `bsrMaskPtr`$=$ \[2\] and `sizeOfMask`=1.
1365    ///
1366    /// The mask operator is equivalent to the following operation:
1367    ///
1368    /// If a block row is not present in the `bsrMaskPtr`, then no calculation is performed on that row, and the corresponding value in `y` is unmodified. The question mark “?” is used to inidcate row blocks not in `bsrMaskPtr`.
1369    ///
1370    /// In this case, first row block is not present in `bsrMaskPtr`, so `bsrRowPtr\[0\]` and `bsrEndPtr\[0\]` are not touched also.
1371    ///
1372    /// `bsrxmv()` has the following properties:
1373    ///
1374    /// * The routine requires no extra storage.
1375    /// * The routine supports asynchronous execution.
1376    /// * The routine supports CUDA graph capture.
1377    ///
1378    /// A couple of comments on `bsrxmv()`:
1379    ///
1380    /// * Only `blockDim > 1` is supported
1381    /// * Only [`cusparseOperation_t::CUSPARSE_OPERATION_NON_TRANSPOSE`] and [`cusparseMatrixType_t::CUSPARSE_MATRIX_TYPE_GENERAL`] are supported.
1382    /// * Parameters `bsrMaskPtr`, `bsrRowPtr`, `bsrEndPtr` and `bsrColInd` are consistent with base index, either one-based or zero-based. The above example is one-based.
1383    pub fn cusparseDbsrxmv(
1384        handle: cusparseHandle_t,
1385        dirA: cusparseDirection_t,
1386        transA: cusparseOperation_t,
1387        sizeOfMask: ::core::ffi::c_int,
1388        mb: ::core::ffi::c_int,
1389        nb: ::core::ffi::c_int,
1390        nnzb: ::core::ffi::c_int,
1391        alpha: *const f64,
1392        descrA: cusparseMatDescr_t,
1393        bsrSortedValA: *const f64,
1394        bsrSortedMaskPtrA: *const ::core::ffi::c_int,
1395        bsrSortedRowPtrA: *const ::core::ffi::c_int,
1396        bsrSortedEndPtrA: *const ::core::ffi::c_int,
1397        bsrSortedColIndA: *const ::core::ffi::c_int,
1398        blockDim: ::core::ffi::c_int,
1399        x: *const f64,
1400        beta: *const f64,
1401        y: *mut f64,
1402    ) -> cusparseStatus_t;
1403}
1404unsafe extern "C" {
1405    /// This function performs a `bsrmv` and a mask operation
1406    ///
1407    /// where $A\text{ is an }(mb \ast blockDim) \times (nb \ast blockDim)$ sparse matrix that is defined in BSRX storage format by the four arrays `bsrVal`, `bsrRowPtr`, `bsrEndPtr`, and `bsrColInd`); `x` and `y` are vectors; $\alpha\text{~and~}\beta$ are scalars; and:
1408    /// $$
1409    /// \operatorname{op}(A) =
1410    /// \begin{cases}
1411    /// A & \text{if } trans = \text{CUSPARSE_OPERATION_NON_TRANSPOSE} \\
1412    /// A^T & \text{if } trans = \text{CUSPARSE_OPERATION_TRANSPOSE} \\
1413    /// A^H & \text{if } trans = \text{CUSPARSE_OPERATION_CONJUGATE_TRANSPOSE}
1414    /// \end{cases}
1415    /// $$
1416    ///
1417    /// The mask operation is defined by array `bsrMaskPtr` which contains updated block row indices of $y$. If row $i$ is not specified in `bsrMaskPtr`, then `bsrxmv()` does not touch row block $i$ of $A$ and $y$.
1418    ///
1419    /// For example, consider the $2 \times 3$ block matrix $A$:
1420    ///
1421    /// and its one-based BSR format (three vector form) is:
1422    ///
1423    /// Suppose we want to do the following `bsrmv` operation on a matrix $\bar{A}$ which is slightly different from $A$.
1424    ///
1425    /// We don’t need to create another BSR format for the new matrix $\bar{A}$, all that we should do is to keep `bsrVal` and `bsrColInd` unchanged, but modify `bsrRowPtr` and add an additional array `bsrEndPtr` which points to the last nonzero elements per row of $\bar{A}$ plus 1.
1426    ///
1427    /// For example, the following `bsrRowPtr` and `bsrEndPtr` can represent matrix $\bar{A}$:
1428    ///
1429    /// Further we can use a mask operator (specified by array `bsrMaskPtr`) to update particular block row indices of $y$ only because $y_{1}$ is never changed. In this case, `bsrMaskPtr`$=$ \[2\] and `sizeOfMask`=1.
1430    ///
1431    /// The mask operator is equivalent to the following operation:
1432    ///
1433    /// If a block row is not present in the `bsrMaskPtr`, then no calculation is performed on that row, and the corresponding value in `y` is unmodified. The question mark “?” is used to inidcate row blocks not in `bsrMaskPtr`.
1434    ///
1435    /// In this case, first row block is not present in `bsrMaskPtr`, so `bsrRowPtr\[0\]` and `bsrEndPtr\[0\]` are not touched also.
1436    ///
1437    /// `bsrxmv()` has the following properties:
1438    ///
1439    /// * The routine requires no extra storage.
1440    /// * The routine supports asynchronous execution.
1441    /// * The routine supports CUDA graph capture.
1442    ///
1443    /// A couple of comments on `bsrxmv()`:
1444    ///
1445    /// * Only `blockDim > 1` is supported
1446    /// * Only [`cusparseOperation_t::CUSPARSE_OPERATION_NON_TRANSPOSE`] and [`cusparseMatrixType_t::CUSPARSE_MATRIX_TYPE_GENERAL`] are supported.
1447    /// * Parameters `bsrMaskPtr`, `bsrRowPtr`, `bsrEndPtr` and `bsrColInd` are consistent with base index, either one-based or zero-based. The above example is one-based.
1448    pub fn cusparseCbsrxmv(
1449        handle: cusparseHandle_t,
1450        dirA: cusparseDirection_t,
1451        transA: cusparseOperation_t,
1452        sizeOfMask: ::core::ffi::c_int,
1453        mb: ::core::ffi::c_int,
1454        nb: ::core::ffi::c_int,
1455        nnzb: ::core::ffi::c_int,
1456        alpha: *const cuComplex,
1457        descrA: cusparseMatDescr_t,
1458        bsrSortedValA: *const cuComplex,
1459        bsrSortedMaskPtrA: *const ::core::ffi::c_int,
1460        bsrSortedRowPtrA: *const ::core::ffi::c_int,
1461        bsrSortedEndPtrA: *const ::core::ffi::c_int,
1462        bsrSortedColIndA: *const ::core::ffi::c_int,
1463        blockDim: ::core::ffi::c_int,
1464        x: *const cuComplex,
1465        beta: *const cuComplex,
1466        y: *mut cuComplex,
1467    ) -> cusparseStatus_t;
1468}
1469unsafe extern "C" {
1470    /// This function performs a `bsrmv` and a mask operation
1471    ///
1472    /// where $A\text{ is an }(mb \ast blockDim) \times (nb \ast blockDim)$ sparse matrix that is defined in BSRX storage format by the four arrays `bsrVal`, `bsrRowPtr`, `bsrEndPtr`, and `bsrColInd`); `x` and `y` are vectors; $\alpha\text{~and~}\beta$ are scalars; and:
1473    /// $$
1474    /// \operatorname{op}(A) =
1475    /// \begin{cases}
1476    /// A & \text{if } trans = \text{CUSPARSE_OPERATION_NON_TRANSPOSE} \\
1477    /// A^T & \text{if } trans = \text{CUSPARSE_OPERATION_TRANSPOSE} \\
1478    /// A^H & \text{if } trans = \text{CUSPARSE_OPERATION_CONJUGATE_TRANSPOSE}
1479    /// \end{cases}
1480    /// $$
1481    ///
1482    /// The mask operation is defined by array `bsrMaskPtr` which contains updated block row indices of $y$. If row $i$ is not specified in `bsrMaskPtr`, then `bsrxmv()` does not touch row block $i$ of $A$ and $y$.
1483    ///
1484    /// For example, consider the $2 \times 3$ block matrix $A$:
1485    ///
1486    /// and its one-based BSR format (three vector form) is:
1487    ///
1488    /// Suppose we want to do the following `bsrmv` operation on a matrix $\bar{A}$ which is slightly different from $A$.
1489    ///
1490    /// We don’t need to create another BSR format for the new matrix $\bar{A}$, all that we should do is to keep `bsrVal` and `bsrColInd` unchanged, but modify `bsrRowPtr` and add an additional array `bsrEndPtr` which points to the last nonzero elements per row of $\bar{A}$ plus 1.
1491    ///
1492    /// For example, the following `bsrRowPtr` and `bsrEndPtr` can represent matrix $\bar{A}$:
1493    ///
1494    /// Further we can use a mask operator (specified by array `bsrMaskPtr`) to update particular block row indices of $y$ only because $y_{1}$ is never changed. In this case, `bsrMaskPtr`$=$ \[2\] and `sizeOfMask`=1.
1495    ///
1496    /// The mask operator is equivalent to the following operation:
1497    ///
1498    /// If a block row is not present in the `bsrMaskPtr`, then no calculation is performed on that row, and the corresponding value in `y` is unmodified. The question mark “?” is used to inidcate row blocks not in `bsrMaskPtr`.
1499    ///
1500    /// In this case, first row block is not present in `bsrMaskPtr`, so `bsrRowPtr\[0\]` and `bsrEndPtr\[0\]` are not touched also.
1501    ///
1502    /// `bsrxmv()` has the following properties:
1503    ///
1504    /// * The routine requires no extra storage.
1505    /// * The routine supports asynchronous execution.
1506    /// * The routine supports CUDA graph capture.
1507    ///
1508    /// A couple of comments on `bsrxmv()`:
1509    ///
1510    /// * Only `blockDim > 1` is supported
1511    /// * Only [`cusparseOperation_t::CUSPARSE_OPERATION_NON_TRANSPOSE`] and [`cusparseMatrixType_t::CUSPARSE_MATRIX_TYPE_GENERAL`] are supported.
1512    /// * Parameters `bsrMaskPtr`, `bsrRowPtr`, `bsrEndPtr` and `bsrColInd` are consistent with base index, either one-based or zero-based. The above example is one-based.
1513    pub fn cusparseZbsrxmv(
1514        handle: cusparseHandle_t,
1515        dirA: cusparseDirection_t,
1516        transA: cusparseOperation_t,
1517        sizeOfMask: ::core::ffi::c_int,
1518        mb: ::core::ffi::c_int,
1519        nb: ::core::ffi::c_int,
1520        nnzb: ::core::ffi::c_int,
1521        alpha: *const cuDoubleComplex,
1522        descrA: cusparseMatDescr_t,
1523        bsrSortedValA: *const cuDoubleComplex,
1524        bsrSortedMaskPtrA: *const ::core::ffi::c_int,
1525        bsrSortedRowPtrA: *const ::core::ffi::c_int,
1526        bsrSortedEndPtrA: *const ::core::ffi::c_int,
1527        bsrSortedColIndA: *const ::core::ffi::c_int,
1528        blockDim: ::core::ffi::c_int,
1529        x: *const cuDoubleComplex,
1530        beta: *const cuDoubleComplex,
1531        y: *mut cuDoubleComplex,
1532    ) -> cusparseStatus_t;
1533}
1534unsafe extern "C" {
1535    /// If the returned error code is [`cusparseStatus_t::CUSPARSE_STATUS_ZERO_PIVOT`], `position=j` means `A(j,j)` is either structural zero or numerical zero (singular block). Otherwise `position=-1`.
1536    ///
1537    /// The `position` can be 0-based or 1-based, the same as the matrix.
1538    ///
1539    /// Function [`cusparseXbsrsv2_zeroPivot`] is a blocking call. It calls `cudaDeviceSynchronize()` to make sure all previous kernels are done.
1540    ///
1541    /// The `position` can be in the host memory or device memory. The user can set the proper mode with [`cusparseSetPointerMode`].
1542    ///
1543    /// * The routine requires no extra storage
1544    /// * The routine supports asynchronous execution if the Stream Ordered Memory Allocator is available
1545    /// * The routine supports CUDA graph capture if the Stream Ordered Memory Allocator is available.
1546    ///
1547    /// # Parameters
1548    ///
1549    /// - `position`: if no structural or numerical zero, `position` is -1; otherwise if `A(j,j)` is missing or `U(j,j)` is zero, `position=j`.
1550    #[deprecated]
1551    pub fn cusparseXbsrsv2_zeroPivot(
1552        handle: cusparseHandle_t,
1553        info: bsrsv2Info_t,
1554        position: *mut ::core::ffi::c_int,
1555    ) -> cusparseStatus_t;
1556}
1557unsafe extern "C" {
1558    /// This function returns size of the buffer used in `bsrsv2`, a new sparse triangular linear system `op(A)*y =`$\alpha$`x`.
1559    ///
1560    /// `A` is an `(mb*blockDim)x(mb*blockDim)` sparse matrix that is defined in BSR storage format by the three arrays `bsrValA`, `bsrRowPtrA`, and `bsrColIndA`); `x` and `y` are the right-hand-side and the solution vectors; $\alpha$ is a scalar; and:
1561    /// $$
1562    /// \operatorname{op}(A) =
1563    /// \begin{cases}
1564    /// A & \text{if } trans = \text{CUSPARSE_OPERATION_NON_TRANSPOSE} \\
1565    /// A^T & \text{if } trans = \text{CUSPARSE_OPERATION_TRANSPOSE} \\
1566    /// A^H & \text{if } trans = \text{CUSPARSE_OPERATION_CONJUGATE_TRANSPOSE}
1567    /// \end{cases}
1568    /// $$
1569    ///
1570    /// Although there are six combinations in terms of parameter `trans` and the upper (lower) triangular part of `A`, `bsrsv2_bufferSize()` returns the maximum size buffer among these combinations. The buffer size depends on the dimensions `mb`, `blockDim`, and the number of nonzero blocks of the matrix `nnzb`. If the user changes the matrix, it is necessary to call `bsrsv2_bufferSize()` again to have the correct buffer size; otherwise a segmentation fault may occur.
1571    ///
1572    /// * The routine requires no extra storage.
1573    /// * The routine supports asynchronous execution.
1574    /// * The routine supports CUDA graph capture.
1575    pub fn cusparseSbsrsv2_bufferSize(
1576        handle: cusparseHandle_t,
1577        dirA: cusparseDirection_t,
1578        transA: cusparseOperation_t,
1579        mb: ::core::ffi::c_int,
1580        nnzb: ::core::ffi::c_int,
1581        descrA: cusparseMatDescr_t,
1582        bsrSortedValA: *mut f32,
1583        bsrSortedRowPtrA: *const ::core::ffi::c_int,
1584        bsrSortedColIndA: *const ::core::ffi::c_int,
1585        blockDim: ::core::ffi::c_int,
1586        info: bsrsv2Info_t,
1587        pBufferSizeInBytes: *mut ::core::ffi::c_int,
1588    ) -> cusparseStatus_t;
1589}
1590unsafe extern "C" {
1591    /// This function returns size of the buffer used in `bsrsv2`, a new sparse triangular linear system `op(A)*y =`$\alpha$`x`.
1592    ///
1593    /// `A` is an `(mb*blockDim)x(mb*blockDim)` sparse matrix that is defined in BSR storage format by the three arrays `bsrValA`, `bsrRowPtrA`, and `bsrColIndA`); `x` and `y` are the right-hand-side and the solution vectors; $\alpha$ is a scalar; and:
1594    /// $$
1595    /// \operatorname{op}(A) =
1596    /// \begin{cases}
1597    /// A & \text{if } trans = \text{CUSPARSE_OPERATION_NON_TRANSPOSE} \\
1598    /// A^T & \text{if } trans = \text{CUSPARSE_OPERATION_TRANSPOSE} \\
1599    /// A^H & \text{if } trans = \text{CUSPARSE_OPERATION_CONJUGATE_TRANSPOSE}
1600    /// \end{cases}
1601    /// $$
1602    ///
1603    /// Although there are six combinations in terms of parameter `trans` and the upper (lower) triangular part of `A`, `bsrsv2_bufferSize()` returns the maximum size buffer among these combinations. The buffer size depends on the dimensions `mb`, `blockDim`, and the number of nonzero blocks of the matrix `nnzb`. If the user changes the matrix, it is necessary to call `bsrsv2_bufferSize()` again to have the correct buffer size; otherwise a segmentation fault may occur.
1604    ///
1605    /// * The routine requires no extra storage.
1606    /// * The routine supports asynchronous execution.
1607    /// * The routine supports CUDA graph capture.
1608    pub fn cusparseDbsrsv2_bufferSize(
1609        handle: cusparseHandle_t,
1610        dirA: cusparseDirection_t,
1611        transA: cusparseOperation_t,
1612        mb: ::core::ffi::c_int,
1613        nnzb: ::core::ffi::c_int,
1614        descrA: cusparseMatDescr_t,
1615        bsrSortedValA: *mut f64,
1616        bsrSortedRowPtrA: *const ::core::ffi::c_int,
1617        bsrSortedColIndA: *const ::core::ffi::c_int,
1618        blockDim: ::core::ffi::c_int,
1619        info: bsrsv2Info_t,
1620        pBufferSizeInBytes: *mut ::core::ffi::c_int,
1621    ) -> cusparseStatus_t;
1622}
1623unsafe extern "C" {
1624    /// This function returns size of the buffer used in `bsrsv2`, a new sparse triangular linear system `op(A)*y =`$\alpha$`x`.
1625    ///
1626    /// `A` is an `(mb*blockDim)x(mb*blockDim)` sparse matrix that is defined in BSR storage format by the three arrays `bsrValA`, `bsrRowPtrA`, and `bsrColIndA`); `x` and `y` are the right-hand-side and the solution vectors; $\alpha$ is a scalar; and:
1627    /// $$
1628    /// \operatorname{op}(A) =
1629    /// \begin{cases}
1630    /// A & \text{if } trans = \text{CUSPARSE_OPERATION_NON_TRANSPOSE} \\
1631    /// A^T & \text{if } trans = \text{CUSPARSE_OPERATION_TRANSPOSE} \\
1632    /// A^H & \text{if } trans = \text{CUSPARSE_OPERATION_CONJUGATE_TRANSPOSE}
1633    /// \end{cases}
1634    /// $$
1635    ///
1636    /// Although there are six combinations in terms of parameter `trans` and the upper (lower) triangular part of `A`, `bsrsv2_bufferSize()` returns the maximum size buffer among these combinations. The buffer size depends on the dimensions `mb`, `blockDim`, and the number of nonzero blocks of the matrix `nnzb`. If the user changes the matrix, it is necessary to call `bsrsv2_bufferSize()` again to have the correct buffer size; otherwise a segmentation fault may occur.
1637    ///
1638    /// * The routine requires no extra storage.
1639    /// * The routine supports asynchronous execution.
1640    /// * The routine supports CUDA graph capture.
1641    pub fn cusparseCbsrsv2_bufferSize(
1642        handle: cusparseHandle_t,
1643        dirA: cusparseDirection_t,
1644        transA: cusparseOperation_t,
1645        mb: ::core::ffi::c_int,
1646        nnzb: ::core::ffi::c_int,
1647        descrA: cusparseMatDescr_t,
1648        bsrSortedValA: *mut cuComplex,
1649        bsrSortedRowPtrA: *const ::core::ffi::c_int,
1650        bsrSortedColIndA: *const ::core::ffi::c_int,
1651        blockDim: ::core::ffi::c_int,
1652        info: bsrsv2Info_t,
1653        pBufferSizeInBytes: *mut ::core::ffi::c_int,
1654    ) -> cusparseStatus_t;
1655}
1656unsafe extern "C" {
1657    /// This function returns size of the buffer used in `bsrsv2`, a new sparse triangular linear system `op(A)*y =`$\alpha$`x`.
1658    ///
1659    /// `A` is an `(mb*blockDim)x(mb*blockDim)` sparse matrix that is defined in BSR storage format by the three arrays `bsrValA`, `bsrRowPtrA`, and `bsrColIndA`); `x` and `y` are the right-hand-side and the solution vectors; $\alpha$ is a scalar; and:
1660    /// $$
1661    /// \operatorname{op}(A) =
1662    /// \begin{cases}
1663    /// A & \text{if } trans = \text{CUSPARSE_OPERATION_NON_TRANSPOSE} \\
1664    /// A^T & \text{if } trans = \text{CUSPARSE_OPERATION_TRANSPOSE} \\
1665    /// A^H & \text{if } trans = \text{CUSPARSE_OPERATION_CONJUGATE_TRANSPOSE}
1666    /// \end{cases}
1667    /// $$
1668    ///
1669    /// Although there are six combinations in terms of parameter `trans` and the upper (lower) triangular part of `A`, `bsrsv2_bufferSize()` returns the maximum size buffer among these combinations. The buffer size depends on the dimensions `mb`, `blockDim`, and the number of nonzero blocks of the matrix `nnzb`. If the user changes the matrix, it is necessary to call `bsrsv2_bufferSize()` again to have the correct buffer size; otherwise a segmentation fault may occur.
1670    ///
1671    /// * The routine requires no extra storage.
1672    /// * The routine supports asynchronous execution.
1673    /// * The routine supports CUDA graph capture.
1674    pub fn cusparseZbsrsv2_bufferSize(
1675        handle: cusparseHandle_t,
1676        dirA: cusparseDirection_t,
1677        transA: cusparseOperation_t,
1678        mb: ::core::ffi::c_int,
1679        nnzb: ::core::ffi::c_int,
1680        descrA: cusparseMatDescr_t,
1681        bsrSortedValA: *mut cuDoubleComplex,
1682        bsrSortedRowPtrA: *const ::core::ffi::c_int,
1683        bsrSortedColIndA: *const ::core::ffi::c_int,
1684        blockDim: ::core::ffi::c_int,
1685        info: bsrsv2Info_t,
1686        pBufferSizeInBytes: *mut ::core::ffi::c_int,
1687    ) -> cusparseStatus_t;
1688}
1689unsafe extern "C" {
1690    pub fn cusparseSbsrsv2_bufferSizeExt(
1691        handle: cusparseHandle_t,
1692        dirA: cusparseDirection_t,
1693        transA: cusparseOperation_t,
1694        mb: ::core::ffi::c_int,
1695        nnzb: ::core::ffi::c_int,
1696        descrA: cusparseMatDescr_t,
1697        bsrSortedValA: *mut f32,
1698        bsrSortedRowPtrA: *const ::core::ffi::c_int,
1699        bsrSortedColIndA: *const ::core::ffi::c_int,
1700        blockSize: ::core::ffi::c_int,
1701        info: bsrsv2Info_t,
1702        pBufferSize: *mut size_t,
1703    ) -> cusparseStatus_t;
1704}
1705unsafe extern "C" {
1706    pub fn cusparseDbsrsv2_bufferSizeExt(
1707        handle: cusparseHandle_t,
1708        dirA: cusparseDirection_t,
1709        transA: cusparseOperation_t,
1710        mb: ::core::ffi::c_int,
1711        nnzb: ::core::ffi::c_int,
1712        descrA: cusparseMatDescr_t,
1713        bsrSortedValA: *mut f64,
1714        bsrSortedRowPtrA: *const ::core::ffi::c_int,
1715        bsrSortedColIndA: *const ::core::ffi::c_int,
1716        blockSize: ::core::ffi::c_int,
1717        info: bsrsv2Info_t,
1718        pBufferSize: *mut size_t,
1719    ) -> cusparseStatus_t;
1720}
1721unsafe extern "C" {
1722    pub fn cusparseCbsrsv2_bufferSizeExt(
1723        handle: cusparseHandle_t,
1724        dirA: cusparseDirection_t,
1725        transA: cusparseOperation_t,
1726        mb: ::core::ffi::c_int,
1727        nnzb: ::core::ffi::c_int,
1728        descrA: cusparseMatDescr_t,
1729        bsrSortedValA: *mut cuComplex,
1730        bsrSortedRowPtrA: *const ::core::ffi::c_int,
1731        bsrSortedColIndA: *const ::core::ffi::c_int,
1732        blockSize: ::core::ffi::c_int,
1733        info: bsrsv2Info_t,
1734        pBufferSize: *mut size_t,
1735    ) -> cusparseStatus_t;
1736}
1737unsafe extern "C" {
1738    pub fn cusparseZbsrsv2_bufferSizeExt(
1739        handle: cusparseHandle_t,
1740        dirA: cusparseDirection_t,
1741        transA: cusparseOperation_t,
1742        mb: ::core::ffi::c_int,
1743        nnzb: ::core::ffi::c_int,
1744        descrA: cusparseMatDescr_t,
1745        bsrSortedValA: *mut cuDoubleComplex,
1746        bsrSortedRowPtrA: *const ::core::ffi::c_int,
1747        bsrSortedColIndA: *const ::core::ffi::c_int,
1748        blockSize: ::core::ffi::c_int,
1749        info: bsrsv2Info_t,
1750        pBufferSize: *mut size_t,
1751    ) -> cusparseStatus_t;
1752}
1753unsafe extern "C" {
1754    /// This function performs the analysis phase of `bsrsv2`, a new sparse triangular linear system `op(A)*y =`$\alpha$`x`.
1755    ///
1756    /// `A` is an `(mb*blockDim)x(mb*blockDim)` sparse matrix that is defined in BSR storage format by the three arrays `bsrValA`, `bsrRowPtrA`, and `bsrColIndA`); `x` and `y` are the right-hand side and the solution vectors; $\alpha$ is a scalar; and:
1757    /// $$
1758    /// \operatorname{op}(A) =
1759    /// \begin{cases}
1760    /// A & \text{if } trans = \text{CUSPARSE_OPERATION_NON_TRANSPOSE} \\
1761    /// A^T & \text{if } trans = \text{CUSPARSE_OPERATION_TRANSPOSE} \\
1762    /// A^H & \text{if } trans = \text{CUSPARSE_OPERATION_CONJUGATE_TRANSPOSE}
1763    /// \end{cases}
1764    /// $$
1765    ///
1766    /// The block of BSR format is of size `blockDim*blockDim`, stored as column-major or row-major as determined by parameter `dirA`, which is either [`cusparseDirection_t::CUSPARSE_DIRECTION_COLUMN`] or [`cusparseDirection_t::CUSPARSE_DIRECTION_ROW`]. The matrix type must be [`cusparseMatrixType_t::CUSPARSE_MATRIX_TYPE_GENERAL`], and the fill mode and diagonal type are ignored.
1767    ///
1768    /// It is expected that this function will be executed only once for a given matrix and a particular operation type.
1769    ///
1770    /// This function requires a buffer size returned by `bsrsv2_bufferSize()`. The address of `pBuffer` must be multiple of 128 bytes. If it is not, [`cusparseStatus_t::CUSPARSE_STATUS_INVALID_VALUE`] is returned.
1771    ///
1772    /// Function `bsrsv2_analysis()` reports a structural zero and computes level information, which stored in the opaque structure `info`. The level information can extract more parallelism for a triangular solver. However `bsrsv2_solve()` can be done without level information. To disable level information, the user needs to specify the policy of the triangular solver as [`cusparseSolvePolicy_t::CUSPARSE_SOLVE_POLICY_NO_LEVEL`].
1773    ///
1774    /// Function `bsrsv2_analysis()` always reports the first structural zero, even when parameter `policy` is [`cusparseSolvePolicy_t::CUSPARSE_SOLVE_POLICY_NO_LEVEL`]. No structural zero is reported if [`cusparseDiagType_t::CUSPARSE_DIAG_TYPE_UNIT`] is specified, even if block `A(j,j)` is missing for some `j`. The user needs to call [`cusparseXbsrsv2_zeroPivot`] to know where the structural zero is.
1775    ///
1776    /// It is the user’s choice whether to call `bsrsv2_solve()` if `bsrsv2_analysis()` reports a structural zero. In this case, the user can still call `bsrsv2_solve()`, which will return a numerical zero at the same position as a structural zero. However the result `x` is meaningless.
1777    ///
1778    /// * This function requires temporary extra storage that is allocated internally
1779    /// * The routine supports asynchronous execution if the Stream Ordered Memory Allocator is available
1780    /// * The routine supports CUDA graph capture if the Stream Ordered Memory Allocator is available.
1781    pub fn cusparseSbsrsv2_analysis(
1782        handle: cusparseHandle_t,
1783        dirA: cusparseDirection_t,
1784        transA: cusparseOperation_t,
1785        mb: ::core::ffi::c_int,
1786        nnzb: ::core::ffi::c_int,
1787        descrA: cusparseMatDescr_t,
1788        bsrSortedValA: *const f32,
1789        bsrSortedRowPtrA: *const ::core::ffi::c_int,
1790        bsrSortedColIndA: *const ::core::ffi::c_int,
1791        blockDim: ::core::ffi::c_int,
1792        info: bsrsv2Info_t,
1793        policy: cusparseSolvePolicy_t,
1794        pBuffer: *mut ::core::ffi::c_void,
1795    ) -> cusparseStatus_t;
1796}
1797unsafe extern "C" {
1798    /// This function performs the analysis phase of `bsrsv2`, a new sparse triangular linear system `op(A)*y =`$\alpha$`x`.
1799    ///
1800    /// `A` is an `(mb*blockDim)x(mb*blockDim)` sparse matrix that is defined in BSR storage format by the three arrays `bsrValA`, `bsrRowPtrA`, and `bsrColIndA`); `x` and `y` are the right-hand side and the solution vectors; $\alpha$ is a scalar; and:
1801    /// $$
1802    /// \operatorname{op}(A) =
1803    /// \begin{cases}
1804    /// A & \text{if } trans = \text{CUSPARSE_OPERATION_NON_TRANSPOSE} \\
1805    /// A^T & \text{if } trans = \text{CUSPARSE_OPERATION_TRANSPOSE} \\
1806    /// A^H & \text{if } trans = \text{CUSPARSE_OPERATION_CONJUGATE_TRANSPOSE}
1807    /// \end{cases}
1808    /// $$
1809    ///
1810    /// The block of BSR format is of size `blockDim*blockDim`, stored as column-major or row-major as determined by parameter `dirA`, which is either [`cusparseDirection_t::CUSPARSE_DIRECTION_COLUMN`] or [`cusparseDirection_t::CUSPARSE_DIRECTION_ROW`]. The matrix type must be [`cusparseMatrixType_t::CUSPARSE_MATRIX_TYPE_GENERAL`], and the fill mode and diagonal type are ignored.
1811    ///
1812    /// It is expected that this function will be executed only once for a given matrix and a particular operation type.
1813    ///
1814    /// This function requires a buffer size returned by `bsrsv2_bufferSize()`. The address of `pBuffer` must be multiple of 128 bytes. If it is not, [`cusparseStatus_t::CUSPARSE_STATUS_INVALID_VALUE`] is returned.
1815    ///
1816    /// Function `bsrsv2_analysis()` reports a structural zero and computes level information, which stored in the opaque structure `info`. The level information can extract more parallelism for a triangular solver. However `bsrsv2_solve()` can be done without level information. To disable level information, the user needs to specify the policy of the triangular solver as [`cusparseSolvePolicy_t::CUSPARSE_SOLVE_POLICY_NO_LEVEL`].
1817    ///
1818    /// Function `bsrsv2_analysis()` always reports the first structural zero, even when parameter `policy` is [`cusparseSolvePolicy_t::CUSPARSE_SOLVE_POLICY_NO_LEVEL`]. No structural zero is reported if [`cusparseDiagType_t::CUSPARSE_DIAG_TYPE_UNIT`] is specified, even if block `A(j,j)` is missing for some `j`. The user needs to call [`cusparseXbsrsv2_zeroPivot`] to know where the structural zero is.
1819    ///
1820    /// It is the user’s choice whether to call `bsrsv2_solve()` if `bsrsv2_analysis()` reports a structural zero. In this case, the user can still call `bsrsv2_solve()`, which will return a numerical zero at the same position as a structural zero. However the result `x` is meaningless.
1821    ///
1822    /// * This function requires temporary extra storage that is allocated internally
1823    /// * The routine supports asynchronous execution if the Stream Ordered Memory Allocator is available
1824    /// * The routine supports CUDA graph capture if the Stream Ordered Memory Allocator is available.
1825    pub fn cusparseDbsrsv2_analysis(
1826        handle: cusparseHandle_t,
1827        dirA: cusparseDirection_t,
1828        transA: cusparseOperation_t,
1829        mb: ::core::ffi::c_int,
1830        nnzb: ::core::ffi::c_int,
1831        descrA: cusparseMatDescr_t,
1832        bsrSortedValA: *const f64,
1833        bsrSortedRowPtrA: *const ::core::ffi::c_int,
1834        bsrSortedColIndA: *const ::core::ffi::c_int,
1835        blockDim: ::core::ffi::c_int,
1836        info: bsrsv2Info_t,
1837        policy: cusparseSolvePolicy_t,
1838        pBuffer: *mut ::core::ffi::c_void,
1839    ) -> cusparseStatus_t;
1840}
1841unsafe extern "C" {
1842    /// This function performs the analysis phase of `bsrsv2`, a new sparse triangular linear system `op(A)*y =`$\alpha$`x`.
1843    ///
1844    /// `A` is an `(mb*blockDim)x(mb*blockDim)` sparse matrix that is defined in BSR storage format by the three arrays `bsrValA`, `bsrRowPtrA`, and `bsrColIndA`); `x` and `y` are the right-hand side and the solution vectors; $\alpha$ is a scalar; and:
1845    /// $$
1846    /// \operatorname{op}(A) =
1847    /// \begin{cases}
1848    /// A & \text{if } trans = \text{CUSPARSE_OPERATION_NON_TRANSPOSE} \\
1849    /// A^T & \text{if } trans = \text{CUSPARSE_OPERATION_TRANSPOSE} \\
1850    /// A^H & \text{if } trans = \text{CUSPARSE_OPERATION_CONJUGATE_TRANSPOSE}
1851    /// \end{cases}
1852    /// $$
1853    ///
1854    /// The block of BSR format is of size `blockDim*blockDim`, stored as column-major or row-major as determined by parameter `dirA`, which is either [`cusparseDirection_t::CUSPARSE_DIRECTION_COLUMN`] or [`cusparseDirection_t::CUSPARSE_DIRECTION_ROW`]. The matrix type must be [`cusparseMatrixType_t::CUSPARSE_MATRIX_TYPE_GENERAL`], and the fill mode and diagonal type are ignored.
1855    ///
1856    /// It is expected that this function will be executed only once for a given matrix and a particular operation type.
1857    ///
1858    /// This function requires a buffer size returned by `bsrsv2_bufferSize()`. The address of `pBuffer` must be multiple of 128 bytes. If it is not, [`cusparseStatus_t::CUSPARSE_STATUS_INVALID_VALUE`] is returned.
1859    ///
1860    /// Function `bsrsv2_analysis()` reports a structural zero and computes level information, which stored in the opaque structure `info`. The level information can extract more parallelism for a triangular solver. However `bsrsv2_solve()` can be done without level information. To disable level information, the user needs to specify the policy of the triangular solver as [`cusparseSolvePolicy_t::CUSPARSE_SOLVE_POLICY_NO_LEVEL`].
1861    ///
1862    /// Function `bsrsv2_analysis()` always reports the first structural zero, even when parameter `policy` is [`cusparseSolvePolicy_t::CUSPARSE_SOLVE_POLICY_NO_LEVEL`]. No structural zero is reported if [`cusparseDiagType_t::CUSPARSE_DIAG_TYPE_UNIT`] is specified, even if block `A(j,j)` is missing for some `j`. The user needs to call [`cusparseXbsrsv2_zeroPivot`] to know where the structural zero is.
1863    ///
1864    /// It is the user’s choice whether to call `bsrsv2_solve()` if `bsrsv2_analysis()` reports a structural zero. In this case, the user can still call `bsrsv2_solve()`, which will return a numerical zero at the same position as a structural zero. However the result `x` is meaningless.
1865    ///
1866    /// * This function requires temporary extra storage that is allocated internally
1867    /// * The routine supports asynchronous execution if the Stream Ordered Memory Allocator is available
1868    /// * The routine supports CUDA graph capture if the Stream Ordered Memory Allocator is available.
1869    pub fn cusparseCbsrsv2_analysis(
1870        handle: cusparseHandle_t,
1871        dirA: cusparseDirection_t,
1872        transA: cusparseOperation_t,
1873        mb: ::core::ffi::c_int,
1874        nnzb: ::core::ffi::c_int,
1875        descrA: cusparseMatDescr_t,
1876        bsrSortedValA: *const cuComplex,
1877        bsrSortedRowPtrA: *const ::core::ffi::c_int,
1878        bsrSortedColIndA: *const ::core::ffi::c_int,
1879        blockDim: ::core::ffi::c_int,
1880        info: bsrsv2Info_t,
1881        policy: cusparseSolvePolicy_t,
1882        pBuffer: *mut ::core::ffi::c_void,
1883    ) -> cusparseStatus_t;
1884}
1885unsafe extern "C" {
1886    /// This function performs the analysis phase of `bsrsv2`, a new sparse triangular linear system `op(A)*y =`$\alpha$`x`.
1887    ///
1888    /// `A` is an `(mb*blockDim)x(mb*blockDim)` sparse matrix that is defined in BSR storage format by the three arrays `bsrValA`, `bsrRowPtrA`, and `bsrColIndA`); `x` and `y` are the right-hand side and the solution vectors; $\alpha$ is a scalar; and:
1889    /// $$
1890    /// \operatorname{op}(A) =
1891    /// \begin{cases}
1892    /// A & \text{if } trans = \text{CUSPARSE_OPERATION_NON_TRANSPOSE} \\
1893    /// A^T & \text{if } trans = \text{CUSPARSE_OPERATION_TRANSPOSE} \\
1894    /// A^H & \text{if } trans = \text{CUSPARSE_OPERATION_CONJUGATE_TRANSPOSE}
1895    /// \end{cases}
1896    /// $$
1897    ///
1898    /// The block of BSR format is of size `blockDim*blockDim`, stored as column-major or row-major as determined by parameter `dirA`, which is either [`cusparseDirection_t::CUSPARSE_DIRECTION_COLUMN`] or [`cusparseDirection_t::CUSPARSE_DIRECTION_ROW`]. The matrix type must be [`cusparseMatrixType_t::CUSPARSE_MATRIX_TYPE_GENERAL`], and the fill mode and diagonal type are ignored.
1899    ///
1900    /// It is expected that this function will be executed only once for a given matrix and a particular operation type.
1901    ///
1902    /// This function requires a buffer size returned by `bsrsv2_bufferSize()`. The address of `pBuffer` must be multiple of 128 bytes. If it is not, [`cusparseStatus_t::CUSPARSE_STATUS_INVALID_VALUE`] is returned.
1903    ///
1904    /// Function `bsrsv2_analysis()` reports a structural zero and computes level information, which stored in the opaque structure `info`. The level information can extract more parallelism for a triangular solver. However `bsrsv2_solve()` can be done without level information. To disable level information, the user needs to specify the policy of the triangular solver as [`cusparseSolvePolicy_t::CUSPARSE_SOLVE_POLICY_NO_LEVEL`].
1905    ///
1906    /// Function `bsrsv2_analysis()` always reports the first structural zero, even when parameter `policy` is [`cusparseSolvePolicy_t::CUSPARSE_SOLVE_POLICY_NO_LEVEL`]. No structural zero is reported if [`cusparseDiagType_t::CUSPARSE_DIAG_TYPE_UNIT`] is specified, even if block `A(j,j)` is missing for some `j`. The user needs to call [`cusparseXbsrsv2_zeroPivot`] to know where the structural zero is.
1907    ///
1908    /// It is the user’s choice whether to call `bsrsv2_solve()` if `bsrsv2_analysis()` reports a structural zero. In this case, the user can still call `bsrsv2_solve()`, which will return a numerical zero at the same position as a structural zero. However the result `x` is meaningless.
1909    ///
1910    /// * This function requires temporary extra storage that is allocated internally
1911    /// * The routine supports asynchronous execution if the Stream Ordered Memory Allocator is available
1912    /// * The routine supports CUDA graph capture if the Stream Ordered Memory Allocator is available.
1913    pub fn cusparseZbsrsv2_analysis(
1914        handle: cusparseHandle_t,
1915        dirA: cusparseDirection_t,
1916        transA: cusparseOperation_t,
1917        mb: ::core::ffi::c_int,
1918        nnzb: ::core::ffi::c_int,
1919        descrA: cusparseMatDescr_t,
1920        bsrSortedValA: *const cuDoubleComplex,
1921        bsrSortedRowPtrA: *const ::core::ffi::c_int,
1922        bsrSortedColIndA: *const ::core::ffi::c_int,
1923        blockDim: ::core::ffi::c_int,
1924        info: bsrsv2Info_t,
1925        policy: cusparseSolvePolicy_t,
1926        pBuffer: *mut ::core::ffi::c_void,
1927    ) -> cusparseStatus_t;
1928}
1929unsafe extern "C" {
1930    /// This function performs the solve phase of `bsrsv2`, a new sparse triangular linear system `op(A)*y =`$\alpha$`x`.
1931    ///
1932    /// `A` is an `(mb*blockDim)x(mb*blockDim)` sparse matrix that is defined in BSR storage format by the three arrays `bsrValA`, `bsrRowPtrA`, and `bsrColIndA`); `x` and `y` are the right-hand-side and the solution vectors; $\alpha$ is a scalar; and:
1933    /// $$
1934    /// \operatorname{op}(A) =
1935    /// \begin{cases}
1936    /// A & \text{if } trans = \text{CUSPARSE_OPERATION_NON_TRANSPOSE} \\
1937    /// A^T & \text{if } trans = \text{CUSPARSE_OPERATION_TRANSPOSE} \\
1938    /// A^H & \text{if } trans = \text{CUSPARSE_OPERATION_CONJUGATE_TRANSPOSE}
1939    /// \end{cases}
1940    /// $$
1941    ///
1942    /// The block in BSR format is of size `blockDim*blockDim`, stored as column-major or row-major as determined by parameter `dirA`, which is either [`cusparseDirection_t::CUSPARSE_DIRECTION_COLUMN`] or [`cusparseDirection_t::CUSPARSE_DIRECTION_ROW`]. The matrix type must be [`cusparseMatrixType_t::CUSPARSE_MATRIX_TYPE_GENERAL`], and the fill mode and diagonal type are ignored. Function `bsrsv02_solve()` can support an arbitrary `blockDim`.
1943    ///
1944    /// This function may be executed multiple times for a given matrix and a particular operation type.
1945    ///
1946    /// This function requires a buffer size returned by `bsrsv2_bufferSize()`. The address of `pBuffer` must be multiple of 128 bytes. If it is not, [`cusparseStatus_t::CUSPARSE_STATUS_INVALID_VALUE`] is returned.
1947    ///
1948    /// Although `bsrsv2_solve()` can be done without level information, the user still needs to be aware of consistency. If `bsrsv2_analysis()` is called with policy [`cusparseSolvePolicy_t::CUSPARSE_SOLVE_POLICY_USE_LEVEL`], `bsrsv2_solve()` can be run with or without levels. On the other hand, if `bsrsv2_analysis()` is called with [`cusparseSolvePolicy_t::CUSPARSE_SOLVE_POLICY_NO_LEVEL`], `bsrsv2_solve()` can only accept [`cusparseSolvePolicy_t::CUSPARSE_SOLVE_POLICY_NO_LEVEL`]; otherwise, [`cusparseStatus_t::CUSPARSE_STATUS_INVALID_VALUE`] is returned.
1949    ///
1950    /// The level information may not improve the performance, but may spend extra time doing analysis. For example, a tridiagonal matrix has no parallelism. In this case, [`cusparseSolvePolicy_t::CUSPARSE_SOLVE_POLICY_NO_LEVEL`] performs better than [`cusparseSolvePolicy_t::CUSPARSE_SOLVE_POLICY_USE_LEVEL`]. If the user has an iterative solver, the best approach is to do `bsrsv2_analysis()` with [`cusparseSolvePolicy_t::CUSPARSE_SOLVE_POLICY_USE_LEVEL`] once. Then do `bsrsv2_solve()` with [`cusparseSolvePolicy_t::CUSPARSE_SOLVE_POLICY_NO_LEVEL`] in the first run, and with [`cusparseSolvePolicy_t::CUSPARSE_SOLVE_POLICY_USE_LEVEL`] in the second run, and pick the fastest one to perform the remaining iterations.
1951    ///
1952    /// Function `bsrsv02_solve()` has the same behavior as `csrsv02_solve()`. That is, `bsr2csr(bsrsv02(A)) = csrsv02(bsr2csr(A))`. The numerical zero of `csrsv02_solve()` means there exists some zero `A(j,j)`. The numerical zero of `bsrsv02_solve()` means there exists some block `A(j,j)` that is not invertible.
1953    ///
1954    /// Function `bsrsv2_solve()` reports the first numerical zero, including a structural zero. No numerical zero is reported if [`cusparseDiagType_t::CUSPARSE_DIAG_TYPE_UNIT`] is specified, even if `A(j,j)` is not invertible for some `j`. The user needs to call [`cusparseXbsrsv2_zeroPivot`] to know where the numerical zero is.
1955    ///
1956    /// The function supports the following properties if `pBuffer != NULL`:
1957    ///
1958    /// * The routine requires no extra storage.
1959    /// * The routine supports asynchronous execution.
1960    /// * The routine supports CUDA graph capture.
1961    ///
1962    /// For example, suppose L is a lower triangular matrix with unit diagonal, then the following code solves `L*y=x` by level information.
1963    pub fn cusparseSbsrsv2_solve(
1964        handle: cusparseHandle_t,
1965        dirA: cusparseDirection_t,
1966        transA: cusparseOperation_t,
1967        mb: ::core::ffi::c_int,
1968        nnzb: ::core::ffi::c_int,
1969        alpha: *const f32,
1970        descrA: cusparseMatDescr_t,
1971        bsrSortedValA: *const f32,
1972        bsrSortedRowPtrA: *const ::core::ffi::c_int,
1973        bsrSortedColIndA: *const ::core::ffi::c_int,
1974        blockDim: ::core::ffi::c_int,
1975        info: bsrsv2Info_t,
1976        f: *const f32,
1977        x: *mut f32,
1978        policy: cusparseSolvePolicy_t,
1979        pBuffer: *mut ::core::ffi::c_void,
1980    ) -> cusparseStatus_t;
1981}
1982unsafe extern "C" {
1983    /// This function performs the solve phase of `bsrsv2`, a new sparse triangular linear system `op(A)*y =`$\alpha$`x`.
1984    ///
1985    /// `A` is an `(mb*blockDim)x(mb*blockDim)` sparse matrix that is defined in BSR storage format by the three arrays `bsrValA`, `bsrRowPtrA`, and `bsrColIndA`); `x` and `y` are the right-hand-side and the solution vectors; $\alpha$ is a scalar; and:
1986    /// $$
1987    /// \operatorname{op}(A) =
1988    /// \begin{cases}
1989    /// A & \text{if } trans = \text{CUSPARSE_OPERATION_NON_TRANSPOSE} \\
1990    /// A^T & \text{if } trans = \text{CUSPARSE_OPERATION_TRANSPOSE} \\
1991    /// A^H & \text{if } trans = \text{CUSPARSE_OPERATION_CONJUGATE_TRANSPOSE}
1992    /// \end{cases}
1993    /// $$
1994    ///
1995    /// The block in BSR format is of size `blockDim*blockDim`, stored as column-major or row-major as determined by parameter `dirA`, which is either [`cusparseDirection_t::CUSPARSE_DIRECTION_COLUMN`] or [`cusparseDirection_t::CUSPARSE_DIRECTION_ROW`]. The matrix type must be [`cusparseMatrixType_t::CUSPARSE_MATRIX_TYPE_GENERAL`], and the fill mode and diagonal type are ignored. Function `bsrsv02_solve()` can support an arbitrary `blockDim`.
1996    ///
1997    /// This function may be executed multiple times for a given matrix and a particular operation type.
1998    ///
1999    /// This function requires a buffer size returned by `bsrsv2_bufferSize()`. The address of `pBuffer` must be multiple of 128 bytes. If it is not, [`cusparseStatus_t::CUSPARSE_STATUS_INVALID_VALUE`] is returned.
2000    ///
2001    /// Although `bsrsv2_solve()` can be done without level information, the user still needs to be aware of consistency. If `bsrsv2_analysis()` is called with policy [`cusparseSolvePolicy_t::CUSPARSE_SOLVE_POLICY_USE_LEVEL`], `bsrsv2_solve()` can be run with or without levels. On the other hand, if `bsrsv2_analysis()` is called with [`cusparseSolvePolicy_t::CUSPARSE_SOLVE_POLICY_NO_LEVEL`], `bsrsv2_solve()` can only accept [`cusparseSolvePolicy_t::CUSPARSE_SOLVE_POLICY_NO_LEVEL`]; otherwise, [`cusparseStatus_t::CUSPARSE_STATUS_INVALID_VALUE`] is returned.
2002    ///
2003    /// The level information may not improve the performance, but may spend extra time doing analysis. For example, a tridiagonal matrix has no parallelism. In this case, [`cusparseSolvePolicy_t::CUSPARSE_SOLVE_POLICY_NO_LEVEL`] performs better than [`cusparseSolvePolicy_t::CUSPARSE_SOLVE_POLICY_USE_LEVEL`]. If the user has an iterative solver, the best approach is to do `bsrsv2_analysis()` with [`cusparseSolvePolicy_t::CUSPARSE_SOLVE_POLICY_USE_LEVEL`] once. Then do `bsrsv2_solve()` with [`cusparseSolvePolicy_t::CUSPARSE_SOLVE_POLICY_NO_LEVEL`] in the first run, and with [`cusparseSolvePolicy_t::CUSPARSE_SOLVE_POLICY_USE_LEVEL`] in the second run, and pick the fastest one to perform the remaining iterations.
2004    ///
2005    /// Function `bsrsv02_solve()` has the same behavior as `csrsv02_solve()`. That is, `bsr2csr(bsrsv02(A)) = csrsv02(bsr2csr(A))`. The numerical zero of `csrsv02_solve()` means there exists some zero `A(j,j)`. The numerical zero of `bsrsv02_solve()` means there exists some block `A(j,j)` that is not invertible.
2006    ///
2007    /// Function `bsrsv2_solve()` reports the first numerical zero, including a structural zero. No numerical zero is reported if [`cusparseDiagType_t::CUSPARSE_DIAG_TYPE_UNIT`] is specified, even if `A(j,j)` is not invertible for some `j`. The user needs to call [`cusparseXbsrsv2_zeroPivot`] to know where the numerical zero is.
2008    ///
2009    /// The function supports the following properties if `pBuffer != NULL`:
2010    ///
2011    /// * The routine requires no extra storage.
2012    /// * The routine supports asynchronous execution.
2013    /// * The routine supports CUDA graph capture.
2014    ///
2015    /// For example, suppose L is a lower triangular matrix with unit diagonal, then the following code solves `L*y=x` by level information.
2016    pub fn cusparseDbsrsv2_solve(
2017        handle: cusparseHandle_t,
2018        dirA: cusparseDirection_t,
2019        transA: cusparseOperation_t,
2020        mb: ::core::ffi::c_int,
2021        nnzb: ::core::ffi::c_int,
2022        alpha: *const f64,
2023        descrA: cusparseMatDescr_t,
2024        bsrSortedValA: *const f64,
2025        bsrSortedRowPtrA: *const ::core::ffi::c_int,
2026        bsrSortedColIndA: *const ::core::ffi::c_int,
2027        blockDim: ::core::ffi::c_int,
2028        info: bsrsv2Info_t,
2029        f: *const f64,
2030        x: *mut f64,
2031        policy: cusparseSolvePolicy_t,
2032        pBuffer: *mut ::core::ffi::c_void,
2033    ) -> cusparseStatus_t;
2034}
2035unsafe extern "C" {
2036    /// This function performs the solve phase of `bsrsv2`, a new sparse triangular linear system `op(A)*y =`$\alpha$`x`.
2037    ///
2038    /// `A` is an `(mb*blockDim)x(mb*blockDim)` sparse matrix that is defined in BSR storage format by the three arrays `bsrValA`, `bsrRowPtrA`, and `bsrColIndA`); `x` and `y` are the right-hand-side and the solution vectors; $\alpha$ is a scalar; and:
2039    /// $$
2040    /// \operatorname{op}(A) =
2041    /// \begin{cases}
2042    /// A & \text{if } trans = \text{CUSPARSE_OPERATION_NON_TRANSPOSE} \\
2043    /// A^T & \text{if } trans = \text{CUSPARSE_OPERATION_TRANSPOSE} \\
2044    /// A^H & \text{if } trans = \text{CUSPARSE_OPERATION_CONJUGATE_TRANSPOSE}
2045    /// \end{cases}
2046    /// $$
2047    ///
2048    /// The block in BSR format is of size `blockDim*blockDim`, stored as column-major or row-major as determined by parameter `dirA`, which is either [`cusparseDirection_t::CUSPARSE_DIRECTION_COLUMN`] or [`cusparseDirection_t::CUSPARSE_DIRECTION_ROW`]. The matrix type must be [`cusparseMatrixType_t::CUSPARSE_MATRIX_TYPE_GENERAL`], and the fill mode and diagonal type are ignored. Function `bsrsv02_solve()` can support an arbitrary `blockDim`.
2049    ///
2050    /// This function may be executed multiple times for a given matrix and a particular operation type.
2051    ///
2052    /// This function requires a buffer size returned by `bsrsv2_bufferSize()`. The address of `pBuffer` must be multiple of 128 bytes. If it is not, [`cusparseStatus_t::CUSPARSE_STATUS_INVALID_VALUE`] is returned.
2053    ///
2054    /// Although `bsrsv2_solve()` can be done without level information, the user still needs to be aware of consistency. If `bsrsv2_analysis()` is called with policy [`cusparseSolvePolicy_t::CUSPARSE_SOLVE_POLICY_USE_LEVEL`], `bsrsv2_solve()` can be run with or without levels. On the other hand, if `bsrsv2_analysis()` is called with [`cusparseSolvePolicy_t::CUSPARSE_SOLVE_POLICY_NO_LEVEL`], `bsrsv2_solve()` can only accept [`cusparseSolvePolicy_t::CUSPARSE_SOLVE_POLICY_NO_LEVEL`]; otherwise, [`cusparseStatus_t::CUSPARSE_STATUS_INVALID_VALUE`] is returned.
2055    ///
2056    /// The level information may not improve the performance, but may spend extra time doing analysis. For example, a tridiagonal matrix has no parallelism. In this case, [`cusparseSolvePolicy_t::CUSPARSE_SOLVE_POLICY_NO_LEVEL`] performs better than [`cusparseSolvePolicy_t::CUSPARSE_SOLVE_POLICY_USE_LEVEL`]. If the user has an iterative solver, the best approach is to do `bsrsv2_analysis()` with [`cusparseSolvePolicy_t::CUSPARSE_SOLVE_POLICY_USE_LEVEL`] once. Then do `bsrsv2_solve()` with [`cusparseSolvePolicy_t::CUSPARSE_SOLVE_POLICY_NO_LEVEL`] in the first run, and with [`cusparseSolvePolicy_t::CUSPARSE_SOLVE_POLICY_USE_LEVEL`] in the second run, and pick the fastest one to perform the remaining iterations.
2057    ///
2058    /// Function `bsrsv02_solve()` has the same behavior as `csrsv02_solve()`. That is, `bsr2csr(bsrsv02(A)) = csrsv02(bsr2csr(A))`. The numerical zero of `csrsv02_solve()` means there exists some zero `A(j,j)`. The numerical zero of `bsrsv02_solve()` means there exists some block `A(j,j)` that is not invertible.
2059    ///
2060    /// Function `bsrsv2_solve()` reports the first numerical zero, including a structural zero. No numerical zero is reported if [`cusparseDiagType_t::CUSPARSE_DIAG_TYPE_UNIT`] is specified, even if `A(j,j)` is not invertible for some `j`. The user needs to call [`cusparseXbsrsv2_zeroPivot`] to know where the numerical zero is.
2061    ///
2062    /// The function supports the following properties if `pBuffer != NULL`:
2063    ///
2064    /// * The routine requires no extra storage.
2065    /// * The routine supports asynchronous execution.
2066    /// * The routine supports CUDA graph capture.
2067    ///
2068    /// For example, suppose L is a lower triangular matrix with unit diagonal, then the following code solves `L*y=x` by level information.
2069    pub fn cusparseCbsrsv2_solve(
2070        handle: cusparseHandle_t,
2071        dirA: cusparseDirection_t,
2072        transA: cusparseOperation_t,
2073        mb: ::core::ffi::c_int,
2074        nnzb: ::core::ffi::c_int,
2075        alpha: *const cuComplex,
2076        descrA: cusparseMatDescr_t,
2077        bsrSortedValA: *const cuComplex,
2078        bsrSortedRowPtrA: *const ::core::ffi::c_int,
2079        bsrSortedColIndA: *const ::core::ffi::c_int,
2080        blockDim: ::core::ffi::c_int,
2081        info: bsrsv2Info_t,
2082        f: *const cuComplex,
2083        x: *mut cuComplex,
2084        policy: cusparseSolvePolicy_t,
2085        pBuffer: *mut ::core::ffi::c_void,
2086    ) -> cusparseStatus_t;
2087}
2088unsafe extern "C" {
2089    /// This function performs the solve phase of `bsrsv2`, a new sparse triangular linear system `op(A)*y =`$\alpha$`x`.
2090    ///
2091    /// `A` is an `(mb*blockDim)x(mb*blockDim)` sparse matrix that is defined in BSR storage format by the three arrays `bsrValA`, `bsrRowPtrA`, and `bsrColIndA`); `x` and `y` are the right-hand-side and the solution vectors; $\alpha$ is a scalar; and:
2092    /// $$
2093    /// \operatorname{op}(A) =
2094    /// \begin{cases}
2095    /// A & \text{if } trans = \text{CUSPARSE_OPERATION_NON_TRANSPOSE} \\
2096    /// A^T & \text{if } trans = \text{CUSPARSE_OPERATION_TRANSPOSE} \\
2097    /// A^H & \text{if } trans = \text{CUSPARSE_OPERATION_CONJUGATE_TRANSPOSE}
2098    /// \end{cases}
2099    /// $$
2100    ///
2101    /// The block in BSR format is of size `blockDim*blockDim`, stored as column-major or row-major as determined by parameter `dirA`, which is either [`cusparseDirection_t::CUSPARSE_DIRECTION_COLUMN`] or [`cusparseDirection_t::CUSPARSE_DIRECTION_ROW`]. The matrix type must be [`cusparseMatrixType_t::CUSPARSE_MATRIX_TYPE_GENERAL`], and the fill mode and diagonal type are ignored. Function `bsrsv02_solve()` can support an arbitrary `blockDim`.
2102    ///
2103    /// This function may be executed multiple times for a given matrix and a particular operation type.
2104    ///
2105    /// This function requires a buffer size returned by `bsrsv2_bufferSize()`. The address of `pBuffer` must be multiple of 128 bytes. If it is not, [`cusparseStatus_t::CUSPARSE_STATUS_INVALID_VALUE`] is returned.
2106    ///
2107    /// Although `bsrsv2_solve()` can be done without level information, the user still needs to be aware of consistency. If `bsrsv2_analysis()` is called with policy [`cusparseSolvePolicy_t::CUSPARSE_SOLVE_POLICY_USE_LEVEL`], `bsrsv2_solve()` can be run with or without levels. On the other hand, if `bsrsv2_analysis()` is called with [`cusparseSolvePolicy_t::CUSPARSE_SOLVE_POLICY_NO_LEVEL`], `bsrsv2_solve()` can only accept [`cusparseSolvePolicy_t::CUSPARSE_SOLVE_POLICY_NO_LEVEL`]; otherwise, [`cusparseStatus_t::CUSPARSE_STATUS_INVALID_VALUE`] is returned.
2108    ///
2109    /// The level information may not improve the performance, but may spend extra time doing analysis. For example, a tridiagonal matrix has no parallelism. In this case, [`cusparseSolvePolicy_t::CUSPARSE_SOLVE_POLICY_NO_LEVEL`] performs better than [`cusparseSolvePolicy_t::CUSPARSE_SOLVE_POLICY_USE_LEVEL`]. If the user has an iterative solver, the best approach is to do `bsrsv2_analysis()` with [`cusparseSolvePolicy_t::CUSPARSE_SOLVE_POLICY_USE_LEVEL`] once. Then do `bsrsv2_solve()` with [`cusparseSolvePolicy_t::CUSPARSE_SOLVE_POLICY_NO_LEVEL`] in the first run, and with [`cusparseSolvePolicy_t::CUSPARSE_SOLVE_POLICY_USE_LEVEL`] in the second run, and pick the fastest one to perform the remaining iterations.
2110    ///
2111    /// Function `bsrsv02_solve()` has the same behavior as `csrsv02_solve()`. That is, `bsr2csr(bsrsv02(A)) = csrsv02(bsr2csr(A))`. The numerical zero of `csrsv02_solve()` means there exists some zero `A(j,j)`. The numerical zero of `bsrsv02_solve()` means there exists some block `A(j,j)` that is not invertible.
2112    ///
2113    /// Function `bsrsv2_solve()` reports the first numerical zero, including a structural zero. No numerical zero is reported if [`cusparseDiagType_t::CUSPARSE_DIAG_TYPE_UNIT`] is specified, even if `A(j,j)` is not invertible for some `j`. The user needs to call [`cusparseXbsrsv2_zeroPivot`] to know where the numerical zero is.
2114    ///
2115    /// The function supports the following properties if `pBuffer != NULL`:
2116    ///
2117    /// * The routine requires no extra storage.
2118    /// * The routine supports asynchronous execution.
2119    /// * The routine supports CUDA graph capture.
2120    ///
2121    /// For example, suppose L is a lower triangular matrix with unit diagonal, then the following code solves `L*y=x` by level information.
2122    pub fn cusparseZbsrsv2_solve(
2123        handle: cusparseHandle_t,
2124        dirA: cusparseDirection_t,
2125        transA: cusparseOperation_t,
2126        mb: ::core::ffi::c_int,
2127        nnzb: ::core::ffi::c_int,
2128        alpha: *const cuDoubleComplex,
2129        descrA: cusparseMatDescr_t,
2130        bsrSortedValA: *const cuDoubleComplex,
2131        bsrSortedRowPtrA: *const ::core::ffi::c_int,
2132        bsrSortedColIndA: *const ::core::ffi::c_int,
2133        blockDim: ::core::ffi::c_int,
2134        info: bsrsv2Info_t,
2135        f: *const cuDoubleComplex,
2136        x: *mut cuDoubleComplex,
2137        policy: cusparseSolvePolicy_t,
2138        pBuffer: *mut ::core::ffi::c_void,
2139    ) -> cusparseStatus_t;
2140}
2141unsafe extern "C" {
2142    /// This function performs one of the following matrix-matrix operations:
2143    ///
2144    /// `A` is an $mb \times kb$ sparse matrix that is defined in BSR storage format by the three arrays `bsrValA`, `bsrRowPtrA`, and `bsrColIndA`; `B` and `C` are dense matrices; $\alpha\text{~and~}\beta$ are scalars; and:
2145    /// $$
2146    /// \operatorname{op}(A) =
2147    /// \begin{cases}
2148    /// A & \text{if } transA = \text{CUSPARSE_OPERATION_NON_TRANSPOSE} \\
2149    /// A^T & \text{if } transA = \text{CUSPARSE_OPERATION_TRANSPOSE (not supported)} \\
2150    /// A^H & \text{if } transA = \text{CUSPARSE_OPERATION_CONJUGATE_TRANSPOSE (not supported)}
2151    /// \end{cases}
2152    /// $$
2153    ///
2154    /// and:
2155    /// $$
2156    /// \operatorname{op}(B) =
2157    /// \begin{cases}
2158    /// B & \text{if } transB = \text{CUSPARSE_OPERATION_NON_TRANSPOSE} \\
2159    /// B^T & \text{if } transB = \text{CUSPARSE_OPERATION_TRANSPOSE} \\
2160    /// B^H & \text{if } transB = \text{CUSPARSE_OPERATION_CONJUGATE_TRANSPOSE (not supported)}
2161    /// \end{cases}
2162    /// $$
2163    ///
2164    /// The function has the following limitations:
2165    ///
2166    /// * only [`cusparseMatrixType_t::CUSPARSE_MATRIX_TYPE_GENERAL`] matrix type is supported
2167    /// * only `blockDim > 1` is supported
2168    /// * if `blockDim` ≤ 4, then max(mb)/max(n) = 524,272
2169    /// * if 4 &lt; `blockDim` ≤ 8, then max(mb) = 524,272, max(n) = 262,136
2170    /// * if `blockDim` > 8, then m &lt; 65,535 and max(n) = 262,136
2171    ///
2172    /// The motivation of `transpose(B)` is to improve memory access of matrix `B`. The computational pattern of `A*transpose(B)` with matrix `B` in column-major order is equivalent to `A*B` with matrix `B` in row-major order.
2173    ///
2174    /// In practice, no operation in an iterative solver or eigenvalue solver uses `A*transpose(B)`. However, we can perform `A*transpose(transpose(B))` which is the same as `A*B`. For example, suppose `A` is `mb*kb`, `B` is `k*n` and `C` is `m*n`, the following code shows usage of [`cusparseDbsrmm`].
2175    ///
2176    /// Instead of using `A*B`, our proposal is to transpose `B` to `Bt` by first calling `cublas&lt;t>geam()`, and then to perform `A*transpose(Bt)`.
2177    ///
2178    /// `bsrmm()` has the following properties:
2179    ///
2180    /// * The routine requires no extra storage.
2181    /// * The routine supports asynchronous execution.
2182    /// * The routine supports CUDA graph capture.
2183    pub fn cusparseSbsrmm(
2184        handle: cusparseHandle_t,
2185        dirA: cusparseDirection_t,
2186        transA: cusparseOperation_t,
2187        transB: cusparseOperation_t,
2188        mb: ::core::ffi::c_int,
2189        n: ::core::ffi::c_int,
2190        kb: ::core::ffi::c_int,
2191        nnzb: ::core::ffi::c_int,
2192        alpha: *const f32,
2193        descrA: cusparseMatDescr_t,
2194        bsrSortedValA: *const f32,
2195        bsrSortedRowPtrA: *const ::core::ffi::c_int,
2196        bsrSortedColIndA: *const ::core::ffi::c_int,
2197        blockSize: ::core::ffi::c_int,
2198        B: *const f32,
2199        ldb: ::core::ffi::c_int,
2200        beta: *const f32,
2201        C: *mut f32,
2202        ldc: ::core::ffi::c_int,
2203    ) -> cusparseStatus_t;
2204}
2205unsafe extern "C" {
2206    /// This function performs one of the following matrix-matrix operations:
2207    ///
2208    /// `A` is an $mb \times kb$ sparse matrix that is defined in BSR storage format by the three arrays `bsrValA`, `bsrRowPtrA`, and `bsrColIndA`; `B` and `C` are dense matrices; $\alpha\text{~and~}\beta$ are scalars; and:
2209    /// $$
2210    /// \operatorname{op}(A) =
2211    /// \begin{cases}
2212    /// A & \text{if } transA = \text{CUSPARSE_OPERATION_NON_TRANSPOSE} \\
2213    /// A^T & \text{if } transA = \text{CUSPARSE_OPERATION_TRANSPOSE (not supported)} \\
2214    /// A^H & \text{if } transA = \text{CUSPARSE_OPERATION_CONJUGATE_TRANSPOSE (not supported)}
2215    /// \end{cases}
2216    /// $$
2217    ///
2218    /// and:
2219    /// $$
2220    /// \operatorname{op}(B) =
2221    /// \begin{cases}
2222    /// B & \text{if } transB = \text{CUSPARSE_OPERATION_NON_TRANSPOSE} \\
2223    /// B^T & \text{if } transB = \text{CUSPARSE_OPERATION_TRANSPOSE} \\
2224    /// B^H & \text{if } transB = \text{CUSPARSE_OPERATION_CONJUGATE_TRANSPOSE (not supported)}
2225    /// \end{cases}
2226    /// $$
2227    ///
2228    /// The function has the following limitations:
2229    ///
2230    /// * only [`cusparseMatrixType_t::CUSPARSE_MATRIX_TYPE_GENERAL`] matrix type is supported
2231    /// * only `blockDim > 1` is supported
2232    /// * if `blockDim` ≤ 4, then max(mb)/max(n) = 524,272
2233    /// * if 4 &lt; `blockDim` ≤ 8, then max(mb) = 524,272, max(n) = 262,136
2234    /// * if `blockDim` > 8, then m &lt; 65,535 and max(n) = 262,136
2235    ///
2236    /// The motivation of `transpose(B)` is to improve memory access of matrix `B`. The computational pattern of `A*transpose(B)` with matrix `B` in column-major order is equivalent to `A*B` with matrix `B` in row-major order.
2237    ///
2238    /// In practice, no operation in an iterative solver or eigenvalue solver uses `A*transpose(B)`. However, we can perform `A*transpose(transpose(B))` which is the same as `A*B`. For example, suppose `A` is `mb*kb`, `B` is `k*n` and `C` is `m*n`, the following code shows usage of [`cusparseDbsrmm`].
2239    ///
2240    /// Instead of using `A*B`, our proposal is to transpose `B` to `Bt` by first calling `cublas&lt;t>geam()`, and then to perform `A*transpose(Bt)`.
2241    ///
2242    /// `bsrmm()` has the following properties:
2243    ///
2244    /// * The routine requires no extra storage.
2245    /// * The routine supports asynchronous execution.
2246    /// * The routine supports CUDA graph capture.
2247    pub fn cusparseDbsrmm(
2248        handle: cusparseHandle_t,
2249        dirA: cusparseDirection_t,
2250        transA: cusparseOperation_t,
2251        transB: cusparseOperation_t,
2252        mb: ::core::ffi::c_int,
2253        n: ::core::ffi::c_int,
2254        kb: ::core::ffi::c_int,
2255        nnzb: ::core::ffi::c_int,
2256        alpha: *const f64,
2257        descrA: cusparseMatDescr_t,
2258        bsrSortedValA: *const f64,
2259        bsrSortedRowPtrA: *const ::core::ffi::c_int,
2260        bsrSortedColIndA: *const ::core::ffi::c_int,
2261        blockSize: ::core::ffi::c_int,
2262        B: *const f64,
2263        ldb: ::core::ffi::c_int,
2264        beta: *const f64,
2265        C: *mut f64,
2266        ldc: ::core::ffi::c_int,
2267    ) -> cusparseStatus_t;
2268}
2269unsafe extern "C" {
2270    /// This function performs one of the following matrix-matrix operations:
2271    ///
2272    /// `A` is an $mb \times kb$ sparse matrix that is defined in BSR storage format by the three arrays `bsrValA`, `bsrRowPtrA`, and `bsrColIndA`; `B` and `C` are dense matrices; $\alpha\text{~and~}\beta$ are scalars; and:
2273    /// $$
2274    /// \operatorname{op}(A) =
2275    /// \begin{cases}
2276    /// A & \text{if } transA = \text{CUSPARSE_OPERATION_NON_TRANSPOSE} \\
2277    /// A^T & \text{if } transA = \text{CUSPARSE_OPERATION_TRANSPOSE (not supported)} \\
2278    /// A^H & \text{if } transA = \text{CUSPARSE_OPERATION_CONJUGATE_TRANSPOSE (not supported)}
2279    /// \end{cases}
2280    /// $$
2281    ///
2282    /// and:
2283    /// $$
2284    /// \operatorname{op}(B) =
2285    /// \begin{cases}
2286    /// B & \text{if } transB = \text{CUSPARSE_OPERATION_NON_TRANSPOSE} \\
2287    /// B^T & \text{if } transB = \text{CUSPARSE_OPERATION_TRANSPOSE} \\
2288    /// B^H & \text{if } transB = \text{CUSPARSE_OPERATION_CONJUGATE_TRANSPOSE (not supported)}
2289    /// \end{cases}
2290    /// $$
2291    ///
2292    /// The function has the following limitations:
2293    ///
2294    /// * only [`cusparseMatrixType_t::CUSPARSE_MATRIX_TYPE_GENERAL`] matrix type is supported
2295    /// * only `blockDim > 1` is supported
2296    /// * if `blockDim` ≤ 4, then max(mb)/max(n) = 524,272
2297    /// * if 4 &lt; `blockDim` ≤ 8, then max(mb) = 524,272, max(n) = 262,136
2298    /// * if `blockDim` > 8, then m &lt; 65,535 and max(n) = 262,136
2299    ///
2300    /// The motivation of `transpose(B)` is to improve memory access of matrix `B`. The computational pattern of `A*transpose(B)` with matrix `B` in column-major order is equivalent to `A*B` with matrix `B` in row-major order.
2301    ///
2302    /// In practice, no operation in an iterative solver or eigenvalue solver uses `A*transpose(B)`. However, we can perform `A*transpose(transpose(B))` which is the same as `A*B`. For example, suppose `A` is `mb*kb`, `B` is `k*n` and `C` is `m*n`, the following code shows usage of [`cusparseDbsrmm`].
2303    ///
2304    /// Instead of using `A*B`, our proposal is to transpose `B` to `Bt` by first calling `cublas&lt;t>geam()`, and then to perform `A*transpose(Bt)`.
2305    ///
2306    /// `bsrmm()` has the following properties:
2307    ///
2308    /// * The routine requires no extra storage.
2309    /// * The routine supports asynchronous execution.
2310    /// * The routine supports CUDA graph capture.
2311    pub fn cusparseCbsrmm(
2312        handle: cusparseHandle_t,
2313        dirA: cusparseDirection_t,
2314        transA: cusparseOperation_t,
2315        transB: cusparseOperation_t,
2316        mb: ::core::ffi::c_int,
2317        n: ::core::ffi::c_int,
2318        kb: ::core::ffi::c_int,
2319        nnzb: ::core::ffi::c_int,
2320        alpha: *const cuComplex,
2321        descrA: cusparseMatDescr_t,
2322        bsrSortedValA: *const cuComplex,
2323        bsrSortedRowPtrA: *const ::core::ffi::c_int,
2324        bsrSortedColIndA: *const ::core::ffi::c_int,
2325        blockSize: ::core::ffi::c_int,
2326        B: *const cuComplex,
2327        ldb: ::core::ffi::c_int,
2328        beta: *const cuComplex,
2329        C: *mut cuComplex,
2330        ldc: ::core::ffi::c_int,
2331    ) -> cusparseStatus_t;
2332}
2333unsafe extern "C" {
2334    /// This function performs one of the following matrix-matrix operations:
2335    ///
2336    /// `A` is an $mb \times kb$ sparse matrix that is defined in BSR storage format by the three arrays `bsrValA`, `bsrRowPtrA`, and `bsrColIndA`; `B` and `C` are dense matrices; $\alpha\text{~and~}\beta$ are scalars; and:
2337    /// $$
2338    /// \operatorname{op}(A) =
2339    /// \begin{cases}
2340    /// A & \text{if } transA = \text{CUSPARSE_OPERATION_NON_TRANSPOSE} \\
2341    /// A^T & \text{if } transA = \text{CUSPARSE_OPERATION_TRANSPOSE (not supported)} \\
2342    /// A^H & \text{if } transA = \text{CUSPARSE_OPERATION_CONJUGATE_TRANSPOSE (not supported)}
2343    /// \end{cases}
2344    /// $$
2345    ///
2346    /// and:
2347    /// $$
2348    /// \operatorname{op}(B) =
2349    /// \begin{cases}
2350    /// B & \text{if } transB = \text{CUSPARSE_OPERATION_NON_TRANSPOSE} \\
2351    /// B^T & \text{if } transB = \text{CUSPARSE_OPERATION_TRANSPOSE} \\
2352    /// B^H & \text{if } transB = \text{CUSPARSE_OPERATION_CONJUGATE_TRANSPOSE (not supported)}
2353    /// \end{cases}
2354    /// $$
2355    ///
2356    /// The function has the following limitations:
2357    ///
2358    /// * only [`cusparseMatrixType_t::CUSPARSE_MATRIX_TYPE_GENERAL`] matrix type is supported
2359    /// * only `blockDim > 1` is supported
2360    /// * if `blockDim` ≤ 4, then max(mb)/max(n) = 524,272
2361    /// * if 4 &lt; `blockDim` ≤ 8, then max(mb) = 524,272, max(n) = 262,136
2362    /// * if `blockDim` > 8, then m &lt; 65,535 and max(n) = 262,136
2363    ///
2364    /// The motivation of `transpose(B)` is to improve memory access of matrix `B`. The computational pattern of `A*transpose(B)` with matrix `B` in column-major order is equivalent to `A*B` with matrix `B` in row-major order.
2365    ///
2366    /// In practice, no operation in an iterative solver or eigenvalue solver uses `A*transpose(B)`. However, we can perform `A*transpose(transpose(B))` which is the same as `A*B`. For example, suppose `A` is `mb*kb`, `B` is `k*n` and `C` is `m*n`, the following code shows usage of [`cusparseDbsrmm`].
2367    ///
2368    /// Instead of using `A*B`, our proposal is to transpose `B` to `Bt` by first calling `cublas&lt;t>geam()`, and then to perform `A*transpose(Bt)`.
2369    ///
2370    /// `bsrmm()` has the following properties:
2371    ///
2372    /// * The routine requires no extra storage.
2373    /// * The routine supports asynchronous execution.
2374    /// * The routine supports CUDA graph capture.
2375    pub fn cusparseZbsrmm(
2376        handle: cusparseHandle_t,
2377        dirA: cusparseDirection_t,
2378        transA: cusparseOperation_t,
2379        transB: cusparseOperation_t,
2380        mb: ::core::ffi::c_int,
2381        n: ::core::ffi::c_int,
2382        kb: ::core::ffi::c_int,
2383        nnzb: ::core::ffi::c_int,
2384        alpha: *const cuDoubleComplex,
2385        descrA: cusparseMatDescr_t,
2386        bsrSortedValA: *const cuDoubleComplex,
2387        bsrSortedRowPtrA: *const ::core::ffi::c_int,
2388        bsrSortedColIndA: *const ::core::ffi::c_int,
2389        blockSize: ::core::ffi::c_int,
2390        B: *const cuDoubleComplex,
2391        ldb: ::core::ffi::c_int,
2392        beta: *const cuDoubleComplex,
2393        C: *mut cuDoubleComplex,
2394        ldc: ::core::ffi::c_int,
2395    ) -> cusparseStatus_t;
2396}
2397unsafe extern "C" {
2398    /// If the returned error code is [`cusparseStatus_t::CUSPARSE_STATUS_ZERO_PIVOT`], `position=j` means `A(j,j)` is either a structural zero or a numerical zero (singular block). Otherwise `position=-1`.
2399    ///
2400    /// The `position` can be 0-base or 1-base, the same as the matrix.
2401    ///
2402    /// Function [`cusparseXbsrsm2_zeroPivot`] is a blocking call. It calls `cudaDeviceSynchronize()` to make sure all previous kernels are done.
2403    ///
2404    /// The `position` can be in the host memory or device memory. The user can set the proper mode with [`cusparseSetPointerMode`].
2405    ///
2406    /// * The routine requires no extra storage.
2407    /// * The routine supports asynchronous execution if the Stream Ordered Memory Allocator is available.
2408    /// * The routine supports CUDA graph capture if the Stream Ordered Memory Allocator is available.
2409    ///
2410    /// # Parameters
2411    ///
2412    /// - `position`: if no structural or numerical zero, `position` is -1; otherwise, if `A(j,j)` is missing or `U(j,j)` is zero, `position=j`.
2413    #[deprecated]
2414    pub fn cusparseXbsrsm2_zeroPivot(
2415        handle: cusparseHandle_t,
2416        info: bsrsm2Info_t,
2417        position: *mut ::core::ffi::c_int,
2418    ) -> cusparseStatus_t;
2419}
2420unsafe extern "C" {
2421    /// This function returns size of buffer used in `bsrsm2()`, a new sparse triangular linear system `op(A)*op(X)=`$\alpha$`op(B)`.
2422    ///
2423    /// `A` is an `(mb*blockDim)x(mb*blockDim)` sparse matrix that is defined in BSR storage format by the three arrays `bsrValA`, `bsrRowPtrA`, and `bsrColIndA`); `B` and `X` are the right-hand-side and the solution matrices; $\alpha$ is a scalar; and
2424    ///
2425    /// $\operatorname{op}(A) = \text{CUSPARSE_OPERATION_NON_TRANSPOSE}$
2426    ///
2427    /// Although there are six combinations in terms of parameter `trans` and the upper (and lower) triangular part of `A`, `bsrsm2_bufferSize()` returns the maximum size of the buffer among these combinations. The buffer size depends on dimension `mb,blockDim` and the number of nonzeros of the matrix, `nnzb`. If the user changes the matrix, it is necessary to call `bsrsm2_bufferSize()` again to get the correct buffer size, otherwise a segmentation fault may occur.
2428    ///
2429    /// * The routine requires no extra storage.
2430    /// * The routine supports asynchronous execution.
2431    /// * The routine supports CUDA graph capture.
2432    pub fn cusparseSbsrsm2_bufferSize(
2433        handle: cusparseHandle_t,
2434        dirA: cusparseDirection_t,
2435        transA: cusparseOperation_t,
2436        transXY: cusparseOperation_t,
2437        mb: ::core::ffi::c_int,
2438        n: ::core::ffi::c_int,
2439        nnzb: ::core::ffi::c_int,
2440        descrA: cusparseMatDescr_t,
2441        bsrSortedVal: *mut f32,
2442        bsrSortedRowPtr: *const ::core::ffi::c_int,
2443        bsrSortedColInd: *const ::core::ffi::c_int,
2444        blockSize: ::core::ffi::c_int,
2445        info: bsrsm2Info_t,
2446        pBufferSizeInBytes: *mut ::core::ffi::c_int,
2447    ) -> cusparseStatus_t;
2448}
2449unsafe extern "C" {
2450    /// This function returns size of buffer used in `bsrsm2()`, a new sparse triangular linear system `op(A)*op(X)=`$\alpha$`op(B)`.
2451    ///
2452    /// `A` is an `(mb*blockDim)x(mb*blockDim)` sparse matrix that is defined in BSR storage format by the three arrays `bsrValA`, `bsrRowPtrA`, and `bsrColIndA`); `B` and `X` are the right-hand-side and the solution matrices; $\alpha$ is a scalar; and
2453    ///
2454    /// $\operatorname{op}(A) = \text{CUSPARSE_OPERATION_NON_TRANSPOSE}$
2455    ///
2456    /// Although there are six combinations in terms of parameter `trans` and the upper (and lower) triangular part of `A`, `bsrsm2_bufferSize()` returns the maximum size of the buffer among these combinations. The buffer size depends on dimension `mb,blockDim` and the number of nonzeros of the matrix, `nnzb`. If the user changes the matrix, it is necessary to call `bsrsm2_bufferSize()` again to get the correct buffer size, otherwise a segmentation fault may occur.
2457    ///
2458    /// * The routine requires no extra storage.
2459    /// * The routine supports asynchronous execution.
2460    /// * The routine supports CUDA graph capture.
2461    pub fn cusparseDbsrsm2_bufferSize(
2462        handle: cusparseHandle_t,
2463        dirA: cusparseDirection_t,
2464        transA: cusparseOperation_t,
2465        transXY: cusparseOperation_t,
2466        mb: ::core::ffi::c_int,
2467        n: ::core::ffi::c_int,
2468        nnzb: ::core::ffi::c_int,
2469        descrA: cusparseMatDescr_t,
2470        bsrSortedVal: *mut f64,
2471        bsrSortedRowPtr: *const ::core::ffi::c_int,
2472        bsrSortedColInd: *const ::core::ffi::c_int,
2473        blockSize: ::core::ffi::c_int,
2474        info: bsrsm2Info_t,
2475        pBufferSizeInBytes: *mut ::core::ffi::c_int,
2476    ) -> cusparseStatus_t;
2477}
2478unsafe extern "C" {
2479    /// This function returns size of buffer used in `bsrsm2()`, a new sparse triangular linear system `op(A)*op(X)=`$\alpha$`op(B)`.
2480    ///
2481    /// `A` is an `(mb*blockDim)x(mb*blockDim)` sparse matrix that is defined in BSR storage format by the three arrays `bsrValA`, `bsrRowPtrA`, and `bsrColIndA`); `B` and `X` are the right-hand-side and the solution matrices; $\alpha$ is a scalar; and
2482    ///
2483    /// $\operatorname{op}(A) = \text{CUSPARSE_OPERATION_NON_TRANSPOSE}$
2484    ///
2485    /// Although there are six combinations in terms of parameter `trans` and the upper (and lower) triangular part of `A`, `bsrsm2_bufferSize()` returns the maximum size of the buffer among these combinations. The buffer size depends on dimension `mb,blockDim` and the number of nonzeros of the matrix, `nnzb`. If the user changes the matrix, it is necessary to call `bsrsm2_bufferSize()` again to get the correct buffer size, otherwise a segmentation fault may occur.
2486    ///
2487    /// * The routine requires no extra storage.
2488    /// * The routine supports asynchronous execution.
2489    /// * The routine supports CUDA graph capture.
2490    pub fn cusparseCbsrsm2_bufferSize(
2491        handle: cusparseHandle_t,
2492        dirA: cusparseDirection_t,
2493        transA: cusparseOperation_t,
2494        transXY: cusparseOperation_t,
2495        mb: ::core::ffi::c_int,
2496        n: ::core::ffi::c_int,
2497        nnzb: ::core::ffi::c_int,
2498        descrA: cusparseMatDescr_t,
2499        bsrSortedVal: *mut cuComplex,
2500        bsrSortedRowPtr: *const ::core::ffi::c_int,
2501        bsrSortedColInd: *const ::core::ffi::c_int,
2502        blockSize: ::core::ffi::c_int,
2503        info: bsrsm2Info_t,
2504        pBufferSizeInBytes: *mut ::core::ffi::c_int,
2505    ) -> cusparseStatus_t;
2506}
2507unsafe extern "C" {
2508    /// This function returns size of buffer used in `bsrsm2()`, a new sparse triangular linear system `op(A)*op(X)=`$\alpha$`op(B)`.
2509    ///
2510    /// `A` is an `(mb*blockDim)x(mb*blockDim)` sparse matrix that is defined in BSR storage format by the three arrays `bsrValA`, `bsrRowPtrA`, and `bsrColIndA`); `B` and `X` are the right-hand-side and the solution matrices; $\alpha$ is a scalar; and
2511    ///
2512    /// $\operatorname{op}(A) = \text{CUSPARSE_OPERATION_NON_TRANSPOSE}$
2513    ///
2514    /// Although there are six combinations in terms of parameter `trans` and the upper (and lower) triangular part of `A`, `bsrsm2_bufferSize()` returns the maximum size of the buffer among these combinations. The buffer size depends on dimension `mb,blockDim` and the number of nonzeros of the matrix, `nnzb`. If the user changes the matrix, it is necessary to call `bsrsm2_bufferSize()` again to get the correct buffer size, otherwise a segmentation fault may occur.
2515    ///
2516    /// * The routine requires no extra storage.
2517    /// * The routine supports asynchronous execution.
2518    /// * The routine supports CUDA graph capture.
2519    pub fn cusparseZbsrsm2_bufferSize(
2520        handle: cusparseHandle_t,
2521        dirA: cusparseDirection_t,
2522        transA: cusparseOperation_t,
2523        transXY: cusparseOperation_t,
2524        mb: ::core::ffi::c_int,
2525        n: ::core::ffi::c_int,
2526        nnzb: ::core::ffi::c_int,
2527        descrA: cusparseMatDescr_t,
2528        bsrSortedVal: *mut cuDoubleComplex,
2529        bsrSortedRowPtr: *const ::core::ffi::c_int,
2530        bsrSortedColInd: *const ::core::ffi::c_int,
2531        blockSize: ::core::ffi::c_int,
2532        info: bsrsm2Info_t,
2533        pBufferSizeInBytes: *mut ::core::ffi::c_int,
2534    ) -> cusparseStatus_t;
2535}
2536unsafe extern "C" {
2537    pub fn cusparseSbsrsm2_bufferSizeExt(
2538        handle: cusparseHandle_t,
2539        dirA: cusparseDirection_t,
2540        transA: cusparseOperation_t,
2541        transB: cusparseOperation_t,
2542        mb: ::core::ffi::c_int,
2543        n: ::core::ffi::c_int,
2544        nnzb: ::core::ffi::c_int,
2545        descrA: cusparseMatDescr_t,
2546        bsrSortedVal: *mut f32,
2547        bsrSortedRowPtr: *const ::core::ffi::c_int,
2548        bsrSortedColInd: *const ::core::ffi::c_int,
2549        blockSize: ::core::ffi::c_int,
2550        info: bsrsm2Info_t,
2551        pBufferSize: *mut size_t,
2552    ) -> cusparseStatus_t;
2553}
2554unsafe extern "C" {
2555    pub fn cusparseDbsrsm2_bufferSizeExt(
2556        handle: cusparseHandle_t,
2557        dirA: cusparseDirection_t,
2558        transA: cusparseOperation_t,
2559        transB: cusparseOperation_t,
2560        mb: ::core::ffi::c_int,
2561        n: ::core::ffi::c_int,
2562        nnzb: ::core::ffi::c_int,
2563        descrA: cusparseMatDescr_t,
2564        bsrSortedVal: *mut f64,
2565        bsrSortedRowPtr: *const ::core::ffi::c_int,
2566        bsrSortedColInd: *const ::core::ffi::c_int,
2567        blockSize: ::core::ffi::c_int,
2568        info: bsrsm2Info_t,
2569        pBufferSize: *mut size_t,
2570    ) -> cusparseStatus_t;
2571}
2572unsafe extern "C" {
2573    pub fn cusparseCbsrsm2_bufferSizeExt(
2574        handle: cusparseHandle_t,
2575        dirA: cusparseDirection_t,
2576        transA: cusparseOperation_t,
2577        transB: cusparseOperation_t,
2578        mb: ::core::ffi::c_int,
2579        n: ::core::ffi::c_int,
2580        nnzb: ::core::ffi::c_int,
2581        descrA: cusparseMatDescr_t,
2582        bsrSortedVal: *mut cuComplex,
2583        bsrSortedRowPtr: *const ::core::ffi::c_int,
2584        bsrSortedColInd: *const ::core::ffi::c_int,
2585        blockSize: ::core::ffi::c_int,
2586        info: bsrsm2Info_t,
2587        pBufferSize: *mut size_t,
2588    ) -> cusparseStatus_t;
2589}
2590unsafe extern "C" {
2591    pub fn cusparseZbsrsm2_bufferSizeExt(
2592        handle: cusparseHandle_t,
2593        dirA: cusparseDirection_t,
2594        transA: cusparseOperation_t,
2595        transB: cusparseOperation_t,
2596        mb: ::core::ffi::c_int,
2597        n: ::core::ffi::c_int,
2598        nnzb: ::core::ffi::c_int,
2599        descrA: cusparseMatDescr_t,
2600        bsrSortedVal: *mut cuDoubleComplex,
2601        bsrSortedRowPtr: *const ::core::ffi::c_int,
2602        bsrSortedColInd: *const ::core::ffi::c_int,
2603        blockSize: ::core::ffi::c_int,
2604        info: bsrsm2Info_t,
2605        pBufferSize: *mut size_t,
2606    ) -> cusparseStatus_t;
2607}
2608unsafe extern "C" {
2609    /// This function performs the analysis phase of `bsrsm2()`, a new sparse triangular linear system `op(A)*op(X) =`$\alpha$`op(B)`.
2610    ///
2611    /// `A` is an `(mb*blockDim)x(mb*blockDim)` sparse matrix that is defined in BSR storage format by the three arrays `bsrValA`, `bsrRowPtrA`, and `bsrColIndA`); `B` and `X` are the right-hand-side and the solution matrices; $\alpha$ is a scalar; and
2612    ///
2613    /// $\operatorname{op}(A) = \text{CUSPARSE_OPERATION_NON_TRANSPOSE}$
2614    ///
2615    /// and:
2616    /// $$
2617    /// \operatorname{op}(X) =
2618    /// \begin{cases}
2619    /// X & \text{if } transX = \text{CUSPARSE_OPERATION_NON_TRANSPOSE} \\
2620    /// X^T & \text{if } transX = \text{CUSPARSE_OPERATION_TRANSPOSE} \\
2621    /// X^H & \text{if } transX = \text{CUSPARSE_OPERATION_CONJUGATE_TRANSPOSE (not supported)}
2622    /// \end{cases}
2623    /// $$
2624    ///
2625    /// and `op(B)` and `op(X)` are equal.
2626    ///
2627    /// The block of BSR format is of size `blockDim*blockDim`, stored in column-major or row-major as determined by parameter `dirA`, which is either [`cusparseDirection_t::CUSPARSE_DIRECTION_ROW`] or [`cusparseDirection_t::CUSPARSE_DIRECTION_COLUMN`]. The matrix type must be [`cusparseMatrixType_t::CUSPARSE_MATRIX_TYPE_GENERAL`], and the fill mode and diagonal type are ignored.
2628    ///
2629    /// It is expected that this function will be executed only once for a given matrix and a particular operation type.
2630    ///
2631    /// This function requires the buffer size returned by `bsrsm2_bufferSize()`. The address of `pBuffer` must be multiple of 128 bytes. If not, [`cusparseStatus_t::CUSPARSE_STATUS_INVALID_VALUE`] is returned.
2632    ///
2633    /// Function `bsrsm2_analysis()` reports a structural zero and computes the level information stored in opaque structure `info`. The level information can extract more parallelism during a triangular solver. However `bsrsm2_solve()` can be done without level information. To disable level information, the user needs to specify the policy of the triangular solver as [`cusparseSolvePolicy_t::CUSPARSE_SOLVE_POLICY_NO_LEVEL`].
2634    ///
2635    /// Function `bsrsm2_analysis()` always reports the first structural zero, even if the parameter `policy` is [`cusparseSolvePolicy_t::CUSPARSE_SOLVE_POLICY_NO_LEVEL`]. Besides, no structural zero is reported if [`cusparseDiagType_t::CUSPARSE_DIAG_TYPE_UNIT`] is specified, even if block `A(j,j)` is missing for some `j`. The user must call `cusparseXbsrsm2_query_zero_pivot()` to know where the structural zero is.
2636    ///
2637    /// If `bsrsm2_analysis()` reports a structural zero, the solve will return a numerical zero in the same position as the structural zero but this result `X` is meaningless.
2638    ///
2639    /// * This function requires temporary extra storage that is allocated internally.
2640    /// * The routine supports asynchronous execution if the Stream Ordered Memory Allocator is available.
2641    /// * The routine supports CUDA graph capture if the Stream Ordered Memory Allocator is available.
2642    pub fn cusparseSbsrsm2_analysis(
2643        handle: cusparseHandle_t,
2644        dirA: cusparseDirection_t,
2645        transA: cusparseOperation_t,
2646        transXY: cusparseOperation_t,
2647        mb: ::core::ffi::c_int,
2648        n: ::core::ffi::c_int,
2649        nnzb: ::core::ffi::c_int,
2650        descrA: cusparseMatDescr_t,
2651        bsrSortedVal: *const f32,
2652        bsrSortedRowPtr: *const ::core::ffi::c_int,
2653        bsrSortedColInd: *const ::core::ffi::c_int,
2654        blockSize: ::core::ffi::c_int,
2655        info: bsrsm2Info_t,
2656        policy: cusparseSolvePolicy_t,
2657        pBuffer: *mut ::core::ffi::c_void,
2658    ) -> cusparseStatus_t;
2659}
2660unsafe extern "C" {
2661    /// This function performs the analysis phase of `bsrsm2()`, a new sparse triangular linear system `op(A)*op(X) =`$\alpha$`op(B)`.
2662    ///
2663    /// `A` is an `(mb*blockDim)x(mb*blockDim)` sparse matrix that is defined in BSR storage format by the three arrays `bsrValA`, `bsrRowPtrA`, and `bsrColIndA`); `B` and `X` are the right-hand-side and the solution matrices; $\alpha$ is a scalar; and
2664    ///
2665    /// $\operatorname{op}(A) = \text{CUSPARSE_OPERATION_NON_TRANSPOSE}$
2666    ///
2667    /// and:
2668    /// $$
2669    /// \operatorname{op}(X) =
2670    /// \begin{cases}
2671    /// X & \text{if } transX = \text{CUSPARSE_OPERATION_NON_TRANSPOSE} \\
2672    /// X^T & \text{if } transX = \text{CUSPARSE_OPERATION_TRANSPOSE} \\
2673    /// X^H & \text{if } transX = \text{CUSPARSE_OPERATION_CONJUGATE_TRANSPOSE (not supported)}
2674    /// \end{cases}
2675    /// $$
2676    ///
2677    /// and `op(B)` and `op(X)` are equal.
2678    ///
2679    /// The block of BSR format is of size `blockDim*blockDim`, stored in column-major or row-major as determined by parameter `dirA`, which is either [`cusparseDirection_t::CUSPARSE_DIRECTION_ROW`] or [`cusparseDirection_t::CUSPARSE_DIRECTION_COLUMN`]. The matrix type must be [`cusparseMatrixType_t::CUSPARSE_MATRIX_TYPE_GENERAL`], and the fill mode and diagonal type are ignored.
2680    ///
2681    /// It is expected that this function will be executed only once for a given matrix and a particular operation type.
2682    ///
2683    /// This function requires the buffer size returned by `bsrsm2_bufferSize()`. The address of `pBuffer` must be multiple of 128 bytes. If not, [`cusparseStatus_t::CUSPARSE_STATUS_INVALID_VALUE`] is returned.
2684    ///
2685    /// Function `bsrsm2_analysis()` reports a structural zero and computes the level information stored in opaque structure `info`. The level information can extract more parallelism during a triangular solver. However `bsrsm2_solve()` can be done without level information. To disable level information, the user needs to specify the policy of the triangular solver as [`cusparseSolvePolicy_t::CUSPARSE_SOLVE_POLICY_NO_LEVEL`].
2686    ///
2687    /// Function `bsrsm2_analysis()` always reports the first structural zero, even if the parameter `policy` is [`cusparseSolvePolicy_t::CUSPARSE_SOLVE_POLICY_NO_LEVEL`]. Besides, no structural zero is reported if [`cusparseDiagType_t::CUSPARSE_DIAG_TYPE_UNIT`] is specified, even if block `A(j,j)` is missing for some `j`. The user must call `cusparseXbsrsm2_query_zero_pivot()` to know where the structural zero is.
2688    ///
2689    /// If `bsrsm2_analysis()` reports a structural zero, the solve will return a numerical zero in the same position as the structural zero but this result `X` is meaningless.
2690    ///
2691    /// * This function requires temporary extra storage that is allocated internally.
2692    /// * The routine supports asynchronous execution if the Stream Ordered Memory Allocator is available.
2693    /// * The routine supports CUDA graph capture if the Stream Ordered Memory Allocator is available.
2694    pub fn cusparseDbsrsm2_analysis(
2695        handle: cusparseHandle_t,
2696        dirA: cusparseDirection_t,
2697        transA: cusparseOperation_t,
2698        transXY: cusparseOperation_t,
2699        mb: ::core::ffi::c_int,
2700        n: ::core::ffi::c_int,
2701        nnzb: ::core::ffi::c_int,
2702        descrA: cusparseMatDescr_t,
2703        bsrSortedVal: *const f64,
2704        bsrSortedRowPtr: *const ::core::ffi::c_int,
2705        bsrSortedColInd: *const ::core::ffi::c_int,
2706        blockSize: ::core::ffi::c_int,
2707        info: bsrsm2Info_t,
2708        policy: cusparseSolvePolicy_t,
2709        pBuffer: *mut ::core::ffi::c_void,
2710    ) -> cusparseStatus_t;
2711}
2712unsafe extern "C" {
2713    /// This function performs the analysis phase of `bsrsm2()`, a new sparse triangular linear system `op(A)*op(X) =`$\alpha$`op(B)`.
2714    ///
2715    /// `A` is an `(mb*blockDim)x(mb*blockDim)` sparse matrix that is defined in BSR storage format by the three arrays `bsrValA`, `bsrRowPtrA`, and `bsrColIndA`); `B` and `X` are the right-hand-side and the solution matrices; $\alpha$ is a scalar; and
2716    ///
2717    /// $\operatorname{op}(A) = \text{CUSPARSE_OPERATION_NON_TRANSPOSE}$
2718    ///
2719    /// and:
2720    /// $$
2721    /// \operatorname{op}(X) =
2722    /// \begin{cases}
2723    /// X & \text{if } transX = \text{CUSPARSE_OPERATION_NON_TRANSPOSE} \\
2724    /// X^T & \text{if } transX = \text{CUSPARSE_OPERATION_TRANSPOSE} \\
2725    /// X^H & \text{if } transX = \text{CUSPARSE_OPERATION_CONJUGATE_TRANSPOSE (not supported)}
2726    /// \end{cases}
2727    /// $$
2728    ///
2729    /// and `op(B)` and `op(X)` are equal.
2730    ///
2731    /// The block of BSR format is of size `blockDim*blockDim`, stored in column-major or row-major as determined by parameter `dirA`, which is either [`cusparseDirection_t::CUSPARSE_DIRECTION_ROW`] or [`cusparseDirection_t::CUSPARSE_DIRECTION_COLUMN`]. The matrix type must be [`cusparseMatrixType_t::CUSPARSE_MATRIX_TYPE_GENERAL`], and the fill mode and diagonal type are ignored.
2732    ///
2733    /// It is expected that this function will be executed only once for a given matrix and a particular operation type.
2734    ///
2735    /// This function requires the buffer size returned by `bsrsm2_bufferSize()`. The address of `pBuffer` must be multiple of 128 bytes. If not, [`cusparseStatus_t::CUSPARSE_STATUS_INVALID_VALUE`] is returned.
2736    ///
2737    /// Function `bsrsm2_analysis()` reports a structural zero and computes the level information stored in opaque structure `info`. The level information can extract more parallelism during a triangular solver. However `bsrsm2_solve()` can be done without level information. To disable level information, the user needs to specify the policy of the triangular solver as [`cusparseSolvePolicy_t::CUSPARSE_SOLVE_POLICY_NO_LEVEL`].
2738    ///
2739    /// Function `bsrsm2_analysis()` always reports the first structural zero, even if the parameter `policy` is [`cusparseSolvePolicy_t::CUSPARSE_SOLVE_POLICY_NO_LEVEL`]. Besides, no structural zero is reported if [`cusparseDiagType_t::CUSPARSE_DIAG_TYPE_UNIT`] is specified, even if block `A(j,j)` is missing for some `j`. The user must call `cusparseXbsrsm2_query_zero_pivot()` to know where the structural zero is.
2740    ///
2741    /// If `bsrsm2_analysis()` reports a structural zero, the solve will return a numerical zero in the same position as the structural zero but this result `X` is meaningless.
2742    ///
2743    /// * This function requires temporary extra storage that is allocated internally.
2744    /// * The routine supports asynchronous execution if the Stream Ordered Memory Allocator is available.
2745    /// * The routine supports CUDA graph capture if the Stream Ordered Memory Allocator is available.
2746    pub fn cusparseCbsrsm2_analysis(
2747        handle: cusparseHandle_t,
2748        dirA: cusparseDirection_t,
2749        transA: cusparseOperation_t,
2750        transXY: cusparseOperation_t,
2751        mb: ::core::ffi::c_int,
2752        n: ::core::ffi::c_int,
2753        nnzb: ::core::ffi::c_int,
2754        descrA: cusparseMatDescr_t,
2755        bsrSortedVal: *const cuComplex,
2756        bsrSortedRowPtr: *const ::core::ffi::c_int,
2757        bsrSortedColInd: *const ::core::ffi::c_int,
2758        blockSize: ::core::ffi::c_int,
2759        info: bsrsm2Info_t,
2760        policy: cusparseSolvePolicy_t,
2761        pBuffer: *mut ::core::ffi::c_void,
2762    ) -> cusparseStatus_t;
2763}
2764unsafe extern "C" {
2765    /// This function performs the analysis phase of `bsrsm2()`, a new sparse triangular linear system `op(A)*op(X) =`$\alpha$`op(B)`.
2766    ///
2767    /// `A` is an `(mb*blockDim)x(mb*blockDim)` sparse matrix that is defined in BSR storage format by the three arrays `bsrValA`, `bsrRowPtrA`, and `bsrColIndA`); `B` and `X` are the right-hand-side and the solution matrices; $\alpha$ is a scalar; and
2768    ///
2769    /// $\operatorname{op}(A) = \text{CUSPARSE_OPERATION_NON_TRANSPOSE}$
2770    ///
2771    /// and:
2772    /// $$
2773    /// \operatorname{op}(X) =
2774    /// \begin{cases}
2775    /// X & \text{if } transX = \text{CUSPARSE_OPERATION_NON_TRANSPOSE} \\
2776    /// X^T & \text{if } transX = \text{CUSPARSE_OPERATION_TRANSPOSE} \\
2777    /// X^H & \text{if } transX = \text{CUSPARSE_OPERATION_CONJUGATE_TRANSPOSE (not supported)}
2778    /// \end{cases}
2779    /// $$
2780    ///
2781    /// and `op(B)` and `op(X)` are equal.
2782    ///
2783    /// The block of BSR format is of size `blockDim*blockDim`, stored in column-major or row-major as determined by parameter `dirA`, which is either [`cusparseDirection_t::CUSPARSE_DIRECTION_ROW`] or [`cusparseDirection_t::CUSPARSE_DIRECTION_COLUMN`]. The matrix type must be [`cusparseMatrixType_t::CUSPARSE_MATRIX_TYPE_GENERAL`], and the fill mode and diagonal type are ignored.
2784    ///
2785    /// It is expected that this function will be executed only once for a given matrix and a particular operation type.
2786    ///
2787    /// This function requires the buffer size returned by `bsrsm2_bufferSize()`. The address of `pBuffer` must be multiple of 128 bytes. If not, [`cusparseStatus_t::CUSPARSE_STATUS_INVALID_VALUE`] is returned.
2788    ///
2789    /// Function `bsrsm2_analysis()` reports a structural zero and computes the level information stored in opaque structure `info`. The level information can extract more parallelism during a triangular solver. However `bsrsm2_solve()` can be done without level information. To disable level information, the user needs to specify the policy of the triangular solver as [`cusparseSolvePolicy_t::CUSPARSE_SOLVE_POLICY_NO_LEVEL`].
2790    ///
2791    /// Function `bsrsm2_analysis()` always reports the first structural zero, even if the parameter `policy` is [`cusparseSolvePolicy_t::CUSPARSE_SOLVE_POLICY_NO_LEVEL`]. Besides, no structural zero is reported if [`cusparseDiagType_t::CUSPARSE_DIAG_TYPE_UNIT`] is specified, even if block `A(j,j)` is missing for some `j`. The user must call `cusparseXbsrsm2_query_zero_pivot()` to know where the structural zero is.
2792    ///
2793    /// If `bsrsm2_analysis()` reports a structural zero, the solve will return a numerical zero in the same position as the structural zero but this result `X` is meaningless.
2794    ///
2795    /// * This function requires temporary extra storage that is allocated internally.
2796    /// * The routine supports asynchronous execution if the Stream Ordered Memory Allocator is available.
2797    /// * The routine supports CUDA graph capture if the Stream Ordered Memory Allocator is available.
2798    pub fn cusparseZbsrsm2_analysis(
2799        handle: cusparseHandle_t,
2800        dirA: cusparseDirection_t,
2801        transA: cusparseOperation_t,
2802        transXY: cusparseOperation_t,
2803        mb: ::core::ffi::c_int,
2804        n: ::core::ffi::c_int,
2805        nnzb: ::core::ffi::c_int,
2806        descrA: cusparseMatDescr_t,
2807        bsrSortedVal: *const cuDoubleComplex,
2808        bsrSortedRowPtr: *const ::core::ffi::c_int,
2809        bsrSortedColInd: *const ::core::ffi::c_int,
2810        blockSize: ::core::ffi::c_int,
2811        info: bsrsm2Info_t,
2812        policy: cusparseSolvePolicy_t,
2813        pBuffer: *mut ::core::ffi::c_void,
2814    ) -> cusparseStatus_t;
2815}
2816unsafe extern "C" {
2817    /// This function performs the solve phase of the solution of a sparse triangular linear system:
2818    ///
2819    /// `A` is an `(mb*blockDim)x(mb*blockDim)` sparse matrix that is defined in BSR storage format by the three arrays `bsrValA`, `bsrRowPtrA`, and `bsrColIndA`); `B` and `X` are the right-hand-side and the solution matrices; $\alpha$ is a scalar, and
2820    ///
2821    /// $\operatorname{op}(A) = \text{CUSPARSE_OPERATION_NON_TRANSPOSE}$
2822    ///
2823    /// and:
2824    /// $$
2825    /// \operatorname{op}(X) =
2826    /// \begin{cases}
2827    /// X & \text{if } transX = \text{CUSPARSE_OPERATION_NON_TRANSPOSE} \\
2828    /// X^T & \text{if } transX = \text{CUSPARSE_OPERATION_TRANSPOSE} \\
2829    /// X^H & \text{not supported}
2830    /// \end{cases}
2831    /// $$
2832    ///
2833    /// Only `op(A)=A` is supported.
2834    ///
2835    /// `op(B)` and `op(X)` must be performed in the same way. In other words, if `op(B)=B`, `op(X)=X`.
2836    ///
2837    /// The block of BSR format is of size `blockDim*blockDim`, stored as column-major or row-major as determined by parameter `dirA`, which is either [`cusparseDirection_t::CUSPARSE_DIRECTION_ROW`] or [`cusparseDirection_t::CUSPARSE_DIRECTION_COLUMN`]. The matrix type must be [`cusparseMatrixType_t::CUSPARSE_MATRIX_TYPE_GENERAL`], and the fill mode and diagonal type are ignored. Function `bsrsm02_solve()` can support an arbitrary `blockDim`.
2838    ///
2839    /// This function may be executed multiple times for a given matrix and a particular operation type.
2840    ///
2841    /// This function requires the buffer size returned by `bsrsm2_bufferSize()`. The address of `pBuffer` must be multiple of 128 bytes. If it is not, [`cusparseStatus_t::CUSPARSE_STATUS_INVALID_VALUE`] is returned.
2842    ///
2843    /// Although `bsrsm2_solve()` can be done without level information, the user still needs to be aware of consistency. If `bsrsm2_analysis()` is called with policy [`cusparseSolvePolicy_t::CUSPARSE_SOLVE_POLICY_USE_LEVEL`], `bsrsm2_solve()` can be run with or without levels. On the other hand, if `bsrsm2_analysis()` is called with [`cusparseSolvePolicy_t::CUSPARSE_SOLVE_POLICY_NO_LEVEL`], `bsrsm2_solve()` can only accept [`cusparseSolvePolicy_t::CUSPARSE_SOLVE_POLICY_NO_LEVEL`]; otherwise, [`cusparseStatus_t::CUSPARSE_STATUS_INVALID_VALUE`] is returned.
2844    ///
2845    /// Function `bsrsm02_solve()` has the same behavior as `bsrsv02_solve()`, reporting the first numerical zero, including a structural zero. The user must call `cusparseXbsrsm2_query_zero_pivot()` to know where the numerical zero is.
2846    ///
2847    /// The motivation of `transpose(X)` is to improve the memory access of matrix `X`. The computational pattern of `transpose(X)` with matrix `X` in column-major order is equivalent to `X` with matrix `X` in row-major order.
2848    ///
2849    /// In-place is supported and requires that `B` and `X` point to the same memory block, and `ldb=ldx`.
2850    ///
2851    /// The function supports the following properties if `pBuffer != NULL`:
2852    ///
2853    /// * The routine requires no extra storage.
2854    /// * The routine supports asynchronous execution.
2855    /// * The routine supports CUDA graph capture.
2856    pub fn cusparseSbsrsm2_solve(
2857        handle: cusparseHandle_t,
2858        dirA: cusparseDirection_t,
2859        transA: cusparseOperation_t,
2860        transXY: cusparseOperation_t,
2861        mb: ::core::ffi::c_int,
2862        n: ::core::ffi::c_int,
2863        nnzb: ::core::ffi::c_int,
2864        alpha: *const f32,
2865        descrA: cusparseMatDescr_t,
2866        bsrSortedVal: *const f32,
2867        bsrSortedRowPtr: *const ::core::ffi::c_int,
2868        bsrSortedColInd: *const ::core::ffi::c_int,
2869        blockSize: ::core::ffi::c_int,
2870        info: bsrsm2Info_t,
2871        B: *const f32,
2872        ldb: ::core::ffi::c_int,
2873        X: *mut f32,
2874        ldx: ::core::ffi::c_int,
2875        policy: cusparseSolvePolicy_t,
2876        pBuffer: *mut ::core::ffi::c_void,
2877    ) -> cusparseStatus_t;
2878}
2879unsafe extern "C" {
2880    /// This function performs the solve phase of the solution of a sparse triangular linear system:
2881    ///
2882    /// `A` is an `(mb*blockDim)x(mb*blockDim)` sparse matrix that is defined in BSR storage format by the three arrays `bsrValA`, `bsrRowPtrA`, and `bsrColIndA`); `B` and `X` are the right-hand-side and the solution matrices; $\alpha$ is a scalar, and
2883    ///
2884    /// $\operatorname{op}(A) = \text{CUSPARSE_OPERATION_NON_TRANSPOSE}$
2885    ///
2886    /// and:
2887    /// $$
2888    /// \operatorname{op}(X) =
2889    /// \begin{cases}
2890    /// X & \text{if } transX = \text{CUSPARSE_OPERATION_NON_TRANSPOSE} \\
2891    /// X^T & \text{if } transX = \text{CUSPARSE_OPERATION_TRANSPOSE} \\
2892    /// X^H & \text{not supported}
2893    /// \end{cases}
2894    /// $$
2895    ///
2896    /// Only `op(A)=A` is supported.
2897    ///
2898    /// `op(B)` and `op(X)` must be performed in the same way. In other words, if `op(B)=B`, `op(X)=X`.
2899    ///
2900    /// The block of BSR format is of size `blockDim*blockDim`, stored as column-major or row-major as determined by parameter `dirA`, which is either [`cusparseDirection_t::CUSPARSE_DIRECTION_ROW`] or [`cusparseDirection_t::CUSPARSE_DIRECTION_COLUMN`]. The matrix type must be [`cusparseMatrixType_t::CUSPARSE_MATRIX_TYPE_GENERAL`], and the fill mode and diagonal type are ignored. Function `bsrsm02_solve()` can support an arbitrary `blockDim`.
2901    ///
2902    /// This function may be executed multiple times for a given matrix and a particular operation type.
2903    ///
2904    /// This function requires the buffer size returned by `bsrsm2_bufferSize()`. The address of `pBuffer` must be multiple of 128 bytes. If it is not, [`cusparseStatus_t::CUSPARSE_STATUS_INVALID_VALUE`] is returned.
2905    ///
2906    /// Although `bsrsm2_solve()` can be done without level information, the user still needs to be aware of consistency. If `bsrsm2_analysis()` is called with policy [`cusparseSolvePolicy_t::CUSPARSE_SOLVE_POLICY_USE_LEVEL`], `bsrsm2_solve()` can be run with or without levels. On the other hand, if `bsrsm2_analysis()` is called with [`cusparseSolvePolicy_t::CUSPARSE_SOLVE_POLICY_NO_LEVEL`], `bsrsm2_solve()` can only accept [`cusparseSolvePolicy_t::CUSPARSE_SOLVE_POLICY_NO_LEVEL`]; otherwise, [`cusparseStatus_t::CUSPARSE_STATUS_INVALID_VALUE`] is returned.
2907    ///
2908    /// Function `bsrsm02_solve()` has the same behavior as `bsrsv02_solve()`, reporting the first numerical zero, including a structural zero. The user must call `cusparseXbsrsm2_query_zero_pivot()` to know where the numerical zero is.
2909    ///
2910    /// The motivation of `transpose(X)` is to improve the memory access of matrix `X`. The computational pattern of `transpose(X)` with matrix `X` in column-major order is equivalent to `X` with matrix `X` in row-major order.
2911    ///
2912    /// In-place is supported and requires that `B` and `X` point to the same memory block, and `ldb=ldx`.
2913    ///
2914    /// The function supports the following properties if `pBuffer != NULL`:
2915    ///
2916    /// * The routine requires no extra storage.
2917    /// * The routine supports asynchronous execution.
2918    /// * The routine supports CUDA graph capture.
2919    pub fn cusparseDbsrsm2_solve(
2920        handle: cusparseHandle_t,
2921        dirA: cusparseDirection_t,
2922        transA: cusparseOperation_t,
2923        transXY: cusparseOperation_t,
2924        mb: ::core::ffi::c_int,
2925        n: ::core::ffi::c_int,
2926        nnzb: ::core::ffi::c_int,
2927        alpha: *const f64,
2928        descrA: cusparseMatDescr_t,
2929        bsrSortedVal: *const f64,
2930        bsrSortedRowPtr: *const ::core::ffi::c_int,
2931        bsrSortedColInd: *const ::core::ffi::c_int,
2932        blockSize: ::core::ffi::c_int,
2933        info: bsrsm2Info_t,
2934        B: *const f64,
2935        ldb: ::core::ffi::c_int,
2936        X: *mut f64,
2937        ldx: ::core::ffi::c_int,
2938        policy: cusparseSolvePolicy_t,
2939        pBuffer: *mut ::core::ffi::c_void,
2940    ) -> cusparseStatus_t;
2941}
2942unsafe extern "C" {
2943    /// This function performs the solve phase of the solution of a sparse triangular linear system:
2944    ///
2945    /// `A` is an `(mb*blockDim)x(mb*blockDim)` sparse matrix that is defined in BSR storage format by the three arrays `bsrValA`, `bsrRowPtrA`, and `bsrColIndA`); `B` and `X` are the right-hand-side and the solution matrices; $\alpha$ is a scalar, and
2946    ///
2947    /// $\operatorname{op}(A) = \text{CUSPARSE_OPERATION_NON_TRANSPOSE}$
2948    ///
2949    /// and:
2950    /// $$
2951    /// \operatorname{op}(X) =
2952    /// \begin{cases}
2953    /// X & \text{if } transX = \text{CUSPARSE_OPERATION_NON_TRANSPOSE} \\
2954    /// X^T & \text{if } transX = \text{CUSPARSE_OPERATION_TRANSPOSE} \\
2955    /// X^H & \text{not supported}
2956    /// \end{cases}
2957    /// $$
2958    ///
2959    /// Only `op(A)=A` is supported.
2960    ///
2961    /// `op(B)` and `op(X)` must be performed in the same way. In other words, if `op(B)=B`, `op(X)=X`.
2962    ///
2963    /// The block of BSR format is of size `blockDim*blockDim`, stored as column-major or row-major as determined by parameter `dirA`, which is either [`cusparseDirection_t::CUSPARSE_DIRECTION_ROW`] or [`cusparseDirection_t::CUSPARSE_DIRECTION_COLUMN`]. The matrix type must be [`cusparseMatrixType_t::CUSPARSE_MATRIX_TYPE_GENERAL`], and the fill mode and diagonal type are ignored. Function `bsrsm02_solve()` can support an arbitrary `blockDim`.
2964    ///
2965    /// This function may be executed multiple times for a given matrix and a particular operation type.
2966    ///
2967    /// This function requires the buffer size returned by `bsrsm2_bufferSize()`. The address of `pBuffer` must be multiple of 128 bytes. If it is not, [`cusparseStatus_t::CUSPARSE_STATUS_INVALID_VALUE`] is returned.
2968    ///
2969    /// Although `bsrsm2_solve()` can be done without level information, the user still needs to be aware of consistency. If `bsrsm2_analysis()` is called with policy [`cusparseSolvePolicy_t::CUSPARSE_SOLVE_POLICY_USE_LEVEL`], `bsrsm2_solve()` can be run with or without levels. On the other hand, if `bsrsm2_analysis()` is called with [`cusparseSolvePolicy_t::CUSPARSE_SOLVE_POLICY_NO_LEVEL`], `bsrsm2_solve()` can only accept [`cusparseSolvePolicy_t::CUSPARSE_SOLVE_POLICY_NO_LEVEL`]; otherwise, [`cusparseStatus_t::CUSPARSE_STATUS_INVALID_VALUE`] is returned.
2970    ///
2971    /// Function `bsrsm02_solve()` has the same behavior as `bsrsv02_solve()`, reporting the first numerical zero, including a structural zero. The user must call `cusparseXbsrsm2_query_zero_pivot()` to know where the numerical zero is.
2972    ///
2973    /// The motivation of `transpose(X)` is to improve the memory access of matrix `X`. The computational pattern of `transpose(X)` with matrix `X` in column-major order is equivalent to `X` with matrix `X` in row-major order.
2974    ///
2975    /// In-place is supported and requires that `B` and `X` point to the same memory block, and `ldb=ldx`.
2976    ///
2977    /// The function supports the following properties if `pBuffer != NULL`:
2978    ///
2979    /// * The routine requires no extra storage.
2980    /// * The routine supports asynchronous execution.
2981    /// * The routine supports CUDA graph capture.
2982    pub fn cusparseCbsrsm2_solve(
2983        handle: cusparseHandle_t,
2984        dirA: cusparseDirection_t,
2985        transA: cusparseOperation_t,
2986        transXY: cusparseOperation_t,
2987        mb: ::core::ffi::c_int,
2988        n: ::core::ffi::c_int,
2989        nnzb: ::core::ffi::c_int,
2990        alpha: *const cuComplex,
2991        descrA: cusparseMatDescr_t,
2992        bsrSortedVal: *const cuComplex,
2993        bsrSortedRowPtr: *const ::core::ffi::c_int,
2994        bsrSortedColInd: *const ::core::ffi::c_int,
2995        blockSize: ::core::ffi::c_int,
2996        info: bsrsm2Info_t,
2997        B: *const cuComplex,
2998        ldb: ::core::ffi::c_int,
2999        X: *mut cuComplex,
3000        ldx: ::core::ffi::c_int,
3001        policy: cusparseSolvePolicy_t,
3002        pBuffer: *mut ::core::ffi::c_void,
3003    ) -> cusparseStatus_t;
3004}
3005unsafe extern "C" {
3006    /// This function performs the solve phase of the solution of a sparse triangular linear system:
3007    ///
3008    /// `A` is an `(mb*blockDim)x(mb*blockDim)` sparse matrix that is defined in BSR storage format by the three arrays `bsrValA`, `bsrRowPtrA`, and `bsrColIndA`); `B` and `X` are the right-hand-side and the solution matrices; $\alpha$ is a scalar, and
3009    ///
3010    /// $\operatorname{op}(A) = \text{CUSPARSE_OPERATION_NON_TRANSPOSE}$
3011    ///
3012    /// and:
3013    /// $$
3014    /// \operatorname{op}(X) =
3015    /// \begin{cases}
3016    /// X & \text{if } transX = \text{CUSPARSE_OPERATION_NON_TRANSPOSE} \\
3017    /// X^T & \text{if } transX = \text{CUSPARSE_OPERATION_TRANSPOSE} \\
3018    /// X^H & \text{not supported}
3019    /// \end{cases}
3020    /// $$
3021    ///
3022    /// Only `op(A)=A` is supported.
3023    ///
3024    /// `op(B)` and `op(X)` must be performed in the same way. In other words, if `op(B)=B`, `op(X)=X`.
3025    ///
3026    /// The block of BSR format is of size `blockDim*blockDim`, stored as column-major or row-major as determined by parameter `dirA`, which is either [`cusparseDirection_t::CUSPARSE_DIRECTION_ROW`] or [`cusparseDirection_t::CUSPARSE_DIRECTION_COLUMN`]. The matrix type must be [`cusparseMatrixType_t::CUSPARSE_MATRIX_TYPE_GENERAL`], and the fill mode and diagonal type are ignored. Function `bsrsm02_solve()` can support an arbitrary `blockDim`.
3027    ///
3028    /// This function may be executed multiple times for a given matrix and a particular operation type.
3029    ///
3030    /// This function requires the buffer size returned by `bsrsm2_bufferSize()`. The address of `pBuffer` must be multiple of 128 bytes. If it is not, [`cusparseStatus_t::CUSPARSE_STATUS_INVALID_VALUE`] is returned.
3031    ///
3032    /// Although `bsrsm2_solve()` can be done without level information, the user still needs to be aware of consistency. If `bsrsm2_analysis()` is called with policy [`cusparseSolvePolicy_t::CUSPARSE_SOLVE_POLICY_USE_LEVEL`], `bsrsm2_solve()` can be run with or without levels. On the other hand, if `bsrsm2_analysis()` is called with [`cusparseSolvePolicy_t::CUSPARSE_SOLVE_POLICY_NO_LEVEL`], `bsrsm2_solve()` can only accept [`cusparseSolvePolicy_t::CUSPARSE_SOLVE_POLICY_NO_LEVEL`]; otherwise, [`cusparseStatus_t::CUSPARSE_STATUS_INVALID_VALUE`] is returned.
3033    ///
3034    /// Function `bsrsm02_solve()` has the same behavior as `bsrsv02_solve()`, reporting the first numerical zero, including a structural zero. The user must call `cusparseXbsrsm2_query_zero_pivot()` to know where the numerical zero is.
3035    ///
3036    /// The motivation of `transpose(X)` is to improve the memory access of matrix `X`. The computational pattern of `transpose(X)` with matrix `X` in column-major order is equivalent to `X` with matrix `X` in row-major order.
3037    ///
3038    /// In-place is supported and requires that `B` and `X` point to the same memory block, and `ldb=ldx`.
3039    ///
3040    /// The function supports the following properties if `pBuffer != NULL`:
3041    ///
3042    /// * The routine requires no extra storage.
3043    /// * The routine supports asynchronous execution.
3044    /// * The routine supports CUDA graph capture.
3045    pub fn cusparseZbsrsm2_solve(
3046        handle: cusparseHandle_t,
3047        dirA: cusparseDirection_t,
3048        transA: cusparseOperation_t,
3049        transXY: cusparseOperation_t,
3050        mb: ::core::ffi::c_int,
3051        n: ::core::ffi::c_int,
3052        nnzb: ::core::ffi::c_int,
3053        alpha: *const cuDoubleComplex,
3054        descrA: cusparseMatDescr_t,
3055        bsrSortedVal: *const cuDoubleComplex,
3056        bsrSortedRowPtr: *const ::core::ffi::c_int,
3057        bsrSortedColInd: *const ::core::ffi::c_int,
3058        blockSize: ::core::ffi::c_int,
3059        info: bsrsm2Info_t,
3060        B: *const cuDoubleComplex,
3061        ldb: ::core::ffi::c_int,
3062        X: *mut cuDoubleComplex,
3063        ldx: ::core::ffi::c_int,
3064        policy: cusparseSolvePolicy_t,
3065        pBuffer: *mut ::core::ffi::c_void,
3066    ) -> cusparseStatus_t;
3067}
3068unsafe extern "C" {
3069    /// The user can use a boost value to replace a numerical value in incomplete LU factorization. The `tol` is used to determine a numerical zero, and the `boost_val` is used to replace a numerical zero. The behavior is
3070    ///
3071    /// if `tol >= fabs(A(j,j))`, then `A(j,j)=boost_val`.
3072    ///
3073    /// To enable a boost value, the user has to set parameter `enable_boost` to 1 before calling `csrilu02()`. To disable a boost value, the user can call `csrilu02_numericBoost()` again with parameter `enable_boost=0`.
3074    ///
3075    /// If `enable_boost=0`, `tol` and `boost_val` are ignored.
3076    ///
3077    /// Both `tol` and `boost_val` can be in the host memory or device memory. The user can set the proper mode with [`cusparseSetPointerMode`].
3078    ///
3079    /// * The routine requires no extra storage.
3080    /// * The routine supports asynchronous execution.
3081    /// * The routine supports CUDA graph capture.
3082    pub fn cusparseScsrilu02_numericBoost(
3083        handle: cusparseHandle_t,
3084        info: csrilu02Info_t,
3085        enable_boost: ::core::ffi::c_int,
3086        tol: *mut f64,
3087        boost_val: *mut f32,
3088    ) -> cusparseStatus_t;
3089}
3090unsafe extern "C" {
3091    /// The user can use a boost value to replace a numerical value in incomplete LU factorization. The `tol` is used to determine a numerical zero, and the `boost_val` is used to replace a numerical zero. The behavior is
3092    ///
3093    /// if `tol >= fabs(A(j,j))`, then `A(j,j)=boost_val`.
3094    ///
3095    /// To enable a boost value, the user has to set parameter `enable_boost` to 1 before calling `csrilu02()`. To disable a boost value, the user can call `csrilu02_numericBoost()` again with parameter `enable_boost=0`.
3096    ///
3097    /// If `enable_boost=0`, `tol` and `boost_val` are ignored.
3098    ///
3099    /// Both `tol` and `boost_val` can be in the host memory or device memory. The user can set the proper mode with [`cusparseSetPointerMode`].
3100    ///
3101    /// * The routine requires no extra storage.
3102    /// * The routine supports asynchronous execution.
3103    /// * The routine supports CUDA graph capture.
3104    pub fn cusparseDcsrilu02_numericBoost(
3105        handle: cusparseHandle_t,
3106        info: csrilu02Info_t,
3107        enable_boost: ::core::ffi::c_int,
3108        tol: *mut f64,
3109        boost_val: *mut f64,
3110    ) -> cusparseStatus_t;
3111}
3112unsafe extern "C" {
3113    /// The user can use a boost value to replace a numerical value in incomplete LU factorization. The `tol` is used to determine a numerical zero, and the `boost_val` is used to replace a numerical zero. The behavior is
3114    ///
3115    /// if `tol >= fabs(A(j,j))`, then `A(j,j)=boost_val`.
3116    ///
3117    /// To enable a boost value, the user has to set parameter `enable_boost` to 1 before calling `csrilu02()`. To disable a boost value, the user can call `csrilu02_numericBoost()` again with parameter `enable_boost=0`.
3118    ///
3119    /// If `enable_boost=0`, `tol` and `boost_val` are ignored.
3120    ///
3121    /// Both `tol` and `boost_val` can be in the host memory or device memory. The user can set the proper mode with [`cusparseSetPointerMode`].
3122    ///
3123    /// * The routine requires no extra storage.
3124    /// * The routine supports asynchronous execution.
3125    /// * The routine supports CUDA graph capture.
3126    pub fn cusparseCcsrilu02_numericBoost(
3127        handle: cusparseHandle_t,
3128        info: csrilu02Info_t,
3129        enable_boost: ::core::ffi::c_int,
3130        tol: *mut f64,
3131        boost_val: *mut cuComplex,
3132    ) -> cusparseStatus_t;
3133}
3134unsafe extern "C" {
3135    /// The user can use a boost value to replace a numerical value in incomplete LU factorization. The `tol` is used to determine a numerical zero, and the `boost_val` is used to replace a numerical zero. The behavior is
3136    ///
3137    /// if `tol >= fabs(A(j,j))`, then `A(j,j)=boost_val`.
3138    ///
3139    /// To enable a boost value, the user has to set parameter `enable_boost` to 1 before calling `csrilu02()`. To disable a boost value, the user can call `csrilu02_numericBoost()` again with parameter `enable_boost=0`.
3140    ///
3141    /// If `enable_boost=0`, `tol` and `boost_val` are ignored.
3142    ///
3143    /// Both `tol` and `boost_val` can be in the host memory or device memory. The user can set the proper mode with [`cusparseSetPointerMode`].
3144    ///
3145    /// * The routine requires no extra storage.
3146    /// * The routine supports asynchronous execution.
3147    /// * The routine supports CUDA graph capture.
3148    pub fn cusparseZcsrilu02_numericBoost(
3149        handle: cusparseHandle_t,
3150        info: csrilu02Info_t,
3151        enable_boost: ::core::ffi::c_int,
3152        tol: *mut f64,
3153        boost_val: *mut cuDoubleComplex,
3154    ) -> cusparseStatus_t;
3155}
3156unsafe extern "C" {
3157    /// If the returned error code is [`cusparseStatus_t::CUSPARSE_STATUS_ZERO_PIVOT`], `position=j` means `A(j,j)` has either a structural zero or a numerical zero; otherwise, `position=-1`.
3158    ///
3159    /// The `position` can be 0-based or 1-based, the same as the matrix.
3160    ///
3161    /// Function [`cusparseXcsrilu02_zeroPivot`] is a blocking call. It calls `cudaDeviceSynchronize(`) to make sure all previous kernels are done.
3162    ///
3163    /// The `position` can be in the host memory or device memory. The user can set proper mode with [`cusparseSetPointerMode`].
3164    ///
3165    /// * The routine requires no extra storage
3166    /// * The routine supports asynchronous execution if the Stream Ordered Memory Allocator is available
3167    /// * The routine supports CUDA graph capture if the Stream Ordered Memory Allocator is available.
3168    ///
3169    /// # Parameters
3170    ///
3171    /// - `position`: If no structural or numerical zero, `position` is -1; otherwise if `A(j,j)` is missing or `U(j,j)` is zero, `position=j`.
3172    #[deprecated]
3173    pub fn cusparseXcsrilu02_zeroPivot(
3174        handle: cusparseHandle_t,
3175        info: csrilu02Info_t,
3176        position: *mut ::core::ffi::c_int,
3177    ) -> cusparseStatus_t;
3178}
3179unsafe extern "C" {
3180    /// This function returns size of the buffer used in computing the incomplete-LU factorization with $0$ fill-in and no pivoting:
3181    ///
3182    /// `A` is an $m \times m$ sparse matrix that is defined in CSR storage format by the three arrays `csrValA`, `csrRowPtrA`, and `csrColIndA`.
3183    ///
3184    /// The buffer size depends on the dimension `m` and `nnz`, the number of nonzeros of the matrix. If the user changes the matrix, it is necessary to call `csrilu02_bufferSize()` again to have the correct buffer size; otherwise, a segmentation fault may occur.
3185    ///
3186    /// * The routine requires no extra storage.
3187    /// * The routine supports asynchronous execution.
3188    /// * The routine supports CUDA graph capture.
3189    pub fn cusparseScsrilu02_bufferSize(
3190        handle: cusparseHandle_t,
3191        m: ::core::ffi::c_int,
3192        nnz: ::core::ffi::c_int,
3193        descrA: cusparseMatDescr_t,
3194        csrSortedValA: *mut f32,
3195        csrSortedRowPtrA: *const ::core::ffi::c_int,
3196        csrSortedColIndA: *const ::core::ffi::c_int,
3197        info: csrilu02Info_t,
3198        pBufferSizeInBytes: *mut ::core::ffi::c_int,
3199    ) -> cusparseStatus_t;
3200}
3201unsafe extern "C" {
3202    /// This function returns size of the buffer used in computing the incomplete-LU factorization with $0$ fill-in and no pivoting:
3203    ///
3204    /// `A` is an $m \times m$ sparse matrix that is defined in CSR storage format by the three arrays `csrValA`, `csrRowPtrA`, and `csrColIndA`.
3205    ///
3206    /// The buffer size depends on the dimension `m` and `nnz`, the number of nonzeros of the matrix. If the user changes the matrix, it is necessary to call `csrilu02_bufferSize()` again to have the correct buffer size; otherwise, a segmentation fault may occur.
3207    ///
3208    /// * The routine requires no extra storage.
3209    /// * The routine supports asynchronous execution.
3210    /// * The routine supports CUDA graph capture.
3211    pub fn cusparseDcsrilu02_bufferSize(
3212        handle: cusparseHandle_t,
3213        m: ::core::ffi::c_int,
3214        nnz: ::core::ffi::c_int,
3215        descrA: cusparseMatDescr_t,
3216        csrSortedValA: *mut f64,
3217        csrSortedRowPtrA: *const ::core::ffi::c_int,
3218        csrSortedColIndA: *const ::core::ffi::c_int,
3219        info: csrilu02Info_t,
3220        pBufferSizeInBytes: *mut ::core::ffi::c_int,
3221    ) -> cusparseStatus_t;
3222}
3223unsafe extern "C" {
3224    /// This function returns size of the buffer used in computing the incomplete-LU factorization with $0$ fill-in and no pivoting:
3225    ///
3226    /// `A` is an $m \times m$ sparse matrix that is defined in CSR storage format by the three arrays `csrValA`, `csrRowPtrA`, and `csrColIndA`.
3227    ///
3228    /// The buffer size depends on the dimension `m` and `nnz`, the number of nonzeros of the matrix. If the user changes the matrix, it is necessary to call `csrilu02_bufferSize()` again to have the correct buffer size; otherwise, a segmentation fault may occur.
3229    ///
3230    /// * The routine requires no extra storage.
3231    /// * The routine supports asynchronous execution.
3232    /// * The routine supports CUDA graph capture.
3233    pub fn cusparseCcsrilu02_bufferSize(
3234        handle: cusparseHandle_t,
3235        m: ::core::ffi::c_int,
3236        nnz: ::core::ffi::c_int,
3237        descrA: cusparseMatDescr_t,
3238        csrSortedValA: *mut cuComplex,
3239        csrSortedRowPtrA: *const ::core::ffi::c_int,
3240        csrSortedColIndA: *const ::core::ffi::c_int,
3241        info: csrilu02Info_t,
3242        pBufferSizeInBytes: *mut ::core::ffi::c_int,
3243    ) -> cusparseStatus_t;
3244}
3245unsafe extern "C" {
3246    /// This function returns size of the buffer used in computing the incomplete-LU factorization with $0$ fill-in and no pivoting:
3247    ///
3248    /// `A` is an $m \times m$ sparse matrix that is defined in CSR storage format by the three arrays `csrValA`, `csrRowPtrA`, and `csrColIndA`.
3249    ///
3250    /// The buffer size depends on the dimension `m` and `nnz`, the number of nonzeros of the matrix. If the user changes the matrix, it is necessary to call `csrilu02_bufferSize()` again to have the correct buffer size; otherwise, a segmentation fault may occur.
3251    ///
3252    /// * The routine requires no extra storage.
3253    /// * The routine supports asynchronous execution.
3254    /// * The routine supports CUDA graph capture.
3255    pub fn cusparseZcsrilu02_bufferSize(
3256        handle: cusparseHandle_t,
3257        m: ::core::ffi::c_int,
3258        nnz: ::core::ffi::c_int,
3259        descrA: cusparseMatDescr_t,
3260        csrSortedValA: *mut cuDoubleComplex,
3261        csrSortedRowPtrA: *const ::core::ffi::c_int,
3262        csrSortedColIndA: *const ::core::ffi::c_int,
3263        info: csrilu02Info_t,
3264        pBufferSizeInBytes: *mut ::core::ffi::c_int,
3265    ) -> cusparseStatus_t;
3266}
3267unsafe extern "C" {
3268    pub fn cusparseScsrilu02_bufferSizeExt(
3269        handle: cusparseHandle_t,
3270        m: ::core::ffi::c_int,
3271        nnz: ::core::ffi::c_int,
3272        descrA: cusparseMatDescr_t,
3273        csrSortedVal: *mut f32,
3274        csrSortedRowPtr: *const ::core::ffi::c_int,
3275        csrSortedColInd: *const ::core::ffi::c_int,
3276        info: csrilu02Info_t,
3277        pBufferSize: *mut size_t,
3278    ) -> cusparseStatus_t;
3279}
3280unsafe extern "C" {
3281    pub fn cusparseDcsrilu02_bufferSizeExt(
3282        handle: cusparseHandle_t,
3283        m: ::core::ffi::c_int,
3284        nnz: ::core::ffi::c_int,
3285        descrA: cusparseMatDescr_t,
3286        csrSortedVal: *mut f64,
3287        csrSortedRowPtr: *const ::core::ffi::c_int,
3288        csrSortedColInd: *const ::core::ffi::c_int,
3289        info: csrilu02Info_t,
3290        pBufferSize: *mut size_t,
3291    ) -> cusparseStatus_t;
3292}
3293unsafe extern "C" {
3294    pub fn cusparseCcsrilu02_bufferSizeExt(
3295        handle: cusparseHandle_t,
3296        m: ::core::ffi::c_int,
3297        nnz: ::core::ffi::c_int,
3298        descrA: cusparseMatDescr_t,
3299        csrSortedVal: *mut cuComplex,
3300        csrSortedRowPtr: *const ::core::ffi::c_int,
3301        csrSortedColInd: *const ::core::ffi::c_int,
3302        info: csrilu02Info_t,
3303        pBufferSize: *mut size_t,
3304    ) -> cusparseStatus_t;
3305}
3306unsafe extern "C" {
3307    pub fn cusparseZcsrilu02_bufferSizeExt(
3308        handle: cusparseHandle_t,
3309        m: ::core::ffi::c_int,
3310        nnz: ::core::ffi::c_int,
3311        descrA: cusparseMatDescr_t,
3312        csrSortedVal: *mut cuDoubleComplex,
3313        csrSortedRowPtr: *const ::core::ffi::c_int,
3314        csrSortedColInd: *const ::core::ffi::c_int,
3315        info: csrilu02Info_t,
3316        pBufferSize: *mut size_t,
3317    ) -> cusparseStatus_t;
3318}
3319unsafe extern "C" {
3320    /// This function performs the analysis phase of the incomplete-LU factorization with $0$ fill-in and no pivoting:
3321    ///
3322    /// `A` is an $m \times m$ sparse matrix that is defined in CSR storage format by the three arrays `csrValA`, `csrRowPtrA`, and `csrColIndA`.
3323    ///
3324    /// This function requires the buffer size returned by `csrilu02_bufferSize()`. The address of `pBuffer` must be a multiple of 128 bytes. If not, [`cusparseStatus_t::CUSPARSE_STATUS_INVALID_VALUE`] is returned.
3325    ///
3326    /// Function `csrilu02_analysis()` reports a structural zero and computes level information stored in the opaque structure `info`. The level information can extract more parallelism during incomplete LU factorization; however `csrilu02()` can be done without level information. To disable level information, the user must specify the policy of `csrilu02()` as [`cusparseSolvePolicy_t::CUSPARSE_SOLVE_POLICY_NO_LEVEL`].
3327    ///
3328    /// It is the user’s choice whether to call `csrilu02()` if `csrilu02_analysis()` reports a structural zero. In this case, the user can still call `csrilu02()`, which will return a numerical zero at the same position as the structural zero. However, the result is meaningless.
3329    ///
3330    /// * This function requires temporary extra storage that is allocated internally.
3331    /// * The routine supports asynchronous execution if the Stream Ordered Memory Allocator is available.
3332    /// * The routine supports CUDA graph capture if the Stream Ordered Memory Allocator is available.
3333    pub fn cusparseScsrilu02_analysis(
3334        handle: cusparseHandle_t,
3335        m: ::core::ffi::c_int,
3336        nnz: ::core::ffi::c_int,
3337        descrA: cusparseMatDescr_t,
3338        csrSortedValA: *const f32,
3339        csrSortedRowPtrA: *const ::core::ffi::c_int,
3340        csrSortedColIndA: *const ::core::ffi::c_int,
3341        info: csrilu02Info_t,
3342        policy: cusparseSolvePolicy_t,
3343        pBuffer: *mut ::core::ffi::c_void,
3344    ) -> cusparseStatus_t;
3345}
3346unsafe extern "C" {
3347    /// This function performs the analysis phase of the incomplete-LU factorization with $0$ fill-in and no pivoting:
3348    ///
3349    /// `A` is an $m \times m$ sparse matrix that is defined in CSR storage format by the three arrays `csrValA`, `csrRowPtrA`, and `csrColIndA`.
3350    ///
3351    /// This function requires the buffer size returned by `csrilu02_bufferSize()`. The address of `pBuffer` must be a multiple of 128 bytes. If not, [`cusparseStatus_t::CUSPARSE_STATUS_INVALID_VALUE`] is returned.
3352    ///
3353    /// Function `csrilu02_analysis()` reports a structural zero and computes level information stored in the opaque structure `info`. The level information can extract more parallelism during incomplete LU factorization; however `csrilu02()` can be done without level information. To disable level information, the user must specify the policy of `csrilu02()` as [`cusparseSolvePolicy_t::CUSPARSE_SOLVE_POLICY_NO_LEVEL`].
3354    ///
3355    /// It is the user’s choice whether to call `csrilu02()` if `csrilu02_analysis()` reports a structural zero. In this case, the user can still call `csrilu02()`, which will return a numerical zero at the same position as the structural zero. However, the result is meaningless.
3356    ///
3357    /// * This function requires temporary extra storage that is allocated internally.
3358    /// * The routine supports asynchronous execution if the Stream Ordered Memory Allocator is available.
3359    /// * The routine supports CUDA graph capture if the Stream Ordered Memory Allocator is available.
3360    pub fn cusparseDcsrilu02_analysis(
3361        handle: cusparseHandle_t,
3362        m: ::core::ffi::c_int,
3363        nnz: ::core::ffi::c_int,
3364        descrA: cusparseMatDescr_t,
3365        csrSortedValA: *const f64,
3366        csrSortedRowPtrA: *const ::core::ffi::c_int,
3367        csrSortedColIndA: *const ::core::ffi::c_int,
3368        info: csrilu02Info_t,
3369        policy: cusparseSolvePolicy_t,
3370        pBuffer: *mut ::core::ffi::c_void,
3371    ) -> cusparseStatus_t;
3372}
3373unsafe extern "C" {
3374    /// This function performs the analysis phase of the incomplete-LU factorization with $0$ fill-in and no pivoting:
3375    ///
3376    /// `A` is an $m \times m$ sparse matrix that is defined in CSR storage format by the three arrays `csrValA`, `csrRowPtrA`, and `csrColIndA`.
3377    ///
3378    /// This function requires the buffer size returned by `csrilu02_bufferSize()`. The address of `pBuffer` must be a multiple of 128 bytes. If not, [`cusparseStatus_t::CUSPARSE_STATUS_INVALID_VALUE`] is returned.
3379    ///
3380    /// Function `csrilu02_analysis()` reports a structural zero and computes level information stored in the opaque structure `info`. The level information can extract more parallelism during incomplete LU factorization; however `csrilu02()` can be done without level information. To disable level information, the user must specify the policy of `csrilu02()` as [`cusparseSolvePolicy_t::CUSPARSE_SOLVE_POLICY_NO_LEVEL`].
3381    ///
3382    /// It is the user’s choice whether to call `csrilu02()` if `csrilu02_analysis()` reports a structural zero. In this case, the user can still call `csrilu02()`, which will return a numerical zero at the same position as the structural zero. However, the result is meaningless.
3383    ///
3384    /// * This function requires temporary extra storage that is allocated internally.
3385    /// * The routine supports asynchronous execution if the Stream Ordered Memory Allocator is available.
3386    /// * The routine supports CUDA graph capture if the Stream Ordered Memory Allocator is available.
3387    pub fn cusparseCcsrilu02_analysis(
3388        handle: cusparseHandle_t,
3389        m: ::core::ffi::c_int,
3390        nnz: ::core::ffi::c_int,
3391        descrA: cusparseMatDescr_t,
3392        csrSortedValA: *const cuComplex,
3393        csrSortedRowPtrA: *const ::core::ffi::c_int,
3394        csrSortedColIndA: *const ::core::ffi::c_int,
3395        info: csrilu02Info_t,
3396        policy: cusparseSolvePolicy_t,
3397        pBuffer: *mut ::core::ffi::c_void,
3398    ) -> cusparseStatus_t;
3399}
3400unsafe extern "C" {
3401    /// This function performs the analysis phase of the incomplete-LU factorization with $0$ fill-in and no pivoting:
3402    ///
3403    /// `A` is an $m \times m$ sparse matrix that is defined in CSR storage format by the three arrays `csrValA`, `csrRowPtrA`, and `csrColIndA`.
3404    ///
3405    /// This function requires the buffer size returned by `csrilu02_bufferSize()`. The address of `pBuffer` must be a multiple of 128 bytes. If not, [`cusparseStatus_t::CUSPARSE_STATUS_INVALID_VALUE`] is returned.
3406    ///
3407    /// Function `csrilu02_analysis()` reports a structural zero and computes level information stored in the opaque structure `info`. The level information can extract more parallelism during incomplete LU factorization; however `csrilu02()` can be done without level information. To disable level information, the user must specify the policy of `csrilu02()` as [`cusparseSolvePolicy_t::CUSPARSE_SOLVE_POLICY_NO_LEVEL`].
3408    ///
3409    /// It is the user’s choice whether to call `csrilu02()` if `csrilu02_analysis()` reports a structural zero. In this case, the user can still call `csrilu02()`, which will return a numerical zero at the same position as the structural zero. However, the result is meaningless.
3410    ///
3411    /// * This function requires temporary extra storage that is allocated internally.
3412    /// * The routine supports asynchronous execution if the Stream Ordered Memory Allocator is available.
3413    /// * The routine supports CUDA graph capture if the Stream Ordered Memory Allocator is available.
3414    pub fn cusparseZcsrilu02_analysis(
3415        handle: cusparseHandle_t,
3416        m: ::core::ffi::c_int,
3417        nnz: ::core::ffi::c_int,
3418        descrA: cusparseMatDescr_t,
3419        csrSortedValA: *const cuDoubleComplex,
3420        csrSortedRowPtrA: *const ::core::ffi::c_int,
3421        csrSortedColIndA: *const ::core::ffi::c_int,
3422        info: csrilu02Info_t,
3423        policy: cusparseSolvePolicy_t,
3424        pBuffer: *mut ::core::ffi::c_void,
3425    ) -> cusparseStatus_t;
3426}
3427unsafe extern "C" {
3428    /// This function performs the solve phase of the incomplete-LU factorization with $0$ fill-in and no pivoting:
3429    ///
3430    /// `A` is an $m \times m$ sparse matrix that is defined in CSR storage format by the three arrays `csrValA_valM`, `csrRowPtrA`, and `csrColIndA`.
3431    ///
3432    /// This function requires a buffer size returned by `csrilu02_bufferSize()`. The address of `pBuffer` must be a multiple of 128 bytes. If not, [`cusparseStatus_t::CUSPARSE_STATUS_INVALID_VALUE`] is returned.
3433    ///
3434    /// The matrix type must be [`cusparseMatrixType_t::CUSPARSE_MATRIX_TYPE_GENERAL`]. The fill mode and diagonal type are ignored.
3435    ///
3436    /// Although `csrilu02()` can be done without level information, the user still needs to be aware of consistency. If `csrilu02_analysis()` is called with policy [`cusparseSolvePolicy_t::CUSPARSE_SOLVE_POLICY_USE_LEVEL`], `csrilu02()` can be run with or without levels. On the other hand, if `csrilu02_analysis()` is called with [`cusparseSolvePolicy_t::CUSPARSE_SOLVE_POLICY_NO_LEVEL`], `csrilu02()` can only accept [`cusparseSolvePolicy_t::CUSPARSE_SOLVE_POLICY_NO_LEVEL`]; otherwise, [`cusparseStatus_t::CUSPARSE_STATUS_INVALID_VALUE`] is returned.
3437    ///
3438    /// Function `csrilu02()` reports the first numerical zero, including a structural zero. The user must call [`cusparseXcsrilu02_zeroPivot`] to know where the numerical zero is.
3439    ///
3440    /// For example, suppose `A` is a real $m \times m$ matrix, the following code solves precondition system `M*y = x` where `M` is the product of LU factors `L` and `U`.
3441    ///
3442    /// The function supports the following properties if `pBuffer != NULL`:
3443    ///
3444    /// * The routine requires no extra storage
3445    /// * The routine supports asynchronous execution
3446    /// * The routine supports CUDA graph capture.
3447    pub fn cusparseScsrilu02(
3448        handle: cusparseHandle_t,
3449        m: ::core::ffi::c_int,
3450        nnz: ::core::ffi::c_int,
3451        descrA: cusparseMatDescr_t,
3452        csrSortedValA_valM: *mut f32,
3453        csrSortedRowPtrA: *const ::core::ffi::c_int,
3454        csrSortedColIndA: *const ::core::ffi::c_int,
3455        info: csrilu02Info_t,
3456        policy: cusparseSolvePolicy_t,
3457        pBuffer: *mut ::core::ffi::c_void,
3458    ) -> cusparseStatus_t;
3459}
3460unsafe extern "C" {
3461    /// This function performs the solve phase of the incomplete-LU factorization with $0$ fill-in and no pivoting:
3462    ///
3463    /// `A` is an $m \times m$ sparse matrix that is defined in CSR storage format by the three arrays `csrValA_valM`, `csrRowPtrA`, and `csrColIndA`.
3464    ///
3465    /// This function requires a buffer size returned by `csrilu02_bufferSize()`. The address of `pBuffer` must be a multiple of 128 bytes. If not, [`cusparseStatus_t::CUSPARSE_STATUS_INVALID_VALUE`] is returned.
3466    ///
3467    /// The matrix type must be [`cusparseMatrixType_t::CUSPARSE_MATRIX_TYPE_GENERAL`]. The fill mode and diagonal type are ignored.
3468    ///
3469    /// Although `csrilu02()` can be done without level information, the user still needs to be aware of consistency. If `csrilu02_analysis()` is called with policy [`cusparseSolvePolicy_t::CUSPARSE_SOLVE_POLICY_USE_LEVEL`], `csrilu02()` can be run with or without levels. On the other hand, if `csrilu02_analysis()` is called with [`cusparseSolvePolicy_t::CUSPARSE_SOLVE_POLICY_NO_LEVEL`], `csrilu02()` can only accept [`cusparseSolvePolicy_t::CUSPARSE_SOLVE_POLICY_NO_LEVEL`]; otherwise, [`cusparseStatus_t::CUSPARSE_STATUS_INVALID_VALUE`] is returned.
3470    ///
3471    /// Function `csrilu02()` reports the first numerical zero, including a structural zero. The user must call [`cusparseXcsrilu02_zeroPivot`] to know where the numerical zero is.
3472    ///
3473    /// For example, suppose `A` is a real $m \times m$ matrix, the following code solves precondition system `M*y = x` where `M` is the product of LU factors `L` and `U`.
3474    ///
3475    /// The function supports the following properties if `pBuffer != NULL`:
3476    ///
3477    /// * The routine requires no extra storage
3478    /// * The routine supports asynchronous execution
3479    /// * The routine supports CUDA graph capture.
3480    pub fn cusparseDcsrilu02(
3481        handle: cusparseHandle_t,
3482        m: ::core::ffi::c_int,
3483        nnz: ::core::ffi::c_int,
3484        descrA: cusparseMatDescr_t,
3485        csrSortedValA_valM: *mut f64,
3486        csrSortedRowPtrA: *const ::core::ffi::c_int,
3487        csrSortedColIndA: *const ::core::ffi::c_int,
3488        info: csrilu02Info_t,
3489        policy: cusparseSolvePolicy_t,
3490        pBuffer: *mut ::core::ffi::c_void,
3491    ) -> cusparseStatus_t;
3492}
3493unsafe extern "C" {
3494    /// This function performs the solve phase of the incomplete-LU factorization with $0$ fill-in and no pivoting:
3495    ///
3496    /// `A` is an $m \times m$ sparse matrix that is defined in CSR storage format by the three arrays `csrValA_valM`, `csrRowPtrA`, and `csrColIndA`.
3497    ///
3498    /// This function requires a buffer size returned by `csrilu02_bufferSize()`. The address of `pBuffer` must be a multiple of 128 bytes. If not, [`cusparseStatus_t::CUSPARSE_STATUS_INVALID_VALUE`] is returned.
3499    ///
3500    /// The matrix type must be [`cusparseMatrixType_t::CUSPARSE_MATRIX_TYPE_GENERAL`]. The fill mode and diagonal type are ignored.
3501    ///
3502    /// Although `csrilu02()` can be done without level information, the user still needs to be aware of consistency. If `csrilu02_analysis()` is called with policy [`cusparseSolvePolicy_t::CUSPARSE_SOLVE_POLICY_USE_LEVEL`], `csrilu02()` can be run with or without levels. On the other hand, if `csrilu02_analysis()` is called with [`cusparseSolvePolicy_t::CUSPARSE_SOLVE_POLICY_NO_LEVEL`], `csrilu02()` can only accept [`cusparseSolvePolicy_t::CUSPARSE_SOLVE_POLICY_NO_LEVEL`]; otherwise, [`cusparseStatus_t::CUSPARSE_STATUS_INVALID_VALUE`] is returned.
3503    ///
3504    /// Function `csrilu02()` reports the first numerical zero, including a structural zero. The user must call [`cusparseXcsrilu02_zeroPivot`] to know where the numerical zero is.
3505    ///
3506    /// For example, suppose `A` is a real $m \times m$ matrix, the following code solves precondition system `M*y = x` where `M` is the product of LU factors `L` and `U`.
3507    ///
3508    /// The function supports the following properties if `pBuffer != NULL`:
3509    ///
3510    /// * The routine requires no extra storage
3511    /// * The routine supports asynchronous execution
3512    /// * The routine supports CUDA graph capture.
3513    pub fn cusparseCcsrilu02(
3514        handle: cusparseHandle_t,
3515        m: ::core::ffi::c_int,
3516        nnz: ::core::ffi::c_int,
3517        descrA: cusparseMatDescr_t,
3518        csrSortedValA_valM: *mut cuComplex,
3519        csrSortedRowPtrA: *const ::core::ffi::c_int,
3520        csrSortedColIndA: *const ::core::ffi::c_int,
3521        info: csrilu02Info_t,
3522        policy: cusparseSolvePolicy_t,
3523        pBuffer: *mut ::core::ffi::c_void,
3524    ) -> cusparseStatus_t;
3525}
3526unsafe extern "C" {
3527    /// This function performs the solve phase of the incomplete-LU factorization with $0$ fill-in and no pivoting:
3528    ///
3529    /// `A` is an $m \times m$ sparse matrix that is defined in CSR storage format by the three arrays `csrValA_valM`, `csrRowPtrA`, and `csrColIndA`.
3530    ///
3531    /// This function requires a buffer size returned by `csrilu02_bufferSize()`. The address of `pBuffer` must be a multiple of 128 bytes. If not, [`cusparseStatus_t::CUSPARSE_STATUS_INVALID_VALUE`] is returned.
3532    ///
3533    /// The matrix type must be [`cusparseMatrixType_t::CUSPARSE_MATRIX_TYPE_GENERAL`]. The fill mode and diagonal type are ignored.
3534    ///
3535    /// Although `csrilu02()` can be done without level information, the user still needs to be aware of consistency. If `csrilu02_analysis()` is called with policy [`cusparseSolvePolicy_t::CUSPARSE_SOLVE_POLICY_USE_LEVEL`], `csrilu02()` can be run with or without levels. On the other hand, if `csrilu02_analysis()` is called with [`cusparseSolvePolicy_t::CUSPARSE_SOLVE_POLICY_NO_LEVEL`], `csrilu02()` can only accept [`cusparseSolvePolicy_t::CUSPARSE_SOLVE_POLICY_NO_LEVEL`]; otherwise, [`cusparseStatus_t::CUSPARSE_STATUS_INVALID_VALUE`] is returned.
3536    ///
3537    /// Function `csrilu02()` reports the first numerical zero, including a structural zero. The user must call [`cusparseXcsrilu02_zeroPivot`] to know where the numerical zero is.
3538    ///
3539    /// For example, suppose `A` is a real $m \times m$ matrix, the following code solves precondition system `M*y = x` where `M` is the product of LU factors `L` and `U`.
3540    ///
3541    /// The function supports the following properties if `pBuffer != NULL`:
3542    ///
3543    /// * The routine requires no extra storage
3544    /// * The routine supports asynchronous execution
3545    /// * The routine supports CUDA graph capture.
3546    pub fn cusparseZcsrilu02(
3547        handle: cusparseHandle_t,
3548        m: ::core::ffi::c_int,
3549        nnz: ::core::ffi::c_int,
3550        descrA: cusparseMatDescr_t,
3551        csrSortedValA_valM: *mut cuDoubleComplex,
3552        csrSortedRowPtrA: *const ::core::ffi::c_int,
3553        csrSortedColIndA: *const ::core::ffi::c_int,
3554        info: csrilu02Info_t,
3555        policy: cusparseSolvePolicy_t,
3556        pBuffer: *mut ::core::ffi::c_void,
3557    ) -> cusparseStatus_t;
3558}
3559unsafe extern "C" {
3560    /// The user can use a boost value to replace a numerical value in incomplete LU factorization. Parameter `tol` is used to determine a numerical zero, and `boost_val` is used to replace a numerical zero. The behavior is as follows:
3561    ///
3562    /// if `tol >= fabs(A(j,j))`, then reset each diagonal element of block `A(j,j)` by `boost_val`.
3563    ///
3564    /// To enable a boost value, the user sets parameter `enable_boost` to 1 before calling `bsrilu02()`. To disable the boost value, the user can call `bsrilu02_numericBoost()` with parameter `enable_boost=0`.
3565    ///
3566    /// If `enable_boost=0`, `tol` and `boost_val` are ignored.
3567    ///
3568    /// Both `tol` and `boost_val` can be in host memory or device memory. The user can set the proper mode with [`cusparseSetPointerMode`].
3569    ///
3570    /// * The routine requires no extra storage.
3571    /// * The routine supports asynchronous execution.
3572    /// * The routine supports CUDA graph capture.
3573    pub fn cusparseSbsrilu02_numericBoost(
3574        handle: cusparseHandle_t,
3575        info: bsrilu02Info_t,
3576        enable_boost: ::core::ffi::c_int,
3577        tol: *mut f64,
3578        boost_val: *mut f32,
3579    ) -> cusparseStatus_t;
3580}
3581unsafe extern "C" {
3582    /// The user can use a boost value to replace a numerical value in incomplete LU factorization. Parameter `tol` is used to determine a numerical zero, and `boost_val` is used to replace a numerical zero. The behavior is as follows:
3583    ///
3584    /// if `tol >= fabs(A(j,j))`, then reset each diagonal element of block `A(j,j)` by `boost_val`.
3585    ///
3586    /// To enable a boost value, the user sets parameter `enable_boost` to 1 before calling `bsrilu02()`. To disable the boost value, the user can call `bsrilu02_numericBoost()` with parameter `enable_boost=0`.
3587    ///
3588    /// If `enable_boost=0`, `tol` and `boost_val` are ignored.
3589    ///
3590    /// Both `tol` and `boost_val` can be in host memory or device memory. The user can set the proper mode with [`cusparseSetPointerMode`].
3591    ///
3592    /// * The routine requires no extra storage.
3593    /// * The routine supports asynchronous execution.
3594    /// * The routine supports CUDA graph capture.
3595    pub fn cusparseDbsrilu02_numericBoost(
3596        handle: cusparseHandle_t,
3597        info: bsrilu02Info_t,
3598        enable_boost: ::core::ffi::c_int,
3599        tol: *mut f64,
3600        boost_val: *mut f64,
3601    ) -> cusparseStatus_t;
3602}
3603unsafe extern "C" {
3604    /// The user can use a boost value to replace a numerical value in incomplete LU factorization. Parameter `tol` is used to determine a numerical zero, and `boost_val` is used to replace a numerical zero. The behavior is as follows:
3605    ///
3606    /// if `tol >= fabs(A(j,j))`, then reset each diagonal element of block `A(j,j)` by `boost_val`.
3607    ///
3608    /// To enable a boost value, the user sets parameter `enable_boost` to 1 before calling `bsrilu02()`. To disable the boost value, the user can call `bsrilu02_numericBoost()` with parameter `enable_boost=0`.
3609    ///
3610    /// If `enable_boost=0`, `tol` and `boost_val` are ignored.
3611    ///
3612    /// Both `tol` and `boost_val` can be in host memory or device memory. The user can set the proper mode with [`cusparseSetPointerMode`].
3613    ///
3614    /// * The routine requires no extra storage.
3615    /// * The routine supports asynchronous execution.
3616    /// * The routine supports CUDA graph capture.
3617    pub fn cusparseCbsrilu02_numericBoost(
3618        handle: cusparseHandle_t,
3619        info: bsrilu02Info_t,
3620        enable_boost: ::core::ffi::c_int,
3621        tol: *mut f64,
3622        boost_val: *mut cuComplex,
3623    ) -> cusparseStatus_t;
3624}
3625unsafe extern "C" {
3626    /// The user can use a boost value to replace a numerical value in incomplete LU factorization. Parameter `tol` is used to determine a numerical zero, and `boost_val` is used to replace a numerical zero. The behavior is as follows:
3627    ///
3628    /// if `tol >= fabs(A(j,j))`, then reset each diagonal element of block `A(j,j)` by `boost_val`.
3629    ///
3630    /// To enable a boost value, the user sets parameter `enable_boost` to 1 before calling `bsrilu02()`. To disable the boost value, the user can call `bsrilu02_numericBoost()` with parameter `enable_boost=0`.
3631    ///
3632    /// If `enable_boost=0`, `tol` and `boost_val` are ignored.
3633    ///
3634    /// Both `tol` and `boost_val` can be in host memory or device memory. The user can set the proper mode with [`cusparseSetPointerMode`].
3635    ///
3636    /// * The routine requires no extra storage.
3637    /// * The routine supports asynchronous execution.
3638    /// * The routine supports CUDA graph capture.
3639    pub fn cusparseZbsrilu02_numericBoost(
3640        handle: cusparseHandle_t,
3641        info: bsrilu02Info_t,
3642        enable_boost: ::core::ffi::c_int,
3643        tol: *mut f64,
3644        boost_val: *mut cuDoubleComplex,
3645    ) -> cusparseStatus_t;
3646}
3647unsafe extern "C" {
3648    /// If the returned error code is [`cusparseStatus_t::CUSPARSE_STATUS_ZERO_PIVOT`], `position=j` means `A(j,j)` has either a structural zero or a numerical zero (the block is not invertible). Otherwise `position=-1`.
3649    ///
3650    /// The `position` can be 0-based or 1-based, the same as the matrix.
3651    ///
3652    /// Function [`cusparseXbsrilu02_zeroPivot`] is a blocking call. It calls `cudaDeviceSynchronize()` to make sure all previous kernels are done.
3653    ///
3654    /// The `position` can be in the host memory or device memory. The user can set proper the mode with [`cusparseSetPointerMode`].
3655    ///
3656    /// * The routine requires no extra storage.
3657    /// * The routine supports asynchronous execution if the Stream Ordered Memory Allocator is available.
3658    /// * The routine supports CUDA graph capture if the Stream Ordered Memory Allocator is available.
3659    ///
3660    /// # Parameters
3661    ///
3662    /// - `position`: if no structural or numerical zero, `position` is -1; otherwise if `A(j,j)` is missing or `U(j,j)` is not invertible, `position=j`.
3663    #[deprecated]
3664    pub fn cusparseXbsrilu02_zeroPivot(
3665        handle: cusparseHandle_t,
3666        info: bsrilu02Info_t,
3667        position: *mut ::core::ffi::c_int,
3668    ) -> cusparseStatus_t;
3669}
3670unsafe extern "C" {
3671    /// This function returns the size of the buffer used in computing the incomplete-LU factorization with 0 fill-in and no pivoting.
3672    ///
3673    /// `A` is an `(mb*blockDim)x(mb*blockDim)` sparse matrix that is defined in BSR storage format by the three arrays `bsrValA`, `bsrRowPtrA`, and `bsrColIndA`.
3674    ///
3675    /// The buffer size depends on the dimensions of `mb`, `blockDim`, and the number of nonzero blocks of the matrix `nnzb`. If the user changes the matrix, it is necessary to call `bsrilu02_bufferSize()` again to have the correct buffer size; otherwise, a segmentation fault may occur.
3676    ///
3677    /// **Status Returned**
3678    ///
3679    /// |  |  |
3680    /// | --- | --- |
3681    /// | [`cusparseStatus_t::CUSPARSE_STATUS_SUCCESS`] | the operation completed successfully. |
3682    /// | [`cusparseStatus_t::CUSPARSE_STATUS_NOT_INITIALIZED`] | the library was not initialized. |
3683    /// | [`cusparseStatus_t::CUSPARSE_STATUS_ALLOC_FAILED`] | the resources could not be allocated. |
3684    /// | [`cusparseStatus_t::CUSPARSE_STATUS_INVALID_VALUE`] | invalid parameters were passed (`mb,nnzb&lt;=0`), base index is not 0 or 1. |
3685    /// | [`cusparseStatus_t::CUSPARSE_STATUS_ARCH_MISMATCH`] | the device only supports compute capability 2.0 and above. |
3686    /// | [`cusparseStatus_t::CUSPARSE_STATUS_INTERNAL_ERROR`] | an internal operation failed. |
3687    /// | [`cusparseStatus_t::CUSPARSE_STATUS_MATRIX_TYPE_NOT_SUPPORTED`] | the matrix type is not supported. |
3688    pub fn cusparseSbsrilu02_bufferSize(
3689        handle: cusparseHandle_t,
3690        dirA: cusparseDirection_t,
3691        mb: ::core::ffi::c_int,
3692        nnzb: ::core::ffi::c_int,
3693        descrA: cusparseMatDescr_t,
3694        bsrSortedVal: *mut f32,
3695        bsrSortedRowPtr: *const ::core::ffi::c_int,
3696        bsrSortedColInd: *const ::core::ffi::c_int,
3697        blockDim: ::core::ffi::c_int,
3698        info: bsrilu02Info_t,
3699        pBufferSizeInBytes: *mut ::core::ffi::c_int,
3700    ) -> cusparseStatus_t;
3701}
3702unsafe extern "C" {
3703    /// This function returns the size of the buffer used in computing the incomplete-LU factorization with 0 fill-in and no pivoting.
3704    ///
3705    /// `A` is an `(mb*blockDim)x(mb*blockDim)` sparse matrix that is defined in BSR storage format by the three arrays `bsrValA`, `bsrRowPtrA`, and `bsrColIndA`.
3706    ///
3707    /// The buffer size depends on the dimensions of `mb`, `blockDim`, and the number of nonzero blocks of the matrix `nnzb`. If the user changes the matrix, it is necessary to call `bsrilu02_bufferSize()` again to have the correct buffer size; otherwise, a segmentation fault may occur.
3708    ///
3709    /// **Status Returned**
3710    ///
3711    /// |  |  |
3712    /// | --- | --- |
3713    /// | [`cusparseStatus_t::CUSPARSE_STATUS_SUCCESS`] | the operation completed successfully. |
3714    /// | [`cusparseStatus_t::CUSPARSE_STATUS_NOT_INITIALIZED`] | the library was not initialized. |
3715    /// | [`cusparseStatus_t::CUSPARSE_STATUS_ALLOC_FAILED`] | the resources could not be allocated. |
3716    /// | [`cusparseStatus_t::CUSPARSE_STATUS_INVALID_VALUE`] | invalid parameters were passed (`mb,nnzb&lt;=0`), base index is not 0 or 1. |
3717    /// | [`cusparseStatus_t::CUSPARSE_STATUS_ARCH_MISMATCH`] | the device only supports compute capability 2.0 and above. |
3718    /// | [`cusparseStatus_t::CUSPARSE_STATUS_INTERNAL_ERROR`] | an internal operation failed. |
3719    /// | [`cusparseStatus_t::CUSPARSE_STATUS_MATRIX_TYPE_NOT_SUPPORTED`] | the matrix type is not supported. |
3720    pub fn cusparseDbsrilu02_bufferSize(
3721        handle: cusparseHandle_t,
3722        dirA: cusparseDirection_t,
3723        mb: ::core::ffi::c_int,
3724        nnzb: ::core::ffi::c_int,
3725        descrA: cusparseMatDescr_t,
3726        bsrSortedVal: *mut f64,
3727        bsrSortedRowPtr: *const ::core::ffi::c_int,
3728        bsrSortedColInd: *const ::core::ffi::c_int,
3729        blockDim: ::core::ffi::c_int,
3730        info: bsrilu02Info_t,
3731        pBufferSizeInBytes: *mut ::core::ffi::c_int,
3732    ) -> cusparseStatus_t;
3733}
3734unsafe extern "C" {
3735    /// This function returns the size of the buffer used in computing the incomplete-LU factorization with 0 fill-in and no pivoting.
3736    ///
3737    /// `A` is an `(mb*blockDim)x(mb*blockDim)` sparse matrix that is defined in BSR storage format by the three arrays `bsrValA`, `bsrRowPtrA`, and `bsrColIndA`.
3738    ///
3739    /// The buffer size depends on the dimensions of `mb`, `blockDim`, and the number of nonzero blocks of the matrix `nnzb`. If the user changes the matrix, it is necessary to call `bsrilu02_bufferSize()` again to have the correct buffer size; otherwise, a segmentation fault may occur.
3740    ///
3741    /// **Status Returned**
3742    ///
3743    /// |  |  |
3744    /// | --- | --- |
3745    /// | [`cusparseStatus_t::CUSPARSE_STATUS_SUCCESS`] | the operation completed successfully. |
3746    /// | [`cusparseStatus_t::CUSPARSE_STATUS_NOT_INITIALIZED`] | the library was not initialized. |
3747    /// | [`cusparseStatus_t::CUSPARSE_STATUS_ALLOC_FAILED`] | the resources could not be allocated. |
3748    /// | [`cusparseStatus_t::CUSPARSE_STATUS_INVALID_VALUE`] | invalid parameters were passed (`mb,nnzb&lt;=0`), base index is not 0 or 1. |
3749    /// | [`cusparseStatus_t::CUSPARSE_STATUS_ARCH_MISMATCH`] | the device only supports compute capability 2.0 and above. |
3750    /// | [`cusparseStatus_t::CUSPARSE_STATUS_INTERNAL_ERROR`] | an internal operation failed. |
3751    /// | [`cusparseStatus_t::CUSPARSE_STATUS_MATRIX_TYPE_NOT_SUPPORTED`] | the matrix type is not supported. |
3752    pub fn cusparseCbsrilu02_bufferSize(
3753        handle: cusparseHandle_t,
3754        dirA: cusparseDirection_t,
3755        mb: ::core::ffi::c_int,
3756        nnzb: ::core::ffi::c_int,
3757        descrA: cusparseMatDescr_t,
3758        bsrSortedVal: *mut cuComplex,
3759        bsrSortedRowPtr: *const ::core::ffi::c_int,
3760        bsrSortedColInd: *const ::core::ffi::c_int,
3761        blockDim: ::core::ffi::c_int,
3762        info: bsrilu02Info_t,
3763        pBufferSizeInBytes: *mut ::core::ffi::c_int,
3764    ) -> cusparseStatus_t;
3765}
3766unsafe extern "C" {
3767    /// This function returns the size of the buffer used in computing the incomplete-LU factorization with 0 fill-in and no pivoting.
3768    ///
3769    /// `A` is an `(mb*blockDim)x(mb*blockDim)` sparse matrix that is defined in BSR storage format by the three arrays `bsrValA`, `bsrRowPtrA`, and `bsrColIndA`.
3770    ///
3771    /// The buffer size depends on the dimensions of `mb`, `blockDim`, and the number of nonzero blocks of the matrix `nnzb`. If the user changes the matrix, it is necessary to call `bsrilu02_bufferSize()` again to have the correct buffer size; otherwise, a segmentation fault may occur.
3772    ///
3773    /// **Status Returned**
3774    ///
3775    /// |  |  |
3776    /// | --- | --- |
3777    /// | [`cusparseStatus_t::CUSPARSE_STATUS_SUCCESS`] | the operation completed successfully. |
3778    /// | [`cusparseStatus_t::CUSPARSE_STATUS_NOT_INITIALIZED`] | the library was not initialized. |
3779    /// | [`cusparseStatus_t::CUSPARSE_STATUS_ALLOC_FAILED`] | the resources could not be allocated. |
3780    /// | [`cusparseStatus_t::CUSPARSE_STATUS_INVALID_VALUE`] | invalid parameters were passed (`mb,nnzb&lt;=0`), base index is not 0 or 1. |
3781    /// | [`cusparseStatus_t::CUSPARSE_STATUS_ARCH_MISMATCH`] | the device only supports compute capability 2.0 and above. |
3782    /// | [`cusparseStatus_t::CUSPARSE_STATUS_INTERNAL_ERROR`] | an internal operation failed. |
3783    /// | [`cusparseStatus_t::CUSPARSE_STATUS_MATRIX_TYPE_NOT_SUPPORTED`] | the matrix type is not supported. |
3784    pub fn cusparseZbsrilu02_bufferSize(
3785        handle: cusparseHandle_t,
3786        dirA: cusparseDirection_t,
3787        mb: ::core::ffi::c_int,
3788        nnzb: ::core::ffi::c_int,
3789        descrA: cusparseMatDescr_t,
3790        bsrSortedVal: *mut cuDoubleComplex,
3791        bsrSortedRowPtr: *const ::core::ffi::c_int,
3792        bsrSortedColInd: *const ::core::ffi::c_int,
3793        blockDim: ::core::ffi::c_int,
3794        info: bsrilu02Info_t,
3795        pBufferSizeInBytes: *mut ::core::ffi::c_int,
3796    ) -> cusparseStatus_t;
3797}
3798unsafe extern "C" {
3799    pub fn cusparseSbsrilu02_bufferSizeExt(
3800        handle: cusparseHandle_t,
3801        dirA: cusparseDirection_t,
3802        mb: ::core::ffi::c_int,
3803        nnzb: ::core::ffi::c_int,
3804        descrA: cusparseMatDescr_t,
3805        bsrSortedVal: *mut f32,
3806        bsrSortedRowPtr: *const ::core::ffi::c_int,
3807        bsrSortedColInd: *const ::core::ffi::c_int,
3808        blockSize: ::core::ffi::c_int,
3809        info: bsrilu02Info_t,
3810        pBufferSize: *mut size_t,
3811    ) -> cusparseStatus_t;
3812}
3813unsafe extern "C" {
3814    pub fn cusparseDbsrilu02_bufferSizeExt(
3815        handle: cusparseHandle_t,
3816        dirA: cusparseDirection_t,
3817        mb: ::core::ffi::c_int,
3818        nnzb: ::core::ffi::c_int,
3819        descrA: cusparseMatDescr_t,
3820        bsrSortedVal: *mut f64,
3821        bsrSortedRowPtr: *const ::core::ffi::c_int,
3822        bsrSortedColInd: *const ::core::ffi::c_int,
3823        blockSize: ::core::ffi::c_int,
3824        info: bsrilu02Info_t,
3825        pBufferSize: *mut size_t,
3826    ) -> cusparseStatus_t;
3827}
3828unsafe extern "C" {
3829    pub fn cusparseCbsrilu02_bufferSizeExt(
3830        handle: cusparseHandle_t,
3831        dirA: cusparseDirection_t,
3832        mb: ::core::ffi::c_int,
3833        nnzb: ::core::ffi::c_int,
3834        descrA: cusparseMatDescr_t,
3835        bsrSortedVal: *mut cuComplex,
3836        bsrSortedRowPtr: *const ::core::ffi::c_int,
3837        bsrSortedColInd: *const ::core::ffi::c_int,
3838        blockSize: ::core::ffi::c_int,
3839        info: bsrilu02Info_t,
3840        pBufferSize: *mut size_t,
3841    ) -> cusparseStatus_t;
3842}
3843unsafe extern "C" {
3844    pub fn cusparseZbsrilu02_bufferSizeExt(
3845        handle: cusparseHandle_t,
3846        dirA: cusparseDirection_t,
3847        mb: ::core::ffi::c_int,
3848        nnzb: ::core::ffi::c_int,
3849        descrA: cusparseMatDescr_t,
3850        bsrSortedVal: *mut cuDoubleComplex,
3851        bsrSortedRowPtr: *const ::core::ffi::c_int,
3852        bsrSortedColInd: *const ::core::ffi::c_int,
3853        blockSize: ::core::ffi::c_int,
3854        info: bsrilu02Info_t,
3855        pBufferSize: *mut size_t,
3856    ) -> cusparseStatus_t;
3857}
3858unsafe extern "C" {
3859    /// This function performs the analysis phase of the incomplete-LU factorization with 0 fill-in and no pivoting.
3860    ///
3861    /// |  |
3862    /// | --- |
3863    /// | $A \approx LU$ |
3864    ///
3865    /// `A` is an `(mb*blockDim)×(mb*blockDim)` sparse matrix that is defined in BSR storage format by the three arrays `bsrValA`, `bsrRowPtrA`, and `bsrColIndA`. The block in BSR format is of size `blockDim*blockDim`, stored as column-major or row-major as determined by parameter `dirA`, which is either [`cusparseDirection_t::CUSPARSE_DIRECTION_COLUMN`] or [`cusparseDirection_t::CUSPARSE_DIRECTION_ROW`]. The matrix type must be [`cusparseMatrixType_t::CUSPARSE_MATRIX_TYPE_GENERAL`], and the fill mode and diagonal type are ignored.
3866    ///
3867    /// This function requires a buffer size returned by `bsrilu02_bufferSize()`. The address of `pBuffer` must be multiple of 128 bytes. If it is not, [`cusparseStatus_t::CUSPARSE_STATUS_INVALID_VALUE`] is returned.
3868    ///
3869    /// Function `bsrilu02_analysis()` reports a structural zero and computes level information stored in the opaque structure `info`. The level information can extract more parallelism during incomplete LU factorization. However `bsrilu02()` can be done without level information. To disable level information, the user needs to specify the parameter `policy` of `bsrilu02\[_analysis| \]` as [`cusparseSolvePolicy_t::CUSPARSE_SOLVE_POLICY_NO_LEVEL`].
3870    ///
3871    /// Function `bsrilu02_analysis()` always reports the first structural zero, even with parameter `policy` is [`cusparseSolvePolicy_t::CUSPARSE_SOLVE_POLICY_NO_LEVEL`]. The user must call [`cusparseXbsrilu02_zeroPivot`] to know where the structural zero is.
3872    ///
3873    /// It is the user’s choice whether to call `bsrilu02()` if `bsrilu02_analysis()` reports a structural zero. In this case, the user can still call `bsrilu02()`, which will return a numerical zero at the same position as the structural zero. However the result is meaningless.
3874    ///
3875    /// * This function requires temporary extra storage that is allocated internally.
3876    /// * The routine supports asynchronous execution if the Stream Ordered Memory Allocator is available.
3877    /// * The routine supports CUDA graph capture if the Stream Ordered Memory Allocator is available.
3878    pub fn cusparseSbsrilu02_analysis(
3879        handle: cusparseHandle_t,
3880        dirA: cusparseDirection_t,
3881        mb: ::core::ffi::c_int,
3882        nnzb: ::core::ffi::c_int,
3883        descrA: cusparseMatDescr_t,
3884        bsrSortedVal: *mut f32,
3885        bsrSortedRowPtr: *const ::core::ffi::c_int,
3886        bsrSortedColInd: *const ::core::ffi::c_int,
3887        blockDim: ::core::ffi::c_int,
3888        info: bsrilu02Info_t,
3889        policy: cusparseSolvePolicy_t,
3890        pBuffer: *mut ::core::ffi::c_void,
3891    ) -> cusparseStatus_t;
3892}
3893unsafe extern "C" {
3894    /// This function performs the analysis phase of the incomplete-LU factorization with 0 fill-in and no pivoting.
3895    ///
3896    /// |  |
3897    /// | --- |
3898    /// | $A \approx LU$ |
3899    ///
3900    /// `A` is an `(mb*blockDim)×(mb*blockDim)` sparse matrix that is defined in BSR storage format by the three arrays `bsrValA`, `bsrRowPtrA`, and `bsrColIndA`. The block in BSR format is of size `blockDim*blockDim`, stored as column-major or row-major as determined by parameter `dirA`, which is either [`cusparseDirection_t::CUSPARSE_DIRECTION_COLUMN`] or [`cusparseDirection_t::CUSPARSE_DIRECTION_ROW`]. The matrix type must be [`cusparseMatrixType_t::CUSPARSE_MATRIX_TYPE_GENERAL`], and the fill mode and diagonal type are ignored.
3901    ///
3902    /// This function requires a buffer size returned by `bsrilu02_bufferSize()`. The address of `pBuffer` must be multiple of 128 bytes. If it is not, [`cusparseStatus_t::CUSPARSE_STATUS_INVALID_VALUE`] is returned.
3903    ///
3904    /// Function `bsrilu02_analysis()` reports a structural zero and computes level information stored in the opaque structure `info`. The level information can extract more parallelism during incomplete LU factorization. However `bsrilu02()` can be done without level information. To disable level information, the user needs to specify the parameter `policy` of `bsrilu02\[_analysis| \]` as [`cusparseSolvePolicy_t::CUSPARSE_SOLVE_POLICY_NO_LEVEL`].
3905    ///
3906    /// Function `bsrilu02_analysis()` always reports the first structural zero, even with parameter `policy` is [`cusparseSolvePolicy_t::CUSPARSE_SOLVE_POLICY_NO_LEVEL`]. The user must call [`cusparseXbsrilu02_zeroPivot`] to know where the structural zero is.
3907    ///
3908    /// It is the user’s choice whether to call `bsrilu02()` if `bsrilu02_analysis()` reports a structural zero. In this case, the user can still call `bsrilu02()`, which will return a numerical zero at the same position as the structural zero. However the result is meaningless.
3909    ///
3910    /// * This function requires temporary extra storage that is allocated internally.
3911    /// * The routine supports asynchronous execution if the Stream Ordered Memory Allocator is available.
3912    /// * The routine supports CUDA graph capture if the Stream Ordered Memory Allocator is available.
3913    pub fn cusparseDbsrilu02_analysis(
3914        handle: cusparseHandle_t,
3915        dirA: cusparseDirection_t,
3916        mb: ::core::ffi::c_int,
3917        nnzb: ::core::ffi::c_int,
3918        descrA: cusparseMatDescr_t,
3919        bsrSortedVal: *mut f64,
3920        bsrSortedRowPtr: *const ::core::ffi::c_int,
3921        bsrSortedColInd: *const ::core::ffi::c_int,
3922        blockDim: ::core::ffi::c_int,
3923        info: bsrilu02Info_t,
3924        policy: cusparseSolvePolicy_t,
3925        pBuffer: *mut ::core::ffi::c_void,
3926    ) -> cusparseStatus_t;
3927}
3928unsafe extern "C" {
3929    /// This function performs the analysis phase of the incomplete-LU factorization with 0 fill-in and no pivoting.
3930    ///
3931    /// |  |
3932    /// | --- |
3933    /// | $A \approx LU$ |
3934    ///
3935    /// `A` is an `(mb*blockDim)×(mb*blockDim)` sparse matrix that is defined in BSR storage format by the three arrays `bsrValA`, `bsrRowPtrA`, and `bsrColIndA`. The block in BSR format is of size `blockDim*blockDim`, stored as column-major or row-major as determined by parameter `dirA`, which is either [`cusparseDirection_t::CUSPARSE_DIRECTION_COLUMN`] or [`cusparseDirection_t::CUSPARSE_DIRECTION_ROW`]. The matrix type must be [`cusparseMatrixType_t::CUSPARSE_MATRIX_TYPE_GENERAL`], and the fill mode and diagonal type are ignored.
3936    ///
3937    /// This function requires a buffer size returned by `bsrilu02_bufferSize()`. The address of `pBuffer` must be multiple of 128 bytes. If it is not, [`cusparseStatus_t::CUSPARSE_STATUS_INVALID_VALUE`] is returned.
3938    ///
3939    /// Function `bsrilu02_analysis()` reports a structural zero and computes level information stored in the opaque structure `info`. The level information can extract more parallelism during incomplete LU factorization. However `bsrilu02()` can be done without level information. To disable level information, the user needs to specify the parameter `policy` of `bsrilu02\[_analysis| \]` as [`cusparseSolvePolicy_t::CUSPARSE_SOLVE_POLICY_NO_LEVEL`].
3940    ///
3941    /// Function `bsrilu02_analysis()` always reports the first structural zero, even with parameter `policy` is [`cusparseSolvePolicy_t::CUSPARSE_SOLVE_POLICY_NO_LEVEL`]. The user must call [`cusparseXbsrilu02_zeroPivot`] to know where the structural zero is.
3942    ///
3943    /// It is the user’s choice whether to call `bsrilu02()` if `bsrilu02_analysis()` reports a structural zero. In this case, the user can still call `bsrilu02()`, which will return a numerical zero at the same position as the structural zero. However the result is meaningless.
3944    ///
3945    /// * This function requires temporary extra storage that is allocated internally.
3946    /// * The routine supports asynchronous execution if the Stream Ordered Memory Allocator is available.
3947    /// * The routine supports CUDA graph capture if the Stream Ordered Memory Allocator is available.
3948    pub fn cusparseCbsrilu02_analysis(
3949        handle: cusparseHandle_t,
3950        dirA: cusparseDirection_t,
3951        mb: ::core::ffi::c_int,
3952        nnzb: ::core::ffi::c_int,
3953        descrA: cusparseMatDescr_t,
3954        bsrSortedVal: *mut cuComplex,
3955        bsrSortedRowPtr: *const ::core::ffi::c_int,
3956        bsrSortedColInd: *const ::core::ffi::c_int,
3957        blockDim: ::core::ffi::c_int,
3958        info: bsrilu02Info_t,
3959        policy: cusparseSolvePolicy_t,
3960        pBuffer: *mut ::core::ffi::c_void,
3961    ) -> cusparseStatus_t;
3962}
3963unsafe extern "C" {
3964    /// This function performs the analysis phase of the incomplete-LU factorization with 0 fill-in and no pivoting.
3965    ///
3966    /// |  |
3967    /// | --- |
3968    /// | $A \approx LU$ |
3969    ///
3970    /// `A` is an `(mb*blockDim)×(mb*blockDim)` sparse matrix that is defined in BSR storage format by the three arrays `bsrValA`, `bsrRowPtrA`, and `bsrColIndA`. The block in BSR format is of size `blockDim*blockDim`, stored as column-major or row-major as determined by parameter `dirA`, which is either [`cusparseDirection_t::CUSPARSE_DIRECTION_COLUMN`] or [`cusparseDirection_t::CUSPARSE_DIRECTION_ROW`]. The matrix type must be [`cusparseMatrixType_t::CUSPARSE_MATRIX_TYPE_GENERAL`], and the fill mode and diagonal type are ignored.
3971    ///
3972    /// This function requires a buffer size returned by `bsrilu02_bufferSize()`. The address of `pBuffer` must be multiple of 128 bytes. If it is not, [`cusparseStatus_t::CUSPARSE_STATUS_INVALID_VALUE`] is returned.
3973    ///
3974    /// Function `bsrilu02_analysis()` reports a structural zero and computes level information stored in the opaque structure `info`. The level information can extract more parallelism during incomplete LU factorization. However `bsrilu02()` can be done without level information. To disable level information, the user needs to specify the parameter `policy` of `bsrilu02\[_analysis| \]` as [`cusparseSolvePolicy_t::CUSPARSE_SOLVE_POLICY_NO_LEVEL`].
3975    ///
3976    /// Function `bsrilu02_analysis()` always reports the first structural zero, even with parameter `policy` is [`cusparseSolvePolicy_t::CUSPARSE_SOLVE_POLICY_NO_LEVEL`]. The user must call [`cusparseXbsrilu02_zeroPivot`] to know where the structural zero is.
3977    ///
3978    /// It is the user’s choice whether to call `bsrilu02()` if `bsrilu02_analysis()` reports a structural zero. In this case, the user can still call `bsrilu02()`, which will return a numerical zero at the same position as the structural zero. However the result is meaningless.
3979    ///
3980    /// * This function requires temporary extra storage that is allocated internally.
3981    /// * The routine supports asynchronous execution if the Stream Ordered Memory Allocator is available.
3982    /// * The routine supports CUDA graph capture if the Stream Ordered Memory Allocator is available.
3983    pub fn cusparseZbsrilu02_analysis(
3984        handle: cusparseHandle_t,
3985        dirA: cusparseDirection_t,
3986        mb: ::core::ffi::c_int,
3987        nnzb: ::core::ffi::c_int,
3988        descrA: cusparseMatDescr_t,
3989        bsrSortedVal: *mut cuDoubleComplex,
3990        bsrSortedRowPtr: *const ::core::ffi::c_int,
3991        bsrSortedColInd: *const ::core::ffi::c_int,
3992        blockDim: ::core::ffi::c_int,
3993        info: bsrilu02Info_t,
3994        policy: cusparseSolvePolicy_t,
3995        pBuffer: *mut ::core::ffi::c_void,
3996    ) -> cusparseStatus_t;
3997}
3998unsafe extern "C" {
3999    /// This function performs the solve phase of the incomplete-LU factorization with 0 fill-in and no pivoting.
4000    ///
4001    /// `A` is an `(mb*blockDim)×(mb*blockDim)` sparse matrix that is defined in BSR storage format by the three arrays `bsrValA`, `bsrRowPtrA`, and `bsrColIndA`. The block in BSR format is of size `blockDim*blockDim`, stored as column-major or row-major determined by parameter `dirA`, which is either [`cusparseDirection_t::CUSPARSE_DIRECTION_COLUMN`] or [`cusparseDirection_t::CUSPARSE_DIRECTION_ROW`]. The matrix type must be [`cusparseMatrixType_t::CUSPARSE_MATRIX_TYPE_GENERAL`], and the fill mode and diagonal type are ignored. Function `bsrilu02()` supports an arbitrary `blockDim`.
4002    ///
4003    /// This function requires a buffer size returned by `bsrilu02_bufferSize()`. The address of `pBuffer` must be a multiple of 128 bytes. If it is not, [`cusparseStatus_t::CUSPARSE_STATUS_INVALID_VALUE`] is returned.
4004    ///
4005    /// Although `bsrilu02()` can be used without level information, the user must be aware of consistency. If `bsrilu02_analysis()` is called with policy [`cusparseSolvePolicy_t::CUSPARSE_SOLVE_POLICY_USE_LEVEL`], `bsrilu02()` can be run with or without levels. On the other hand, if `bsrilu02_analysis()` is called with [`cusparseSolvePolicy_t::CUSPARSE_SOLVE_POLICY_NO_LEVEL`], `bsrilu02()` can only accept [`cusparseSolvePolicy_t::CUSPARSE_SOLVE_POLICY_NO_LEVEL`]; otherwise, [`cusparseStatus_t::CUSPARSE_STATUS_INVALID_VALUE`] is returned.
4006    ///
4007    /// Function `bsrilu02()` has the same behavior as `csrilu02()`. That is, `bsr2csr(bsrilu02(A)) = csrilu02(bsr2csr(A))`. The numerical zero of `csrilu02()` means there exists some zero `U(j,j)`. The numerical zero of `bsrilu02()` means there exists some block `U(j,j)` that is not invertible.
4008    ///
4009    /// Function `bsrilu02` reports the first numerical zero, including a structural zero. The user must call [`cusparseXbsrilu02_zeroPivot`] to know where the numerical zero is.
4010    ///
4011    /// For example, suppose `A` is a real m-by-m matrix where `m=mb*blockDim`. The following code solves precondition system `M*y = x`, where `M` is the product of LU factors `L` and `U`.
4012    ///
4013    /// The function supports the following properties if `pBuffer != NULL`:
4014    ///
4015    /// * The routine requires no extra storage.
4016    /// * The routine supports asynchronous execution.
4017    /// * The routine supports CUDA graph capture.
4018    pub fn cusparseSbsrilu02(
4019        handle: cusparseHandle_t,
4020        dirA: cusparseDirection_t,
4021        mb: ::core::ffi::c_int,
4022        nnzb: ::core::ffi::c_int,
4023        descrA: cusparseMatDescr_t,
4024        bsrSortedVal: *mut f32,
4025        bsrSortedRowPtr: *const ::core::ffi::c_int,
4026        bsrSortedColInd: *const ::core::ffi::c_int,
4027        blockDim: ::core::ffi::c_int,
4028        info: bsrilu02Info_t,
4029        policy: cusparseSolvePolicy_t,
4030        pBuffer: *mut ::core::ffi::c_void,
4031    ) -> cusparseStatus_t;
4032}
4033unsafe extern "C" {
4034    /// This function performs the solve phase of the incomplete-LU factorization with 0 fill-in and no pivoting.
4035    ///
4036    /// `A` is an `(mb*blockDim)×(mb*blockDim)` sparse matrix that is defined in BSR storage format by the three arrays `bsrValA`, `bsrRowPtrA`, and `bsrColIndA`. The block in BSR format is of size `blockDim*blockDim`, stored as column-major or row-major determined by parameter `dirA`, which is either [`cusparseDirection_t::CUSPARSE_DIRECTION_COLUMN`] or [`cusparseDirection_t::CUSPARSE_DIRECTION_ROW`]. The matrix type must be [`cusparseMatrixType_t::CUSPARSE_MATRIX_TYPE_GENERAL`], and the fill mode and diagonal type are ignored. Function `bsrilu02()` supports an arbitrary `blockDim`.
4037    ///
4038    /// This function requires a buffer size returned by `bsrilu02_bufferSize()`. The address of `pBuffer` must be a multiple of 128 bytes. If it is not, [`cusparseStatus_t::CUSPARSE_STATUS_INVALID_VALUE`] is returned.
4039    ///
4040    /// Although `bsrilu02()` can be used without level information, the user must be aware of consistency. If `bsrilu02_analysis()` is called with policy [`cusparseSolvePolicy_t::CUSPARSE_SOLVE_POLICY_USE_LEVEL`], `bsrilu02()` can be run with or without levels. On the other hand, if `bsrilu02_analysis()` is called with [`cusparseSolvePolicy_t::CUSPARSE_SOLVE_POLICY_NO_LEVEL`], `bsrilu02()` can only accept [`cusparseSolvePolicy_t::CUSPARSE_SOLVE_POLICY_NO_LEVEL`]; otherwise, [`cusparseStatus_t::CUSPARSE_STATUS_INVALID_VALUE`] is returned.
4041    ///
4042    /// Function `bsrilu02()` has the same behavior as `csrilu02()`. That is, `bsr2csr(bsrilu02(A)) = csrilu02(bsr2csr(A))`. The numerical zero of `csrilu02()` means there exists some zero `U(j,j)`. The numerical zero of `bsrilu02()` means there exists some block `U(j,j)` that is not invertible.
4043    ///
4044    /// Function `bsrilu02` reports the first numerical zero, including a structural zero. The user must call [`cusparseXbsrilu02_zeroPivot`] to know where the numerical zero is.
4045    ///
4046    /// For example, suppose `A` is a real m-by-m matrix where `m=mb*blockDim`. The following code solves precondition system `M*y = x`, where `M` is the product of LU factors `L` and `U`.
4047    ///
4048    /// The function supports the following properties if `pBuffer != NULL`:
4049    ///
4050    /// * The routine requires no extra storage.
4051    /// * The routine supports asynchronous execution.
4052    /// * The routine supports CUDA graph capture.
4053    pub fn cusparseDbsrilu02(
4054        handle: cusparseHandle_t,
4055        dirA: cusparseDirection_t,
4056        mb: ::core::ffi::c_int,
4057        nnzb: ::core::ffi::c_int,
4058        descrA: cusparseMatDescr_t,
4059        bsrSortedVal: *mut f64,
4060        bsrSortedRowPtr: *const ::core::ffi::c_int,
4061        bsrSortedColInd: *const ::core::ffi::c_int,
4062        blockDim: ::core::ffi::c_int,
4063        info: bsrilu02Info_t,
4064        policy: cusparseSolvePolicy_t,
4065        pBuffer: *mut ::core::ffi::c_void,
4066    ) -> cusparseStatus_t;
4067}
4068unsafe extern "C" {
4069    /// This function performs the solve phase of the incomplete-LU factorization with 0 fill-in and no pivoting.
4070    ///
4071    /// `A` is an `(mb*blockDim)×(mb*blockDim)` sparse matrix that is defined in BSR storage format by the three arrays `bsrValA`, `bsrRowPtrA`, and `bsrColIndA`. The block in BSR format is of size `blockDim*blockDim`, stored as column-major or row-major determined by parameter `dirA`, which is either [`cusparseDirection_t::CUSPARSE_DIRECTION_COLUMN`] or [`cusparseDirection_t::CUSPARSE_DIRECTION_ROW`]. The matrix type must be [`cusparseMatrixType_t::CUSPARSE_MATRIX_TYPE_GENERAL`], and the fill mode and diagonal type are ignored. Function `bsrilu02()` supports an arbitrary `blockDim`.
4072    ///
4073    /// This function requires a buffer size returned by `bsrilu02_bufferSize()`. The address of `pBuffer` must be a multiple of 128 bytes. If it is not, [`cusparseStatus_t::CUSPARSE_STATUS_INVALID_VALUE`] is returned.
4074    ///
4075    /// Although `bsrilu02()` can be used without level information, the user must be aware of consistency. If `bsrilu02_analysis()` is called with policy [`cusparseSolvePolicy_t::CUSPARSE_SOLVE_POLICY_USE_LEVEL`], `bsrilu02()` can be run with or without levels. On the other hand, if `bsrilu02_analysis()` is called with [`cusparseSolvePolicy_t::CUSPARSE_SOLVE_POLICY_NO_LEVEL`], `bsrilu02()` can only accept [`cusparseSolvePolicy_t::CUSPARSE_SOLVE_POLICY_NO_LEVEL`]; otherwise, [`cusparseStatus_t::CUSPARSE_STATUS_INVALID_VALUE`] is returned.
4076    ///
4077    /// Function `bsrilu02()` has the same behavior as `csrilu02()`. That is, `bsr2csr(bsrilu02(A)) = csrilu02(bsr2csr(A))`. The numerical zero of `csrilu02()` means there exists some zero `U(j,j)`. The numerical zero of `bsrilu02()` means there exists some block `U(j,j)` that is not invertible.
4078    ///
4079    /// Function `bsrilu02` reports the first numerical zero, including a structural zero. The user must call [`cusparseXbsrilu02_zeroPivot`] to know where the numerical zero is.
4080    ///
4081    /// For example, suppose `A` is a real m-by-m matrix where `m=mb*blockDim`. The following code solves precondition system `M*y = x`, where `M` is the product of LU factors `L` and `U`.
4082    ///
4083    /// The function supports the following properties if `pBuffer != NULL`:
4084    ///
4085    /// * The routine requires no extra storage.
4086    /// * The routine supports asynchronous execution.
4087    /// * The routine supports CUDA graph capture.
4088    pub fn cusparseCbsrilu02(
4089        handle: cusparseHandle_t,
4090        dirA: cusparseDirection_t,
4091        mb: ::core::ffi::c_int,
4092        nnzb: ::core::ffi::c_int,
4093        descrA: cusparseMatDescr_t,
4094        bsrSortedVal: *mut cuComplex,
4095        bsrSortedRowPtr: *const ::core::ffi::c_int,
4096        bsrSortedColInd: *const ::core::ffi::c_int,
4097        blockDim: ::core::ffi::c_int,
4098        info: bsrilu02Info_t,
4099        policy: cusparseSolvePolicy_t,
4100        pBuffer: *mut ::core::ffi::c_void,
4101    ) -> cusparseStatus_t;
4102}
4103unsafe extern "C" {
4104    /// This function performs the solve phase of the incomplete-LU factorization with 0 fill-in and no pivoting.
4105    ///
4106    /// `A` is an `(mb*blockDim)×(mb*blockDim)` sparse matrix that is defined in BSR storage format by the three arrays `bsrValA`, `bsrRowPtrA`, and `bsrColIndA`. The block in BSR format is of size `blockDim*blockDim`, stored as column-major or row-major determined by parameter `dirA`, which is either [`cusparseDirection_t::CUSPARSE_DIRECTION_COLUMN`] or [`cusparseDirection_t::CUSPARSE_DIRECTION_ROW`]. The matrix type must be [`cusparseMatrixType_t::CUSPARSE_MATRIX_TYPE_GENERAL`], and the fill mode and diagonal type are ignored. Function `bsrilu02()` supports an arbitrary `blockDim`.
4107    ///
4108    /// This function requires a buffer size returned by `bsrilu02_bufferSize()`. The address of `pBuffer` must be a multiple of 128 bytes. If it is not, [`cusparseStatus_t::CUSPARSE_STATUS_INVALID_VALUE`] is returned.
4109    ///
4110    /// Although `bsrilu02()` can be used without level information, the user must be aware of consistency. If `bsrilu02_analysis()` is called with policy [`cusparseSolvePolicy_t::CUSPARSE_SOLVE_POLICY_USE_LEVEL`], `bsrilu02()` can be run with or without levels. On the other hand, if `bsrilu02_analysis()` is called with [`cusparseSolvePolicy_t::CUSPARSE_SOLVE_POLICY_NO_LEVEL`], `bsrilu02()` can only accept [`cusparseSolvePolicy_t::CUSPARSE_SOLVE_POLICY_NO_LEVEL`]; otherwise, [`cusparseStatus_t::CUSPARSE_STATUS_INVALID_VALUE`] is returned.
4111    ///
4112    /// Function `bsrilu02()` has the same behavior as `csrilu02()`. That is, `bsr2csr(bsrilu02(A)) = csrilu02(bsr2csr(A))`. The numerical zero of `csrilu02()` means there exists some zero `U(j,j)`. The numerical zero of `bsrilu02()` means there exists some block `U(j,j)` that is not invertible.
4113    ///
4114    /// Function `bsrilu02` reports the first numerical zero, including a structural zero. The user must call [`cusparseXbsrilu02_zeroPivot`] to know where the numerical zero is.
4115    ///
4116    /// For example, suppose `A` is a real m-by-m matrix where `m=mb*blockDim`. The following code solves precondition system `M*y = x`, where `M` is the product of LU factors `L` and `U`.
4117    ///
4118    /// The function supports the following properties if `pBuffer != NULL`:
4119    ///
4120    /// * The routine requires no extra storage.
4121    /// * The routine supports asynchronous execution.
4122    /// * The routine supports CUDA graph capture.
4123    pub fn cusparseZbsrilu02(
4124        handle: cusparseHandle_t,
4125        dirA: cusparseDirection_t,
4126        mb: ::core::ffi::c_int,
4127        nnzb: ::core::ffi::c_int,
4128        descrA: cusparseMatDescr_t,
4129        bsrSortedVal: *mut cuDoubleComplex,
4130        bsrSortedRowPtr: *const ::core::ffi::c_int,
4131        bsrSortedColInd: *const ::core::ffi::c_int,
4132        blockDim: ::core::ffi::c_int,
4133        info: bsrilu02Info_t,
4134        policy: cusparseSolvePolicy_t,
4135        pBuffer: *mut ::core::ffi::c_void,
4136    ) -> cusparseStatus_t;
4137}
4138unsafe extern "C" {
4139    /// If the returned error code is [`cusparseStatus_t::CUSPARSE_STATUS_ZERO_PIVOT`], `position=j` means `A(j,j)` has either a structural zero or a numerical zero; otherwise, `position=-1`.
4140    ///
4141    /// The `position` can be 0-based or 1-based, the same as the matrix.
4142    ///
4143    /// Function [`cusparseXcsric02_zeroPivot`] is a blocking call. It calls `cudaDeviceSynchronize()` to make sure all previous kernels are done.
4144    ///
4145    /// The `position` can be in the host memory or device memory. The user can set proper mode with [`cusparseSetPointerMode`].
4146    ///
4147    /// * The routine requires no extra storage.
4148    /// * The routine supports asynchronous execution if the Stream Ordered Memory Allocator is available.
4149    /// * The routine supports CUDA graph capture if the Stream Ordered Memory Allocator is available.
4150    ///
4151    /// # Parameters
4152    ///
4153    /// - `position`: if no structural or numerical zero, `position` is -1; otherwise, if `A(j,j)` is missing or `L(j,j)` is zero, `position=j`.
4154    #[deprecated]
4155    pub fn cusparseXcsric02_zeroPivot(
4156        handle: cusparseHandle_t,
4157        info: csric02Info_t,
4158        position: *mut ::core::ffi::c_int,
4159    ) -> cusparseStatus_t;
4160}
4161unsafe extern "C" {
4162    /// This function returns size of buffer used in computing the incomplete-Cholesky factorization with $0$ fill-in and no pivoting:
4163    ///
4164    /// `A` is an $m \times m$ sparse matrix that is defined in CSR storage format by the three arrays `csrValA`, `csrRowPtrA`, and `csrColIndA`.
4165    ///
4166    /// The buffer size depends on dimension `m` and `nnz`, the number of nonzeros of the matrix. If the user changes the matrix, it is necessary to call `csric02_bufferSize()` again to have the correct buffer size; otherwise, a segmentation fault may occur.
4167    ///
4168    /// * The routine requires no extra storage.
4169    /// * The routine supports asynchronous execution.
4170    /// * The routine supports CUDA graph capture.
4171    pub fn cusparseScsric02_bufferSize(
4172        handle: cusparseHandle_t,
4173        m: ::core::ffi::c_int,
4174        nnz: ::core::ffi::c_int,
4175        descrA: cusparseMatDescr_t,
4176        csrSortedValA: *mut f32,
4177        csrSortedRowPtrA: *const ::core::ffi::c_int,
4178        csrSortedColIndA: *const ::core::ffi::c_int,
4179        info: csric02Info_t,
4180        pBufferSizeInBytes: *mut ::core::ffi::c_int,
4181    ) -> cusparseStatus_t;
4182}
4183unsafe extern "C" {
4184    /// This function returns size of buffer used in computing the incomplete-Cholesky factorization with $0$ fill-in and no pivoting:
4185    ///
4186    /// `A` is an $m \times m$ sparse matrix that is defined in CSR storage format by the three arrays `csrValA`, `csrRowPtrA`, and `csrColIndA`.
4187    ///
4188    /// The buffer size depends on dimension `m` and `nnz`, the number of nonzeros of the matrix. If the user changes the matrix, it is necessary to call `csric02_bufferSize()` again to have the correct buffer size; otherwise, a segmentation fault may occur.
4189    ///
4190    /// * The routine requires no extra storage.
4191    /// * The routine supports asynchronous execution.
4192    /// * The routine supports CUDA graph capture.
4193    pub fn cusparseDcsric02_bufferSize(
4194        handle: cusparseHandle_t,
4195        m: ::core::ffi::c_int,
4196        nnz: ::core::ffi::c_int,
4197        descrA: cusparseMatDescr_t,
4198        csrSortedValA: *mut f64,
4199        csrSortedRowPtrA: *const ::core::ffi::c_int,
4200        csrSortedColIndA: *const ::core::ffi::c_int,
4201        info: csric02Info_t,
4202        pBufferSizeInBytes: *mut ::core::ffi::c_int,
4203    ) -> cusparseStatus_t;
4204}
4205unsafe extern "C" {
4206    /// This function returns size of buffer used in computing the incomplete-Cholesky factorization with $0$ fill-in and no pivoting:
4207    ///
4208    /// `A` is an $m \times m$ sparse matrix that is defined in CSR storage format by the three arrays `csrValA`, `csrRowPtrA`, and `csrColIndA`.
4209    ///
4210    /// The buffer size depends on dimension `m` and `nnz`, the number of nonzeros of the matrix. If the user changes the matrix, it is necessary to call `csric02_bufferSize()` again to have the correct buffer size; otherwise, a segmentation fault may occur.
4211    ///
4212    /// * The routine requires no extra storage.
4213    /// * The routine supports asynchronous execution.
4214    /// * The routine supports CUDA graph capture.
4215    pub fn cusparseCcsric02_bufferSize(
4216        handle: cusparseHandle_t,
4217        m: ::core::ffi::c_int,
4218        nnz: ::core::ffi::c_int,
4219        descrA: cusparseMatDescr_t,
4220        csrSortedValA: *mut cuComplex,
4221        csrSortedRowPtrA: *const ::core::ffi::c_int,
4222        csrSortedColIndA: *const ::core::ffi::c_int,
4223        info: csric02Info_t,
4224        pBufferSizeInBytes: *mut ::core::ffi::c_int,
4225    ) -> cusparseStatus_t;
4226}
4227unsafe extern "C" {
4228    /// This function returns size of buffer used in computing the incomplete-Cholesky factorization with $0$ fill-in and no pivoting:
4229    ///
4230    /// `A` is an $m \times m$ sparse matrix that is defined in CSR storage format by the three arrays `csrValA`, `csrRowPtrA`, and `csrColIndA`.
4231    ///
4232    /// The buffer size depends on dimension `m` and `nnz`, the number of nonzeros of the matrix. If the user changes the matrix, it is necessary to call `csric02_bufferSize()` again to have the correct buffer size; otherwise, a segmentation fault may occur.
4233    ///
4234    /// * The routine requires no extra storage.
4235    /// * The routine supports asynchronous execution.
4236    /// * The routine supports CUDA graph capture.
4237    pub fn cusparseZcsric02_bufferSize(
4238        handle: cusparseHandle_t,
4239        m: ::core::ffi::c_int,
4240        nnz: ::core::ffi::c_int,
4241        descrA: cusparseMatDescr_t,
4242        csrSortedValA: *mut cuDoubleComplex,
4243        csrSortedRowPtrA: *const ::core::ffi::c_int,
4244        csrSortedColIndA: *const ::core::ffi::c_int,
4245        info: csric02Info_t,
4246        pBufferSizeInBytes: *mut ::core::ffi::c_int,
4247    ) -> cusparseStatus_t;
4248}
4249unsafe extern "C" {
4250    pub fn cusparseScsric02_bufferSizeExt(
4251        handle: cusparseHandle_t,
4252        m: ::core::ffi::c_int,
4253        nnz: ::core::ffi::c_int,
4254        descrA: cusparseMatDescr_t,
4255        csrSortedVal: *mut f32,
4256        csrSortedRowPtr: *const ::core::ffi::c_int,
4257        csrSortedColInd: *const ::core::ffi::c_int,
4258        info: csric02Info_t,
4259        pBufferSize: *mut size_t,
4260    ) -> cusparseStatus_t;
4261}
4262unsafe extern "C" {
4263    pub fn cusparseDcsric02_bufferSizeExt(
4264        handle: cusparseHandle_t,
4265        m: ::core::ffi::c_int,
4266        nnz: ::core::ffi::c_int,
4267        descrA: cusparseMatDescr_t,
4268        csrSortedVal: *mut f64,
4269        csrSortedRowPtr: *const ::core::ffi::c_int,
4270        csrSortedColInd: *const ::core::ffi::c_int,
4271        info: csric02Info_t,
4272        pBufferSize: *mut size_t,
4273    ) -> cusparseStatus_t;
4274}
4275unsafe extern "C" {
4276    pub fn cusparseCcsric02_bufferSizeExt(
4277        handle: cusparseHandle_t,
4278        m: ::core::ffi::c_int,
4279        nnz: ::core::ffi::c_int,
4280        descrA: cusparseMatDescr_t,
4281        csrSortedVal: *mut cuComplex,
4282        csrSortedRowPtr: *const ::core::ffi::c_int,
4283        csrSortedColInd: *const ::core::ffi::c_int,
4284        info: csric02Info_t,
4285        pBufferSize: *mut size_t,
4286    ) -> cusparseStatus_t;
4287}
4288unsafe extern "C" {
4289    pub fn cusparseZcsric02_bufferSizeExt(
4290        handle: cusparseHandle_t,
4291        m: ::core::ffi::c_int,
4292        nnz: ::core::ffi::c_int,
4293        descrA: cusparseMatDescr_t,
4294        csrSortedVal: *mut cuDoubleComplex,
4295        csrSortedRowPtr: *const ::core::ffi::c_int,
4296        csrSortedColInd: *const ::core::ffi::c_int,
4297        info: csric02Info_t,
4298        pBufferSize: *mut size_t,
4299    ) -> cusparseStatus_t;
4300}
4301unsafe extern "C" {
4302    /// This function performs the analysis phase of the incomplete-Cholesky factorization with $0$ fill-in and no pivoting:
4303    ///
4304    /// `A` is an $m \times m$ sparse matrix that is defined in CSR storage format by the three arrays `csrValA`, `csrRowPtrA`, and `csrColIndA`.
4305    ///
4306    /// This function requires a buffer size returned by `csric02_bufferSize()`. The address of `pBuffer` must be multiple of 128 bytes. If not, [`cusparseStatus_t::CUSPARSE_STATUS_INVALID_VALUE`] is returned.
4307    ///
4308    /// Function `csric02_analysis()` reports a structural zero and computes level information stored in the opaque structure `info`. The level information can extract more parallelism during incomplete Cholesky factorization. However `csric02()` can be done without level information. To disable level information, the user must specify the policy of `csric02_analysis()` and `csric02()` as [`cusparseSolvePolicy_t::CUSPARSE_SOLVE_POLICY_NO_LEVEL`].
4309    ///
4310    /// Function `csric02_analysis()` always reports the first structural zero, even if the policy is [`cusparseSolvePolicy_t::CUSPARSE_SOLVE_POLICY_NO_LEVEL`]. The user needs to call [`cusparseXcsric02_zeroPivot`] to know where the structural zero is.
4311    ///
4312    /// It is the user’s choice whether to call `csric02()` if `csric02_analysis()` reports a structural zero. In this case, the user can still call `csric02()`, which will return a numerical zero at the same position as the structural zero. However the result is meaningless.
4313    ///
4314    /// * This function requires temporary extra storage that is allocated internally
4315    /// * The routine supports asynchronous execution if the Stream Ordered Memory Allocator is available
4316    /// * The routine supports CUDA graph capture if the Stream Ordered Memory Allocator is available.
4317    pub fn cusparseScsric02_analysis(
4318        handle: cusparseHandle_t,
4319        m: ::core::ffi::c_int,
4320        nnz: ::core::ffi::c_int,
4321        descrA: cusparseMatDescr_t,
4322        csrSortedValA: *const f32,
4323        csrSortedRowPtrA: *const ::core::ffi::c_int,
4324        csrSortedColIndA: *const ::core::ffi::c_int,
4325        info: csric02Info_t,
4326        policy: cusparseSolvePolicy_t,
4327        pBuffer: *mut ::core::ffi::c_void,
4328    ) -> cusparseStatus_t;
4329}
4330unsafe extern "C" {
4331    /// This function performs the analysis phase of the incomplete-Cholesky factorization with $0$ fill-in and no pivoting:
4332    ///
4333    /// `A` is an $m \times m$ sparse matrix that is defined in CSR storage format by the three arrays `csrValA`, `csrRowPtrA`, and `csrColIndA`.
4334    ///
4335    /// This function requires a buffer size returned by `csric02_bufferSize()`. The address of `pBuffer` must be multiple of 128 bytes. If not, [`cusparseStatus_t::CUSPARSE_STATUS_INVALID_VALUE`] is returned.
4336    ///
4337    /// Function `csric02_analysis()` reports a structural zero and computes level information stored in the opaque structure `info`. The level information can extract more parallelism during incomplete Cholesky factorization. However `csric02()` can be done without level information. To disable level information, the user must specify the policy of `csric02_analysis()` and `csric02()` as [`cusparseSolvePolicy_t::CUSPARSE_SOLVE_POLICY_NO_LEVEL`].
4338    ///
4339    /// Function `csric02_analysis()` always reports the first structural zero, even if the policy is [`cusparseSolvePolicy_t::CUSPARSE_SOLVE_POLICY_NO_LEVEL`]. The user needs to call [`cusparseXcsric02_zeroPivot`] to know where the structural zero is.
4340    ///
4341    /// It is the user’s choice whether to call `csric02()` if `csric02_analysis()` reports a structural zero. In this case, the user can still call `csric02()`, which will return a numerical zero at the same position as the structural zero. However the result is meaningless.
4342    ///
4343    /// * This function requires temporary extra storage that is allocated internally
4344    /// * The routine supports asynchronous execution if the Stream Ordered Memory Allocator is available
4345    /// * The routine supports CUDA graph capture if the Stream Ordered Memory Allocator is available.
4346    pub fn cusparseDcsric02_analysis(
4347        handle: cusparseHandle_t,
4348        m: ::core::ffi::c_int,
4349        nnz: ::core::ffi::c_int,
4350        descrA: cusparseMatDescr_t,
4351        csrSortedValA: *const f64,
4352        csrSortedRowPtrA: *const ::core::ffi::c_int,
4353        csrSortedColIndA: *const ::core::ffi::c_int,
4354        info: csric02Info_t,
4355        policy: cusparseSolvePolicy_t,
4356        pBuffer: *mut ::core::ffi::c_void,
4357    ) -> cusparseStatus_t;
4358}
4359unsafe extern "C" {
4360    /// This function performs the analysis phase of the incomplete-Cholesky factorization with $0$ fill-in and no pivoting:
4361    ///
4362    /// `A` is an $m \times m$ sparse matrix that is defined in CSR storage format by the three arrays `csrValA`, `csrRowPtrA`, and `csrColIndA`.
4363    ///
4364    /// This function requires a buffer size returned by `csric02_bufferSize()`. The address of `pBuffer` must be multiple of 128 bytes. If not, [`cusparseStatus_t::CUSPARSE_STATUS_INVALID_VALUE`] is returned.
4365    ///
4366    /// Function `csric02_analysis()` reports a structural zero and computes level information stored in the opaque structure `info`. The level information can extract more parallelism during incomplete Cholesky factorization. However `csric02()` can be done without level information. To disable level information, the user must specify the policy of `csric02_analysis()` and `csric02()` as [`cusparseSolvePolicy_t::CUSPARSE_SOLVE_POLICY_NO_LEVEL`].
4367    ///
4368    /// Function `csric02_analysis()` always reports the first structural zero, even if the policy is [`cusparseSolvePolicy_t::CUSPARSE_SOLVE_POLICY_NO_LEVEL`]. The user needs to call [`cusparseXcsric02_zeroPivot`] to know where the structural zero is.
4369    ///
4370    /// It is the user’s choice whether to call `csric02()` if `csric02_analysis()` reports a structural zero. In this case, the user can still call `csric02()`, which will return a numerical zero at the same position as the structural zero. However the result is meaningless.
4371    ///
4372    /// * This function requires temporary extra storage that is allocated internally
4373    /// * The routine supports asynchronous execution if the Stream Ordered Memory Allocator is available
4374    /// * The routine supports CUDA graph capture if the Stream Ordered Memory Allocator is available.
4375    pub fn cusparseCcsric02_analysis(
4376        handle: cusparseHandle_t,
4377        m: ::core::ffi::c_int,
4378        nnz: ::core::ffi::c_int,
4379        descrA: cusparseMatDescr_t,
4380        csrSortedValA: *const cuComplex,
4381        csrSortedRowPtrA: *const ::core::ffi::c_int,
4382        csrSortedColIndA: *const ::core::ffi::c_int,
4383        info: csric02Info_t,
4384        policy: cusparseSolvePolicy_t,
4385        pBuffer: *mut ::core::ffi::c_void,
4386    ) -> cusparseStatus_t;
4387}
4388unsafe extern "C" {
4389    /// This function performs the analysis phase of the incomplete-Cholesky factorization with $0$ fill-in and no pivoting:
4390    ///
4391    /// `A` is an $m \times m$ sparse matrix that is defined in CSR storage format by the three arrays `csrValA`, `csrRowPtrA`, and `csrColIndA`.
4392    ///
4393    /// This function requires a buffer size returned by `csric02_bufferSize()`. The address of `pBuffer` must be multiple of 128 bytes. If not, [`cusparseStatus_t::CUSPARSE_STATUS_INVALID_VALUE`] is returned.
4394    ///
4395    /// Function `csric02_analysis()` reports a structural zero and computes level information stored in the opaque structure `info`. The level information can extract more parallelism during incomplete Cholesky factorization. However `csric02()` can be done without level information. To disable level information, the user must specify the policy of `csric02_analysis()` and `csric02()` as [`cusparseSolvePolicy_t::CUSPARSE_SOLVE_POLICY_NO_LEVEL`].
4396    ///
4397    /// Function `csric02_analysis()` always reports the first structural zero, even if the policy is [`cusparseSolvePolicy_t::CUSPARSE_SOLVE_POLICY_NO_LEVEL`]. The user needs to call [`cusparseXcsric02_zeroPivot`] to know where the structural zero is.
4398    ///
4399    /// It is the user’s choice whether to call `csric02()` if `csric02_analysis()` reports a structural zero. In this case, the user can still call `csric02()`, which will return a numerical zero at the same position as the structural zero. However the result is meaningless.
4400    ///
4401    /// * This function requires temporary extra storage that is allocated internally
4402    /// * The routine supports asynchronous execution if the Stream Ordered Memory Allocator is available
4403    /// * The routine supports CUDA graph capture if the Stream Ordered Memory Allocator is available.
4404    pub fn cusparseZcsric02_analysis(
4405        handle: cusparseHandle_t,
4406        m: ::core::ffi::c_int,
4407        nnz: ::core::ffi::c_int,
4408        descrA: cusparseMatDescr_t,
4409        csrSortedValA: *const cuDoubleComplex,
4410        csrSortedRowPtrA: *const ::core::ffi::c_int,
4411        csrSortedColIndA: *const ::core::ffi::c_int,
4412        info: csric02Info_t,
4413        policy: cusparseSolvePolicy_t,
4414        pBuffer: *mut ::core::ffi::c_void,
4415    ) -> cusparseStatus_t;
4416}
4417unsafe extern "C" {
4418    /// This function performs the solve phase of the computing the incomplete-Cholesky factorization with $0$ fill-in and no pivoting:
4419    ///
4420    /// This function requires a buffer size returned by `csric02_bufferSize()`. The address of `pBuffer` must be a multiple of 128 bytes. If not, [`cusparseStatus_t::CUSPARSE_STATUS_INVALID_VALUE`] is returned.
4421    ///
4422    /// Although `csric02()` can be done without level information, the user still needs to be aware of consistency. If `csric02_analysis()` is called with policy [`cusparseSolvePolicy_t::CUSPARSE_SOLVE_POLICY_USE_LEVEL`], `csric02()` can be run with or without levels. On the other hand, if `csric02_analysis()` is called with [`cusparseSolvePolicy_t::CUSPARSE_SOLVE_POLICY_NO_LEVEL`], `csric02()` can only accept [`cusparseSolvePolicy_t::CUSPARSE_SOLVE_POLICY_NO_LEVEL`]; otherwise, [`cusparseStatus_t::CUSPARSE_STATUS_INVALID_VALUE`] is returned.
4423    ///
4424    /// Function `csric02()` reports the first numerical zero, including a structural zero. The user must call [`cusparseXcsric02_zeroPivot`] to know where the numerical zero is.
4425    ///
4426    /// Function `csric02()` only takes the lower triangular part of matrix `A` to perform factorization. The matrix type must be [`cusparseMatrixType_t::CUSPARSE_MATRIX_TYPE_GENERAL`], the fill mode and diagonal type are ignored, and the strictly upper triangular part is ignored and never touched. It does not matter if `A` is Hermitian or not. In other words, from the point of view of `csric02() ``A` is Hermitian and only the lower triangular part is provided.
4427    ///
4428    /// For example, suppose `A` is a real m times m matrix, the following code solves the precondition system `M*y = x` where `M` is the product of Cholesky factorization `L` and its transpose.
4429    ///
4430    /// The function supports the following properties if `pBuffer != NULL`:
4431    ///
4432    /// * This function requires temporary extra storage that is allocated internally.
4433    /// * The routine supports asynchronous execution if the Stream Ordered Memory Allocator is available.
4434    /// * The routine supports CUDA graph capture if the Stream Ordered Memory Allocator is available.
4435    pub fn cusparseScsric02(
4436        handle: cusparseHandle_t,
4437        m: ::core::ffi::c_int,
4438        nnz: ::core::ffi::c_int,
4439        descrA: cusparseMatDescr_t,
4440        csrSortedValA_valM: *mut f32,
4441        csrSortedRowPtrA: *const ::core::ffi::c_int,
4442        csrSortedColIndA: *const ::core::ffi::c_int,
4443        info: csric02Info_t,
4444        policy: cusparseSolvePolicy_t,
4445        pBuffer: *mut ::core::ffi::c_void,
4446    ) -> cusparseStatus_t;
4447}
4448unsafe extern "C" {
4449    /// This function performs the solve phase of the computing the incomplete-Cholesky factorization with $0$ fill-in and no pivoting:
4450    ///
4451    /// This function requires a buffer size returned by `csric02_bufferSize()`. The address of `pBuffer` must be a multiple of 128 bytes. If not, [`cusparseStatus_t::CUSPARSE_STATUS_INVALID_VALUE`] is returned.
4452    ///
4453    /// Although `csric02()` can be done without level information, the user still needs to be aware of consistency. If `csric02_analysis()` is called with policy [`cusparseSolvePolicy_t::CUSPARSE_SOLVE_POLICY_USE_LEVEL`], `csric02()` can be run with or without levels. On the other hand, if `csric02_analysis()` is called with [`cusparseSolvePolicy_t::CUSPARSE_SOLVE_POLICY_NO_LEVEL`], `csric02()` can only accept [`cusparseSolvePolicy_t::CUSPARSE_SOLVE_POLICY_NO_LEVEL`]; otherwise, [`cusparseStatus_t::CUSPARSE_STATUS_INVALID_VALUE`] is returned.
4454    ///
4455    /// Function `csric02()` reports the first numerical zero, including a structural zero. The user must call [`cusparseXcsric02_zeroPivot`] to know where the numerical zero is.
4456    ///
4457    /// Function `csric02()` only takes the lower triangular part of matrix `A` to perform factorization. The matrix type must be [`cusparseMatrixType_t::CUSPARSE_MATRIX_TYPE_GENERAL`], the fill mode and diagonal type are ignored, and the strictly upper triangular part is ignored and never touched. It does not matter if `A` is Hermitian or not. In other words, from the point of view of `csric02() ``A` is Hermitian and only the lower triangular part is provided.
4458    ///
4459    /// For example, suppose `A` is a real m times m matrix, the following code solves the precondition system `M*y = x` where `M` is the product of Cholesky factorization `L` and its transpose.
4460    ///
4461    /// The function supports the following properties if `pBuffer != NULL`:
4462    ///
4463    /// * This function requires temporary extra storage that is allocated internally.
4464    /// * The routine supports asynchronous execution if the Stream Ordered Memory Allocator is available.
4465    /// * The routine supports CUDA graph capture if the Stream Ordered Memory Allocator is available.
4466    pub fn cusparseDcsric02(
4467        handle: cusparseHandle_t,
4468        m: ::core::ffi::c_int,
4469        nnz: ::core::ffi::c_int,
4470        descrA: cusparseMatDescr_t,
4471        csrSortedValA_valM: *mut f64,
4472        csrSortedRowPtrA: *const ::core::ffi::c_int,
4473        csrSortedColIndA: *const ::core::ffi::c_int,
4474        info: csric02Info_t,
4475        policy: cusparseSolvePolicy_t,
4476        pBuffer: *mut ::core::ffi::c_void,
4477    ) -> cusparseStatus_t;
4478}
4479unsafe extern "C" {
4480    /// This function performs the solve phase of the computing the incomplete-Cholesky factorization with $0$ fill-in and no pivoting:
4481    ///
4482    /// This function requires a buffer size returned by `csric02_bufferSize()`. The address of `pBuffer` must be a multiple of 128 bytes. If not, [`cusparseStatus_t::CUSPARSE_STATUS_INVALID_VALUE`] is returned.
4483    ///
4484    /// Although `csric02()` can be done without level information, the user still needs to be aware of consistency. If `csric02_analysis()` is called with policy [`cusparseSolvePolicy_t::CUSPARSE_SOLVE_POLICY_USE_LEVEL`], `csric02()` can be run with or without levels. On the other hand, if `csric02_analysis()` is called with [`cusparseSolvePolicy_t::CUSPARSE_SOLVE_POLICY_NO_LEVEL`], `csric02()` can only accept [`cusparseSolvePolicy_t::CUSPARSE_SOLVE_POLICY_NO_LEVEL`]; otherwise, [`cusparseStatus_t::CUSPARSE_STATUS_INVALID_VALUE`] is returned.
4485    ///
4486    /// Function `csric02()` reports the first numerical zero, including a structural zero. The user must call [`cusparseXcsric02_zeroPivot`] to know where the numerical zero is.
4487    ///
4488    /// Function `csric02()` only takes the lower triangular part of matrix `A` to perform factorization. The matrix type must be [`cusparseMatrixType_t::CUSPARSE_MATRIX_TYPE_GENERAL`], the fill mode and diagonal type are ignored, and the strictly upper triangular part is ignored and never touched. It does not matter if `A` is Hermitian or not. In other words, from the point of view of `csric02() ``A` is Hermitian and only the lower triangular part is provided.
4489    ///
4490    /// For example, suppose `A` is a real m times m matrix, the following code solves the precondition system `M*y = x` where `M` is the product of Cholesky factorization `L` and its transpose.
4491    ///
4492    /// The function supports the following properties if `pBuffer != NULL`:
4493    ///
4494    /// * This function requires temporary extra storage that is allocated internally.
4495    /// * The routine supports asynchronous execution if the Stream Ordered Memory Allocator is available.
4496    /// * The routine supports CUDA graph capture if the Stream Ordered Memory Allocator is available.
4497    pub fn cusparseCcsric02(
4498        handle: cusparseHandle_t,
4499        m: ::core::ffi::c_int,
4500        nnz: ::core::ffi::c_int,
4501        descrA: cusparseMatDescr_t,
4502        csrSortedValA_valM: *mut cuComplex,
4503        csrSortedRowPtrA: *const ::core::ffi::c_int,
4504        csrSortedColIndA: *const ::core::ffi::c_int,
4505        info: csric02Info_t,
4506        policy: cusparseSolvePolicy_t,
4507        pBuffer: *mut ::core::ffi::c_void,
4508    ) -> cusparseStatus_t;
4509}
4510unsafe extern "C" {
4511    /// This function performs the solve phase of the computing the incomplete-Cholesky factorization with $0$ fill-in and no pivoting:
4512    ///
4513    /// This function requires a buffer size returned by `csric02_bufferSize()`. The address of `pBuffer` must be a multiple of 128 bytes. If not, [`cusparseStatus_t::CUSPARSE_STATUS_INVALID_VALUE`] is returned.
4514    ///
4515    /// Although `csric02()` can be done without level information, the user still needs to be aware of consistency. If `csric02_analysis()` is called with policy [`cusparseSolvePolicy_t::CUSPARSE_SOLVE_POLICY_USE_LEVEL`], `csric02()` can be run with or without levels. On the other hand, if `csric02_analysis()` is called with [`cusparseSolvePolicy_t::CUSPARSE_SOLVE_POLICY_NO_LEVEL`], `csric02()` can only accept [`cusparseSolvePolicy_t::CUSPARSE_SOLVE_POLICY_NO_LEVEL`]; otherwise, [`cusparseStatus_t::CUSPARSE_STATUS_INVALID_VALUE`] is returned.
4516    ///
4517    /// Function `csric02()` reports the first numerical zero, including a structural zero. The user must call [`cusparseXcsric02_zeroPivot`] to know where the numerical zero is.
4518    ///
4519    /// Function `csric02()` only takes the lower triangular part of matrix `A` to perform factorization. The matrix type must be [`cusparseMatrixType_t::CUSPARSE_MATRIX_TYPE_GENERAL`], the fill mode and diagonal type are ignored, and the strictly upper triangular part is ignored and never touched. It does not matter if `A` is Hermitian or not. In other words, from the point of view of `csric02() ``A` is Hermitian and only the lower triangular part is provided.
4520    ///
4521    /// For example, suppose `A` is a real m times m matrix, the following code solves the precondition system `M*y = x` where `M` is the product of Cholesky factorization `L` and its transpose.
4522    ///
4523    /// The function supports the following properties if `pBuffer != NULL`:
4524    ///
4525    /// * This function requires temporary extra storage that is allocated internally.
4526    /// * The routine supports asynchronous execution if the Stream Ordered Memory Allocator is available.
4527    /// * The routine supports CUDA graph capture if the Stream Ordered Memory Allocator is available.
4528    pub fn cusparseZcsric02(
4529        handle: cusparseHandle_t,
4530        m: ::core::ffi::c_int,
4531        nnz: ::core::ffi::c_int,
4532        descrA: cusparseMatDescr_t,
4533        csrSortedValA_valM: *mut cuDoubleComplex,
4534        csrSortedRowPtrA: *const ::core::ffi::c_int,
4535        csrSortedColIndA: *const ::core::ffi::c_int,
4536        info: csric02Info_t,
4537        policy: cusparseSolvePolicy_t,
4538        pBuffer: *mut ::core::ffi::c_void,
4539    ) -> cusparseStatus_t;
4540}
4541unsafe extern "C" {
4542    /// If the returned error code is [`cusparseStatus_t::CUSPARSE_STATUS_ZERO_PIVOT`], `position=j` means `A(j,j)` has either a structural zero or a numerical zero (the block is not positive definite). Otherwise `position=-1`.
4543    ///
4544    /// The `position` can be 0-based or 1-based, the same as the matrix.
4545    ///
4546    /// Function [`cusparseXbsric02_zeroPivot`] is a blocking call. It calls `cudaDeviceSynchronize()` to make sure all previous kernels are done.
4547    ///
4548    /// The `position` can be in the host memory or device memory. The user can set the proper mode with [`cusparseSetPointerMode`].
4549    ///
4550    /// * The routine requires no extra storage.
4551    /// * The routine supports asynchronous execution if the Stream Ordered Memory Allocator is available.
4552    /// * The routine supports CUDA graph capture if the Stream Ordered Memory Allocator is available.
4553    ///
4554    /// # Parameters
4555    ///
4556    /// - `position`: If no structural or numerical zero, `position` is -1, otherwise if `A(j,j)` is missing or `L(j,j)` is not positive definite, `position=j`.
4557    #[deprecated]
4558    pub fn cusparseXbsric02_zeroPivot(
4559        handle: cusparseHandle_t,
4560        info: bsric02Info_t,
4561        position: *mut ::core::ffi::c_int,
4562    ) -> cusparseStatus_t;
4563}
4564unsafe extern "C" {
4565    /// This function returns the size of a buffer used in computing the incomplete-Cholesky factorization with 0 fill-in and no pivoting
4566    ///
4567    /// `A` is an `(mb*blockDim)*(mb*blockDim)` sparse matrix that is defined in BSR storage format by the three arrays `bsrValA`, `bsrRowPtrA`, and `bsrColIndA`.
4568    ///
4569    /// The buffer size depends on the dimensions of `mb`, `blockDim`, and the number of nonzero blocks of the matrix `nnzb`. If the user changes the matrix, it is necessary to call `bsric02_bufferSize()` again to have the correct buffer size; otherwise, a segmentation fault may occur.
4570    ///
4571    /// * The routine requires no extra storage.
4572    /// * The routine supports asynchronous execution.
4573    /// * The routine supports CUDA graph capture.
4574    pub fn cusparseSbsric02_bufferSize(
4575        handle: cusparseHandle_t,
4576        dirA: cusparseDirection_t,
4577        mb: ::core::ffi::c_int,
4578        nnzb: ::core::ffi::c_int,
4579        descrA: cusparseMatDescr_t,
4580        bsrSortedVal: *mut f32,
4581        bsrSortedRowPtr: *const ::core::ffi::c_int,
4582        bsrSortedColInd: *const ::core::ffi::c_int,
4583        blockDim: ::core::ffi::c_int,
4584        info: bsric02Info_t,
4585        pBufferSizeInBytes: *mut ::core::ffi::c_int,
4586    ) -> cusparseStatus_t;
4587}
4588unsafe extern "C" {
4589    /// This function returns the size of a buffer used in computing the incomplete-Cholesky factorization with 0 fill-in and no pivoting
4590    ///
4591    /// `A` is an `(mb*blockDim)*(mb*blockDim)` sparse matrix that is defined in BSR storage format by the three arrays `bsrValA`, `bsrRowPtrA`, and `bsrColIndA`.
4592    ///
4593    /// The buffer size depends on the dimensions of `mb`, `blockDim`, and the number of nonzero blocks of the matrix `nnzb`. If the user changes the matrix, it is necessary to call `bsric02_bufferSize()` again to have the correct buffer size; otherwise, a segmentation fault may occur.
4594    ///
4595    /// * The routine requires no extra storage.
4596    /// * The routine supports asynchronous execution.
4597    /// * The routine supports CUDA graph capture.
4598    pub fn cusparseDbsric02_bufferSize(
4599        handle: cusparseHandle_t,
4600        dirA: cusparseDirection_t,
4601        mb: ::core::ffi::c_int,
4602        nnzb: ::core::ffi::c_int,
4603        descrA: cusparseMatDescr_t,
4604        bsrSortedVal: *mut f64,
4605        bsrSortedRowPtr: *const ::core::ffi::c_int,
4606        bsrSortedColInd: *const ::core::ffi::c_int,
4607        blockDim: ::core::ffi::c_int,
4608        info: bsric02Info_t,
4609        pBufferSizeInBytes: *mut ::core::ffi::c_int,
4610    ) -> cusparseStatus_t;
4611}
4612unsafe extern "C" {
4613    /// This function returns the size of a buffer used in computing the incomplete-Cholesky factorization with 0 fill-in and no pivoting
4614    ///
4615    /// `A` is an `(mb*blockDim)*(mb*blockDim)` sparse matrix that is defined in BSR storage format by the three arrays `bsrValA`, `bsrRowPtrA`, and `bsrColIndA`.
4616    ///
4617    /// The buffer size depends on the dimensions of `mb`, `blockDim`, and the number of nonzero blocks of the matrix `nnzb`. If the user changes the matrix, it is necessary to call `bsric02_bufferSize()` again to have the correct buffer size; otherwise, a segmentation fault may occur.
4618    ///
4619    /// * The routine requires no extra storage.
4620    /// * The routine supports asynchronous execution.
4621    /// * The routine supports CUDA graph capture.
4622    pub fn cusparseCbsric02_bufferSize(
4623        handle: cusparseHandle_t,
4624        dirA: cusparseDirection_t,
4625        mb: ::core::ffi::c_int,
4626        nnzb: ::core::ffi::c_int,
4627        descrA: cusparseMatDescr_t,
4628        bsrSortedVal: *mut cuComplex,
4629        bsrSortedRowPtr: *const ::core::ffi::c_int,
4630        bsrSortedColInd: *const ::core::ffi::c_int,
4631        blockDim: ::core::ffi::c_int,
4632        info: bsric02Info_t,
4633        pBufferSizeInBytes: *mut ::core::ffi::c_int,
4634    ) -> cusparseStatus_t;
4635}
4636unsafe extern "C" {
4637    /// This function returns the size of a buffer used in computing the incomplete-Cholesky factorization with 0 fill-in and no pivoting
4638    ///
4639    /// `A` is an `(mb*blockDim)*(mb*blockDim)` sparse matrix that is defined in BSR storage format by the three arrays `bsrValA`, `bsrRowPtrA`, and `bsrColIndA`.
4640    ///
4641    /// The buffer size depends on the dimensions of `mb`, `blockDim`, and the number of nonzero blocks of the matrix `nnzb`. If the user changes the matrix, it is necessary to call `bsric02_bufferSize()` again to have the correct buffer size; otherwise, a segmentation fault may occur.
4642    ///
4643    /// * The routine requires no extra storage.
4644    /// * The routine supports asynchronous execution.
4645    /// * The routine supports CUDA graph capture.
4646    pub fn cusparseZbsric02_bufferSize(
4647        handle: cusparseHandle_t,
4648        dirA: cusparseDirection_t,
4649        mb: ::core::ffi::c_int,
4650        nnzb: ::core::ffi::c_int,
4651        descrA: cusparseMatDescr_t,
4652        bsrSortedVal: *mut cuDoubleComplex,
4653        bsrSortedRowPtr: *const ::core::ffi::c_int,
4654        bsrSortedColInd: *const ::core::ffi::c_int,
4655        blockDim: ::core::ffi::c_int,
4656        info: bsric02Info_t,
4657        pBufferSizeInBytes: *mut ::core::ffi::c_int,
4658    ) -> cusparseStatus_t;
4659}
4660unsafe extern "C" {
4661    pub fn cusparseSbsric02_bufferSizeExt(
4662        handle: cusparseHandle_t,
4663        dirA: cusparseDirection_t,
4664        mb: ::core::ffi::c_int,
4665        nnzb: ::core::ffi::c_int,
4666        descrA: cusparseMatDescr_t,
4667        bsrSortedVal: *mut f32,
4668        bsrSortedRowPtr: *const ::core::ffi::c_int,
4669        bsrSortedColInd: *const ::core::ffi::c_int,
4670        blockSize: ::core::ffi::c_int,
4671        info: bsric02Info_t,
4672        pBufferSize: *mut size_t,
4673    ) -> cusparseStatus_t;
4674}
4675unsafe extern "C" {
4676    pub fn cusparseDbsric02_bufferSizeExt(
4677        handle: cusparseHandle_t,
4678        dirA: cusparseDirection_t,
4679        mb: ::core::ffi::c_int,
4680        nnzb: ::core::ffi::c_int,
4681        descrA: cusparseMatDescr_t,
4682        bsrSortedVal: *mut f64,
4683        bsrSortedRowPtr: *const ::core::ffi::c_int,
4684        bsrSortedColInd: *const ::core::ffi::c_int,
4685        blockSize: ::core::ffi::c_int,
4686        info: bsric02Info_t,
4687        pBufferSize: *mut size_t,
4688    ) -> cusparseStatus_t;
4689}
4690unsafe extern "C" {
4691    pub fn cusparseCbsric02_bufferSizeExt(
4692        handle: cusparseHandle_t,
4693        dirA: cusparseDirection_t,
4694        mb: ::core::ffi::c_int,
4695        nnzb: ::core::ffi::c_int,
4696        descrA: cusparseMatDescr_t,
4697        bsrSortedVal: *mut cuComplex,
4698        bsrSortedRowPtr: *const ::core::ffi::c_int,
4699        bsrSortedColInd: *const ::core::ffi::c_int,
4700        blockSize: ::core::ffi::c_int,
4701        info: bsric02Info_t,
4702        pBufferSize: *mut size_t,
4703    ) -> cusparseStatus_t;
4704}
4705unsafe extern "C" {
4706    pub fn cusparseZbsric02_bufferSizeExt(
4707        handle: cusparseHandle_t,
4708        dirA: cusparseDirection_t,
4709        mb: ::core::ffi::c_int,
4710        nnzb: ::core::ffi::c_int,
4711        descrA: cusparseMatDescr_t,
4712        bsrSortedVal: *mut cuDoubleComplex,
4713        bsrSortedRowPtr: *const ::core::ffi::c_int,
4714        bsrSortedColInd: *const ::core::ffi::c_int,
4715        blockSize: ::core::ffi::c_int,
4716        info: bsric02Info_t,
4717        pBufferSize: *mut size_t,
4718    ) -> cusparseStatus_t;
4719}
4720unsafe extern "C" {
4721    /// This function performs the analysis phase of the incomplete-Cholesky factorization with 0 fill-in and no pivoting
4722    ///
4723    /// `A` is an `(mb*blockDim)x(mb*blockDim)` sparse matrix that is defined in BSR storage format by the three arrays `bsrValA`, `bsrRowPtrA`, and `bsrColIndA`. The block in BSR format is of size `blockDim*blockDim`, stored as column-major or row-major as determined by parameter `dirA`, which is either [`cusparseDirection_t::CUSPARSE_DIRECTION_COLUMN`] or [`cusparseDirection_t::CUSPARSE_DIRECTION_ROW`]. The matrix type must be [`cusparseMatrixType_t::CUSPARSE_MATRIX_TYPE_GENERAL`], and the fill mode and diagonal type are ignored.
4724    ///
4725    /// This function requires a buffer size returned by `bsric02_bufferSize90`. The address of `pBuffer` must be a multiple of 128 bytes. If it is not, [`cusparseStatus_t::CUSPARSE_STATUS_INVALID_VALUE`] is returned.
4726    ///
4727    /// Function `bsric02_analysis()` reports structural zero and computes level information stored in the opaque structure `info`. The level information can extract more parallelism during incomplete Cholesky factorization. However `bsric02()` can be done without level information. To disable level information, the user needs to specify the parameter `policy` of `bsric02\[_analysis| \]` as [`cusparseSolvePolicy_t::CUSPARSE_SOLVE_POLICY_NO_LEVEL`].
4728    ///
4729    /// Function `bsric02_analysis` always reports the first structural zero, even when parameter `policy` is [`cusparseSolvePolicy_t::CUSPARSE_SOLVE_POLICY_NO_LEVEL`]. The user must call [`cusparseXbsric02_zeroPivot`] to know where the structural zero is.
4730    ///
4731    /// It is the user’s choice whether to call `bsric02()` if `bsric02_analysis()` reports a structural zero. In this case, the user can still call `bsric02()`, which returns a numerical zero in the same position as the structural zero. However the result is meaningless.
4732    ///
4733    /// * This function requires temporary extra storage that is allocated internally.
4734    /// * The routine supports asynchronous execution if the Stream Ordered Memory Allocator is available.
4735    /// * The routine supports CUDA graph capture if the Stream Ordered Memory Allocator is available.
4736    pub fn cusparseSbsric02_analysis(
4737        handle: cusparseHandle_t,
4738        dirA: cusparseDirection_t,
4739        mb: ::core::ffi::c_int,
4740        nnzb: ::core::ffi::c_int,
4741        descrA: cusparseMatDescr_t,
4742        bsrSortedVal: *const f32,
4743        bsrSortedRowPtr: *const ::core::ffi::c_int,
4744        bsrSortedColInd: *const ::core::ffi::c_int,
4745        blockDim: ::core::ffi::c_int,
4746        info: bsric02Info_t,
4747        policy: cusparseSolvePolicy_t,
4748        pInputBuffer: *mut ::core::ffi::c_void,
4749    ) -> cusparseStatus_t;
4750}
4751unsafe extern "C" {
4752    /// This function performs the analysis phase of the incomplete-Cholesky factorization with 0 fill-in and no pivoting
4753    ///
4754    /// `A` is an `(mb*blockDim)x(mb*blockDim)` sparse matrix that is defined in BSR storage format by the three arrays `bsrValA`, `bsrRowPtrA`, and `bsrColIndA`. The block in BSR format is of size `blockDim*blockDim`, stored as column-major or row-major as determined by parameter `dirA`, which is either [`cusparseDirection_t::CUSPARSE_DIRECTION_COLUMN`] or [`cusparseDirection_t::CUSPARSE_DIRECTION_ROW`]. The matrix type must be [`cusparseMatrixType_t::CUSPARSE_MATRIX_TYPE_GENERAL`], and the fill mode and diagonal type are ignored.
4755    ///
4756    /// This function requires a buffer size returned by `bsric02_bufferSize90`. The address of `pBuffer` must be a multiple of 128 bytes. If it is not, [`cusparseStatus_t::CUSPARSE_STATUS_INVALID_VALUE`] is returned.
4757    ///
4758    /// Function `bsric02_analysis()` reports structural zero and computes level information stored in the opaque structure `info`. The level information can extract more parallelism during incomplete Cholesky factorization. However `bsric02()` can be done without level information. To disable level information, the user needs to specify the parameter `policy` of `bsric02\[_analysis| \]` as [`cusparseSolvePolicy_t::CUSPARSE_SOLVE_POLICY_NO_LEVEL`].
4759    ///
4760    /// Function `bsric02_analysis` always reports the first structural zero, even when parameter `policy` is [`cusparseSolvePolicy_t::CUSPARSE_SOLVE_POLICY_NO_LEVEL`]. The user must call [`cusparseXbsric02_zeroPivot`] to know where the structural zero is.
4761    ///
4762    /// It is the user’s choice whether to call `bsric02()` if `bsric02_analysis()` reports a structural zero. In this case, the user can still call `bsric02()`, which returns a numerical zero in the same position as the structural zero. However the result is meaningless.
4763    ///
4764    /// * This function requires temporary extra storage that is allocated internally.
4765    /// * The routine supports asynchronous execution if the Stream Ordered Memory Allocator is available.
4766    /// * The routine supports CUDA graph capture if the Stream Ordered Memory Allocator is available.
4767    pub fn cusparseDbsric02_analysis(
4768        handle: cusparseHandle_t,
4769        dirA: cusparseDirection_t,
4770        mb: ::core::ffi::c_int,
4771        nnzb: ::core::ffi::c_int,
4772        descrA: cusparseMatDescr_t,
4773        bsrSortedVal: *const f64,
4774        bsrSortedRowPtr: *const ::core::ffi::c_int,
4775        bsrSortedColInd: *const ::core::ffi::c_int,
4776        blockDim: ::core::ffi::c_int,
4777        info: bsric02Info_t,
4778        policy: cusparseSolvePolicy_t,
4779        pInputBuffer: *mut ::core::ffi::c_void,
4780    ) -> cusparseStatus_t;
4781}
4782unsafe extern "C" {
4783    /// This function performs the analysis phase of the incomplete-Cholesky factorization with 0 fill-in and no pivoting
4784    ///
4785    /// `A` is an `(mb*blockDim)x(mb*blockDim)` sparse matrix that is defined in BSR storage format by the three arrays `bsrValA`, `bsrRowPtrA`, and `bsrColIndA`. The block in BSR format is of size `blockDim*blockDim`, stored as column-major or row-major as determined by parameter `dirA`, which is either [`cusparseDirection_t::CUSPARSE_DIRECTION_COLUMN`] or [`cusparseDirection_t::CUSPARSE_DIRECTION_ROW`]. The matrix type must be [`cusparseMatrixType_t::CUSPARSE_MATRIX_TYPE_GENERAL`], and the fill mode and diagonal type are ignored.
4786    ///
4787    /// This function requires a buffer size returned by `bsric02_bufferSize90`. The address of `pBuffer` must be a multiple of 128 bytes. If it is not, [`cusparseStatus_t::CUSPARSE_STATUS_INVALID_VALUE`] is returned.
4788    ///
4789    /// Function `bsric02_analysis()` reports structural zero and computes level information stored in the opaque structure `info`. The level information can extract more parallelism during incomplete Cholesky factorization. However `bsric02()` can be done without level information. To disable level information, the user needs to specify the parameter `policy` of `bsric02\[_analysis| \]` as [`cusparseSolvePolicy_t::CUSPARSE_SOLVE_POLICY_NO_LEVEL`].
4790    ///
4791    /// Function `bsric02_analysis` always reports the first structural zero, even when parameter `policy` is [`cusparseSolvePolicy_t::CUSPARSE_SOLVE_POLICY_NO_LEVEL`]. The user must call [`cusparseXbsric02_zeroPivot`] to know where the structural zero is.
4792    ///
4793    /// It is the user’s choice whether to call `bsric02()` if `bsric02_analysis()` reports a structural zero. In this case, the user can still call `bsric02()`, which returns a numerical zero in the same position as the structural zero. However the result is meaningless.
4794    ///
4795    /// * This function requires temporary extra storage that is allocated internally.
4796    /// * The routine supports asynchronous execution if the Stream Ordered Memory Allocator is available.
4797    /// * The routine supports CUDA graph capture if the Stream Ordered Memory Allocator is available.
4798    pub fn cusparseCbsric02_analysis(
4799        handle: cusparseHandle_t,
4800        dirA: cusparseDirection_t,
4801        mb: ::core::ffi::c_int,
4802        nnzb: ::core::ffi::c_int,
4803        descrA: cusparseMatDescr_t,
4804        bsrSortedVal: *const cuComplex,
4805        bsrSortedRowPtr: *const ::core::ffi::c_int,
4806        bsrSortedColInd: *const ::core::ffi::c_int,
4807        blockDim: ::core::ffi::c_int,
4808        info: bsric02Info_t,
4809        policy: cusparseSolvePolicy_t,
4810        pInputBuffer: *mut ::core::ffi::c_void,
4811    ) -> cusparseStatus_t;
4812}
4813unsafe extern "C" {
4814    /// This function performs the analysis phase of the incomplete-Cholesky factorization with 0 fill-in and no pivoting
4815    ///
4816    /// `A` is an `(mb*blockDim)x(mb*blockDim)` sparse matrix that is defined in BSR storage format by the three arrays `bsrValA`, `bsrRowPtrA`, and `bsrColIndA`. The block in BSR format is of size `blockDim*blockDim`, stored as column-major or row-major as determined by parameter `dirA`, which is either [`cusparseDirection_t::CUSPARSE_DIRECTION_COLUMN`] or [`cusparseDirection_t::CUSPARSE_DIRECTION_ROW`]. The matrix type must be [`cusparseMatrixType_t::CUSPARSE_MATRIX_TYPE_GENERAL`], and the fill mode and diagonal type are ignored.
4817    ///
4818    /// This function requires a buffer size returned by `bsric02_bufferSize90`. The address of `pBuffer` must be a multiple of 128 bytes. If it is not, [`cusparseStatus_t::CUSPARSE_STATUS_INVALID_VALUE`] is returned.
4819    ///
4820    /// Function `bsric02_analysis()` reports structural zero and computes level information stored in the opaque structure `info`. The level information can extract more parallelism during incomplete Cholesky factorization. However `bsric02()` can be done without level information. To disable level information, the user needs to specify the parameter `policy` of `bsric02\[_analysis| \]` as [`cusparseSolvePolicy_t::CUSPARSE_SOLVE_POLICY_NO_LEVEL`].
4821    ///
4822    /// Function `bsric02_analysis` always reports the first structural zero, even when parameter `policy` is [`cusparseSolvePolicy_t::CUSPARSE_SOLVE_POLICY_NO_LEVEL`]. The user must call [`cusparseXbsric02_zeroPivot`] to know where the structural zero is.
4823    ///
4824    /// It is the user’s choice whether to call `bsric02()` if `bsric02_analysis()` reports a structural zero. In this case, the user can still call `bsric02()`, which returns a numerical zero in the same position as the structural zero. However the result is meaningless.
4825    ///
4826    /// * This function requires temporary extra storage that is allocated internally.
4827    /// * The routine supports asynchronous execution if the Stream Ordered Memory Allocator is available.
4828    /// * The routine supports CUDA graph capture if the Stream Ordered Memory Allocator is available.
4829    pub fn cusparseZbsric02_analysis(
4830        handle: cusparseHandle_t,
4831        dirA: cusparseDirection_t,
4832        mb: ::core::ffi::c_int,
4833        nnzb: ::core::ffi::c_int,
4834        descrA: cusparseMatDescr_t,
4835        bsrSortedVal: *const cuDoubleComplex,
4836        bsrSortedRowPtr: *const ::core::ffi::c_int,
4837        bsrSortedColInd: *const ::core::ffi::c_int,
4838        blockDim: ::core::ffi::c_int,
4839        info: bsric02Info_t,
4840        policy: cusparseSolvePolicy_t,
4841        pInputBuffer: *mut ::core::ffi::c_void,
4842    ) -> cusparseStatus_t;
4843}
4844unsafe extern "C" {
4845    /// This function performs the solve phase of the incomplete-Cholesky factorization with 0 fill-in and no pivoting.
4846    ///
4847    /// `A` is an `(mb*blockDim)x(mb*blockDim)` sparse matrix that is defined in BSR storage format by the three arrays `bsrValA`, `bsrRowPtrA`, and `bsrColIndA`. The block in BSR format is of size `blockDim*blockDim`, stored as column-major or row-major as determined by parameter `dirA`, which is either [`cusparseDirection_t::CUSPARSE_DIRECTION_COLUMN`] or [`cusparseDirection_t::CUSPARSE_DIRECTION_ROW`]. The matrix type must be [`cusparseMatrixType_t::CUSPARSE_MATRIX_TYPE_GENERAL`], and the fill mode and diagonal type are ignored.
4848    ///
4849    /// This function requires a buffer size returned by `bsric02_bufferSize()`. The address of `pBuffer` must be a multiple of 128 bytes. If it is not, [`cusparseStatus_t::CUSPARSE_STATUS_INVALID_VALUE`] is returned.
4850    ///
4851    /// Although `bsric02()` can be done without level information, the user must be aware of consistency. If `bsric02_analysis()` is called with policy [`cusparseSolvePolicy_t::CUSPARSE_SOLVE_POLICY_USE_LEVEL`], `bsric02()` can be run with or without levels. On the other hand, if `bsric02_analysis()` is called with [`cusparseSolvePolicy_t::CUSPARSE_SOLVE_POLICY_NO_LEVEL`], `bsric02()` can only accept [`cusparseSolvePolicy_t::CUSPARSE_SOLVE_POLICY_NO_LEVEL`]; otherwise, [`cusparseStatus_t::CUSPARSE_STATUS_INVALID_VALUE`] is returned.
4852    ///
4853    /// Function `bsric02()` has the same behavior as `csric02()`. That is, `bsr2csr(bsric02(A)) = csric02(bsr2csr(A))`. The numerical zero of `csric02()` means there exists some zero `L(j,j)`. The numerical zero of `bsric02()` means there exists some block `Lj,j)` that is not invertible.
4854    ///
4855    /// Function `bsric02` reports the first numerical zero, including a structural zero. The user must call [`cusparseXbsric02_zeroPivot`] to know where the numerical zero is.
4856    ///
4857    /// The `bsric02()` function only takes the lower triangular part of matrix `A` to perform factorization. The strictly upper triangular part is ignored and never touched. It does not matter if `A` is Hermitian or not. In other words, from the point of view of `bsric02()`, `A` is Hermitian and only the lower triangular part is provided. Moreover, the imaginary part of diagonal elements of diagonal blocks is ignored.
4858    ///
4859    /// For example, suppose `A` is a real m-by-m matrix, where `m=mb*blockDim`. The following code solves precondition system `M*y = x`, where `M` is the product of Cholesky factorization `L` and its transpose.
4860    ///
4861    /// The function supports the following properties if `pBuffer != NULL`:
4862    ///
4863    /// * The routine requires no extra storage.
4864    /// * The routine supports asynchronous execution.
4865    /// * The routine supports CUDA graph capture.
4866    pub fn cusparseSbsric02(
4867        handle: cusparseHandle_t,
4868        dirA: cusparseDirection_t,
4869        mb: ::core::ffi::c_int,
4870        nnzb: ::core::ffi::c_int,
4871        descrA: cusparseMatDescr_t,
4872        bsrSortedVal: *mut f32,
4873        bsrSortedRowPtr: *const ::core::ffi::c_int,
4874        bsrSortedColInd: *const ::core::ffi::c_int,
4875        blockDim: ::core::ffi::c_int,
4876        info: bsric02Info_t,
4877        policy: cusparseSolvePolicy_t,
4878        pBuffer: *mut ::core::ffi::c_void,
4879    ) -> cusparseStatus_t;
4880}
4881unsafe extern "C" {
4882    /// This function performs the solve phase of the incomplete-Cholesky factorization with 0 fill-in and no pivoting.
4883    ///
4884    /// `A` is an `(mb*blockDim)x(mb*blockDim)` sparse matrix that is defined in BSR storage format by the three arrays `bsrValA`, `bsrRowPtrA`, and `bsrColIndA`. The block in BSR format is of size `blockDim*blockDim`, stored as column-major or row-major as determined by parameter `dirA`, which is either [`cusparseDirection_t::CUSPARSE_DIRECTION_COLUMN`] or [`cusparseDirection_t::CUSPARSE_DIRECTION_ROW`]. The matrix type must be [`cusparseMatrixType_t::CUSPARSE_MATRIX_TYPE_GENERAL`], and the fill mode and diagonal type are ignored.
4885    ///
4886    /// This function requires a buffer size returned by `bsric02_bufferSize()`. The address of `pBuffer` must be a multiple of 128 bytes. If it is not, [`cusparseStatus_t::CUSPARSE_STATUS_INVALID_VALUE`] is returned.
4887    ///
4888    /// Although `bsric02()` can be done without level information, the user must be aware of consistency. If `bsric02_analysis()` is called with policy [`cusparseSolvePolicy_t::CUSPARSE_SOLVE_POLICY_USE_LEVEL`], `bsric02()` can be run with or without levels. On the other hand, if `bsric02_analysis()` is called with [`cusparseSolvePolicy_t::CUSPARSE_SOLVE_POLICY_NO_LEVEL`], `bsric02()` can only accept [`cusparseSolvePolicy_t::CUSPARSE_SOLVE_POLICY_NO_LEVEL`]; otherwise, [`cusparseStatus_t::CUSPARSE_STATUS_INVALID_VALUE`] is returned.
4889    ///
4890    /// Function `bsric02()` has the same behavior as `csric02()`. That is, `bsr2csr(bsric02(A)) = csric02(bsr2csr(A))`. The numerical zero of `csric02()` means there exists some zero `L(j,j)`. The numerical zero of `bsric02()` means there exists some block `Lj,j)` that is not invertible.
4891    ///
4892    /// Function `bsric02` reports the first numerical zero, including a structural zero. The user must call [`cusparseXbsric02_zeroPivot`] to know where the numerical zero is.
4893    ///
4894    /// The `bsric02()` function only takes the lower triangular part of matrix `A` to perform factorization. The strictly upper triangular part is ignored and never touched. It does not matter if `A` is Hermitian or not. In other words, from the point of view of `bsric02()`, `A` is Hermitian and only the lower triangular part is provided. Moreover, the imaginary part of diagonal elements of diagonal blocks is ignored.
4895    ///
4896    /// For example, suppose `A` is a real m-by-m matrix, where `m=mb*blockDim`. The following code solves precondition system `M*y = x`, where `M` is the product of Cholesky factorization `L` and its transpose.
4897    ///
4898    /// The function supports the following properties if `pBuffer != NULL`:
4899    ///
4900    /// * The routine requires no extra storage.
4901    /// * The routine supports asynchronous execution.
4902    /// * The routine supports CUDA graph capture.
4903    pub fn cusparseDbsric02(
4904        handle: cusparseHandle_t,
4905        dirA: cusparseDirection_t,
4906        mb: ::core::ffi::c_int,
4907        nnzb: ::core::ffi::c_int,
4908        descrA: cusparseMatDescr_t,
4909        bsrSortedVal: *mut f64,
4910        bsrSortedRowPtr: *const ::core::ffi::c_int,
4911        bsrSortedColInd: *const ::core::ffi::c_int,
4912        blockDim: ::core::ffi::c_int,
4913        info: bsric02Info_t,
4914        policy: cusparseSolvePolicy_t,
4915        pBuffer: *mut ::core::ffi::c_void,
4916    ) -> cusparseStatus_t;
4917}
4918unsafe extern "C" {
4919    /// This function performs the solve phase of the incomplete-Cholesky factorization with 0 fill-in and no pivoting.
4920    ///
4921    /// `A` is an `(mb*blockDim)x(mb*blockDim)` sparse matrix that is defined in BSR storage format by the three arrays `bsrValA`, `bsrRowPtrA`, and `bsrColIndA`. The block in BSR format is of size `blockDim*blockDim`, stored as column-major or row-major as determined by parameter `dirA`, which is either [`cusparseDirection_t::CUSPARSE_DIRECTION_COLUMN`] or [`cusparseDirection_t::CUSPARSE_DIRECTION_ROW`]. The matrix type must be [`cusparseMatrixType_t::CUSPARSE_MATRIX_TYPE_GENERAL`], and the fill mode and diagonal type are ignored.
4922    ///
4923    /// This function requires a buffer size returned by `bsric02_bufferSize()`. The address of `pBuffer` must be a multiple of 128 bytes. If it is not, [`cusparseStatus_t::CUSPARSE_STATUS_INVALID_VALUE`] is returned.
4924    ///
4925    /// Although `bsric02()` can be done without level information, the user must be aware of consistency. If `bsric02_analysis()` is called with policy [`cusparseSolvePolicy_t::CUSPARSE_SOLVE_POLICY_USE_LEVEL`], `bsric02()` can be run with or without levels. On the other hand, if `bsric02_analysis()` is called with [`cusparseSolvePolicy_t::CUSPARSE_SOLVE_POLICY_NO_LEVEL`], `bsric02()` can only accept [`cusparseSolvePolicy_t::CUSPARSE_SOLVE_POLICY_NO_LEVEL`]; otherwise, [`cusparseStatus_t::CUSPARSE_STATUS_INVALID_VALUE`] is returned.
4926    ///
4927    /// Function `bsric02()` has the same behavior as `csric02()`. That is, `bsr2csr(bsric02(A)) = csric02(bsr2csr(A))`. The numerical zero of `csric02()` means there exists some zero `L(j,j)`. The numerical zero of `bsric02()` means there exists some block `Lj,j)` that is not invertible.
4928    ///
4929    /// Function `bsric02` reports the first numerical zero, including a structural zero. The user must call [`cusparseXbsric02_zeroPivot`] to know where the numerical zero is.
4930    ///
4931    /// The `bsric02()` function only takes the lower triangular part of matrix `A` to perform factorization. The strictly upper triangular part is ignored and never touched. It does not matter if `A` is Hermitian or not. In other words, from the point of view of `bsric02()`, `A` is Hermitian and only the lower triangular part is provided. Moreover, the imaginary part of diagonal elements of diagonal blocks is ignored.
4932    ///
4933    /// For example, suppose `A` is a real m-by-m matrix, where `m=mb*blockDim`. The following code solves precondition system `M*y = x`, where `M` is the product of Cholesky factorization `L` and its transpose.
4934    ///
4935    /// The function supports the following properties if `pBuffer != NULL`:
4936    ///
4937    /// * The routine requires no extra storage.
4938    /// * The routine supports asynchronous execution.
4939    /// * The routine supports CUDA graph capture.
4940    pub fn cusparseCbsric02(
4941        handle: cusparseHandle_t,
4942        dirA: cusparseDirection_t,
4943        mb: ::core::ffi::c_int,
4944        nnzb: ::core::ffi::c_int,
4945        descrA: cusparseMatDescr_t,
4946        bsrSortedVal: *mut cuComplex,
4947        bsrSortedRowPtr: *const ::core::ffi::c_int,
4948        bsrSortedColInd: *const ::core::ffi::c_int,
4949        blockDim: ::core::ffi::c_int,
4950        info: bsric02Info_t,
4951        policy: cusparseSolvePolicy_t,
4952        pBuffer: *mut ::core::ffi::c_void,
4953    ) -> cusparseStatus_t;
4954}
4955unsafe extern "C" {
4956    /// This function performs the solve phase of the incomplete-Cholesky factorization with 0 fill-in and no pivoting.
4957    ///
4958    /// `A` is an `(mb*blockDim)x(mb*blockDim)` sparse matrix that is defined in BSR storage format by the three arrays `bsrValA`, `bsrRowPtrA`, and `bsrColIndA`. The block in BSR format is of size `blockDim*blockDim`, stored as column-major or row-major as determined by parameter `dirA`, which is either [`cusparseDirection_t::CUSPARSE_DIRECTION_COLUMN`] or [`cusparseDirection_t::CUSPARSE_DIRECTION_ROW`]. The matrix type must be [`cusparseMatrixType_t::CUSPARSE_MATRIX_TYPE_GENERAL`], and the fill mode and diagonal type are ignored.
4959    ///
4960    /// This function requires a buffer size returned by `bsric02_bufferSize()`. The address of `pBuffer` must be a multiple of 128 bytes. If it is not, [`cusparseStatus_t::CUSPARSE_STATUS_INVALID_VALUE`] is returned.
4961    ///
4962    /// Although `bsric02()` can be done without level information, the user must be aware of consistency. If `bsric02_analysis()` is called with policy [`cusparseSolvePolicy_t::CUSPARSE_SOLVE_POLICY_USE_LEVEL`], `bsric02()` can be run with or without levels. On the other hand, if `bsric02_analysis()` is called with [`cusparseSolvePolicy_t::CUSPARSE_SOLVE_POLICY_NO_LEVEL`], `bsric02()` can only accept [`cusparseSolvePolicy_t::CUSPARSE_SOLVE_POLICY_NO_LEVEL`]; otherwise, [`cusparseStatus_t::CUSPARSE_STATUS_INVALID_VALUE`] is returned.
4963    ///
4964    /// Function `bsric02()` has the same behavior as `csric02()`. That is, `bsr2csr(bsric02(A)) = csric02(bsr2csr(A))`. The numerical zero of `csric02()` means there exists some zero `L(j,j)`. The numerical zero of `bsric02()` means there exists some block `Lj,j)` that is not invertible.
4965    ///
4966    /// Function `bsric02` reports the first numerical zero, including a structural zero. The user must call [`cusparseXbsric02_zeroPivot`] to know where the numerical zero is.
4967    ///
4968    /// The `bsric02()` function only takes the lower triangular part of matrix `A` to perform factorization. The strictly upper triangular part is ignored and never touched. It does not matter if `A` is Hermitian or not. In other words, from the point of view of `bsric02()`, `A` is Hermitian and only the lower triangular part is provided. Moreover, the imaginary part of diagonal elements of diagonal blocks is ignored.
4969    ///
4970    /// For example, suppose `A` is a real m-by-m matrix, where `m=mb*blockDim`. The following code solves precondition system `M*y = x`, where `M` is the product of Cholesky factorization `L` and its transpose.
4971    ///
4972    /// The function supports the following properties if `pBuffer != NULL`:
4973    ///
4974    /// * The routine requires no extra storage.
4975    /// * The routine supports asynchronous execution.
4976    /// * The routine supports CUDA graph capture.
4977    pub fn cusparseZbsric02(
4978        handle: cusparseHandle_t,
4979        dirA: cusparseDirection_t,
4980        mb: ::core::ffi::c_int,
4981        nnzb: ::core::ffi::c_int,
4982        descrA: cusparseMatDescr_t,
4983        bsrSortedVal: *mut cuDoubleComplex,
4984        bsrSortedRowPtr: *const ::core::ffi::c_int,
4985        bsrSortedColInd: *const ::core::ffi::c_int,
4986        blockDim: ::core::ffi::c_int,
4987        info: bsric02Info_t,
4988        policy: cusparseSolvePolicy_t,
4989        pBuffer: *mut ::core::ffi::c_void,
4990    ) -> cusparseStatus_t;
4991}
4992unsafe extern "C" {
4993    pub fn cusparseSgtsv2_bufferSizeExt(
4994        handle: cusparseHandle_t,
4995        m: ::core::ffi::c_int,
4996        n: ::core::ffi::c_int,
4997        dl: *const f32,
4998        d: *const f32,
4999        du: *const f32,
5000        B: *const f32,
5001        ldb: ::core::ffi::c_int,
5002        bufferSizeInBytes: *mut size_t,
5003    ) -> cusparseStatus_t;
5004}
5005unsafe extern "C" {
5006    pub fn cusparseDgtsv2_bufferSizeExt(
5007        handle: cusparseHandle_t,
5008        m: ::core::ffi::c_int,
5009        n: ::core::ffi::c_int,
5010        dl: *const f64,
5011        d: *const f64,
5012        du: *const f64,
5013        B: *const f64,
5014        ldb: ::core::ffi::c_int,
5015        bufferSizeInBytes: *mut size_t,
5016    ) -> cusparseStatus_t;
5017}
5018unsafe extern "C" {
5019    pub fn cusparseCgtsv2_bufferSizeExt(
5020        handle: cusparseHandle_t,
5021        m: ::core::ffi::c_int,
5022        n: ::core::ffi::c_int,
5023        dl: *const cuComplex,
5024        d: *const cuComplex,
5025        du: *const cuComplex,
5026        B: *const cuComplex,
5027        ldb: ::core::ffi::c_int,
5028        bufferSizeInBytes: *mut size_t,
5029    ) -> cusparseStatus_t;
5030}
5031unsafe extern "C" {
5032    pub fn cusparseZgtsv2_bufferSizeExt(
5033        handle: cusparseHandle_t,
5034        m: ::core::ffi::c_int,
5035        n: ::core::ffi::c_int,
5036        dl: *const cuDoubleComplex,
5037        d: *const cuDoubleComplex,
5038        du: *const cuDoubleComplex,
5039        B: *const cuDoubleComplex,
5040        ldb: ::core::ffi::c_int,
5041        bufferSizeInBytes: *mut size_t,
5042    ) -> cusparseStatus_t;
5043}
5044unsafe extern "C" {
5045    /// This function computes the solution of a tridiagonal linear system with multiple right-hand sides:
5046    ///
5047    /// The coefficient matrix `A` of each of these tri-diagonal linear system is defined with three vectors corresponding to its lower (`dl`), main (`d`), and upper (`du`) matrix diagonals; the right-hand sides are stored in the dense matrix `B`. Notice that solution `X` overwrites right-hand-side matrix `B` on exit.
5048    ///
5049    /// Assuming `A` is of size `m` and base-1, `dl`, `d` and `du` are defined by the following formula:
5050    ///
5051    /// `dl(i):= A(i, i-1)` for `i=1,2,...,m`
5052    ///
5053    /// The first element of dl is out-of-bound (`dl(1):= A(1,0)`), so `dl(1) = 0`.
5054    ///
5055    /// `d(i) = A(i,i)` for `i=1,2,...,m`
5056    ///
5057    /// `du(i) = A(i,i+1)` for `i=1,2,...,m`
5058    ///
5059    /// The last element of du is out-of-bound (`du(m):= A(m,m+1)`), so `du(m) = 0`.
5060    ///
5061    /// The routine does perform pivoting, which usually results in more accurate and more stable results than `cusparse&lt;t>gtsv_nopivot()` or `cusparse&lt;t>gtsv2_nopivot()` at the expense of some execution time.
5062    ///
5063    /// This function requires a buffer size returned by `gtsv2_bufferSizeExt()`. The address of `pBuffer` must be multiple of 128 bytes. If it is not, [`cusparseStatus_t::CUSPARSE_STATUS_INVALID_VALUE`] is returned.
5064    ///
5065    /// * The routine requires no extra storage.
5066    /// * The routine supports asynchronous execution.
5067    /// * The routine supports CUDA graph capture.
5068    pub fn cusparseSgtsv2(
5069        handle: cusparseHandle_t,
5070        m: ::core::ffi::c_int,
5071        n: ::core::ffi::c_int,
5072        dl: *const f32,
5073        d: *const f32,
5074        du: *const f32,
5075        B: *mut f32,
5076        ldb: ::core::ffi::c_int,
5077        pBuffer: *mut ::core::ffi::c_void,
5078    ) -> cusparseStatus_t;
5079}
5080unsafe extern "C" {
5081    /// This function computes the solution of a tridiagonal linear system with multiple right-hand sides:
5082    ///
5083    /// The coefficient matrix `A` of each of these tri-diagonal linear system is defined with three vectors corresponding to its lower (`dl`), main (`d`), and upper (`du`) matrix diagonals; the right-hand sides are stored in the dense matrix `B`. Notice that solution `X` overwrites right-hand-side matrix `B` on exit.
5084    ///
5085    /// Assuming `A` is of size `m` and base-1, `dl`, `d` and `du` are defined by the following formula:
5086    ///
5087    /// `dl(i):= A(i, i-1)` for `i=1,2,...,m`
5088    ///
5089    /// The first element of dl is out-of-bound (`dl(1):= A(1,0)`), so `dl(1) = 0`.
5090    ///
5091    /// `d(i) = A(i,i)` for `i=1,2,...,m`
5092    ///
5093    /// `du(i) = A(i,i+1)` for `i=1,2,...,m`
5094    ///
5095    /// The last element of du is out-of-bound (`du(m):= A(m,m+1)`), so `du(m) = 0`.
5096    ///
5097    /// The routine does perform pivoting, which usually results in more accurate and more stable results than `cusparse&lt;t>gtsv_nopivot()` or `cusparse&lt;t>gtsv2_nopivot()` at the expense of some execution time.
5098    ///
5099    /// This function requires a buffer size returned by `gtsv2_bufferSizeExt()`. The address of `pBuffer` must be multiple of 128 bytes. If it is not, [`cusparseStatus_t::CUSPARSE_STATUS_INVALID_VALUE`] is returned.
5100    ///
5101    /// * The routine requires no extra storage.
5102    /// * The routine supports asynchronous execution.
5103    /// * The routine supports CUDA graph capture.
5104    pub fn cusparseDgtsv2(
5105        handle: cusparseHandle_t,
5106        m: ::core::ffi::c_int,
5107        n: ::core::ffi::c_int,
5108        dl: *const f64,
5109        d: *const f64,
5110        du: *const f64,
5111        B: *mut f64,
5112        ldb: ::core::ffi::c_int,
5113        pBuffer: *mut ::core::ffi::c_void,
5114    ) -> cusparseStatus_t;
5115}
5116unsafe extern "C" {
5117    /// This function computes the solution of a tridiagonal linear system with multiple right-hand sides:
5118    ///
5119    /// The coefficient matrix `A` of each of these tri-diagonal linear system is defined with three vectors corresponding to its lower (`dl`), main (`d`), and upper (`du`) matrix diagonals; the right-hand sides are stored in the dense matrix `B`. Notice that solution `X` overwrites right-hand-side matrix `B` on exit.
5120    ///
5121    /// Assuming `A` is of size `m` and base-1, `dl`, `d` and `du` are defined by the following formula:
5122    ///
5123    /// `dl(i):= A(i, i-1)` for `i=1,2,...,m`
5124    ///
5125    /// The first element of dl is out-of-bound (`dl(1):= A(1,0)`), so `dl(1) = 0`.
5126    ///
5127    /// `d(i) = A(i,i)` for `i=1,2,...,m`
5128    ///
5129    /// `du(i) = A(i,i+1)` for `i=1,2,...,m`
5130    ///
5131    /// The last element of du is out-of-bound (`du(m):= A(m,m+1)`), so `du(m) = 0`.
5132    ///
5133    /// The routine does perform pivoting, which usually results in more accurate and more stable results than `cusparse&lt;t>gtsv_nopivot()` or `cusparse&lt;t>gtsv2_nopivot()` at the expense of some execution time.
5134    ///
5135    /// This function requires a buffer size returned by `gtsv2_bufferSizeExt()`. The address of `pBuffer` must be multiple of 128 bytes. If it is not, [`cusparseStatus_t::CUSPARSE_STATUS_INVALID_VALUE`] is returned.
5136    ///
5137    /// * The routine requires no extra storage.
5138    /// * The routine supports asynchronous execution.
5139    /// * The routine supports CUDA graph capture.
5140    pub fn cusparseCgtsv2(
5141        handle: cusparseHandle_t,
5142        m: ::core::ffi::c_int,
5143        n: ::core::ffi::c_int,
5144        dl: *const cuComplex,
5145        d: *const cuComplex,
5146        du: *const cuComplex,
5147        B: *mut cuComplex,
5148        ldb: ::core::ffi::c_int,
5149        pBuffer: *mut ::core::ffi::c_void,
5150    ) -> cusparseStatus_t;
5151}
5152unsafe extern "C" {
5153    /// This function computes the solution of a tridiagonal linear system with multiple right-hand sides:
5154    ///
5155    /// The coefficient matrix `A` of each of these tri-diagonal linear system is defined with three vectors corresponding to its lower (`dl`), main (`d`), and upper (`du`) matrix diagonals; the right-hand sides are stored in the dense matrix `B`. Notice that solution `X` overwrites right-hand-side matrix `B` on exit.
5156    ///
5157    /// Assuming `A` is of size `m` and base-1, `dl`, `d` and `du` are defined by the following formula:
5158    ///
5159    /// `dl(i):= A(i, i-1)` for `i=1,2,...,m`
5160    ///
5161    /// The first element of dl is out-of-bound (`dl(1):= A(1,0)`), so `dl(1) = 0`.
5162    ///
5163    /// `d(i) = A(i,i)` for `i=1,2,...,m`
5164    ///
5165    /// `du(i) = A(i,i+1)` for `i=1,2,...,m`
5166    ///
5167    /// The last element of du is out-of-bound (`du(m):= A(m,m+1)`), so `du(m) = 0`.
5168    ///
5169    /// The routine does perform pivoting, which usually results in more accurate and more stable results than `cusparse&lt;t>gtsv_nopivot()` or `cusparse&lt;t>gtsv2_nopivot()` at the expense of some execution time.
5170    ///
5171    /// This function requires a buffer size returned by `gtsv2_bufferSizeExt()`. The address of `pBuffer` must be multiple of 128 bytes. If it is not, [`cusparseStatus_t::CUSPARSE_STATUS_INVALID_VALUE`] is returned.
5172    ///
5173    /// * The routine requires no extra storage.
5174    /// * The routine supports asynchronous execution.
5175    /// * The routine supports CUDA graph capture.
5176    pub fn cusparseZgtsv2(
5177        handle: cusparseHandle_t,
5178        m: ::core::ffi::c_int,
5179        n: ::core::ffi::c_int,
5180        dl: *const cuDoubleComplex,
5181        d: *const cuDoubleComplex,
5182        du: *const cuDoubleComplex,
5183        B: *mut cuDoubleComplex,
5184        ldb: ::core::ffi::c_int,
5185        pBuffer: *mut ::core::ffi::c_void,
5186    ) -> cusparseStatus_t;
5187}
5188unsafe extern "C" {
5189    /// This function returns the size of the buffer used in `gtsv2_nopivot` which computes the solution of a tridiagonal linear system with multiple right-hand sides.
5190    ///
5191    /// The coefficient matrix `A` of each of these tri-diagonal linear system is defined with three vectors corresponding to its lower (`dl`), main (`d`), and upper (`du`) matrix diagonals; the right-hand sides are stored in the dense matrix `B`. Notice that solution `X` overwrites right-hand-side matrix `B` on exit.
5192    ///
5193    /// * The routine requires no extra storage.
5194    /// * The routine supports asynchronous execution.
5195    /// * The routine supports CUDA graph capture.
5196    pub fn cusparseSgtsv2_nopivot_bufferSizeExt(
5197        handle: cusparseHandle_t,
5198        m: ::core::ffi::c_int,
5199        n: ::core::ffi::c_int,
5200        dl: *const f32,
5201        d: *const f32,
5202        du: *const f32,
5203        B: *const f32,
5204        ldb: ::core::ffi::c_int,
5205        bufferSizeInBytes: *mut size_t,
5206    ) -> cusparseStatus_t;
5207}
5208unsafe extern "C" {
5209    /// This function returns the size of the buffer used in `gtsv2_nopivot` which computes the solution of a tridiagonal linear system with multiple right-hand sides.
5210    ///
5211    /// The coefficient matrix `A` of each of these tri-diagonal linear system is defined with three vectors corresponding to its lower (`dl`), main (`d`), and upper (`du`) matrix diagonals; the right-hand sides are stored in the dense matrix `B`. Notice that solution `X` overwrites right-hand-side matrix `B` on exit.
5212    ///
5213    /// * The routine requires no extra storage.
5214    /// * The routine supports asynchronous execution.
5215    /// * The routine supports CUDA graph capture.
5216    pub fn cusparseDgtsv2_nopivot_bufferSizeExt(
5217        handle: cusparseHandle_t,
5218        m: ::core::ffi::c_int,
5219        n: ::core::ffi::c_int,
5220        dl: *const f64,
5221        d: *const f64,
5222        du: *const f64,
5223        B: *const f64,
5224        ldb: ::core::ffi::c_int,
5225        bufferSizeInBytes: *mut size_t,
5226    ) -> cusparseStatus_t;
5227}
5228unsafe extern "C" {
5229    /// This function returns the size of the buffer used in `gtsv2_nopivot` which computes the solution of a tridiagonal linear system with multiple right-hand sides.
5230    ///
5231    /// The coefficient matrix `A` of each of these tri-diagonal linear system is defined with three vectors corresponding to its lower (`dl`), main (`d`), and upper (`du`) matrix diagonals; the right-hand sides are stored in the dense matrix `B`. Notice that solution `X` overwrites right-hand-side matrix `B` on exit.
5232    ///
5233    /// * The routine requires no extra storage.
5234    /// * The routine supports asynchronous execution.
5235    /// * The routine supports CUDA graph capture.
5236    pub fn cusparseCgtsv2_nopivot_bufferSizeExt(
5237        handle: cusparseHandle_t,
5238        m: ::core::ffi::c_int,
5239        n: ::core::ffi::c_int,
5240        dl: *const cuComplex,
5241        d: *const cuComplex,
5242        du: *const cuComplex,
5243        B: *const cuComplex,
5244        ldb: ::core::ffi::c_int,
5245        bufferSizeInBytes: *mut size_t,
5246    ) -> cusparseStatus_t;
5247}
5248unsafe extern "C" {
5249    /// This function returns the size of the buffer used in `gtsv2_nopivot` which computes the solution of a tridiagonal linear system with multiple right-hand sides.
5250    ///
5251    /// The coefficient matrix `A` of each of these tri-diagonal linear system is defined with three vectors corresponding to its lower (`dl`), main (`d`), and upper (`du`) matrix diagonals; the right-hand sides are stored in the dense matrix `B`. Notice that solution `X` overwrites right-hand-side matrix `B` on exit.
5252    ///
5253    /// * The routine requires no extra storage.
5254    /// * The routine supports asynchronous execution.
5255    /// * The routine supports CUDA graph capture.
5256    pub fn cusparseZgtsv2_nopivot_bufferSizeExt(
5257        handle: cusparseHandle_t,
5258        m: ::core::ffi::c_int,
5259        n: ::core::ffi::c_int,
5260        dl: *const cuDoubleComplex,
5261        d: *const cuDoubleComplex,
5262        du: *const cuDoubleComplex,
5263        B: *const cuDoubleComplex,
5264        ldb: ::core::ffi::c_int,
5265        bufferSizeInBytes: *mut size_t,
5266    ) -> cusparseStatus_t;
5267}
5268unsafe extern "C" {
5269    /// This function computes the solution of a tridiagonal linear system with multiple right-hand sides:
5270    ///
5271    /// The coefficient matrix `A` of each of these tri-diagonal linear system is defined with three vectors corresponding to its lower (`dl`), main (`d`), and upper (`du`) matrix diagonals; the right-hand sides are stored in the dense matrix `B`. Notice that solution `X` overwrites right-hand-side matrix `B` on exit.
5272    ///
5273    /// The routine does not perform any pivoting and uses a combination of the Cyclic Reduction (CR) and the Parallel Cyclic Reduction (PCR) algorithms to find the solution. It achieves better performance when `m` is a power of 2.
5274    ///
5275    /// This function requires a buffer size returned by `gtsv2_nopivot_bufferSizeExt()`. The address of `pBuffer` must be multiple of 128 bytes. If it is not, [`cusparseStatus_t::CUSPARSE_STATUS_INVALID_VALUE`] is returned.
5276    ///
5277    /// * The routine requires no extra storage.
5278    /// * The routine supports asynchronous execution.
5279    /// * The routine supports CUDA graph capture.
5280    pub fn cusparseSgtsv2_nopivot(
5281        handle: cusparseHandle_t,
5282        m: ::core::ffi::c_int,
5283        n: ::core::ffi::c_int,
5284        dl: *const f32,
5285        d: *const f32,
5286        du: *const f32,
5287        B: *mut f32,
5288        ldb: ::core::ffi::c_int,
5289        pBuffer: *mut ::core::ffi::c_void,
5290    ) -> cusparseStatus_t;
5291}
5292unsafe extern "C" {
5293    /// This function computes the solution of a tridiagonal linear system with multiple right-hand sides:
5294    ///
5295    /// The coefficient matrix `A` of each of these tri-diagonal linear system is defined with three vectors corresponding to its lower (`dl`), main (`d`), and upper (`du`) matrix diagonals; the right-hand sides are stored in the dense matrix `B`. Notice that solution `X` overwrites right-hand-side matrix `B` on exit.
5296    ///
5297    /// The routine does not perform any pivoting and uses a combination of the Cyclic Reduction (CR) and the Parallel Cyclic Reduction (PCR) algorithms to find the solution. It achieves better performance when `m` is a power of 2.
5298    ///
5299    /// This function requires a buffer size returned by `gtsv2_nopivot_bufferSizeExt()`. The address of `pBuffer` must be multiple of 128 bytes. If it is not, [`cusparseStatus_t::CUSPARSE_STATUS_INVALID_VALUE`] is returned.
5300    ///
5301    /// * The routine requires no extra storage.
5302    /// * The routine supports asynchronous execution.
5303    /// * The routine supports CUDA graph capture.
5304    pub fn cusparseDgtsv2_nopivot(
5305        handle: cusparseHandle_t,
5306        m: ::core::ffi::c_int,
5307        n: ::core::ffi::c_int,
5308        dl: *const f64,
5309        d: *const f64,
5310        du: *const f64,
5311        B: *mut f64,
5312        ldb: ::core::ffi::c_int,
5313        pBuffer: *mut ::core::ffi::c_void,
5314    ) -> cusparseStatus_t;
5315}
5316unsafe extern "C" {
5317    /// This function computes the solution of a tridiagonal linear system with multiple right-hand sides:
5318    ///
5319    /// The coefficient matrix `A` of each of these tri-diagonal linear system is defined with three vectors corresponding to its lower (`dl`), main (`d`), and upper (`du`) matrix diagonals; the right-hand sides are stored in the dense matrix `B`. Notice that solution `X` overwrites right-hand-side matrix `B` on exit.
5320    ///
5321    /// The routine does not perform any pivoting and uses a combination of the Cyclic Reduction (CR) and the Parallel Cyclic Reduction (PCR) algorithms to find the solution. It achieves better performance when `m` is a power of 2.
5322    ///
5323    /// This function requires a buffer size returned by `gtsv2_nopivot_bufferSizeExt()`. The address of `pBuffer` must be multiple of 128 bytes. If it is not, [`cusparseStatus_t::CUSPARSE_STATUS_INVALID_VALUE`] is returned.
5324    ///
5325    /// * The routine requires no extra storage.
5326    /// * The routine supports asynchronous execution.
5327    /// * The routine supports CUDA graph capture.
5328    pub fn cusparseCgtsv2_nopivot(
5329        handle: cusparseHandle_t,
5330        m: ::core::ffi::c_int,
5331        n: ::core::ffi::c_int,
5332        dl: *const cuComplex,
5333        d: *const cuComplex,
5334        du: *const cuComplex,
5335        B: *mut cuComplex,
5336        ldb: ::core::ffi::c_int,
5337        pBuffer: *mut ::core::ffi::c_void,
5338    ) -> cusparseStatus_t;
5339}
5340unsafe extern "C" {
5341    /// This function computes the solution of a tridiagonal linear system with multiple right-hand sides:
5342    ///
5343    /// The coefficient matrix `A` of each of these tri-diagonal linear system is defined with three vectors corresponding to its lower (`dl`), main (`d`), and upper (`du`) matrix diagonals; the right-hand sides are stored in the dense matrix `B`. Notice that solution `X` overwrites right-hand-side matrix `B` on exit.
5344    ///
5345    /// The routine does not perform any pivoting and uses a combination of the Cyclic Reduction (CR) and the Parallel Cyclic Reduction (PCR) algorithms to find the solution. It achieves better performance when `m` is a power of 2.
5346    ///
5347    /// This function requires a buffer size returned by `gtsv2_nopivot_bufferSizeExt()`. The address of `pBuffer` must be multiple of 128 bytes. If it is not, [`cusparseStatus_t::CUSPARSE_STATUS_INVALID_VALUE`] is returned.
5348    ///
5349    /// * The routine requires no extra storage.
5350    /// * The routine supports asynchronous execution.
5351    /// * The routine supports CUDA graph capture.
5352    pub fn cusparseZgtsv2_nopivot(
5353        handle: cusparseHandle_t,
5354        m: ::core::ffi::c_int,
5355        n: ::core::ffi::c_int,
5356        dl: *const cuDoubleComplex,
5357        d: *const cuDoubleComplex,
5358        du: *const cuDoubleComplex,
5359        B: *mut cuDoubleComplex,
5360        ldb: ::core::ffi::c_int,
5361        pBuffer: *mut ::core::ffi::c_void,
5362    ) -> cusparseStatus_t;
5363}
5364unsafe extern "C" {
5365    /// This function returns the size of the buffer used in `gtsv2StridedBatch` which computes the solution of multiple tridiagonal linear systems for *i*=0,…,`batchCount`:
5366    ///
5367    /// The coefficient matrix `A` of each of these tri-diagonal linear system is defined with three vectors corresponding to its lower (`dl`), main (`d`), and upper (`du`) matrix diagonals; the right-hand sides are stored in the dense matrix `X`. Notice that solution `Y` overwrites right-hand-side matrix `X` on exit. The different matrices are assumed to be of the same size and are stored with a fixed `batchStride` in memory.
5368    ///
5369    /// * The routine requires no extra storage.
5370    /// * The routine supports asynchronous execution.
5371    /// * The routine supports CUDA graph capture.
5372    pub fn cusparseSgtsv2StridedBatch_bufferSizeExt(
5373        handle: cusparseHandle_t,
5374        m: ::core::ffi::c_int,
5375        dl: *const f32,
5376        d: *const f32,
5377        du: *const f32,
5378        x: *const f32,
5379        batchCount: ::core::ffi::c_int,
5380        batchStride: ::core::ffi::c_int,
5381        bufferSizeInBytes: *mut size_t,
5382    ) -> cusparseStatus_t;
5383}
5384unsafe extern "C" {
5385    /// This function returns the size of the buffer used in `gtsv2StridedBatch` which computes the solution of multiple tridiagonal linear systems for *i*=0,…,`batchCount`:
5386    ///
5387    /// The coefficient matrix `A` of each of these tri-diagonal linear system is defined with three vectors corresponding to its lower (`dl`), main (`d`), and upper (`du`) matrix diagonals; the right-hand sides are stored in the dense matrix `X`. Notice that solution `Y` overwrites right-hand-side matrix `X` on exit. The different matrices are assumed to be of the same size and are stored with a fixed `batchStride` in memory.
5388    ///
5389    /// * The routine requires no extra storage.
5390    /// * The routine supports asynchronous execution.
5391    /// * The routine supports CUDA graph capture.
5392    pub fn cusparseDgtsv2StridedBatch_bufferSizeExt(
5393        handle: cusparseHandle_t,
5394        m: ::core::ffi::c_int,
5395        dl: *const f64,
5396        d: *const f64,
5397        du: *const f64,
5398        x: *const f64,
5399        batchCount: ::core::ffi::c_int,
5400        batchStride: ::core::ffi::c_int,
5401        bufferSizeInBytes: *mut size_t,
5402    ) -> cusparseStatus_t;
5403}
5404unsafe extern "C" {
5405    /// This function returns the size of the buffer used in `gtsv2StridedBatch` which computes the solution of multiple tridiagonal linear systems for *i*=0,…,`batchCount`:
5406    ///
5407    /// The coefficient matrix `A` of each of these tri-diagonal linear system is defined with three vectors corresponding to its lower (`dl`), main (`d`), and upper (`du`) matrix diagonals; the right-hand sides are stored in the dense matrix `X`. Notice that solution `Y` overwrites right-hand-side matrix `X` on exit. The different matrices are assumed to be of the same size and are stored with a fixed `batchStride` in memory.
5408    ///
5409    /// * The routine requires no extra storage.
5410    /// * The routine supports asynchronous execution.
5411    /// * The routine supports CUDA graph capture.
5412    pub fn cusparseCgtsv2StridedBatch_bufferSizeExt(
5413        handle: cusparseHandle_t,
5414        m: ::core::ffi::c_int,
5415        dl: *const cuComplex,
5416        d: *const cuComplex,
5417        du: *const cuComplex,
5418        x: *const cuComplex,
5419        batchCount: ::core::ffi::c_int,
5420        batchStride: ::core::ffi::c_int,
5421        bufferSizeInBytes: *mut size_t,
5422    ) -> cusparseStatus_t;
5423}
5424unsafe extern "C" {
5425    /// This function returns the size of the buffer used in `gtsv2StridedBatch` which computes the solution of multiple tridiagonal linear systems for *i*=0,…,`batchCount`:
5426    ///
5427    /// The coefficient matrix `A` of each of these tri-diagonal linear system is defined with three vectors corresponding to its lower (`dl`), main (`d`), and upper (`du`) matrix diagonals; the right-hand sides are stored in the dense matrix `X`. Notice that solution `Y` overwrites right-hand-side matrix `X` on exit. The different matrices are assumed to be of the same size and are stored with a fixed `batchStride` in memory.
5428    ///
5429    /// * The routine requires no extra storage.
5430    /// * The routine supports asynchronous execution.
5431    /// * The routine supports CUDA graph capture.
5432    pub fn cusparseZgtsv2StridedBatch_bufferSizeExt(
5433        handle: cusparseHandle_t,
5434        m: ::core::ffi::c_int,
5435        dl: *const cuDoubleComplex,
5436        d: *const cuDoubleComplex,
5437        du: *const cuDoubleComplex,
5438        x: *const cuDoubleComplex,
5439        batchCount: ::core::ffi::c_int,
5440        batchStride: ::core::ffi::c_int,
5441        bufferSizeInBytes: *mut size_t,
5442    ) -> cusparseStatus_t;
5443}
5444unsafe extern "C" {
5445    /// This function computes the solution of multiple tridiagonal linear systems for *i*=0,…,`batchCount`:
5446    ///
5447    /// The coefficient matrix `A` of each of these tri-diagonal linear system is defined with three vectors corresponding to its lower (`dl`), main (`d`), and upper (`du`) matrix diagonals; the right-hand sides are stored in the dense matrix `X`. Notice that solution `Y` overwrites right-hand-side matrix `X` on exit. The different matrices are assumed to be of the same size and are stored with a fixed `batchStride` in memory.
5448    ///
5449    /// The routine does not perform any pivoting and uses a combination of the Cyclic Reduction (CR) and the Parallel Cyclic Reduction (PCR) algorithms to find the solution. It achieves better performance when `m` is a power of 2.
5450    ///
5451    /// This function requires a buffer size returned by `gtsv2StridedBatch_bufferSizeExt()`. The address of `pBuffer` must be multiple of 128 bytes. If it is not, [`cusparseStatus_t::CUSPARSE_STATUS_INVALID_VALUE`] is returned.
5452    ///
5453    /// * The routine requires no extra storage.
5454    /// * The routine supports asynchronous execution.
5455    /// * The routine supports CUDA graph capture.
5456    pub fn cusparseSgtsv2StridedBatch(
5457        handle: cusparseHandle_t,
5458        m: ::core::ffi::c_int,
5459        dl: *const f32,
5460        d: *const f32,
5461        du: *const f32,
5462        x: *mut f32,
5463        batchCount: ::core::ffi::c_int,
5464        batchStride: ::core::ffi::c_int,
5465        pBuffer: *mut ::core::ffi::c_void,
5466    ) -> cusparseStatus_t;
5467}
5468unsafe extern "C" {
5469    /// This function computes the solution of multiple tridiagonal linear systems for *i*=0,…,`batchCount`:
5470    ///
5471    /// The coefficient matrix `A` of each of these tri-diagonal linear system is defined with three vectors corresponding to its lower (`dl`), main (`d`), and upper (`du`) matrix diagonals; the right-hand sides are stored in the dense matrix `X`. Notice that solution `Y` overwrites right-hand-side matrix `X` on exit. The different matrices are assumed to be of the same size and are stored with a fixed `batchStride` in memory.
5472    ///
5473    /// The routine does not perform any pivoting and uses a combination of the Cyclic Reduction (CR) and the Parallel Cyclic Reduction (PCR) algorithms to find the solution. It achieves better performance when `m` is a power of 2.
5474    ///
5475    /// This function requires a buffer size returned by `gtsv2StridedBatch_bufferSizeExt()`. The address of `pBuffer` must be multiple of 128 bytes. If it is not, [`cusparseStatus_t::CUSPARSE_STATUS_INVALID_VALUE`] is returned.
5476    ///
5477    /// * The routine requires no extra storage.
5478    /// * The routine supports asynchronous execution.
5479    /// * The routine supports CUDA graph capture.
5480    pub fn cusparseDgtsv2StridedBatch(
5481        handle: cusparseHandle_t,
5482        m: ::core::ffi::c_int,
5483        dl: *const f64,
5484        d: *const f64,
5485        du: *const f64,
5486        x: *mut f64,
5487        batchCount: ::core::ffi::c_int,
5488        batchStride: ::core::ffi::c_int,
5489        pBuffer: *mut ::core::ffi::c_void,
5490    ) -> cusparseStatus_t;
5491}
5492unsafe extern "C" {
5493    /// This function computes the solution of multiple tridiagonal linear systems for *i*=0,…,`batchCount`:
5494    ///
5495    /// The coefficient matrix `A` of each of these tri-diagonal linear system is defined with three vectors corresponding to its lower (`dl`), main (`d`), and upper (`du`) matrix diagonals; the right-hand sides are stored in the dense matrix `X`. Notice that solution `Y` overwrites right-hand-side matrix `X` on exit. The different matrices are assumed to be of the same size and are stored with a fixed `batchStride` in memory.
5496    ///
5497    /// The routine does not perform any pivoting and uses a combination of the Cyclic Reduction (CR) and the Parallel Cyclic Reduction (PCR) algorithms to find the solution. It achieves better performance when `m` is a power of 2.
5498    ///
5499    /// This function requires a buffer size returned by `gtsv2StridedBatch_bufferSizeExt()`. The address of `pBuffer` must be multiple of 128 bytes. If it is not, [`cusparseStatus_t::CUSPARSE_STATUS_INVALID_VALUE`] is returned.
5500    ///
5501    /// * The routine requires no extra storage.
5502    /// * The routine supports asynchronous execution.
5503    /// * The routine supports CUDA graph capture.
5504    pub fn cusparseCgtsv2StridedBatch(
5505        handle: cusparseHandle_t,
5506        m: ::core::ffi::c_int,
5507        dl: *const cuComplex,
5508        d: *const cuComplex,
5509        du: *const cuComplex,
5510        x: *mut cuComplex,
5511        batchCount: ::core::ffi::c_int,
5512        batchStride: ::core::ffi::c_int,
5513        pBuffer: *mut ::core::ffi::c_void,
5514    ) -> cusparseStatus_t;
5515}
5516unsafe extern "C" {
5517    /// This function computes the solution of multiple tridiagonal linear systems for *i*=0,…,`batchCount`:
5518    ///
5519    /// The coefficient matrix `A` of each of these tri-diagonal linear system is defined with three vectors corresponding to its lower (`dl`), main (`d`), and upper (`du`) matrix diagonals; the right-hand sides are stored in the dense matrix `X`. Notice that solution `Y` overwrites right-hand-side matrix `X` on exit. The different matrices are assumed to be of the same size and are stored with a fixed `batchStride` in memory.
5520    ///
5521    /// The routine does not perform any pivoting and uses a combination of the Cyclic Reduction (CR) and the Parallel Cyclic Reduction (PCR) algorithms to find the solution. It achieves better performance when `m` is a power of 2.
5522    ///
5523    /// This function requires a buffer size returned by `gtsv2StridedBatch_bufferSizeExt()`. The address of `pBuffer` must be multiple of 128 bytes. If it is not, [`cusparseStatus_t::CUSPARSE_STATUS_INVALID_VALUE`] is returned.
5524    ///
5525    /// * The routine requires no extra storage.
5526    /// * The routine supports asynchronous execution.
5527    /// * The routine supports CUDA graph capture.
5528    pub fn cusparseZgtsv2StridedBatch(
5529        handle: cusparseHandle_t,
5530        m: ::core::ffi::c_int,
5531        dl: *const cuDoubleComplex,
5532        d: *const cuDoubleComplex,
5533        du: *const cuDoubleComplex,
5534        x: *mut cuDoubleComplex,
5535        batchCount: ::core::ffi::c_int,
5536        batchStride: ::core::ffi::c_int,
5537        pBuffer: *mut ::core::ffi::c_void,
5538    ) -> cusparseStatus_t;
5539}
5540unsafe extern "C" {
5541    pub fn cusparseSgtsvInterleavedBatch_bufferSizeExt(
5542        handle: cusparseHandle_t,
5543        algo: ::core::ffi::c_int,
5544        m: ::core::ffi::c_int,
5545        dl: *const f32,
5546        d: *const f32,
5547        du: *const f32,
5548        x: *const f32,
5549        batchCount: ::core::ffi::c_int,
5550        pBufferSizeInBytes: *mut size_t,
5551    ) -> cusparseStatus_t;
5552}
5553unsafe extern "C" {
5554    pub fn cusparseDgtsvInterleavedBatch_bufferSizeExt(
5555        handle: cusparseHandle_t,
5556        algo: ::core::ffi::c_int,
5557        m: ::core::ffi::c_int,
5558        dl: *const f64,
5559        d: *const f64,
5560        du: *const f64,
5561        x: *const f64,
5562        batchCount: ::core::ffi::c_int,
5563        pBufferSizeInBytes: *mut size_t,
5564    ) -> cusparseStatus_t;
5565}
5566unsafe extern "C" {
5567    pub fn cusparseCgtsvInterleavedBatch_bufferSizeExt(
5568        handle: cusparseHandle_t,
5569        algo: ::core::ffi::c_int,
5570        m: ::core::ffi::c_int,
5571        dl: *const cuComplex,
5572        d: *const cuComplex,
5573        du: *const cuComplex,
5574        x: *const cuComplex,
5575        batchCount: ::core::ffi::c_int,
5576        pBufferSizeInBytes: *mut size_t,
5577    ) -> cusparseStatus_t;
5578}
5579unsafe extern "C" {
5580    pub fn cusparseZgtsvInterleavedBatch_bufferSizeExt(
5581        handle: cusparseHandle_t,
5582        algo: ::core::ffi::c_int,
5583        m: ::core::ffi::c_int,
5584        dl: *const cuDoubleComplex,
5585        d: *const cuDoubleComplex,
5586        du: *const cuDoubleComplex,
5587        x: *const cuDoubleComplex,
5588        batchCount: ::core::ffi::c_int,
5589        pBufferSizeInBytes: *mut size_t,
5590    ) -> cusparseStatus_t;
5591}
5592unsafe extern "C" {
5593    /// This function computes the solution of multiple tridiagonal linear systems for *i*=0,…,`batchCount`:
5594    ///
5595    /// The coefficient matrix `A` of each of these tri-diagonal linear system is defined with three vectors corresponding to its lower (`dl`), main (`d`), and upper (`du`) matrix diagonals; the right-hand sides are stored in the dense matrix `B`. Notice that solution `X` overwrites right-hand-side matrix `B` on exit.
5596    ///
5597    /// Assuming `A` is of size `m` and base-1, `dl`, `d` and `du` are defined by the following formula:
5598    ///
5599    /// `dl(i):= A(i, i-1)` for `i=1,2,...,m`
5600    ///
5601    /// The first element of dl is out-of-bound (`dl(1):= A(1,0)`), so `dl(1) = 0`.
5602    ///
5603    /// `d(i) = A(i,i)` for `i=1,2,...,m`
5604    ///
5605    /// `du(i) = A(i,i+1)` for `i=1,2,...,m`
5606    ///
5607    /// The last element of du is out-of-bound (`du(m):= A(m,m+1)`), so `du(m) = 0`.
5608    ///
5609    /// The data layout is different from `gtsvStridedBatch` which aggregates all matrices one after another. Instead, `gtsvInterleavedBatch` gathers different matrices of the same element in a continuous manner. If `dl` is regarded as a 2-D array of size `m-by-batchCount`, `dl(:,j)` to store `j-th` matrix. `gtsvStridedBatch` uses column-major while `gtsvInterleavedBatch` uses row-major.
5610    ///
5611    /// The routine provides three different algorithms, selected by parameter `algo`. The first algorithm is `cuThomas` provided by `Barcelona Supercomputing Center`. The second algorithm is LU with partial pivoting and last algorithm is QR. From stability perspective, cuThomas is not numerically stable because it does not have pivoting. LU with partial pivoting and QR are stable. From performance perspective, LU with partial pivoting and QR is about 10% to 20% slower than cuThomas.
5612    ///
5613    /// This function requires a buffer size returned by `gtsvInterleavedBatch_bufferSizeExt()`. The address of `pBuffer` must be multiple of 128 bytes. If it is not, [`cusparseStatus_t::CUSPARSE_STATUS_INVALID_VALUE`] is returned.
5614    ///
5615    /// If the user prepares aggregate format, one can use `cublasXgeam` to get interleaved format. However such transformation takes time comparable to solver itself. To reach best performance, the user must prepare interleaved format explicitly.
5616    ///
5617    /// * This function requires temporary extra storage that is allocated internally.
5618    /// * The routine supports asynchronous execution if the Stream Ordered Memory Allocator is available.
5619    /// * The routine supports CUDA graph capture if the Stream Ordered Memory Allocator is available.
5620    pub fn cusparseSgtsvInterleavedBatch(
5621        handle: cusparseHandle_t,
5622        algo: ::core::ffi::c_int,
5623        m: ::core::ffi::c_int,
5624        dl: *mut f32,
5625        d: *mut f32,
5626        du: *mut f32,
5627        x: *mut f32,
5628        batchCount: ::core::ffi::c_int,
5629        pBuffer: *mut ::core::ffi::c_void,
5630    ) -> cusparseStatus_t;
5631}
5632unsafe extern "C" {
5633    /// This function computes the solution of multiple tridiagonal linear systems for *i*=0,…,`batchCount`:
5634    ///
5635    /// The coefficient matrix `A` of each of these tri-diagonal linear system is defined with three vectors corresponding to its lower (`dl`), main (`d`), and upper (`du`) matrix diagonals; the right-hand sides are stored in the dense matrix `B`. Notice that solution `X` overwrites right-hand-side matrix `B` on exit.
5636    ///
5637    /// Assuming `A` is of size `m` and base-1, `dl`, `d` and `du` are defined by the following formula:
5638    ///
5639    /// `dl(i):= A(i, i-1)` for `i=1,2,...,m`
5640    ///
5641    /// The first element of dl is out-of-bound (`dl(1):= A(1,0)`), so `dl(1) = 0`.
5642    ///
5643    /// `d(i) = A(i,i)` for `i=1,2,...,m`
5644    ///
5645    /// `du(i) = A(i,i+1)` for `i=1,2,...,m`
5646    ///
5647    /// The last element of du is out-of-bound (`du(m):= A(m,m+1)`), so `du(m) = 0`.
5648    ///
5649    /// The data layout is different from `gtsvStridedBatch` which aggregates all matrices one after another. Instead, `gtsvInterleavedBatch` gathers different matrices of the same element in a continuous manner. If `dl` is regarded as a 2-D array of size `m-by-batchCount`, `dl(:,j)` to store `j-th` matrix. `gtsvStridedBatch` uses column-major while `gtsvInterleavedBatch` uses row-major.
5650    ///
5651    /// The routine provides three different algorithms, selected by parameter `algo`. The first algorithm is `cuThomas` provided by `Barcelona Supercomputing Center`. The second algorithm is LU with partial pivoting and last algorithm is QR. From stability perspective, cuThomas is not numerically stable because it does not have pivoting. LU with partial pivoting and QR are stable. From performance perspective, LU with partial pivoting and QR is about 10% to 20% slower than cuThomas.
5652    ///
5653    /// This function requires a buffer size returned by `gtsvInterleavedBatch_bufferSizeExt()`. The address of `pBuffer` must be multiple of 128 bytes. If it is not, [`cusparseStatus_t::CUSPARSE_STATUS_INVALID_VALUE`] is returned.
5654    ///
5655    /// If the user prepares aggregate format, one can use `cublasXgeam` to get interleaved format. However such transformation takes time comparable to solver itself. To reach best performance, the user must prepare interleaved format explicitly.
5656    ///
5657    /// * This function requires temporary extra storage that is allocated internally.
5658    /// * The routine supports asynchronous execution if the Stream Ordered Memory Allocator is available.
5659    /// * The routine supports CUDA graph capture if the Stream Ordered Memory Allocator is available.
5660    pub fn cusparseDgtsvInterleavedBatch(
5661        handle: cusparseHandle_t,
5662        algo: ::core::ffi::c_int,
5663        m: ::core::ffi::c_int,
5664        dl: *mut f64,
5665        d: *mut f64,
5666        du: *mut f64,
5667        x: *mut f64,
5668        batchCount: ::core::ffi::c_int,
5669        pBuffer: *mut ::core::ffi::c_void,
5670    ) -> cusparseStatus_t;
5671}
5672unsafe extern "C" {
5673    /// This function computes the solution of multiple tridiagonal linear systems for *i*=0,…,`batchCount`:
5674    ///
5675    /// The coefficient matrix `A` of each of these tri-diagonal linear system is defined with three vectors corresponding to its lower (`dl`), main (`d`), and upper (`du`) matrix diagonals; the right-hand sides are stored in the dense matrix `B`. Notice that solution `X` overwrites right-hand-side matrix `B` on exit.
5676    ///
5677    /// Assuming `A` is of size `m` and base-1, `dl`, `d` and `du` are defined by the following formula:
5678    ///
5679    /// `dl(i):= A(i, i-1)` for `i=1,2,...,m`
5680    ///
5681    /// The first element of dl is out-of-bound (`dl(1):= A(1,0)`), so `dl(1) = 0`.
5682    ///
5683    /// `d(i) = A(i,i)` for `i=1,2,...,m`
5684    ///
5685    /// `du(i) = A(i,i+1)` for `i=1,2,...,m`
5686    ///
5687    /// The last element of du is out-of-bound (`du(m):= A(m,m+1)`), so `du(m) = 0`.
5688    ///
5689    /// The data layout is different from `gtsvStridedBatch` which aggregates all matrices one after another. Instead, `gtsvInterleavedBatch` gathers different matrices of the same element in a continuous manner. If `dl` is regarded as a 2-D array of size `m-by-batchCount`, `dl(:,j)` to store `j-th` matrix. `gtsvStridedBatch` uses column-major while `gtsvInterleavedBatch` uses row-major.
5690    ///
5691    /// The routine provides three different algorithms, selected by parameter `algo`. The first algorithm is `cuThomas` provided by `Barcelona Supercomputing Center`. The second algorithm is LU with partial pivoting and last algorithm is QR. From stability perspective, cuThomas is not numerically stable because it does not have pivoting. LU with partial pivoting and QR are stable. From performance perspective, LU with partial pivoting and QR is about 10% to 20% slower than cuThomas.
5692    ///
5693    /// This function requires a buffer size returned by `gtsvInterleavedBatch_bufferSizeExt()`. The address of `pBuffer` must be multiple of 128 bytes. If it is not, [`cusparseStatus_t::CUSPARSE_STATUS_INVALID_VALUE`] is returned.
5694    ///
5695    /// If the user prepares aggregate format, one can use `cublasXgeam` to get interleaved format. However such transformation takes time comparable to solver itself. To reach best performance, the user must prepare interleaved format explicitly.
5696    ///
5697    /// * This function requires temporary extra storage that is allocated internally.
5698    /// * The routine supports asynchronous execution if the Stream Ordered Memory Allocator is available.
5699    /// * The routine supports CUDA graph capture if the Stream Ordered Memory Allocator is available.
5700    pub fn cusparseCgtsvInterleavedBatch(
5701        handle: cusparseHandle_t,
5702        algo: ::core::ffi::c_int,
5703        m: ::core::ffi::c_int,
5704        dl: *mut cuComplex,
5705        d: *mut cuComplex,
5706        du: *mut cuComplex,
5707        x: *mut cuComplex,
5708        batchCount: ::core::ffi::c_int,
5709        pBuffer: *mut ::core::ffi::c_void,
5710    ) -> cusparseStatus_t;
5711}
5712unsafe extern "C" {
5713    /// This function computes the solution of multiple tridiagonal linear systems for *i*=0,…,`batchCount`:
5714    ///
5715    /// The coefficient matrix `A` of each of these tri-diagonal linear system is defined with three vectors corresponding to its lower (`dl`), main (`d`), and upper (`du`) matrix diagonals; the right-hand sides are stored in the dense matrix `B`. Notice that solution `X` overwrites right-hand-side matrix `B` on exit.
5716    ///
5717    /// Assuming `A` is of size `m` and base-1, `dl`, `d` and `du` are defined by the following formula:
5718    ///
5719    /// `dl(i):= A(i, i-1)` for `i=1,2,...,m`
5720    ///
5721    /// The first element of dl is out-of-bound (`dl(1):= A(1,0)`), so `dl(1) = 0`.
5722    ///
5723    /// `d(i) = A(i,i)` for `i=1,2,...,m`
5724    ///
5725    /// `du(i) = A(i,i+1)` for `i=1,2,...,m`
5726    ///
5727    /// The last element of du is out-of-bound (`du(m):= A(m,m+1)`), so `du(m) = 0`.
5728    ///
5729    /// The data layout is different from `gtsvStridedBatch` which aggregates all matrices one after another. Instead, `gtsvInterleavedBatch` gathers different matrices of the same element in a continuous manner. If `dl` is regarded as a 2-D array of size `m-by-batchCount`, `dl(:,j)` to store `j-th` matrix. `gtsvStridedBatch` uses column-major while `gtsvInterleavedBatch` uses row-major.
5730    ///
5731    /// The routine provides three different algorithms, selected by parameter `algo`. The first algorithm is `cuThomas` provided by `Barcelona Supercomputing Center`. The second algorithm is LU with partial pivoting and last algorithm is QR. From stability perspective, cuThomas is not numerically stable because it does not have pivoting. LU with partial pivoting and QR are stable. From performance perspective, LU with partial pivoting and QR is about 10% to 20% slower than cuThomas.
5732    ///
5733    /// This function requires a buffer size returned by `gtsvInterleavedBatch_bufferSizeExt()`. The address of `pBuffer` must be multiple of 128 bytes. If it is not, [`cusparseStatus_t::CUSPARSE_STATUS_INVALID_VALUE`] is returned.
5734    ///
5735    /// If the user prepares aggregate format, one can use `cublasXgeam` to get interleaved format. However such transformation takes time comparable to solver itself. To reach best performance, the user must prepare interleaved format explicitly.
5736    ///
5737    /// * This function requires temporary extra storage that is allocated internally.
5738    /// * The routine supports asynchronous execution if the Stream Ordered Memory Allocator is available.
5739    /// * The routine supports CUDA graph capture if the Stream Ordered Memory Allocator is available.
5740    pub fn cusparseZgtsvInterleavedBatch(
5741        handle: cusparseHandle_t,
5742        algo: ::core::ffi::c_int,
5743        m: ::core::ffi::c_int,
5744        dl: *mut cuDoubleComplex,
5745        d: *mut cuDoubleComplex,
5746        du: *mut cuDoubleComplex,
5747        x: *mut cuDoubleComplex,
5748        batchCount: ::core::ffi::c_int,
5749        pBuffer: *mut ::core::ffi::c_void,
5750    ) -> cusparseStatus_t;
5751}
5752unsafe extern "C" {
5753    pub fn cusparseSgpsvInterleavedBatch_bufferSizeExt(
5754        handle: cusparseHandle_t,
5755        algo: ::core::ffi::c_int,
5756        m: ::core::ffi::c_int,
5757        ds: *const f32,
5758        dl: *const f32,
5759        d: *const f32,
5760        du: *const f32,
5761        dw: *const f32,
5762        x: *const f32,
5763        batchCount: ::core::ffi::c_int,
5764        pBufferSizeInBytes: *mut size_t,
5765    ) -> cusparseStatus_t;
5766}
5767unsafe extern "C" {
5768    pub fn cusparseDgpsvInterleavedBatch_bufferSizeExt(
5769        handle: cusparseHandle_t,
5770        algo: ::core::ffi::c_int,
5771        m: ::core::ffi::c_int,
5772        ds: *const f64,
5773        dl: *const f64,
5774        d: *const f64,
5775        du: *const f64,
5776        dw: *const f64,
5777        x: *const f64,
5778        batchCount: ::core::ffi::c_int,
5779        pBufferSizeInBytes: *mut size_t,
5780    ) -> cusparseStatus_t;
5781}
5782unsafe extern "C" {
5783    pub fn cusparseCgpsvInterleavedBatch_bufferSizeExt(
5784        handle: cusparseHandle_t,
5785        algo: ::core::ffi::c_int,
5786        m: ::core::ffi::c_int,
5787        ds: *const cuComplex,
5788        dl: *const cuComplex,
5789        d: *const cuComplex,
5790        du: *const cuComplex,
5791        dw: *const cuComplex,
5792        x: *const cuComplex,
5793        batchCount: ::core::ffi::c_int,
5794        pBufferSizeInBytes: *mut size_t,
5795    ) -> cusparseStatus_t;
5796}
5797unsafe extern "C" {
5798    pub fn cusparseZgpsvInterleavedBatch_bufferSizeExt(
5799        handle: cusparseHandle_t,
5800        algo: ::core::ffi::c_int,
5801        m: ::core::ffi::c_int,
5802        ds: *const cuDoubleComplex,
5803        dl: *const cuDoubleComplex,
5804        d: *const cuDoubleComplex,
5805        du: *const cuDoubleComplex,
5806        dw: *const cuDoubleComplex,
5807        x: *const cuDoubleComplex,
5808        batchCount: ::core::ffi::c_int,
5809        pBufferSizeInBytes: *mut size_t,
5810    ) -> cusparseStatus_t;
5811}
5812unsafe extern "C" {
5813    /// This function computes the solution of multiple penta-diagonal linear systems for *i*=0,…,`batchCount`:
5814    ///
5815    /// The coefficient matrix `A` of each of these penta-diagonal linear system is defined with five vectors corresponding to its lower (`ds, dl`), main (`d`), and upper (`du, dw`) matrix diagonals; the right-hand sides are stored in the dense matrix `B`. Notice that solution `X` overwrites right-hand-side matrix `B` on exit.
5816    ///
5817    /// Assuming `A` is of size `m` and base-1, `ds`, `dl`, `d`, `du` and `dw` are defined by the following formula:
5818    ///
5819    /// `ds(i):= A(i, i-2)` for `i=1,2,...,m`
5820    ///
5821    /// The first two elements of ds is out-of-bound (`ds(1):= A(1,-1)`, `ds(2):= A(2,0)`), so `ds(1) = 0` and `ds(2) = 0`.
5822    ///
5823    /// `dl(i):= A(i, i-1)` for `i=1,2,...,m`
5824    ///
5825    /// The first element of dl is out-of-bound (`dl(1):= A(1,0)`), so `dl(1) = 0`.
5826    ///
5827    /// `d(i) = A(i,i)` for `i=1,2,...,m`
5828    ///
5829    /// `du(i) = A(i,i+1)` for `i=1,2,...,m`
5830    ///
5831    /// The last element of du is out-of-bound (`du(m):= A(m,m+1)`), so `du(m) = 0`.
5832    ///
5833    /// `dw(i) = A(i,i+2)` for `i=1,2,...,m`
5834    ///
5835    /// The last two elements of dw is out-of-bound (`dw(m-1):= A(m-1,m+1)`, `dw(m):= A(m,m+2)`), so `dw(m-1) = 0` and `dw(m) = 0`.
5836    ///
5837    /// The data layout is the same as `gtsvStridedBatch`.
5838    ///
5839    /// The routine is numerically stable because it uses QR to solve the linear system.
5840    ///
5841    /// This function requires a buffer size returned by `gpsvInterleavedBatch_bufferSizeExt()`. The address of `pBuffer` must be multiple of 128 bytes. If it is not, [`cusparseStatus_t::CUSPARSE_STATUS_INVALID_VALUE`] is returned.
5842    ///
5843    /// The function supports the following properties if `pBuffer != NULL`:
5844    ///
5845    /// * The routine requires no extra storage.
5846    /// * The routine supports asynchronous execution.
5847    /// * The routine supports CUDA graph capture.
5848    ///
5849    /// Please visit [cuSPARSE Library Samples - cusparseSgpsvInterleavedBatch](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSPARSE/gpsvInterleavedBatch) for a code example.
5850    pub fn cusparseSgpsvInterleavedBatch(
5851        handle: cusparseHandle_t,
5852        algo: ::core::ffi::c_int,
5853        m: ::core::ffi::c_int,
5854        ds: *mut f32,
5855        dl: *mut f32,
5856        d: *mut f32,
5857        du: *mut f32,
5858        dw: *mut f32,
5859        x: *mut f32,
5860        batchCount: ::core::ffi::c_int,
5861        pBuffer: *mut ::core::ffi::c_void,
5862    ) -> cusparseStatus_t;
5863}
5864unsafe extern "C" {
5865    /// This function computes the solution of multiple penta-diagonal linear systems for *i*=0,…,`batchCount`:
5866    ///
5867    /// The coefficient matrix `A` of each of these penta-diagonal linear system is defined with five vectors corresponding to its lower (`ds, dl`), main (`d`), and upper (`du, dw`) matrix diagonals; the right-hand sides are stored in the dense matrix `B`. Notice that solution `X` overwrites right-hand-side matrix `B` on exit.
5868    ///
5869    /// Assuming `A` is of size `m` and base-1, `ds`, `dl`, `d`, `du` and `dw` are defined by the following formula:
5870    ///
5871    /// `ds(i):= A(i, i-2)` for `i=1,2,...,m`
5872    ///
5873    /// The first two elements of ds is out-of-bound (`ds(1):= A(1,-1)`, `ds(2):= A(2,0)`), so `ds(1) = 0` and `ds(2) = 0`.
5874    ///
5875    /// `dl(i):= A(i, i-1)` for `i=1,2,...,m`
5876    ///
5877    /// The first element of dl is out-of-bound (`dl(1):= A(1,0)`), so `dl(1) = 0`.
5878    ///
5879    /// `d(i) = A(i,i)` for `i=1,2,...,m`
5880    ///
5881    /// `du(i) = A(i,i+1)` for `i=1,2,...,m`
5882    ///
5883    /// The last element of du is out-of-bound (`du(m):= A(m,m+1)`), so `du(m) = 0`.
5884    ///
5885    /// `dw(i) = A(i,i+2)` for `i=1,2,...,m`
5886    ///
5887    /// The last two elements of dw is out-of-bound (`dw(m-1):= A(m-1,m+1)`, `dw(m):= A(m,m+2)`), so `dw(m-1) = 0` and `dw(m) = 0`.
5888    ///
5889    /// The data layout is the same as `gtsvStridedBatch`.
5890    ///
5891    /// The routine is numerically stable because it uses QR to solve the linear system.
5892    ///
5893    /// This function requires a buffer size returned by `gpsvInterleavedBatch_bufferSizeExt()`. The address of `pBuffer` must be multiple of 128 bytes. If it is not, [`cusparseStatus_t::CUSPARSE_STATUS_INVALID_VALUE`] is returned.
5894    ///
5895    /// The function supports the following properties if `pBuffer != NULL`:
5896    ///
5897    /// * The routine requires no extra storage.
5898    /// * The routine supports asynchronous execution.
5899    /// * The routine supports CUDA graph capture.
5900    ///
5901    /// Please visit [cuSPARSE Library Samples - cusparseSgpsvInterleavedBatch](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSPARSE/gpsvInterleavedBatch) for a code example.
5902    pub fn cusparseDgpsvInterleavedBatch(
5903        handle: cusparseHandle_t,
5904        algo: ::core::ffi::c_int,
5905        m: ::core::ffi::c_int,
5906        ds: *mut f64,
5907        dl: *mut f64,
5908        d: *mut f64,
5909        du: *mut f64,
5910        dw: *mut f64,
5911        x: *mut f64,
5912        batchCount: ::core::ffi::c_int,
5913        pBuffer: *mut ::core::ffi::c_void,
5914    ) -> cusparseStatus_t;
5915}
5916unsafe extern "C" {
5917    /// This function computes the solution of multiple penta-diagonal linear systems for *i*=0,…,`batchCount`:
5918    ///
5919    /// The coefficient matrix `A` of each of these penta-diagonal linear system is defined with five vectors corresponding to its lower (`ds, dl`), main (`d`), and upper (`du, dw`) matrix diagonals; the right-hand sides are stored in the dense matrix `B`. Notice that solution `X` overwrites right-hand-side matrix `B` on exit.
5920    ///
5921    /// Assuming `A` is of size `m` and base-1, `ds`, `dl`, `d`, `du` and `dw` are defined by the following formula:
5922    ///
5923    /// `ds(i):= A(i, i-2)` for `i=1,2,...,m`
5924    ///
5925    /// The first two elements of ds is out-of-bound (`ds(1):= A(1,-1)`, `ds(2):= A(2,0)`), so `ds(1) = 0` and `ds(2) = 0`.
5926    ///
5927    /// `dl(i):= A(i, i-1)` for `i=1,2,...,m`
5928    ///
5929    /// The first element of dl is out-of-bound (`dl(1):= A(1,0)`), so `dl(1) = 0`.
5930    ///
5931    /// `d(i) = A(i,i)` for `i=1,2,...,m`
5932    ///
5933    /// `du(i) = A(i,i+1)` for `i=1,2,...,m`
5934    ///
5935    /// The last element of du is out-of-bound (`du(m):= A(m,m+1)`), so `du(m) = 0`.
5936    ///
5937    /// `dw(i) = A(i,i+2)` for `i=1,2,...,m`
5938    ///
5939    /// The last two elements of dw is out-of-bound (`dw(m-1):= A(m-1,m+1)`, `dw(m):= A(m,m+2)`), so `dw(m-1) = 0` and `dw(m) = 0`.
5940    ///
5941    /// The data layout is the same as `gtsvStridedBatch`.
5942    ///
5943    /// The routine is numerically stable because it uses QR to solve the linear system.
5944    ///
5945    /// This function requires a buffer size returned by `gpsvInterleavedBatch_bufferSizeExt()`. The address of `pBuffer` must be multiple of 128 bytes. If it is not, [`cusparseStatus_t::CUSPARSE_STATUS_INVALID_VALUE`] is returned.
5946    ///
5947    /// The function supports the following properties if `pBuffer != NULL`:
5948    ///
5949    /// * The routine requires no extra storage.
5950    /// * The routine supports asynchronous execution.
5951    /// * The routine supports CUDA graph capture.
5952    ///
5953    /// Please visit [cuSPARSE Library Samples - cusparseSgpsvInterleavedBatch](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSPARSE/gpsvInterleavedBatch) for a code example.
5954    pub fn cusparseCgpsvInterleavedBatch(
5955        handle: cusparseHandle_t,
5956        algo: ::core::ffi::c_int,
5957        m: ::core::ffi::c_int,
5958        ds: *mut cuComplex,
5959        dl: *mut cuComplex,
5960        d: *mut cuComplex,
5961        du: *mut cuComplex,
5962        dw: *mut cuComplex,
5963        x: *mut cuComplex,
5964        batchCount: ::core::ffi::c_int,
5965        pBuffer: *mut ::core::ffi::c_void,
5966    ) -> cusparseStatus_t;
5967}
5968unsafe extern "C" {
5969    /// This function computes the solution of multiple penta-diagonal linear systems for *i*=0,…,`batchCount`:
5970    ///
5971    /// The coefficient matrix `A` of each of these penta-diagonal linear system is defined with five vectors corresponding to its lower (`ds, dl`), main (`d`), and upper (`du, dw`) matrix diagonals; the right-hand sides are stored in the dense matrix `B`. Notice that solution `X` overwrites right-hand-side matrix `B` on exit.
5972    ///
5973    /// Assuming `A` is of size `m` and base-1, `ds`, `dl`, `d`, `du` and `dw` are defined by the following formula:
5974    ///
5975    /// `ds(i):= A(i, i-2)` for `i=1,2,...,m`
5976    ///
5977    /// The first two elements of ds is out-of-bound (`ds(1):= A(1,-1)`, `ds(2):= A(2,0)`), so `ds(1) = 0` and `ds(2) = 0`.
5978    ///
5979    /// `dl(i):= A(i, i-1)` for `i=1,2,...,m`
5980    ///
5981    /// The first element of dl is out-of-bound (`dl(1):= A(1,0)`), so `dl(1) = 0`.
5982    ///
5983    /// `d(i) = A(i,i)` for `i=1,2,...,m`
5984    ///
5985    /// `du(i) = A(i,i+1)` for `i=1,2,...,m`
5986    ///
5987    /// The last element of du is out-of-bound (`du(m):= A(m,m+1)`), so `du(m) = 0`.
5988    ///
5989    /// `dw(i) = A(i,i+2)` for `i=1,2,...,m`
5990    ///
5991    /// The last two elements of dw is out-of-bound (`dw(m-1):= A(m-1,m+1)`, `dw(m):= A(m,m+2)`), so `dw(m-1) = 0` and `dw(m) = 0`.
5992    ///
5993    /// The data layout is the same as `gtsvStridedBatch`.
5994    ///
5995    /// The routine is numerically stable because it uses QR to solve the linear system.
5996    ///
5997    /// This function requires a buffer size returned by `gpsvInterleavedBatch_bufferSizeExt()`. The address of `pBuffer` must be multiple of 128 bytes. If it is not, [`cusparseStatus_t::CUSPARSE_STATUS_INVALID_VALUE`] is returned.
5998    ///
5999    /// The function supports the following properties if `pBuffer != NULL`:
6000    ///
6001    /// * The routine requires no extra storage.
6002    /// * The routine supports asynchronous execution.
6003    /// * The routine supports CUDA graph capture.
6004    ///
6005    /// Please visit [cuSPARSE Library Samples - cusparseSgpsvInterleavedBatch](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSPARSE/gpsvInterleavedBatch) for a code example.
6006    pub fn cusparseZgpsvInterleavedBatch(
6007        handle: cusparseHandle_t,
6008        algo: ::core::ffi::c_int,
6009        m: ::core::ffi::c_int,
6010        ds: *mut cuDoubleComplex,
6011        dl: *mut cuDoubleComplex,
6012        d: *mut cuDoubleComplex,
6013        du: *mut cuDoubleComplex,
6014        dw: *mut cuDoubleComplex,
6015        x: *mut cuDoubleComplex,
6016        batchCount: ::core::ffi::c_int,
6017        pBuffer: *mut ::core::ffi::c_void,
6018    ) -> cusparseStatus_t;
6019}
6020unsafe extern "C" {
6021    pub fn cusparseScsrgeam2_bufferSizeExt(
6022        handle: cusparseHandle_t,
6023        m: ::core::ffi::c_int,
6024        n: ::core::ffi::c_int,
6025        alpha: *const f32,
6026        descrA: cusparseMatDescr_t,
6027        nnzA: ::core::ffi::c_int,
6028        csrSortedValA: *const f32,
6029        csrSortedRowPtrA: *const ::core::ffi::c_int,
6030        csrSortedColIndA: *const ::core::ffi::c_int,
6031        beta: *const f32,
6032        descrB: cusparseMatDescr_t,
6033        nnzB: ::core::ffi::c_int,
6034        csrSortedValB: *const f32,
6035        csrSortedRowPtrB: *const ::core::ffi::c_int,
6036        csrSortedColIndB: *const ::core::ffi::c_int,
6037        descrC: cusparseMatDescr_t,
6038        csrSortedValC: *const f32,
6039        csrSortedRowPtrC: *const ::core::ffi::c_int,
6040        csrSortedColIndC: *const ::core::ffi::c_int,
6041        pBufferSizeInBytes: *mut size_t,
6042    ) -> cusparseStatus_t;
6043}
6044unsafe extern "C" {
6045    pub fn cusparseDcsrgeam2_bufferSizeExt(
6046        handle: cusparseHandle_t,
6047        m: ::core::ffi::c_int,
6048        n: ::core::ffi::c_int,
6049        alpha: *const f64,
6050        descrA: cusparseMatDescr_t,
6051        nnzA: ::core::ffi::c_int,
6052        csrSortedValA: *const f64,
6053        csrSortedRowPtrA: *const ::core::ffi::c_int,
6054        csrSortedColIndA: *const ::core::ffi::c_int,
6055        beta: *const f64,
6056        descrB: cusparseMatDescr_t,
6057        nnzB: ::core::ffi::c_int,
6058        csrSortedValB: *const f64,
6059        csrSortedRowPtrB: *const ::core::ffi::c_int,
6060        csrSortedColIndB: *const ::core::ffi::c_int,
6061        descrC: cusparseMatDescr_t,
6062        csrSortedValC: *const f64,
6063        csrSortedRowPtrC: *const ::core::ffi::c_int,
6064        csrSortedColIndC: *const ::core::ffi::c_int,
6065        pBufferSizeInBytes: *mut size_t,
6066    ) -> cusparseStatus_t;
6067}
6068unsafe extern "C" {
6069    pub fn cusparseCcsrgeam2_bufferSizeExt(
6070        handle: cusparseHandle_t,
6071        m: ::core::ffi::c_int,
6072        n: ::core::ffi::c_int,
6073        alpha: *const cuComplex,
6074        descrA: cusparseMatDescr_t,
6075        nnzA: ::core::ffi::c_int,
6076        csrSortedValA: *const cuComplex,
6077        csrSortedRowPtrA: *const ::core::ffi::c_int,
6078        csrSortedColIndA: *const ::core::ffi::c_int,
6079        beta: *const cuComplex,
6080        descrB: cusparseMatDescr_t,
6081        nnzB: ::core::ffi::c_int,
6082        csrSortedValB: *const cuComplex,
6083        csrSortedRowPtrB: *const ::core::ffi::c_int,
6084        csrSortedColIndB: *const ::core::ffi::c_int,
6085        descrC: cusparseMatDescr_t,
6086        csrSortedValC: *const cuComplex,
6087        csrSortedRowPtrC: *const ::core::ffi::c_int,
6088        csrSortedColIndC: *const ::core::ffi::c_int,
6089        pBufferSizeInBytes: *mut size_t,
6090    ) -> cusparseStatus_t;
6091}
6092unsafe extern "C" {
6093    pub fn cusparseZcsrgeam2_bufferSizeExt(
6094        handle: cusparseHandle_t,
6095        m: ::core::ffi::c_int,
6096        n: ::core::ffi::c_int,
6097        alpha: *const cuDoubleComplex,
6098        descrA: cusparseMatDescr_t,
6099        nnzA: ::core::ffi::c_int,
6100        csrSortedValA: *const cuDoubleComplex,
6101        csrSortedRowPtrA: *const ::core::ffi::c_int,
6102        csrSortedColIndA: *const ::core::ffi::c_int,
6103        beta: *const cuDoubleComplex,
6104        descrB: cusparseMatDescr_t,
6105        nnzB: ::core::ffi::c_int,
6106        csrSortedValB: *const cuDoubleComplex,
6107        csrSortedRowPtrB: *const ::core::ffi::c_int,
6108        csrSortedColIndB: *const ::core::ffi::c_int,
6109        descrC: cusparseMatDescr_t,
6110        csrSortedValC: *const cuDoubleComplex,
6111        csrSortedRowPtrC: *const ::core::ffi::c_int,
6112        csrSortedColIndC: *const ::core::ffi::c_int,
6113        pBufferSizeInBytes: *mut size_t,
6114    ) -> cusparseStatus_t;
6115}
6116unsafe extern "C" {
6117    pub fn cusparseXcsrgeam2Nnz(
6118        handle: cusparseHandle_t,
6119        m: ::core::ffi::c_int,
6120        n: ::core::ffi::c_int,
6121        descrA: cusparseMatDescr_t,
6122        nnzA: ::core::ffi::c_int,
6123        csrSortedRowPtrA: *const ::core::ffi::c_int,
6124        csrSortedColIndA: *const ::core::ffi::c_int,
6125        descrB: cusparseMatDescr_t,
6126        nnzB: ::core::ffi::c_int,
6127        csrSortedRowPtrB: *const ::core::ffi::c_int,
6128        csrSortedColIndB: *const ::core::ffi::c_int,
6129        descrC: cusparseMatDescr_t,
6130        csrSortedRowPtrC: *mut ::core::ffi::c_int,
6131        nnzTotalDevHostPtr: *mut ::core::ffi::c_int,
6132        workspace: *mut ::core::ffi::c_void,
6133    ) -> cusparseStatus_t;
6134}
6135unsafe extern "C" {
6136    /// This function performs following matrix-matrix operation
6137    ///
6138    /// where `A`, `B`, and `C` are $m \times n$ sparse matrices (defined in CSR storage format by the three arrays `csrValA|csrValB|csrValC`, `csrRowPtrA|csrRowPtrB|csrRowPtrC`, and `csrColIndA|csrColIndB|csrcolIndC` respectively), and $\alpha\text{~and~}\beta$ are scalars. Since `A` and `B` have different sparsity patterns, cuSPARSE adopts a two-step approach to complete sparse matrix `C`. In the first step, the user allocates `csrRowPtrC` of `m+1 `elements and uses function [`cusparseXcsrgeam2Nnz`] to determine `csrRowPtrC` and the total number of nonzero elements. In the second step, the user gathers `nnzC` (number of nonzero elements of matrix `C`) from either `(nnzC=*nnzTotalDevHostPtr)` or `(nnzC=csrRowPtrC(m)-csrRowPtrC(0))` and allocates `csrValC, csrColIndC` of `nnzC` elements respectively, then finally calls function `cusparse\[S|D|C|Z\]csrgeam2()` to complete matrix `C`.
6139    ///
6140    /// The general procedure is as follows:
6141    ///
6142    /// Several comments on `csrgeam2()`:
6143    ///
6144    /// * The other three combinations, NT, TN, and TT, are not supported by cuSPARSE. In order to do any one of the three, the user should use the routine `csr2csc()` to convert $A$ | $B$ to $A^{T}$ | $B^{T}$.
6145    /// * Only [`cusparseMatrixType_t::CUSPARSE_MATRIX_TYPE_GENERAL`] is supported. If either `A` or `B` is symmetric or Hermitian, then the user must extend the matrix to a full one and reconfigure the `MatrixType` field of the descriptor to [`cusparseMatrixType_t::CUSPARSE_MATRIX_TYPE_GENERAL`].
6146    /// * If the sparsity pattern of matrix `C` is known, the user can skip the call to function [`cusparseXcsrgeam2Nnz`]. For example, suppose that the user has an iterative algorithm which would update `A` and `B` iteratively but keep the sparsity patterns. The user can call function [`cusparseXcsrgeam2Nnz`] once to set up the sparsity pattern of `C`, then call function `cusparse\[S|D|C|Z\]geam()` only for each iteration.
6147    /// * The pointers `alpha` and `beta` must be valid.
6148    /// * When `alpha` or `beta` is zero, it is not considered a special case by cuSPARSE. The sparsity pattern of `C` is independent of the value of `alpha` and `beta`. If the user wants $C = 0 \times A + 1 \times B^{T}$, then `csr2csc()` is better than `csrgeam2()`.
6149    /// * `csrgeam2()` is the same as `csrgeam()` except `csrgeam2()` needs explicit buffer where `csrgeam()` allocates the buffer internally.
6150    /// * This function requires temporary extra storage that is allocated internally.
6151    /// * The routine supports asynchronous execution if the Stream Ordered Memory Allocator is available.
6152    /// * The routine supports CUDA graph capture if the Stream Ordered Memory Allocator is available.
6153    pub fn cusparseScsrgeam2(
6154        handle: cusparseHandle_t,
6155        m: ::core::ffi::c_int,
6156        n: ::core::ffi::c_int,
6157        alpha: *const f32,
6158        descrA: cusparseMatDescr_t,
6159        nnzA: ::core::ffi::c_int,
6160        csrSortedValA: *const f32,
6161        csrSortedRowPtrA: *const ::core::ffi::c_int,
6162        csrSortedColIndA: *const ::core::ffi::c_int,
6163        beta: *const f32,
6164        descrB: cusparseMatDescr_t,
6165        nnzB: ::core::ffi::c_int,
6166        csrSortedValB: *const f32,
6167        csrSortedRowPtrB: *const ::core::ffi::c_int,
6168        csrSortedColIndB: *const ::core::ffi::c_int,
6169        descrC: cusparseMatDescr_t,
6170        csrSortedValC: *mut f32,
6171        csrSortedRowPtrC: *mut ::core::ffi::c_int,
6172        csrSortedColIndC: *mut ::core::ffi::c_int,
6173        pBuffer: *mut ::core::ffi::c_void,
6174    ) -> cusparseStatus_t;
6175}
6176unsafe extern "C" {
6177    /// This function performs following matrix-matrix operation
6178    ///
6179    /// where `A`, `B`, and `C` are $m \times n$ sparse matrices (defined in CSR storage format by the three arrays `csrValA|csrValB|csrValC`, `csrRowPtrA|csrRowPtrB|csrRowPtrC`, and `csrColIndA|csrColIndB|csrcolIndC` respectively), and $\alpha\text{~and~}\beta$ are scalars. Since `A` and `B` have different sparsity patterns, cuSPARSE adopts a two-step approach to complete sparse matrix `C`. In the first step, the user allocates `csrRowPtrC` of `m+1 `elements and uses function [`cusparseXcsrgeam2Nnz`] to determine `csrRowPtrC` and the total number of nonzero elements. In the second step, the user gathers `nnzC` (number of nonzero elements of matrix `C`) from either `(nnzC=*nnzTotalDevHostPtr)` or `(nnzC=csrRowPtrC(m)-csrRowPtrC(0))` and allocates `csrValC, csrColIndC` of `nnzC` elements respectively, then finally calls function `cusparse\[S|D|C|Z\]csrgeam2()` to complete matrix `C`.
6180    ///
6181    /// The general procedure is as follows:
6182    ///
6183    /// Several comments on `csrgeam2()`:
6184    ///
6185    /// * The other three combinations, NT, TN, and TT, are not supported by cuSPARSE. In order to do any one of the three, the user should use the routine `csr2csc()` to convert $A$ | $B$ to $A^{T}$ | $B^{T}$.
6186    /// * Only [`cusparseMatrixType_t::CUSPARSE_MATRIX_TYPE_GENERAL`] is supported. If either `A` or `B` is symmetric or Hermitian, then the user must extend the matrix to a full one and reconfigure the `MatrixType` field of the descriptor to [`cusparseMatrixType_t::CUSPARSE_MATRIX_TYPE_GENERAL`].
6187    /// * If the sparsity pattern of matrix `C` is known, the user can skip the call to function [`cusparseXcsrgeam2Nnz`]. For example, suppose that the user has an iterative algorithm which would update `A` and `B` iteratively but keep the sparsity patterns. The user can call function [`cusparseXcsrgeam2Nnz`] once to set up the sparsity pattern of `C`, then call function `cusparse\[S|D|C|Z\]geam()` only for each iteration.
6188    /// * The pointers `alpha` and `beta` must be valid.
6189    /// * When `alpha` or `beta` is zero, it is not considered a special case by cuSPARSE. The sparsity pattern of `C` is independent of the value of `alpha` and `beta`. If the user wants $C = 0 \times A + 1 \times B^{T}$, then `csr2csc()` is better than `csrgeam2()`.
6190    /// * `csrgeam2()` is the same as `csrgeam()` except `csrgeam2()` needs explicit buffer where `csrgeam()` allocates the buffer internally.
6191    /// * This function requires temporary extra storage that is allocated internally.
6192    /// * The routine supports asynchronous execution if the Stream Ordered Memory Allocator is available.
6193    /// * The routine supports CUDA graph capture if the Stream Ordered Memory Allocator is available.
6194    pub fn cusparseDcsrgeam2(
6195        handle: cusparseHandle_t,
6196        m: ::core::ffi::c_int,
6197        n: ::core::ffi::c_int,
6198        alpha: *const f64,
6199        descrA: cusparseMatDescr_t,
6200        nnzA: ::core::ffi::c_int,
6201        csrSortedValA: *const f64,
6202        csrSortedRowPtrA: *const ::core::ffi::c_int,
6203        csrSortedColIndA: *const ::core::ffi::c_int,
6204        beta: *const f64,
6205        descrB: cusparseMatDescr_t,
6206        nnzB: ::core::ffi::c_int,
6207        csrSortedValB: *const f64,
6208        csrSortedRowPtrB: *const ::core::ffi::c_int,
6209        csrSortedColIndB: *const ::core::ffi::c_int,
6210        descrC: cusparseMatDescr_t,
6211        csrSortedValC: *mut f64,
6212        csrSortedRowPtrC: *mut ::core::ffi::c_int,
6213        csrSortedColIndC: *mut ::core::ffi::c_int,
6214        pBuffer: *mut ::core::ffi::c_void,
6215    ) -> cusparseStatus_t;
6216}
6217unsafe extern "C" {
6218    /// This function performs following matrix-matrix operation
6219    ///
6220    /// where `A`, `B`, and `C` are $m \times n$ sparse matrices (defined in CSR storage format by the three arrays `csrValA|csrValB|csrValC`, `csrRowPtrA|csrRowPtrB|csrRowPtrC`, and `csrColIndA|csrColIndB|csrcolIndC` respectively), and $\alpha\text{~and~}\beta$ are scalars. Since `A` and `B` have different sparsity patterns, cuSPARSE adopts a two-step approach to complete sparse matrix `C`. In the first step, the user allocates `csrRowPtrC` of `m+1 `elements and uses function [`cusparseXcsrgeam2Nnz`] to determine `csrRowPtrC` and the total number of nonzero elements. In the second step, the user gathers `nnzC` (number of nonzero elements of matrix `C`) from either `(nnzC=*nnzTotalDevHostPtr)` or `(nnzC=csrRowPtrC(m)-csrRowPtrC(0))` and allocates `csrValC, csrColIndC` of `nnzC` elements respectively, then finally calls function `cusparse\[S|D|C|Z\]csrgeam2()` to complete matrix `C`.
6221    ///
6222    /// The general procedure is as follows:
6223    ///
6224    /// Several comments on `csrgeam2()`:
6225    ///
6226    /// * The other three combinations, NT, TN, and TT, are not supported by cuSPARSE. In order to do any one of the three, the user should use the routine `csr2csc()` to convert $A$ | $B$ to $A^{T}$ | $B^{T}$.
6227    /// * Only [`cusparseMatrixType_t::CUSPARSE_MATRIX_TYPE_GENERAL`] is supported. If either `A` or `B` is symmetric or Hermitian, then the user must extend the matrix to a full one and reconfigure the `MatrixType` field of the descriptor to [`cusparseMatrixType_t::CUSPARSE_MATRIX_TYPE_GENERAL`].
6228    /// * If the sparsity pattern of matrix `C` is known, the user can skip the call to function [`cusparseXcsrgeam2Nnz`]. For example, suppose that the user has an iterative algorithm which would update `A` and `B` iteratively but keep the sparsity patterns. The user can call function [`cusparseXcsrgeam2Nnz`] once to set up the sparsity pattern of `C`, then call function `cusparse\[S|D|C|Z\]geam()` only for each iteration.
6229    /// * The pointers `alpha` and `beta` must be valid.
6230    /// * When `alpha` or `beta` is zero, it is not considered a special case by cuSPARSE. The sparsity pattern of `C` is independent of the value of `alpha` and `beta`. If the user wants $C = 0 \times A + 1 \times B^{T}$, then `csr2csc()` is better than `csrgeam2()`.
6231    /// * `csrgeam2()` is the same as `csrgeam()` except `csrgeam2()` needs explicit buffer where `csrgeam()` allocates the buffer internally.
6232    /// * This function requires temporary extra storage that is allocated internally.
6233    /// * The routine supports asynchronous execution if the Stream Ordered Memory Allocator is available.
6234    /// * The routine supports CUDA graph capture if the Stream Ordered Memory Allocator is available.
6235    pub fn cusparseCcsrgeam2(
6236        handle: cusparseHandle_t,
6237        m: ::core::ffi::c_int,
6238        n: ::core::ffi::c_int,
6239        alpha: *const cuComplex,
6240        descrA: cusparseMatDescr_t,
6241        nnzA: ::core::ffi::c_int,
6242        csrSortedValA: *const cuComplex,
6243        csrSortedRowPtrA: *const ::core::ffi::c_int,
6244        csrSortedColIndA: *const ::core::ffi::c_int,
6245        beta: *const cuComplex,
6246        descrB: cusparseMatDescr_t,
6247        nnzB: ::core::ffi::c_int,
6248        csrSortedValB: *const cuComplex,
6249        csrSortedRowPtrB: *const ::core::ffi::c_int,
6250        csrSortedColIndB: *const ::core::ffi::c_int,
6251        descrC: cusparseMatDescr_t,
6252        csrSortedValC: *mut cuComplex,
6253        csrSortedRowPtrC: *mut ::core::ffi::c_int,
6254        csrSortedColIndC: *mut ::core::ffi::c_int,
6255        pBuffer: *mut ::core::ffi::c_void,
6256    ) -> cusparseStatus_t;
6257}
6258unsafe extern "C" {
6259    /// This function performs following matrix-matrix operation
6260    ///
6261    /// where `A`, `B`, and `C` are $m \times n$ sparse matrices (defined in CSR storage format by the three arrays `csrValA|csrValB|csrValC`, `csrRowPtrA|csrRowPtrB|csrRowPtrC`, and `csrColIndA|csrColIndB|csrcolIndC` respectively), and $\alpha\text{~and~}\beta$ are scalars. Since `A` and `B` have different sparsity patterns, cuSPARSE adopts a two-step approach to complete sparse matrix `C`. In the first step, the user allocates `csrRowPtrC` of `m+1 `elements and uses function [`cusparseXcsrgeam2Nnz`] to determine `csrRowPtrC` and the total number of nonzero elements. In the second step, the user gathers `nnzC` (number of nonzero elements of matrix `C`) from either `(nnzC=*nnzTotalDevHostPtr)` or `(nnzC=csrRowPtrC(m)-csrRowPtrC(0))` and allocates `csrValC, csrColIndC` of `nnzC` elements respectively, then finally calls function `cusparse\[S|D|C|Z\]csrgeam2()` to complete matrix `C`.
6262    ///
6263    /// The general procedure is as follows:
6264    ///
6265    /// Several comments on `csrgeam2()`:
6266    ///
6267    /// * The other three combinations, NT, TN, and TT, are not supported by cuSPARSE. In order to do any one of the three, the user should use the routine `csr2csc()` to convert $A$ | $B$ to $A^{T}$ | $B^{T}$.
6268    /// * Only [`cusparseMatrixType_t::CUSPARSE_MATRIX_TYPE_GENERAL`] is supported. If either `A` or `B` is symmetric or Hermitian, then the user must extend the matrix to a full one and reconfigure the `MatrixType` field of the descriptor to [`cusparseMatrixType_t::CUSPARSE_MATRIX_TYPE_GENERAL`].
6269    /// * If the sparsity pattern of matrix `C` is known, the user can skip the call to function [`cusparseXcsrgeam2Nnz`]. For example, suppose that the user has an iterative algorithm which would update `A` and `B` iteratively but keep the sparsity patterns. The user can call function [`cusparseXcsrgeam2Nnz`] once to set up the sparsity pattern of `C`, then call function `cusparse\[S|D|C|Z\]geam()` only for each iteration.
6270    /// * The pointers `alpha` and `beta` must be valid.
6271    /// * When `alpha` or `beta` is zero, it is not considered a special case by cuSPARSE. The sparsity pattern of `C` is independent of the value of `alpha` and `beta`. If the user wants $C = 0 \times A + 1 \times B^{T}$, then `csr2csc()` is better than `csrgeam2()`.
6272    /// * `csrgeam2()` is the same as `csrgeam()` except `csrgeam2()` needs explicit buffer where `csrgeam()` allocates the buffer internally.
6273    /// * This function requires temporary extra storage that is allocated internally.
6274    /// * The routine supports asynchronous execution if the Stream Ordered Memory Allocator is available.
6275    /// * The routine supports CUDA graph capture if the Stream Ordered Memory Allocator is available.
6276    pub fn cusparseZcsrgeam2(
6277        handle: cusparseHandle_t,
6278        m: ::core::ffi::c_int,
6279        n: ::core::ffi::c_int,
6280        alpha: *const cuDoubleComplex,
6281        descrA: cusparseMatDescr_t,
6282        nnzA: ::core::ffi::c_int,
6283        csrSortedValA: *const cuDoubleComplex,
6284        csrSortedRowPtrA: *const ::core::ffi::c_int,
6285        csrSortedColIndA: *const ::core::ffi::c_int,
6286        beta: *const cuDoubleComplex,
6287        descrB: cusparseMatDescr_t,
6288        nnzB: ::core::ffi::c_int,
6289        csrSortedValB: *const cuDoubleComplex,
6290        csrSortedRowPtrB: *const ::core::ffi::c_int,
6291        csrSortedColIndB: *const ::core::ffi::c_int,
6292        descrC: cusparseMatDescr_t,
6293        csrSortedValC: *mut cuDoubleComplex,
6294        csrSortedRowPtrC: *mut ::core::ffi::c_int,
6295        csrSortedColIndC: *mut ::core::ffi::c_int,
6296        pBuffer: *mut ::core::ffi::c_void,
6297    ) -> cusparseStatus_t;
6298}
6299unsafe extern "C" {
6300    /// This function performs the coloring of the adjacency graph associated with the matrix A stored in CSR format. The coloring is an assignment of colors (integer numbers) to nodes, such that neighboring nodes have distinct colors. An approximate coloring algorithm is used in this routine, and is stopped when a certain percentage of nodes has been colored. The rest of the nodes are assigned distinct colors (an increasing sequence of integers numbers, starting from the last integer used previously). The last two auxiliary routines can be used to extract the resulting number of colors, their assignment and the associated reordering. The reordering is such that nodes that have been assigned the same color are reordered to be next to each other.
6301    ///
6302    /// The matrix A passed to this routine, must be stored as a general matrix and have a symmetric sparsity pattern. If the matrix is nonsymmetric the user should pass A+A^T as a parameter to this routine.
6303    ///
6304    /// * This function requires temporary extra storage that is allocated internally.
6305    /// * The routine supports asynchronous execution if the Stream Ordered Memory Allocator is available.
6306    /// * The routine supports CUDA graph capture if the Stream Ordered Memory Allocator is available.
6307    pub fn cusparseScsrcolor(
6308        handle: cusparseHandle_t,
6309        m: ::core::ffi::c_int,
6310        nnz: ::core::ffi::c_int,
6311        descrA: cusparseMatDescr_t,
6312        csrSortedValA: *const f32,
6313        csrSortedRowPtrA: *const ::core::ffi::c_int,
6314        csrSortedColIndA: *const ::core::ffi::c_int,
6315        fractionToColor: *const f32,
6316        ncolors: *mut ::core::ffi::c_int,
6317        coloring: *mut ::core::ffi::c_int,
6318        reordering: *mut ::core::ffi::c_int,
6319        info: cusparseColorInfo_t,
6320    ) -> cusparseStatus_t;
6321}
6322unsafe extern "C" {
6323    /// This function performs the coloring of the adjacency graph associated with the matrix A stored in CSR format. The coloring is an assignment of colors (integer numbers) to nodes, such that neighboring nodes have distinct colors. An approximate coloring algorithm is used in this routine, and is stopped when a certain percentage of nodes has been colored. The rest of the nodes are assigned distinct colors (an increasing sequence of integers numbers, starting from the last integer used previously). The last two auxiliary routines can be used to extract the resulting number of colors, their assignment and the associated reordering. The reordering is such that nodes that have been assigned the same color are reordered to be next to each other.
6324    ///
6325    /// The matrix A passed to this routine, must be stored as a general matrix and have a symmetric sparsity pattern. If the matrix is nonsymmetric the user should pass A+A^T as a parameter to this routine.
6326    ///
6327    /// * This function requires temporary extra storage that is allocated internally.
6328    /// * The routine supports asynchronous execution if the Stream Ordered Memory Allocator is available.
6329    /// * The routine supports CUDA graph capture if the Stream Ordered Memory Allocator is available.
6330    pub fn cusparseDcsrcolor(
6331        handle: cusparseHandle_t,
6332        m: ::core::ffi::c_int,
6333        nnz: ::core::ffi::c_int,
6334        descrA: cusparseMatDescr_t,
6335        csrSortedValA: *const f64,
6336        csrSortedRowPtrA: *const ::core::ffi::c_int,
6337        csrSortedColIndA: *const ::core::ffi::c_int,
6338        fractionToColor: *const f64,
6339        ncolors: *mut ::core::ffi::c_int,
6340        coloring: *mut ::core::ffi::c_int,
6341        reordering: *mut ::core::ffi::c_int,
6342        info: cusparseColorInfo_t,
6343    ) -> cusparseStatus_t;
6344}
6345unsafe extern "C" {
6346    /// This function performs the coloring of the adjacency graph associated with the matrix A stored in CSR format. The coloring is an assignment of colors (integer numbers) to nodes, such that neighboring nodes have distinct colors. An approximate coloring algorithm is used in this routine, and is stopped when a certain percentage of nodes has been colored. The rest of the nodes are assigned distinct colors (an increasing sequence of integers numbers, starting from the last integer used previously). The last two auxiliary routines can be used to extract the resulting number of colors, their assignment and the associated reordering. The reordering is such that nodes that have been assigned the same color are reordered to be next to each other.
6347    ///
6348    /// The matrix A passed to this routine, must be stored as a general matrix and have a symmetric sparsity pattern. If the matrix is nonsymmetric the user should pass A+A^T as a parameter to this routine.
6349    ///
6350    /// * This function requires temporary extra storage that is allocated internally.
6351    /// * The routine supports asynchronous execution if the Stream Ordered Memory Allocator is available.
6352    /// * The routine supports CUDA graph capture if the Stream Ordered Memory Allocator is available.
6353    pub fn cusparseCcsrcolor(
6354        handle: cusparseHandle_t,
6355        m: ::core::ffi::c_int,
6356        nnz: ::core::ffi::c_int,
6357        descrA: cusparseMatDescr_t,
6358        csrSortedValA: *const cuComplex,
6359        csrSortedRowPtrA: *const ::core::ffi::c_int,
6360        csrSortedColIndA: *const ::core::ffi::c_int,
6361        fractionToColor: *const f32,
6362        ncolors: *mut ::core::ffi::c_int,
6363        coloring: *mut ::core::ffi::c_int,
6364        reordering: *mut ::core::ffi::c_int,
6365        info: cusparseColorInfo_t,
6366    ) -> cusparseStatus_t;
6367}
6368unsafe extern "C" {
6369    /// This function performs the coloring of the adjacency graph associated with the matrix A stored in CSR format. The coloring is an assignment of colors (integer numbers) to nodes, such that neighboring nodes have distinct colors. An approximate coloring algorithm is used in this routine, and is stopped when a certain percentage of nodes has been colored. The rest of the nodes are assigned distinct colors (an increasing sequence of integers numbers, starting from the last integer used previously). The last two auxiliary routines can be used to extract the resulting number of colors, their assignment and the associated reordering. The reordering is such that nodes that have been assigned the same color are reordered to be next to each other.
6370    ///
6371    /// The matrix A passed to this routine, must be stored as a general matrix and have a symmetric sparsity pattern. If the matrix is nonsymmetric the user should pass A+A^T as a parameter to this routine.
6372    ///
6373    /// * This function requires temporary extra storage that is allocated internally.
6374    /// * The routine supports asynchronous execution if the Stream Ordered Memory Allocator is available.
6375    /// * The routine supports CUDA graph capture if the Stream Ordered Memory Allocator is available.
6376    pub fn cusparseZcsrcolor(
6377        handle: cusparseHandle_t,
6378        m: ::core::ffi::c_int,
6379        nnz: ::core::ffi::c_int,
6380        descrA: cusparseMatDescr_t,
6381        csrSortedValA: *const cuDoubleComplex,
6382        csrSortedRowPtrA: *const ::core::ffi::c_int,
6383        csrSortedColIndA: *const ::core::ffi::c_int,
6384        fractionToColor: *const f64,
6385        ncolors: *mut ::core::ffi::c_int,
6386        coloring: *mut ::core::ffi::c_int,
6387        reordering: *mut ::core::ffi::c_int,
6388        info: cusparseColorInfo_t,
6389    ) -> cusparseStatus_t;
6390}
6391unsafe extern "C" {
6392    /// This function computes the number of nonzero elements per row or column and the total number of nonzero elements in a dense matrix.
6393    ///
6394    /// * This function requires temporary extra storage that is allocated internally.
6395    /// * The routine supports asynchronous execution if the Stream Ordered Memory Allocator is available.
6396    /// * The routine supports CUDA graph capture if the Stream Ordered Memory Allocator is available.
6397    pub fn cusparseSnnz(
6398        handle: cusparseHandle_t,
6399        dirA: cusparseDirection_t,
6400        m: ::core::ffi::c_int,
6401        n: ::core::ffi::c_int,
6402        descrA: cusparseMatDescr_t,
6403        A: *const f32,
6404        lda: ::core::ffi::c_int,
6405        nnzPerRowCol: *mut ::core::ffi::c_int,
6406        nnzTotalDevHostPtr: *mut ::core::ffi::c_int,
6407    ) -> cusparseStatus_t;
6408}
6409unsafe extern "C" {
6410    /// This function computes the number of nonzero elements per row or column and the total number of nonzero elements in a dense matrix.
6411    ///
6412    /// * This function requires temporary extra storage that is allocated internally.
6413    /// * The routine supports asynchronous execution if the Stream Ordered Memory Allocator is available.
6414    /// * The routine supports CUDA graph capture if the Stream Ordered Memory Allocator is available.
6415    pub fn cusparseDnnz(
6416        handle: cusparseHandle_t,
6417        dirA: cusparseDirection_t,
6418        m: ::core::ffi::c_int,
6419        n: ::core::ffi::c_int,
6420        descrA: cusparseMatDescr_t,
6421        A: *const f64,
6422        lda: ::core::ffi::c_int,
6423        nnzPerRowCol: *mut ::core::ffi::c_int,
6424        nnzTotalDevHostPtr: *mut ::core::ffi::c_int,
6425    ) -> cusparseStatus_t;
6426}
6427unsafe extern "C" {
6428    /// This function computes the number of nonzero elements per row or column and the total number of nonzero elements in a dense matrix.
6429    ///
6430    /// * This function requires temporary extra storage that is allocated internally.
6431    /// * The routine supports asynchronous execution if the Stream Ordered Memory Allocator is available.
6432    /// * The routine supports CUDA graph capture if the Stream Ordered Memory Allocator is available.
6433    pub fn cusparseCnnz(
6434        handle: cusparseHandle_t,
6435        dirA: cusparseDirection_t,
6436        m: ::core::ffi::c_int,
6437        n: ::core::ffi::c_int,
6438        descrA: cusparseMatDescr_t,
6439        A: *const cuComplex,
6440        lda: ::core::ffi::c_int,
6441        nnzPerRowCol: *mut ::core::ffi::c_int,
6442        nnzTotalDevHostPtr: *mut ::core::ffi::c_int,
6443    ) -> cusparseStatus_t;
6444}
6445unsafe extern "C" {
6446    /// This function computes the number of nonzero elements per row or column and the total number of nonzero elements in a dense matrix.
6447    ///
6448    /// * This function requires temporary extra storage that is allocated internally.
6449    /// * The routine supports asynchronous execution if the Stream Ordered Memory Allocator is available.
6450    /// * The routine supports CUDA graph capture if the Stream Ordered Memory Allocator is available.
6451    pub fn cusparseZnnz(
6452        handle: cusparseHandle_t,
6453        dirA: cusparseDirection_t,
6454        m: ::core::ffi::c_int,
6455        n: ::core::ffi::c_int,
6456        descrA: cusparseMatDescr_t,
6457        A: *const cuDoubleComplex,
6458        lda: ::core::ffi::c_int,
6459        nnzPerRowCol: *mut ::core::ffi::c_int,
6460        nnzTotalDevHostPtr: *mut ::core::ffi::c_int,
6461    ) -> cusparseStatus_t;
6462}
6463unsafe extern "C" {
6464    /// This function is the step one to convert from csr format to compressed csr format.
6465    ///
6466    /// Given a sparse matrix A and a non-negative value threshold, the function returns nnzPerRow(the number of nonzeros columns per row) and nnzC(the total number of nonzeros) of a sparse matrix C, defined by
6467    ///
6468    /// A key assumption for the cuComplex and cuDoubleComplex case is that this tolerance is given as the real part. For example `tol = 1e-8 + 0*i` and we extract cureal, that is the x component of this struct.
6469    ///
6470    /// * This function requires temporary extra storage that is allocated internally.
6471    /// * The routine supports asynchronous execution if the Stream Ordered Memory Allocator is available.
6472    /// * The routine supports CUDA graph capture if the Stream Ordered Memory Allocator is available.
6473    pub fn cusparseSnnz_compress(
6474        handle: cusparseHandle_t,
6475        m: ::core::ffi::c_int,
6476        descr: cusparseMatDescr_t,
6477        csrSortedValA: *const f32,
6478        csrSortedRowPtrA: *const ::core::ffi::c_int,
6479        nnzPerRow: *mut ::core::ffi::c_int,
6480        nnzC: *mut ::core::ffi::c_int,
6481        tol: f32,
6482    ) -> cusparseStatus_t;
6483}
6484unsafe extern "C" {
6485    /// This function is the step one to convert from csr format to compressed csr format.
6486    ///
6487    /// Given a sparse matrix A and a non-negative value threshold, the function returns nnzPerRow(the number of nonzeros columns per row) and nnzC(the total number of nonzeros) of a sparse matrix C, defined by
6488    ///
6489    /// A key assumption for the cuComplex and cuDoubleComplex case is that this tolerance is given as the real part. For example `tol = 1e-8 + 0*i` and we extract cureal, that is the x component of this struct.
6490    ///
6491    /// * This function requires temporary extra storage that is allocated internally.
6492    /// * The routine supports asynchronous execution if the Stream Ordered Memory Allocator is available.
6493    /// * The routine supports CUDA graph capture if the Stream Ordered Memory Allocator is available.
6494    pub fn cusparseDnnz_compress(
6495        handle: cusparseHandle_t,
6496        m: ::core::ffi::c_int,
6497        descr: cusparseMatDescr_t,
6498        csrSortedValA: *const f64,
6499        csrSortedRowPtrA: *const ::core::ffi::c_int,
6500        nnzPerRow: *mut ::core::ffi::c_int,
6501        nnzC: *mut ::core::ffi::c_int,
6502        tol: f64,
6503    ) -> cusparseStatus_t;
6504}
6505unsafe extern "C" {
6506    /// This function is the step one to convert from csr format to compressed csr format.
6507    ///
6508    /// Given a sparse matrix A and a non-negative value threshold, the function returns nnzPerRow(the number of nonzeros columns per row) and nnzC(the total number of nonzeros) of a sparse matrix C, defined by
6509    ///
6510    /// A key assumption for the cuComplex and cuDoubleComplex case is that this tolerance is given as the real part. For example `tol = 1e-8 + 0*i` and we extract cureal, that is the x component of this struct.
6511    ///
6512    /// * This function requires temporary extra storage that is allocated internally.
6513    /// * The routine supports asynchronous execution if the Stream Ordered Memory Allocator is available.
6514    /// * The routine supports CUDA graph capture if the Stream Ordered Memory Allocator is available.
6515    pub fn cusparseCnnz_compress(
6516        handle: cusparseHandle_t,
6517        m: ::core::ffi::c_int,
6518        descr: cusparseMatDescr_t,
6519        csrSortedValA: *const cuComplex,
6520        csrSortedRowPtrA: *const ::core::ffi::c_int,
6521        nnzPerRow: *mut ::core::ffi::c_int,
6522        nnzC: *mut ::core::ffi::c_int,
6523        tol: cuComplex,
6524    ) -> cusparseStatus_t;
6525}
6526unsafe extern "C" {
6527    /// This function is the step one to convert from csr format to compressed csr format.
6528    ///
6529    /// Given a sparse matrix A and a non-negative value threshold, the function returns nnzPerRow(the number of nonzeros columns per row) and nnzC(the total number of nonzeros) of a sparse matrix C, defined by
6530    ///
6531    /// A key assumption for the cuComplex and cuDoubleComplex case is that this tolerance is given as the real part. For example `tol = 1e-8 + 0*i` and we extract cureal, that is the x component of this struct.
6532    ///
6533    /// * This function requires temporary extra storage that is allocated internally.
6534    /// * The routine supports asynchronous execution if the Stream Ordered Memory Allocator is available.
6535    /// * The routine supports CUDA graph capture if the Stream Ordered Memory Allocator is available.
6536    pub fn cusparseZnnz_compress(
6537        handle: cusparseHandle_t,
6538        m: ::core::ffi::c_int,
6539        descr: cusparseMatDescr_t,
6540        csrSortedValA: *const cuDoubleComplex,
6541        csrSortedRowPtrA: *const ::core::ffi::c_int,
6542        nnzPerRow: *mut ::core::ffi::c_int,
6543        nnzC: *mut ::core::ffi::c_int,
6544        tol: cuDoubleComplex,
6545    ) -> cusparseStatus_t;
6546}
6547unsafe extern "C" {
6548    pub fn cusparseScsr2csr_compress(
6549        handle: cusparseHandle_t,
6550        m: ::core::ffi::c_int,
6551        n: ::core::ffi::c_int,
6552        descrA: cusparseMatDescr_t,
6553        csrSortedValA: *const f32,
6554        csrSortedColIndA: *const ::core::ffi::c_int,
6555        csrSortedRowPtrA: *const ::core::ffi::c_int,
6556        nnzA: ::core::ffi::c_int,
6557        nnzPerRow: *const ::core::ffi::c_int,
6558        csrSortedValC: *mut f32,
6559        csrSortedColIndC: *mut ::core::ffi::c_int,
6560        csrSortedRowPtrC: *mut ::core::ffi::c_int,
6561        tol: f32,
6562    ) -> cusparseStatus_t;
6563}
6564unsafe extern "C" {
6565    pub fn cusparseDcsr2csr_compress(
6566        handle: cusparseHandle_t,
6567        m: ::core::ffi::c_int,
6568        n: ::core::ffi::c_int,
6569        descrA: cusparseMatDescr_t,
6570        csrSortedValA: *const f64,
6571        csrSortedColIndA: *const ::core::ffi::c_int,
6572        csrSortedRowPtrA: *const ::core::ffi::c_int,
6573        nnzA: ::core::ffi::c_int,
6574        nnzPerRow: *const ::core::ffi::c_int,
6575        csrSortedValC: *mut f64,
6576        csrSortedColIndC: *mut ::core::ffi::c_int,
6577        csrSortedRowPtrC: *mut ::core::ffi::c_int,
6578        tol: f64,
6579    ) -> cusparseStatus_t;
6580}
6581unsafe extern "C" {
6582    pub fn cusparseCcsr2csr_compress(
6583        handle: cusparseHandle_t,
6584        m: ::core::ffi::c_int,
6585        n: ::core::ffi::c_int,
6586        descrA: cusparseMatDescr_t,
6587        csrSortedValA: *const cuComplex,
6588        csrSortedColIndA: *const ::core::ffi::c_int,
6589        csrSortedRowPtrA: *const ::core::ffi::c_int,
6590        nnzA: ::core::ffi::c_int,
6591        nnzPerRow: *const ::core::ffi::c_int,
6592        csrSortedValC: *mut cuComplex,
6593        csrSortedColIndC: *mut ::core::ffi::c_int,
6594        csrSortedRowPtrC: *mut ::core::ffi::c_int,
6595        tol: cuComplex,
6596    ) -> cusparseStatus_t;
6597}
6598unsafe extern "C" {
6599    pub fn cusparseZcsr2csr_compress(
6600        handle: cusparseHandle_t,
6601        m: ::core::ffi::c_int,
6602        n: ::core::ffi::c_int,
6603        descrA: cusparseMatDescr_t,
6604        csrSortedValA: *const cuDoubleComplex,
6605        csrSortedColIndA: *const ::core::ffi::c_int,
6606        csrSortedRowPtrA: *const ::core::ffi::c_int,
6607        nnzA: ::core::ffi::c_int,
6608        nnzPerRow: *const ::core::ffi::c_int,
6609        csrSortedValC: *mut cuDoubleComplex,
6610        csrSortedColIndC: *mut ::core::ffi::c_int,
6611        csrSortedRowPtrC: *mut ::core::ffi::c_int,
6612        tol: cuDoubleComplex,
6613    ) -> cusparseStatus_t;
6614}
6615unsafe extern "C" {
6616    /// This function converts the array containing the uncompressed row indices (corresponding to COO format) into an array of compressed row pointers (corresponding to CSR format).
6617    ///
6618    /// It can also be used to convert the array containing the uncompressed column indices (corresponding to COO format) into an array of column pointers (corresponding to CSC format).
6619    ///
6620    /// * The routine requires no extra storage.
6621    /// * The routine supports asynchronous execution.
6622    /// * The routine supports CUDA graph capture.
6623    pub fn cusparseXcoo2csr(
6624        handle: cusparseHandle_t,
6625        cooRowInd: *const ::core::ffi::c_int,
6626        nnz: ::core::ffi::c_int,
6627        m: ::core::ffi::c_int,
6628        csrSortedRowPtr: *mut ::core::ffi::c_int,
6629        idxBase: cusparseIndexBase_t,
6630    ) -> cusparseStatus_t;
6631}
6632unsafe extern "C" {
6633    /// This function converts the array containing the compressed row pointers (corresponding to CSR format) into an array of uncompressed row indices (corresponding to COO format).
6634    ///
6635    /// It can also be used to convert the array containing the compressed column indices (corresponding to CSC format) into an array of uncompressed column indices (corresponding to COO format).
6636    ///
6637    /// * The routine requires no extra storage.
6638    /// * The routine supports asynchronous execution.
6639    /// * The routine supports CUDA graph capture.
6640    pub fn cusparseXcsr2coo(
6641        handle: cusparseHandle_t,
6642        csrSortedRowPtr: *const ::core::ffi::c_int,
6643        nnz: ::core::ffi::c_int,
6644        m: ::core::ffi::c_int,
6645        cooRowInd: *mut ::core::ffi::c_int,
6646        idxBase: cusparseIndexBase_t,
6647    ) -> cusparseStatus_t;
6648}
6649unsafe extern "C" {
6650    pub fn cusparseXcsr2bsrNnz(
6651        handle: cusparseHandle_t,
6652        dirA: cusparseDirection_t,
6653        m: ::core::ffi::c_int,
6654        n: ::core::ffi::c_int,
6655        descrA: cusparseMatDescr_t,
6656        csrSortedRowPtrA: *const ::core::ffi::c_int,
6657        csrSortedColIndA: *const ::core::ffi::c_int,
6658        blockDim: ::core::ffi::c_int,
6659        descrC: cusparseMatDescr_t,
6660        bsrSortedRowPtrC: *mut ::core::ffi::c_int,
6661        nnzTotalDevHostPtr: *mut ::core::ffi::c_int,
6662    ) -> cusparseStatus_t;
6663}
6664unsafe extern "C" {
6665    pub fn cusparseScsr2bsr(
6666        handle: cusparseHandle_t,
6667        dirA: cusparseDirection_t,
6668        m: ::core::ffi::c_int,
6669        n: ::core::ffi::c_int,
6670        descrA: cusparseMatDescr_t,
6671        csrSortedValA: *const f32,
6672        csrSortedRowPtrA: *const ::core::ffi::c_int,
6673        csrSortedColIndA: *const ::core::ffi::c_int,
6674        blockDim: ::core::ffi::c_int,
6675        descrC: cusparseMatDescr_t,
6676        bsrSortedValC: *mut f32,
6677        bsrSortedRowPtrC: *mut ::core::ffi::c_int,
6678        bsrSortedColIndC: *mut ::core::ffi::c_int,
6679    ) -> cusparseStatus_t;
6680}
6681unsafe extern "C" {
6682    pub fn cusparseDcsr2bsr(
6683        handle: cusparseHandle_t,
6684        dirA: cusparseDirection_t,
6685        m: ::core::ffi::c_int,
6686        n: ::core::ffi::c_int,
6687        descrA: cusparseMatDescr_t,
6688        csrSortedValA: *const f64,
6689        csrSortedRowPtrA: *const ::core::ffi::c_int,
6690        csrSortedColIndA: *const ::core::ffi::c_int,
6691        blockDim: ::core::ffi::c_int,
6692        descrC: cusparseMatDescr_t,
6693        bsrSortedValC: *mut f64,
6694        bsrSortedRowPtrC: *mut ::core::ffi::c_int,
6695        bsrSortedColIndC: *mut ::core::ffi::c_int,
6696    ) -> cusparseStatus_t;
6697}
6698unsafe extern "C" {
6699    pub fn cusparseCcsr2bsr(
6700        handle: cusparseHandle_t,
6701        dirA: cusparseDirection_t,
6702        m: ::core::ffi::c_int,
6703        n: ::core::ffi::c_int,
6704        descrA: cusparseMatDescr_t,
6705        csrSortedValA: *const cuComplex,
6706        csrSortedRowPtrA: *const ::core::ffi::c_int,
6707        csrSortedColIndA: *const ::core::ffi::c_int,
6708        blockDim: ::core::ffi::c_int,
6709        descrC: cusparseMatDescr_t,
6710        bsrSortedValC: *mut cuComplex,
6711        bsrSortedRowPtrC: *mut ::core::ffi::c_int,
6712        bsrSortedColIndC: *mut ::core::ffi::c_int,
6713    ) -> cusparseStatus_t;
6714}
6715unsafe extern "C" {
6716    pub fn cusparseZcsr2bsr(
6717        handle: cusparseHandle_t,
6718        dirA: cusparseDirection_t,
6719        m: ::core::ffi::c_int,
6720        n: ::core::ffi::c_int,
6721        descrA: cusparseMatDescr_t,
6722        csrSortedValA: *const cuDoubleComplex,
6723        csrSortedRowPtrA: *const ::core::ffi::c_int,
6724        csrSortedColIndA: *const ::core::ffi::c_int,
6725        blockDim: ::core::ffi::c_int,
6726        descrC: cusparseMatDescr_t,
6727        bsrSortedValC: *mut cuDoubleComplex,
6728        bsrSortedRowPtrC: *mut ::core::ffi::c_int,
6729        bsrSortedColIndC: *mut ::core::ffi::c_int,
6730    ) -> cusparseStatus_t;
6731}
6732unsafe extern "C" {
6733    /// This function converts a sparse matrix in BSR format that is defined by the three arrays `bsrValA`, `bsrRowPtrA`, and `bsrColIndA`) into a sparse matrix in CSR format that is defined by arrays `csrValC`, `csrRowPtrC`, and `csrColIndC`.
6734    ///
6735    /// Let `m(=mb*blockDim)` be the number of rows of `A` and `n(=nb*blockDim)` be number of columns of `A`, then `A` and `C` are `m*n` sparse matrices. The BSR format of `A` contains `nnzb(=bsrRowPtrA\[mb\] - bsrRowPtrA\[0\])` nonzero blocks, whereas the sparse matrix `A` contains `nnz(=nnzb*blockDim*blockDim)` elements. The user must allocate enough space for arrays `csrRowPtrC`, `csrColIndC`, and `csrValC`. The requirements are as follows:
6736    ///
6737    /// `csrRowPtrC` of `m+1` elements
6738    ///
6739    /// `csrValC` of `nnz` elements
6740    ///
6741    /// `csrColIndC` of `nnz` elements
6742    ///
6743    /// The general procedure is as follows:
6744    ///
6745    /// * The routine requires no extra storage
6746    /// * The routine supports asynchronous execution if `blockDim != 1` or the Stream Ordered Memory Allocator is available
6747    /// * The routine supports CUDA graph capture if `blockDim != 1` or the Stream Ordered Memory Allocator is available.
6748    pub fn cusparseSbsr2csr(
6749        handle: cusparseHandle_t,
6750        dirA: cusparseDirection_t,
6751        mb: ::core::ffi::c_int,
6752        nb: ::core::ffi::c_int,
6753        descrA: cusparseMatDescr_t,
6754        bsrSortedValA: *const f32,
6755        bsrSortedRowPtrA: *const ::core::ffi::c_int,
6756        bsrSortedColIndA: *const ::core::ffi::c_int,
6757        blockDim: ::core::ffi::c_int,
6758        descrC: cusparseMatDescr_t,
6759        csrSortedValC: *mut f32,
6760        csrSortedRowPtrC: *mut ::core::ffi::c_int,
6761        csrSortedColIndC: *mut ::core::ffi::c_int,
6762    ) -> cusparseStatus_t;
6763}
6764unsafe extern "C" {
6765    /// This function converts a sparse matrix in BSR format that is defined by the three arrays `bsrValA`, `bsrRowPtrA`, and `bsrColIndA`) into a sparse matrix in CSR format that is defined by arrays `csrValC`, `csrRowPtrC`, and `csrColIndC`.
6766    ///
6767    /// Let `m(=mb*blockDim)` be the number of rows of `A` and `n(=nb*blockDim)` be number of columns of `A`, then `A` and `C` are `m*n` sparse matrices. The BSR format of `A` contains `nnzb(=bsrRowPtrA\[mb\] - bsrRowPtrA\[0\])` nonzero blocks, whereas the sparse matrix `A` contains `nnz(=nnzb*blockDim*blockDim)` elements. The user must allocate enough space for arrays `csrRowPtrC`, `csrColIndC`, and `csrValC`. The requirements are as follows:
6768    ///
6769    /// `csrRowPtrC` of `m+1` elements
6770    ///
6771    /// `csrValC` of `nnz` elements
6772    ///
6773    /// `csrColIndC` of `nnz` elements
6774    ///
6775    /// The general procedure is as follows:
6776    ///
6777    /// * The routine requires no extra storage
6778    /// * The routine supports asynchronous execution if `blockDim != 1` or the Stream Ordered Memory Allocator is available
6779    /// * The routine supports CUDA graph capture if `blockDim != 1` or the Stream Ordered Memory Allocator is available.
6780    pub fn cusparseDbsr2csr(
6781        handle: cusparseHandle_t,
6782        dirA: cusparseDirection_t,
6783        mb: ::core::ffi::c_int,
6784        nb: ::core::ffi::c_int,
6785        descrA: cusparseMatDescr_t,
6786        bsrSortedValA: *const f64,
6787        bsrSortedRowPtrA: *const ::core::ffi::c_int,
6788        bsrSortedColIndA: *const ::core::ffi::c_int,
6789        blockDim: ::core::ffi::c_int,
6790        descrC: cusparseMatDescr_t,
6791        csrSortedValC: *mut f64,
6792        csrSortedRowPtrC: *mut ::core::ffi::c_int,
6793        csrSortedColIndC: *mut ::core::ffi::c_int,
6794    ) -> cusparseStatus_t;
6795}
6796unsafe extern "C" {
6797    /// This function converts a sparse matrix in BSR format that is defined by the three arrays `bsrValA`, `bsrRowPtrA`, and `bsrColIndA`) into a sparse matrix in CSR format that is defined by arrays `csrValC`, `csrRowPtrC`, and `csrColIndC`.
6798    ///
6799    /// Let `m(=mb*blockDim)` be the number of rows of `A` and `n(=nb*blockDim)` be number of columns of `A`, then `A` and `C` are `m*n` sparse matrices. The BSR format of `A` contains `nnzb(=bsrRowPtrA\[mb\] - bsrRowPtrA\[0\])` nonzero blocks, whereas the sparse matrix `A` contains `nnz(=nnzb*blockDim*blockDim)` elements. The user must allocate enough space for arrays `csrRowPtrC`, `csrColIndC`, and `csrValC`. The requirements are as follows:
6800    ///
6801    /// `csrRowPtrC` of `m+1` elements
6802    ///
6803    /// `csrValC` of `nnz` elements
6804    ///
6805    /// `csrColIndC` of `nnz` elements
6806    ///
6807    /// The general procedure is as follows:
6808    ///
6809    /// * The routine requires no extra storage
6810    /// * The routine supports asynchronous execution if `blockDim != 1` or the Stream Ordered Memory Allocator is available
6811    /// * The routine supports CUDA graph capture if `blockDim != 1` or the Stream Ordered Memory Allocator is available.
6812    pub fn cusparseCbsr2csr(
6813        handle: cusparseHandle_t,
6814        dirA: cusparseDirection_t,
6815        mb: ::core::ffi::c_int,
6816        nb: ::core::ffi::c_int,
6817        descrA: cusparseMatDescr_t,
6818        bsrSortedValA: *const cuComplex,
6819        bsrSortedRowPtrA: *const ::core::ffi::c_int,
6820        bsrSortedColIndA: *const ::core::ffi::c_int,
6821        blockDim: ::core::ffi::c_int,
6822        descrC: cusparseMatDescr_t,
6823        csrSortedValC: *mut cuComplex,
6824        csrSortedRowPtrC: *mut ::core::ffi::c_int,
6825        csrSortedColIndC: *mut ::core::ffi::c_int,
6826    ) -> cusparseStatus_t;
6827}
6828unsafe extern "C" {
6829    /// This function converts a sparse matrix in BSR format that is defined by the three arrays `bsrValA`, `bsrRowPtrA`, and `bsrColIndA`) into a sparse matrix in CSR format that is defined by arrays `csrValC`, `csrRowPtrC`, and `csrColIndC`.
6830    ///
6831    /// Let `m(=mb*blockDim)` be the number of rows of `A` and `n(=nb*blockDim)` be number of columns of `A`, then `A` and `C` are `m*n` sparse matrices. The BSR format of `A` contains `nnzb(=bsrRowPtrA\[mb\] - bsrRowPtrA\[0\])` nonzero blocks, whereas the sparse matrix `A` contains `nnz(=nnzb*blockDim*blockDim)` elements. The user must allocate enough space for arrays `csrRowPtrC`, `csrColIndC`, and `csrValC`. The requirements are as follows:
6832    ///
6833    /// `csrRowPtrC` of `m+1` elements
6834    ///
6835    /// `csrValC` of `nnz` elements
6836    ///
6837    /// `csrColIndC` of `nnz` elements
6838    ///
6839    /// The general procedure is as follows:
6840    ///
6841    /// * The routine requires no extra storage
6842    /// * The routine supports asynchronous execution if `blockDim != 1` or the Stream Ordered Memory Allocator is available
6843    /// * The routine supports CUDA graph capture if `blockDim != 1` or the Stream Ordered Memory Allocator is available.
6844    pub fn cusparseZbsr2csr(
6845        handle: cusparseHandle_t,
6846        dirA: cusparseDirection_t,
6847        mb: ::core::ffi::c_int,
6848        nb: ::core::ffi::c_int,
6849        descrA: cusparseMatDescr_t,
6850        bsrSortedValA: *const cuDoubleComplex,
6851        bsrSortedRowPtrA: *const ::core::ffi::c_int,
6852        bsrSortedColIndA: *const ::core::ffi::c_int,
6853        blockDim: ::core::ffi::c_int,
6854        descrC: cusparseMatDescr_t,
6855        csrSortedValC: *mut cuDoubleComplex,
6856        csrSortedRowPtrC: *mut ::core::ffi::c_int,
6857        csrSortedColIndC: *mut ::core::ffi::c_int,
6858    ) -> cusparseStatus_t;
6859}
6860unsafe extern "C" {
6861    pub fn cusparseSgebsr2gebsc_bufferSize(
6862        handle: cusparseHandle_t,
6863        mb: ::core::ffi::c_int,
6864        nb: ::core::ffi::c_int,
6865        nnzb: ::core::ffi::c_int,
6866        bsrSortedVal: *const f32,
6867        bsrSortedRowPtr: *const ::core::ffi::c_int,
6868        bsrSortedColInd: *const ::core::ffi::c_int,
6869        rowBlockDim: ::core::ffi::c_int,
6870        colBlockDim: ::core::ffi::c_int,
6871        pBufferSizeInBytes: *mut ::core::ffi::c_int,
6872    ) -> cusparseStatus_t;
6873}
6874unsafe extern "C" {
6875    pub fn cusparseDgebsr2gebsc_bufferSize(
6876        handle: cusparseHandle_t,
6877        mb: ::core::ffi::c_int,
6878        nb: ::core::ffi::c_int,
6879        nnzb: ::core::ffi::c_int,
6880        bsrSortedVal: *const f64,
6881        bsrSortedRowPtr: *const ::core::ffi::c_int,
6882        bsrSortedColInd: *const ::core::ffi::c_int,
6883        rowBlockDim: ::core::ffi::c_int,
6884        colBlockDim: ::core::ffi::c_int,
6885        pBufferSizeInBytes: *mut ::core::ffi::c_int,
6886    ) -> cusparseStatus_t;
6887}
6888unsafe extern "C" {
6889    pub fn cusparseCgebsr2gebsc_bufferSize(
6890        handle: cusparseHandle_t,
6891        mb: ::core::ffi::c_int,
6892        nb: ::core::ffi::c_int,
6893        nnzb: ::core::ffi::c_int,
6894        bsrSortedVal: *const cuComplex,
6895        bsrSortedRowPtr: *const ::core::ffi::c_int,
6896        bsrSortedColInd: *const ::core::ffi::c_int,
6897        rowBlockDim: ::core::ffi::c_int,
6898        colBlockDim: ::core::ffi::c_int,
6899        pBufferSizeInBytes: *mut ::core::ffi::c_int,
6900    ) -> cusparseStatus_t;
6901}
6902unsafe extern "C" {
6903    pub fn cusparseZgebsr2gebsc_bufferSize(
6904        handle: cusparseHandle_t,
6905        mb: ::core::ffi::c_int,
6906        nb: ::core::ffi::c_int,
6907        nnzb: ::core::ffi::c_int,
6908        bsrSortedVal: *const cuDoubleComplex,
6909        bsrSortedRowPtr: *const ::core::ffi::c_int,
6910        bsrSortedColInd: *const ::core::ffi::c_int,
6911        rowBlockDim: ::core::ffi::c_int,
6912        colBlockDim: ::core::ffi::c_int,
6913        pBufferSizeInBytes: *mut ::core::ffi::c_int,
6914    ) -> cusparseStatus_t;
6915}
6916unsafe extern "C" {
6917    pub fn cusparseSgebsr2gebsc_bufferSizeExt(
6918        handle: cusparseHandle_t,
6919        mb: ::core::ffi::c_int,
6920        nb: ::core::ffi::c_int,
6921        nnzb: ::core::ffi::c_int,
6922        bsrSortedVal: *const f32,
6923        bsrSortedRowPtr: *const ::core::ffi::c_int,
6924        bsrSortedColInd: *const ::core::ffi::c_int,
6925        rowBlockDim: ::core::ffi::c_int,
6926        colBlockDim: ::core::ffi::c_int,
6927        pBufferSize: *mut size_t,
6928    ) -> cusparseStatus_t;
6929}
6930unsafe extern "C" {
6931    pub fn cusparseDgebsr2gebsc_bufferSizeExt(
6932        handle: cusparseHandle_t,
6933        mb: ::core::ffi::c_int,
6934        nb: ::core::ffi::c_int,
6935        nnzb: ::core::ffi::c_int,
6936        bsrSortedVal: *const f64,
6937        bsrSortedRowPtr: *const ::core::ffi::c_int,
6938        bsrSortedColInd: *const ::core::ffi::c_int,
6939        rowBlockDim: ::core::ffi::c_int,
6940        colBlockDim: ::core::ffi::c_int,
6941        pBufferSize: *mut size_t,
6942    ) -> cusparseStatus_t;
6943}
6944unsafe extern "C" {
6945    pub fn cusparseCgebsr2gebsc_bufferSizeExt(
6946        handle: cusparseHandle_t,
6947        mb: ::core::ffi::c_int,
6948        nb: ::core::ffi::c_int,
6949        nnzb: ::core::ffi::c_int,
6950        bsrSortedVal: *const cuComplex,
6951        bsrSortedRowPtr: *const ::core::ffi::c_int,
6952        bsrSortedColInd: *const ::core::ffi::c_int,
6953        rowBlockDim: ::core::ffi::c_int,
6954        colBlockDim: ::core::ffi::c_int,
6955        pBufferSize: *mut size_t,
6956    ) -> cusparseStatus_t;
6957}
6958unsafe extern "C" {
6959    pub fn cusparseZgebsr2gebsc_bufferSizeExt(
6960        handle: cusparseHandle_t,
6961        mb: ::core::ffi::c_int,
6962        nb: ::core::ffi::c_int,
6963        nnzb: ::core::ffi::c_int,
6964        bsrSortedVal: *const cuDoubleComplex,
6965        bsrSortedRowPtr: *const ::core::ffi::c_int,
6966        bsrSortedColInd: *const ::core::ffi::c_int,
6967        rowBlockDim: ::core::ffi::c_int,
6968        colBlockDim: ::core::ffi::c_int,
6969        pBufferSize: *mut size_t,
6970    ) -> cusparseStatus_t;
6971}
6972unsafe extern "C" {
6973    /// This function can be seen as the same as `csr2csc()` when each block of size `rowBlockDim*colBlockDim` is regarded as a scalar.
6974    ///
6975    /// This sparsity pattern of the result matrix can also be seen as the transpose of the original sparse matrix, but the memory layout of a block does not change.
6976    ///
6977    /// The user must call `gebsr2gebsc_bufferSize()` to determine the size of the buffer required by `gebsr2gebsc()`, allocate the buffer, and pass the buffer pointer to `gebsr2gebsc()`.
6978    ///
6979    /// * The routine requires no extra storage if `pBuffer != NULL`
6980    /// * The routine supports asynchronous execution if the Stream Ordered Memory Allocator is available
6981    /// * The routine supports CUDA graph capture if the Stream Ordered Memory Allocator is available.
6982    pub fn cusparseSgebsr2gebsc(
6983        handle: cusparseHandle_t,
6984        mb: ::core::ffi::c_int,
6985        nb: ::core::ffi::c_int,
6986        nnzb: ::core::ffi::c_int,
6987        bsrSortedVal: *const f32,
6988        bsrSortedRowPtr: *const ::core::ffi::c_int,
6989        bsrSortedColInd: *const ::core::ffi::c_int,
6990        rowBlockDim: ::core::ffi::c_int,
6991        colBlockDim: ::core::ffi::c_int,
6992        bscVal: *mut f32,
6993        bscRowInd: *mut ::core::ffi::c_int,
6994        bscColPtr: *mut ::core::ffi::c_int,
6995        copyValues: cusparseAction_t,
6996        idxBase: cusparseIndexBase_t,
6997        pBuffer: *mut ::core::ffi::c_void,
6998    ) -> cusparseStatus_t;
6999}
7000unsafe extern "C" {
7001    /// This function can be seen as the same as `csr2csc()` when each block of size `rowBlockDim*colBlockDim` is regarded as a scalar.
7002    ///
7003    /// This sparsity pattern of the result matrix can also be seen as the transpose of the original sparse matrix, but the memory layout of a block does not change.
7004    ///
7005    /// The user must call `gebsr2gebsc_bufferSize()` to determine the size of the buffer required by `gebsr2gebsc()`, allocate the buffer, and pass the buffer pointer to `gebsr2gebsc()`.
7006    ///
7007    /// * The routine requires no extra storage if `pBuffer != NULL`
7008    /// * The routine supports asynchronous execution if the Stream Ordered Memory Allocator is available
7009    /// * The routine supports CUDA graph capture if the Stream Ordered Memory Allocator is available.
7010    pub fn cusparseDgebsr2gebsc(
7011        handle: cusparseHandle_t,
7012        mb: ::core::ffi::c_int,
7013        nb: ::core::ffi::c_int,
7014        nnzb: ::core::ffi::c_int,
7015        bsrSortedVal: *const f64,
7016        bsrSortedRowPtr: *const ::core::ffi::c_int,
7017        bsrSortedColInd: *const ::core::ffi::c_int,
7018        rowBlockDim: ::core::ffi::c_int,
7019        colBlockDim: ::core::ffi::c_int,
7020        bscVal: *mut f64,
7021        bscRowInd: *mut ::core::ffi::c_int,
7022        bscColPtr: *mut ::core::ffi::c_int,
7023        copyValues: cusparseAction_t,
7024        idxBase: cusparseIndexBase_t,
7025        pBuffer: *mut ::core::ffi::c_void,
7026    ) -> cusparseStatus_t;
7027}
7028unsafe extern "C" {
7029    /// This function can be seen as the same as `csr2csc()` when each block of size `rowBlockDim*colBlockDim` is regarded as a scalar.
7030    ///
7031    /// This sparsity pattern of the result matrix can also be seen as the transpose of the original sparse matrix, but the memory layout of a block does not change.
7032    ///
7033    /// The user must call `gebsr2gebsc_bufferSize()` to determine the size of the buffer required by `gebsr2gebsc()`, allocate the buffer, and pass the buffer pointer to `gebsr2gebsc()`.
7034    ///
7035    /// * The routine requires no extra storage if `pBuffer != NULL`
7036    /// * The routine supports asynchronous execution if the Stream Ordered Memory Allocator is available
7037    /// * The routine supports CUDA graph capture if the Stream Ordered Memory Allocator is available.
7038    pub fn cusparseCgebsr2gebsc(
7039        handle: cusparseHandle_t,
7040        mb: ::core::ffi::c_int,
7041        nb: ::core::ffi::c_int,
7042        nnzb: ::core::ffi::c_int,
7043        bsrSortedVal: *const cuComplex,
7044        bsrSortedRowPtr: *const ::core::ffi::c_int,
7045        bsrSortedColInd: *const ::core::ffi::c_int,
7046        rowBlockDim: ::core::ffi::c_int,
7047        colBlockDim: ::core::ffi::c_int,
7048        bscVal: *mut cuComplex,
7049        bscRowInd: *mut ::core::ffi::c_int,
7050        bscColPtr: *mut ::core::ffi::c_int,
7051        copyValues: cusparseAction_t,
7052        idxBase: cusparseIndexBase_t,
7053        pBuffer: *mut ::core::ffi::c_void,
7054    ) -> cusparseStatus_t;
7055}
7056unsafe extern "C" {
7057    /// This function can be seen as the same as `csr2csc()` when each block of size `rowBlockDim*colBlockDim` is regarded as a scalar.
7058    ///
7059    /// This sparsity pattern of the result matrix can also be seen as the transpose of the original sparse matrix, but the memory layout of a block does not change.
7060    ///
7061    /// The user must call `gebsr2gebsc_bufferSize()` to determine the size of the buffer required by `gebsr2gebsc()`, allocate the buffer, and pass the buffer pointer to `gebsr2gebsc()`.
7062    ///
7063    /// * The routine requires no extra storage if `pBuffer != NULL`
7064    /// * The routine supports asynchronous execution if the Stream Ordered Memory Allocator is available
7065    /// * The routine supports CUDA graph capture if the Stream Ordered Memory Allocator is available.
7066    pub fn cusparseZgebsr2gebsc(
7067        handle: cusparseHandle_t,
7068        mb: ::core::ffi::c_int,
7069        nb: ::core::ffi::c_int,
7070        nnzb: ::core::ffi::c_int,
7071        bsrSortedVal: *const cuDoubleComplex,
7072        bsrSortedRowPtr: *const ::core::ffi::c_int,
7073        bsrSortedColInd: *const ::core::ffi::c_int,
7074        rowBlockDim: ::core::ffi::c_int,
7075        colBlockDim: ::core::ffi::c_int,
7076        bscVal: *mut cuDoubleComplex,
7077        bscRowInd: *mut ::core::ffi::c_int,
7078        bscColPtr: *mut ::core::ffi::c_int,
7079        copyValues: cusparseAction_t,
7080        idxBase: cusparseIndexBase_t,
7081        pBuffer: *mut ::core::ffi::c_void,
7082    ) -> cusparseStatus_t;
7083}
7084unsafe extern "C" {
7085    /// This function converts a sparse matrix in BSR format that is defined by the three arrays `bsrValA`, `bsrRowPtrA`, and `bsrColIndA`) into a sparse matrix in CSR format that is defined by arrays `csrValC`, `csrRowPtrC`, and `csrColIndC`.
7086    ///
7087    /// Let `m(=mb*blockDim)` be the number of rows of `A` and `n(=nb*blockDim)` be number of columns of `A`, then `A` and `C` are `m*n` sparse matrices. The BSR format of `A` contains `nnzb(=bsrRowPtrA\[mb\] - bsrRowPtrA\[0\])` nonzero blocks, whereas the sparse matrix `A` contains `nnz(=nnzb*blockDim*blockDim)` elements. The user must allocate enough space for arrays `csrRowPtrC`, `csrColIndC`, and `csrValC`. The requirements are as follows:
7088    ///
7089    /// `csrRowPtrC` of `m+1` elements
7090    ///
7091    /// `csrValC` of `nnz` elements
7092    ///
7093    /// `csrColIndC` of `nnz` elements
7094    ///
7095    /// The general procedure is as follows:
7096    ///
7097    /// * The routine requires no extra storage
7098    /// * The routine supports asynchronous execution if `blockDim != 1` or the Stream Ordered Memory Allocator is available
7099    /// * The routine supports CUDA graph capture if `blockDim != 1` or the Stream Ordered Memory Allocator is available.
7100    pub fn cusparseXgebsr2csr(
7101        handle: cusparseHandle_t,
7102        dirA: cusparseDirection_t,
7103        mb: ::core::ffi::c_int,
7104        nb: ::core::ffi::c_int,
7105        descrA: cusparseMatDescr_t,
7106        bsrSortedRowPtrA: *const ::core::ffi::c_int,
7107        bsrSortedColIndA: *const ::core::ffi::c_int,
7108        rowBlockDim: ::core::ffi::c_int,
7109        colBlockDim: ::core::ffi::c_int,
7110        descrC: cusparseMatDescr_t,
7111        csrSortedRowPtrC: *mut ::core::ffi::c_int,
7112        csrSortedColIndC: *mut ::core::ffi::c_int,
7113    ) -> cusparseStatus_t;
7114}
7115unsafe extern "C" {
7116    /// This function converts a sparse matrix in BSR format that is defined by the three arrays `bsrValA`, `bsrRowPtrA`, and `bsrColIndA`) into a sparse matrix in CSR format that is defined by arrays `csrValC`, `csrRowPtrC`, and `csrColIndC`.
7117    ///
7118    /// Let `m(=mb*blockDim)` be the number of rows of `A` and `n(=nb*blockDim)` be number of columns of `A`, then `A` and `C` are `m*n` sparse matrices. The BSR format of `A` contains `nnzb(=bsrRowPtrA\[mb\] - bsrRowPtrA\[0\])` nonzero blocks, whereas the sparse matrix `A` contains `nnz(=nnzb*blockDim*blockDim)` elements. The user must allocate enough space for arrays `csrRowPtrC`, `csrColIndC`, and `csrValC`. The requirements are as follows:
7119    ///
7120    /// `csrRowPtrC` of `m+1` elements
7121    ///
7122    /// `csrValC` of `nnz` elements
7123    ///
7124    /// `csrColIndC` of `nnz` elements
7125    ///
7126    /// The general procedure is as follows:
7127    ///
7128    /// * The routine requires no extra storage
7129    /// * The routine supports asynchronous execution if `blockDim != 1` or the Stream Ordered Memory Allocator is available
7130    /// * The routine supports CUDA graph capture if `blockDim != 1` or the Stream Ordered Memory Allocator is available.
7131    pub fn cusparseSgebsr2csr(
7132        handle: cusparseHandle_t,
7133        dirA: cusparseDirection_t,
7134        mb: ::core::ffi::c_int,
7135        nb: ::core::ffi::c_int,
7136        descrA: cusparseMatDescr_t,
7137        bsrSortedValA: *const f32,
7138        bsrSortedRowPtrA: *const ::core::ffi::c_int,
7139        bsrSortedColIndA: *const ::core::ffi::c_int,
7140        rowBlockDim: ::core::ffi::c_int,
7141        colBlockDim: ::core::ffi::c_int,
7142        descrC: cusparseMatDescr_t,
7143        csrSortedValC: *mut f32,
7144        csrSortedRowPtrC: *mut ::core::ffi::c_int,
7145        csrSortedColIndC: *mut ::core::ffi::c_int,
7146    ) -> cusparseStatus_t;
7147}
7148unsafe extern "C" {
7149    /// This function converts a sparse matrix in BSR format that is defined by the three arrays `bsrValA`, `bsrRowPtrA`, and `bsrColIndA`) into a sparse matrix in CSR format that is defined by arrays `csrValC`, `csrRowPtrC`, and `csrColIndC`.
7150    ///
7151    /// Let `m(=mb*blockDim)` be the number of rows of `A` and `n(=nb*blockDim)` be number of columns of `A`, then `A` and `C` are `m*n` sparse matrices. The BSR format of `A` contains `nnzb(=bsrRowPtrA\[mb\] - bsrRowPtrA\[0\])` nonzero blocks, whereas the sparse matrix `A` contains `nnz(=nnzb*blockDim*blockDim)` elements. The user must allocate enough space for arrays `csrRowPtrC`, `csrColIndC`, and `csrValC`. The requirements are as follows:
7152    ///
7153    /// `csrRowPtrC` of `m+1` elements
7154    ///
7155    /// `csrValC` of `nnz` elements
7156    ///
7157    /// `csrColIndC` of `nnz` elements
7158    ///
7159    /// The general procedure is as follows:
7160    ///
7161    /// * The routine requires no extra storage
7162    /// * The routine supports asynchronous execution if `blockDim != 1` or the Stream Ordered Memory Allocator is available
7163    /// * The routine supports CUDA graph capture if `blockDim != 1` or the Stream Ordered Memory Allocator is available.
7164    pub fn cusparseDgebsr2csr(
7165        handle: cusparseHandle_t,
7166        dirA: cusparseDirection_t,
7167        mb: ::core::ffi::c_int,
7168        nb: ::core::ffi::c_int,
7169        descrA: cusparseMatDescr_t,
7170        bsrSortedValA: *const f64,
7171        bsrSortedRowPtrA: *const ::core::ffi::c_int,
7172        bsrSortedColIndA: *const ::core::ffi::c_int,
7173        rowBlockDim: ::core::ffi::c_int,
7174        colBlockDim: ::core::ffi::c_int,
7175        descrC: cusparseMatDescr_t,
7176        csrSortedValC: *mut f64,
7177        csrSortedRowPtrC: *mut ::core::ffi::c_int,
7178        csrSortedColIndC: *mut ::core::ffi::c_int,
7179    ) -> cusparseStatus_t;
7180}
7181unsafe extern "C" {
7182    /// This function converts a sparse matrix in BSR format that is defined by the three arrays `bsrValA`, `bsrRowPtrA`, and `bsrColIndA`) into a sparse matrix in CSR format that is defined by arrays `csrValC`, `csrRowPtrC`, and `csrColIndC`.
7183    ///
7184    /// Let `m(=mb*blockDim)` be the number of rows of `A` and `n(=nb*blockDim)` be number of columns of `A`, then `A` and `C` are `m*n` sparse matrices. The BSR format of `A` contains `nnzb(=bsrRowPtrA\[mb\] - bsrRowPtrA\[0\])` nonzero blocks, whereas the sparse matrix `A` contains `nnz(=nnzb*blockDim*blockDim)` elements. The user must allocate enough space for arrays `csrRowPtrC`, `csrColIndC`, and `csrValC`. The requirements are as follows:
7185    ///
7186    /// `csrRowPtrC` of `m+1` elements
7187    ///
7188    /// `csrValC` of `nnz` elements
7189    ///
7190    /// `csrColIndC` of `nnz` elements
7191    ///
7192    /// The general procedure is as follows:
7193    ///
7194    /// * The routine requires no extra storage
7195    /// * The routine supports asynchronous execution if `blockDim != 1` or the Stream Ordered Memory Allocator is available
7196    /// * The routine supports CUDA graph capture if `blockDim != 1` or the Stream Ordered Memory Allocator is available.
7197    pub fn cusparseCgebsr2csr(
7198        handle: cusparseHandle_t,
7199        dirA: cusparseDirection_t,
7200        mb: ::core::ffi::c_int,
7201        nb: ::core::ffi::c_int,
7202        descrA: cusparseMatDescr_t,
7203        bsrSortedValA: *const cuComplex,
7204        bsrSortedRowPtrA: *const ::core::ffi::c_int,
7205        bsrSortedColIndA: *const ::core::ffi::c_int,
7206        rowBlockDim: ::core::ffi::c_int,
7207        colBlockDim: ::core::ffi::c_int,
7208        descrC: cusparseMatDescr_t,
7209        csrSortedValC: *mut cuComplex,
7210        csrSortedRowPtrC: *mut ::core::ffi::c_int,
7211        csrSortedColIndC: *mut ::core::ffi::c_int,
7212    ) -> cusparseStatus_t;
7213}
7214unsafe extern "C" {
7215    /// This function converts a sparse matrix in BSR format that is defined by the three arrays `bsrValA`, `bsrRowPtrA`, and `bsrColIndA`) into a sparse matrix in CSR format that is defined by arrays `csrValC`, `csrRowPtrC`, and `csrColIndC`.
7216    ///
7217    /// Let `m(=mb*blockDim)` be the number of rows of `A` and `n(=nb*blockDim)` be number of columns of `A`, then `A` and `C` are `m*n` sparse matrices. The BSR format of `A` contains `nnzb(=bsrRowPtrA\[mb\] - bsrRowPtrA\[0\])` nonzero blocks, whereas the sparse matrix `A` contains `nnz(=nnzb*blockDim*blockDim)` elements. The user must allocate enough space for arrays `csrRowPtrC`, `csrColIndC`, and `csrValC`. The requirements are as follows:
7218    ///
7219    /// `csrRowPtrC` of `m+1` elements
7220    ///
7221    /// `csrValC` of `nnz` elements
7222    ///
7223    /// `csrColIndC` of `nnz` elements
7224    ///
7225    /// The general procedure is as follows:
7226    ///
7227    /// * The routine requires no extra storage
7228    /// * The routine supports asynchronous execution if `blockDim != 1` or the Stream Ordered Memory Allocator is available
7229    /// * The routine supports CUDA graph capture if `blockDim != 1` or the Stream Ordered Memory Allocator is available.
7230    pub fn cusparseZgebsr2csr(
7231        handle: cusparseHandle_t,
7232        dirA: cusparseDirection_t,
7233        mb: ::core::ffi::c_int,
7234        nb: ::core::ffi::c_int,
7235        descrA: cusparseMatDescr_t,
7236        bsrSortedValA: *const cuDoubleComplex,
7237        bsrSortedRowPtrA: *const ::core::ffi::c_int,
7238        bsrSortedColIndA: *const ::core::ffi::c_int,
7239        rowBlockDim: ::core::ffi::c_int,
7240        colBlockDim: ::core::ffi::c_int,
7241        descrC: cusparseMatDescr_t,
7242        csrSortedValC: *mut cuDoubleComplex,
7243        csrSortedRowPtrC: *mut ::core::ffi::c_int,
7244        csrSortedColIndC: *mut ::core::ffi::c_int,
7245    ) -> cusparseStatus_t;
7246}
7247unsafe extern "C" {
7248    pub fn cusparseScsr2gebsr_bufferSize(
7249        handle: cusparseHandle_t,
7250        dirA: cusparseDirection_t,
7251        m: ::core::ffi::c_int,
7252        n: ::core::ffi::c_int,
7253        descrA: cusparseMatDescr_t,
7254        csrSortedValA: *const f32,
7255        csrSortedRowPtrA: *const ::core::ffi::c_int,
7256        csrSortedColIndA: *const ::core::ffi::c_int,
7257        rowBlockDim: ::core::ffi::c_int,
7258        colBlockDim: ::core::ffi::c_int,
7259        pBufferSizeInBytes: *mut ::core::ffi::c_int,
7260    ) -> cusparseStatus_t;
7261}
7262unsafe extern "C" {
7263    pub fn cusparseDcsr2gebsr_bufferSize(
7264        handle: cusparseHandle_t,
7265        dirA: cusparseDirection_t,
7266        m: ::core::ffi::c_int,
7267        n: ::core::ffi::c_int,
7268        descrA: cusparseMatDescr_t,
7269        csrSortedValA: *const f64,
7270        csrSortedRowPtrA: *const ::core::ffi::c_int,
7271        csrSortedColIndA: *const ::core::ffi::c_int,
7272        rowBlockDim: ::core::ffi::c_int,
7273        colBlockDim: ::core::ffi::c_int,
7274        pBufferSizeInBytes: *mut ::core::ffi::c_int,
7275    ) -> cusparseStatus_t;
7276}
7277unsafe extern "C" {
7278    pub fn cusparseCcsr2gebsr_bufferSize(
7279        handle: cusparseHandle_t,
7280        dirA: cusparseDirection_t,
7281        m: ::core::ffi::c_int,
7282        n: ::core::ffi::c_int,
7283        descrA: cusparseMatDescr_t,
7284        csrSortedValA: *const cuComplex,
7285        csrSortedRowPtrA: *const ::core::ffi::c_int,
7286        csrSortedColIndA: *const ::core::ffi::c_int,
7287        rowBlockDim: ::core::ffi::c_int,
7288        colBlockDim: ::core::ffi::c_int,
7289        pBufferSizeInBytes: *mut ::core::ffi::c_int,
7290    ) -> cusparseStatus_t;
7291}
7292unsafe extern "C" {
7293    pub fn cusparseZcsr2gebsr_bufferSize(
7294        handle: cusparseHandle_t,
7295        dirA: cusparseDirection_t,
7296        m: ::core::ffi::c_int,
7297        n: ::core::ffi::c_int,
7298        descrA: cusparseMatDescr_t,
7299        csrSortedValA: *const cuDoubleComplex,
7300        csrSortedRowPtrA: *const ::core::ffi::c_int,
7301        csrSortedColIndA: *const ::core::ffi::c_int,
7302        rowBlockDim: ::core::ffi::c_int,
7303        colBlockDim: ::core::ffi::c_int,
7304        pBufferSizeInBytes: *mut ::core::ffi::c_int,
7305    ) -> cusparseStatus_t;
7306}
7307unsafe extern "C" {
7308    pub fn cusparseScsr2gebsr_bufferSizeExt(
7309        handle: cusparseHandle_t,
7310        dirA: cusparseDirection_t,
7311        m: ::core::ffi::c_int,
7312        n: ::core::ffi::c_int,
7313        descrA: cusparseMatDescr_t,
7314        csrSortedValA: *const f32,
7315        csrSortedRowPtrA: *const ::core::ffi::c_int,
7316        csrSortedColIndA: *const ::core::ffi::c_int,
7317        rowBlockDim: ::core::ffi::c_int,
7318        colBlockDim: ::core::ffi::c_int,
7319        pBufferSize: *mut size_t,
7320    ) -> cusparseStatus_t;
7321}
7322unsafe extern "C" {
7323    pub fn cusparseDcsr2gebsr_bufferSizeExt(
7324        handle: cusparseHandle_t,
7325        dirA: cusparseDirection_t,
7326        m: ::core::ffi::c_int,
7327        n: ::core::ffi::c_int,
7328        descrA: cusparseMatDescr_t,
7329        csrSortedValA: *const f64,
7330        csrSortedRowPtrA: *const ::core::ffi::c_int,
7331        csrSortedColIndA: *const ::core::ffi::c_int,
7332        rowBlockDim: ::core::ffi::c_int,
7333        colBlockDim: ::core::ffi::c_int,
7334        pBufferSize: *mut size_t,
7335    ) -> cusparseStatus_t;
7336}
7337unsafe extern "C" {
7338    pub fn cusparseCcsr2gebsr_bufferSizeExt(
7339        handle: cusparseHandle_t,
7340        dirA: cusparseDirection_t,
7341        m: ::core::ffi::c_int,
7342        n: ::core::ffi::c_int,
7343        descrA: cusparseMatDescr_t,
7344        csrSortedValA: *const cuComplex,
7345        csrSortedRowPtrA: *const ::core::ffi::c_int,
7346        csrSortedColIndA: *const ::core::ffi::c_int,
7347        rowBlockDim: ::core::ffi::c_int,
7348        colBlockDim: ::core::ffi::c_int,
7349        pBufferSize: *mut size_t,
7350    ) -> cusparseStatus_t;
7351}
7352unsafe extern "C" {
7353    pub fn cusparseZcsr2gebsr_bufferSizeExt(
7354        handle: cusparseHandle_t,
7355        dirA: cusparseDirection_t,
7356        m: ::core::ffi::c_int,
7357        n: ::core::ffi::c_int,
7358        descrA: cusparseMatDescr_t,
7359        csrSortedValA: *const cuDoubleComplex,
7360        csrSortedRowPtrA: *const ::core::ffi::c_int,
7361        csrSortedColIndA: *const ::core::ffi::c_int,
7362        rowBlockDim: ::core::ffi::c_int,
7363        colBlockDim: ::core::ffi::c_int,
7364        pBufferSize: *mut size_t,
7365    ) -> cusparseStatus_t;
7366}
7367unsafe extern "C" {
7368    pub fn cusparseXcsr2gebsrNnz(
7369        handle: cusparseHandle_t,
7370        dirA: cusparseDirection_t,
7371        m: ::core::ffi::c_int,
7372        n: ::core::ffi::c_int,
7373        descrA: cusparseMatDescr_t,
7374        csrSortedRowPtrA: *const ::core::ffi::c_int,
7375        csrSortedColIndA: *const ::core::ffi::c_int,
7376        descrC: cusparseMatDescr_t,
7377        bsrSortedRowPtrC: *mut ::core::ffi::c_int,
7378        rowBlockDim: ::core::ffi::c_int,
7379        colBlockDim: ::core::ffi::c_int,
7380        nnzTotalDevHostPtr: *mut ::core::ffi::c_int,
7381        pBuffer: *mut ::core::ffi::c_void,
7382    ) -> cusparseStatus_t;
7383}
7384unsafe extern "C" {
7385    /// This function converts a sparse matrix `A` in CSR format (that is defined by arrays `csrValA`, `csrRowPtrA`, and `csrColIndA`) into a sparse matrix `C` in general BSR format (that is defined by the three arrays `bsrValC`, `bsrRowPtrC`, and `bsrColIndC`).
7386    ///
7387    /// The matrix A is an :math: m times n sparse matrix and matrix `C` is a `(mb*rowBlockDim)*(nb*colBlockDim)` sparse matrix, where `mb(=(m+rowBlockDim-1)/rowBlockDim)` is the number of block rows of `C`, and `nb(=(n+colBlockDim-1)/colBlockDim)` is the number of block columns of `C`.
7388    ///
7389    /// The block of `C` is of size `rowBlockDim*colBlockDim`. If `m` is not multiple of `rowBlockDim` or `n` is not multiple of `colBlockDim`, zeros are filled in.
7390    ///
7391    /// The implementation adopts a two-step approach to do the conversion. First, the user allocates `bsrRowPtrC` of `mb+1` elements and uses function [`cusparseXcsr2gebsrNnz`] to determine the number of nonzero block columns per block row. Second, the user gathers `nnzb` (number of nonzero block columns of matrix `C`) from either `(nnzb=*nnzTotalDevHostPtr)` or `(nnzb=bsrRowPtrC\[mb\]-bsrRowPtrC\[0\])` and allocates `bsrValC` of `nnzb*rowBlockDim*colBlockDim` elements and `bsrColIndC` of `nnzb` integers. Finally function `cusparse\[S|D|C|Z\]csr2gebsr()` is called to complete the conversion.
7392    ///
7393    /// The user must obtain the size of the buffer required by `csr2gebsr()` by calling `csr2gebsr_bufferSize()`, allocate the buffer, and pass the buffer pointer to `csr2gebsr()`.
7394    ///
7395    /// The general procedure is as follows:
7396    ///
7397    /// The routine [`cusparseXcsr2gebsrNnz`] has the following properties:
7398    ///
7399    /// * The routine requires no extra storage.
7400    /// * The routine supports asynchronous execution if the Stream Ordered Memory Allocator is available.
7401    /// * The routine supports CUDA graph capture if the Stream Ordered Memory Allocator is available.
7402    ///
7403    /// The routine `cusparse&lt;t>csr2gebsr()` has the following properties:
7404    ///
7405    /// * The routine requires no extra storage if `pBuffer != NULL`.
7406    /// * The routine supports asynchronous execution.
7407    /// * The routine supports CUDA graph capture.
7408    pub fn cusparseScsr2gebsr(
7409        handle: cusparseHandle_t,
7410        dirA: cusparseDirection_t,
7411        m: ::core::ffi::c_int,
7412        n: ::core::ffi::c_int,
7413        descrA: cusparseMatDescr_t,
7414        csrSortedValA: *const f32,
7415        csrSortedRowPtrA: *const ::core::ffi::c_int,
7416        csrSortedColIndA: *const ::core::ffi::c_int,
7417        descrC: cusparseMatDescr_t,
7418        bsrSortedValC: *mut f32,
7419        bsrSortedRowPtrC: *mut ::core::ffi::c_int,
7420        bsrSortedColIndC: *mut ::core::ffi::c_int,
7421        rowBlockDim: ::core::ffi::c_int,
7422        colBlockDim: ::core::ffi::c_int,
7423        pBuffer: *mut ::core::ffi::c_void,
7424    ) -> cusparseStatus_t;
7425}
7426unsafe extern "C" {
7427    /// This function converts a sparse matrix `A` in CSR format (that is defined by arrays `csrValA`, `csrRowPtrA`, and `csrColIndA`) into a sparse matrix `C` in general BSR format (that is defined by the three arrays `bsrValC`, `bsrRowPtrC`, and `bsrColIndC`).
7428    ///
7429    /// The matrix A is an :math: m times n sparse matrix and matrix `C` is a `(mb*rowBlockDim)*(nb*colBlockDim)` sparse matrix, where `mb(=(m+rowBlockDim-1)/rowBlockDim)` is the number of block rows of `C`, and `nb(=(n+colBlockDim-1)/colBlockDim)` is the number of block columns of `C`.
7430    ///
7431    /// The block of `C` is of size `rowBlockDim*colBlockDim`. If `m` is not multiple of `rowBlockDim` or `n` is not multiple of `colBlockDim`, zeros are filled in.
7432    ///
7433    /// The implementation adopts a two-step approach to do the conversion. First, the user allocates `bsrRowPtrC` of `mb+1` elements and uses function [`cusparseXcsr2gebsrNnz`] to determine the number of nonzero block columns per block row. Second, the user gathers `nnzb` (number of nonzero block columns of matrix `C`) from either `(nnzb=*nnzTotalDevHostPtr)` or `(nnzb=bsrRowPtrC\[mb\]-bsrRowPtrC\[0\])` and allocates `bsrValC` of `nnzb*rowBlockDim*colBlockDim` elements and `bsrColIndC` of `nnzb` integers. Finally function `cusparse\[S|D|C|Z\]csr2gebsr()` is called to complete the conversion.
7434    ///
7435    /// The user must obtain the size of the buffer required by `csr2gebsr()` by calling `csr2gebsr_bufferSize()`, allocate the buffer, and pass the buffer pointer to `csr2gebsr()`.
7436    ///
7437    /// The general procedure is as follows:
7438    ///
7439    /// The routine [`cusparseXcsr2gebsrNnz`] has the following properties:
7440    ///
7441    /// * The routine requires no extra storage.
7442    /// * The routine supports asynchronous execution if the Stream Ordered Memory Allocator is available.
7443    /// * The routine supports CUDA graph capture if the Stream Ordered Memory Allocator is available.
7444    ///
7445    /// The routine `cusparse&lt;t>csr2gebsr()` has the following properties:
7446    ///
7447    /// * The routine requires no extra storage if `pBuffer != NULL`.
7448    /// * The routine supports asynchronous execution.
7449    /// * The routine supports CUDA graph capture.
7450    pub fn cusparseDcsr2gebsr(
7451        handle: cusparseHandle_t,
7452        dirA: cusparseDirection_t,
7453        m: ::core::ffi::c_int,
7454        n: ::core::ffi::c_int,
7455        descrA: cusparseMatDescr_t,
7456        csrSortedValA: *const f64,
7457        csrSortedRowPtrA: *const ::core::ffi::c_int,
7458        csrSortedColIndA: *const ::core::ffi::c_int,
7459        descrC: cusparseMatDescr_t,
7460        bsrSortedValC: *mut f64,
7461        bsrSortedRowPtrC: *mut ::core::ffi::c_int,
7462        bsrSortedColIndC: *mut ::core::ffi::c_int,
7463        rowBlockDim: ::core::ffi::c_int,
7464        colBlockDim: ::core::ffi::c_int,
7465        pBuffer: *mut ::core::ffi::c_void,
7466    ) -> cusparseStatus_t;
7467}
7468unsafe extern "C" {
7469    /// This function converts a sparse matrix `A` in CSR format (that is defined by arrays `csrValA`, `csrRowPtrA`, and `csrColIndA`) into a sparse matrix `C` in general BSR format (that is defined by the three arrays `bsrValC`, `bsrRowPtrC`, and `bsrColIndC`).
7470    ///
7471    /// The matrix A is an :math: m times n sparse matrix and matrix `C` is a `(mb*rowBlockDim)*(nb*colBlockDim)` sparse matrix, where `mb(=(m+rowBlockDim-1)/rowBlockDim)` is the number of block rows of `C`, and `nb(=(n+colBlockDim-1)/colBlockDim)` is the number of block columns of `C`.
7472    ///
7473    /// The block of `C` is of size `rowBlockDim*colBlockDim`. If `m` is not multiple of `rowBlockDim` or `n` is not multiple of `colBlockDim`, zeros are filled in.
7474    ///
7475    /// The implementation adopts a two-step approach to do the conversion. First, the user allocates `bsrRowPtrC` of `mb+1` elements and uses function [`cusparseXcsr2gebsrNnz`] to determine the number of nonzero block columns per block row. Second, the user gathers `nnzb` (number of nonzero block columns of matrix `C`) from either `(nnzb=*nnzTotalDevHostPtr)` or `(nnzb=bsrRowPtrC\[mb\]-bsrRowPtrC\[0\])` and allocates `bsrValC` of `nnzb*rowBlockDim*colBlockDim` elements and `bsrColIndC` of `nnzb` integers. Finally function `cusparse\[S|D|C|Z\]csr2gebsr()` is called to complete the conversion.
7476    ///
7477    /// The user must obtain the size of the buffer required by `csr2gebsr()` by calling `csr2gebsr_bufferSize()`, allocate the buffer, and pass the buffer pointer to `csr2gebsr()`.
7478    ///
7479    /// The general procedure is as follows:
7480    ///
7481    /// The routine [`cusparseXcsr2gebsrNnz`] has the following properties:
7482    ///
7483    /// * The routine requires no extra storage.
7484    /// * The routine supports asynchronous execution if the Stream Ordered Memory Allocator is available.
7485    /// * The routine supports CUDA graph capture if the Stream Ordered Memory Allocator is available.
7486    ///
7487    /// The routine `cusparse&lt;t>csr2gebsr()` has the following properties:
7488    ///
7489    /// * The routine requires no extra storage if `pBuffer != NULL`.
7490    /// * The routine supports asynchronous execution.
7491    /// * The routine supports CUDA graph capture.
7492    pub fn cusparseCcsr2gebsr(
7493        handle: cusparseHandle_t,
7494        dirA: cusparseDirection_t,
7495        m: ::core::ffi::c_int,
7496        n: ::core::ffi::c_int,
7497        descrA: cusparseMatDescr_t,
7498        csrSortedValA: *const cuComplex,
7499        csrSortedRowPtrA: *const ::core::ffi::c_int,
7500        csrSortedColIndA: *const ::core::ffi::c_int,
7501        descrC: cusparseMatDescr_t,
7502        bsrSortedValC: *mut cuComplex,
7503        bsrSortedRowPtrC: *mut ::core::ffi::c_int,
7504        bsrSortedColIndC: *mut ::core::ffi::c_int,
7505        rowBlockDim: ::core::ffi::c_int,
7506        colBlockDim: ::core::ffi::c_int,
7507        pBuffer: *mut ::core::ffi::c_void,
7508    ) -> cusparseStatus_t;
7509}
7510unsafe extern "C" {
7511    /// This function converts a sparse matrix `A` in CSR format (that is defined by arrays `csrValA`, `csrRowPtrA`, and `csrColIndA`) into a sparse matrix `C` in general BSR format (that is defined by the three arrays `bsrValC`, `bsrRowPtrC`, and `bsrColIndC`).
7512    ///
7513    /// The matrix A is an :math: m times n sparse matrix and matrix `C` is a `(mb*rowBlockDim)*(nb*colBlockDim)` sparse matrix, where `mb(=(m+rowBlockDim-1)/rowBlockDim)` is the number of block rows of `C`, and `nb(=(n+colBlockDim-1)/colBlockDim)` is the number of block columns of `C`.
7514    ///
7515    /// The block of `C` is of size `rowBlockDim*colBlockDim`. If `m` is not multiple of `rowBlockDim` or `n` is not multiple of `colBlockDim`, zeros are filled in.
7516    ///
7517    /// The implementation adopts a two-step approach to do the conversion. First, the user allocates `bsrRowPtrC` of `mb+1` elements and uses function [`cusparseXcsr2gebsrNnz`] to determine the number of nonzero block columns per block row. Second, the user gathers `nnzb` (number of nonzero block columns of matrix `C`) from either `(nnzb=*nnzTotalDevHostPtr)` or `(nnzb=bsrRowPtrC\[mb\]-bsrRowPtrC\[0\])` and allocates `bsrValC` of `nnzb*rowBlockDim*colBlockDim` elements and `bsrColIndC` of `nnzb` integers. Finally function `cusparse\[S|D|C|Z\]csr2gebsr()` is called to complete the conversion.
7518    ///
7519    /// The user must obtain the size of the buffer required by `csr2gebsr()` by calling `csr2gebsr_bufferSize()`, allocate the buffer, and pass the buffer pointer to `csr2gebsr()`.
7520    ///
7521    /// The general procedure is as follows:
7522    ///
7523    /// The routine [`cusparseXcsr2gebsrNnz`] has the following properties:
7524    ///
7525    /// * The routine requires no extra storage.
7526    /// * The routine supports asynchronous execution if the Stream Ordered Memory Allocator is available.
7527    /// * The routine supports CUDA graph capture if the Stream Ordered Memory Allocator is available.
7528    ///
7529    /// The routine `cusparse&lt;t>csr2gebsr()` has the following properties:
7530    ///
7531    /// * The routine requires no extra storage if `pBuffer != NULL`.
7532    /// * The routine supports asynchronous execution.
7533    /// * The routine supports CUDA graph capture.
7534    pub fn cusparseZcsr2gebsr(
7535        handle: cusparseHandle_t,
7536        dirA: cusparseDirection_t,
7537        m: ::core::ffi::c_int,
7538        n: ::core::ffi::c_int,
7539        descrA: cusparseMatDescr_t,
7540        csrSortedValA: *const cuDoubleComplex,
7541        csrSortedRowPtrA: *const ::core::ffi::c_int,
7542        csrSortedColIndA: *const ::core::ffi::c_int,
7543        descrC: cusparseMatDescr_t,
7544        bsrSortedValC: *mut cuDoubleComplex,
7545        bsrSortedRowPtrC: *mut ::core::ffi::c_int,
7546        bsrSortedColIndC: *mut ::core::ffi::c_int,
7547        rowBlockDim: ::core::ffi::c_int,
7548        colBlockDim: ::core::ffi::c_int,
7549        pBuffer: *mut ::core::ffi::c_void,
7550    ) -> cusparseStatus_t;
7551}
7552unsafe extern "C" {
7553    pub fn cusparseSgebsr2gebsr_bufferSize(
7554        handle: cusparseHandle_t,
7555        dirA: cusparseDirection_t,
7556        mb: ::core::ffi::c_int,
7557        nb: ::core::ffi::c_int,
7558        nnzb: ::core::ffi::c_int,
7559        descrA: cusparseMatDescr_t,
7560        bsrSortedValA: *const f32,
7561        bsrSortedRowPtrA: *const ::core::ffi::c_int,
7562        bsrSortedColIndA: *const ::core::ffi::c_int,
7563        rowBlockDimA: ::core::ffi::c_int,
7564        colBlockDimA: ::core::ffi::c_int,
7565        rowBlockDimC: ::core::ffi::c_int,
7566        colBlockDimC: ::core::ffi::c_int,
7567        pBufferSizeInBytes: *mut ::core::ffi::c_int,
7568    ) -> cusparseStatus_t;
7569}
7570unsafe extern "C" {
7571    pub fn cusparseDgebsr2gebsr_bufferSize(
7572        handle: cusparseHandle_t,
7573        dirA: cusparseDirection_t,
7574        mb: ::core::ffi::c_int,
7575        nb: ::core::ffi::c_int,
7576        nnzb: ::core::ffi::c_int,
7577        descrA: cusparseMatDescr_t,
7578        bsrSortedValA: *const f64,
7579        bsrSortedRowPtrA: *const ::core::ffi::c_int,
7580        bsrSortedColIndA: *const ::core::ffi::c_int,
7581        rowBlockDimA: ::core::ffi::c_int,
7582        colBlockDimA: ::core::ffi::c_int,
7583        rowBlockDimC: ::core::ffi::c_int,
7584        colBlockDimC: ::core::ffi::c_int,
7585        pBufferSizeInBytes: *mut ::core::ffi::c_int,
7586    ) -> cusparseStatus_t;
7587}
7588unsafe extern "C" {
7589    pub fn cusparseCgebsr2gebsr_bufferSize(
7590        handle: cusparseHandle_t,
7591        dirA: cusparseDirection_t,
7592        mb: ::core::ffi::c_int,
7593        nb: ::core::ffi::c_int,
7594        nnzb: ::core::ffi::c_int,
7595        descrA: cusparseMatDescr_t,
7596        bsrSortedValA: *const cuComplex,
7597        bsrSortedRowPtrA: *const ::core::ffi::c_int,
7598        bsrSortedColIndA: *const ::core::ffi::c_int,
7599        rowBlockDimA: ::core::ffi::c_int,
7600        colBlockDimA: ::core::ffi::c_int,
7601        rowBlockDimC: ::core::ffi::c_int,
7602        colBlockDimC: ::core::ffi::c_int,
7603        pBufferSizeInBytes: *mut ::core::ffi::c_int,
7604    ) -> cusparseStatus_t;
7605}
7606unsafe extern "C" {
7607    pub fn cusparseZgebsr2gebsr_bufferSize(
7608        handle: cusparseHandle_t,
7609        dirA: cusparseDirection_t,
7610        mb: ::core::ffi::c_int,
7611        nb: ::core::ffi::c_int,
7612        nnzb: ::core::ffi::c_int,
7613        descrA: cusparseMatDescr_t,
7614        bsrSortedValA: *const cuDoubleComplex,
7615        bsrSortedRowPtrA: *const ::core::ffi::c_int,
7616        bsrSortedColIndA: *const ::core::ffi::c_int,
7617        rowBlockDimA: ::core::ffi::c_int,
7618        colBlockDimA: ::core::ffi::c_int,
7619        rowBlockDimC: ::core::ffi::c_int,
7620        colBlockDimC: ::core::ffi::c_int,
7621        pBufferSizeInBytes: *mut ::core::ffi::c_int,
7622    ) -> cusparseStatus_t;
7623}
7624unsafe extern "C" {
7625    pub fn cusparseSgebsr2gebsr_bufferSizeExt(
7626        handle: cusparseHandle_t,
7627        dirA: cusparseDirection_t,
7628        mb: ::core::ffi::c_int,
7629        nb: ::core::ffi::c_int,
7630        nnzb: ::core::ffi::c_int,
7631        descrA: cusparseMatDescr_t,
7632        bsrSortedValA: *const f32,
7633        bsrSortedRowPtrA: *const ::core::ffi::c_int,
7634        bsrSortedColIndA: *const ::core::ffi::c_int,
7635        rowBlockDimA: ::core::ffi::c_int,
7636        colBlockDimA: ::core::ffi::c_int,
7637        rowBlockDimC: ::core::ffi::c_int,
7638        colBlockDimC: ::core::ffi::c_int,
7639        pBufferSize: *mut size_t,
7640    ) -> cusparseStatus_t;
7641}
7642unsafe extern "C" {
7643    pub fn cusparseDgebsr2gebsr_bufferSizeExt(
7644        handle: cusparseHandle_t,
7645        dirA: cusparseDirection_t,
7646        mb: ::core::ffi::c_int,
7647        nb: ::core::ffi::c_int,
7648        nnzb: ::core::ffi::c_int,
7649        descrA: cusparseMatDescr_t,
7650        bsrSortedValA: *const f64,
7651        bsrSortedRowPtrA: *const ::core::ffi::c_int,
7652        bsrSortedColIndA: *const ::core::ffi::c_int,
7653        rowBlockDimA: ::core::ffi::c_int,
7654        colBlockDimA: ::core::ffi::c_int,
7655        rowBlockDimC: ::core::ffi::c_int,
7656        colBlockDimC: ::core::ffi::c_int,
7657        pBufferSize: *mut size_t,
7658    ) -> cusparseStatus_t;
7659}
7660unsafe extern "C" {
7661    pub fn cusparseCgebsr2gebsr_bufferSizeExt(
7662        handle: cusparseHandle_t,
7663        dirA: cusparseDirection_t,
7664        mb: ::core::ffi::c_int,
7665        nb: ::core::ffi::c_int,
7666        nnzb: ::core::ffi::c_int,
7667        descrA: cusparseMatDescr_t,
7668        bsrSortedValA: *const cuComplex,
7669        bsrSortedRowPtrA: *const ::core::ffi::c_int,
7670        bsrSortedColIndA: *const ::core::ffi::c_int,
7671        rowBlockDimA: ::core::ffi::c_int,
7672        colBlockDimA: ::core::ffi::c_int,
7673        rowBlockDimC: ::core::ffi::c_int,
7674        colBlockDimC: ::core::ffi::c_int,
7675        pBufferSize: *mut size_t,
7676    ) -> cusparseStatus_t;
7677}
7678unsafe extern "C" {
7679    pub fn cusparseZgebsr2gebsr_bufferSizeExt(
7680        handle: cusparseHandle_t,
7681        dirA: cusparseDirection_t,
7682        mb: ::core::ffi::c_int,
7683        nb: ::core::ffi::c_int,
7684        nnzb: ::core::ffi::c_int,
7685        descrA: cusparseMatDescr_t,
7686        bsrSortedValA: *const cuDoubleComplex,
7687        bsrSortedRowPtrA: *const ::core::ffi::c_int,
7688        bsrSortedColIndA: *const ::core::ffi::c_int,
7689        rowBlockDimA: ::core::ffi::c_int,
7690        colBlockDimA: ::core::ffi::c_int,
7691        rowBlockDimC: ::core::ffi::c_int,
7692        colBlockDimC: ::core::ffi::c_int,
7693        pBufferSize: *mut size_t,
7694    ) -> cusparseStatus_t;
7695}
7696unsafe extern "C" {
7697    pub fn cusparseXgebsr2gebsrNnz(
7698        handle: cusparseHandle_t,
7699        dirA: cusparseDirection_t,
7700        mb: ::core::ffi::c_int,
7701        nb: ::core::ffi::c_int,
7702        nnzb: ::core::ffi::c_int,
7703        descrA: cusparseMatDescr_t,
7704        bsrSortedRowPtrA: *const ::core::ffi::c_int,
7705        bsrSortedColIndA: *const ::core::ffi::c_int,
7706        rowBlockDimA: ::core::ffi::c_int,
7707        colBlockDimA: ::core::ffi::c_int,
7708        descrC: cusparseMatDescr_t,
7709        bsrSortedRowPtrC: *mut ::core::ffi::c_int,
7710        rowBlockDimC: ::core::ffi::c_int,
7711        colBlockDimC: ::core::ffi::c_int,
7712        nnzTotalDevHostPtr: *mut ::core::ffi::c_int,
7713        pBuffer: *mut ::core::ffi::c_void,
7714    ) -> cusparseStatus_t;
7715}
7716unsafe extern "C" {
7717    /// This function converts a sparse matrix in general BSR format that is defined by the three arrays `bsrValA`, `bsrRowPtrA`, and `bsrColIndA` into a sparse matrix in another general BSR format that is defined by arrays `bsrValC`, `bsrRowPtrC`, and `bsrColIndC`.
7718    ///
7719    /// If `rowBlockDimA=1` and `colBlockDimA=1`, `cusparse\[S|D|C|Z\]gebsr2gebsr()` is the same as `cusparse\[S|D|C|Z\]csr2gebsr()`.
7720    ///
7721    /// If `rowBlockDimC=1` and `colBlockDimC=1`, `cusparse\[S|D|C|Z\]gebsr2gebsr()` is the same as `cusparse\[S|D|C|Z\]gebsr2csr()`.
7722    ///
7723    /// `A` is an `m*n` sparse matrix where `m(=mb*rowBlockDim)` is the number of rows of `A`, and `n(=nb*colBlockDim)` is the number of columns of `A`. The general BSR format of `A` contains `nnzb(=bsrRowPtrA\[mb\] - bsrRowPtrA\[0\])` nonzero blocks. The matrix `C` is also general BSR format with a different block size, `rowBlockDimC*colBlockDimC`. If `m` is not a multiple of `rowBlockDimC`, or `n` is not a multiple of `colBlockDimC`, zeros are filled in. The number of block rows of `C` is `mc(=(m+rowBlockDimC-1)/rowBlockDimC)`. The number of block rows of `C` is `nc(=(n+colBlockDimC-1)/colBlockDimC)`. The number of nonzero blocks of `C` is `nnzc`.
7724    ///
7725    /// The implementation adopts a two-step approach to do the conversion. First, the user allocates `bsrRowPtrC` of `mc+1` elements and uses function [`cusparseXgebsr2gebsrNnz`] to determine the number of nonzero block columns per block row of matrix `C`. Second, the user gathers `nnzc` (number of non-zero block columns of matrix `C`) from either `(nnzc=*nnzTotalDevHostPtr)` or `(nnzc=bsrRowPtrC\[mc\]-bsrRowPtrC\[0\])` and allocates `bsrValC` of `nnzc*rowBlockDimC*colBlockDimC` elements and `bsrColIndC` of `nnzc` integers. Finally the function `cusparse\[S|D|C|Z\]gebsr2gebsr()` is called to complete the conversion.
7726    ///
7727    /// The user must call `gebsr2gebsr_bufferSize()` to know the size of the buffer required by `gebsr2gebsr()`, allocate the buffer, and pass the buffer pointer to `gebsr2gebsr()`.
7728    ///
7729    /// The general procedure is as follows:
7730    ///
7731    /// * The routines require no extra storage if `pBuffer != NULL`
7732    /// * The routine supports asynchronous execution if the Stream Ordered Memory Allocator is available
7733    /// * The routines do **not** support CUDA graph capture.
7734    pub fn cusparseSgebsr2gebsr(
7735        handle: cusparseHandle_t,
7736        dirA: cusparseDirection_t,
7737        mb: ::core::ffi::c_int,
7738        nb: ::core::ffi::c_int,
7739        nnzb: ::core::ffi::c_int,
7740        descrA: cusparseMatDescr_t,
7741        bsrSortedValA: *const f32,
7742        bsrSortedRowPtrA: *const ::core::ffi::c_int,
7743        bsrSortedColIndA: *const ::core::ffi::c_int,
7744        rowBlockDimA: ::core::ffi::c_int,
7745        colBlockDimA: ::core::ffi::c_int,
7746        descrC: cusparseMatDescr_t,
7747        bsrSortedValC: *mut f32,
7748        bsrSortedRowPtrC: *mut ::core::ffi::c_int,
7749        bsrSortedColIndC: *mut ::core::ffi::c_int,
7750        rowBlockDimC: ::core::ffi::c_int,
7751        colBlockDimC: ::core::ffi::c_int,
7752        pBuffer: *mut ::core::ffi::c_void,
7753    ) -> cusparseStatus_t;
7754}
7755unsafe extern "C" {
7756    /// This function converts a sparse matrix in general BSR format that is defined by the three arrays `bsrValA`, `bsrRowPtrA`, and `bsrColIndA` into a sparse matrix in another general BSR format that is defined by arrays `bsrValC`, `bsrRowPtrC`, and `bsrColIndC`.
7757    ///
7758    /// If `rowBlockDimA=1` and `colBlockDimA=1`, `cusparse\[S|D|C|Z\]gebsr2gebsr()` is the same as `cusparse\[S|D|C|Z\]csr2gebsr()`.
7759    ///
7760    /// If `rowBlockDimC=1` and `colBlockDimC=1`, `cusparse\[S|D|C|Z\]gebsr2gebsr()` is the same as `cusparse\[S|D|C|Z\]gebsr2csr()`.
7761    ///
7762    /// `A` is an `m*n` sparse matrix where `m(=mb*rowBlockDim)` is the number of rows of `A`, and `n(=nb*colBlockDim)` is the number of columns of `A`. The general BSR format of `A` contains `nnzb(=bsrRowPtrA\[mb\] - bsrRowPtrA\[0\])` nonzero blocks. The matrix `C` is also general BSR format with a different block size, `rowBlockDimC*colBlockDimC`. If `m` is not a multiple of `rowBlockDimC`, or `n` is not a multiple of `colBlockDimC`, zeros are filled in. The number of block rows of `C` is `mc(=(m+rowBlockDimC-1)/rowBlockDimC)`. The number of block rows of `C` is `nc(=(n+colBlockDimC-1)/colBlockDimC)`. The number of nonzero blocks of `C` is `nnzc`.
7763    ///
7764    /// The implementation adopts a two-step approach to do the conversion. First, the user allocates `bsrRowPtrC` of `mc+1` elements and uses function [`cusparseXgebsr2gebsrNnz`] to determine the number of nonzero block columns per block row of matrix `C`. Second, the user gathers `nnzc` (number of non-zero block columns of matrix `C`) from either `(nnzc=*nnzTotalDevHostPtr)` or `(nnzc=bsrRowPtrC\[mc\]-bsrRowPtrC\[0\])` and allocates `bsrValC` of `nnzc*rowBlockDimC*colBlockDimC` elements and `bsrColIndC` of `nnzc` integers. Finally the function `cusparse\[S|D|C|Z\]gebsr2gebsr()` is called to complete the conversion.
7765    ///
7766    /// The user must call `gebsr2gebsr_bufferSize()` to know the size of the buffer required by `gebsr2gebsr()`, allocate the buffer, and pass the buffer pointer to `gebsr2gebsr()`.
7767    ///
7768    /// The general procedure is as follows:
7769    ///
7770    /// * The routines require no extra storage if `pBuffer != NULL`
7771    /// * The routine supports asynchronous execution if the Stream Ordered Memory Allocator is available
7772    /// * The routines do **not** support CUDA graph capture.
7773    pub fn cusparseDgebsr2gebsr(
7774        handle: cusparseHandle_t,
7775        dirA: cusparseDirection_t,
7776        mb: ::core::ffi::c_int,
7777        nb: ::core::ffi::c_int,
7778        nnzb: ::core::ffi::c_int,
7779        descrA: cusparseMatDescr_t,
7780        bsrSortedValA: *const f64,
7781        bsrSortedRowPtrA: *const ::core::ffi::c_int,
7782        bsrSortedColIndA: *const ::core::ffi::c_int,
7783        rowBlockDimA: ::core::ffi::c_int,
7784        colBlockDimA: ::core::ffi::c_int,
7785        descrC: cusparseMatDescr_t,
7786        bsrSortedValC: *mut f64,
7787        bsrSortedRowPtrC: *mut ::core::ffi::c_int,
7788        bsrSortedColIndC: *mut ::core::ffi::c_int,
7789        rowBlockDimC: ::core::ffi::c_int,
7790        colBlockDimC: ::core::ffi::c_int,
7791        pBuffer: *mut ::core::ffi::c_void,
7792    ) -> cusparseStatus_t;
7793}
7794unsafe extern "C" {
7795    /// This function converts a sparse matrix in general BSR format that is defined by the three arrays `bsrValA`, `bsrRowPtrA`, and `bsrColIndA` into a sparse matrix in another general BSR format that is defined by arrays `bsrValC`, `bsrRowPtrC`, and `bsrColIndC`.
7796    ///
7797    /// If `rowBlockDimA=1` and `colBlockDimA=1`, `cusparse\[S|D|C|Z\]gebsr2gebsr()` is the same as `cusparse\[S|D|C|Z\]csr2gebsr()`.
7798    ///
7799    /// If `rowBlockDimC=1` and `colBlockDimC=1`, `cusparse\[S|D|C|Z\]gebsr2gebsr()` is the same as `cusparse\[S|D|C|Z\]gebsr2csr()`.
7800    ///
7801    /// `A` is an `m*n` sparse matrix where `m(=mb*rowBlockDim)` is the number of rows of `A`, and `n(=nb*colBlockDim)` is the number of columns of `A`. The general BSR format of `A` contains `nnzb(=bsrRowPtrA\[mb\] - bsrRowPtrA\[0\])` nonzero blocks. The matrix `C` is also general BSR format with a different block size, `rowBlockDimC*colBlockDimC`. If `m` is not a multiple of `rowBlockDimC`, or `n` is not a multiple of `colBlockDimC`, zeros are filled in. The number of block rows of `C` is `mc(=(m+rowBlockDimC-1)/rowBlockDimC)`. The number of block rows of `C` is `nc(=(n+colBlockDimC-1)/colBlockDimC)`. The number of nonzero blocks of `C` is `nnzc`.
7802    ///
7803    /// The implementation adopts a two-step approach to do the conversion. First, the user allocates `bsrRowPtrC` of `mc+1` elements and uses function [`cusparseXgebsr2gebsrNnz`] to determine the number of nonzero block columns per block row of matrix `C`. Second, the user gathers `nnzc` (number of non-zero block columns of matrix `C`) from either `(nnzc=*nnzTotalDevHostPtr)` or `(nnzc=bsrRowPtrC\[mc\]-bsrRowPtrC\[0\])` and allocates `bsrValC` of `nnzc*rowBlockDimC*colBlockDimC` elements and `bsrColIndC` of `nnzc` integers. Finally the function `cusparse\[S|D|C|Z\]gebsr2gebsr()` is called to complete the conversion.
7804    ///
7805    /// The user must call `gebsr2gebsr_bufferSize()` to know the size of the buffer required by `gebsr2gebsr()`, allocate the buffer, and pass the buffer pointer to `gebsr2gebsr()`.
7806    ///
7807    /// The general procedure is as follows:
7808    ///
7809    /// * The routines require no extra storage if `pBuffer != NULL`
7810    /// * The routine supports asynchronous execution if the Stream Ordered Memory Allocator is available
7811    /// * The routines do **not** support CUDA graph capture.
7812    pub fn cusparseCgebsr2gebsr(
7813        handle: cusparseHandle_t,
7814        dirA: cusparseDirection_t,
7815        mb: ::core::ffi::c_int,
7816        nb: ::core::ffi::c_int,
7817        nnzb: ::core::ffi::c_int,
7818        descrA: cusparseMatDescr_t,
7819        bsrSortedValA: *const cuComplex,
7820        bsrSortedRowPtrA: *const ::core::ffi::c_int,
7821        bsrSortedColIndA: *const ::core::ffi::c_int,
7822        rowBlockDimA: ::core::ffi::c_int,
7823        colBlockDimA: ::core::ffi::c_int,
7824        descrC: cusparseMatDescr_t,
7825        bsrSortedValC: *mut cuComplex,
7826        bsrSortedRowPtrC: *mut ::core::ffi::c_int,
7827        bsrSortedColIndC: *mut ::core::ffi::c_int,
7828        rowBlockDimC: ::core::ffi::c_int,
7829        colBlockDimC: ::core::ffi::c_int,
7830        pBuffer: *mut ::core::ffi::c_void,
7831    ) -> cusparseStatus_t;
7832}
7833unsafe extern "C" {
7834    /// This function converts a sparse matrix in general BSR format that is defined by the three arrays `bsrValA`, `bsrRowPtrA`, and `bsrColIndA` into a sparse matrix in another general BSR format that is defined by arrays `bsrValC`, `bsrRowPtrC`, and `bsrColIndC`.
7835    ///
7836    /// If `rowBlockDimA=1` and `colBlockDimA=1`, `cusparse\[S|D|C|Z\]gebsr2gebsr()` is the same as `cusparse\[S|D|C|Z\]csr2gebsr()`.
7837    ///
7838    /// If `rowBlockDimC=1` and `colBlockDimC=1`, `cusparse\[S|D|C|Z\]gebsr2gebsr()` is the same as `cusparse\[S|D|C|Z\]gebsr2csr()`.
7839    ///
7840    /// `A` is an `m*n` sparse matrix where `m(=mb*rowBlockDim)` is the number of rows of `A`, and `n(=nb*colBlockDim)` is the number of columns of `A`. The general BSR format of `A` contains `nnzb(=bsrRowPtrA\[mb\] - bsrRowPtrA\[0\])` nonzero blocks. The matrix `C` is also general BSR format with a different block size, `rowBlockDimC*colBlockDimC`. If `m` is not a multiple of `rowBlockDimC`, or `n` is not a multiple of `colBlockDimC`, zeros are filled in. The number of block rows of `C` is `mc(=(m+rowBlockDimC-1)/rowBlockDimC)`. The number of block rows of `C` is `nc(=(n+colBlockDimC-1)/colBlockDimC)`. The number of nonzero blocks of `C` is `nnzc`.
7841    ///
7842    /// The implementation adopts a two-step approach to do the conversion. First, the user allocates `bsrRowPtrC` of `mc+1` elements and uses function [`cusparseXgebsr2gebsrNnz`] to determine the number of nonzero block columns per block row of matrix `C`. Second, the user gathers `nnzc` (number of non-zero block columns of matrix `C`) from either `(nnzc=*nnzTotalDevHostPtr)` or `(nnzc=bsrRowPtrC\[mc\]-bsrRowPtrC\[0\])` and allocates `bsrValC` of `nnzc*rowBlockDimC*colBlockDimC` elements and `bsrColIndC` of `nnzc` integers. Finally the function `cusparse\[S|D|C|Z\]gebsr2gebsr()` is called to complete the conversion.
7843    ///
7844    /// The user must call `gebsr2gebsr_bufferSize()` to know the size of the buffer required by `gebsr2gebsr()`, allocate the buffer, and pass the buffer pointer to `gebsr2gebsr()`.
7845    ///
7846    /// The general procedure is as follows:
7847    ///
7848    /// * The routines require no extra storage if `pBuffer != NULL`
7849    /// * The routine supports asynchronous execution if the Stream Ordered Memory Allocator is available
7850    /// * The routines do **not** support CUDA graph capture.
7851    pub fn cusparseZgebsr2gebsr(
7852        handle: cusparseHandle_t,
7853        dirA: cusparseDirection_t,
7854        mb: ::core::ffi::c_int,
7855        nb: ::core::ffi::c_int,
7856        nnzb: ::core::ffi::c_int,
7857        descrA: cusparseMatDescr_t,
7858        bsrSortedValA: *const cuDoubleComplex,
7859        bsrSortedRowPtrA: *const ::core::ffi::c_int,
7860        bsrSortedColIndA: *const ::core::ffi::c_int,
7861        rowBlockDimA: ::core::ffi::c_int,
7862        colBlockDimA: ::core::ffi::c_int,
7863        descrC: cusparseMatDescr_t,
7864        bsrSortedValC: *mut cuDoubleComplex,
7865        bsrSortedRowPtrC: *mut ::core::ffi::c_int,
7866        bsrSortedColIndC: *mut ::core::ffi::c_int,
7867        rowBlockDimC: ::core::ffi::c_int,
7868        colBlockDimC: ::core::ffi::c_int,
7869        pBuffer: *mut ::core::ffi::c_void,
7870    ) -> cusparseStatus_t;
7871}
7872unsafe extern "C" {
7873    /// This function creates an identity map. The output parameter `p` represents such map by `p = 0:1:(n-1)`.
7874    ///
7875    /// This function is typically used with `coosort`, `csrsort`, `cscsort`.
7876    ///
7877    /// * The routine requires no extra storage.
7878    /// * The routine supports asynchronous execution.
7879    /// * The routine supports CUDA graph capture.
7880    #[deprecated]
7881    pub fn cusparseCreateIdentityPermutation(
7882        handle: cusparseHandle_t,
7883        n: ::core::ffi::c_int,
7884        p: *mut ::core::ffi::c_int,
7885    ) -> cusparseStatus_t;
7886}
7887unsafe extern "C" {
7888    pub fn cusparseXcoosort_bufferSizeExt(
7889        handle: cusparseHandle_t,
7890        m: ::core::ffi::c_int,
7891        n: ::core::ffi::c_int,
7892        nnz: ::core::ffi::c_int,
7893        cooRowsA: *const ::core::ffi::c_int,
7894        cooColsA: *const ::core::ffi::c_int,
7895        pBufferSizeInBytes: *mut size_t,
7896    ) -> cusparseStatus_t;
7897}
7898unsafe extern "C" {
7899    pub fn cusparseXcoosortByRow(
7900        handle: cusparseHandle_t,
7901        m: ::core::ffi::c_int,
7902        n: ::core::ffi::c_int,
7903        nnz: ::core::ffi::c_int,
7904        cooRowsA: *mut ::core::ffi::c_int,
7905        cooColsA: *mut ::core::ffi::c_int,
7906        P: *mut ::core::ffi::c_int,
7907        pBuffer: *mut ::core::ffi::c_void,
7908    ) -> cusparseStatus_t;
7909}
7910unsafe extern "C" {
7911    pub fn cusparseXcoosortByColumn(
7912        handle: cusparseHandle_t,
7913        m: ::core::ffi::c_int,
7914        n: ::core::ffi::c_int,
7915        nnz: ::core::ffi::c_int,
7916        cooRowsA: *mut ::core::ffi::c_int,
7917        cooColsA: *mut ::core::ffi::c_int,
7918        P: *mut ::core::ffi::c_int,
7919        pBuffer: *mut ::core::ffi::c_void,
7920    ) -> cusparseStatus_t;
7921}
7922unsafe extern "C" {
7923    pub fn cusparseXcsrsort_bufferSizeExt(
7924        handle: cusparseHandle_t,
7925        m: ::core::ffi::c_int,
7926        n: ::core::ffi::c_int,
7927        nnz: ::core::ffi::c_int,
7928        csrRowPtrA: *const ::core::ffi::c_int,
7929        csrColIndA: *const ::core::ffi::c_int,
7930        pBufferSizeInBytes: *mut size_t,
7931    ) -> cusparseStatus_t;
7932}
7933unsafe extern "C" {
7934    /// This function sorts CSR format. The stable sorting is in-place.
7935    ///
7936    /// The matrix type is regarded as [`cusparseMatrixType_t::CUSPARSE_MATRIX_TYPE_GENERAL`] implicitly. In other words, any symmetric property is ignored.
7937    ///
7938    /// This function `csrsort()` requires buffer size returned by `csrsort_bufferSizeExt()`. The address of `pBuffer` must be multiple of 128 bytes. If not, [`cusparseStatus_t::CUSPARSE_STATUS_INVALID_VALUE`] is returned.
7939    ///
7940    /// The parameter `P` is both input and output. If the user wants to compute sorted `csrVal`, `P` must be set as 0:1:(nnz-1) before `csrsort()`, and after `csrsort()`, new sorted value array satisfies `csrVal_sorted = csrVal(P)`.
7941    ///
7942    /// The general procedure is as follows:
7943    ///
7944    /// * The routine requires no extra storage if `pBuffer != NULL`
7945    /// * The routine supports asynchronous execution if the Stream Ordered Memory Allocator is available
7946    /// * The routine supports CUDA graph capture if the Stream Ordered Memory Allocator is available.
7947    pub fn cusparseXcsrsort(
7948        handle: cusparseHandle_t,
7949        m: ::core::ffi::c_int,
7950        n: ::core::ffi::c_int,
7951        nnz: ::core::ffi::c_int,
7952        descrA: cusparseMatDescr_t,
7953        csrRowPtrA: *const ::core::ffi::c_int,
7954        csrColIndA: *mut ::core::ffi::c_int,
7955        P: *mut ::core::ffi::c_int,
7956        pBuffer: *mut ::core::ffi::c_void,
7957    ) -> cusparseStatus_t;
7958}
7959unsafe extern "C" {
7960    pub fn cusparseXcscsort_bufferSizeExt(
7961        handle: cusparseHandle_t,
7962        m: ::core::ffi::c_int,
7963        n: ::core::ffi::c_int,
7964        nnz: ::core::ffi::c_int,
7965        cscColPtrA: *const ::core::ffi::c_int,
7966        cscRowIndA: *const ::core::ffi::c_int,
7967        pBufferSizeInBytes: *mut size_t,
7968    ) -> cusparseStatus_t;
7969}
7970unsafe extern "C" {
7971    /// This function sorts CSC format. The stable sorting is in-place.
7972    ///
7973    /// The matrix type is regarded as [`cusparseMatrixType_t::CUSPARSE_MATRIX_TYPE_GENERAL`] implicitly. In other words, any symmetric property is ignored.
7974    ///
7975    /// This function `cscsort()` requires buffer size returned by `cscsort_bufferSizeExt()`. The address of `pBuffer` must be multiple of 128 bytes. If not, [`cusparseStatus_t::CUSPARSE_STATUS_INVALID_VALUE`] is returned.
7976    ///
7977    /// The parameter `P` is both input and output. If the user wants to compute sorted `cscVal`, `P` must be set as 0:1:(nnz-1) before `cscsort()`, and after `cscsort()`, new sorted value array satisfies `cscVal_sorted = cscVal(P)`.
7978    ///
7979    /// The general procedure is as follows:
7980    ///
7981    /// * The routine requires no extra storage if `pBuffer != NULL`
7982    /// * The routine supports asynchronous execution if the Stream Ordered Memory Allocator is available
7983    /// * The routine supports CUDA graph capture if the Stream Ordered Memory Allocator is available.
7984    pub fn cusparseXcscsort(
7985        handle: cusparseHandle_t,
7986        m: ::core::ffi::c_int,
7987        n: ::core::ffi::c_int,
7988        nnz: ::core::ffi::c_int,
7989        descrA: cusparseMatDescr_t,
7990        cscColPtrA: *const ::core::ffi::c_int,
7991        cscRowIndA: *mut ::core::ffi::c_int,
7992        P: *mut ::core::ffi::c_int,
7993        pBuffer: *mut ::core::ffi::c_void,
7994    ) -> cusparseStatus_t;
7995}
7996unsafe extern "C" {
7997    pub fn cusparseScsru2csr_bufferSizeExt(
7998        handle: cusparseHandle_t,
7999        m: ::core::ffi::c_int,
8000        n: ::core::ffi::c_int,
8001        nnz: ::core::ffi::c_int,
8002        csrVal: *mut f32,
8003        csrRowPtr: *const ::core::ffi::c_int,
8004        csrColInd: *mut ::core::ffi::c_int,
8005        info: csru2csrInfo_t,
8006        pBufferSizeInBytes: *mut size_t,
8007    ) -> cusparseStatus_t;
8008}
8009unsafe extern "C" {
8010    pub fn cusparseDcsru2csr_bufferSizeExt(
8011        handle: cusparseHandle_t,
8012        m: ::core::ffi::c_int,
8013        n: ::core::ffi::c_int,
8014        nnz: ::core::ffi::c_int,
8015        csrVal: *mut f64,
8016        csrRowPtr: *const ::core::ffi::c_int,
8017        csrColInd: *mut ::core::ffi::c_int,
8018        info: csru2csrInfo_t,
8019        pBufferSizeInBytes: *mut size_t,
8020    ) -> cusparseStatus_t;
8021}
8022unsafe extern "C" {
8023    pub fn cusparseCcsru2csr_bufferSizeExt(
8024        handle: cusparseHandle_t,
8025        m: ::core::ffi::c_int,
8026        n: ::core::ffi::c_int,
8027        nnz: ::core::ffi::c_int,
8028        csrVal: *mut cuComplex,
8029        csrRowPtr: *const ::core::ffi::c_int,
8030        csrColInd: *mut ::core::ffi::c_int,
8031        info: csru2csrInfo_t,
8032        pBufferSizeInBytes: *mut size_t,
8033    ) -> cusparseStatus_t;
8034}
8035unsafe extern "C" {
8036    pub fn cusparseZcsru2csr_bufferSizeExt(
8037        handle: cusparseHandle_t,
8038        m: ::core::ffi::c_int,
8039        n: ::core::ffi::c_int,
8040        nnz: ::core::ffi::c_int,
8041        csrVal: *mut cuDoubleComplex,
8042        csrRowPtr: *const ::core::ffi::c_int,
8043        csrColInd: *mut ::core::ffi::c_int,
8044        info: csru2csrInfo_t,
8045        pBufferSizeInBytes: *mut size_t,
8046    ) -> cusparseStatus_t;
8047}
8048unsafe extern "C" {
8049    pub fn cusparseScsru2csr(
8050        handle: cusparseHandle_t,
8051        m: ::core::ffi::c_int,
8052        n: ::core::ffi::c_int,
8053        nnz: ::core::ffi::c_int,
8054        descrA: cusparseMatDescr_t,
8055        csrVal: *mut f32,
8056        csrRowPtr: *const ::core::ffi::c_int,
8057        csrColInd: *mut ::core::ffi::c_int,
8058        info: csru2csrInfo_t,
8059        pBuffer: *mut ::core::ffi::c_void,
8060    ) -> cusparseStatus_t;
8061}
8062unsafe extern "C" {
8063    pub fn cusparseDcsru2csr(
8064        handle: cusparseHandle_t,
8065        m: ::core::ffi::c_int,
8066        n: ::core::ffi::c_int,
8067        nnz: ::core::ffi::c_int,
8068        descrA: cusparseMatDescr_t,
8069        csrVal: *mut f64,
8070        csrRowPtr: *const ::core::ffi::c_int,
8071        csrColInd: *mut ::core::ffi::c_int,
8072        info: csru2csrInfo_t,
8073        pBuffer: *mut ::core::ffi::c_void,
8074    ) -> cusparseStatus_t;
8075}
8076unsafe extern "C" {
8077    pub fn cusparseCcsru2csr(
8078        handle: cusparseHandle_t,
8079        m: ::core::ffi::c_int,
8080        n: ::core::ffi::c_int,
8081        nnz: ::core::ffi::c_int,
8082        descrA: cusparseMatDescr_t,
8083        csrVal: *mut cuComplex,
8084        csrRowPtr: *const ::core::ffi::c_int,
8085        csrColInd: *mut ::core::ffi::c_int,
8086        info: csru2csrInfo_t,
8087        pBuffer: *mut ::core::ffi::c_void,
8088    ) -> cusparseStatus_t;
8089}
8090unsafe extern "C" {
8091    pub fn cusparseZcsru2csr(
8092        handle: cusparseHandle_t,
8093        m: ::core::ffi::c_int,
8094        n: ::core::ffi::c_int,
8095        nnz: ::core::ffi::c_int,
8096        descrA: cusparseMatDescr_t,
8097        csrVal: *mut cuDoubleComplex,
8098        csrRowPtr: *const ::core::ffi::c_int,
8099        csrColInd: *mut ::core::ffi::c_int,
8100        info: csru2csrInfo_t,
8101        pBuffer: *mut ::core::ffi::c_void,
8102    ) -> cusparseStatus_t;
8103}
8104unsafe extern "C" {
8105    pub fn cusparseScsr2csru(
8106        handle: cusparseHandle_t,
8107        m: ::core::ffi::c_int,
8108        n: ::core::ffi::c_int,
8109        nnz: ::core::ffi::c_int,
8110        descrA: cusparseMatDescr_t,
8111        csrVal: *mut f32,
8112        csrRowPtr: *const ::core::ffi::c_int,
8113        csrColInd: *mut ::core::ffi::c_int,
8114        info: csru2csrInfo_t,
8115        pBuffer: *mut ::core::ffi::c_void,
8116    ) -> cusparseStatus_t;
8117}
8118unsafe extern "C" {
8119    pub fn cusparseDcsr2csru(
8120        handle: cusparseHandle_t,
8121        m: ::core::ffi::c_int,
8122        n: ::core::ffi::c_int,
8123        nnz: ::core::ffi::c_int,
8124        descrA: cusparseMatDescr_t,
8125        csrVal: *mut f64,
8126        csrRowPtr: *const ::core::ffi::c_int,
8127        csrColInd: *mut ::core::ffi::c_int,
8128        info: csru2csrInfo_t,
8129        pBuffer: *mut ::core::ffi::c_void,
8130    ) -> cusparseStatus_t;
8131}
8132unsafe extern "C" {
8133    pub fn cusparseCcsr2csru(
8134        handle: cusparseHandle_t,
8135        m: ::core::ffi::c_int,
8136        n: ::core::ffi::c_int,
8137        nnz: ::core::ffi::c_int,
8138        descrA: cusparseMatDescr_t,
8139        csrVal: *mut cuComplex,
8140        csrRowPtr: *const ::core::ffi::c_int,
8141        csrColInd: *mut ::core::ffi::c_int,
8142        info: csru2csrInfo_t,
8143        pBuffer: *mut ::core::ffi::c_void,
8144    ) -> cusparseStatus_t;
8145}
8146unsafe extern "C" {
8147    pub fn cusparseZcsr2csru(
8148        handle: cusparseHandle_t,
8149        m: ::core::ffi::c_int,
8150        n: ::core::ffi::c_int,
8151        nnz: ::core::ffi::c_int,
8152        descrA: cusparseMatDescr_t,
8153        csrVal: *mut cuDoubleComplex,
8154        csrRowPtr: *const ::core::ffi::c_int,
8155        csrColInd: *mut ::core::ffi::c_int,
8156        info: csru2csrInfo_t,
8157        pBuffer: *mut ::core::ffi::c_void,
8158    ) -> cusparseStatus_t;
8159}
8160unsafe extern "C" {
8161    pub fn cusparseSpruneDense2csr_bufferSizeExt(
8162        handle: cusparseHandle_t,
8163        m: ::core::ffi::c_int,
8164        n: ::core::ffi::c_int,
8165        A: *const f32,
8166        lda: ::core::ffi::c_int,
8167        threshold: *const f32,
8168        descrC: cusparseMatDescr_t,
8169        csrSortedValC: *const f32,
8170        csrSortedRowPtrC: *const ::core::ffi::c_int,
8171        csrSortedColIndC: *const ::core::ffi::c_int,
8172        pBufferSizeInBytes: *mut size_t,
8173    ) -> cusparseStatus_t;
8174}
8175unsafe extern "C" {
8176    pub fn cusparseDpruneDense2csr_bufferSizeExt(
8177        handle: cusparseHandle_t,
8178        m: ::core::ffi::c_int,
8179        n: ::core::ffi::c_int,
8180        A: *const f64,
8181        lda: ::core::ffi::c_int,
8182        threshold: *const f64,
8183        descrC: cusparseMatDescr_t,
8184        csrSortedValC: *const f64,
8185        csrSortedRowPtrC: *const ::core::ffi::c_int,
8186        csrSortedColIndC: *const ::core::ffi::c_int,
8187        pBufferSizeInBytes: *mut size_t,
8188    ) -> cusparseStatus_t;
8189}
8190unsafe extern "C" {
8191    pub fn cusparseSpruneDense2csrNnz(
8192        handle: cusparseHandle_t,
8193        m: ::core::ffi::c_int,
8194        n: ::core::ffi::c_int,
8195        A: *const f32,
8196        lda: ::core::ffi::c_int,
8197        threshold: *const f32,
8198        descrC: cusparseMatDescr_t,
8199        csrRowPtrC: *mut ::core::ffi::c_int,
8200        nnzTotalDevHostPtr: *mut ::core::ffi::c_int,
8201        pBuffer: *mut ::core::ffi::c_void,
8202    ) -> cusparseStatus_t;
8203}
8204unsafe extern "C" {
8205    pub fn cusparseDpruneDense2csrNnz(
8206        handle: cusparseHandle_t,
8207        m: ::core::ffi::c_int,
8208        n: ::core::ffi::c_int,
8209        A: *const f64,
8210        lda: ::core::ffi::c_int,
8211        threshold: *const f64,
8212        descrC: cusparseMatDescr_t,
8213        csrSortedRowPtrC: *mut ::core::ffi::c_int,
8214        nnzTotalDevHostPtr: *mut ::core::ffi::c_int,
8215        pBuffer: *mut ::core::ffi::c_void,
8216    ) -> cusparseStatus_t;
8217}
8218unsafe extern "C" {
8219    pub fn cusparseSpruneDense2csr(
8220        handle: cusparseHandle_t,
8221        m: ::core::ffi::c_int,
8222        n: ::core::ffi::c_int,
8223        A: *const f32,
8224        lda: ::core::ffi::c_int,
8225        threshold: *const f32,
8226        descrC: cusparseMatDescr_t,
8227        csrSortedValC: *mut f32,
8228        csrSortedRowPtrC: *const ::core::ffi::c_int,
8229        csrSortedColIndC: *mut ::core::ffi::c_int,
8230        pBuffer: *mut ::core::ffi::c_void,
8231    ) -> cusparseStatus_t;
8232}
8233unsafe extern "C" {
8234    pub fn cusparseDpruneDense2csr(
8235        handle: cusparseHandle_t,
8236        m: ::core::ffi::c_int,
8237        n: ::core::ffi::c_int,
8238        A: *const f64,
8239        lda: ::core::ffi::c_int,
8240        threshold: *const f64,
8241        descrC: cusparseMatDescr_t,
8242        csrSortedValC: *mut f64,
8243        csrSortedRowPtrC: *const ::core::ffi::c_int,
8244        csrSortedColIndC: *mut ::core::ffi::c_int,
8245        pBuffer: *mut ::core::ffi::c_void,
8246    ) -> cusparseStatus_t;
8247}
8248unsafe extern "C" {
8249    pub fn cusparseSpruneCsr2csr_bufferSizeExt(
8250        handle: cusparseHandle_t,
8251        m: ::core::ffi::c_int,
8252        n: ::core::ffi::c_int,
8253        nnzA: ::core::ffi::c_int,
8254        descrA: cusparseMatDescr_t,
8255        csrSortedValA: *const f32,
8256        csrSortedRowPtrA: *const ::core::ffi::c_int,
8257        csrSortedColIndA: *const ::core::ffi::c_int,
8258        threshold: *const f32,
8259        descrC: cusparseMatDescr_t,
8260        csrSortedValC: *const f32,
8261        csrSortedRowPtrC: *const ::core::ffi::c_int,
8262        csrSortedColIndC: *const ::core::ffi::c_int,
8263        pBufferSizeInBytes: *mut size_t,
8264    ) -> cusparseStatus_t;
8265}
8266unsafe extern "C" {
8267    pub fn cusparseDpruneCsr2csr_bufferSizeExt(
8268        handle: cusparseHandle_t,
8269        m: ::core::ffi::c_int,
8270        n: ::core::ffi::c_int,
8271        nnzA: ::core::ffi::c_int,
8272        descrA: cusparseMatDescr_t,
8273        csrSortedValA: *const f64,
8274        csrSortedRowPtrA: *const ::core::ffi::c_int,
8275        csrSortedColIndA: *const ::core::ffi::c_int,
8276        threshold: *const f64,
8277        descrC: cusparseMatDescr_t,
8278        csrSortedValC: *const f64,
8279        csrSortedRowPtrC: *const ::core::ffi::c_int,
8280        csrSortedColIndC: *const ::core::ffi::c_int,
8281        pBufferSizeInBytes: *mut size_t,
8282    ) -> cusparseStatus_t;
8283}
8284unsafe extern "C" {
8285    pub fn cusparseSpruneCsr2csrNnz(
8286        handle: cusparseHandle_t,
8287        m: ::core::ffi::c_int,
8288        n: ::core::ffi::c_int,
8289        nnzA: ::core::ffi::c_int,
8290        descrA: cusparseMatDescr_t,
8291        csrSortedValA: *const f32,
8292        csrSortedRowPtrA: *const ::core::ffi::c_int,
8293        csrSortedColIndA: *const ::core::ffi::c_int,
8294        threshold: *const f32,
8295        descrC: cusparseMatDescr_t,
8296        csrSortedRowPtrC: *mut ::core::ffi::c_int,
8297        nnzTotalDevHostPtr: *mut ::core::ffi::c_int,
8298        pBuffer: *mut ::core::ffi::c_void,
8299    ) -> cusparseStatus_t;
8300}
8301unsafe extern "C" {
8302    pub fn cusparseDpruneCsr2csrNnz(
8303        handle: cusparseHandle_t,
8304        m: ::core::ffi::c_int,
8305        n: ::core::ffi::c_int,
8306        nnzA: ::core::ffi::c_int,
8307        descrA: cusparseMatDescr_t,
8308        csrSortedValA: *const f64,
8309        csrSortedRowPtrA: *const ::core::ffi::c_int,
8310        csrSortedColIndA: *const ::core::ffi::c_int,
8311        threshold: *const f64,
8312        descrC: cusparseMatDescr_t,
8313        csrSortedRowPtrC: *mut ::core::ffi::c_int,
8314        nnzTotalDevHostPtr: *mut ::core::ffi::c_int,
8315        pBuffer: *mut ::core::ffi::c_void,
8316    ) -> cusparseStatus_t;
8317}
8318unsafe extern "C" {
8319    pub fn cusparseSpruneCsr2csr(
8320        handle: cusparseHandle_t,
8321        m: ::core::ffi::c_int,
8322        n: ::core::ffi::c_int,
8323        nnzA: ::core::ffi::c_int,
8324        descrA: cusparseMatDescr_t,
8325        csrSortedValA: *const f32,
8326        csrSortedRowPtrA: *const ::core::ffi::c_int,
8327        csrSortedColIndA: *const ::core::ffi::c_int,
8328        threshold: *const f32,
8329        descrC: cusparseMatDescr_t,
8330        csrSortedValC: *mut f32,
8331        csrSortedRowPtrC: *const ::core::ffi::c_int,
8332        csrSortedColIndC: *mut ::core::ffi::c_int,
8333        pBuffer: *mut ::core::ffi::c_void,
8334    ) -> cusparseStatus_t;
8335}
8336unsafe extern "C" {
8337    pub fn cusparseDpruneCsr2csr(
8338        handle: cusparseHandle_t,
8339        m: ::core::ffi::c_int,
8340        n: ::core::ffi::c_int,
8341        nnzA: ::core::ffi::c_int,
8342        descrA: cusparseMatDescr_t,
8343        csrSortedValA: *const f64,
8344        csrSortedRowPtrA: *const ::core::ffi::c_int,
8345        csrSortedColIndA: *const ::core::ffi::c_int,
8346        threshold: *const f64,
8347        descrC: cusparseMatDescr_t,
8348        csrSortedValC: *mut f64,
8349        csrSortedRowPtrC: *const ::core::ffi::c_int,
8350        csrSortedColIndC: *mut ::core::ffi::c_int,
8351        pBuffer: *mut ::core::ffi::c_void,
8352    ) -> cusparseStatus_t;
8353}
8354unsafe extern "C" {
8355    pub fn cusparseSpruneDense2csrByPercentage_bufferSizeExt(
8356        handle: cusparseHandle_t,
8357        m: ::core::ffi::c_int,
8358        n: ::core::ffi::c_int,
8359        A: *const f32,
8360        lda: ::core::ffi::c_int,
8361        percentage: f32,
8362        descrC: cusparseMatDescr_t,
8363        csrSortedValC: *const f32,
8364        csrSortedRowPtrC: *const ::core::ffi::c_int,
8365        csrSortedColIndC: *const ::core::ffi::c_int,
8366        info: pruneInfo_t,
8367        pBufferSizeInBytes: *mut size_t,
8368    ) -> cusparseStatus_t;
8369}
8370unsafe extern "C" {
8371    pub fn cusparseDpruneDense2csrByPercentage_bufferSizeExt(
8372        handle: cusparseHandle_t,
8373        m: ::core::ffi::c_int,
8374        n: ::core::ffi::c_int,
8375        A: *const f64,
8376        lda: ::core::ffi::c_int,
8377        percentage: f32,
8378        descrC: cusparseMatDescr_t,
8379        csrSortedValC: *const f64,
8380        csrSortedRowPtrC: *const ::core::ffi::c_int,
8381        csrSortedColIndC: *const ::core::ffi::c_int,
8382        info: pruneInfo_t,
8383        pBufferSizeInBytes: *mut size_t,
8384    ) -> cusparseStatus_t;
8385}
8386unsafe extern "C" {
8387    pub fn cusparseSpruneDense2csrNnzByPercentage(
8388        handle: cusparseHandle_t,
8389        m: ::core::ffi::c_int,
8390        n: ::core::ffi::c_int,
8391        A: *const f32,
8392        lda: ::core::ffi::c_int,
8393        percentage: f32,
8394        descrC: cusparseMatDescr_t,
8395        csrRowPtrC: *mut ::core::ffi::c_int,
8396        nnzTotalDevHostPtr: *mut ::core::ffi::c_int,
8397        info: pruneInfo_t,
8398        pBuffer: *mut ::core::ffi::c_void,
8399    ) -> cusparseStatus_t;
8400}
8401unsafe extern "C" {
8402    pub fn cusparseDpruneDense2csrNnzByPercentage(
8403        handle: cusparseHandle_t,
8404        m: ::core::ffi::c_int,
8405        n: ::core::ffi::c_int,
8406        A: *const f64,
8407        lda: ::core::ffi::c_int,
8408        percentage: f32,
8409        descrC: cusparseMatDescr_t,
8410        csrRowPtrC: *mut ::core::ffi::c_int,
8411        nnzTotalDevHostPtr: *mut ::core::ffi::c_int,
8412        info: pruneInfo_t,
8413        pBuffer: *mut ::core::ffi::c_void,
8414    ) -> cusparseStatus_t;
8415}
8416unsafe extern "C" {
8417    pub fn cusparseSpruneDense2csrByPercentage(
8418        handle: cusparseHandle_t,
8419        m: ::core::ffi::c_int,
8420        n: ::core::ffi::c_int,
8421        A: *const f32,
8422        lda: ::core::ffi::c_int,
8423        percentage: f32,
8424        descrC: cusparseMatDescr_t,
8425        csrSortedValC: *mut f32,
8426        csrSortedRowPtrC: *const ::core::ffi::c_int,
8427        csrSortedColIndC: *mut ::core::ffi::c_int,
8428        info: pruneInfo_t,
8429        pBuffer: *mut ::core::ffi::c_void,
8430    ) -> cusparseStatus_t;
8431}
8432unsafe extern "C" {
8433    pub fn cusparseDpruneDense2csrByPercentage(
8434        handle: cusparseHandle_t,
8435        m: ::core::ffi::c_int,
8436        n: ::core::ffi::c_int,
8437        A: *const f64,
8438        lda: ::core::ffi::c_int,
8439        percentage: f32,
8440        descrC: cusparseMatDescr_t,
8441        csrSortedValC: *mut f64,
8442        csrSortedRowPtrC: *const ::core::ffi::c_int,
8443        csrSortedColIndC: *mut ::core::ffi::c_int,
8444        info: pruneInfo_t,
8445        pBuffer: *mut ::core::ffi::c_void,
8446    ) -> cusparseStatus_t;
8447}
8448unsafe extern "C" {
8449    pub fn cusparseSpruneCsr2csrByPercentage_bufferSizeExt(
8450        handle: cusparseHandle_t,
8451        m: ::core::ffi::c_int,
8452        n: ::core::ffi::c_int,
8453        nnzA: ::core::ffi::c_int,
8454        descrA: cusparseMatDescr_t,
8455        csrSortedValA: *const f32,
8456        csrSortedRowPtrA: *const ::core::ffi::c_int,
8457        csrSortedColIndA: *const ::core::ffi::c_int,
8458        percentage: f32,
8459        descrC: cusparseMatDescr_t,
8460        csrSortedValC: *const f32,
8461        csrSortedRowPtrC: *const ::core::ffi::c_int,
8462        csrSortedColIndC: *const ::core::ffi::c_int,
8463        info: pruneInfo_t,
8464        pBufferSizeInBytes: *mut size_t,
8465    ) -> cusparseStatus_t;
8466}
8467unsafe extern "C" {
8468    pub fn cusparseDpruneCsr2csrByPercentage_bufferSizeExt(
8469        handle: cusparseHandle_t,
8470        m: ::core::ffi::c_int,
8471        n: ::core::ffi::c_int,
8472        nnzA: ::core::ffi::c_int,
8473        descrA: cusparseMatDescr_t,
8474        csrSortedValA: *const f64,
8475        csrSortedRowPtrA: *const ::core::ffi::c_int,
8476        csrSortedColIndA: *const ::core::ffi::c_int,
8477        percentage: f32,
8478        descrC: cusparseMatDescr_t,
8479        csrSortedValC: *const f64,
8480        csrSortedRowPtrC: *const ::core::ffi::c_int,
8481        csrSortedColIndC: *const ::core::ffi::c_int,
8482        info: pruneInfo_t,
8483        pBufferSizeInBytes: *mut size_t,
8484    ) -> cusparseStatus_t;
8485}
8486unsafe extern "C" {
8487    pub fn cusparseSpruneCsr2csrNnzByPercentage(
8488        handle: cusparseHandle_t,
8489        m: ::core::ffi::c_int,
8490        n: ::core::ffi::c_int,
8491        nnzA: ::core::ffi::c_int,
8492        descrA: cusparseMatDescr_t,
8493        csrSortedValA: *const f32,
8494        csrSortedRowPtrA: *const ::core::ffi::c_int,
8495        csrSortedColIndA: *const ::core::ffi::c_int,
8496        percentage: f32,
8497        descrC: cusparseMatDescr_t,
8498        csrSortedRowPtrC: *mut ::core::ffi::c_int,
8499        nnzTotalDevHostPtr: *mut ::core::ffi::c_int,
8500        info: pruneInfo_t,
8501        pBuffer: *mut ::core::ffi::c_void,
8502    ) -> cusparseStatus_t;
8503}
8504unsafe extern "C" {
8505    pub fn cusparseDpruneCsr2csrNnzByPercentage(
8506        handle: cusparseHandle_t,
8507        m: ::core::ffi::c_int,
8508        n: ::core::ffi::c_int,
8509        nnzA: ::core::ffi::c_int,
8510        descrA: cusparseMatDescr_t,
8511        csrSortedValA: *const f64,
8512        csrSortedRowPtrA: *const ::core::ffi::c_int,
8513        csrSortedColIndA: *const ::core::ffi::c_int,
8514        percentage: f32,
8515        descrC: cusparseMatDescr_t,
8516        csrSortedRowPtrC: *mut ::core::ffi::c_int,
8517        nnzTotalDevHostPtr: *mut ::core::ffi::c_int,
8518        info: pruneInfo_t,
8519        pBuffer: *mut ::core::ffi::c_void,
8520    ) -> cusparseStatus_t;
8521}
8522unsafe extern "C" {
8523    pub fn cusparseSpruneCsr2csrByPercentage(
8524        handle: cusparseHandle_t,
8525        m: ::core::ffi::c_int,
8526        n: ::core::ffi::c_int,
8527        nnzA: ::core::ffi::c_int,
8528        descrA: cusparseMatDescr_t,
8529        csrSortedValA: *const f32,
8530        csrSortedRowPtrA: *const ::core::ffi::c_int,
8531        csrSortedColIndA: *const ::core::ffi::c_int,
8532        percentage: f32,
8533        descrC: cusparseMatDescr_t,
8534        csrSortedValC: *mut f32,
8535        csrSortedRowPtrC: *const ::core::ffi::c_int,
8536        csrSortedColIndC: *mut ::core::ffi::c_int,
8537        info: pruneInfo_t,
8538        pBuffer: *mut ::core::ffi::c_void,
8539    ) -> cusparseStatus_t;
8540}
8541unsafe extern "C" {
8542    pub fn cusparseDpruneCsr2csrByPercentage(
8543        handle: cusparseHandle_t,
8544        m: ::core::ffi::c_int,
8545        n: ::core::ffi::c_int,
8546        nnzA: ::core::ffi::c_int,
8547        descrA: cusparseMatDescr_t,
8548        csrSortedValA: *const f64,
8549        csrSortedRowPtrA: *const ::core::ffi::c_int,
8550        csrSortedColIndA: *const ::core::ffi::c_int,
8551        percentage: f32,
8552        descrC: cusparseMatDescr_t,
8553        csrSortedValC: *mut f64,
8554        csrSortedRowPtrC: *const ::core::ffi::c_int,
8555        csrSortedColIndC: *mut ::core::ffi::c_int,
8556        info: pruneInfo_t,
8557        pBuffer: *mut ::core::ffi::c_void,
8558    ) -> cusparseStatus_t;
8559}
8560impl cusparseCsr2CscAlg_t {
8561    pub const CUSPARSE_CSR2CSC_ALG1: cusparseCsr2CscAlg_t = cusparseCsr2CscAlg_t::CUSPARSE_CSR2CSC_ALG_DEFAULT;
8562}
8563#[repr(u32)]
8564#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
8565pub enum cusparseCsr2CscAlg_t {
8566    CUSPARSE_CSR2CSC_ALG_DEFAULT = 1,
8567}
8568unsafe extern "C" {
8569    /// This function converts a sparse matrix in CSR format (that is defined by the three arrays `csrVal`, `csrRowPtr`, and `csrColInd`) into a sparse matrix in CSC format (that is defined by arrays `cscVal`, `cscRowInd`, and `cscColPtr`). The resulting matrix can also be seen as the transpose of the original sparse matrix. Notice that this routine can also be used to convert a matrix in CSC format into a matrix in CSR format.
8570    ///
8571    /// The routine requires extra storage proportional to the number of nonzero values `nnz`. It provides in output always the same matrix.
8572    ///
8573    /// It is executed asynchronously with respect to the host, and it may return control to the application on the host before the result is ready.
8574    ///
8575    /// The function [`cusparseCsr2cscEx2_bufferSize`] returns the size of the workspace needed by [`cusparseCsr2cscEx2`]. User needs to allocate a buffer of this size and give that buffer to [`cusparseCsr2cscEx2`] as an argument.
8576    ///
8577    /// If `nnz == 0`, then `csrColInd`, `csrVal`, `cscVal`, and `cscRowInd` could have `NULL` value. In this case, `cscColPtr` is set to `idxBase` for all values.
8578    ///
8579    /// If `m == 0` or `n == 0`, the pointers are not checked and the routine returns [`cusparseStatus_t::CUSPARSE_STATUS_SUCCESS`].
8580    ///
8581    /// [`cusparseCsr2cscEx2`] supports the following data types:
8582    ///
8583    /// | `X`/`Y` |
8584    /// | --- |
8585    /// | `cudaDataType_t::CUDA_R_8I` |
8586    /// | `cudaDataType_t::CUDA_R_16F` |
8587    /// | `cudaDataType_t::CUDA_R_16BF` |
8588    /// | `cudaDataType_t::CUDA_R_32F` |
8589    /// | `cudaDataType_t::CUDA_R_64F` |
8590    /// | `cudaDataType_t::CUDA_C_16F` \[DEPRECATED\] |
8591    /// | `cudaDataType_t::CUDA_C_16BF` \[DEPRECATED\] |
8592    /// | `cudaDataType_t::CUDA_C_32F` |
8593    /// | `cudaDataType_t::CUDA_C_64F` |
8594    ///
8595    /// [`cusparseCsr2cscEx2`] supports the following algorithms ([`cusparseCsr2CscAlg_t`]):
8596    ///
8597    /// | Algorithm | Notes |
8598    /// | --- | --- |
8599    /// | [`cusparseCsr2CscAlg_t::CUSPARSE_CSR2CSC_ALG_DEFAULT`], `CUSPARSE_CSR2CSC_ALG1` | Default algorithm |
8600    ///
8601    /// | Action | Notes |
8602    /// | --- | --- |
8603    /// | [`cusparseAction_t::CUSPARSE_ACTION_SYMBOLIC`] | Compute the “structure” of the CSC output matrix (offset, row indices) |
8604    /// | [`cusparseAction_t::CUSPARSE_ACTION_NUMERIC`] | Compute the “structure” of the CSC output matrix and copy the values |
8605    ///
8606    /// [`cusparseCsr2cscEx2`] has the following properties:
8607    ///
8608    /// * The routine requires no extra storage
8609    /// * The routine supports asynchronous execution
8610    ///
8611    /// [`cusparseCsr2cscEx2`] supports the following optimizations:
8612    ///
8613    /// * CUDA graph capture
8614    /// * Hardware Memory Compression.
8615    ///
8616    /// # Parameters
8617    ///
8618    /// - `handle`: Handle to the cuSPARSE library context.
8619    /// - `m`: Number of rows of the CSR input matrix; number of columns of the CSC ouput matrix.
8620    /// - `n`: Number of columns of the CSR input matrix; number of rows of the CSC ouput matrix.
8621    /// - `nnz`: Number of nonzero elements of the CSR and CSC matrices.
8622    /// - `csrVal`: Value array of size `nnz` of the CSR matrix; of same type as `valType`.
8623    /// - `csrRowPtr`: Integer array of size `m + 1` that containes the CSR row offsets.
8624    /// - `csrColInd`: Integer array of size `nnz` that containes the CSR column indices.
8625    /// - `cscVal`: Value array of size `nnz` of the CSC matrix; of same type as `valType`.
8626    /// - `cscColPtr`: Integer array of size `n + 1` that containes the CSC column offsets.
8627    /// - `cscRowInd`: Integer array of size `nnz` that containes the CSC row indices.
8628    /// - `valType`: Value type for both CSR and CSC matrices.
8629    /// - `copyValues`: [`cusparseAction_t::CUSPARSE_ACTION_SYMBOLIC`] or [`cusparseAction_t::CUSPARSE_ACTION_NUMERIC`].
8630    /// - `idxBase`: Index base [`cusparseIndexBase_t::CUSPARSE_INDEX_BASE_ZERO`] or [`cusparseIndexBase_t::CUSPARSE_INDEX_BASE_ONE`].
8631    /// - `alg`: Algorithm implementation. see [`cusparseCsr2CscAlg_t`] for possible values.
8632    /// - `buffer`: Pointer to workspace buffer.
8633    pub fn cusparseCsr2cscEx2(
8634        handle: cusparseHandle_t,
8635        m: ::core::ffi::c_int,
8636        n: ::core::ffi::c_int,
8637        nnz: ::core::ffi::c_int,
8638        csrVal: *const ::core::ffi::c_void,
8639        csrRowPtr: *const ::core::ffi::c_int,
8640        csrColInd: *const ::core::ffi::c_int,
8641        cscVal: *mut ::core::ffi::c_void,
8642        cscColPtr: *mut ::core::ffi::c_int,
8643        cscRowInd: *mut ::core::ffi::c_int,
8644        valType: cudaDataType,
8645        copyValues: cusparseAction_t,
8646        idxBase: cusparseIndexBase_t,
8647        alg: cusparseCsr2CscAlg_t,
8648        buffer: *mut ::core::ffi::c_void,
8649    ) -> cusparseStatus_t;
8650}
8651unsafe extern "C" {
8652    pub fn cusparseCsr2cscEx2_bufferSize(
8653        handle: cusparseHandle_t,
8654        m: ::core::ffi::c_int,
8655        n: ::core::ffi::c_int,
8656        nnz: ::core::ffi::c_int,
8657        csrVal: *const ::core::ffi::c_void,
8658        csrRowPtr: *const ::core::ffi::c_int,
8659        csrColInd: *const ::core::ffi::c_int,
8660        cscVal: *mut ::core::ffi::c_void,
8661        cscColPtr: *mut ::core::ffi::c_int,
8662        cscRowInd: *mut ::core::ffi::c_int,
8663        valType: cudaDataType,
8664        copyValues: cusparseAction_t,
8665        idxBase: cusparseIndexBase_t,
8666        alg: cusparseCsr2CscAlg_t,
8667        bufferSize: *mut size_t,
8668    ) -> cusparseStatus_t;
8669}
8670/// This type indicates the format of the sparse matrix.
8671/// See cuSPARSE Storage Formats for their description.
8672#[repr(u32)]
8673#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
8674pub enum cusparseFormat_t {
8675    /// The matrix is stored in Compressed Sparse Row (CSR) format.
8676    CUSPARSE_FORMAT_CSR = 1,
8677    /// The matrix is stored in Compressed Sparse Column (CSC) format.
8678    CUSPARSE_FORMAT_CSC = 2,
8679    /// The matrix is stored in Coordinate (COO) format organized in *Structure of Arrays (SoA)* layout.
8680    CUSPARSE_FORMAT_COO = 3,
8681    /// The matrix is stored in Blocked-Ellpack (Blocked-ELL) format.
8682    CUSPARSE_FORMAT_BLOCKED_ELL = 5,
8683    /// The matrix is stored in Block Sparse Row (BSR) format.
8684    CUSPARSE_FORMAT_BSR = 6,
8685    CUSPARSE_FORMAT_SLICED_ELLPACK = 7,
8686}
8687/// This type indicates the memory layout of a dense matrix.
8688#[repr(u32)]
8689#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
8690pub enum cusparseOrder_t {
8691    /// The matrix is stored in column-major.
8692    CUSPARSE_ORDER_COL = 1,
8693    /// The matrix is stored in row-major.
8694    CUSPARSE_ORDER_ROW = 2,
8695}
8696/// This type indicates the index type for representing the sparse matrix indices.
8697#[repr(u32)]
8698#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
8699pub enum cusparseIndexType_t {
8700    CUSPARSE_INDEX_16U = 1,
8701    /// 32-bit signed integer \[0, 2^31 - 1\].
8702    CUSPARSE_INDEX_32I = 2,
8703    /// 64-bit signed integer \[0, 2^63 - 1\].
8704    CUSPARSE_INDEX_64I = 3,
8705}
8706#[repr(C)]
8707#[derive(Debug, Copy, Clone)]
8708pub struct cusparseSpVecDescr {
8709    _unused: [u8; 0],
8710}
8711#[repr(C)]
8712#[derive(Debug, Copy, Clone)]
8713pub struct cusparseDnVecDescr {
8714    _unused: [u8; 0],
8715}
8716#[repr(C)]
8717#[derive(Debug, Copy, Clone)]
8718pub struct cusparseSpMatDescr {
8719    _unused: [u8; 0],
8720}
8721#[repr(C)]
8722#[derive(Debug, Copy, Clone)]
8723pub struct cusparseDnMatDescr {
8724    _unused: [u8; 0],
8725}
8726pub type cusparseSpVecDescr_t = *mut cusparseSpVecDescr;
8727pub type cusparseDnVecDescr_t = *mut cusparseDnVecDescr;
8728pub type cusparseSpMatDescr_t = *mut cusparseSpMatDescr;
8729pub type cusparseDnMatDescr_t = *mut cusparseDnMatDescr;
8730pub type cusparseConstSpVecDescr_t = *const cusparseSpVecDescr;
8731pub type cusparseConstDnVecDescr_t = *const cusparseDnVecDescr;
8732pub type cusparseConstSpMatDescr_t = *const cusparseSpMatDescr;
8733pub type cusparseConstDnMatDescr_t = *const cusparseDnMatDescr;
8734unsafe extern "C" {
8735    /// This function initializes the sparse matrix descriptor `spVecDescr`.
8736    ///
8737    /// [`cusparseCreateSpVec`] has the following constraints:
8738    ///
8739    /// * `indices` and `values` must be aligned to the size of the datatypes specified by `idxType` and `valueType`, respectively. See [`cudaDataType_t`] for the description of the datatypes.
8740    ///
8741    /// # Parameters
8742    ///
8743    /// - `spVecDescr`: Sparse vector descriptor.
8744    /// - `size`: Size of the sparse vector.
8745    /// - `nnz`: Number of non-zero entries of the sparse vector.
8746    /// - `indices`: Indices of the sparse vector. Array with `nnz` elements.
8747    /// - `values`: Values of the sparse vector. Array with `nnz` elements.
8748    /// - `idxType`: Enumerator specifying the data type of `indices`.
8749    /// - `idxBase`: Enumerator specifying the index base of `indices`.
8750    /// - `valueType`: Enumerator specifying the datatype of `values`.
8751    pub fn cusparseCreateSpVec(
8752        spVecDescr: *mut cusparseSpVecDescr_t,
8753        size: i64,
8754        nnz: i64,
8755        indices: *mut ::core::ffi::c_void,
8756        values: *mut ::core::ffi::c_void,
8757        idxType: cusparseIndexType_t,
8758        idxBase: cusparseIndexBase_t,
8759        valueType: cudaDataType,
8760    ) -> cusparseStatus_t;
8761}
8762unsafe extern "C" {
8763    pub fn cusparseCreateConstSpVec(
8764        spVecDescr: *mut cusparseConstSpVecDescr_t,
8765        size: i64,
8766        nnz: i64,
8767        indices: *const ::core::ffi::c_void,
8768        values: *const ::core::ffi::c_void,
8769        idxType: cusparseIndexType_t,
8770        idxBase: cusparseIndexBase_t,
8771        valueType: cudaDataType,
8772    ) -> cusparseStatus_t;
8773}
8774unsafe extern "C" {
8775    /// This function releases the host memory allocated for the sparse vector descriptor `spVecDescr`.
8776    ///
8777    /// # Parameters
8778    ///
8779    /// - `spVecDescr`: Sparse vector descriptor.
8780    pub fn cusparseDestroySpVec(
8781        spVecDescr: cusparseConstSpVecDescr_t,
8782    ) -> cusparseStatus_t;
8783}
8784unsafe extern "C" {
8785    /// This function returns the fields of the sparse vector descriptor `spVecDescr`.
8786    ///
8787    /// # Parameters
8788    ///
8789    /// - `spVecDescr`: Sparse vector descriptor.
8790    /// - `size`: Size of the sparse vector.
8791    /// - `nnz`: Number of non-zero entries of the sparse vector.
8792    /// - `indices`: Indices of the sparse vector. Array with `nnz` elements.
8793    /// - `values`: Values of the sparse vector. Array with `nnz` elements.
8794    /// - `idxType`: Enumerator specifying the data type of `indices`.
8795    /// - `idxBase`: Enumerator specifying the index base of `indices`.
8796    /// - `valueType`: Enumerator specifying the datatype of `values`.
8797    pub fn cusparseSpVecGet(
8798        spVecDescr: cusparseSpVecDescr_t,
8799        size: *mut i64,
8800        nnz: *mut i64,
8801        indices: *mut *mut ::core::ffi::c_void,
8802        values: *mut *mut ::core::ffi::c_void,
8803        idxType: *mut cusparseIndexType_t,
8804        idxBase: *mut cusparseIndexBase_t,
8805        valueType: *mut cudaDataType,
8806    ) -> cusparseStatus_t;
8807}
8808unsafe extern "C" {
8809    pub fn cusparseConstSpVecGet(
8810        spVecDescr: cusparseConstSpVecDescr_t,
8811        size: *mut i64,
8812        nnz: *mut i64,
8813        indices: *mut *const ::core::ffi::c_void,
8814        values: *mut *const ::core::ffi::c_void,
8815        idxType: *mut cusparseIndexType_t,
8816        idxBase: *mut cusparseIndexBase_t,
8817        valueType: *mut cudaDataType,
8818    ) -> cusparseStatus_t;
8819}
8820unsafe extern "C" {
8821    /// This function returns the `idxBase` field of the sparse vector descriptor `spVecDescr`.
8822    ///
8823    /// # Parameters
8824    ///
8825    /// - `spVecDescr`: Sparse vector descriptor.
8826    /// - `idxBase`: Enumerator specifying the index base of `indices`.
8827    pub fn cusparseSpVecGetIndexBase(
8828        spVecDescr: cusparseConstSpVecDescr_t,
8829        idxBase: *mut cusparseIndexBase_t,
8830    ) -> cusparseStatus_t;
8831}
8832unsafe extern "C" {
8833    /// This function returns the `values` field of the sparse vector descriptor `spVecDescr`.
8834    ///
8835    /// # Parameters
8836    ///
8837    /// - `spVecDescr`: Sparse vector descriptor.
8838    /// - `values`: Values of the sparse vector. Array with `nnz` elements.
8839    pub fn cusparseSpVecGetValues(
8840        spVecDescr: cusparseSpVecDescr_t,
8841        values: *mut *mut ::core::ffi::c_void,
8842    ) -> cusparseStatus_t;
8843}
8844unsafe extern "C" {
8845    pub fn cusparseConstSpVecGetValues(
8846        spVecDescr: cusparseConstSpVecDescr_t,
8847        values: *mut *const ::core::ffi::c_void,
8848    ) -> cusparseStatus_t;
8849}
8850unsafe extern "C" {
8851    /// This function sets the `values` field of the sparse vector descriptor `spVecDescr`.
8852    ///
8853    /// [`cusparseDnVecSetValues`] has the following constraints:
8854    ///
8855    /// * `values` must be aligned to the size of the datatype specified in `spVecDescr`. See [`cudaDataType_t`] for the description of the datatypes.
8856    ///
8857    /// # Parameters
8858    ///
8859    /// - `spVecDescr`: Sparse vector descriptor.
8860    /// - `values`: Values of the sparse vector. Array with `nnz` elements.
8861    pub fn cusparseSpVecSetValues(
8862        spVecDescr: cusparseSpVecDescr_t,
8863        values: *mut ::core::ffi::c_void,
8864    ) -> cusparseStatus_t;
8865}
8866unsafe extern "C" {
8867    /// This function initializes the dense vector descriptor `dnVecDescr`.
8868    ///
8869    /// [`cusparseCreateDnVec`] has the following constraints:
8870    ///
8871    /// * `values` must be aligned to the size of the datatype specified by `valueType`. Refer to [`cudaDataType_t`] for the description of the datatypes.
8872    ///
8873    /// # Parameters
8874    ///
8875    /// - `dnVecDescr`: Dense vector descriptor.
8876    /// - `size`: Size of the dense vector.
8877    /// - `values`: Values of the dense vector. Array with `size` elements.
8878    /// - `valueType`: Enumerator specifying the datatype of `values`.
8879    pub fn cusparseCreateDnVec(
8880        dnVecDescr: *mut cusparseDnVecDescr_t,
8881        size: i64,
8882        values: *mut ::core::ffi::c_void,
8883        valueType: cudaDataType,
8884    ) -> cusparseStatus_t;
8885}
8886unsafe extern "C" {
8887    pub fn cusparseCreateConstDnVec(
8888        dnVecDescr: *mut cusparseConstDnVecDescr_t,
8889        size: i64,
8890        values: *const ::core::ffi::c_void,
8891        valueType: cudaDataType,
8892    ) -> cusparseStatus_t;
8893}
8894unsafe extern "C" {
8895    /// This function releases the host memory allocated for the dense vector descriptor `dnVecDescr`.
8896    ///
8897    /// # Parameters
8898    ///
8899    /// - `dnVecDescr`: Dense vector descriptor.
8900    pub fn cusparseDestroyDnVec(
8901        dnVecDescr: cusparseConstDnVecDescr_t,
8902    ) -> cusparseStatus_t;
8903}
8904unsafe extern "C" {
8905    /// This function returns the fields of the dense vector descriptor `dnVecDescr`.
8906    ///
8907    /// # Parameters
8908    ///
8909    /// - `dnVecDescr`: Dense vector descriptor.
8910    /// - `size`: Size of the dense vector.
8911    /// - `values`: Values of the dense vector. Array with `nnz` elements.
8912    /// - `valueType`: Enumerator specifying the datatype of `values`.
8913    pub fn cusparseDnVecGet(
8914        dnVecDescr: cusparseDnVecDescr_t,
8915        size: *mut i64,
8916        values: *mut *mut ::core::ffi::c_void,
8917        valueType: *mut cudaDataType,
8918    ) -> cusparseStatus_t;
8919}
8920unsafe extern "C" {
8921    pub fn cusparseConstDnVecGet(
8922        dnVecDescr: cusparseConstDnVecDescr_t,
8923        size: *mut i64,
8924        values: *mut *const ::core::ffi::c_void,
8925        valueType: *mut cudaDataType,
8926    ) -> cusparseStatus_t;
8927}
8928unsafe extern "C" {
8929    /// This function returns the `values` field of the dense vector descriptor `dnVecDescr`.
8930    ///
8931    /// # Parameters
8932    ///
8933    /// - `dnVecDescr`: Dense vector descriptor.
8934    /// - `values`: Values of the dense vector.
8935    pub fn cusparseDnVecGetValues(
8936        dnVecDescr: cusparseDnVecDescr_t,
8937        values: *mut *mut ::core::ffi::c_void,
8938    ) -> cusparseStatus_t;
8939}
8940unsafe extern "C" {
8941    pub fn cusparseConstDnVecGetValues(
8942        dnVecDescr: cusparseConstDnVecDescr_t,
8943        values: *mut *const ::core::ffi::c_void,
8944    ) -> cusparseStatus_t;
8945}
8946unsafe extern "C" {
8947    /// This function sets the `values` field of the dense vector descriptor `dnVecDescr`.
8948    ///
8949    /// [`cusparseDnVecSetValues`] has the following constraints:
8950    ///
8951    /// * `values` must be aligned to the size of the datatype specified in `dnVecDescr`. Refer to [`cudaDataType_t`] for the description of the datatypes.
8952    ///
8953    /// # Parameters
8954    ///
8955    /// - `dnVecDescr`: Dense vector descriptor.
8956    /// - `values`: Values of the dense vector. Array with `size` elements.
8957    pub fn cusparseDnVecSetValues(
8958        dnVecDescr: cusparseDnVecDescr_t,
8959        values: *mut ::core::ffi::c_void,
8960    ) -> cusparseStatus_t;
8961}
8962unsafe extern "C" {
8963    /// This function releases the host memory allocated for the sparse matrix descriptor `spMatDescr`.
8964    ///
8965    /// # Parameters
8966    ///
8967    /// - `spMatDescr`: Sparse matrix descriptor.
8968    pub fn cusparseDestroySpMat(
8969        spMatDescr: cusparseConstSpMatDescr_t,
8970    ) -> cusparseStatus_t;
8971}
8972unsafe extern "C" {
8973    /// This function returns the `format` field of the sparse matrix descriptor `spMatDescr`.
8974    ///
8975    /// # Parameters
8976    ///
8977    /// - `spMatDescr`: Sparse matrix descriptor.
8978    /// - `format`: Storage format of the sparse matrix.
8979    pub fn cusparseSpMatGetFormat(
8980        spMatDescr: cusparseConstSpMatDescr_t,
8981        format: *mut cusparseFormat_t,
8982    ) -> cusparseStatus_t;
8983}
8984unsafe extern "C" {
8985    /// This function returns the `idxBase` field of the sparse matrix descriptor `spMatDescr`.
8986    ///
8987    /// # Parameters
8988    ///
8989    /// - `spMatDescr`: Sparse matrix descriptor.
8990    /// - `idxBase`: Index base of the sparse matrix.
8991    pub fn cusparseSpMatGetIndexBase(
8992        spMatDescr: cusparseConstSpMatDescr_t,
8993        idxBase: *mut cusparseIndexBase_t,
8994    ) -> cusparseStatus_t;
8995}
8996unsafe extern "C" {
8997    /// This function returns the `values` field of the sparse matrix descriptor `spMatDescr`.
8998    ///
8999    /// # Parameters
9000    ///
9001    /// - `spMatDescr`: Sparse matrix descriptor.
9002    /// - `values`: Values of the sparse matrix. Array with `nnz` elements.
9003    pub fn cusparseSpMatGetValues(
9004        spMatDescr: cusparseSpMatDescr_t,
9005        values: *mut *mut ::core::ffi::c_void,
9006    ) -> cusparseStatus_t;
9007}
9008unsafe extern "C" {
9009    pub fn cusparseConstSpMatGetValues(
9010        spMatDescr: cusparseConstSpMatDescr_t,
9011        values: *mut *const ::core::ffi::c_void,
9012    ) -> cusparseStatus_t;
9013}
9014unsafe extern "C" {
9015    /// This function sets the `values` field of the sparse matrix descriptor `spMatDescr`.
9016    ///
9017    /// [`cusparseSpMatSetValues`] has the following constraints:
9018    ///
9019    /// * `values` must be aligned to the size of its corresponding datatype specified in `spMatDescr`. See [`cudaDataType_t`] for the description of the datatypes.
9020    ///
9021    /// # Parameters
9022    ///
9023    /// - `spMatDescr`: Sparse matrix descriptor.
9024    /// - `values`: Values of the sparse matrix. Array with `nnz` elements.
9025    pub fn cusparseSpMatSetValues(
9026        spMatDescr: cusparseSpMatDescr_t,
9027        values: *mut ::core::ffi::c_void,
9028    ) -> cusparseStatus_t;
9029}
9030unsafe extern "C" {
9031    /// This function returns the sizes of the sparse matrix `spMatDescr`.
9032    ///
9033    /// # Parameters
9034    ///
9035    /// - `spMatDescr`: Sparse matrix descriptor.
9036    /// - `rows`: Number of rows of the sparse matrix.
9037    /// - `cols`: Number of columns of the sparse matrix.
9038    /// - `nnz`: Number of non-zero entries of the sparse matrix.
9039    pub fn cusparseSpMatGetSize(
9040        spMatDescr: cusparseConstSpMatDescr_t,
9041        rows: *mut i64,
9042        cols: *mut i64,
9043        nnz: *mut i64,
9044    ) -> cusparseStatus_t;
9045}
9046unsafe extern "C" {
9047    /// This function returns the `batchCount` field of the sparse matrix descriptor `spMatDescr`.
9048    ///
9049    /// # Parameters
9050    ///
9051    /// - `spMatDescr`: Sparse matrix descriptor.
9052    /// - `batchCount`: Number of batches of the sparse matrix.
9053    pub fn cusparseSpMatGetStridedBatch(
9054        spMatDescr: cusparseConstSpMatDescr_t,
9055        batchCount: *mut ::core::ffi::c_int,
9056    ) -> cusparseStatus_t;
9057}
9058unsafe extern "C" {
9059    /// This function sets the `batchCount` and the `batchStride` fields of the sparse matrix descriptor `spMatDescr`.
9060    ///
9061    /// # Parameters
9062    ///
9063    /// - `spMatDescr`: Sparse matrix descriptor.
9064    /// - `batchCount`: Number of batches of the sparse matrix.
9065    /// - `batchStride`: address offset between consecutive batches.
9066    pub fn cusparseCooSetStridedBatch(
9067        spMatDescr: cusparseSpMatDescr_t,
9068        batchCount: ::core::ffi::c_int,
9069        batchStride: i64,
9070    ) -> cusparseStatus_t;
9071}
9072unsafe extern "C" {
9073    /// This function sets the `batchCount` and the `batchStride` fields of the sparse matrix descriptor `spMatDescr`.
9074    ///
9075    /// # Parameters
9076    ///
9077    /// - `spMatDescr`: Sparse matrix descriptor.
9078    /// - `batchCount`: Number of batches of the sparse matrix.
9079    /// - `offsetsBatchStride`: Address offset between consecutive batches for the row offset array.
9080    /// - `columnsValuesBatchStride`: Address offset between consecutive batches for the column and value arrays.
9081    pub fn cusparseCsrSetStridedBatch(
9082        spMatDescr: cusparseSpMatDescr_t,
9083        batchCount: ::core::ffi::c_int,
9084        offsetsBatchStride: i64,
9085        columnsValuesBatchStride: i64,
9086    ) -> cusparseStatus_t;
9087}
9088unsafe extern "C" {
9089    /// This function sets the `batchCount` and the `batchStride` fields of the sparse matrix descriptor `spMatDescr`.
9090    ///
9091    /// # Parameters
9092    ///
9093    /// - `spMatDescr`: Sparse matrix descriptor.
9094    /// - `batchCount`: Number of batches of the sparse matrix.
9095    /// - `offsetsBatchStride`: Address offset between consecutive batches for the row offset array.
9096    /// - `columnsBatchStride`: Address offset between consecutive batches for the column array.
9097    pub fn cusparseBsrSetStridedBatch(
9098        spMatDescr: cusparseSpMatDescr_t,
9099        batchCount: ::core::ffi::c_int,
9100        offsetsBatchStride: i64,
9101        columnsBatchStride: i64,
9102        ValuesBatchStride: i64,
9103    ) -> cusparseStatus_t;
9104}
9105#[repr(u32)]
9106#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
9107pub enum cusparseSpMatAttribute_t {
9108    CUSPARSE_SPMAT_FILL_MODE = 0,
9109    CUSPARSE_SPMAT_DIAG_TYPE = 1,
9110}
9111unsafe extern "C" {
9112    /// The function gets the attributes of the sparse matrix descriptor `spMatDescr`.
9113    ///
9114    /// | Attribute | Meaning | Possible Values |
9115    /// | --- | --- | --- |
9116    /// | [`cusparseSpMatAttribute_t::CUSPARSE_SPMAT_FILL_MODE`] | Indicates if the lower or upper part of a matrix is stored in sparse storage | [`cusparseFillMode_t::CUSPARSE_FILL_MODE_LOWER`], [`cusparseFillMode_t::CUSPARSE_FILL_MODE_UPPER`] |
9117    /// | [`cusparseSpMatAttribute_t::CUSPARSE_SPMAT_DIAG_TYPE`] | Indicates if the matrix diagonal entries are unity | [`cusparseDiagType_t::CUSPARSE_DIAG_TYPE_NON_UNIT`], [`cusparseDiagType_t::CUSPARSE_DIAG_TYPE_UNIT`] |
9118    ///
9119    /// # Parameters
9120    ///
9121    /// - `spMatDescr`: Sparse matrix descriptor.
9122    /// - `attribute`: Attribute enumerator.
9123    /// - `data`: Attribute value.
9124    /// - `dataSize`: Size of the attribute in bytes for safety.
9125    pub fn cusparseSpMatGetAttribute(
9126        spMatDescr: cusparseConstSpMatDescr_t,
9127        attribute: cusparseSpMatAttribute_t,
9128        data: *mut ::core::ffi::c_void,
9129        dataSize: size_t,
9130    ) -> cusparseStatus_t;
9131}
9132unsafe extern "C" {
9133    /// The function sets the attributes of the sparse matrix descriptor `spMatDescr`
9134    ///
9135    /// | Attribute | Meaning | Possible Values |
9136    /// | --- | --- | --- |
9137    /// | [`cusparseSpMatAttribute_t::CUSPARSE_SPMAT_FILL_MODE`] | Indicates if the lower or upper part of a matrix is stored in sparse storage | [`cusparseFillMode_t::CUSPARSE_FILL_MODE_LOWER`], [`cusparseFillMode_t::CUSPARSE_FILL_MODE_UPPER`] |
9138    /// | [`cusparseSpMatAttribute_t::CUSPARSE_SPMAT_DIAG_TYPE`] | Indicates if the matrix diagonal entries are unity | [`cusparseDiagType_t::CUSPARSE_DIAG_TYPE_NON_UNIT`], [`cusparseDiagType_t::CUSPARSE_DIAG_TYPE_UNIT`] |
9139    ///
9140    /// # Parameters
9141    ///
9142    /// - `spMatDescr`: Sparse matrix descriptor.
9143    /// - `attribute`: Attribute enumerator.
9144    /// - `data`: Attribute value.
9145    /// - `dataSize`: Size of the attribute in bytes for safety.
9146    pub fn cusparseSpMatSetAttribute(
9147        spMatDescr: cusparseSpMatDescr_t,
9148        attribute: cusparseSpMatAttribute_t,
9149        data: *mut ::core::ffi::c_void,
9150        dataSize: size_t,
9151    ) -> cusparseStatus_t;
9152}
9153unsafe extern "C" {
9154    /// This function initializes the sparse matrix descriptor `spMatDescr` in the CSR format.
9155    ///
9156    /// [`cusparseCreateCsr`] has the following constraints:
9157    ///
9158    /// * `csrRowOffsets`, `csrColInd`, and `csrValues` must be aligned to the size of the datatypes specified by `csrRowOffsetsType`, `csrColIndType`, and `valueType`, respectively. See [`cudaDataType_t`] for the description of the datatypes.
9159    ///
9160    /// # Parameters
9161    ///
9162    /// - `spMatDescr`: Sparse matrix descriptor.
9163    /// - `rows`: Number of rows of the sparse matrix.
9164    /// - `cols`: Number of columns of the sparse matrix.
9165    /// - `nnz`: Number of non-zero entries of the sparse matrix.
9166    /// - `csrRowOffsets`: Row offsets of the sparse matrix. Array with `rows + 1` elements.
9167    /// - `csrColInd`: Column indices of the sparse matrix. Array with `nnz` elements.
9168    /// - `csrValues`: Values of the sparse matrix. Array with `nnz` elements.
9169    /// - `csrRowOffsetsType`: Data type of `csrRowOffsets`.
9170    /// - `csrColIndType`: Data type of `csrColInd`.
9171    /// - `idxBase`: Index base of `csrRowOffsets` and `csrColInd`.
9172    /// - `valueType`: Datatype of `csrValues`.
9173    pub fn cusparseCreateCsr(
9174        spMatDescr: *mut cusparseSpMatDescr_t,
9175        rows: i64,
9176        cols: i64,
9177        nnz: i64,
9178        csrRowOffsets: *mut ::core::ffi::c_void,
9179        csrColInd: *mut ::core::ffi::c_void,
9180        csrValues: *mut ::core::ffi::c_void,
9181        csrRowOffsetsType: cusparseIndexType_t,
9182        csrColIndType: cusparseIndexType_t,
9183        idxBase: cusparseIndexBase_t,
9184        valueType: cudaDataType,
9185    ) -> cusparseStatus_t;
9186}
9187unsafe extern "C" {
9188    pub fn cusparseCreateConstCsr(
9189        spMatDescr: *mut cusparseConstSpMatDescr_t,
9190        rows: i64,
9191        cols: i64,
9192        nnz: i64,
9193        csrRowOffsets: *const ::core::ffi::c_void,
9194        csrColInd: *const ::core::ffi::c_void,
9195        csrValues: *const ::core::ffi::c_void,
9196        csrRowOffsetsType: cusparseIndexType_t,
9197        csrColIndType: cusparseIndexType_t,
9198        idxBase: cusparseIndexBase_t,
9199        valueType: cudaDataType,
9200    ) -> cusparseStatus_t;
9201}
9202unsafe extern "C" {
9203    /// This function initializes the sparse matrix descriptor `spMatDescr` in the CSC format.
9204    ///
9205    /// [`cusparseCreateCsc`] has the following constraints:
9206    ///
9207    /// * `cscColOffsets`, `cscRowInd`, and `cscValues` must be aligned to the size of the datatypes specified by `cscColOffsetsType`, `cscRowIndType`, and `valueType`, respectively. See [`cudaDataType_t`] for the description of the datatypes.
9208    ///
9209    /// # Parameters
9210    ///
9211    /// - `spMatDescr`: Sparse matrix descriptor.
9212    /// - `rows`: Number of rows of the sparse matrix.
9213    /// - `cols`: Number of columns of the sparse matrix.
9214    /// - `nnz`: Number of non-zero entries of the sparse matrix.
9215    /// - `cscColOffsets`: Column offsets of the sparse matrix. Array with `cols + 1` elements.
9216    /// - `cscRowInd`: Row indices of the sparse matrix. Array with `nnz` elements.
9217    /// - `cscValues`: Values of the sparse matrix. Array with `nnz` elements.
9218    /// - `cscColOffsetsType`: Data type of `cscColOffsets`.
9219    /// - `cscRowIndType`: Data type of `cscRowInd`.
9220    /// - `idxBase`: Index base of `cscColOffsets` and `cscRowInd`.
9221    /// - `valueType`: Datatype of `cscValues`.
9222    pub fn cusparseCreateCsc(
9223        spMatDescr: *mut cusparseSpMatDescr_t,
9224        rows: i64,
9225        cols: i64,
9226        nnz: i64,
9227        cscColOffsets: *mut ::core::ffi::c_void,
9228        cscRowInd: *mut ::core::ffi::c_void,
9229        cscValues: *mut ::core::ffi::c_void,
9230        cscColOffsetsType: cusparseIndexType_t,
9231        cscRowIndType: cusparseIndexType_t,
9232        idxBase: cusparseIndexBase_t,
9233        valueType: cudaDataType,
9234    ) -> cusparseStatus_t;
9235}
9236unsafe extern "C" {
9237    pub fn cusparseCreateConstCsc(
9238        spMatDescr: *mut cusparseConstSpMatDescr_t,
9239        rows: i64,
9240        cols: i64,
9241        nnz: i64,
9242        cscColOffsets: *const ::core::ffi::c_void,
9243        cscRowInd: *const ::core::ffi::c_void,
9244        cscValues: *const ::core::ffi::c_void,
9245        cscColOffsetsType: cusparseIndexType_t,
9246        cscRowIndType: cusparseIndexType_t,
9247        idxBase: cusparseIndexBase_t,
9248        valueType: cudaDataType,
9249    ) -> cusparseStatus_t;
9250}
9251unsafe extern "C" {
9252    /// This function returns the fields of the sparse matrix descriptor `spMatDescr` stored in CSR format.
9253    ///
9254    /// # Parameters
9255    ///
9256    /// - `spMatDescr`: Sparse matrix descriptor.
9257    /// - `rows`: Number of rows of the sparse matrix.
9258    /// - `cols`: Number of columns of the sparse matrix.
9259    /// - `nnz`: Number of non-zero entries of the sparse matrix.
9260    /// - `csrRowOffsets`: Row offsets of the sparse matrix. Array with `rows + 1` elements.
9261    /// - `csrColInd`: Column indices of the sparse matrix. Array with `nnz` elements.
9262    /// - `csrValues`: Values of the sparse matrix. Array with `nnz` elements.
9263    /// - `csrRowOffsetsType`: Data type of `csrRowOffsets`.
9264    /// - `csrColIndType`: Data type of `csrColInd`.
9265    /// - `idxBase`: Index base of `csrRowOffsets` and `csrColInd`.
9266    /// - `valueType`: Datatype of `csrValues`.
9267    pub fn cusparseCsrGet(
9268        spMatDescr: cusparseSpMatDescr_t,
9269        rows: *mut i64,
9270        cols: *mut i64,
9271        nnz: *mut i64,
9272        csrRowOffsets: *mut *mut ::core::ffi::c_void,
9273        csrColInd: *mut *mut ::core::ffi::c_void,
9274        csrValues: *mut *mut ::core::ffi::c_void,
9275        csrRowOffsetsType: *mut cusparseIndexType_t,
9276        csrColIndType: *mut cusparseIndexType_t,
9277        idxBase: *mut cusparseIndexBase_t,
9278        valueType: *mut cudaDataType,
9279    ) -> cusparseStatus_t;
9280}
9281unsafe extern "C" {
9282    pub fn cusparseConstCsrGet(
9283        spMatDescr: cusparseConstSpMatDescr_t,
9284        rows: *mut i64,
9285        cols: *mut i64,
9286        nnz: *mut i64,
9287        csrRowOffsets: *mut *const ::core::ffi::c_void,
9288        csrColInd: *mut *const ::core::ffi::c_void,
9289        csrValues: *mut *const ::core::ffi::c_void,
9290        csrRowOffsetsType: *mut cusparseIndexType_t,
9291        csrColIndType: *mut cusparseIndexType_t,
9292        idxBase: *mut cusparseIndexBase_t,
9293        valueType: *mut cudaDataType,
9294    ) -> cusparseStatus_t;
9295}
9296unsafe extern "C" {
9297    /// This function returns the fields of the sparse matrix descriptor `spMatDescr` stored in CSC format.
9298    ///
9299    /// # Parameters
9300    ///
9301    /// - `spMatDescr`: Sparse matrix descriptor.
9302    /// - `rows`: Number of rows of the sparse matrix.
9303    /// - `cols`: Number of columns of the sparse matrix.
9304    /// - `nnz`: Number of non-zero entries of the sparse matrix.
9305    /// - `cscColOffsets`: Col offsets of the sparse matrix. Array with `cols + 1` elements.
9306    /// - `cscRowInd`: Row indices of the sparse matrix. Array with `nnz` elements.
9307    /// - `cscValues`: Values of the sparse matrix. Array with `nnz` elements.
9308    /// - `cscColOffsetsType`: Data type of `cscColOffsets`.
9309    /// - `cscRowIndType`: Data type of `cscRowInd`.
9310    /// - `idxBase`: Index base of `cscColOffsets` and `cscRowInd`.
9311    /// - `valueType`: Datatype of `cscValues`.
9312    pub fn cusparseCscGet(
9313        spMatDescr: cusparseSpMatDescr_t,
9314        rows: *mut i64,
9315        cols: *mut i64,
9316        nnz: *mut i64,
9317        cscColOffsets: *mut *mut ::core::ffi::c_void,
9318        cscRowInd: *mut *mut ::core::ffi::c_void,
9319        cscValues: *mut *mut ::core::ffi::c_void,
9320        cscColOffsetsType: *mut cusparseIndexType_t,
9321        cscRowIndType: *mut cusparseIndexType_t,
9322        idxBase: *mut cusparseIndexBase_t,
9323        valueType: *mut cudaDataType,
9324    ) -> cusparseStatus_t;
9325}
9326unsafe extern "C" {
9327    pub fn cusparseConstCscGet(
9328        spMatDescr: cusparseConstSpMatDescr_t,
9329        rows: *mut i64,
9330        cols: *mut i64,
9331        nnz: *mut i64,
9332        cscColOffsets: *mut *const ::core::ffi::c_void,
9333        cscRowInd: *mut *const ::core::ffi::c_void,
9334        cscValues: *mut *const ::core::ffi::c_void,
9335        cscColOffsetsType: *mut cusparseIndexType_t,
9336        cscRowIndType: *mut cusparseIndexType_t,
9337        idxBase: *mut cusparseIndexBase_t,
9338        valueType: *mut cudaDataType,
9339    ) -> cusparseStatus_t;
9340}
9341unsafe extern "C" {
9342    /// This function sets the pointers of the sparse matrix descriptor `spMatDescr`.
9343    ///
9344    /// [`cusparseCsrSetPointers`] has the following constraints:
9345    ///
9346    /// * `csrRowOffsets`, `csrColInd`, and `csrValues` must be aligned to the size of their corresponding datatypes specified in `spMatDescr`. See [`cudaDataType_t`] for the description of the datatypes.
9347    ///
9348    /// # Parameters
9349    ///
9350    /// - `spMatDescr`: Sparse matrix descriptor.
9351    /// - `csrRowOffsets`: Row offsets of the sparse matrix. Array with `rows + 1` elements.
9352    /// - `csrColInd`: Column indices of the sparse matrix. Array with `nnz` elements.
9353    /// - `csrValues`: Values of the sparse matrix. Array with `nnz` elements.
9354    pub fn cusparseCsrSetPointers(
9355        spMatDescr: cusparseSpMatDescr_t,
9356        csrRowOffsets: *mut ::core::ffi::c_void,
9357        csrColInd: *mut ::core::ffi::c_void,
9358        csrValues: *mut ::core::ffi::c_void,
9359    ) -> cusparseStatus_t;
9360}
9361unsafe extern "C" {
9362    /// This function sets the pointers of the sparse matrix descriptor `spMatDescr`.
9363    ///
9364    /// [`cusparseCscSetPointers`] has the following constraints:
9365    ///
9366    /// * `cscColOffsets`, `cscRowInd`, and `cscValues` must be aligned to the size of their corresponding datatypes specified in `spMatDescr`. See [`cudaDataType_t`] for the description of the datatypes.
9367    ///
9368    /// # Parameters
9369    ///
9370    /// - `spMatDescr`: Sparse matrix descriptor.
9371    /// - `cscColOffsets`: Col offsets of the sparse matrix. Array with `cols + 1` elements.
9372    /// - `cscRowInd`: Row indices of the sparse matrix. Array with `nnz` elements.
9373    /// - `cscValues`: Values of the sparse matrix. Array with `nnz` elements.
9374    pub fn cusparseCscSetPointers(
9375        spMatDescr: cusparseSpMatDescr_t,
9376        cscColOffsets: *mut ::core::ffi::c_void,
9377        cscRowInd: *mut ::core::ffi::c_void,
9378        cscValues: *mut ::core::ffi::c_void,
9379    ) -> cusparseStatus_t;
9380}
9381unsafe extern "C" {
9382    /// This function initializes the sparse matrix descriptor `spMatDescr` for the Block Compressed Row (BSR) format.
9383    ///
9384    /// [`cusparseCreateBsr`] has the following constraints:
9385    ///
9386    /// * `bsrRowOffsets`, `bsrColInd`, and `bsrValues` must be aligned to the size of the datatypes specified by `bsrRowOffsetsType`, `bsrColIndType`, and `valueType`, respectively. See [`cudaDataType_t`] for the description of the datatypes.
9387    ///
9388    /// # Parameters
9389    ///
9390    /// - `spMatDescr`: Sparse matrix descriptor.
9391    /// - `brows`: Number of block rows of the sparse matrix.
9392    /// - `bcols`: Number of block columns of the sparse matrix.
9393    /// - `bnnz`: Number of blocks of the sparse matrix.
9394    /// - `rowBlockSize`: Number of rows of each block.
9395    /// - `colBlockSize`: Number of columns of each block.
9396    /// - `bsrRowOffsets`: Block row offsets of the sparse matrix. Array of size `brows + 1`.
9397    /// - `bsrColInd`: Block column indices of the sparse matrix. Array of size `bnnz`.
9398    /// - `bsrValues`: Values of the sparse matrix. Array of size `bnnz * rowBlockSize * colBlockSize`.
9399    /// - `bsrRowOffsetsType`: Data type of `bsrRowOffsets`.
9400    /// - `bsrColIndType`: Data type of `bsrColInd`.
9401    /// - `idxBase`: Base index of `bsrRowOffsets` and `bsrColInd`.
9402    /// - `valueType`: Datatype of `bsrValues`.
9403    /// - `order`: Enumerator specifying the memory layout of values in each block.
9404    pub fn cusparseCreateBsr(
9405        spMatDescr: *mut cusparseSpMatDescr_t,
9406        brows: i64,
9407        bcols: i64,
9408        bnnz: i64,
9409        rowBlockSize: i64,
9410        colBlockSize: i64,
9411        bsrRowOffsets: *mut ::core::ffi::c_void,
9412        bsrColInd: *mut ::core::ffi::c_void,
9413        bsrValues: *mut ::core::ffi::c_void,
9414        bsrRowOffsetsType: cusparseIndexType_t,
9415        bsrColIndType: cusparseIndexType_t,
9416        idxBase: cusparseIndexBase_t,
9417        valueType: cudaDataType,
9418        order: cusparseOrder_t,
9419    ) -> cusparseStatus_t;
9420}
9421unsafe extern "C" {
9422    pub fn cusparseCreateConstBsr(
9423        spMatDescr: *mut cusparseConstSpMatDescr_t,
9424        brows: i64,
9425        bcols: i64,
9426        bnnz: i64,
9427        rowBlockDim: i64,
9428        colBlockDim: i64,
9429        bsrRowOffsets: *const ::core::ffi::c_void,
9430        bsrColInd: *const ::core::ffi::c_void,
9431        bsrValues: *const ::core::ffi::c_void,
9432        bsrRowOffsetsType: cusparseIndexType_t,
9433        bsrColIndType: cusparseIndexType_t,
9434        idxBase: cusparseIndexBase_t,
9435        valueType: cudaDataType,
9436        order: cusparseOrder_t,
9437    ) -> cusparseStatus_t;
9438}
9439unsafe extern "C" {
9440    /// This function initializes the sparse matrix descriptor `spMatDescr` in the COO format (Structure of Arrays layout).
9441    ///
9442    /// [`cusparseCreateCoo`] has the following constraints:
9443    ///
9444    /// * `cooRowInd`, `cooColInd`, and `cooValues` must be aligned to the size of the datatypes specified by `cooIdxType`, `cooIdxType`, and `valueType`. respectively. See [`cudaDataType_t`] for the description of the datatypes.
9445    ///
9446    /// # Parameters
9447    ///
9448    /// - `spMatDescr`: Sparse matrix descriptor.
9449    /// - `rows`: Number of rows of the sparse matrix.
9450    /// - `cols`: Number of columns of the sparse matrix.
9451    /// - `nnz`: Number of non-zero entries of the sparse matrix.
9452    /// - `cooRowInd`: Row indices of the sparse matrix. Array with `nnz` elements.
9453    /// - `cooColInd`: Column indices of the sparse matrix. Array with `nnz` elements.
9454    /// - `cooValues`: Values of the sparse matrix. Array with `nnz` elements.
9455    /// - `cooIdxType`: Data type of `cooRowInd` and `cooColInd`.
9456    /// - `idxBase`: Index base of `cooRowInd` and `cooColInd`.
9457    /// - `valueType`: Datatype of `cooValues`.
9458    pub fn cusparseCreateCoo(
9459        spMatDescr: *mut cusparseSpMatDescr_t,
9460        rows: i64,
9461        cols: i64,
9462        nnz: i64,
9463        cooRowInd: *mut ::core::ffi::c_void,
9464        cooColInd: *mut ::core::ffi::c_void,
9465        cooValues: *mut ::core::ffi::c_void,
9466        cooIdxType: cusparseIndexType_t,
9467        idxBase: cusparseIndexBase_t,
9468        valueType: cudaDataType,
9469    ) -> cusparseStatus_t;
9470}
9471unsafe extern "C" {
9472    pub fn cusparseCreateConstCoo(
9473        spMatDescr: *mut cusparseConstSpMatDescr_t,
9474        rows: i64,
9475        cols: i64,
9476        nnz: i64,
9477        cooRowInd: *const ::core::ffi::c_void,
9478        cooColInd: *const ::core::ffi::c_void,
9479        cooValues: *const ::core::ffi::c_void,
9480        cooIdxType: cusparseIndexType_t,
9481        idxBase: cusparseIndexBase_t,
9482        valueType: cudaDataType,
9483    ) -> cusparseStatus_t;
9484}
9485unsafe extern "C" {
9486    /// This function returns the fields of the sparse matrix descriptor `spMatDescr` stored in COO format (Array of Structures layout).
9487    ///
9488    /// # Parameters
9489    ///
9490    /// - `spMatDescr`: Sparse matrix descriptor.
9491    /// - `rows`: Number of rows of the sparse matrix.
9492    /// - `cols`: Number of columns of the sparse matrix.
9493    /// - `nnz`: Number of non-zero entries of the sparse matrix.
9494    /// - `cooRowInd`: Row indices of the sparse matrix. Array `nnz` elements.
9495    /// - `cooColInd`: Column indices of the sparse matrix. Array `nnz` elements.
9496    /// - `cooValues`: Values of the sparse matrix. Array `nnz` elements.
9497    /// - `idxBase`: Index base of `cooRowInd` and `cooColInd`.
9498    /// - `valueType`: Datatype of `cooValues`.
9499    pub fn cusparseCooGet(
9500        spMatDescr: cusparseSpMatDescr_t,
9501        rows: *mut i64,
9502        cols: *mut i64,
9503        nnz: *mut i64,
9504        cooRowInd: *mut *mut ::core::ffi::c_void,
9505        cooColInd: *mut *mut ::core::ffi::c_void,
9506        cooValues: *mut *mut ::core::ffi::c_void,
9507        idxType: *mut cusparseIndexType_t,
9508        idxBase: *mut cusparseIndexBase_t,
9509        valueType: *mut cudaDataType,
9510    ) -> cusparseStatus_t;
9511}
9512unsafe extern "C" {
9513    pub fn cusparseConstCooGet(
9514        spMatDescr: cusparseConstSpMatDescr_t,
9515        rows: *mut i64,
9516        cols: *mut i64,
9517        nnz: *mut i64,
9518        cooRowInd: *mut *const ::core::ffi::c_void,
9519        cooColInd: *mut *const ::core::ffi::c_void,
9520        cooValues: *mut *const ::core::ffi::c_void,
9521        idxType: *mut cusparseIndexType_t,
9522        idxBase: *mut cusparseIndexBase_t,
9523        valueType: *mut cudaDataType,
9524    ) -> cusparseStatus_t;
9525}
9526unsafe extern "C" {
9527    /// This function sets the pointers of the sparse matrix descriptor `spMatDescr`.
9528    ///
9529    /// [`cusparseCooSetPointers`] has the following constraints:
9530    ///
9531    /// * `cooRows`, `cooColumns`, and `cooValues` must be aligned to the size of their corresponding datatypes specified in `spMatDescr`. See [`cudaDataType_t`] for the description of the datatypes.
9532    ///
9533    /// # Parameters
9534    ///
9535    /// - `spMatDescr`: Sparse matrix descriptor.
9536    /// - `cooRows`: Row indices of the sparse matrix. Array with `nnz` elements.
9537    /// - `cooColumns`: Column indices of the sparse matrix. Array with `nnz` elements.
9538    /// - `cooValues`: Values of the sparse matrix. Array with `nnz` elements.
9539    pub fn cusparseCooSetPointers(
9540        spMatDescr: cusparseSpMatDescr_t,
9541        cooRows: *mut ::core::ffi::c_void,
9542        cooColumns: *mut ::core::ffi::c_void,
9543        cooValues: *mut ::core::ffi::c_void,
9544    ) -> cusparseStatus_t;
9545}
9546unsafe extern "C" {
9547    /// This function initializes the sparse matrix descriptor `spMatDescr` for the Blocked-Ellpack (ELL) format.
9548    ///
9549    /// Blocked-ELL Column indices (`ellColInd`) are in the range `\[0, cols / ellBlockSize -1\]`. The array can contain `-1` values for indicating empty blocks.
9550    ///
9551    /// # Parameters
9552    ///
9553    /// - `spMatDescr`: Sparse matrix descriptor.
9554    /// - `rows`: Number of rows of the sparse matrix.
9555    /// - `cols`: Number of columns of the sparse matrix.
9556    /// - `ellBlockSize`: Size of the ELL-Block.
9557    /// - `ellCols`: Actual number of columns of the Blocked-Ellpack format (`ellValue` columns).
9558    /// - `ellColInd`: Blocked-ELL Column indices. Array with `\[ellCols / ellBlockSize\]\[rows / ellBlockSize\]` elements.
9559    /// - `ellValue`: Values of the sparse matrix. Array with `rows * ellCols` elements.
9560    /// - `ellIdxType`: Data type of `ellColInd`.
9561    /// - `idxBase`: Index base of `ellColInd`.
9562    /// - `valueType`: Data type of `ellValue`.
9563    pub fn cusparseCreateBlockedEll(
9564        spMatDescr: *mut cusparseSpMatDescr_t,
9565        rows: i64,
9566        cols: i64,
9567        ellBlockSize: i64,
9568        ellCols: i64,
9569        ellColInd: *mut ::core::ffi::c_void,
9570        ellValue: *mut ::core::ffi::c_void,
9571        ellIdxType: cusparseIndexType_t,
9572        idxBase: cusparseIndexBase_t,
9573        valueType: cudaDataType,
9574    ) -> cusparseStatus_t;
9575}
9576unsafe extern "C" {
9577    pub fn cusparseCreateConstBlockedEll(
9578        spMatDescr: *mut cusparseConstSpMatDescr_t,
9579        rows: i64,
9580        cols: i64,
9581        ellBlockSize: i64,
9582        ellCols: i64,
9583        ellColInd: *const ::core::ffi::c_void,
9584        ellValue: *const ::core::ffi::c_void,
9585        ellIdxType: cusparseIndexType_t,
9586        idxBase: cusparseIndexBase_t,
9587        valueType: cudaDataType,
9588    ) -> cusparseStatus_t;
9589}
9590unsafe extern "C" {
9591    /// This function returns the fields of the sparse matrix descriptor `spMatDescr` stored in Blocked-Ellpack (ELL) format.
9592    ///
9593    /// # Parameters
9594    ///
9595    /// - `spMatDescr`: Sparse matrix descriptor.
9596    /// - `rows`: Number of rows of the sparse matrix.
9597    /// - `cols`: Number of columns of the sparse matrix.
9598    /// - `ellBlockSize`: Size of the ELL-Block.
9599    /// - `ellCols`: Actual number of columns of the Blocked-Ellpack format.
9600    /// - `ellColInd`: Column indices for the ELL-Block. Array with `\[cols / ellBlockSize\]\[rows / ellBlockSize\]` elements.
9601    /// - `ellValue`: Values of the sparse matrix. Array with `rows * ellCols` elements.
9602    /// - `ellIdxType`: Data type of `ellColInd`.
9603    /// - `idxBase`: Index base of `ellColInd`.
9604    /// - `valueType`: Datatype of `ellValue`.
9605    pub fn cusparseBlockedEllGet(
9606        spMatDescr: cusparseSpMatDescr_t,
9607        rows: *mut i64,
9608        cols: *mut i64,
9609        ellBlockSize: *mut i64,
9610        ellCols: *mut i64,
9611        ellColInd: *mut *mut ::core::ffi::c_void,
9612        ellValue: *mut *mut ::core::ffi::c_void,
9613        ellIdxType: *mut cusparseIndexType_t,
9614        idxBase: *mut cusparseIndexBase_t,
9615        valueType: *mut cudaDataType,
9616    ) -> cusparseStatus_t;
9617}
9618unsafe extern "C" {
9619    pub fn cusparseConstBlockedEllGet(
9620        spMatDescr: cusparseConstSpMatDescr_t,
9621        rows: *mut i64,
9622        cols: *mut i64,
9623        ellBlockSize: *mut i64,
9624        ellCols: *mut i64,
9625        ellColInd: *mut *const ::core::ffi::c_void,
9626        ellValue: *mut *const ::core::ffi::c_void,
9627        ellIdxType: *mut cusparseIndexType_t,
9628        idxBase: *mut cusparseIndexBase_t,
9629        valueType: *mut cudaDataType,
9630    ) -> cusparseStatus_t;
9631}
9632unsafe extern "C" {
9633    /// This function initializes the sparse matrix descriptor `spMatDescr` for the Sliced Ellpack (SELL) format.
9634    ///
9635    /// [`cusparseCreateSlicedEll`] has the following constraints:
9636    ///
9637    /// * `sellSliceOffsets`, `sellColInd`, and `sellValues` must be aligned to the size of the datatypes specified by `sellSliceOffsetsType`, `sellColIndType`, and `valueType`, respectively. See [`cudaDataType_t`] for the description of the datatypes.
9638    ///
9639    /// # Parameters
9640    ///
9641    /// - `spMatDescr`: Sparse matrix descriptor.
9642    /// - `rows`: Number of rows of the sparse matrix.
9643    /// - `cols`: Number of columns of the sparse matrix.
9644    /// - `nnz`: Number of nonzero elements in the sparse matrix.
9645    /// - `sellValuesSize`: Total number of elements in `sellValues` array (nonzero and padding).
9646    /// - `sliceSize`: The number of rows per slice.
9647    /// - `sellSliceOffsets`: Slice offsets of the sparse matrix. Array of size $\left \lceil{\frac{rows}{sliceSize}}\right \rceil + 1$.
9648    /// - `sellColInd`: Column indexes of the sparse matrix. Array of size `sellValuesSize`.
9649    /// - `sellValues`: Values of the sparse matrix. Array of size `sellValuesSize` elements.
9650    /// - `sellSliceOffsetsType`: Data type of `sellSliceOffsets`.
9651    /// - `sellColIndType`: Data type of `sellColInd`.
9652    /// - `idxBase`: Index base of `sellColInd`.
9653    /// - `valueType`: Data type of `sellValues`.
9654    pub fn cusparseCreateSlicedEll(
9655        spMatDescr: *mut cusparseSpMatDescr_t,
9656        rows: i64,
9657        cols: i64,
9658        nnz: i64,
9659        sellValuesSize: i64,
9660        sliceSize: i64,
9661        sellSliceOffsets: *mut ::core::ffi::c_void,
9662        sellColInd: *mut ::core::ffi::c_void,
9663        sellValues: *mut ::core::ffi::c_void,
9664        sellSliceOffsetsType: cusparseIndexType_t,
9665        sellColIndType: cusparseIndexType_t,
9666        idxBase: cusparseIndexBase_t,
9667        valueType: cudaDataType,
9668    ) -> cusparseStatus_t;
9669}
9670unsafe extern "C" {
9671    pub fn cusparseCreateConstSlicedEll(
9672        spMatDescr: *mut cusparseConstSpMatDescr_t,
9673        rows: i64,
9674        cols: i64,
9675        nnz: i64,
9676        sellValuesSize: i64,
9677        sliceSize: i64,
9678        sellSliceOffsets: *const ::core::ffi::c_void,
9679        sellColInd: *const ::core::ffi::c_void,
9680        sellValues: *const ::core::ffi::c_void,
9681        sellSliceOffsetsType: cusparseIndexType_t,
9682        sellColIndType: cusparseIndexType_t,
9683        idxBase: cusparseIndexBase_t,
9684        valueType: cudaDataType,
9685    ) -> cusparseStatus_t;
9686}
9687unsafe extern "C" {
9688    /// The function initializes the dense matrix descriptor `dnMatDescr`.
9689    ///
9690    /// [`cusparseCreateDnMat`] has the following constraints:
9691    ///
9692    /// * `values` must be aligned to the size of the datatype specified by `valueType`. See [`cudaDataType_t`] for the description of the datatypes.
9693    ///
9694    /// # Parameters
9695    ///
9696    /// - `dnMatDescr`: Dense matrix descriptor.
9697    /// - `rows`: Number of rows of the dense matrix.
9698    /// - `cols`: Number of columns of the dense matrix.
9699    /// - `ld`: Leading dimension of the dense matrix.
9700    /// - `values`: Values of the dense matrix. Array with `size` elements.
9701    /// - `valueType`: Enumerator specifying the datatype of `values`.
9702    /// - `order`: Enumerator specifying the memory layout of the dense matrix.
9703    pub fn cusparseCreateDnMat(
9704        dnMatDescr: *mut cusparseDnMatDescr_t,
9705        rows: i64,
9706        cols: i64,
9707        ld: i64,
9708        values: *mut ::core::ffi::c_void,
9709        valueType: cudaDataType,
9710        order: cusparseOrder_t,
9711    ) -> cusparseStatus_t;
9712}
9713unsafe extern "C" {
9714    pub fn cusparseCreateConstDnMat(
9715        dnMatDescr: *mut cusparseConstDnMatDescr_t,
9716        rows: i64,
9717        cols: i64,
9718        ld: i64,
9719        values: *const ::core::ffi::c_void,
9720        valueType: cudaDataType,
9721        order: cusparseOrder_t,
9722    ) -> cusparseStatus_t;
9723}
9724unsafe extern "C" {
9725    /// This function releases the host memory allocated for the dense matrix descriptor `dnMatDescr`.
9726    ///
9727    /// # Parameters
9728    ///
9729    /// - `dnMatDescr`: Dense matrix descriptor.
9730    pub fn cusparseDestroyDnMat(
9731        dnMatDescr: cusparseConstDnMatDescr_t,
9732    ) -> cusparseStatus_t;
9733}
9734unsafe extern "C" {
9735    /// This function returns the fields of the dense matrix descriptor `dnMatDescr`.
9736    ///
9737    /// # Parameters
9738    ///
9739    /// - `dnMatDescr`: Dense matrix descriptor.
9740    /// - `rows`: Number of rows of the dense matrix.
9741    /// - `cols`: Number of columns of the dense matrix.
9742    /// - `ld`: Leading dimension of the dense matrix.
9743    /// - `values`: Values of the dense matrix. Array with `ld * cols` elements.
9744    /// - `order`: Enumerator specifying the memory layout of the dense matrix.
9745    pub fn cusparseDnMatGet(
9746        dnMatDescr: cusparseDnMatDescr_t,
9747        rows: *mut i64,
9748        cols: *mut i64,
9749        ld: *mut i64,
9750        values: *mut *mut ::core::ffi::c_void,
9751        type_: *mut cudaDataType,
9752        order: *mut cusparseOrder_t,
9753    ) -> cusparseStatus_t;
9754}
9755unsafe extern "C" {
9756    pub fn cusparseConstDnMatGet(
9757        dnMatDescr: cusparseConstDnMatDescr_t,
9758        rows: *mut i64,
9759        cols: *mut i64,
9760        ld: *mut i64,
9761        values: *mut *const ::core::ffi::c_void,
9762        type_: *mut cudaDataType,
9763        order: *mut cusparseOrder_t,
9764    ) -> cusparseStatus_t;
9765}
9766unsafe extern "C" {
9767    /// This function returns the `values` field of the dense matrix descriptor `dnMatDescr`.
9768    ///
9769    /// # Parameters
9770    ///
9771    /// - `dnMatDescr`: Dense matrix descriptor.
9772    /// - `values`: Values of the dense matrix. Array with `ld * cols` elements.
9773    pub fn cusparseDnMatGetValues(
9774        dnMatDescr: cusparseDnMatDescr_t,
9775        values: *mut *mut ::core::ffi::c_void,
9776    ) -> cusparseStatus_t;
9777}
9778unsafe extern "C" {
9779    pub fn cusparseConstDnMatGetValues(
9780        dnMatDescr: cusparseConstDnMatDescr_t,
9781        values: *mut *const ::core::ffi::c_void,
9782    ) -> cusparseStatus_t;
9783}
9784unsafe extern "C" {
9785    /// This function sets the `values` field of the dense matrix descriptor `dnMatDescr`.
9786    ///
9787    /// [`cusparseDnMatSetValues`] has the following constraints:
9788    ///
9789    /// * `values` must be aligned to the size of the datatype specified in `dnMatDescr`. See [`cudaDataType_t`] for the description of the datatypes.
9790    ///
9791    /// # Parameters
9792    ///
9793    /// - `dnMatDescr`: Dense matrix descriptor.
9794    /// - `values`: Values of the dense matrix. Array with `ld * cols` elements.
9795    pub fn cusparseDnMatSetValues(
9796        dnMatDescr: cusparseDnMatDescr_t,
9797        values: *mut ::core::ffi::c_void,
9798    ) -> cusparseStatus_t;
9799}
9800unsafe extern "C" {
9801    /// The function sets the number of batches and the batch stride of the dense matrix descriptor `dnMatDescr`.
9802    ///
9803    /// # Parameters
9804    ///
9805    /// - `dnMatDescr`: Dense matrix descriptor.
9806    /// - `batchCount`: Number of batches of the dense matrix.
9807    /// - `batchStride`: Address offset between a matrix and the next one in the batch. `batchStride ≥ ld * cols` if the matrix uses column-major layout, `batchStride ≥ ld * rows` otherwise.
9808    pub fn cusparseDnMatSetStridedBatch(
9809        dnMatDescr: cusparseDnMatDescr_t,
9810        batchCount: ::core::ffi::c_int,
9811        batchStride: i64,
9812    ) -> cusparseStatus_t;
9813}
9814unsafe extern "C" {
9815    /// The function returns the number of batches and the batch stride of the dense matrix descriptor `dnMatDescr`.
9816    ///
9817    /// # Parameters
9818    ///
9819    /// - `dnMatDescr`: Dense matrix descriptor.
9820    /// - `batchCount`: Number of batches of the dense matrix.
9821    /// - `batchStride`: Address offset between a matrix and the next one in the batch.
9822    pub fn cusparseDnMatGetStridedBatch(
9823        dnMatDescr: cusparseConstDnMatDescr_t,
9824        batchCount: *mut ::core::ffi::c_int,
9825        batchStride: *mut i64,
9826    ) -> cusparseStatus_t;
9827}
9828unsafe extern "C" {
9829    /// The function computes the sum of a sparse vector `vecX` and a dense vector `vecY`.
9830    ///
9831    /// In other words,
9832    ///
9833    /// ```text
9834    /// for i=0 to n-1
9835    /// Y\[i\] = beta * Y\[i\]
9836    /// for i=0 to nnz-1
9837    /// Y\[X_indices[i\]] += alpha * X_values\[i\]
9838    /// ```
9839    ///
9840    /// [`cusparseAxpby`] supports the following index type for representing the sparse vector `vecX`:
9841    ///
9842    /// * 32-bit indices ([`cusparseIndexType_t::CUSPARSE_INDEX_32I`])
9843    /// * 64-bit indices ([`cusparseIndexType_t::CUSPARSE_INDEX_64I`])
9844    ///
9845    /// [`cusparseAxpby`] supports the following data types:
9846    ///
9847    /// Uniform-precision computation:
9848    ///
9849    /// | `X`/`Y`/`compute` |
9850    /// | --- |
9851    /// | `cudaDataType_t::CUDA_R_32F` |
9852    /// | `cudaDataType_t::CUDA_R_64F` |
9853    /// | `cudaDataType_t::CUDA_C_32F` |
9854    /// | `cudaDataType_t::CUDA_C_64F` |
9855    ///
9856    /// Mixed-precision computation:
9857    ///
9858    /// | `X`/`Y` | `compute` |  |
9859    /// | --- | --- | --- |
9860    /// | `cudaDataType_t::CUDA_R_16F` | `cudaDataType_t::CUDA_R_32F` |  |
9861    /// | `cudaDataType_t::CUDA_R_16BF` |  |  |
9862    /// | `cudaDataType_t::CUDA_C_16F` | `cudaDataType_t::CUDA_C_32F` | \[DEPRECATED\] |
9863    /// | `cudaDataType_t::CUDA_C_16BF` | \[DEPRECATED\] |  |
9864    ///
9865    /// [`cusparseAxpby`] has the following constraints:
9866    ///
9867    /// * The arrays representing the sparse vector `vecX` must be aligned to 16 bytes
9868    ///
9869    /// [`cusparseAxpby`] has the following properties:
9870    ///
9871    /// * The routine requires no extra storage
9872    /// * The routine supports asynchronous execution
9873    /// * Provides deterministic (bit-wise) results for each run if the sparse vector `vecX` indices are distinct
9874    /// * The routine allows `indices` of `vecX` to be unsorted
9875    ///
9876    /// [`cusparseAxpby`] supports the following optimizations:
9877    ///
9878    /// * CUDA graph capture
9879    /// * Hardware Memory Compression
9880    ///
9881    /// Please visit [cuSPARSE Library Samples - cusparseAxpby](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSPARSE/axpby) for a code example.
9882    ///
9883    /// # Parameters
9884    ///
9885    /// - `handle`: Handle to the cuSPARSE library context.
9886    /// - `alpha`: $\alpha$ scalar used for multiplication of compute type.
9887    /// - `vecX`: Sparse vector `X`.
9888    /// - `beta`: $\beta$ scalar used for multiplication of compute type.
9889    /// - `vecY`: Dense vector `Y`.
9890    #[deprecated]
9891    pub fn cusparseAxpby(
9892        handle: cusparseHandle_t,
9893        alpha: *const ::core::ffi::c_void,
9894        vecX: cusparseConstSpVecDescr_t,
9895        beta: *const ::core::ffi::c_void,
9896        vecY: cusparseDnVecDescr_t,
9897    ) -> cusparseStatus_t;
9898}
9899unsafe extern "C" {
9900    /// The function gathers the elements of the dense vector `vecY` into the sparse vector `vecX`
9901    ///
9902    /// In other words,
9903    ///
9904    /// ```text
9905    /// for i=0 to nnz-1
9906    /// X_values\[i\] = Y\[X_indices[i\]]
9907    /// ```
9908    ///
9909    /// [`cusparseGather`] supports the following index type for representing the sparse vector `vecX`:
9910    ///
9911    /// * 32-bit indices ([`cusparseIndexType_t::CUSPARSE_INDEX_32I`])
9912    /// * 64-bit indices ([`cusparseIndexType_t::CUSPARSE_INDEX_64I`])
9913    ///
9914    /// [`cusparseGather`] supports the following data types:
9915    ///
9916    /// | `X`/`Y` |
9917    /// | --- |
9918    /// | `cudaDataType_t::CUDA_R_16F` |
9919    /// | `cudaDataType_t::CUDA_R_16BF` |
9920    /// | `cudaDataType_t::CUDA_R_32F` |
9921    /// | `cudaDataType_t::CUDA_R_64F` |
9922    /// | `cudaDataType_t::CUDA_C_16F` \[DEPRECATED\] |
9923    /// | `cudaDataType_t::CUDA_C_16BF` \[DEPRECATED\] |
9924    /// | `cudaDataType_t::CUDA_C_32F` |
9925    /// | `cudaDataType_t::CUDA_C_64F` |
9926    ///
9927    /// [`cusparseGather`] has the following constraints:
9928    ///
9929    /// * The arrays representing the sparse vector `vecX` must be aligned to 16 bytes
9930    ///
9931    /// [`cusparseGather`] has the following properties:
9932    ///
9933    /// * The routine requires no extra storage
9934    /// * The routine supports asynchronous execution
9935    /// * Provides deterministic (bit-wise) results for each run if the sparse vector `vecX` indices are distinct
9936    /// * The routine allows `indices` of `vecX` to be unsorted
9937    ///
9938    /// [`cusparseGather`] supports the following optimizations:
9939    ///
9940    /// * CUDA graph capture
9941    /// * Hardware Memory Compression
9942    ///
9943    /// Please visit [cuSPARSE Library Samples - cusparseGather](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSPARSE/gather) for a code example.
9944    ///
9945    /// # Parameters
9946    ///
9947    /// - `handle`: Handle to the cuSPARSE library context.
9948    /// - `vecY`: Dense vector `Y`.
9949    /// - `vecX`: Sparse vector `X`.
9950    pub fn cusparseGather(
9951        handle: cusparseHandle_t,
9952        vecY: cusparseConstDnVecDescr_t,
9953        vecX: cusparseSpVecDescr_t,
9954    ) -> cusparseStatus_t;
9955}
9956unsafe extern "C" {
9957    /// The function scatters the elements of the sparse vector `vecX` into the dense vector `vecY`
9958    ///
9959    /// In other words,
9960    ///
9961    /// ```text
9962    /// for i=0 to nnz-1
9963    /// Y\[X_indices[i\]] = X_values\[i\]
9964    /// ```
9965    ///
9966    /// [`cusparseScatter`] supports the following index type for representing the sparse vector `vecX`:
9967    ///
9968    /// * 32-bit indices ([`cusparseIndexType_t::CUSPARSE_INDEX_32I`])
9969    /// * 64-bit indices ([`cusparseIndexType_t::CUSPARSE_INDEX_64I`])
9970    ///
9971    /// [`cusparseScatter`] supports the following data types:
9972    ///
9973    /// | `X`/`Y` |
9974    /// | --- |
9975    /// | `cudaDataType_t::CUDA_R_8I` |
9976    /// | `cudaDataType_t::CUDA_R_16F` |
9977    /// | `cudaDataType_t::CUDA_R_16BF` |
9978    /// | `cudaDataType_t::CUDA_R_32F` |
9979    /// | `cudaDataType_t::CUDA_R_64F` |
9980    /// | `cudaDataType_t::CUDA_C_16F` \[DEPRECATED\] |
9981    /// | `cudaDataType_t::CUDA_C_16BF` \[DEPRECATED\] |
9982    /// | `cudaDataType_t::CUDA_C_32F` |
9983    /// | `cudaDataType_t::CUDA_C_64F` |
9984    ///
9985    /// [`cusparseScatter`] has the following constraints:
9986    ///
9987    /// * The arrays representing the sparse vector `vecX` must be aligned to 16 bytes
9988    ///
9989    /// [`cusparseScatter`] has the following properties:
9990    ///
9991    /// * The routine requires no extra storage
9992    /// * The routine supports asynchronous execution
9993    /// * Provides deterministic (bit-wise) results for each run if the sparse vector `vecX` indices are distinct
9994    /// * The routine allows `indices` of `vecX` to be unsorted
9995    ///
9996    /// [`cusparseScatter`] supports the following optimizations:
9997    ///
9998    /// * CUDA graph capture
9999    /// * Hardware Memory Compression
10000    ///
10001    /// Please visit [cuSPARSE Library Samples - cusparseScatter](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSPARSE/scatter) for a code example.
10002    ///
10003    /// # Parameters
10004    ///
10005    /// - `handle`: Handle to the cuSPARSE library context.
10006    /// - `vecX`: Sparse vector `X`.
10007    /// - `vecY`: Dense vector `Y`.
10008    pub fn cusparseScatter(
10009        handle: cusparseHandle_t,
10010        vecX: cusparseConstSpVecDescr_t,
10011        vecY: cusparseDnVecDescr_t,
10012    ) -> cusparseStatus_t;
10013}
10014unsafe extern "C" {
10015    /// The function computes the Givens rotation matrix
10016    ///
10017    /// to a sparse `vecX` and a dense vector `vecY`
10018    ///
10019    /// In other words,
10020    ///
10021    /// ```text
10022    /// for i=0 to nnz-1
10023    /// Y\[X_indices[i\]] = c * Y\[X_indices[i\]] - s * X_values\[i\]
10024    /// X_values\[i\]     = c * X_values\[i\]     + s * Y\[X_indices[i\]]
10025    /// ```
10026    ///
10027    /// [`cusparseRot`] supports the following index type for representing the sparse vector `vecX`:
10028    ///
10029    /// * 32-bit indices ([`cusparseIndexType_t::CUSPARSE_INDEX_32I`])
10030    /// * 64-bit indices ([`cusparseIndexType_t::CUSPARSE_INDEX_64I`])
10031    ///
10032    /// [`cusparseRot`] supports the following data types:
10033    ///
10034    /// Uniform-precision computation:
10035    ///
10036    /// | `X`/`Y`/`compute` |
10037    /// | --- |
10038    /// | `cudaDataType_t::CUDA_R_32F` |
10039    /// | `cudaDataType_t::CUDA_R_64F` |
10040    /// | `cudaDataType_t::CUDA_C_32F` |
10041    /// | `cudaDataType_t::CUDA_C_64F` |
10042    ///
10043    /// Mixed-precision computation:
10044    ///
10045    /// | `X`/`Y` | `compute` |  |
10046    /// | --- | --- | --- |
10047    /// | `cudaDataType_t::CUDA_R_16F` | `cudaDataType_t::CUDA_R_32F` |  |
10048    /// | `cudaDataType_t::CUDA_R_16BF` |  |  |
10049    /// | `cudaDataType_t::CUDA_C_16F` | `cudaDataType_t::CUDA_C_32F` | \[DEPRECATED\] |
10050    /// | `cudaDataType_t::CUDA_C_16BF` | \[DEPRECATED\] |  |
10051    ///
10052    /// [`cusparseRot`] has the following constraints:
10053    ///
10054    /// * The arrays representing the sparse vector `vecX` must be aligned to 16 bytes
10055    ///
10056    /// [`cusparseRot`] has the following properties:
10057    ///
10058    /// * The routine requires no extra storage
10059    /// * The routine supports asynchronous execution
10060    /// * Provides deterministic (bit-wise) results for each run if the sparse vector `vecX` indices are distinct
10061    ///
10062    /// [`cusparseRot`] supports the following optimizations:
10063    ///
10064    /// * CUDA graph capture
10065    /// * Hardware Memory Compression
10066    ///
10067    /// Please visit [cuSPARSE Library Samples - cusparseRot](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSPARSE/rot) for a code example.
10068    ///
10069    /// # Parameters
10070    ///
10071    /// - `handle`: Handle to the cuSPARSE library context.
10072    /// - `c_coeff`: cosine element of the rotation matrix.
10073    /// - `s_coeff`: sine element of the rotation matrix.
10074    /// - `vecX`: Sparse vector `X`.
10075    /// - `vecY`: Dense vector `Y`.
10076    #[deprecated]
10077    pub fn cusparseRot(
10078        handle: cusparseHandle_t,
10079        c_coeff: *const ::core::ffi::c_void,
10080        s_coeff: *const ::core::ffi::c_void,
10081        vecX: cusparseSpVecDescr_t,
10082        vecY: cusparseDnVecDescr_t,
10083    ) -> cusparseStatus_t;
10084}
10085unsafe extern "C" {
10086    pub fn cusparseSpVV_bufferSize(
10087        handle: cusparseHandle_t,
10088        opX: cusparseOperation_t,
10089        vecX: cusparseConstSpVecDescr_t,
10090        vecY: cusparseConstDnVecDescr_t,
10091        result: *const ::core::ffi::c_void,
10092        computeType: cudaDataType,
10093        bufferSize: *mut size_t,
10094    ) -> cusparseStatus_t;
10095}
10096unsafe extern "C" {
10097    /// The function computes the inner dot product of a sparse vector `vecX` and a dense vector `vecY`
10098    ///
10099    /// In other words,
10100    /// $$
10101    /// \operatorname{op}(X) =
10102    /// \begin{cases}
10103    /// X & \text{if } op(X) = \text{CUSPARSE_OPERATION_NON_TRANSPOSE} \\
10104    /// X & \text{if } op(X) = \text{CUSPARSE_OPERATION_CONJUGATE_TRANSPOSE}
10105    /// \end{cases}
10106    /// $$
10107    ///
10108    /// The function [`cusparseSpVV_bufferSize`] returns the size of the workspace needed by [`cusparseSpVV`]
10109    ///
10110    /// [`cusparseSpVV`] supports the following index type for representing the sparse vector `vecX`:
10111    ///
10112    /// * 32-bit indices ([`cusparseIndexType_t::CUSPARSE_INDEX_32I`])
10113    /// * 64-bit indices ([`cusparseIndexType_t::CUSPARSE_INDEX_64I`])
10114    ///
10115    /// The data types combinations currently supported for [`cusparseSpVV`] are listed below:
10116    ///
10117    /// Uniform-precision computation:
10118    ///
10119    /// | `X`/`Y`/`computeType` |
10120    /// | --- |
10121    /// | `cudaDataType_t::CUDA_R_32F` |
10122    /// | `cudaDataType_t::CUDA_R_64F` |
10123    /// | `cudaDataType_t::CUDA_C_32F` |
10124    /// | `cudaDataType_t::CUDA_C_64F` |
10125    ///
10126    /// Mixed-precision computation:
10127    ///
10128    /// | `X`/`Y` | `computeType`/`result` | Notes |
10129    /// | --- | --- | --- |
10130    /// | `cudaDataType_t::CUDA_R_8I` | `cudaDataType_t::CUDA_R_32I` |  |
10131    /// | `cudaDataType_t::CUDA_R_8I` | `cudaDataType_t::CUDA_R_32F` |  |
10132    /// | `cudaDataType_t::CUDA_R_16F` | `cudaDataType_t::CUDA_R_32F` |  |
10133    /// | `cudaDataType_t::CUDA_R_16BF` | `cudaDataType_t::CUDA_R_32F` |  |
10134    /// | `cudaDataType_t::CUDA_C_16F` | `cudaDataType_t::CUDA_C_32F` | \[DEPRECATED\] |
10135    /// | `cudaDataType_t::CUDA_C_16BF` | `cudaDataType_t::CUDA_C_32F` | \[DEPRECATED\] |
10136    ///
10137    /// [`cusparseSpVV`] has the following constraints:
10138    ///
10139    /// * The arrays representing the sparse vector `vecX` must be aligned to 16 bytes
10140    ///
10141    /// [`cusparseSpVV`] has the following properties:
10142    ///
10143    /// * The routine requires no extra storage
10144    /// * The routine supports asynchronous execution
10145    /// * Provides deterministic (bit-wise) results for each run if the sparse vector `vecX` indices are distinct
10146    /// * The routine allows `indices` of `vecX` to be unsorted
10147    ///
10148    /// [`cusparseSpVV`] supports the following optimizations:
10149    ///
10150    /// * CUDA graph capture
10151    /// * Hardware Memory Compression
10152    ///
10153    /// Please visit [cuSPARSE Library Samples - cusparseSpVV](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSPARSE/spvv) for a code example.
10154    ///
10155    /// # Parameters
10156    ///
10157    /// - `handle`: Handle to the cuSPARSE library context.
10158    /// - `opX`: Operation `op(X)` that is non-transpose or conjugate transpose.
10159    /// - `vecX`: Sparse vector `X`.
10160    /// - `vecY`: Dense vector `Y`.
10161    /// - `result`: The resulting dot product.
10162    /// - `computeType`: Datatype in which the computation is executed.
10163    /// - `externalBuffer`: Pointer to a workspace buffer of at least `bufferSize` bytes.
10164    #[deprecated]
10165    pub fn cusparseSpVV(
10166        handle: cusparseHandle_t,
10167        opX: cusparseOperation_t,
10168        vecX: cusparseConstSpVecDescr_t,
10169        vecY: cusparseConstDnVecDescr_t,
10170        result: *mut ::core::ffi::c_void,
10171        computeType: cudaDataType,
10172        externalBuffer: *mut ::core::ffi::c_void,
10173    ) -> cusparseStatus_t;
10174}
10175#[repr(u32)]
10176#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
10177pub enum cusparseSparseToDenseAlg_t {
10178    CUSPARSE_SPARSETODENSE_ALG_DEFAULT = 0,
10179}
10180unsafe extern "C" {
10181    pub fn cusparseSparseToDense_bufferSize(
10182        handle: cusparseHandle_t,
10183        matA: cusparseConstSpMatDescr_t,
10184        matB: cusparseDnMatDescr_t,
10185        alg: cusparseSparseToDenseAlg_t,
10186        bufferSize: *mut size_t,
10187    ) -> cusparseStatus_t;
10188}
10189unsafe extern "C" {
10190    /// The function converts the sparse matrix `matA` in CSR, CSC, or COO format into its dense representation `matB`. Blocked-ELL is not currently supported.
10191    ///
10192    /// The function [`cusparseSparseToDense_bufferSize`] returns the size of the workspace needed by [`cusparseSparseToDense`].
10193    ///
10194    /// [`cusparseSparseToDense`] supports the following index type for representing the sparse matrix `matA`:
10195    ///
10196    /// * 32-bit indices ([`cusparseIndexType_t::CUSPARSE_INDEX_32I`])
10197    /// * 64-bit indices ([`cusparseIndexType_t::CUSPARSE_INDEX_64I`])
10198    ///
10199    /// [`cusparseSparseToDense`] supports the following data types:
10200    ///
10201    /// | `A`/`B` |
10202    /// | --- |
10203    /// | `cudaDataType_t::CUDA_R_8I` |
10204    /// | `cudaDataType_t::CUDA_R_16F` |
10205    /// | `cudaDataType_t::CUDA_R_16BF` |
10206    /// | `cudaDataType_t::CUDA_R_32F` |
10207    /// | `cudaDataType_t::CUDA_R_64F` |
10208    /// | `cudaDataType_t::CUDA_C_16F` \[DEPRECATED\] |
10209    /// | `cudaDataType_t::CUDA_C_16BF` \[DEPRECATED\] |
10210    /// | `cudaDataType_t::CUDA_C_32F` |
10211    /// | `cudaDataType_t::CUDA_C_64F` |
10212    ///
10213    /// `cusparseSparse2Dense()` supports the following algorithm:
10214    ///
10215    /// | Algorithm | Notes |
10216    /// | --- | --- |
10217    /// | [`cusparseSparseToDenseAlg_t::CUSPARSE_SPARSETODENSE_ALG_DEFAULT`] | Default algorithm |
10218    ///
10219    /// [`cusparseSparseToDense`] has the following properties:
10220    ///
10221    /// * The routine requires no extra storage
10222    /// * The routine supports asynchronous execution
10223    /// * Provides deterministic (bit-wise) results for each run
10224    /// * The routine allows the indices of `matA` to be unsorted
10225    ///
10226    /// [`cusparseSparseToDense`] supports the following optimizations:
10227    ///
10228    /// * CUDA graph capture
10229    /// * Hardware Memory Compression
10230    ///
10231    /// Please visit [cuSPARSE Library Samples - cusparseSparseToDense](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSPARSE/sparse2dense_csr) for a code example.
10232    ///
10233    /// # Parameters
10234    ///
10235    /// - `handle`: Handle to the cuSPARSE library context.
10236    /// - `matA`: Sparse matrix `A`.
10237    /// - `matB`: Dense matrix `B`.
10238    /// - `alg`: Algorithm for the computation.
10239    pub fn cusparseSparseToDense(
10240        handle: cusparseHandle_t,
10241        matA: cusparseConstSpMatDescr_t,
10242        matB: cusparseDnMatDescr_t,
10243        alg: cusparseSparseToDenseAlg_t,
10244        externalBuffer: *mut ::core::ffi::c_void,
10245    ) -> cusparseStatus_t;
10246}
10247#[repr(u32)]
10248#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
10249pub enum cusparseDenseToSparseAlg_t {
10250    CUSPARSE_DENSETOSPARSE_ALG_DEFAULT = 0,
10251}
10252unsafe extern "C" {
10253    pub fn cusparseDenseToSparse_bufferSize(
10254        handle: cusparseHandle_t,
10255        matA: cusparseConstDnMatDescr_t,
10256        matB: cusparseSpMatDescr_t,
10257        alg: cusparseDenseToSparseAlg_t,
10258        bufferSize: *mut size_t,
10259    ) -> cusparseStatus_t;
10260}
10261unsafe extern "C" {
10262    pub fn cusparseDenseToSparse_analysis(
10263        handle: cusparseHandle_t,
10264        matA: cusparseConstDnMatDescr_t,
10265        matB: cusparseSpMatDescr_t,
10266        alg: cusparseDenseToSparseAlg_t,
10267        externalBuffer: *mut ::core::ffi::c_void,
10268    ) -> cusparseStatus_t;
10269}
10270unsafe extern "C" {
10271    pub fn cusparseDenseToSparse_convert(
10272        handle: cusparseHandle_t,
10273        matA: cusparseConstDnMatDescr_t,
10274        matB: cusparseSpMatDescr_t,
10275        alg: cusparseDenseToSparseAlg_t,
10276        externalBuffer: *mut ::core::ffi::c_void,
10277    ) -> cusparseStatus_t;
10278}
10279#[repr(u32)]
10280#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
10281pub enum cusparseSpMVAlg_t {
10282    CUSPARSE_SPMV_ALG_DEFAULT = 0,
10283    CUSPARSE_SPMV_CSR_ALG1 = 2,
10284    CUSPARSE_SPMV_CSR_ALG2 = 3,
10285    CUSPARSE_SPMV_COO_ALG1 = 1,
10286    CUSPARSE_SPMV_COO_ALG2 = 4,
10287    CUSPARSE_SPMV_SELL_ALG1 = 5,
10288    CUSPARSE_SPMV_BSR_ALG1 = 6,
10289}
10290unsafe extern "C" {
10291    /// This function performs the multiplication of a sparse matrix `matA` and a dense vector `vecX`
10292    ///
10293    /// where
10294    ///
10295    /// * `op(A)` is a sparse matrix of size $m \times k$
10296    /// * `X` is a dense vector of size $k$
10297    /// * `Y` is a dense vector of size $m$
10298    /// * $\alpha$ and $\beta$ are scalars
10299    ///
10300    /// Also, for matrix `A`:
10301    /// $$
10302    /// \operatorname{op}(A) =
10303    /// \begin{cases}
10304    /// A & \text{if } op(A) = \text{CUSPARSE_OPERATION_NON_TRANSPOSE} \\
10305    /// A^T & \text{if } op(A) = \text{CUSPARSE_OPERATION_TRANSPOSE} \\
10306    /// A^H & \text{if } op(A) = \text{CUSPARSE_OPERATION_CONJUGATE_TRANSPOSE}
10307    /// \end{cases}
10308    /// $$
10309    ///
10310    /// The function [`cusparseSpMV_bufferSize`] returns the size of the workspace needed by [`cusparseSpMV_preprocess`] and [`cusparseSpMV`]
10311    ///
10312    /// The sparse matrix formats currently supported are listed below:
10313    ///
10314    /// * [`cusparseFormat_t::CUSPARSE_FORMAT_COO`]
10315    /// * [`cusparseFormat_t::CUSPARSE_FORMAT_CSR`]
10316    /// * [`cusparseFormat_t::CUSPARSE_FORMAT_CSC`]
10317    /// * [`cusparseFormat_t::CUSPARSE_FORMAT_BSR`]
10318    /// * `cusparseFormat_t::CUSPARSE_FORMAT_SLICED_ELL`
10319    ///
10320    /// [`cusparseSpMV`] supports the following index type for representing the sparse matrix `matA`:
10321    ///
10322    /// * 32-bit indices ([`cusparseIndexType_t::CUSPARSE_INDEX_32I`])
10323    /// * 64-bit indices ([`cusparseIndexType_t::CUSPARSE_INDEX_64I`])
10324    ///
10325    /// [`cusparseSpMV`] supports the following data types:
10326    ///
10327    /// Uniform-precision computation:
10328    ///
10329    /// | `A`/`X`/ `Y`/`computeType` |
10330    /// | --- |
10331    /// | `cudaDataType_t::CUDA_R_32F` |
10332    /// | `cudaDataType_t::CUDA_R_64F` |
10333    /// | `cudaDataType_t::CUDA_C_32F` |
10334    /// | `cudaDataType_t::CUDA_C_64F` |
10335    ///
10336    /// Mixed-precision computation:
10337    ///
10338    /// | `A`/`X` | `Y` | `computeType` | Notes |
10339    /// | --- | --- | --- | --- |
10340    /// | `cudaDataType_t::CUDA_R_8I` | `cudaDataType_t::CUDA_R_32I` | `cudaDataType_t::CUDA_R_32I` |  |
10341    /// | `cudaDataType_t::CUDA_R_8I` | `cudaDataType_t::CUDA_R_32F` | `cudaDataType_t::CUDA_R_32F` |  |
10342    /// | `cudaDataType_t::CUDA_R_16F` |  |  |  |
10343    /// | `cudaDataType_t::CUDA_R_16BF` |  |  |  |
10344    /// | `cudaDataType_t::CUDA_R_16F` | `cudaDataType_t::CUDA_R_16F` |  |  |
10345    /// | `cudaDataType_t::CUDA_R_16BF` | `cudaDataType_t::CUDA_R_16BF` |  |  |
10346    /// | `cudaDataType_t::CUDA_C_32F` | `cudaDataType_t::CUDA_C_32F` | `cudaDataType_t::CUDA_C_32F` |  |
10347    /// | `cudaDataType_t::CUDA_C_16F` | `cudaDataType_t::CUDA_C_16F` | \[DEPRECATED\] |  |
10348    /// | `cudaDataType_t::CUDA_C_16BF` | `cudaDataType_t::CUDA_C_16BF` | \[DEPRECATED\] |  |
10349    ///
10350    /// | `A` | `X`/`Y`/`computeType` |
10351    /// | --- | --- |
10352    /// | `cudaDataType_t::CUDA_R_32F` | `cudaDataType_t::CUDA_R_64F` |
10353    ///
10354    /// Mixed Regular/Complex computation:
10355    ///
10356    /// | `A` | `X`/`Y`/`computeType` |
10357    /// | --- | --- |
10358    /// | `cudaDataType_t::CUDA_R_32F` | `cudaDataType_t::CUDA_C_32F` |
10359    /// | `cudaDataType_t::CUDA_R_64F` | `cudaDataType_t::CUDA_C_64F` |
10360    ///
10361    /// NOTE: `cudaDataType_t::CUDA_R_16F`, `cudaDataType_t::CUDA_R_16BF`, `cudaDataType_t::CUDA_C_16F`, and `cudaDataType_t::CUDA_C_16BF` data types always imply mixed-precision computation.
10362    ///
10363    /// [`cusparseSpMV`] supports the following algorithms:
10364    ///
10365    /// | Algorithm | Notes |
10366    /// | --- | --- |
10367    /// | [`cusparseSpMVAlg_t::CUSPARSE_SPMV_ALG_DEFAULT`] | Default algorithm for any sparse matrix format. |
10368    /// | [`cusparseSpMVAlg_t::CUSPARSE_SPMV_COO_ALG1`] | Default algorithm for COO sparse matrix format. May produce slightly different results during different runs with the same input parameters. |
10369    /// | [`cusparseSpMVAlg_t::CUSPARSE_SPMV_COO_ALG2`] | Provides deterministic (bit-wise) results for each run. If `opA != CUSPARSE_OPERATION_NON_TRANSPOSE`, it is identical to [`cusparseSpMVAlg_t::CUSPARSE_SPMV_COO_ALG1`]. |
10370    /// | [`cusparseSpMVAlg_t::CUSPARSE_SPMV_CSR_ALG1`] | Default algorithm for CSR/CSC sparse matrix format. May produce slightly different results during different runs with the same input parameters. |
10371    /// | [`cusparseSpMVAlg_t::CUSPARSE_SPMV_CSR_ALG2`] | Provides deterministic (bit-wise) results for each run. If `opA != CUSPARSE_OPERATION_NON_TRANSPOSE`, it is identical to [`cusparseSpMVAlg_t::CUSPARSE_SPMV_CSR_ALG1`]. |
10372    /// | [`cusparseSpMVAlg_t::CUSPARSE_SPMV_SELL_ALG1`] | Default algorithm for Sliced Ellpack sparse matrix format. Provides deterministic (bit-wise) results for each run. |
10373    /// | [`cusparseSpMVAlg_t::CUSPARSE_SPMV_BSR_ALG1`] | Default algorithm for BSR sparse matrix format. Provides deterministic (bit-wise) results for each run. Supports only `opA == CUSPARSE_OPERATION_NON_TRANSPOSE`. Supports both row-major and column-major block layouts in `A`. |
10374    ///
10375    /// Calling [`cusparseSpMV_preprocess`] is optional.
10376    /// It may accelerate subsequent calls to [`cusparseSpMV`].
10377    /// It is useful when [`cusparseSpMV`] is called multiple times with the same sparsity pattern (`matA`).
10378    ///
10379    /// Calling [`cusparseSpMV_preprocess`] with `buffer` makes that buffer “active” for `matA` SpMV calls.
10380    /// Subsequent calls to [`cusparseSpMV`] with `matA` and the active buffer
10381    /// must use the same values for all parameters as the call to [`cusparseSpMV_preprocess`].
10382    /// The exceptions are: `alpha`, `beta`, `vecX`, `vecY`, and the values (but not indices) of `matA` may be different.
10383    /// Importantly, the buffer contents must be unmodified since the call to [`cusparseSpMV_preprocess`].
10384    /// When [`cusparseSpMV`] is called with `matA` and its active buffer, it may read acceleration data from the buffer.
10385    ///
10386    /// Calling [`cusparseSpMV_preprocess`] again with `matA` and a new buffer will make the new buffer active,
10387    /// forgetting about the previously-active buffer and making it inactive.
10388    /// For [`cusparseSpMV`], there can only be one active buffer per sparse matrix at a time.
10389    /// To get the effect of multiple active buffers for a single sparse matrix,
10390    /// create multiple matrix handles that all point to the same index and value buffers,
10391    /// and call [`cusparseSpMV_preprocess`] once per handle with different workspace buffers.
10392    ///
10393    /// Calling [`cusparseSpMV`] with an inactive buffer is always permitted.
10394    /// However, there may be no acceleration from the preprocessing in that case.
10395    ///
10396    /// For the purposes of thread safety,
10397    /// [`cusparseSpMV_preprocess`] is writing to `matA` internal state.
10398    ///
10399    /// **Performance notes:**
10400    ///
10401    /// * [`cusparseSpMVAlg_t::CUSPARSE_SPMV_COO_ALG1`] and [`cusparseSpMVAlg_t::CUSPARSE_SPMV_CSR_ALG1`] provide higher performance than [`cusparseSpMVAlg_t::CUSPARSE_SPMV_COO_ALG2`] and [`cusparseSpMVAlg_t::CUSPARSE_SPMV_CSR_ALG2`].
10402    /// * In general, `opA == CUSPARSE_OPERATION_NON_TRANSPOSE` is 3x faster than `opA != CUSPARSE_OPERATION_NON_TRANSPOSE`.
10403    /// * Using [`cusparseSpMV_preprocess`] helps improve performance of [`cusparseSpMV`] in CSR. It is beneficial when we need to run [`cusparseSpMV`] multiple times with a same matrix ([`cusparseSpMV_preprocess`] is executed only once).
10404    ///
10405    /// [`cusparseSpMV`] has the following properties:
10406    ///
10407    /// * The routine requires extra storage for CSR/CSC format (all algorithms) and for COO format with [`cusparseSpMVAlg_t::CUSPARSE_SPMV_COO_ALG2`] algorithm.
10408    /// * Provides deterministic (bit-wise) results for each run only for [`cusparseSpMVAlg_t::CUSPARSE_SPMV_COO_ALG2`], [`cusparseSpMVAlg_t::CUSPARSE_SPMV_CSR_ALG2`] and [`cusparseSpMVAlg_t::CUSPARSE_SPMV_BSR_ALG1`] algorithms, and `opA == CUSPARSE_OPERATION_NON_TRANSPOSE`.
10409    /// * The routine supports asynchronous execution.
10410    /// * compute-sanitizer could report false race conditions for this routine when `beta == 0`. This is for optimization purposes and does not affect the correctness of the computation.
10411    /// * The routine allows the indices of `matA` to be unsorted.
10412    ///
10413    /// [`cusparseSpMV`] supports the following optimizations:
10414    ///
10415    /// * CUDA graph capture
10416    /// * Hardware Memory Compression
10417    ///
10418    /// Please visit [cuSPARSE Library Samples - cusparseSpMV CSR](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSPARSE/spmv_csr) and [cusparseSpMV COO](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSPARSE/spmv_coo) for a code example.
10419    ///
10420    /// # Parameters
10421    ///
10422    /// - `handle`: Handle to the cuSPARSE library context.
10423    /// - `opA`: Operation `op(A)`.
10424    /// - `alpha`: $\alpha$ scalar used for multiplication of type `computeType`.
10425    /// - `matA`: Sparse matrix `A`.
10426    /// - `vecX`: Dense vector `X`.
10427    /// - `beta`: $\beta$ scalar used for multiplication of type `computeType`.
10428    /// - `vecY`: Dense vector `Y`.
10429    /// - `computeType`: Datatype in which the computation is executed.
10430    /// - `alg`: Algorithm for the computation.
10431    /// - `externalBuffer`: Pointer to a workspace buffer of at least `bufferSize` bytes.
10432    pub fn cusparseSpMV(
10433        handle: cusparseHandle_t,
10434        opA: cusparseOperation_t,
10435        alpha: *const ::core::ffi::c_void,
10436        matA: cusparseConstSpMatDescr_t,
10437        vecX: cusparseConstDnVecDescr_t,
10438        beta: *const ::core::ffi::c_void,
10439        vecY: cusparseDnVecDescr_t,
10440        computeType: cudaDataType,
10441        alg: cusparseSpMVAlg_t,
10442        externalBuffer: *mut ::core::ffi::c_void,
10443    ) -> cusparseStatus_t;
10444}
10445unsafe extern "C" {
10446    pub fn cusparseSpMV_bufferSize(
10447        handle: cusparseHandle_t,
10448        opA: cusparseOperation_t,
10449        alpha: *const ::core::ffi::c_void,
10450        matA: cusparseConstSpMatDescr_t,
10451        vecX: cusparseConstDnVecDescr_t,
10452        beta: *const ::core::ffi::c_void,
10453        vecY: cusparseDnVecDescr_t,
10454        computeType: cudaDataType,
10455        alg: cusparseSpMVAlg_t,
10456        bufferSize: *mut size_t,
10457    ) -> cusparseStatus_t;
10458}
10459unsafe extern "C" {
10460    pub fn cusparseSpMV_preprocess(
10461        handle: cusparseHandle_t,
10462        opA: cusparseOperation_t,
10463        alpha: *const ::core::ffi::c_void,
10464        matA: cusparseConstSpMatDescr_t,
10465        vecX: cusparseConstDnVecDescr_t,
10466        beta: *const ::core::ffi::c_void,
10467        vecY: cusparseDnVecDescr_t,
10468        computeType: cudaDataType,
10469        alg: cusparseSpMVAlg_t,
10470        externalBuffer: *mut ::core::ffi::c_void,
10471    ) -> cusparseStatus_t;
10472}
10473#[repr(u32)]
10474#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
10475pub enum cusparseSpSVAlg_t {
10476    CUSPARSE_SPSV_ALG_DEFAULT = 0,
10477}
10478#[repr(u32)]
10479#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
10480pub enum cusparseSpSVUpdate_t {
10481    CUSPARSE_SPSV_UPDATE_GENERAL = 0,
10482    CUSPARSE_SPSV_UPDATE_DIAGONAL = 1,
10483}
10484#[repr(C)]
10485#[derive(Debug, Copy, Clone)]
10486pub struct cusparseSpSVDescr {
10487    _unused: [u8; 0],
10488}
10489pub type cusparseSpSVDescr_t = *mut cusparseSpSVDescr;
10490unsafe extern "C" {
10491    pub fn cusparseSpSV_createDescr(descr: *mut cusparseSpSVDescr_t) -> cusparseStatus_t;
10492}
10493unsafe extern "C" {
10494    pub fn cusparseSpSV_destroyDescr(descr: cusparseSpSVDescr_t) -> cusparseStatus_t;
10495}
10496unsafe extern "C" {
10497    pub fn cusparseSpSV_bufferSize(
10498        handle: cusparseHandle_t,
10499        opA: cusparseOperation_t,
10500        alpha: *const ::core::ffi::c_void,
10501        matA: cusparseConstSpMatDescr_t,
10502        vecX: cusparseConstDnVecDescr_t,
10503        vecY: cusparseDnVecDescr_t,
10504        computeType: cudaDataType,
10505        alg: cusparseSpSVAlg_t,
10506        spsvDescr: cusparseSpSVDescr_t,
10507        bufferSize: *mut size_t,
10508    ) -> cusparseStatus_t;
10509}
10510unsafe extern "C" {
10511    pub fn cusparseSpSV_analysis(
10512        handle: cusparseHandle_t,
10513        opA: cusparseOperation_t,
10514        alpha: *const ::core::ffi::c_void,
10515        matA: cusparseConstSpMatDescr_t,
10516        vecX: cusparseConstDnVecDescr_t,
10517        vecY: cusparseDnVecDescr_t,
10518        computeType: cudaDataType,
10519        alg: cusparseSpSVAlg_t,
10520        spsvDescr: cusparseSpSVDescr_t,
10521        externalBuffer: *mut ::core::ffi::c_void,
10522    ) -> cusparseStatus_t;
10523}
10524unsafe extern "C" {
10525    pub fn cusparseSpSV_solve(
10526        handle: cusparseHandle_t,
10527        opA: cusparseOperation_t,
10528        alpha: *const ::core::ffi::c_void,
10529        matA: cusparseConstSpMatDescr_t,
10530        vecX: cusparseConstDnVecDescr_t,
10531        vecY: cusparseDnVecDescr_t,
10532        computeType: cudaDataType,
10533        alg: cusparseSpSVAlg_t,
10534        spsvDescr: cusparseSpSVDescr_t,
10535    ) -> cusparseStatus_t;
10536}
10537unsafe extern "C" {
10538    pub fn cusparseSpSV_updateMatrix(
10539        handle: cusparseHandle_t,
10540        spsvDescr: cusparseSpSVDescr_t,
10541        newValues: *mut ::core::ffi::c_void,
10542        updatePart: cusparseSpSVUpdate_t,
10543    ) -> cusparseStatus_t;
10544}
10545#[repr(u32)]
10546#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
10547pub enum cusparseSpSMAlg_t {
10548    CUSPARSE_SPSM_ALG_DEFAULT = 0,
10549}
10550#[repr(u32)]
10551#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
10552pub enum cusparseSpSMUpdate_t {
10553    CUSPARSE_SPSM_UPDATE_GENERAL = 0,
10554    CUSPARSE_SPSM_UPDATE_DIAGONAL = 1,
10555}
10556#[repr(C)]
10557#[derive(Debug, Copy, Clone)]
10558pub struct cusparseSpSMDescr {
10559    _unused: [u8; 0],
10560}
10561pub type cusparseSpSMDescr_t = *mut cusparseSpSMDescr;
10562unsafe extern "C" {
10563    pub fn cusparseSpSM_createDescr(descr: *mut cusparseSpSMDescr_t) -> cusparseStatus_t;
10564}
10565unsafe extern "C" {
10566    pub fn cusparseSpSM_destroyDescr(descr: cusparseSpSMDescr_t) -> cusparseStatus_t;
10567}
10568unsafe extern "C" {
10569    pub fn cusparseSpSM_bufferSize(
10570        handle: cusparseHandle_t,
10571        opA: cusparseOperation_t,
10572        opB: cusparseOperation_t,
10573        alpha: *const ::core::ffi::c_void,
10574        matA: cusparseConstSpMatDescr_t,
10575        matB: cusparseConstDnMatDescr_t,
10576        matC: cusparseDnMatDescr_t,
10577        computeType: cudaDataType,
10578        alg: cusparseSpSMAlg_t,
10579        spsmDescr: cusparseSpSMDescr_t,
10580        bufferSize: *mut size_t,
10581    ) -> cusparseStatus_t;
10582}
10583unsafe extern "C" {
10584    pub fn cusparseSpSM_analysis(
10585        handle: cusparseHandle_t,
10586        opA: cusparseOperation_t,
10587        opB: cusparseOperation_t,
10588        alpha: *const ::core::ffi::c_void,
10589        matA: cusparseConstSpMatDescr_t,
10590        matB: cusparseConstDnMatDescr_t,
10591        matC: cusparseDnMatDescr_t,
10592        computeType: cudaDataType,
10593        alg: cusparseSpSMAlg_t,
10594        spsmDescr: cusparseSpSMDescr_t,
10595        externalBuffer: *mut ::core::ffi::c_void,
10596    ) -> cusparseStatus_t;
10597}
10598unsafe extern "C" {
10599    pub fn cusparseSpSM_solve(
10600        handle: cusparseHandle_t,
10601        opA: cusparseOperation_t,
10602        opB: cusparseOperation_t,
10603        alpha: *const ::core::ffi::c_void,
10604        matA: cusparseConstSpMatDescr_t,
10605        matB: cusparseConstDnMatDescr_t,
10606        matC: cusparseDnMatDescr_t,
10607        computeType: cudaDataType,
10608        alg: cusparseSpSMAlg_t,
10609        spsmDescr: cusparseSpSMDescr_t,
10610    ) -> cusparseStatus_t;
10611}
10612unsafe extern "C" {
10613    pub fn cusparseSpSM_updateMatrix(
10614        handle: cusparseHandle_t,
10615        spsmDescr: cusparseSpSMDescr_t,
10616        newValues: *mut ::core::ffi::c_void,
10617        updatePart: cusparseSpSMUpdate_t,
10618    ) -> cusparseStatus_t;
10619}
10620#[repr(u32)]
10621#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
10622pub enum cusparseSpMMAlg_t {
10623    CUSPARSE_SPMM_ALG_DEFAULT = 0,
10624    CUSPARSE_SPMM_COO_ALG1 = 1,
10625    CUSPARSE_SPMM_COO_ALG2 = 2,
10626    CUSPARSE_SPMM_COO_ALG3 = 3,
10627    CUSPARSE_SPMM_COO_ALG4 = 5,
10628    CUSPARSE_SPMM_CSR_ALG1 = 4,
10629    CUSPARSE_SPMM_CSR_ALG2 = 6,
10630    CUSPARSE_SPMM_CSR_ALG3 = 12,
10631    CUSPARSE_SPMM_BLOCKED_ELL_ALG1 = 13,
10632    CUSPARSE_SPMM_BSR_ALG1 = 14,
10633}
10634unsafe extern "C" {
10635    pub fn cusparseSpMM_bufferSize(
10636        handle: cusparseHandle_t,
10637        opA: cusparseOperation_t,
10638        opB: cusparseOperation_t,
10639        alpha: *const ::core::ffi::c_void,
10640        matA: cusparseConstSpMatDescr_t,
10641        matB: cusparseConstDnMatDescr_t,
10642        beta: *const ::core::ffi::c_void,
10643        matC: cusparseDnMatDescr_t,
10644        computeType: cudaDataType,
10645        alg: cusparseSpMMAlg_t,
10646        bufferSize: *mut size_t,
10647    ) -> cusparseStatus_t;
10648}
10649unsafe extern "C" {
10650    pub fn cusparseSpMM_preprocess(
10651        handle: cusparseHandle_t,
10652        opA: cusparseOperation_t,
10653        opB: cusparseOperation_t,
10654        alpha: *const ::core::ffi::c_void,
10655        matA: cusparseConstSpMatDescr_t,
10656        matB: cusparseConstDnMatDescr_t,
10657        beta: *const ::core::ffi::c_void,
10658        matC: cusparseDnMatDescr_t,
10659        computeType: cudaDataType,
10660        alg: cusparseSpMMAlg_t,
10661        externalBuffer: *mut ::core::ffi::c_void,
10662    ) -> cusparseStatus_t;
10663}
10664unsafe extern "C" {
10665    /// The function performs the multiplication of a sparse matrix `matA` and a dense matrix `matB`.
10666    ///
10667    /// where
10668    ///
10669    /// * `op(A)` is a sparse matrix of size $m \times k$
10670    /// * `op(B)` is a dense matrix of size $k \times n$
10671    /// * `C` is a dense matrix of size $m \times n$
10672    /// * $\alpha$ and $\beta$ are scalars
10673    ///
10674    /// The routine can be also used to perform the multiplication of a dense matrix and a sparse matrix by switching the dense matrices layout:
10675    ///
10676    /// where $\mathbf{B}_{C}$, $\mathbf{C}_{C}$ indicate column-major layout, while $\mathbf{B}_{R}$, $\mathbf{C}_{R}$ refer to row-major layout
10677    ///
10678    /// Also, for matrix `A` and `B`:
10679    /// $$
10680    /// \operatorname{op}(A) =
10681    /// \begin{cases}
10682    /// A & \text{if } op(A) = \text{CUSPARSE_OPERATION_NON_TRANSPOSE} \\
10683    /// A^T & \text{if } op(A) = \text{CUSPARSE_OPERATION_TRANSPOSE} \\
10684    /// A^H & \text{if } op(A) = \text{CUSPARSE_OPERATION_CONJUGATE_TRANSPOSE}
10685    /// \end{cases}
10686    /// $$:
10687    ///
10688    /// $$
10689    /// \operatorname{op}(B) =
10690    /// \begin{cases}
10691    /// B & \text{if } op(B) = \text{CUSPARSE_OPERATION_NON_TRANSPOSE} \\
10692    /// B^T & \text{if } op(B) = \text{CUSPARSE_OPERATION_TRANSPOSE} \\
10693    /// B^H & \text{if } op(B) = \text{CUSPARSE_OPERATION_CONJUGATE_TRANSPOSE}
10694    /// \end{cases}
10695    /// $$
10696    ///
10697    /// When using the (conjugate) transpose of the sparse matrix `A`, this routine may produce slightly different results during different runs with the same input parameters.
10698    ///
10699    /// The function `cusparseSpMM_bufferSize()` returns the size of the workspace needed by `cusparseSpMM()`
10700    ///
10701    /// Calling `cusparseSpMM_preprocess()` is optional.
10702    /// It may accelerate subsequent calls to `cusparseSpMM()`.
10703    /// It is useful when `cusparseSpMM()` is called multiple times with the same sparsity pattern (`matA`).
10704    /// It provides performance advantages with `CUSPARSE_SPMM_CSR_ALG1` or `CUSPARSE_SPMM_CSR_ALG3`.
10705    /// For all other formats and algorithms have no effect.
10706    ///
10707    /// Calling `cusparseSpMM_preprocess()` with `buffer` makes that buffer “active” for `matA` SpMM calls.
10708    /// Subsequent calls to `cusparseSpMM()` with `matA` and the active buffer
10709    /// must use the same values for all parameters as the call to `cusparseSpMM_preprocess()`.
10710    /// The exceptions are: `alpha`, `beta`, `matX`, `matY`, and the values (but not indices) of `matA` may be different.
10711    /// Importantly, the buffer contents must be unmodified since the call to `cusparseSpMM_preprocess()`.
10712    /// When `cusparseSpMM()` is called with `matA` and its active buffer, it may read acceleration data from the buffer.
10713    ///
10714    /// Calling `cusparseSpMM_preprocess()` again with `matA` and a new buffer will make the new buffer active,
10715    /// forgetting about the previously-active buffer and making it inactive.
10716    /// For `cusparseSpMM()`, there can only be one active buffer per sparse matrix at a time.
10717    /// To get the effect of multiple active buffers for a single sparse matrix,
10718    /// create multiple matrix handles that all point to the same index and value buffers,
10719    /// and call `cusparseSpMM_preprocess()` once per handle with different workspace buffers.
10720    ///
10721    /// Calling `cusparseSpMM()` with an inactive buffer is always permitted.
10722    /// However, there may be no acceleration from the preprocessing in that case.
10723    ///
10724    /// For the purposes of thread safety,
10725    /// `cusparseSpMM_preprocess()` is writing to `matA` internal state.
10726    ///
10727    /// `cusparseSpMM` supports the following sparse matrix formats:
10728    ///
10729    /// * [`cusparseFormat_t::CUSPARSE_FORMAT_COO`]
10730    /// * [`cusparseFormat_t::CUSPARSE_FORMAT_CSR`]
10731    /// * [`cusparseFormat_t::CUSPARSE_FORMAT_CSC`]
10732    /// * [`cusparseFormat_t::CUSPARSE_FORMAT_BSR`]
10733    /// * [`cusparseFormat_t::CUSPARSE_FORMAT_BLOCKED_ELL`]
10734    ///
10735    /// |  |  |
10736    /// | --- | --- |
10737    /// | **(1)** | **COO/CSR/CSC/BSR FORMATS** |
10738    ///
10739    /// `cusparseSpMM` supports the following index type for representing the sparse matrix `matA`:
10740    ///
10741    /// * 32-bit indices ([`cusparseIndexType_t::CUSPARSE_INDEX_32I`])
10742    /// * 64-bit indices ([`cusparseIndexType_t::CUSPARSE_INDEX_64I`])
10743    ///
10744    /// `cusparseSpMM` supports the following data types:
10745    ///
10746    /// Uniform-precision computation:
10747    ///
10748    /// | `A`/`B`/ `C`/`computeType` |
10749    /// | --- |
10750    /// | [`cudaDataType_t::CUDA_R_32F`] |
10751    /// | [`cudaDataType_t::CUDA_R_64F`] |
10752    /// | [`cudaDataType_t::CUDA_C_32F`] |
10753    /// | [`cudaDataType_t::CUDA_C_64F`] |
10754    ///
10755    /// Mixed-precision computation:
10756    ///
10757    /// | `A`/`B` | `C` | `computeType` |  |
10758    /// | --- | --- | --- | --- |
10759    /// | [`cudaDataType_t::CUDA_R_8I`] | [`cudaDataType_t::CUDA_R_32I`] | [`cudaDataType_t::CUDA_R_32I`] |  |
10760    /// | [`cudaDataType_t::CUDA_R_8I`] | [`cudaDataType_t::CUDA_R_32F`] | [`cudaDataType_t::CUDA_R_32F`] |  |
10761    /// | [`cudaDataType_t::CUDA_R_16F`] |  |  |  |
10762    /// | [`cudaDataType_t::CUDA_R_16BF`] |  |  |  |
10763    /// | [`cudaDataType_t::CUDA_R_16F`] | [`cudaDataType_t::CUDA_R_16F`] |  |  |
10764    /// | [`cudaDataType_t::CUDA_R_16BF`] | [`cudaDataType_t::CUDA_R_16BF`] |  |  |
10765    /// | [`cudaDataType_t::CUDA_C_16F`] | [`cudaDataType_t::CUDA_C_16F`] | [`cudaDataType_t::CUDA_C_32F`] | \[DEPRECATED\] |
10766    /// | [`cudaDataType_t::CUDA_C_16BF`] | [`cudaDataType_t::CUDA_C_16BF`] | \[DEPRECATED\] |  |
10767    ///
10768    /// NOTE: [`cudaDataType_t::CUDA_R_16F`], [`cudaDataType_t::CUDA_R_16BF`], [`cudaDataType_t::CUDA_C_16F`], and [`cudaDataType_t::CUDA_C_16BF`] data types always imply mixed-precision computation.
10769    ///
10770    /// `cusparseSpMM` supports the following algorithms:
10771    ///
10772    /// | Algorithm | Notes |
10773    /// | --- | --- |
10774    /// | `CUSPARSE_SPMM_ALG_DEFAULT` | Default algorithm for any sparse matrix format |
10775    /// | `CUSPARSE_SPMM_COO_ALG1` | Algorithm 1 for COO sparse matrix format
10776    ///   - May provide better performance for small number of nnz
10777    ///   - Provides the best performance with column-major layout
10778    ///   - It supports batched computation
10779    ///   - May produce slightly different results during different runs with the same input parameters |
10780    /// | `CUSPARSE_SPMM_COO_ALG2` | Algorithm 2 for COO sparse matrix format
10781    ///   - It provides deterministic result
10782    ///   - Provides the best performance with column-major layout
10783    ///   - In general, slower than Algorithm 1
10784    ///   - It supports batched computation
10785    ///   - It requires additional memory
10786    ///   - If `opA != CUSPARSE_OPERATION_NON_TRANSPOSE`, it is identical to `CUSPARSE_SPMM_COO_ALG1` |
10787    /// | `CUSPARSE_SPMM_COO_ALG3` | Algorithm 3 for COO sparse matrix format
10788    ///   - May provide better performance for large number of nnz
10789    ///   - May produce slightly different results during different runs with the same input parameters |
10790    /// | `CUSPARSE_SPMM_COO_ALG4` | Algorithm 4 for COO sparse matrix format
10791    ///   - Provides better performance with row-major layout
10792    ///   - It supports batched computation
10793    ///   - May produce slightly different results during different runs with the same input parameters |
10794    /// | `CUSPARSE_SPMM_CSR_ALG1` | Algorithm 1 for CSR/CSC sparse matrix format
10795    ///   - Provides the best performance with column-major layout
10796    ///   - It supports batched computation
10797    ///   - It requires additional memory
10798    ///   - May produce slightly different results during different runs with the same input parameters |
10799    /// | `CUSPARSE_SPMM_CSR_ALG2` | Algorithm 2 for CSR/CSC sparse matrix format
10800    ///   - Provides the best performance with row-major layout
10801    ///   - It supports batched computation
10802    ///   - It requires additional memory
10803    ///   - May produce slightly different results during different runs with the same input parameters |
10804    /// | `CUSPARSE_SPMM_CSR_ALG3` | Algorithm 3 for CSR sparse matrix format
10805    ///   - It provides deterministic result
10806    ///   - It requires additional memory
10807    ///   - It supports only CSR matrix and `opA == CUSPARSE_OPERATION_NON_TRANSPOSE`
10808    ///   - It does not support `opB == CUSPARSE_OPERATION_CONJUGATE_TRANSPOSE`
10809    ///   - It does not support `CUDA_C_16F and CUDA_C_16BF` data types |
10810    /// | `CUSPARSE_SPMM_BSR_ALG1` | Algorithm 1 for BSR sparse matrix format
10811    ///   - It provides deterministic result
10812    ///   - It requires no additional memory
10813    ///   - It supports only `opA == CUSPARSE_OPERATION_NON_TRANSPOSE`
10814    ///   - It does not support [`cudaDataType_t::CUDA_C_16F`] and [`cudaDataType_t::CUDA_C_16BF`] data types
10815    ///   - It does not support column-major blocks in `A` |
10816    ///
10817    /// NOTE: When using `cusparseSpMM` for mixed-precision computation on COO or CSR matrices, it defaults to algorithms `CUSPARSE_SPMM_COO_ALG2` and `CUSPARSE_SPMM_CSR_ALG3`, respectively. If the required computation isn’t supported by those algorithms, the mixed-precision operation will fail.
10818    ///
10819    /// **Performance notes:**
10820    ///
10821    /// * Row-major layout provides higher performance than column-major
10822    /// * `CUSPARSE_SPMM_COO_ALG4` and `CUSPARSE_SPMM_CSR_ALG2` should be used with row-major layout, while `CUSPARSE_SPMM_COO_ALG1`, `CUSPARSE_SPMM_COO_ALG2`, `CUSPARSE_SPMM_COO_ALG3`, and `CUSPARSE_SPMM_CSR_ALG1` with column-major layout
10823    /// * For `beta != 1`, most algorithms scale the output matrix before the main computation
10824    /// * For `n == 1`, the routine may use `cusparseSpMV()`
10825    ///
10826    /// `cusparseSpMM()` with all algorithms support the following batch modes except for `CUSPARSE_SPMM_CSR_ALG3`:
10827    ///
10828    /// * $C_{i} = A \cdot B_{i}$
10829    /// * $C_{i} = A_{i} \cdot B$
10830    /// * $C_{i} = A_{i} \cdot B_{i}$
10831    ///
10832    /// The number of batches and their strides can be set by using `cusparseCooSetStridedBatch`, `cusparseCsrSetStridedBatch`, and `cusparseDnMatSetStridedBatch`. The maximum number of batches for `cusparseSpMM()` is 65,535.
10833    ///
10834    /// `cusparseSpMM()` has the following properties:
10835    ///
10836    /// * The routine requires no extra storage for `CUSPARSE_SPMM_COO_ALG1`, `CUSPARSE_SPMM_COO_ALG3`, `CUSPARSE_SPMM_COO_ALG4`, `CUSPARSE_SPMM_BSR_ALG1`
10837    /// * The routine supports asynchronous execution
10838    /// * Provides deterministic (bit-wise) results for each run only for `CUSPARSE_SPMM_COO_ALG2`, `CUSPARSE_SPMM_CSR_ALG3`, and `CUSPARSE_SPMM_BSR_ALG1` algorithms
10839    /// * `compute-sanitizer` could report false race conditions for this routine. This is for optimization purposes and does not affect the correctness of the computation
10840    /// * The routine allows the indices of `matA` to be unsorted
10841    ///
10842    /// `cusparseSpMM()` supports the following optimizations:
10843    ///
10844    /// * CUDA graph capture
10845    /// * Hardware Memory Compression
10846    ///
10847    /// Please visit [cuSPARSE Library Samples - cusparseSpMM CSR](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSPARSE/spmm_csr) and [cusparseSpMM COO](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSPARSE/spmm_coo) for a code example. For batched computation please visit [cusparseSpMM CSR Batched](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSPARSE/spmm_csr_batched) and [cusparseSpMM COO Batched](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSPARSE/spmm_coo_batched).
10848    ///
10849    /// |  |  |
10850    /// | --- | --- |
10851    /// | **(2)** | **BLOCKED-ELLPACK FORMAT** |
10852    ///
10853    /// `cusparseSpMM` supports the following data types for [`cusparseFormat_t::CUSPARSE_FORMAT_BLOCKED_ELL`] format and the following GPU architectures for exploiting NVIDIA Tensor Cores:
10854    ///
10855    /// | `A`/`B` | `C` | `computeType` | `opB` | `Compute Capability` |
10856    /// | --- | --- | --- | --- | --- |
10857    /// | [`cudaDataType_t::CUDA_R_16F`] | [`cudaDataType_t::CUDA_R_16F`] | [`cudaDataType_t::CUDA_R_16F`] | `N`, `T` | `≥ 70` |
10858    /// | [`cudaDataType_t::CUDA_R_16F`] | [`cudaDataType_t::CUDA_R_16F`] | [`cudaDataType_t::CUDA_R_32F`] | `N`, `T` | `≥ 70` |
10859    /// | [`cudaDataType_t::CUDA_R_16F`] | [`cudaDataType_t::CUDA_R_32F`] | [`cudaDataType_t::CUDA_R_32F`] | `N`, `T` | `≥ 70` |
10860    /// | [`cudaDataType_t::CUDA_R_8I`] | [`cudaDataType_t::CUDA_R_32I`] | [`cudaDataType_t::CUDA_R_32I`] | `N` column-major | `≥ 75` |
10861    /// | `T` row-major |  |  |  |  |
10862    /// | [`cudaDataType_t::CUDA_R_16BF`] | [`cudaDataType_t::CUDA_R_16BF`] | [`cudaDataType_t::CUDA_R_32F`] | `N`, `T` | `≥ 80` |
10863    /// | [`cudaDataType_t::CUDA_R_16BF`] | [`cudaDataType_t::CUDA_R_32F`] | [`cudaDataType_t::CUDA_R_32F`] | `N`, `T` | `≥ 80` |
10864    /// | [`cudaDataType_t::CUDA_R_32F`] | [`cudaDataType_t::CUDA_R_32F`] | [`cudaDataType_t::CUDA_R_32F`] | `N`, `T` | `≥ 80` |
10865    /// | [`cudaDataType_t::CUDA_R_64F`] | [`cudaDataType_t::CUDA_R_64F`] | [`cudaDataType_t::CUDA_R_64F`] | `N`, `T` | `≥ 80` |
10866    ///
10867    /// `cusparseSpMM` supports the following algorithms with [`cusparseFormat_t::CUSPARSE_FORMAT_BLOCKED_ELL`] format:
10868    ///
10869    /// | Algorithm | Notes |
10870    /// | --- | --- |
10871    /// | `CUSPARSE_SPMM_ALG_DEFAULT` | Default algorithm for any sparse matrix format |
10872    /// | `CUSPARSE_SPMM_BLOCKED_ELL_ALG1` | Default algorithm for Blocked-ELL format |
10873    ///
10874    /// **Performance notes:**
10875    ///
10876    /// * Blocked-ELL SpMM provides the best performance with Power-of-2 Block-Sizes.
10877    /// * Large Block-Sizes (e.g. ≥ 64) provide the best performance.
10878    ///
10879    /// The function has the following limitations:
10880    ///
10881    /// * The pointer mode must be equal to [`cusparsePointerMode_t::CUSPARSE_POINTER_MODE_HOST`]
10882    /// * Only `opA == CUSPARSE_OPERATION_NON_TRANSPOSE` is supported.
10883    /// * `opB == CUSPARSE_OPERATION_CONJUGATE_TRANSPOSE` is not supported.
10884    /// * Only [`cusparseIndexType_t::CUSPARSE_INDEX_32I`] is supported.
10885    ///
10886    /// Please visit [cuSPARSE Library Samples - cusparseSpMM Blocked-ELL](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSPARSE/spmm_blockedell) for a code example.
10887    ///
10888    /// # Parameters
10889    ///
10890    /// - `handle`: Handle to the cuSPARSE library context.
10891    /// - `opA`: Operation `op(A)`.
10892    /// - `opB`: Operation `op(B)`.
10893    /// - `alpha`: $\alpha$ scalar used for multiplication of type `computeType`.
10894    /// - `matA`: Sparse matrix `A`.
10895    /// - `matB`: Dense matrix `B`.
10896    /// - `beta`: $\beta$ scalar used for multiplication of type `computeType`.
10897    /// - `matC`: Dense matrix `C`.
10898    /// - `computeType`: Datatype in which the computation is executed.
10899    /// - `alg`: Algorithm for the computation.
10900    /// - `externalBuffer`: Pointer to workspace buffer of at least `bufferSize` bytes.
10901    pub fn cusparseSpMM(
10902        handle: cusparseHandle_t,
10903        opA: cusparseOperation_t,
10904        opB: cusparseOperation_t,
10905        alpha: *const ::core::ffi::c_void,
10906        matA: cusparseConstSpMatDescr_t,
10907        matB: cusparseConstDnMatDescr_t,
10908        beta: *const ::core::ffi::c_void,
10909        matC: cusparseDnMatDescr_t,
10910        computeType: cudaDataType,
10911        alg: cusparseSpMMAlg_t,
10912        externalBuffer: *mut ::core::ffi::c_void,
10913    ) -> cusparseStatus_t;
10914}
10915#[repr(u32)]
10916#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
10917pub enum cusparseSpGEMMAlg_t {
10918    CUSPARSE_SPGEMM_DEFAULT = 0,
10919    CUSPARSE_SPGEMM_CSR_ALG_DETERMINITIC = 1,
10920    CUSPARSE_SPGEMM_CSR_ALG_NONDETERMINITIC = 2,
10921    CUSPARSE_SPGEMM_ALG1 = 3,
10922    CUSPARSE_SPGEMM_ALG2 = 4,
10923    CUSPARSE_SPGEMM_ALG3 = 5,
10924}
10925#[repr(C)]
10926#[derive(Debug, Copy, Clone)]
10927pub struct cusparseSpGEMMDescr {
10928    _unused: [u8; 0],
10929}
10930pub type cusparseSpGEMMDescr_t = *mut cusparseSpGEMMDescr;
10931unsafe extern "C" {
10932    pub fn cusparseSpGEMM_createDescr(
10933        descr: *mut cusparseSpGEMMDescr_t,
10934    ) -> cusparseStatus_t;
10935}
10936unsafe extern "C" {
10937    pub fn cusparseSpGEMM_destroyDescr(descr: cusparseSpGEMMDescr_t) -> cusparseStatus_t;
10938}
10939unsafe extern "C" {
10940    pub fn cusparseSpGEMM_workEstimation(
10941        handle: cusparseHandle_t,
10942        opA: cusparseOperation_t,
10943        opB: cusparseOperation_t,
10944        alpha: *const ::core::ffi::c_void,
10945        matA: cusparseConstSpMatDescr_t,
10946        matB: cusparseConstSpMatDescr_t,
10947        beta: *const ::core::ffi::c_void,
10948        matC: cusparseSpMatDescr_t,
10949        computeType: cudaDataType,
10950        alg: cusparseSpGEMMAlg_t,
10951        spgemmDescr: cusparseSpGEMMDescr_t,
10952        bufferSize1: *mut size_t,
10953        externalBuffer1: *mut ::core::ffi::c_void,
10954    ) -> cusparseStatus_t;
10955}
10956unsafe extern "C" {
10957    pub fn cusparseSpGEMM_getNumProducts(
10958        spgemmDescr: cusparseSpGEMMDescr_t,
10959        num_prods: *mut i64,
10960    ) -> cusparseStatus_t;
10961}
10962unsafe extern "C" {
10963    pub fn cusparseSpGEMM_estimateMemory(
10964        handle: cusparseHandle_t,
10965        opA: cusparseOperation_t,
10966        opB: cusparseOperation_t,
10967        alpha: *const ::core::ffi::c_void,
10968        matA: cusparseConstSpMatDescr_t,
10969        matB: cusparseConstSpMatDescr_t,
10970        beta: *const ::core::ffi::c_void,
10971        matC: cusparseSpMatDescr_t,
10972        computeType: cudaDataType,
10973        alg: cusparseSpGEMMAlg_t,
10974        spgemmDescr: cusparseSpGEMMDescr_t,
10975        chunk_fraction: f32,
10976        bufferSize3: *mut size_t,
10977        externalBuffer3: *mut ::core::ffi::c_void,
10978        bufferSize2: *mut size_t,
10979    ) -> cusparseStatus_t;
10980}
10981unsafe extern "C" {
10982    pub fn cusparseSpGEMM_compute(
10983        handle: cusparseHandle_t,
10984        opA: cusparseOperation_t,
10985        opB: cusparseOperation_t,
10986        alpha: *const ::core::ffi::c_void,
10987        matA: cusparseConstSpMatDescr_t,
10988        matB: cusparseConstSpMatDescr_t,
10989        beta: *const ::core::ffi::c_void,
10990        matC: cusparseSpMatDescr_t,
10991        computeType: cudaDataType,
10992        alg: cusparseSpGEMMAlg_t,
10993        spgemmDescr: cusparseSpGEMMDescr_t,
10994        bufferSize2: *mut size_t,
10995        externalBuffer2: *mut ::core::ffi::c_void,
10996    ) -> cusparseStatus_t;
10997}
10998unsafe extern "C" {
10999    pub fn cusparseSpGEMM_copy(
11000        handle: cusparseHandle_t,
11001        opA: cusparseOperation_t,
11002        opB: cusparseOperation_t,
11003        alpha: *const ::core::ffi::c_void,
11004        matA: cusparseConstSpMatDescr_t,
11005        matB: cusparseConstSpMatDescr_t,
11006        beta: *const ::core::ffi::c_void,
11007        matC: cusparseSpMatDescr_t,
11008        computeType: cudaDataType,
11009        alg: cusparseSpGEMMAlg_t,
11010        spgemmDescr: cusparseSpGEMMDescr_t,
11011    ) -> cusparseStatus_t;
11012}
11013unsafe extern "C" {
11014    pub fn cusparseSpGEMMreuse_workEstimation(
11015        handle: cusparseHandle_t,
11016        opA: cusparseOperation_t,
11017        opB: cusparseOperation_t,
11018        matA: cusparseConstSpMatDescr_t,
11019        matB: cusparseConstSpMatDescr_t,
11020        matC: cusparseSpMatDescr_t,
11021        alg: cusparseSpGEMMAlg_t,
11022        spgemmDescr: cusparseSpGEMMDescr_t,
11023        bufferSize1: *mut size_t,
11024        externalBuffer1: *mut ::core::ffi::c_void,
11025    ) -> cusparseStatus_t;
11026}
11027unsafe extern "C" {
11028    /// This function computes the number of nonzero elements per row or column and the total number of nonzero elements in a dense matrix.
11029    ///
11030    /// * This function requires temporary extra storage that is allocated internally.
11031    /// * The routine supports asynchronous execution if the Stream Ordered Memory Allocator is available.
11032    /// * The routine supports CUDA graph capture if the Stream Ordered Memory Allocator is available.
11033    pub fn cusparseSpGEMMreuse_nnz(
11034        handle: cusparseHandle_t,
11035        opA: cusparseOperation_t,
11036        opB: cusparseOperation_t,
11037        matA: cusparseConstSpMatDescr_t,
11038        matB: cusparseConstSpMatDescr_t,
11039        matC: cusparseSpMatDescr_t,
11040        alg: cusparseSpGEMMAlg_t,
11041        spgemmDescr: cusparseSpGEMMDescr_t,
11042        bufferSize2: *mut size_t,
11043        externalBuffer2: *mut ::core::ffi::c_void,
11044        bufferSize3: *mut size_t,
11045        externalBuffer3: *mut ::core::ffi::c_void,
11046        bufferSize4: *mut size_t,
11047        externalBuffer4: *mut ::core::ffi::c_void,
11048    ) -> cusparseStatus_t;
11049}
11050unsafe extern "C" {
11051    pub fn cusparseSpGEMMreuse_copy(
11052        handle: cusparseHandle_t,
11053        opA: cusparseOperation_t,
11054        opB: cusparseOperation_t,
11055        matA: cusparseConstSpMatDescr_t,
11056        matB: cusparseConstSpMatDescr_t,
11057        matC: cusparseSpMatDescr_t,
11058        alg: cusparseSpGEMMAlg_t,
11059        spgemmDescr: cusparseSpGEMMDescr_t,
11060        bufferSize5: *mut size_t,
11061        externalBuffer5: *mut ::core::ffi::c_void,
11062    ) -> cusparseStatus_t;
11063}
11064unsafe extern "C" {
11065    pub fn cusparseSpGEMMreuse_compute(
11066        handle: cusparseHandle_t,
11067        opA: cusparseOperation_t,
11068        opB: cusparseOperation_t,
11069        alpha: *const ::core::ffi::c_void,
11070        matA: cusparseConstSpMatDescr_t,
11071        matB: cusparseConstSpMatDescr_t,
11072        beta: *const ::core::ffi::c_void,
11073        matC: cusparseSpMatDescr_t,
11074        computeType: cudaDataType,
11075        alg: cusparseSpGEMMAlg_t,
11076        spgemmDescr: cusparseSpGEMMDescr_t,
11077    ) -> cusparseStatus_t;
11078}
11079#[repr(u32)]
11080#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
11081pub enum cusparseSDDMMAlg_t {
11082    CUSPARSE_SDDMM_ALG_DEFAULT = 0,
11083}
11084unsafe extern "C" {
11085    pub fn cusparseSDDMM_bufferSize(
11086        handle: cusparseHandle_t,
11087        opA: cusparseOperation_t,
11088        opB: cusparseOperation_t,
11089        alpha: *const ::core::ffi::c_void,
11090        matA: cusparseConstDnMatDescr_t,
11091        matB: cusparseConstDnMatDescr_t,
11092        beta: *const ::core::ffi::c_void,
11093        matC: cusparseSpMatDescr_t,
11094        computeType: cudaDataType,
11095        alg: cusparseSDDMMAlg_t,
11096        bufferSize: *mut size_t,
11097    ) -> cusparseStatus_t;
11098}
11099unsafe extern "C" {
11100    pub fn cusparseSDDMM_preprocess(
11101        handle: cusparseHandle_t,
11102        opA: cusparseOperation_t,
11103        opB: cusparseOperation_t,
11104        alpha: *const ::core::ffi::c_void,
11105        matA: cusparseConstDnMatDescr_t,
11106        matB: cusparseConstDnMatDescr_t,
11107        beta: *const ::core::ffi::c_void,
11108        matC: cusparseSpMatDescr_t,
11109        computeType: cudaDataType,
11110        alg: cusparseSDDMMAlg_t,
11111        externalBuffer: *mut ::core::ffi::c_void,
11112    ) -> cusparseStatus_t;
11113}
11114unsafe extern "C" {
11115    /// This function performs the multiplication of `matA` and `matB`, followed by an element-wise multiplication with the sparsity pattern of `matC`. Formally, it performs the following operation:
11116    ///
11117    /// where
11118    ///
11119    /// * `op(A)` is a dense matrix of size $m \times k$
11120    /// * `op(B)` is a dense matrix of size $k \times n$
11121    /// * `C` is a sparse matrix of size $m \times n$
11122    /// * $\alpha$ and $\beta$ are scalars
11123    /// * $\circ$ denotes the Hadamard (entry-wise) matrix product, and ${spy}\left( \mathbf{C} \right)$ is the structural sparsity pattern matrix of `C` defined as:
11124    /// $$
11125    /// \operatorname{spy}(C)_{ij} =
11126    /// \begin{cases}
11127    /// 1 & \text{if } C_{ij} \text{ is an entry stored in matC} \\
11128    /// 0 & \text{otherwise}
11129    /// \end{cases}
11130    /// $$
11131    ///
11132    /// Also, for matrix `A` and `B`:
11133    /// $$
11134    /// \operatorname{op}(A) =
11135    /// \begin{cases}
11136    /// A & \text{if } op(A) = \text{CUSPARSE_OPERATION_NON_TRANSPOSE} \\
11137    /// A^T & \text{if } op(A) = \text{CUSPARSE_OPERATION_TRANSPOSE}
11138    /// \end{cases}
11139    /// $$:
11140    ///
11141    /// $$
11142    /// \operatorname{op}(B) =
11143    /// \begin{cases}
11144    /// B & \text{if } op(B) = \text{CUSPARSE_OPERATION_NON_TRANSPOSE} \\
11145    /// B^T & \text{if } op(B) = \text{CUSPARSE_OPERATION_TRANSPOSE}
11146    /// \end{cases}
11147    /// $$
11148    ///
11149    /// The function `cusparseSDDMM_bufferSize()` returns the size of the workspace needed by `cusparseSDDMM` or `cusparseSDDMM_preprocess`.
11150    ///
11151    /// Calling `cusparseSDDMM_preprocess()` is optional.
11152    /// It may accelerate subsequent calls to `cusparseSDDMM()`.
11153    /// It is useful when `cusparseSDDMM()` is called multiple times with the same sparsity pattern (`matC`).
11154    ///
11155    /// Calling `cusparseSDDMM_preprocess()` with `buffer` makes that buffer “active” for `matC` SDDMM calls.
11156    /// Subsequent calls to `cusparseSDDMM()` with `matC` and the active buffer
11157    /// must use the same values for all parameters as the call to `cusparseSDDMM_preprocess()`.
11158    /// The exceptions are: `alpha`, `beta`, `matA`, `matB`, and the values (but not indices) of `matC` may be different.
11159    /// Importantly, the buffer contents must be unmodified since the call to `cusparseSDDMM_preprocess()`.
11160    /// When `cusparseSDDMM()` is called with `matC` and its active buffer, it may read acceleration data from the buffer.
11161    ///
11162    /// Calling `cusparseSDDMM_preprocess()` again with `matC` and a new buffer will make the new buffer active,
11163    /// forgetting about the previously-active buffer and making it inactive.
11164    /// For `cusparseSDDMM()`, there can only be one active buffer per sparse matrix at a time.
11165    /// To get the effect of multiple active buffers for a single sparse matrix,
11166    /// create multiple matrix handles that all point to the same index and value buffers,
11167    /// and call `cusparseSDDMM_preprocess()` once per handle with different workspace buffers.
11168    ///
11169    /// Calling `cusparseSDDMM()` with an inactive buffer is always permitted.
11170    /// However, there may be no acceleration from the preprocessing in that case.
11171    ///
11172    /// For the purposes of thread safety,
11173    /// `cusparseSDDMM_preprocess()` is writing to `matC` internal state.
11174    ///
11175    /// Currently supported sparse matrix formats:
11176    ///
11177    /// * [`cusparseFormat_t::CUSPARSE_FORMAT_CSR`]
11178    /// * [`cusparseFormat_t::CUSPARSE_FORMAT_BSR`]
11179    ///
11180    /// `cusparseSDDMM()` supports the following index type for representing the sparse matrix `matA`:
11181    ///
11182    /// * 32-bit indices ([`cusparseIndexType_t::CUSPARSE_INDEX_32I`])
11183    /// * 64-bit indices ([`cusparseIndexType_t::CUSPARSE_INDEX_64I`])
11184    ///
11185    /// The data types combinations currently supported for `cusparseSDDMM` are listed below:
11186    ///
11187    /// Uniform-precision computation:
11188    ///
11189    /// | `A`/`X`/ `Y`/`computeType` |
11190    /// | --- |
11191    /// | [`cudaDataType_t::CUDA_R_32F`] |
11192    /// | [`cudaDataType_t::CUDA_R_64F`] |
11193    /// | [`cudaDataType_t::CUDA_C_32F`] |
11194    /// | [`cudaDataType_t::CUDA_C_64F`] |
11195    ///
11196    /// Mixed-precision computation:
11197    ///
11198    /// | `A`/`B` | `C` | `computeType` |
11199    /// | --- | --- | --- |
11200    /// | [`cudaDataType_t::CUDA_R_16F`] | [`cudaDataType_t::CUDA_R_32F`] | [`cudaDataType_t::CUDA_R_32F`] |
11201    /// | [`cudaDataType_t::CUDA_R_16F`] | [`cudaDataType_t::CUDA_R_16F`] |  |
11202    ///
11203    /// `cusparseSDDMM` for [`cusparseFormat_t::CUSPARSE_FORMAT_BSR`] also supports the following mixed-precision computation:
11204    ///
11205    /// | `A`/`B` | `C` | `computeType` |
11206    /// | --- | --- | --- |
11207    /// | [`cudaDataType_t::CUDA_R_16BF`] | [`cudaDataType_t::CUDA_R_32F`] | [`cudaDataType_t::CUDA_R_32F`] |
11208    /// | [`cudaDataType_t::CUDA_R_16BF`] | [`cudaDataType_t::CUDA_R_16BF`] |  |
11209    ///
11210    /// NOTE: [`cudaDataType_t::CUDA_R_16F`], [`cudaDataType_t::CUDA_R_16BF`] data types always imply mixed-precision computation.
11211    ///
11212    /// `cusparseSDDMM()` for `CUSPARSE_FORMAT_BSR` supports block sizes of 2, 4, 8, 16, 32, 64 and 128.
11213    ///
11214    /// `cusparseSDDMM()` supports the following algorithms:
11215    ///
11216    /// | Algorithm | Notes |
11217    /// | --- | --- |
11218    /// | `CUSPARSE_SDDMM_ALG_DEFAULT` | Default algorithm. It supports batched computation. |
11219    ///
11220    /// Performance notes: `cusparseSDDMM()` for [`cusparseFormat_t::CUSPARSE_FORMAT_CSR`] provides the best performance when `matA` and `matB` satisfy:
11221    ///
11222    /// * `matA`:
11223    ///
11224    ///   + `matA` is in row-major order and `opA` is [`cusparseOperation_t::CUSPARSE_OPERATION_NON_TRANSPOSE`], or
11225    ///   + `matA` is in col-major order and `opA` is not [`cusparseOperation_t::CUSPARSE_OPERATION_NON_TRANSPOSE`]
11226    /// * `matB`:
11227    ///
11228    ///   + `matB` is in col-major order and `opB` is [`cusparseOperation_t::CUSPARSE_OPERATION_NON_TRANSPOSE`], or
11229    ///   + `matB` is in row-major order and `opB` is not [`cusparseOperation_t::CUSPARSE_OPERATION_NON_TRANSPOSE`]
11230    ///
11231    /// `cusparseSDDMM()` for [`cusparseFormat_t::CUSPARSE_FORMAT_BSR`] provides the best performance when `matA` and `matB` satisfy:
11232    ///
11233    /// * `matA`:
11234    ///
11235    ///   + `matA` is in row-major order and `opA` is [`cusparseOperation_t::CUSPARSE_OPERATION_NON_TRANSPOSE`], or
11236    ///   + `matA` is in col-major order and `opA` is not [`cusparseOperation_t::CUSPARSE_OPERATION_NON_TRANSPOSE`]
11237    /// * `matB`:
11238    ///
11239    ///   + `matB` is in row-major order and `opB` is [`cusparseOperation_t::CUSPARSE_OPERATION_NON_TRANSPOSE`], or
11240    ///   + `matB` is in col-major order and `opB` is not [`cusparseOperation_t::CUSPARSE_OPERATION_NON_TRANSPOSE`]
11241    ///
11242    /// `cusparseSDDMM()` supports the following batch modes:
11243    ///
11244    /// * $C_{i} = (A \cdot B) \circ C_{i}$
11245    /// * $C_{i} = \left( A_{i} \cdot B \right) \circ C_{i}$
11246    /// * $C_{i} = \left( A \cdot B_{i} \right) \circ C_{i}$
11247    /// * $C_{i} = \left( A_{i} \cdot B_{i} \right) \circ C_{i}$
11248    ///
11249    /// The number of batches and their strides can be set by using `cusparseCsrSetStridedBatch` and `cusparseDnMatSetStridedBatch`. The maximum number of batches for `cusparseSDDMM()` is 65,535.
11250    ///
11251    /// `cusparseSDDMM()` has the following properties:
11252    ///
11253    /// * The routine requires no extra storage
11254    /// * Provides deterministic (bit-wise) results for each run
11255    /// * The routine supports asynchronous execution
11256    /// * The routine allows the indices of `matC` to be unsorted
11257    ///
11258    /// `cusparseSDDMM()` supports the following optimizations:
11259    ///
11260    /// * CUDA graph capture
11261    /// * Hardware Memory Compression
11262    ///
11263    /// Please visit [cuSPARSE Library Samples - cusparseSDDMM](https://github.com/NVIDIA/CUDALibrarySamples/blob/main/cuSPARSE/sddmm_csr) for a code example. For batched computation please visit [cusparseSDDMM CSR Batched](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSPARSE/sddmm_csr_batched).
11264    ///
11265    /// # Parameters
11266    ///
11267    /// - `handle`: Handle to the cuSPARSE library context.
11268    /// - `opA`: Operation `op(A)`.
11269    /// - `opB`: Operation `op(B)`.
11270    /// - `alpha`: $\alpha$ scalar used for multiplication of type `computeType`.
11271    /// - `matA`: Dense matrix `matA`.
11272    /// - `matB`: Dense matrix `matB`.
11273    /// - `beta`: $\beta$ scalar used for multiplication of type `computeType`.
11274    /// - `matC`: Sparse matrix `matC`.
11275    /// - `computeType`: Datatype in which the computation is executed.
11276    /// - `alg`: Algorithm for the computation.
11277    /// - `externalBuffer`: Pointer to a workspace buffer of at least `bufferSize` bytes.
11278    pub fn cusparseSDDMM(
11279        handle: cusparseHandle_t,
11280        opA: cusparseOperation_t,
11281        opB: cusparseOperation_t,
11282        alpha: *const ::core::ffi::c_void,
11283        matA: cusparseConstDnMatDescr_t,
11284        matB: cusparseConstDnMatDescr_t,
11285        beta: *const ::core::ffi::c_void,
11286        matC: cusparseSpMatDescr_t,
11287        computeType: cudaDataType,
11288        alg: cusparseSDDMMAlg_t,
11289        externalBuffer: *mut ::core::ffi::c_void,
11290    ) -> cusparseStatus_t;
11291}
11292#[repr(C)]
11293#[derive(Debug, Copy, Clone)]
11294pub struct cusparseSpMMOpPlan {
11295    _unused: [u8; 0],
11296}
11297pub type cusparseSpMMOpPlan_t = *mut cusparseSpMMOpPlan;
11298#[repr(u32)]
11299#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
11300pub enum cusparseSpMMOpAlg_t {
11301    CUSPARSE_SPMM_OP_ALG_DEFAULT = 0,
11302}
11303unsafe extern "C" {
11304    pub fn cusparseSpMMOp_createPlan(
11305        handle: cusparseHandle_t,
11306        plan: *mut cusparseSpMMOpPlan_t,
11307        opA: cusparseOperation_t,
11308        opB: cusparseOperation_t,
11309        matA: cusparseConstSpMatDescr_t,
11310        matB: cusparseConstDnMatDescr_t,
11311        matC: cusparseDnMatDescr_t,
11312        computeType: cudaDataType,
11313        alg: cusparseSpMMOpAlg_t,
11314        addOperationLtoirBuffer: *const ::core::ffi::c_void,
11315        addOperationBufferSize: size_t,
11316        mulOperationLtoirBuffer: *const ::core::ffi::c_void,
11317        mulOperationBufferSize: size_t,
11318        epilogueLtoirBuffer: *const ::core::ffi::c_void,
11319        epilogueBufferSize: size_t,
11320        SpMMWorkspaceSize: *mut size_t,
11321    ) -> cusparseStatus_t;
11322}
11323unsafe extern "C" {
11324    /// *NOTE 1:* NVRTC and nvJitLink are not currently available on Arm64 Android platforms.
11325    ///
11326    /// *NOTE 2:* The routine does not support Android and Tegra platforms except Judy (sm87).
11327    ///
11328    /// `Experimental`: The function performs the multiplication of a sparse matrix `matA` and a dense matrix `matB` with custom operators.
11329    ///
11330    /// where
11331    ///
11332    /// * `op(A)` is a sparse matrix of size $m \times k$
11333    /// * `op(B)` is a dense matrix of size $k \times n$
11334    /// * `C` is a dense matrix of size $m \times n$
11335    /// * $\oplus$, $\otimes$, and $\text{epilogue}$ are custom **add**, **mul**, and **epilogue** operators respectively.
11336    ///
11337    /// Also, for matrix `A` and `B`:
11338    /// $$
11339    /// \operatorname{op}(A) =
11340    /// \begin{cases}
11341    /// A & \text{if } op(A) = \text{CUSPARSE_OPERATION_NON_TRANSPOSE} \\
11342    /// A^T & \text{if } op(A) = \text{CUSPARSE_OPERATION_TRANSPOSE}
11343    /// \end{cases}
11344    /// $$:
11345    ///
11346    /// $$
11347    /// \operatorname{op}(B) =
11348    /// \begin{cases}
11349    /// B & \text{if } op(B) = \text{CUSPARSE_OPERATION_NON_TRANSPOSE} \\
11350    /// B^T & \text{if } op(B) = \text{CUSPARSE_OPERATION_TRANSPOSE}
11351    /// \end{cases}
11352    /// $$
11353    ///
11354    /// Only `opA == CUSPARSE_OPERATION_NON_TRANSPOSE` is currently supported
11355    ///
11356    /// The function `cusparseSpMMOp_createPlan()` returns the size of the workspace and the compiled kernel needed by `cusparseSpMMOp()`
11357    ///
11358    /// The operators must have the following signature and return type
11359    ///
11360    /// `&lt;computetype>` is one of `float`, `double`, `cuComplex`, `cuDoubleComplex`, or `int`,
11361    ///
11362    /// `cusparseSpMMOp` supports the following sparse matrix formats:
11363    ///
11364    /// * [`cusparseFormat_t::CUSPARSE_FORMAT_CSR`]
11365    ///
11366    /// `cusparseSpMMOp` supports the following index type for representing the sparse matrix `matA`:
11367    ///
11368    /// * 32-bit indices ([`cusparseIndexType_t::CUSPARSE_INDEX_32I`])
11369    /// * 64-bit indices ([`cusparseIndexType_t::CUSPARSE_INDEX_64I`])
11370    ///
11371    /// `cusparseSpMMOp` supports the following data types:
11372    ///
11373    /// Uniform-precision computation:
11374    ///
11375    /// | `A`/`B`/ `C`/`computeType` |
11376    /// | --- |
11377    /// | [`cudaDataType_t::CUDA_R_32F`] |
11378    /// | [`cudaDataType_t::CUDA_R_64F`] |
11379    /// | [`cudaDataType_t::CUDA_C_32F`] |
11380    /// | [`cudaDataType_t::CUDA_C_64F`] |
11381    ///
11382    /// Mixed-precision computation:
11383    ///
11384    /// | `A`/`B` | `C` | `computeType` |
11385    /// | --- | --- | --- |
11386    /// | [`cudaDataType_t::CUDA_R_8I`] | [`cudaDataType_t::CUDA_R_32I`] | [`cudaDataType_t::CUDA_R_32I`] |
11387    /// | [`cudaDataType_t::CUDA_R_8I`] | [`cudaDataType_t::CUDA_R_32F`] | [`cudaDataType_t::CUDA_R_32F`] |
11388    /// | [`cudaDataType_t::CUDA_R_16F`] |  |  |
11389    /// | [`cudaDataType_t::CUDA_R_16BF`] |  |  |
11390    /// | [`cudaDataType_t::CUDA_R_16F`] | [`cudaDataType_t::CUDA_R_16F`] |  |
11391    /// | [`cudaDataType_t::CUDA_R_16BF`] | [`cudaDataType_t::CUDA_R_16BF`] |  |
11392    ///
11393    /// `cusparseSpMMOp` supports the following algorithms:
11394    ///
11395    /// | Algorithm | Notes |
11396    /// | --- | --- |
11397    /// | `CUSPARSE_SPMM_OP_ALG_DEFAULT` | Default algorithm for any sparse matrix format |
11398    ///
11399    /// **Performance notes:**
11400    ///
11401    /// * Row-major layout provides higher performance than column-major.
11402    ///
11403    /// `cusparseSpMMOp()` has the following properties:
11404    ///
11405    /// * The routine requires extra storage
11406    /// * The routine supports asynchronous execution
11407    /// * Provides deterministic (bit-wise) results for each run
11408    /// * The routine allows the indices of `matA` to be unsorted
11409    ///
11410    /// `cusparseSpMMOp()` supports the following optimizations:
11411    ///
11412    /// * CUDA graph capture
11413    /// * Hardware Memory Compression
11414    ///
11415    /// Please visit [cuSPARSE Library Samples - cusparseSpMMOp](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSPARSE/spmm_csr_op).
11416    pub fn cusparseSpMMOp(
11417        plan: cusparseSpMMOpPlan_t,
11418        externalBuffer: *mut ::core::ffi::c_void,
11419    ) -> cusparseStatus_t;
11420}
11421unsafe extern "C" {
11422    pub fn cusparseSpMMOp_destroyPlan(plan: cusparseSpMMOpPlan_t) -> cusparseStatus_t;
11423}