Skip to main content

singe_cusolver_sys/
sys_12100.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 CUSOLVER_VER_MAJOR: u32 = 12;
150pub const CUSOLVER_VER_MINOR: u32 = 1;
151pub const CUSOLVER_VER_PATCH: u32 = 0;
152pub const CUSOLVER_VER_BUILD: u32 = 51;
153pub const CUSOLVER_VERSION: u32 = 12100;
154#[repr(C)]
155#[derive(Debug, Copy, Clone)]
156pub struct cusolverDnContext {
157    _unused: [u8; 0],
158}
159/// This is a pointer type to an opaque cuSolverDN context, which the user must initialize by calling [`cusolverDnCreate`] prior to calling any other library function. An uninitialized Handle object will lead to unexpected behavior, including crashes of cuSolverDN. The handle created and returned by [`cusolverDnCreate`] must be passed to every cuSolverDN function.
160pub type cusolverDnHandle_t = *mut cusolverDnContext;
161#[repr(C)]
162#[derive(Debug, Copy, Clone)]
163pub struct syevjInfo {
164    _unused: [u8; 0],
165}
166pub type syevjInfo_t = *mut syevjInfo;
167#[repr(C)]
168#[derive(Debug, Copy, Clone)]
169pub struct gesvdjInfo {
170    _unused: [u8; 0],
171}
172pub type gesvdjInfo_t = *mut gesvdjInfo;
173#[repr(C)]
174#[derive(Debug, Copy, Clone)]
175pub struct cusolverDnIRSParams {
176    _unused: [u8; 0],
177}
178/// This is a pointer type to an opaque [`cusolverDnIRSParams_t`] structure, which holds parameters for the iterative refinement linear solvers such as `cusolverDnXgesv()`. Use corresponding helper functions described below to either Create/Destroy this structure or Set/Get solver parameters.
179pub type cusolverDnIRSParams_t = *mut cusolverDnIRSParams;
180#[repr(C)]
181#[derive(Debug, Copy, Clone)]
182pub struct cusolverDnIRSInfos {
183    _unused: [u8; 0],
184}
185/// This is a pointer type to an opaque [`cusolverDnIRSInfos_t`] structure, which holds information about the performed call to an iterative refinement linear solver (such as `cusolverDnXgesv()`). Use corresponding helper functions described below to either Create/Destroy this structure or retrieve solve information.
186pub type cusolverDnIRSInfos_t = *mut cusolverDnIRSInfos;
187#[repr(C)]
188#[derive(Debug, Copy, Clone)]
189pub struct cusolverDnParams {
190    _unused: [u8; 0],
191}
192pub type cusolverDnParams_t = *mut cusolverDnParams;
193/// The [`cusolverDnFunction_t`] type indicates which routine needs to be configured by [`cusolverDnSetAdvOptions`]. The value [`cusolverDnFunction_t::CUSOLVERDN_GETRF`] corresponds to the routine `Getrf`.
194#[repr(u32)]
195#[derive(
196    Debug,
197    Copy,
198    Clone,
199    Hash,
200    PartialOrd,
201    Ord,
202    PartialEq,
203    Eq,
204    TryFromPrimitive,
205    IntoPrimitive,
206)]
207pub enum cusolverDnFunction_t {
208    /// Corresponds to `Getrf`.
209    CUSOLVERDN_GETRF = 0,
210    CUSOLVERDN_POTRF = 1,
211    CUSOLVERDN_SYEVBATCHED = 2,
212}
213pub type size_t = ::core::ffi::c_ulong;
214pub type __uint64_t = ::core::ffi::c_ulong;
215pub type __off_t = ::core::ffi::c_long;
216pub type __off64_t = ::core::ffi::c_long;
217pub type FILE = _IO_FILE;
218#[repr(C)]
219#[derive(Debug, Copy, Clone)]
220pub struct _IO_marker {
221    _unused: [u8; 0],
222}
223#[repr(C)]
224#[derive(Debug, Copy, Clone)]
225pub struct _IO_codecvt {
226    _unused: [u8; 0],
227}
228#[repr(C)]
229#[derive(Debug, Copy, Clone)]
230pub struct _IO_wide_data {
231    _unused: [u8; 0],
232}
233pub type _IO_lock_t = ::core::ffi::c_void;
234#[repr(C)]
235#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
236pub struct _IO_FILE {
237    pub _flags: ::core::ffi::c_int,
238    pub _IO_read_ptr: *mut ::core::ffi::c_char,
239    pub _IO_read_end: *mut ::core::ffi::c_char,
240    pub _IO_read_base: *mut ::core::ffi::c_char,
241    pub _IO_write_base: *mut ::core::ffi::c_char,
242    pub _IO_write_ptr: *mut ::core::ffi::c_char,
243    pub _IO_write_end: *mut ::core::ffi::c_char,
244    pub _IO_buf_base: *mut ::core::ffi::c_char,
245    pub _IO_buf_end: *mut ::core::ffi::c_char,
246    pub _IO_save_base: *mut ::core::ffi::c_char,
247    pub _IO_backup_base: *mut ::core::ffi::c_char,
248    pub _IO_save_end: *mut ::core::ffi::c_char,
249    pub _markers: *mut _IO_marker,
250    pub _chain: *mut _IO_FILE,
251    pub _fileno: ::core::ffi::c_int,
252    pub _bitfield_align_1: [u32; 0],
253    pub _bitfield_1: __BindgenBitfieldUnit<[u8; 3usize]>,
254    pub _short_backupbuf: [::core::ffi::c_char; 1usize],
255    pub _old_offset: __off_t,
256    pub _cur_column: ::core::ffi::c_ushort,
257    pub _vtable_offset: ::core::ffi::c_schar,
258    pub _shortbuf: [::core::ffi::c_char; 1usize],
259    pub _lock: *mut _IO_lock_t,
260    pub _offset: __off64_t,
261    pub _codecvt: *mut _IO_codecvt,
262    pub _wide_data: *mut _IO_wide_data,
263    pub _freeres_list: *mut _IO_FILE,
264    pub _freeres_buf: *mut ::core::ffi::c_void,
265    pub _prevchain: *mut *mut _IO_FILE,
266    pub _mode: ::core::ffi::c_int,
267    pub _unused3: ::core::ffi::c_int,
268    pub _total_written: __uint64_t,
269    pub _unused2: [::core::ffi::c_char; 8usize],
270}
271impl Default for _IO_FILE {
272    fn default() -> Self {
273        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
274        unsafe {
275            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
276            s.assume_init()
277        }
278    }
279}
280impl _IO_FILE {
281    #[inline]
282    pub fn _flags2(&self) -> ::core::ffi::c_int {
283        unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 24u8) as u32) }
284    }
285    #[inline]
286    pub fn set__flags2(&mut self, val: ::core::ffi::c_int) {
287        unsafe {
288            let val: u32 = ::core::mem::transmute(val);
289            self._bitfield_1.set(0usize, 24u8, val as u64)
290        }
291    }
292    #[inline]
293    pub unsafe fn _flags2_raw(this: *const Self) -> ::core::ffi::c_int {
294        unsafe {
295            ::core::mem::transmute(
296                <__BindgenBitfieldUnit<
297                    [u8; 3usize],
298                >>::raw_get(::core::ptr::addr_of!((* this)._bitfield_1), 0usize, 24u8)
299                    as u32,
300            )
301        }
302    }
303    #[inline]
304    pub unsafe fn set__flags2_raw(this: *mut Self, val: ::core::ffi::c_int) {
305        unsafe {
306            let val: u32 = ::core::mem::transmute(val);
307            <__BindgenBitfieldUnit<
308                [u8; 3usize],
309            >>::raw_set(
310                ::core::ptr::addr_of_mut!((* this)._bitfield_1),
311                0usize,
312                24u8,
313                val as u64,
314            )
315        }
316    }
317    #[inline]
318    pub fn new_bitfield_1(
319        _flags2: ::core::ffi::c_int,
320    ) -> __BindgenBitfieldUnit<[u8; 3usize]> {
321        let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 3usize]> = Default::default();
322        __bindgen_bitfield_unit
323            .set(
324                0usize,
325                24u8,
326                {
327                    let _flags2: u32 = unsafe { ::core::mem::transmute(_flags2) };
328                    _flags2 as u64
329                },
330            );
331        __bindgen_bitfield_unit
332    }
333}
334#[repr(C)]
335#[repr(align(8))]
336#[derive(Debug, Default, Copy, Clone, PartialOrd, PartialEq)]
337pub struct float2 {
338    pub x: f32,
339    pub y: f32,
340}
341#[repr(C)]
342#[repr(align(16))]
343#[derive(Debug, Default, Copy, Clone, PartialOrd, PartialEq)]
344pub struct double2 {
345    pub x: f64,
346    pub y: f64,
347}
348pub type cuFloatComplex = float2;
349pub type cuDoubleComplex = double2;
350pub type cuComplex = cuFloatComplex;
351#[repr(C)]
352#[derive(Debug, Copy, Clone)]
353pub struct CUstream_st {
354    _unused: [u8; 0],
355}
356/// The type indicates which part (lower or upper) of the dense matrix was filled and consequently should be used by the function.
357///
358/// Notice that BLAS implementations often use Fortran characters `‘L’` or `‘l’` (lower) and `‘U’` or `‘u’` (upper) to describe which part of the matrix is filled.
359#[repr(u32)]
360#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
361pub enum cublasFillMode_t {
362    /// The lower part of the matrix is filled.
363    CUBLAS_FILL_MODE_LOWER = 0,
364    /// The upper part of the matrix is filled.
365    CUBLAS_FILL_MODE_UPPER = 1,
366    /// The full matrix is filled.
367    CUBLAS_FILL_MODE_FULL = 2,
368}
369#[repr(u32)]
370#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
371pub enum cublasDiagType_t {
372    CUBLAS_DIAG_NON_UNIT = 0,
373    CUBLAS_DIAG_UNIT = 1,
374}
375#[repr(u32)]
376#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
377pub enum cublasSideMode_t {
378    CUBLAS_SIDE_LEFT = 0,
379    CUBLAS_SIDE_RIGHT = 1,
380}
381impl cublasOperation_t {
382    pub const CUBLAS_OP_HERMITAN: cublasOperation_t = cublasOperation_t::CUBLAS_OP_C;
383}
384/// The [`cublasOperation_t`] type indicates which operation needs to be performed with the dense matrix.
385///
386/// Notice that BLAS implementations often use Fortran characters `‘N’` or `‘n’` (non-transpose), `‘T’` or `‘t’` (transpose) and `‘C’` or `‘c’` (conjugate transpose) to describe which operations need to be performed with the dense matrix.
387#[repr(u32)]
388#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
389pub enum cublasOperation_t {
390    /// The non-transpose operation is selected.
391    CUBLAS_OP_N = 0,
392    /// The transpose operation is selected.
393    CUBLAS_OP_T = 1,
394    /// The conjugate transpose operation is selected.
395    CUBLAS_OP_C = 2,
396    CUBLAS_OP_CONJG = 3,
397}
398pub type cusolver_int_t = ::core::ffi::c_int;
399/// This is a status type returned by the library functions and it can have the following values.
400///
401/// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The operation completed successfully.
402///
403/// [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]:   The cuSolver 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 cuSolver routine, or an error in the hardware setup.
404///
405/// **To correct:** call [`cusolverDnCreate`] prior to the function call; and check that the hardware, an appropriate version of the driver, and the cuSolver library are correctly installed.
406///
407/// [`cusolverStatus_t::CUSOLVER_STATUS_ALLOC_FAILED`]:   Resource allocation failed inside the cuSolver library. This is usually caused by a `cudaMalloc()` failure.
408///
409/// **To correct:** prior to the function call, deallocate previously allocated memory as much as possible.
410///
411/// [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]:   An unsupported value or parameter was passed to the function (a negative vector size, for example).
412///
413/// **To correct:** ensure that all the parameters being passed have valid values.
414///
415/// [`cusolverStatus_t::CUSOLVER_STATUS_ARCH_MISMATCH`]:   The function requires a feature absent from the device architecture; usually caused by the lack of support for atomic operations or double precision.
416///
417/// **To correct:** compile and run the application on a device with compute capability 5.0 or above.
418///
419/// [`cusolverStatus_t::CUSOLVER_STATUS_EXECUTION_FAILED`]:   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.
420///
421/// **To correct:** check that the hardware, an appropriate version of the driver, and the cuSolver library are correctly installed.
422///
423/// [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]:   An internal cuSolver operation failed. This error is usually caused by a `cudaMemcpyAsync()` failure.
424///
425/// **To correct:** check that the hardware, an appropriate version of the driver, and the cuSolver library are correctly installed. Also, check that the memory passed as a parameter to the routine is not being deallocated prior to the routine’s completion.
426///
427/// [`cusolverStatus_t::CUSOLVER_STATUS_MATRIX_TYPE_NOT_SUPPORTED`]:   The matrix type is not supported by this function. This is usually caused by passing an invalid matrix descriptor to the function.
428///
429/// **To correct:** check that the fields in `descrA` were set correctly.
430///
431/// [`cusolverStatus_t::CUSOLVER_STATUS_NOT_SUPPORTED`]:   The parameter combination is not supported, for example batched version is not supported or `M < N` is not supported.
432///
433/// **To correct:** consult the documentation, and use a supported configuration.
434#[repr(u32)]
435#[derive(
436    Debug,
437    Copy,
438    Clone,
439    Hash,
440    PartialOrd,
441    Ord,
442    PartialEq,
443    Eq,
444    TryFromPrimitive,
445    IntoPrimitive,
446)]
447pub enum cusolverStatus_t {
448    /// The operation completed successfully.
449    CUSOLVER_STATUS_SUCCESS = 0,
450    /// The cuSolver 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 cuSolver routine, or an error in the hardware setup.
451    ///
452    /// **To correct:** call [`cusolverDnCreate`] prior to the function call; and check that the hardware, an appropriate version of the driver, and the cuSolver library are correctly installed.
453    CUSOLVER_STATUS_NOT_INITIALIZED = 1,
454    /// Resource allocation failed inside the cuSolver library. This is usually caused by a `cudaMalloc()` failure.
455    ///
456    /// **To correct:** prior to the function call, deallocate previously allocated memory as much as possible.
457    CUSOLVER_STATUS_ALLOC_FAILED = 2,
458    /// An unsupported value or parameter was passed to the function (a negative vector size, for example).
459    ///
460    /// **To correct:** ensure that all the parameters being passed have valid values.
461    CUSOLVER_STATUS_INVALID_VALUE = 3,
462    /// The function requires a feature absent from the device architecture; usually caused by the lack of support for atomic operations or double precision.
463    ///
464    /// **To correct:** compile and run the application on a device with compute capability 5.0 or above.
465    CUSOLVER_STATUS_ARCH_MISMATCH = 4,
466    CUSOLVER_STATUS_MAPPING_ERROR = 5,
467    /// 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.
468    ///
469    /// **To correct:** check that the hardware, an appropriate version of the driver, and the cuSolver library are correctly installed.
470    CUSOLVER_STATUS_EXECUTION_FAILED = 6,
471    /// An internal cuSolver operation failed. This error is usually caused by a `cudaMemcpyAsync()` failure.
472    ///
473    /// **To correct:** check that the hardware, an appropriate version of the driver, and the cuSolver library are correctly installed. Also, check that the memory passed as a parameter to the routine is not being deallocated prior to the routine’s completion.
474    CUSOLVER_STATUS_INTERNAL_ERROR = 7,
475    /// The matrix type is not supported by this function. This is usually caused by passing an invalid matrix descriptor to the function.
476    ///
477    /// **To correct:** check that the fields in `descrA` were set correctly.
478    CUSOLVER_STATUS_MATRIX_TYPE_NOT_SUPPORTED = 8,
479    /// The parameter combination is not supported, for example batched version is not supported or `M < N` is not supported.
480    ///
481    /// **To correct:** consult the documentation, and use a supported configuration.
482    CUSOLVER_STATUS_NOT_SUPPORTED = 9,
483    CUSOLVER_STATUS_ZERO_PIVOT = 10,
484    CUSOLVER_STATUS_INVALID_LICENSE = 11,
485    CUSOLVER_STATUS_IRS_PARAMS_NOT_INITIALIZED = 12,
486    CUSOLVER_STATUS_IRS_PARAMS_INVALID = 13,
487    CUSOLVER_STATUS_IRS_PARAMS_INVALID_PREC = 14,
488    CUSOLVER_STATUS_IRS_PARAMS_INVALID_REFINE = 15,
489    CUSOLVER_STATUS_IRS_PARAMS_INVALID_MAXITER = 16,
490    CUSOLVER_STATUS_IRS_INTERNAL_ERROR = 20,
491    CUSOLVER_STATUS_IRS_NOT_SUPPORTED = 21,
492    CUSOLVER_STATUS_IRS_OUT_OF_RANGE = 22,
493    CUSOLVER_STATUS_IRS_NRHS_NOT_SUPPORTED_FOR_REFINE_GMRES = 23,
494    CUSOLVER_STATUS_IRS_INFOS_NOT_INITIALIZED = 25,
495    CUSOLVER_STATUS_IRS_INFOS_NOT_DESTROYED = 26,
496    CUSOLVER_STATUS_IRS_MATRIX_SINGULAR = 30,
497    CUSOLVER_STATUS_INVALID_WORKSPACE = 31,
498}
499/// The [`cusolverEigType_t`] type indicates which type of eigenvalue the solver is.
500///
501/// Notice that LAPACK implementations often use Fortran integer `1` (A\*x = lambda\*B\*x), `2` (A\*B\*x = lambda\*x), `3` (B\*A\*x = lambda\*x) to indicate which type of eigenvalue the solver is.
502#[repr(u32)]
503#[derive(
504    Debug,
505    Copy,
506    Clone,
507    Hash,
508    PartialOrd,
509    Ord,
510    PartialEq,
511    Eq,
512    TryFromPrimitive,
513    IntoPrimitive,
514)]
515pub enum cusolverEigType_t {
516    /// A\*x = lambda\*B\*x.
517    CUSOLVER_EIG_TYPE_1 = 1,
518    /// A\*B\*x = lambda\*x.
519    CUSOLVER_EIG_TYPE_2 = 2,
520    /// B\*A\*x = lambda\*x.
521    CUSOLVER_EIG_TYPE_3 = 3,
522}
523/// The [`cusolverEigMode_t`] type indicates whether or not eigenvectors are computed.
524///
525/// Notice that LAPACK implementations often use Fortran character `'N'` (only eigenvalues are computed), `'V'` (both eigenvalues and eigenvectors are computed) to indicate whether or not eigenvectors are computed.
526#[repr(u32)]
527#[derive(
528    Debug,
529    Copy,
530    Clone,
531    Hash,
532    PartialOrd,
533    Ord,
534    PartialEq,
535    Eq,
536    TryFromPrimitive,
537    IntoPrimitive,
538)]
539pub enum cusolverEigMode_t {
540    /// Only eigenvalues are computed.
541    CUSOLVER_EIG_MODE_NOVECTOR = 0,
542    /// Both eigenvalues and eigenvectors are computed.
543    CUSOLVER_EIG_MODE_VECTOR = 1,
544}
545#[repr(u32)]
546#[derive(
547    Debug,
548    Copy,
549    Clone,
550    Hash,
551    PartialOrd,
552    Ord,
553    PartialEq,
554    Eq,
555    TryFromPrimitive,
556    IntoPrimitive,
557)]
558pub enum cusolverEigRange_t {
559    CUSOLVER_EIG_RANGE_ALL = 1001,
560    CUSOLVER_EIG_RANGE_I = 1002,
561    CUSOLVER_EIG_RANGE_V = 1003,
562}
563#[repr(u32)]
564#[derive(
565    Debug,
566    Copy,
567    Clone,
568    Hash,
569    PartialOrd,
570    Ord,
571    PartialEq,
572    Eq,
573    TryFromPrimitive,
574    IntoPrimitive,
575)]
576pub enum cusolverNorm_t {
577    CUSOLVER_INF_NORM = 104,
578    CUSOLVER_MAX_NORM = 105,
579    CUSOLVER_ONE_NORM = 106,
580    CUSOLVER_FRO_NORM = 107,
581}
582/// The [`cusolverIRSRefinement_t`] type indicates which solver type would be used for the specific cusolver function. Most of our experimentation shows that [`cusolverIRSRefinement_t::CUSOLVER_IRS_REFINE_GMRES`] is the best option.
583///
584/// *More details about the refinement process can be found in Azzam Haidar, Stanimire Tomov, Jack Dongarra, and Nicholas J. Higham. 2018. Harnessing GPU tensor cores for fast FP16 arithmetic to speed up mixed-precision iterative refinement solvers. In Proceedings of the International Conference for High Performance Computing, Networking, Storage, and Analysis (SC ‘18). IEEE Press, Piscataway, NJ, USA, Article 47, 11 pages.*
585///
586/// [`cusolverIRSRefinement_t::CUSOLVER_IRS_REFINE_NOT_SET`]:   Solver is not set; this value is what is set when creating the `params` structure. IRS solver will return an error.
587///
588/// [`cusolverIRSRefinement_t::CUSOLVER_IRS_REFINE_NONE`]:   No refinement solver, the IRS solver performs a factorization followed by a solve without any refinement. For example if the IRS solver was [`cusolverDnIRSXgesv`], this is equivalent to a Xgesv routine without refinement and where the factorization is carried out in the lowest precision. If for example the main precision was CUSOLVER_R_64F and the lowest was CUSOLVER_R_64F as well, then this is equivalent to a call to `cusolverDnDgesv()`.
589///
590/// [`cusolverIRSRefinement_t::CUSOLVER_IRS_REFINE_CLASSICAL`]:   Classical iterative refinement solver. Similar to the one used in LAPACK routines.
591///
592/// [`cusolverIRSRefinement_t::CUSOLVER_IRS_REFINE_GMRES`]:   GMRES (Generalized Minimal Residual) based iterative refinement solver. In recent study, the GMRES method has drawn the scientific community attention for its ability to be used as refinement solver that outperforms the classical iterative refinement method. Based on our experimentation, we recommend this setting.
593///
594/// [`cusolverIRSRefinement_t::CUSOLVER_IRS_REFINE_CLASSICAL_GMRES`]:   Classical iterative refinement solver that uses the GMRES (Generalized Minimal Residual) internally to solve the correction equation at each iteration. We call the *classical refinement iteration* the outer iteration while the *GMRES* is called inner iteration. Note that if the tolerance of the inner GMRES is set very low, lets say to machine precision, then the outer *classical refinement iteration* will performs only one iteration and thus this option will behave like [`cusolverIRSRefinement_t::CUSOLVER_IRS_REFINE_GMRES`].
595///
596/// [`cusolverIRSRefinement_t::CUSOLVER_IRS_REFINE_GMRES_GMRES`]:   Similar to [`cusolverIRSRefinement_t::CUSOLVER_IRS_REFINE_CLASSICAL_GMRES`] which consists of classical refinement process that uses GMRES to solve the inner correction system; here it is a GMRES (Generalized Minimal Residual) based iterative refinement solver that uses another GMRES internally to solve the preconditioned system.
597#[repr(u32)]
598#[derive(
599    Debug,
600    Copy,
601    Clone,
602    Hash,
603    PartialOrd,
604    Ord,
605    PartialEq,
606    Eq,
607    TryFromPrimitive,
608    IntoPrimitive,
609)]
610pub enum cusolverIRSRefinement_t {
611    /// Solver is not set; this value is what is set when creating the `params` structure. IRS solver will return an error.
612    CUSOLVER_IRS_REFINE_NOT_SET = 1100,
613    /// No refinement solver, the IRS solver performs a factorization followed by a solve without any refinement. For example if the IRS solver was [`cusolverDnIRSXgesv`], this is equivalent to a Xgesv routine without refinement and where the factorization is carried out in the lowest precision. If for example the main precision was CUSOLVER_R_64F and the lowest was CUSOLVER_R_64F as well, then this is equivalent to a call to `cusolverDnDgesv()`.
614    CUSOLVER_IRS_REFINE_NONE = 1101,
615    /// Classical iterative refinement solver. Similar to the one used in LAPACK routines.
616    CUSOLVER_IRS_REFINE_CLASSICAL = 1102,
617    /// Classical iterative refinement solver that uses the GMRES (Generalized Minimal Residual) internally to solve the correction equation at each iteration. We call the *classical refinement iteration* the outer iteration while the *GMRES* is called inner iteration. Note that if the tolerance of the inner GMRES is set very low, lets say to machine precision, then the outer *classical refinement iteration* will performs only one iteration and thus this option will behave like [`cusolverIRSRefinement_t::CUSOLVER_IRS_REFINE_GMRES`].
618    CUSOLVER_IRS_REFINE_CLASSICAL_GMRES = 1103,
619    /// GMRES (Generalized Minimal Residual) based iterative refinement solver. In recent study, the GMRES method has drawn the scientific community attention for its ability to be used as refinement solver that outperforms the classical iterative refinement method. Based on our experimentation, we recommend this setting.
620    CUSOLVER_IRS_REFINE_GMRES = 1104,
621    /// Similar to [`cusolverIRSRefinement_t::CUSOLVER_IRS_REFINE_CLASSICAL_GMRES`] which consists of classical refinement process that uses GMRES to solve the inner correction system; here it is a GMRES (Generalized Minimal Residual) based iterative refinement solver that uses another GMRES internally to solve the preconditioned system.
622    CUSOLVER_IRS_REFINE_GMRES_GMRES = 1105,
623    CUSOLVER_IRS_REFINE_GMRES_NOPCOND = 1106,
624    CUSOLVER_PREC_DD = 1150,
625    CUSOLVER_PREC_SS = 1151,
626    CUSOLVER_PREC_SHT = 1152,
627}
628#[repr(u32)]
629#[derive(
630    Debug,
631    Copy,
632    Clone,
633    Hash,
634    PartialOrd,
635    Ord,
636    PartialEq,
637    Eq,
638    TryFromPrimitive,
639    IntoPrimitive,
640)]
641pub enum cusolverPrecType_t {
642    CUSOLVER_R_8I = 1201,
643    CUSOLVER_R_8U = 1202,
644    CUSOLVER_R_64F = 1203,
645    CUSOLVER_R_32F = 1204,
646    CUSOLVER_R_16F = 1205,
647    CUSOLVER_R_16BF = 1206,
648    CUSOLVER_R_TF32 = 1207,
649    CUSOLVER_R_AP = 1208,
650    CUSOLVER_C_8I = 1211,
651    CUSOLVER_C_8U = 1212,
652    CUSOLVER_C_64F = 1213,
653    CUSOLVER_C_32F = 1214,
654    CUSOLVER_C_16F = 1215,
655    CUSOLVER_C_16BF = 1216,
656    CUSOLVER_C_TF32 = 1217,
657    CUSOLVER_C_AP = 1218,
658}
659/// The [`cusolverAlgMode_t`] type indicates which algorithm is selected by [`cusolverDnSetAdvOptions`]. The set of algorithms supported for each routine is described in detail along with the routine’s documentation.
660///
661/// The default algorithm is [`cusolverAlgMode_t::CUSOLVER_ALG_0`]. The user can also provide `NULL` to use the default algorithm.
662#[repr(u32)]
663#[derive(
664    Debug,
665    Copy,
666    Clone,
667    Hash,
668    PartialOrd,
669    Ord,
670    PartialEq,
671    Eq,
672    TryFromPrimitive,
673    IntoPrimitive,
674)]
675pub enum cusolverAlgMode_t {
676    CUSOLVER_ALG_0 = 0,
677    CUSOLVER_ALG_1 = 1,
678    CUSOLVER_ALG_2 = 2,
679}
680/// Specifies how the vectors which define the elementary reflectors are stored.
681#[repr(u32)]
682#[derive(
683    Debug,
684    Copy,
685    Clone,
686    Hash,
687    PartialOrd,
688    Ord,
689    PartialEq,
690    Eq,
691    TryFromPrimitive,
692    IntoPrimitive,
693)]
694pub enum cusolverStorevMode_t {
695    /// Columnwise.
696    CUBLAS_STOREV_COLUMNWISE = 0,
697    /// Rowwise.
698    CUBLAS_STOREV_ROWWISE = 1,
699}
700/// Specifies the order in which the elementary reflectors are multiplied to form the block reflector.
701#[repr(u32)]
702#[derive(
703    Debug,
704    Copy,
705    Clone,
706    Hash,
707    PartialOrd,
708    Ord,
709    PartialEq,
710    Eq,
711    TryFromPrimitive,
712    IntoPrimitive,
713)]
714pub enum cusolverDirectMode_t {
715    /// Forward.
716    CUBLAS_DIRECT_FORWARD = 0,
717    /// Backward.
718    CUBLAS_DIRECT_BACKWARD = 1,
719}
720/// The [`cusolverDeterministicMode_t`] type indicates whether multiple cuSolver function executions with the same input have the same bitwise equal result (deterministic) or might have bitwise different results (non-deterministic). In comparison to [cublasAtomicsMode_t](https://docs.nvidia.com/cuda/cublas/#cublasatomicsmode-t), which only includes the usage of atomic functions, [`cusolverDeterministicMode_t`] includes all non-deterministic programming patterns. The deterministic mode can be set and queried using [`cusolverDnSetDeterministicMode`] and [`cusolverDnGetDeterministicMode`] routines, respectively.
721#[repr(u32)]
722#[derive(
723    Debug,
724    Copy,
725    Clone,
726    Hash,
727    PartialOrd,
728    Ord,
729    PartialEq,
730    Eq,
731    TryFromPrimitive,
732    IntoPrimitive,
733)]
734pub enum cusolverDeterministicMode_t {
735    /// Compute deterministic results.
736    CUSOLVER_DETERMINISTIC_RESULTS = 1,
737    /// Allow non-deterministic results.
738    CUSOLVER_ALLOW_NON_DETERMINISTIC_RESULTS = 2,
739}
740/// The [`cusolverMathMode_t`] type is used in [`cusolverDnSetMathMode`] to choose compute precision modes as defined in the following table:
741///
742/// The following combinations of [`cusolverMathMode_t`] using the bitwise OR operator are allowed:
743///
744/// * [`cusolverMathMode_t::CUSOLVER_FP32_FP64_EMULATED_MATH`] = [`cusolverMathMode_t::CUSOLVER_FP32_EMULATED_BF16X9_MATH`] | [`cusolverMathMode_t::CUSOLVER_FP64_EMULATED_FIXEDPOINT_MATH`].
745#[repr(u32)]
746#[derive(
747    Debug,
748    Copy,
749    Clone,
750    Hash,
751    PartialOrd,
752    Ord,
753    PartialEq,
754    Eq,
755    TryFromPrimitive,
756    IntoPrimitive,
757)]
758pub enum cusolverMathMode_t {
759    /// This is the default math mode. Tensor Cores will be used whenever possible.
760    CUSOLVER_DEFAULT_MATH = 1,
761    /// Use FP32 emulation according to the configured emulation strategy (see [`cusolverDnSetEmulationStrategy`]).
762    CUSOLVER_FP32_EMULATED_BF16X9_MATH = 2,
763    /// Use FP64 emulation according to the configured emulation strategy (see [`cusolverDnSetEmulationStrategy`]).
764    CUSOLVER_FP64_EMULATED_FIXEDPOINT_MATH = 4,
765    /// Combination of [`cusolverMathMode_t::CUSOLVER_FP32_EMULATED_BF16X9_MATH`] and [`cusolverMathMode_t::CUSOLVER_FP64_EMULATED_FIXEDPOINT_MATH`].
766    CUSOLVER_FP32_FP64_EMULATED_MATH = 6,
767}
768unsafe extern "C" {
769    pub fn cusolverGetProperty(
770        type_: libraryPropertyType,
771        value: *mut ::core::ffi::c_int,
772    ) -> cusolverStatus_t;
773}
774unsafe extern "C" {
775    pub fn cusolverGetVersion(version: *mut ::core::ffi::c_int) -> cusolverStatus_t;
776}
777unsafe extern "C" {
778    /// This function initializes the cuSolverDN library and creates a handle on the cuSolverDN context. It must be called before any other cuSolverDN API function is invoked. It allocates hardware resources necessary for accessing the GPU.
779    /// This function allocates 4 MiB or 32 MiB of memory (for GPUs with Compute Capability of 9.0 and higher), which will be used as the cuBLAS workspace for the first user-defined stream on which [`cusolverDnSetStream`] is called.
780    /// For the default stream and in all the other cases, cuBLAS will manage its own workspace.
781    ///
782    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The initialization succeeded.
783    ///
784    /// [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]:   The CUDA Runtime initialization failed.
785    ///
786    /// [`cusolverStatus_t::CUSOLVER_STATUS_ALLOC_FAILED`]:   The resources could not be allocated.
787    ///
788    /// [`cusolverStatus_t::CUSOLVER_STATUS_ARCH_MISMATCH`]:   The device only supports compute capability 5.0 and above.
789    ///
790    /// # Parameters
791    ///
792    /// - `handle`: The pointer to the handle to the cuSolverDN context.
793    ///
794    /// # Return value
795    ///
796    /// - [`cusolverStatus_t::CUSOLVER_STATUS_ALLOC_FAILED`]: The resources could not be allocated.
797    /// - [`cusolverStatus_t::CUSOLVER_STATUS_ARCH_MISMATCH`]: The device only supports compute capability 5.0 and above.
798    /// - [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]: The CUDA Runtime initialization failed.
799    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The initialization succeeded.
800    pub fn cusolverDnCreate(handle: *mut cusolverDnHandle_t) -> cusolverStatus_t;
801}
802unsafe extern "C" {
803    /// This function releases CPU-side resources used by the cuSolverDN library.
804    ///
805    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The shutdown succeeded.
806    ///
807    /// [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]:   The library was not initialized.
808    ///
809    /// # Parameters
810    ///
811    /// - `handle`: Handle to the cuSolverDN library context.
812    ///
813    /// # Return value
814    ///
815    /// - [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]: The library was not initialized.
816    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The shutdown succeeded.
817    pub fn cusolverDnDestroy(handle: cusolverDnHandle_t) -> cusolverStatus_t;
818}
819unsafe extern "C" {
820    /// This function sets the stream to be used by the cuSolverDN library to execute its routines.
821    ///
822    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The stream was set successfully.
823    ///
824    /// [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]:   The library was not initialized.
825    ///
826    /// # Parameters
827    ///
828    /// - `handle`: Handle to the cuSolverDN library context.
829    /// - `streamId`: The stream to be used by the library.
830    ///
831    /// # Return value
832    ///
833    /// - [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]: The library was not initialized.
834    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The stream was set successfully.
835    pub fn cusolverDnSetStream(
836        handle: cusolverDnHandle_t,
837        streamId: cudaStream_t,
838    ) -> cusolverStatus_t;
839}
840unsafe extern "C" {
841    /// This function queries the stream to be used by the cuSolverDN library to execute its routines.
842    ///
843    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The stream was set successfully.
844    ///
845    /// [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]:   The library was not initialized.
846    ///
847    /// # Parameters
848    ///
849    /// - `handle`: Handle to the cuSolverDN library context.
850    /// - `streamId`: The stream which is used by `handle`.
851    ///
852    /// # Return value
853    ///
854    /// - [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]: The library was not initialized.
855    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The stream was set successfully.
856    pub fn cusolverDnGetStream(
857        handle: cusolverDnHandle_t,
858        streamId: *mut cudaStream_t,
859    ) -> cusolverStatus_t;
860}
861unsafe extern "C" {
862    /// This function sets the deterministic mode of all cuSolverDN functions for `handle`. For improved performance,
863    /// non-deterministic results can be allowed. Affected functions are `cusolverDn<t>geqrf()`, `cusolverDn<t>syevd()`, `cusolverDn<t>syevdx()`, `cusolverDn<t>gesvd()` (if `m > n`), `cusolverDn<t>gesvdj()`, [`cusolverDnXgeqrf`], [`cusolverDnXsyevd`], [`cusolverDnXsyevdx`], [`cusolverDnXgesvd`] (if `m > n`), [`cusolverDnXgesvdr`] and [`cusolverDnXgesvdp`].
864    ///
865    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The modes were set successfully.
866    ///
867    /// [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]:   The library was not initialized.
868    ///
869    /// [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]:   An internal error occurred.
870    ///
871    /// # Parameters
872    ///
873    /// - `handle`: Handle to the cuSolverDN library context.
874    /// - `mode`: The deterministic mode to be used with `handle`.
875    ///
876    /// # Return value
877    ///
878    /// - [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]: An internal error occurred.
879    /// - [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]: The library was not initialized.
880    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The modes were set successfully.
881    pub fn cusolverDnSetDeterministicMode(
882        handle: cusolverDnHandle_t,
883        mode: cusolverDeterministicMode_t,
884    ) -> cusolverStatus_t;
885}
886unsafe extern "C" {
887    /// This function queries the deterministic mode which is set for `handle`.
888    ///
889    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The modes were queried successfully.
890    ///
891    /// [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]:   The library was not initialized.
892    ///
893    /// [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]:   `mode` is a `NULL` pointer.
894    ///
895    /// # Parameters
896    ///
897    /// - `handle`: Handle to the cuSolverDN library context.
898    /// - `mode`: The deterministic mode of `handle`.
899    ///
900    /// # Return value
901    ///
902    /// - [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]: `mode` is a `NULL` pointer.
903    /// - [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]: The library was not initialized.
904    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The modes were queried successfully.
905    pub fn cusolverDnGetDeterministicMode(
906        handle: cusolverDnHandle_t,
907        mode: *mut cusolverDeterministicMode_t,
908    ) -> cusolverStatus_t;
909}
910unsafe extern "C" {
911    /// This function sets the math modes of all cuSolverDN functions for `handle`. For more information about the effects of the corresponding math modes, please refer to [`cusolverMathMode_t`]. Note that math modes can be combined, e.g., `cusolverDnSetMathMode(handle, CUSOLVER_FP32_EMULATED_BF16X9_MATH | CUSOLVER_FP64_EMULATED_FIXEDPOINT_MATH)`. Please see [`cusolverMathMode_t`] for allowed combinations.
912    ///
913    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The mode was set successfully.
914    ///
915    /// [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]:   The library was not initialized.
916    ///
917    /// [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]:   An invalid mode was given.
918    ///
919    /// [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]:   An internal error occurred.
920    ///
921    /// # Parameters
922    ///
923    /// - `handle`: Handle to the cuSolverDN library context.
924    ///
925    /// # Return value
926    ///
927    /// - [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]: An internal error occurred.
928    /// - [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]: An invalid mode was given.
929    /// - [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]: The library was not initialized.
930    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The mode was set successfully.
931    pub fn cusolverDnSetMathMode(
932        handle: cusolverDnHandle_t,
933        mode: cusolverMathMode_t,
934    ) -> cusolverStatus_t;
935}
936unsafe extern "C" {
937    /// This function queries the math modes which are set for `handle`. Note that math modes can be combined, e.g., `cusolverDnSetMathMode(handle, CUSOLVER_FP32_EMULATED_BF16X9_MATH | CUSOLVER_FP64_EMULATED_FIXEDPOINT_MATH)`. Please see [`cusolverMathMode_t`] for allowed combinations.
938    ///
939    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The mode was set successfully.
940    ///
941    /// [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]:   The library was not initialized.
942    ///
943    /// [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]:   `modes` is a `NULL` pointer.
944    ///
945    /// # Parameters
946    ///
947    /// - `handle`: Handle to the cuSolverDN library context.
948    ///
949    /// # Return value
950    ///
951    /// - [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]: `modes` is a `NULL` pointer.
952    /// - [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]: The library was not initialized.
953    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The mode was set successfully.
954    pub fn cusolverDnGetMathMode(
955        handle: cusolverDnHandle_t,
956        mode: *mut cusolverMathMode_t,
957    ) -> cusolverStatus_t;
958}
959unsafe extern "C" {
960    /// This function sets the emulation strategy of all cuSolverDN functions for `handle`. For more information about the effects of the corresponding strategies, please refer to the analogous definition of [cublasEmulationStrategy_t](https://docs.nvidia.com/cuda/cublas/#cublasemulationstrategy-t).
961    ///
962    /// The emulation strategy set by this API only has an effect, **once** one of the following math modes is enabled (see also [`cusolverMathMode_t`]):
963    ///
964    /// * [`cusolverMathMode_t::CUSOLVER_FP32_EMULATED_BF16X9_MATH`]
965    /// * [`cusolverMathMode_t::CUSOLVER_FP64_EMULATED_FIXEDPOINT_MATH`]
966    /// * [`cusolverMathMode_t::CUSOLVER_FP32_FP64_EMULATED_MATH`]
967    ///
968    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The strategy was set successfully.
969    ///
970    /// [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]:   The library was not initialized.
971    ///
972    /// [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]:   strategy was not a supported emulation strategy
973    ///
974    /// [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]:   An internal error occurred.
975    ///
976    /// # Parameters
977    ///
978    /// - `handle`: Handle to the cuSolverDN library context.
979    /// - `strategy`: The emulation strategy to be used with `handle`.
980    ///
981    /// # Return value
982    ///
983    /// - [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]: An internal error occurred.
984    /// - [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]: strategy was not a supported emulation strategy.
985    /// - [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]: The library was not initialized.
986    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The strategy was set successfully.
987    pub fn cusolverDnSetEmulationStrategy(
988        handle: cusolverDnHandle_t,
989        strategy: cudaEmulationStrategy_t,
990    ) -> cusolverStatus_t;
991}
992unsafe extern "C" {
993    /// This function queries the emulation strategy which is set for `handle`.
994    ///
995    /// The emulation strategy returned by this API only has an effect, **once** one of the following math modes is enabled (see also [`cusolverMathMode_t`]):
996    ///
997    /// * [`cusolverMathMode_t::CUSOLVER_FP32_EMULATED_BF16X9_MATH`]
998    /// * [`cusolverMathMode_t::CUSOLVER_FP64_EMULATED_FIXEDPOINT_MATH`]
999    /// * [`cusolverMathMode_t::CUSOLVER_FP32_FP64_EMULATED_MATH`]
1000    ///
1001    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The strategy was queried successfully.
1002    ///
1003    /// [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]:   The library was not initialized.
1004    ///
1005    /// [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]:   `emulationStrategy` is a `NULL` pointer.
1006    ///
1007    /// # Parameters
1008    ///
1009    /// - `handle`: Handle to the cuSolverDN library context.
1010    /// - `strategy`: The emulation strategy of `handle`.
1011    ///
1012    /// # Return value
1013    ///
1014    /// - [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]: `emulationStrategy` is a `NULL` pointer.
1015    /// - [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]: The library was not initialized.
1016    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The strategy was queried successfully.
1017    pub fn cusolverDnGetEmulationStrategy(
1018        handle: cusolverDnHandle_t,
1019        strategy: *mut cudaEmulationStrategy_t,
1020    ) -> cusolverStatus_t;
1021}
1022unsafe extern "C" {
1023    /// This function sets how the number of mantissa bits is determined for fixed point FP64 emulation. For more information about the effects of the corresponding control modes, please refer to [cudaEmulationMantissaControl_t](https://docs.nvidia.com/cuda/cublas/#cudaemulationmantissacontrol-t).
1024    ///
1025    /// The mantissa control set by this API only has an effect, **once** one of the following math modes is enabled (see also [`cusolverMathMode_t`]):
1026    ///
1027    /// * [`cusolverMathMode_t::CUSOLVER_FP64_EMULATED_FIXEDPOINT_MATH`]
1028    /// * [`cusolverMathMode_t::CUSOLVER_FP32_FP64_EMULATED_MATH`]
1029    ///
1030    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The mantissa control was set successfully.
1031    ///
1032    /// [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]:   The library was not initialized.
1033    ///
1034    /// [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]:   `control` is not a valid `cudaEmulationMantissaControl_t` value.
1035    ///
1036    /// [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]:   An internal error occurred.
1037    ///
1038    /// # Parameters
1039    ///
1040    /// - `handle`: Handle to the cuSolverDN library context.
1041    /// - `control`: The mantissa control mode to be used with `handle`.
1042    ///
1043    /// # Return value
1044    ///
1045    /// - [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]: An internal error occurred.
1046    /// - [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]: `control` is not a valid `cudaEmulationMantissaControl_t` value.
1047    /// - [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]: The library was not initialized.
1048    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The mantissa control was set successfully.
1049    pub fn cusolverDnSetFixedPointEmulationMantissaControl(
1050        handle: cusolverDnHandle_t,
1051        control: cudaEmulationMantissaControl_t,
1052    ) -> cusolverStatus_t;
1053}
1054unsafe extern "C" {
1055    /// This function queries how the number of mantissa bits is determined for fixed point FP64 emulation.
1056    ///
1057    /// The mantissa control returned by this API only has an effect, **once** one of the following math modes is enabled (see also [`cusolverMathMode_t`]):
1058    ///
1059    /// * [`cusolverMathMode_t::CUSOLVER_FP64_EMULATED_FIXEDPOINT_MATH`]
1060    /// * [`cusolverMathMode_t::CUSOLVER_FP32_FP64_EMULATED_MATH`]
1061    ///
1062    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The mantissa control was queried successfully.
1063    ///
1064    /// [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]:   The library was not initialized.
1065    ///
1066    /// [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]:   `control` is a `NULL` pointer.
1067    ///
1068    /// # Parameters
1069    ///
1070    /// - `handle`: Handle to the cuSolverDN library context.
1071    /// - `control`: The mantissa control mode of `handle`.
1072    ///
1073    /// # Return value
1074    ///
1075    /// - [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]: `control` is a `NULL` pointer.
1076    /// - [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]: The library was not initialized.
1077    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The mantissa control was queried successfully.
1078    pub fn cusolverDnGetFixedPointEmulationMantissaControl(
1079        handle: cusolverDnHandle_t,
1080        control: *mut cudaEmulationMantissaControl_t,
1081    ) -> cusolverStatus_t;
1082}
1083unsafe extern "C" {
1084    /// This function sets the maximum number of mantissa bits for fixed point FP64 emulation.
1085    ///
1086    /// The maximum mantissa bit count set by this API only has an effect, **once** one of the following math modes is enabled (see also [`cusolverMathMode_t`]):
1087    ///
1088    /// * [`cusolverMathMode_t::CUSOLVER_FP64_EMULATED_FIXEDPOINT_MATH`]
1089    /// * [`cusolverMathMode_t::CUSOLVER_FP32_FP64_EMULATED_MATH`]
1090    ///
1091    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The mantissa bit count was set successfully.
1092    ///
1093    /// [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]:   The library was not initialized.
1094    ///
1095    /// [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]:   `mantissaBitCount` is less than `0`.
1096    ///
1097    /// [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]:   An internal error occurred.
1098    ///
1099    /// # Parameters
1100    ///
1101    /// - `handle`: Handle to the cuSolverDN library context.
1102    /// - `mantissaBitCount`: The number of mantissa bits to be used. Setting `mantissaBitCount = 0` resets to the default configuration as described in [cuBLAS defaults](https://docs.nvidia.com/cuda/cublas/#default-library-configurations).
1103    ///
1104    /// # Return value
1105    ///
1106    /// - [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]: An internal error occurred.
1107    /// - [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]: `mantissaBitCount` is less than `0`.
1108    /// - [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]: The library was not initialized.
1109    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The mantissa bit count was set successfully.
1110    pub fn cusolverDnSetFixedPointEmulationMaxMantissaBitCount(
1111        handle: cusolverDnHandle_t,
1112        mantissaBitCount: ::core::ffi::c_int,
1113    ) -> cusolverStatus_t;
1114}
1115unsafe extern "C" {
1116    /// This function queries the maximum number of mantissa bits used for fixed point FP64 emulation.
1117    ///
1118    /// The mantissa bit count returned by this API only has an effect, **once** one of the following math modes is enabled (see also [`cusolverMathMode_t`]):
1119    ///
1120    /// * [`cusolverMathMode_t::CUSOLVER_FP64_EMULATED_FIXEDPOINT_MATH`]
1121    /// * [`cusolverMathMode_t::CUSOLVER_FP32_FP64_EMULATED_MATH`]
1122    ///
1123    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The mantissa bit count was queried successfully.
1124    ///
1125    /// [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]:   The library was not initialized.
1126    ///
1127    /// [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]:   `mantissaBitCount` is a `NULL` pointer.
1128    ///
1129    /// # Parameters
1130    ///
1131    /// - `handle`: Handle to the cuSolverDN library context.
1132    /// - `mantissaBitCount`: The maximum number of mantissa bits used.
1133    ///
1134    /// # Return value
1135    ///
1136    /// - [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]: `mantissaBitCount` is a `NULL` pointer.
1137    /// - [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]: The library was not initialized.
1138    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The mantissa bit count was queried successfully.
1139    pub fn cusolverDnGetFixedPointEmulationMaxMantissaBitCount(
1140        handle: cusolverDnHandle_t,
1141        mantissaBitCount: *mut ::core::ffi::c_int,
1142    ) -> cusolverStatus_t;
1143}
1144unsafe extern "C" {
1145    /// This function sets the mantissa bit offset for fixed point FP64 emulation in case of dynamic mantissa control mode.
1146    ///
1147    /// The mantissa bit offset, which is set by this API only has an effect, **once** one of the following math modes is enabled (see also [`cusolverMathMode_t`]):
1148    ///
1149    /// * [`cusolverMathMode_t::CUSOLVER_FP64_EMULATED_FIXEDPOINT_MATH`]
1150    /// * [`cusolverMathMode_t::CUSOLVER_FP32_FP64_EMULATED_MATH`]
1151    ///
1152    /// **And** the following mantissa control is enabled (see also [`cusolverDnSetFixedPointEmulationMantissaControl`]):
1153    ///
1154    /// * `CUDA_EMULATION_MANTISSA_CONTROL_DYNAMIC`
1155    ///
1156    /// You may tune values for `mantissaBitOffset` based on your accuracy and performance requirements, e.g., choose negative values `-8`, `-16`, … for better performance while fewer mantissa bits may reduce accuracy.
1157    ///
1158    /// Please note that values of `mantissaBitOffset` which are unequal to zero require the mantissa control to be equal to `CUDA_EMULATION_MANTISSA_CONTROL_DYNAMIC`. Otherwise, the computational cuSOLVER routines will return [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`], indicating an unsupported handle state.
1159    ///
1160    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The mantissa bit offset was set successfully.
1161    ///
1162    /// [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]:   The library was not initialized.
1163    ///
1164    /// [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]:   An internal error occurred.
1165    ///
1166    /// # Parameters
1167    ///
1168    /// - `handle`: Handle to the cuSolverDN library context.
1169    /// - `mantissaBitOffset`: The mantissa bit offset (default = `0`) to be used when the mantissa control is `CUDA_EMULATION_MANTISSA_CONTROL_DYNAMIC`.
1170    ///
1171    /// # Return value
1172    ///
1173    /// - [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]: An internal error occurred.
1174    /// - [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]: The library was not initialized.
1175    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The mantissa bit offset was set successfully.
1176    pub fn cusolverDnSetFixedPointEmulationMantissaBitOffset(
1177        handle: cusolverDnHandle_t,
1178        mantissaBitOffset: ::core::ffi::c_int,
1179    ) -> cusolverStatus_t;
1180}
1181unsafe extern "C" {
1182    /// This function queries the mantissa bit offset for fixed point FP64 emulation in case of dynamic mantissa control mode.
1183    ///
1184    /// The mantissa bit offset, which is returned by this API only has an effect, **once** one of the following math modes is enabled (see also [`cusolverMathMode_t`]):
1185    ///
1186    /// * [`cusolverMathMode_t::CUSOLVER_FP64_EMULATED_FIXEDPOINT_MATH`]
1187    /// * [`cusolverMathMode_t::CUSOLVER_FP32_FP64_EMULATED_MATH`]
1188    ///
1189    /// **And** the following mantissa control is enabled (see also [`cusolverDnSetFixedPointEmulationMantissaControl`]):
1190    ///
1191    /// * `CUDA_EMULATION_MANTISSA_CONTROL_DYNAMIC`
1192    ///
1193    /// Please note that values of `mantissaBitOffset` which are unequal to zero require the mantissa control to be equal to `CUDA_EMULATION_MANTISSA_CONTROL_DYNAMIC`. Otherwise, the computational cuSOLVER routines will return [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`], indicating an unsupported handle state.
1194    ///
1195    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The mantissa bit offset was queried successfully.
1196    ///
1197    /// [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]:   The library was not initialized.
1198    ///
1199    /// [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]:   `mantissaBitOffset` is a `NULL` pointer.
1200    ///
1201    /// # Parameters
1202    ///
1203    /// - `handle`: Handle to the cuSolverDN library context.
1204    /// - `mantissaBitOffset`: The mantissa bit offset used when `CUDA_EMULATION_MANTISSA_CONTROL_DYNAMIC` is in use.
1205    ///
1206    /// # Return value
1207    ///
1208    /// - [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]: `mantissaBitOffset` is a `NULL` pointer.
1209    /// - [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]: The library was not initialized.
1210    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The mantissa bit offset was queried successfully.
1211    pub fn cusolverDnGetFixedPointEmulationMantissaBitOffset(
1212        handle: cusolverDnHandle_t,
1213        mantissaBitOffset: *mut ::core::ffi::c_int,
1214    ) -> cusolverStatus_t;
1215}
1216unsafe extern "C" {
1217    /// This function sets the handling of special floating point values for `handle`, which is used **once** floating point emulation is allowed.
1218    ///
1219    /// The special value support set by this API only has an effect, **once** one of the following math modes is enabled (see also [`cusolverMathMode_t`]):
1220    ///
1221    /// * [`cusolverMathMode_t::CUSOLVER_FP32_EMULATED_BF16X9_MATH`]
1222    /// * [`cusolverMathMode_t::CUSOLVER_FP64_EMULATED_FIXEDPOINT_MATH`]
1223    /// * [`cusolverMathMode_t::CUSOLVER_FP32_FP64_EMULATED_MATH`]
1224    ///
1225    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The special value support was set successfully.
1226    ///
1227    /// [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]:   The library was not initialized.
1228    ///
1229    /// [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]:   An internal error occurred.
1230    ///
1231    /// # Parameters
1232    ///
1233    /// - `handle`: Handle to the cuSolverDN library context.
1234    /// - `mask`: If set to `CUDA_EMULATION_SPECIAL_VALUE_SUPPORT_DEFAULT`, values are propagated as expected. Performance of floating point emulated math may improve if set to `CUDA_EMULATION_SPECIAL_VALUES_SUPPORT_NONE` for which the propagation of special values is undefined.
1235    ///
1236    /// # Return value
1237    ///
1238    /// - [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]: An internal error occurred.
1239    /// - [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]: The library was not initialized.
1240    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The special value support was set successfully.
1241    pub fn cusolverDnSetEmulationSpecialValuesSupport(
1242        handle: cusolverDnHandle_t,
1243        mask: cudaEmulationSpecialValuesSupport_t,
1244    ) -> cusolverStatus_t;
1245}
1246unsafe extern "C" {
1247    /// This function queries the special floating point value support which is set for `handle` if floating point emulation is allowed.
1248    ///
1249    /// The special floating point value support returned by this API only has an effect, **once** one of the following math modes is enabled (see also [`cusolverMathMode_t`]):
1250    ///
1251    /// * [`cusolverMathMode_t::CUSOLVER_FP32_EMULATED_BF16X9_MATH`]
1252    /// * [`cusolverMathMode_t::CUSOLVER_FP64_EMULATED_FIXEDPOINT_MATH`]
1253    /// * [`cusolverMathMode_t::CUSOLVER_FP32_FP64_EMULATED_MATH`]
1254    ///
1255    /// Otherwise, special floating point values are handled as expected.
1256    ///
1257    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The special value handling was queried successfully.
1258    ///
1259    /// [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]:   The library was not initialized.
1260    ///
1261    /// [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]:   `mask` is a `NULL` pointer.
1262    ///
1263    /// # Parameters
1264    ///
1265    /// - `handle`: Handle to the cuSolverDN library context.
1266    /// - `mask`: The special value support of `handle`. Please see [cudaEmulationSpecialValuesSupport_t](https://docs.nvidia.com/cuda/cublas/#cudaemulationspecialvaluessupport-t) for more information about the allowed values of `mask`.
1267    ///
1268    /// # Return value
1269    ///
1270    /// - [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]: `mask` is a `NULL` pointer.
1271    /// - [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]: The library was not initialized.
1272    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The special value handling was queried successfully.
1273    pub fn cusolverDnGetEmulationSpecialValuesSupport(
1274        handle: cusolverDnHandle_t,
1275        mask: *mut cudaEmulationSpecialValuesSupport_t,
1276    ) -> cusolverStatus_t;
1277}
1278unsafe extern "C" {
1279    /// This function creates and initializes the structure of parameters for an IRS solver such as the [`cusolverDnIRSXgesv`] or the [`cusolverDnIRSXgels`] functions to default values. The params structure created by this function can be used by one or more call to the same or to a different IRS solver. Note that in CUDA 10.2, the behavior was different and a new `params` structure was needed to be created per each call to an IRS solver. Also note that the user can also change configurations of the params and then call a new IRS instance, but be careful that the previous call was done because any change to the configuration before the previous call was done could affect it.
1280    ///
1281    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The structure was created and initialized successfully.
1282    ///
1283    /// [`cusolverStatus_t::CUSOLVER_STATUS_ALLOC_FAILED`]:   The resources could not be allocated.
1284    ///
1285    /// # Return value
1286    ///
1287    /// - [`cusolverStatus_t::CUSOLVER_STATUS_ALLOC_FAILED`]: The resources could not be allocated.
1288    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The structure was created and initialized successfully.
1289    pub fn cusolverDnIRSParamsCreate(
1290        params_ptr: *mut cusolverDnIRSParams_t,
1291    ) -> cusolverStatus_t;
1292}
1293unsafe extern "C" {
1294    /// This function destroys and releases any memory required by the Params structure.
1295    ///
1296    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The resources were released successfully.
1297    ///
1298    /// [`cusolverStatus_t::CUSOLVER_STATUS_IRS_PARAMS_NOT_INITIALIZED`]:   The `Params` structure was not created.
1299    ///
1300    /// [`cusolverStatus_t::CUSOLVER_STATUS_IRS_INFOS_NOT_DESTROYED`]:   Not all the `Infos` structure associated with this `Params` structure have been destroyed yet.
1301    ///
1302    /// # Parameters
1303    ///
1304    /// - `params`: The `cusolverDnIRSParams_t Params` structure.
1305    ///
1306    /// # Return value
1307    ///
1308    /// - [`cusolverStatus_t::CUSOLVER_STATUS_IRS_INFOS_NOT_DESTROYED`]: Not all the `Infos` structure associated with this `Params` structure have been destroyed yet.
1309    /// - [`cusolverStatus_t::CUSOLVER_STATUS_IRS_PARAMS_NOT_INITIALIZED`]: The `Params` structure was not created.
1310    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The resources were released successfully.
1311    pub fn cusolverDnIRSParamsDestroy(params: cusolverDnIRSParams_t) -> cusolverStatus_t;
1312}
1313unsafe extern "C" {
1314    /// This function sets the refinement solver to be used in the Iterative Refinement Solver functions such as the [`cusolverDnIRSXgesv`] or the [`cusolverDnIRSXgels`] functions. Note that the user has to set the refinement algorithm before a first call to the IRS solver because it is NOT set by default with the creating of params. Details about values that can be set to and theirs meaning are described in the table below.
1315    ///
1316    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The operation completed successfully.
1317    ///
1318    /// [`cusolverStatus_t::CUSOLVER_STATUS_IRS_PARAMS_NOT_INITIALIZED`]:   The `Params` structure was not created.
1319    ///
1320    /// [`cusolverIRSRefinement_t::CUSOLVER_IRS_REFINE_NOT_SET`]:   Solver is not set, this value is what is set when creating the params structure. IRS solver will return an error.
1321    ///
1322    /// [`cusolverIRSRefinement_t::CUSOLVER_IRS_REFINE_NONE`]:   No refinement solver; the IRS solver performs a factorization followed by a solve without any refinement. For example, if the IRS solver was [`cusolverDnIRSXgesv`], this is equivalent to a Xgesv routine without refinement and where the factorization is carried out in the lowest precision. If for example the main precision was CUSOLVER_R_64F and the lowest was CUSOLVER_R_64F as well, then this is equivalent to a call to `cusolverDnDgesv()`.
1323    ///
1324    /// [`cusolverIRSRefinement_t::CUSOLVER_IRS_REFINE_CLASSICAL`]:   Classical iterative refinement solver. Similar to the one used in LAPACK routines.
1325    ///
1326    /// [`cusolverIRSRefinement_t::CUSOLVER_IRS_REFINE_GMRES`]:   GMRES (Generalized Minimal Residual) based iterative refinement solver. In recent study, the GMRES method has drawn the scientific community attention for its ability to be used as refinement solver that outperforms the classical iterative refinement method. Based on our experimentation, we recommend this setting.
1327    ///
1328    /// [`cusolverIRSRefinement_t::CUSOLVER_IRS_REFINE_CLASSICAL_GMRES`]:   Classical iterative refinement solver that uses the GMRES (Generalized Minimal Residual) internally to solve the correction equation at each iteration. We call the *classical refinement iteration* the outer iteration while the *GMRES* is called inner iteration. Note that if the tolerance of the inner GMRES is set very low, let say to machine precision, then the outer *classical refinement iteration* will performs only one iteration and thus this option will behaves like [`cusolverIRSRefinement_t::CUSOLVER_IRS_REFINE_GMRES`].
1329    ///
1330    /// [`cusolverIRSRefinement_t::CUSOLVER_IRS_REFINE_GMRES_GMRES`]:   Similar to [`cusolverIRSRefinement_t::CUSOLVER_IRS_REFINE_CLASSICAL_GMRES`] which consists of classical refinement process that uses GMRES to solve the inner correction system, here it is a GMRES (Generalized Minimal Residual) based iterative refinement solver that uses another GMRES internally to solve the preconditioned system.
1331    ///
1332    /// # Parameters
1333    ///
1334    /// - `params`: The [`cusolverDnIRSParams_t`]`Params` structure.
1335    ///
1336    /// # Return value
1337    ///
1338    /// - [`cusolverStatus_t::CUSOLVER_IRS_REFINE_CLASSICAL`]: Classical iterative refinement solver. Similar to the one used in LAPACK routines.
1339    /// - [`cusolverStatus_t::CUSOLVER_IRS_REFINE_CLASSICAL_GMRES`]: Classical iterative refinement solver that uses the GMRES (Generalized Minimal Residual) internally to solve the correction equation at each iteration. We call the *classical refinement iteration* the outer iteration while the *GMRES* is called inner iteration. Note that if the tolerance of the inner GMRES is set very low, let say to machine precision, then the outer *classical refinement iteration* will performs only one iteration and thus this option will behaves like [`cusolverIRSRefinement_t::CUSOLVER_IRS_REFINE_GMRES`].
1340    /// - [`cusolverStatus_t::CUSOLVER_IRS_REFINE_GMRES`]: GMRES (Generalized Minimal Residual) based iterative refinement solver. In recent study, the GMRES method has drawn the scientific community attention for its ability to be used as refinement solver that outperforms the classical iterative refinement method. Based on our experimentation, we recommend this setting.
1341    /// - [`cusolverStatus_t::CUSOLVER_IRS_REFINE_GMRES_GMRES`]: Similar to [`cusolverIRSRefinement_t::CUSOLVER_IRS_REFINE_CLASSICAL_GMRES`] which consists of classical refinement process that uses GMRES to solve the inner correction system, here it is a GMRES (Generalized Minimal Residual) based iterative refinement solver that uses another GMRES internally to solve the preconditioned system.
1342    /// - [`cusolverStatus_t::CUSOLVER_IRS_REFINE_NONE`]: No refinement solver; the IRS solver performs a factorization followed by a solve without any refinement. For example, if the IRS solver was [`cusolverDnIRSXgesv`], this is equivalent to a Xgesv routine without refinement and where the factorization is carried out in the lowest precision. If for example the main precision was CUSOLVER_R_64F and the lowest was CUSOLVER_R_64F as well, then this is equivalent to a call to `cusolverDnDgesv()`.
1343    /// - [`cusolverStatus_t::CUSOLVER_IRS_REFINE_NOT_SET`]: Solver is not set, this value is what is set when creating the params structure. IRS solver will return an error.
1344    /// - [`cusolverStatus_t::CUSOLVER_STATUS_IRS_PARAMS_NOT_INITIALIZED`]: The `Params` structure was not created.
1345    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The operation completed successfully.
1346    pub fn cusolverDnIRSParamsSetRefinementSolver(
1347        params: cusolverDnIRSParams_t,
1348        refinement_solver: cusolverIRSRefinement_t,
1349    ) -> cusolverStatus_t;
1350}
1351unsafe extern "C" {
1352    /// This function sets the main precision for the Iterative Refinement Solver (IRS). By main precision, we mean, the type of the Input and Output data. Note that the user has to set both the main and lowest precision before a first call to the IRS solver because they are NOT set by default with the `params` structure creation, as it depends on the Input Output data type and user request. user can set it by either calling this function or by calling [`cusolverDnIRSParamsSetSolverPrecisions`] which set both the main and the lowest precision together. All possible combinations of main/lowest precision are described in the table in the [`cusolverDnIRSParamsSetSolverPrecisions`] section above.
1353    ///
1354    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The operation completed successfully.
1355    ///
1356    /// [`cusolverStatus_t::CUSOLVER_STATUS_IRS_PARAMS_NOT_INITIALIZED`]:   The `Params` structure was not created.
1357    ///
1358    /// # Parameters
1359    ///
1360    /// - `params`: The `cusolverDnIRSParams_t Params` structure.
1361    /// - `solver_main_precision`: Allowed Inputs/Outputs datatype (for example CUSOLVER_R_FP64 for a real double precision data). See the table in the [`cusolverDnIRSParamsSetSolverPrecisions`] section above for the supported precisions.
1362    ///
1363    /// # Return value
1364    ///
1365    /// - [`cusolverStatus_t::CUSOLVER_STATUS_IRS_PARAMS_NOT_INITIALIZED`]: The `Params` structure was not created.
1366    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The operation completed successfully.
1367    pub fn cusolverDnIRSParamsSetSolverMainPrecision(
1368        params: cusolverDnIRSParams_t,
1369        solver_main_precision: cusolverPrecType_t,
1370    ) -> cusolverStatus_t;
1371}
1372unsafe extern "C" {
1373    /// This function sets the lowest precision that will be used by Iterative Refinement Solver. By lowest precision, we mean the solver is allowed to use as lowest computational precision during the LU factorization process. Note that the user has to set both the main and lowest precision before a first call to the IRS solver because they are NOT set by default with the `params` structure creation, as it depends on the Input Output data type and user request. Usually the lowest precision defines the speedup that can be achieved. The ratio of the performance of the lowest precision over the main precision (e.g., Inputs/Outputs datatype) define somehow the upper bound of the speedup that could be obtained. More precisely, it depends on many factors, but for large matrices sizes, it is the ratio of the matrix-matrix rank-k product (e.g., GEMM where K is 256 and M=N=size of the matrix) that define the possible speedup. For instance, if the inout precision is real double precision CUSOLVER_R_64F and the lowest precision is CUSOLVER_R_32F, then we can expect a speedup of at most 2X for large problem sizes. If the lowest precision was CUSOLVER_R_16F, then we can expect 3X-4X. A reasonable strategy should take the number of right-hand sides, the size of the matrix as well as the convergence rate into account.
1374    ///
1375    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The operation completed successfully.
1376    ///
1377    /// [`cusolverStatus_t::CUSOLVER_STATUS_IRS_PARAMS_NOT_INITIALIZED`]:   The Params structure was not created.
1378    ///
1379    /// # Parameters
1380    ///
1381    /// - `params`: The `cusolverDnIRSParams_t Params` structure.
1382    ///
1383    /// # Return value
1384    ///
1385    /// - [`cusolverStatus_t::CUSOLVER_STATUS_IRS_PARAMS_NOT_INITIALIZED`]: The Params structure was not created.
1386    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The operation completed successfully.
1387    pub fn cusolverDnIRSParamsSetSolverLowestPrecision(
1388        params: cusolverDnIRSParams_t,
1389        solver_lowest_precision: cusolverPrecType_t,
1390    ) -> cusolverStatus_t;
1391}
1392unsafe extern "C" {
1393    /// This function sets both the main and the lowest precision for the Iterative Refinement Solver (IRS). By main precision, we mean the precision of the Input and Output datatype. By lowest precision, we mean the solver is allowed to use as lowest computational precision during the LU factorization process. Note that the user has to set both the main and lowest precision before the first call to the IRS solver because they are NOT set by default with the `params` structure creation, as it depends on the Input Output data type and user request. It is a wrapper to both [`cusolverDnIRSParamsSetSolverMainPrecision`] and [`cusolverDnIRSParamsSetSolverLowestPrecision`]. All possible combinations of main/lowest precision are described in the table below. Usually the lowest precision defines the speedup that can be achieved. The ratio of the performance of the lowest precision over the main precision (e.g., Inputs/Outputs datatype) define the upper bound of the speedup that could be obtained. More precisely, it depends on many factors, but for large matrices sizes, it is the ratio of the matrix-matrix rank-k product (e.g., GEMM where K is 256 and M=N=size of the matrix) that define the possible speedup. For instance, if the inout precision is real double precision CUSOLVER_R_64F and the lowest precision is CUSOLVER_R_32F, then we can expect a speedup of at most 2X for large problem sizes. If the lowest precision was CUSOLVER_R_16F, then we can expect 3X-4X. A reasonable strategy should take the number of right-hand sides, the size of the matrix as well as the convergence rate into account.
1394    ///
1395    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The operation completed successfully.
1396    ///
1397    /// [`cusolverStatus_t::CUSOLVER_STATUS_IRS_PARAMS_NOT_INITIALIZED`]:   The `Params` structure was not created.
1398    ///
1399    /// **Supported Inputs/Outputs data type and lower precision for the IRS solver**
1400    ///
1401    /// | **Inputs/Outputs Data Type (e.g., main precision)** | **Supported values for the lowest precision** |
1402    /// | --- | --- |
1403    /// | [`cusolverPrecType_t::CUSOLVER_C_64F`] | `CUSOLVER_C_64F, CUSOLVER_C_32F, CUSOLVER_C_16F, CUSOLVER_C_16BF, CUSOLVER_C_TF32` |
1404    /// | [`cusolverPrecType_t::CUSOLVER_C_32F`] | `CUSOLVER_C_32F, CUSOLVER_C_16F, CUSOLVER_C_16BF, CUSOLVER_C_TF32` |
1405    /// | [`cusolverPrecType_t::CUSOLVER_R_64F`] | `CUSOLVER_R_64F, CUSOLVER_R_32F, CUSOLVER_R_16F, CUSOLVER_R_16BF, CUSOLVER_R_TF32` |
1406    /// | [`cusolverPrecType_t::CUSOLVER_R_32F`] | `CUSOLVER_R_32F, CUSOLVER_R_16F, CUSOLVER_R_16BF, CUSOLVER_R_TF32` |
1407    ///
1408    /// # Parameters
1409    ///
1410    /// - `params`: The `cusolverDnIRSParams_t Params` structure.
1411    /// - `solver_main_precision`: Allowed Inputs/Outputs datatype (for example CUSOLVER_R_FP64 for a real double precision data). See the table below for the supported precisions.
1412    /// - `solver_lowest_precision`: Allowed lowest compute type (for example CUSOLVER_R_16F for half precision computation). See the table below for the supported precisions.
1413    ///
1414    /// # Return value
1415    ///
1416    /// - [`cusolverStatus_t::CUSOLVER_STATUS_IRS_PARAMS_NOT_INITIALIZED`]: The `Params` structure was not created.
1417    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The operation completed successfully.
1418    pub fn cusolverDnIRSParamsSetSolverPrecisions(
1419        params: cusolverDnIRSParams_t,
1420        solver_main_precision: cusolverPrecType_t,
1421        solver_lowest_precision: cusolverPrecType_t,
1422    ) -> cusolverStatus_t;
1423}
1424unsafe extern "C" {
1425    /// This function sets the tolerance for the refinement solver. By default it is such that all the RHS satisfy:
1426    ///
1427    /// `RNRM < SQRT(N)*XNRM*ANRM*EPS*BWDMAX` where
1428    ///
1429    /// * RNRM is the infinity-norm of the residual
1430    /// * XNRM is the infinity-norm of the solution
1431    /// * ANRM is the infinity-operator-norm of the matrix A
1432    /// * EPS is the machine epsilon for the Inputs/Outputs datatype that matches LAPACK <X>LAMCH(‘Epsilon’)
1433    /// * BWDMAX, the value BWDMAX is fixed to 1.0
1434    ///
1435    /// The user can use this function to change the tolerance to a lower or higher value. Our goal is to give the user more control such a way he can investigate and control every detail of the IRS solver. Note that the tolerance value is always in *real double precision* whatever the Inputs/Outputs datatype is.
1436    ///
1437    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The operation completed successfully.
1438    ///
1439    /// [`cusolverStatus_t::CUSOLVER_STATUS_IRS_PARAMS_NOT_INITIALIZED`]:   The `Params` structure was not created.
1440    ///
1441    /// # Parameters
1442    ///
1443    /// - `params`: The `cusolverDnIRSParams_t Params` structure.
1444    /// - `val`: Double precision real value to which the refinement tolerance will be set.
1445    ///
1446    /// # Return value
1447    ///
1448    /// - [`cusolverStatus_t::CUSOLVER_STATUS_IRS_PARAMS_NOT_INITIALIZED`]: The `Params` structure was not created.
1449    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The operation completed successfully.
1450    pub fn cusolverDnIRSParamsSetTol(
1451        params: cusolverDnIRSParams_t,
1452        val: f64,
1453    ) -> cusolverStatus_t;
1454}
1455unsafe extern "C" {
1456    /// This function sets the tolerance for the inner refinement solver when the refinement solver consists of two-levels solver (for example, [`cusolverIRSRefinement_t::CUSOLVER_IRS_REFINE_CLASSICAL_GMRES`] or [`cusolverIRSRefinement_t::CUSOLVER_IRS_REFINE_GMRES_GMRES`] cases). It is not referenced in case of one level refinement solver such as [`cusolverIRSRefinement_t::CUSOLVER_IRS_REFINE_CLASSICAL`] or [`cusolverIRSRefinement_t::CUSOLVER_IRS_REFINE_GMRES`]. It is set to 1e-4 by default. This function set the tolerance for the inner solver (e.g. the inner GMRES). For example, if the Refinement Solver was set to [`cusolverIRSRefinement_t::CUSOLVER_IRS_REFINE_CLASSICAL_GMRES`], setting this tolerance mean that the inner GMRES solver will converge to that tolerance at each outer iteration of the classical refinement solver. Our goal is to give the user more control such a way he can investigate and control every detail of the IRS solver. Note the, the tolerance value is always in *real double precision* whatever the Inputs/Outputs datatype is.
1457    ///
1458    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The operation completed successfully.
1459    ///
1460    /// [`cusolverStatus_t::CUSOLVER_STATUS_IRS_PARAMS_NOT_INITIALIZED`]:   The `Params` structure was not created.
1461    ///
1462    /// # Parameters
1463    ///
1464    /// - `params`: The `cusolverDnIRSParams_t Params` structure.
1465    /// - `val`: Double precision real value to which the tolerance of the inner refinement solver will be set.
1466    ///
1467    /// # Return value
1468    ///
1469    /// - [`cusolverStatus_t::CUSOLVER_STATUS_IRS_PARAMS_NOT_INITIALIZED`]: The `Params` structure was not created.
1470    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The operation completed successfully.
1471    pub fn cusolverDnIRSParamsSetTolInner(
1472        params: cusolverDnIRSParams_t,
1473        val: f64,
1474    ) -> cusolverStatus_t;
1475}
1476unsafe extern "C" {
1477    /// This function sets the total number of allowed refinement iterations after which the solver will stop. Total means any iteration which means the sum of the outer and the inner iterations (inner is meaningful when two-levels refinement solver is set). Default value is set to 50. Our goal is to give the user more control such a way he can investigate and control every detail of the IRS solver.
1478    ///
1479    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The operation completed successfully.
1480    ///
1481    /// [`cusolverStatus_t::CUSOLVER_STATUS_IRS_PARAMS_NOT_INITIALIZED`]:   The `Params` structure was not created.
1482    ///
1483    /// # Parameters
1484    ///
1485    /// - `params`: The `cusolverDnIRSParams_t Params` structure.
1486    ///
1487    /// # Return value
1488    ///
1489    /// - [`cusolverStatus_t::CUSOLVER_STATUS_IRS_PARAMS_NOT_INITIALIZED`]: The `Params` structure was not created.
1490    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The operation completed successfully.
1491    pub fn cusolverDnIRSParamsSetMaxIters(
1492        params: cusolverDnIRSParams_t,
1493        maxiters: cusolver_int_t,
1494    ) -> cusolverStatus_t;
1495}
1496unsafe extern "C" {
1497    /// This function sets the maximal number of iterations allowed for the inner refinement solver. It is not referenced in case of one level refinement solver such as [`cusolverIRSRefinement_t::CUSOLVER_IRS_REFINE_CLASSICAL`] or [`cusolverIRSRefinement_t::CUSOLVER_IRS_REFINE_GMRES`]. The inner refinement solver will stop after reaching either the inner tolerance or the MaxItersInner value. By default, it is set to 50. Note that this value could not be larger than the MaxIters since MaxIters is the total number of allowed iterations. Note that if the user calls [`cusolverDnIRSParamsSetMaxIters`] after calling this function, `SetMaxIters` has priority and will overwrite `MaxItersInner` to the minimum value of `(MaxIters, MaxItersInner)`.
1498    ///
1499    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The operation completed successfully.
1500    ///
1501    /// [`cusolverStatus_t::CUSOLVER_STATUS_IRS_PARAMS_NOT_INITIALIZED`]:   The `Params` structure was not created.
1502    ///
1503    /// [`cusolverStatus_t::CUSOLVER_STATUS_IRS_PARAMS_INVALID`]:   If the value was larger than `MaxIters`.
1504    ///
1505    /// # Parameters
1506    ///
1507    /// - `params`: The `cusolverDnIRSParams_t Params` structure.
1508    /// - `maxiters_inner`: Maximum number of allowed inner iterations for the inner refinement solver. Meaningful when the refinement solver is a two-levels solver such as [`cusolverIRSRefinement_t::CUSOLVER_IRS_REFINE_CLASSICAL_GMRES`] or [`cusolverIRSRefinement_t::CUSOLVER_IRS_REFINE_GMRES_GMRES`]. Value should be less or equal to `MaxIters`.
1509    ///
1510    /// # Return value
1511    ///
1512    /// - [`cusolverStatus_t::CUSOLVER_STATUS_IRS_PARAMS_INVALID`]: If the value was larger than `MaxIters`.
1513    /// - [`cusolverStatus_t::CUSOLVER_STATUS_IRS_PARAMS_NOT_INITIALIZED`]: The `Params` structure was not created.
1514    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The operation completed successfully.
1515    pub fn cusolverDnIRSParamsSetMaxItersInner(
1516        params: cusolverDnIRSParams_t,
1517        maxiters_inner: cusolver_int_t,
1518    ) -> cusolverStatus_t;
1519}
1520unsafe extern "C" {
1521    /// This function returns the current setting in the `params` structure for the maximal allowed number of iterations (for example, either the default `MaxIters`, or the one set by the user in case he set it using [`cusolverDnIRSParamsSetMaxIters`]). Note that this function returns the current setting in the `params` configuration and not to be confused with the [`cusolverDnIRSInfosGetMaxIters`] which return the maximal allowed number of iterations for a particular call to an IRS solver. To be clearer, the `params` structure can be used for many calls to an IRS solver. A user can change the allowed `MaxIters` between calls while the `Infos` structure in [`cusolverDnIRSInfosGetMaxIters`] contains information about a particular call and cannot be reused for different calls, and thus, [`cusolverDnIRSInfosGetMaxIters`] returns the allowed `MaxIters` for that call.
1522    ///
1523    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The operation completed successfully.
1524    ///
1525    /// [`cusolverStatus_t::CUSOLVER_STATUS_IRS_PARAMS_NOT_INITIALIZED`]:   The `Params` structure was not created.
1526    ///
1527    /// # Parameters
1528    ///
1529    /// - `params`: The `cusolverDnIRSParams_t Params` structure.
1530    /// - `maxiters`: The maximal number of iterations that is currently set.
1531    ///
1532    /// # Return value
1533    ///
1534    /// - [`cusolverStatus_t::CUSOLVER_STATUS_IRS_PARAMS_NOT_INITIALIZED`]: The `Params` structure was not created.
1535    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The operation completed successfully.
1536    pub fn cusolverDnIRSParamsGetMaxIters(
1537        params: cusolverDnIRSParams_t,
1538        maxiters: *mut cusolver_int_t,
1539    ) -> cusolverStatus_t;
1540}
1541unsafe extern "C" {
1542    /// This function enable the fallback to the main precision in case the Iterative Refinement Solver (IRS) failed to converge. In other term, if the IRS solver failed to converge, the solver will return a no convergence code (e.g., `niter` < 0), but can either return the non-convergent solution as it is (e.g., disable fallback) or can fallback (e.g., enable fallback) to the main precision (which is the precision of the Inputs/Outputs data) and solve the problem from scratch returning the good solution. This is the behavior by default, and it will guarantee that the IRS solver always provide the good solution. This function is provided because we provided [`cusolverDnIRSParamsDisableFallback`] which allows the user to disable the fallback and thus this function allow the user to re-enable it.
1543    ///
1544    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The operation completed successfully.
1545    ///
1546    /// [`cusolverStatus_t::CUSOLVER_STATUS_IRS_PARAMS_NOT_INITIALIZED`]:   The `Params` structure was not created.
1547    ///
1548    /// # Parameters
1549    ///
1550    /// - `params`: The `cusolverDnIRSParams_t Params` structure.
1551    ///
1552    /// # Return value
1553    ///
1554    /// - [`cusolverStatus_t::CUSOLVER_STATUS_IRS_PARAMS_NOT_INITIALIZED`]: The `Params` structure was not created.
1555    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The operation completed successfully.
1556    pub fn cusolverDnIRSParamsEnableFallback(
1557        params: cusolverDnIRSParams_t,
1558    ) -> cusolverStatus_t;
1559}
1560unsafe extern "C" {
1561    /// This function disables the fallback to the main precision in case the Iterative Refinement Solver (IRS) failed to converge. In other term, if the IRS solver failed to converge, the solver will return a no convergence code (e.g., `niter` < 0), but can either return the non-convergent solution as it is (e.g., disable fallback) or can fallback (e.g., enable fallback) to the main precision (which is the precision of the Inputs/Outputs data) and solve the problem from scratch returning the good solution. This function disables the fallback and the returned solution is whatever the refinement solver was able to reach before it returns. Disabling fallback does not guarantee that the solution is the good one. However, if users want to keep getting the solution of the lower precision in case the IRS did not converge after certain number of iterations, they need to disable the fallback. The user can re-enable it by calling [`cusolverDnIRSParamsEnableFallback`].
1562    ///
1563    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The operation completed successfully.
1564    ///
1565    /// [`cusolverStatus_t::CUSOLVER_STATUS_IRS_PARAMS_NOT_INITIALIZED`]:   The `Params` structure was not created.
1566    ///
1567    /// # Parameters
1568    ///
1569    /// - `params`: The `cusolverDnIRSParams_t Params` structure.
1570    ///
1571    /// # Return value
1572    ///
1573    /// - [`cusolverStatus_t::CUSOLVER_STATUS_IRS_PARAMS_NOT_INITIALIZED`]: The `Params` structure was not created.
1574    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The operation completed successfully.
1575    pub fn cusolverDnIRSParamsDisableFallback(
1576        params: cusolverDnIRSParams_t,
1577    ) -> cusolverStatus_t;
1578}
1579unsafe extern "C" {
1580    /// This function destroys and releases any memory required by the `Infos` structure. This function destroys all the information (for example, Niters performed, OuterNiters performed, residual history etc.) about a solver call; thus, this function should only be called after the user is finished with the information.
1581    ///
1582    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The resources were released successfully.
1583    ///
1584    /// [`cusolverStatus_t::CUSOLVER_STATUS_IRS_INFOS_NOT_INITIALIZED`]:   The `Infos` structure was not created.
1585    ///
1586    /// # Return value
1587    ///
1588    /// - [`cusolverStatus_t::CUSOLVER_STATUS_IRS_INFOS_NOT_INITIALIZED`]: The `Infos` structure was not created.
1589    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The resources were released successfully.
1590    pub fn cusolverDnIRSInfosDestroy(infos: cusolverDnIRSInfos_t) -> cusolverStatus_t;
1591}
1592unsafe extern "C" {
1593    /// This function creates and initializes the `Infos` structure that will hold the refinement information of an Iterative Refinement Solver (IRS) call. Such information includes the total number of iterations that was needed to converge (`Niters`), the outer number of iterations (meaningful when two-levels preconditioner such as [`cusolverIRSRefinement_t::CUSOLVER_IRS_REFINE_CLASSICAL_GMRES`] is used ), the maximal number of iterations that was allowed for that call, and a pointer to the matrix of the convergence history residual norms. The `Infos` structure needs to be created before a call to an IRS solver. The `Infos` structure is valid for only one call to an IRS solver, since it holds info about that solve and thus each solve will requires its own `Infos` structure.
1594    ///
1595    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The structure was initialized successfully.
1596    ///
1597    /// [`cusolverStatus_t::CUSOLVER_STATUS_ALLOC_FAILED`]:   The resources could not be allocated.
1598    ///
1599    /// # Return value
1600    ///
1601    /// - [`cusolverStatus_t::CUSOLVER_STATUS_ALLOC_FAILED`]: The resources could not be allocated.
1602    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The structure was initialized successfully.
1603    pub fn cusolverDnIRSInfosCreate(
1604        infos_ptr: *mut cusolverDnIRSInfos_t,
1605    ) -> cusolverStatus_t;
1606}
1607unsafe extern "C" {
1608    /// This function returns the total number of iterations performed by the IRS solver. If it was negative, it means that the IRS solver did not converge and if the user did not disable the fallback to full precision, then the fallback to a full precision solution happened and solution is good. Please refer to the description of negative `niters` values in the corresponding IRS linear solver functions such as `cusolverDnXgesv()` or `cusolverDnXgels()`.
1609    ///
1610    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The operation completed successfully.
1611    ///
1612    /// [`cusolverStatus_t::CUSOLVER_STATUS_IRS_INFOS_NOT_INITIALIZED`]:   The `Infos` structure was not created.
1613    ///
1614    /// # Parameters
1615    ///
1616    /// - `infos`: The `cusolverDnIRSInfos_t Infos` structure.
1617    /// - `niters`: The total number of iterations performed by the IRS solver.
1618    ///
1619    /// # Return value
1620    ///
1621    /// - [`cusolverStatus_t::CUSOLVER_STATUS_IRS_INFOS_NOT_INITIALIZED`]: The `Infos` structure was not created.
1622    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The operation completed successfully.
1623    pub fn cusolverDnIRSInfosGetNiters(
1624        infos: cusolverDnIRSInfos_t,
1625        niters: *mut cusolver_int_t,
1626    ) -> cusolverStatus_t;
1627}
1628unsafe extern "C" {
1629    /// This function returns the number of iterations performed by the outer refinement loop of the IRS solver. When the refinement solver consists of a one-level solver such as [`cusolverIRSRefinement_t::CUSOLVER_IRS_REFINE_CLASSICAL`] or [`cusolverIRSRefinement_t::CUSOLVER_IRS_REFINE_GMRES`], it is the same as `Niters`. When the refinement solver consists of a two-levels solver such as [`cusolverIRSRefinement_t::CUSOLVER_IRS_REFINE_CLASSICAL_GMRES`] or [`cusolverIRSRefinement_t::CUSOLVER_IRS_REFINE_GMRES_GMRES`], it is the number of iterations of the outer loop. Refer to the description of the [`cusolverIRSRefinement_t`] for more details.
1630    ///
1631    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The operation completed successfully.
1632    ///
1633    /// [`cusolverStatus_t::CUSOLVER_STATUS_IRS_INFOS_NOT_INITIALIZED`]:   The `Infos` structure was not created.
1634    ///
1635    /// # Parameters
1636    ///
1637    /// - `infos`: The `cusolverDnIRSInfos_t Infos` structure.
1638    /// - `outer_niters`: The number of iterations of the outer refinement loop of the IRS solver.
1639    ///
1640    /// # Return value
1641    ///
1642    /// - [`cusolverStatus_t::CUSOLVER_STATUS_IRS_INFOS_NOT_INITIALIZED`]: The `Infos` structure was not created.
1643    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The operation completed successfully.
1644    pub fn cusolverDnIRSInfosGetOuterNiters(
1645        infos: cusolverDnIRSInfos_t,
1646        outer_niters: *mut cusolver_int_t,
1647    ) -> cusolverStatus_t;
1648}
1649unsafe extern "C" {
1650    /// This function tells the IRS solver to store the convergence history (residual norms) of the refinement phase in a matrix that can be accessed via a pointer returned by the [`cusolverDnIRSInfosGetResidualHistory`] function.
1651    ///
1652    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The operation completed successfully.
1653    ///
1654    /// [`cusolverStatus_t::CUSOLVER_STATUS_IRS_INFOS_NOT_INITIALIZED`]:   The `Infos` structure was not created.
1655    ///
1656    /// # Parameters
1657    ///
1658    /// - `infos`: The `cusolverDnIRSInfos_t Infos` structure.
1659    ///
1660    /// # Return value
1661    ///
1662    /// - [`cusolverStatus_t::CUSOLVER_STATUS_IRS_INFOS_NOT_INITIALIZED`]: The `Infos` structure was not created.
1663    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The operation completed successfully.
1664    pub fn cusolverDnIRSInfosRequestResidual(
1665        infos: cusolverDnIRSInfos_t,
1666    ) -> cusolverStatus_t;
1667}
1668unsafe extern "C" {
1669    /// If the user called [`cusolverDnIRSInfosRequestResidual`] before the call to the IRS function, then the IRS solver will store the convergence history (residual norms) of the refinement phase in a matrix that can be accessed via a pointer returned by this function. The datatype of the residual norms depends on the input and output data type. If the Inputs/Outputs datatype is double precision real or complex (CUSOLVER_R_FP64 or CUSOLVER_C_FP64), this residual will be of type real double precision (FP64) *double*, otherwise if the Inputs/Outputs datatype is single precision real or complex (CUSOLVER_R_FP32 or CUSOLVER_C_FP32), this residual will be real single precision FP32 *float*.
1670    ///
1671    /// The residual history matrix consists of two columns (even for the multiple right-hand side case NRHS) of `MaxIters+1` row, thus a matrix of size (`MaxIters+1,2`). Only the first `OuterNiters+1` rows contains the residual norms the other (e.g., OuterNiters+2:Maxiters+1) are garbage. On the first column, each row *“i”* specify the total number of iterations happened till this outer iteration *“i”* and on the second columns the residual norm corresponding to this outer iteration *“i”*. Thus, the first row (e.g., outer iteration *“0”*) consists of the initial residual (e.g., the residual before the refinement loop start) then the consecutive rows are the residual obtained at each outer iteration of the refinement loop. Note, it only consists of the history of the outer loop.
1672    ///
1673    /// If the refinement solver was [`cusolverIRSRefinement_t::CUSOLVER_IRS_REFINE_CLASSICAL`] or [`cusolverIRSRefinement_t::CUSOLVER_IRS_REFINE_GMRES`], then OuterNiters=Niters (Niters is the total number of iterations performed) and there is Niters+1 rows of norms that correspond to the Niters outer iterations.
1674    ///
1675    /// If the refinement solver was [`cusolverIRSRefinement_t::CUSOLVER_IRS_REFINE_CLASSICAL_GMRES`] or [`cusolverIRSRefinement_t::CUSOLVER_IRS_REFINE_GMRES_GMRES`], then OuterNiters <= Niters corresponds to the outer iterations performed by the outer refinement loop. Thus, there is OuterNiters+1 residual norms where row *“i”* correspond to the outer iteration *“i”* and the first column specify the total number of iterations (outer and inner) that were performed till this step the second columns correspond to the residual norm at this step.
1676    ///
1677    /// For example, let’s say the user specifies [`cusolverIRSRefinement_t::CUSOLVER_IRS_REFINE_CLASSICAL_GMRES`] as a refinement solver and say it needed 3 outer iterations to converge and 4,3,3 inner iterations at each outer, respectively. This consists of 10 total iterations. Row 0 corresponds to the first residual before the refinement start, so it has 0 in its first column. On row 1 which corresponds to the outer iteration 1, it will be 4 (4 is the total number of iterations that were performed till now), on row 2 it will be 7, and on row 3 it will be 10.
1678    ///
1679    /// In summary, let’s define `ldh=Maxiters+1`, the leading dimension of the residual matrix. then `residual_history[i]` shows the total number of iterations performed at the outer iteration *“i”* and `residual_history[i+ldh]` corresponds to the norm of the residual at this outer iteration.
1680    ///
1681    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The operation completed successfully.
1682    ///
1683    /// [`cusolverStatus_t::CUSOLVER_STATUS_IRS_INFOS_NOT_INITIALIZED`]:   The `Infos` structure was not created
1684    ///
1685    /// [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]:   This function was called without calling [`cusolverDnIRSInfosRequestResidual`] in advance.
1686    ///
1687    /// # Parameters
1688    ///
1689    /// - `infos`: The `cusolverDnIRSInfos_t Infos` structure.
1690    /// - `residual_history`: Returns a void pointer to the matrix of the convergence history residual norms. See the description above for the relation between the residual norm datatype and the inout datatype.
1691    ///
1692    /// # Return value
1693    ///
1694    /// - [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]: This function was called without calling [`cusolverDnIRSInfosRequestResidual`] in advance.
1695    /// - [`cusolverStatus_t::CUSOLVER_STATUS_IRS_INFOS_NOT_INITIALIZED`]: The `Infos` structure was not created.
1696    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The operation completed successfully.
1697    pub fn cusolverDnIRSInfosGetResidualHistory(
1698        infos: cusolverDnIRSInfos_t,
1699        residual_history: *mut *mut ::core::ffi::c_void,
1700    ) -> cusolverStatus_t;
1701}
1702unsafe extern "C" {
1703    /// This function returns the maximal allowed number of iterations that was set for the corresponding call to the IRS solver. Note that this function returns the setting that was set when that call happened and is not to be confused with the [`cusolverDnIRSParamsGetMaxIters`] which returns the current setting in the `params` configuration structure. To be clearer, the `params` structure can be used for many calls to an IRS solver. A user can change the allowed `MaxIters` between calls while the `Infos` structure in [`cusolverDnIRSInfosGetMaxIters`] contains information about a particular call and cannot be reused for different calls, thus [`cusolverDnIRSInfosGetMaxIters`] returns the allowed `MaxIters` for that call.
1704    ///
1705    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The operation completed successfully.
1706    ///
1707    /// [`cusolverStatus_t::CUSOLVER_STATUS_IRS_INFOS_NOT_INITIALIZED`]:   The `Infos` structure was not created.
1708    ///
1709    /// # Parameters
1710    ///
1711    /// - `infos`: The `cusolverDnIRSInfos_t Infos` structure.
1712    /// - `maxiters`: The maximal number of iterations that is currently set.
1713    ///
1714    /// # Return value
1715    ///
1716    /// - [`cusolverStatus_t::CUSOLVER_STATUS_IRS_INFOS_NOT_INITIALIZED`]: The `Infos` structure was not created.
1717    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The operation completed successfully.
1718    pub fn cusolverDnIRSInfosGetMaxIters(
1719        infos: cusolverDnIRSInfos_t,
1720        maxiters: *mut cusolver_int_t,
1721    ) -> cusolverStatus_t;
1722}
1723unsafe extern "C" {
1724    pub fn cusolverDnZZgesv(
1725        handle: cusolverDnHandle_t,
1726        n: cusolver_int_t,
1727        nrhs: cusolver_int_t,
1728        dA: *mut cuDoubleComplex,
1729        ldda: cusolver_int_t,
1730        dipiv: *mut cusolver_int_t,
1731        dB: *mut cuDoubleComplex,
1732        lddb: cusolver_int_t,
1733        dX: *mut cuDoubleComplex,
1734        lddx: cusolver_int_t,
1735        dWorkspace: *mut ::core::ffi::c_void,
1736        lwork_bytes: size_t,
1737        iter: *mut cusolver_int_t,
1738        d_info: *mut cusolver_int_t,
1739    ) -> cusolverStatus_t;
1740}
1741unsafe extern "C" {
1742    pub fn cusolverDnZCgesv(
1743        handle: cusolverDnHandle_t,
1744        n: cusolver_int_t,
1745        nrhs: cusolver_int_t,
1746        dA: *mut cuDoubleComplex,
1747        ldda: cusolver_int_t,
1748        dipiv: *mut cusolver_int_t,
1749        dB: *mut cuDoubleComplex,
1750        lddb: cusolver_int_t,
1751        dX: *mut cuDoubleComplex,
1752        lddx: cusolver_int_t,
1753        dWorkspace: *mut ::core::ffi::c_void,
1754        lwork_bytes: size_t,
1755        iter: *mut cusolver_int_t,
1756        d_info: *mut cusolver_int_t,
1757    ) -> cusolverStatus_t;
1758}
1759unsafe extern "C" {
1760    pub fn cusolverDnZKgesv(
1761        handle: cusolverDnHandle_t,
1762        n: cusolver_int_t,
1763        nrhs: cusolver_int_t,
1764        dA: *mut cuDoubleComplex,
1765        ldda: cusolver_int_t,
1766        dipiv: *mut cusolver_int_t,
1767        dB: *mut cuDoubleComplex,
1768        lddb: cusolver_int_t,
1769        dX: *mut cuDoubleComplex,
1770        lddx: cusolver_int_t,
1771        dWorkspace: *mut ::core::ffi::c_void,
1772        lwork_bytes: size_t,
1773        iter: *mut cusolver_int_t,
1774        d_info: *mut cusolver_int_t,
1775    ) -> cusolverStatus_t;
1776}
1777unsafe extern "C" {
1778    pub fn cusolverDnZEgesv(
1779        handle: cusolverDnHandle_t,
1780        n: cusolver_int_t,
1781        nrhs: cusolver_int_t,
1782        dA: *mut cuDoubleComplex,
1783        ldda: cusolver_int_t,
1784        dipiv: *mut cusolver_int_t,
1785        dB: *mut cuDoubleComplex,
1786        lddb: cusolver_int_t,
1787        dX: *mut cuDoubleComplex,
1788        lddx: cusolver_int_t,
1789        dWorkspace: *mut ::core::ffi::c_void,
1790        lwork_bytes: size_t,
1791        iter: *mut cusolver_int_t,
1792        d_info: *mut cusolver_int_t,
1793    ) -> cusolverStatus_t;
1794}
1795unsafe extern "C" {
1796    pub fn cusolverDnZYgesv(
1797        handle: cusolverDnHandle_t,
1798        n: cusolver_int_t,
1799        nrhs: cusolver_int_t,
1800        dA: *mut cuDoubleComplex,
1801        ldda: cusolver_int_t,
1802        dipiv: *mut cusolver_int_t,
1803        dB: *mut cuDoubleComplex,
1804        lddb: cusolver_int_t,
1805        dX: *mut cuDoubleComplex,
1806        lddx: cusolver_int_t,
1807        dWorkspace: *mut ::core::ffi::c_void,
1808        lwork_bytes: size_t,
1809        iter: *mut cusolver_int_t,
1810        d_info: *mut cusolver_int_t,
1811    ) -> cusolverStatus_t;
1812}
1813unsafe extern "C" {
1814    pub fn cusolverDnCCgesv(
1815        handle: cusolverDnHandle_t,
1816        n: cusolver_int_t,
1817        nrhs: cusolver_int_t,
1818        dA: *mut cuComplex,
1819        ldda: cusolver_int_t,
1820        dipiv: *mut cusolver_int_t,
1821        dB: *mut cuComplex,
1822        lddb: cusolver_int_t,
1823        dX: *mut cuComplex,
1824        lddx: cusolver_int_t,
1825        dWorkspace: *mut ::core::ffi::c_void,
1826        lwork_bytes: size_t,
1827        iter: *mut cusolver_int_t,
1828        d_info: *mut cusolver_int_t,
1829    ) -> cusolverStatus_t;
1830}
1831unsafe extern "C" {
1832    pub fn cusolverDnCEgesv(
1833        handle: cusolverDnHandle_t,
1834        n: cusolver_int_t,
1835        nrhs: cusolver_int_t,
1836        dA: *mut cuComplex,
1837        ldda: cusolver_int_t,
1838        dipiv: *mut cusolver_int_t,
1839        dB: *mut cuComplex,
1840        lddb: cusolver_int_t,
1841        dX: *mut cuComplex,
1842        lddx: cusolver_int_t,
1843        dWorkspace: *mut ::core::ffi::c_void,
1844        lwork_bytes: size_t,
1845        iter: *mut cusolver_int_t,
1846        d_info: *mut cusolver_int_t,
1847    ) -> cusolverStatus_t;
1848}
1849unsafe extern "C" {
1850    pub fn cusolverDnCKgesv(
1851        handle: cusolverDnHandle_t,
1852        n: cusolver_int_t,
1853        nrhs: cusolver_int_t,
1854        dA: *mut cuComplex,
1855        ldda: cusolver_int_t,
1856        dipiv: *mut cusolver_int_t,
1857        dB: *mut cuComplex,
1858        lddb: cusolver_int_t,
1859        dX: *mut cuComplex,
1860        lddx: cusolver_int_t,
1861        dWorkspace: *mut ::core::ffi::c_void,
1862        lwork_bytes: size_t,
1863        iter: *mut cusolver_int_t,
1864        d_info: *mut cusolver_int_t,
1865    ) -> cusolverStatus_t;
1866}
1867unsafe extern "C" {
1868    pub fn cusolverDnCYgesv(
1869        handle: cusolverDnHandle_t,
1870        n: cusolver_int_t,
1871        nrhs: cusolver_int_t,
1872        dA: *mut cuComplex,
1873        ldda: cusolver_int_t,
1874        dipiv: *mut cusolver_int_t,
1875        dB: *mut cuComplex,
1876        lddb: cusolver_int_t,
1877        dX: *mut cuComplex,
1878        lddx: cusolver_int_t,
1879        dWorkspace: *mut ::core::ffi::c_void,
1880        lwork_bytes: size_t,
1881        iter: *mut cusolver_int_t,
1882        d_info: *mut cusolver_int_t,
1883    ) -> cusolverStatus_t;
1884}
1885unsafe extern "C" {
1886    pub fn cusolverDnDDgesv(
1887        handle: cusolverDnHandle_t,
1888        n: cusolver_int_t,
1889        nrhs: cusolver_int_t,
1890        dA: *mut f64,
1891        ldda: cusolver_int_t,
1892        dipiv: *mut cusolver_int_t,
1893        dB: *mut f64,
1894        lddb: cusolver_int_t,
1895        dX: *mut f64,
1896        lddx: cusolver_int_t,
1897        dWorkspace: *mut ::core::ffi::c_void,
1898        lwork_bytes: size_t,
1899        iter: *mut cusolver_int_t,
1900        d_info: *mut cusolver_int_t,
1901    ) -> cusolverStatus_t;
1902}
1903unsafe extern "C" {
1904    pub fn cusolverDnDSgesv(
1905        handle: cusolverDnHandle_t,
1906        n: cusolver_int_t,
1907        nrhs: cusolver_int_t,
1908        dA: *mut f64,
1909        ldda: cusolver_int_t,
1910        dipiv: *mut cusolver_int_t,
1911        dB: *mut f64,
1912        lddb: cusolver_int_t,
1913        dX: *mut f64,
1914        lddx: cusolver_int_t,
1915        dWorkspace: *mut ::core::ffi::c_void,
1916        lwork_bytes: size_t,
1917        iter: *mut cusolver_int_t,
1918        d_info: *mut cusolver_int_t,
1919    ) -> cusolverStatus_t;
1920}
1921unsafe extern "C" {
1922    pub fn cusolverDnDHgesv(
1923        handle: cusolverDnHandle_t,
1924        n: cusolver_int_t,
1925        nrhs: cusolver_int_t,
1926        dA: *mut f64,
1927        ldda: cusolver_int_t,
1928        dipiv: *mut cusolver_int_t,
1929        dB: *mut f64,
1930        lddb: cusolver_int_t,
1931        dX: *mut f64,
1932        lddx: cusolver_int_t,
1933        dWorkspace: *mut ::core::ffi::c_void,
1934        lwork_bytes: size_t,
1935        iter: *mut cusolver_int_t,
1936        d_info: *mut cusolver_int_t,
1937    ) -> cusolverStatus_t;
1938}
1939unsafe extern "C" {
1940    pub fn cusolverDnDBgesv(
1941        handle: cusolverDnHandle_t,
1942        n: cusolver_int_t,
1943        nrhs: cusolver_int_t,
1944        dA: *mut f64,
1945        ldda: cusolver_int_t,
1946        dipiv: *mut cusolver_int_t,
1947        dB: *mut f64,
1948        lddb: cusolver_int_t,
1949        dX: *mut f64,
1950        lddx: cusolver_int_t,
1951        dWorkspace: *mut ::core::ffi::c_void,
1952        lwork_bytes: size_t,
1953        iter: *mut cusolver_int_t,
1954        d_info: *mut cusolver_int_t,
1955    ) -> cusolverStatus_t;
1956}
1957unsafe extern "C" {
1958    pub fn cusolverDnDXgesv(
1959        handle: cusolverDnHandle_t,
1960        n: cusolver_int_t,
1961        nrhs: cusolver_int_t,
1962        dA: *mut f64,
1963        ldda: cusolver_int_t,
1964        dipiv: *mut cusolver_int_t,
1965        dB: *mut f64,
1966        lddb: cusolver_int_t,
1967        dX: *mut f64,
1968        lddx: cusolver_int_t,
1969        dWorkspace: *mut ::core::ffi::c_void,
1970        lwork_bytes: size_t,
1971        iter: *mut cusolver_int_t,
1972        d_info: *mut cusolver_int_t,
1973    ) -> cusolverStatus_t;
1974}
1975unsafe extern "C" {
1976    pub fn cusolverDnSSgesv(
1977        handle: cusolverDnHandle_t,
1978        n: cusolver_int_t,
1979        nrhs: cusolver_int_t,
1980        dA: *mut f32,
1981        ldda: cusolver_int_t,
1982        dipiv: *mut cusolver_int_t,
1983        dB: *mut f32,
1984        lddb: cusolver_int_t,
1985        dX: *mut f32,
1986        lddx: cusolver_int_t,
1987        dWorkspace: *mut ::core::ffi::c_void,
1988        lwork_bytes: size_t,
1989        iter: *mut cusolver_int_t,
1990        d_info: *mut cusolver_int_t,
1991    ) -> cusolverStatus_t;
1992}
1993unsafe extern "C" {
1994    pub fn cusolverDnSHgesv(
1995        handle: cusolverDnHandle_t,
1996        n: cusolver_int_t,
1997        nrhs: cusolver_int_t,
1998        dA: *mut f32,
1999        ldda: cusolver_int_t,
2000        dipiv: *mut cusolver_int_t,
2001        dB: *mut f32,
2002        lddb: cusolver_int_t,
2003        dX: *mut f32,
2004        lddx: cusolver_int_t,
2005        dWorkspace: *mut ::core::ffi::c_void,
2006        lwork_bytes: size_t,
2007        iter: *mut cusolver_int_t,
2008        d_info: *mut cusolver_int_t,
2009    ) -> cusolverStatus_t;
2010}
2011unsafe extern "C" {
2012    pub fn cusolverDnSBgesv(
2013        handle: cusolverDnHandle_t,
2014        n: cusolver_int_t,
2015        nrhs: cusolver_int_t,
2016        dA: *mut f32,
2017        ldda: cusolver_int_t,
2018        dipiv: *mut cusolver_int_t,
2019        dB: *mut f32,
2020        lddb: cusolver_int_t,
2021        dX: *mut f32,
2022        lddx: cusolver_int_t,
2023        dWorkspace: *mut ::core::ffi::c_void,
2024        lwork_bytes: size_t,
2025        iter: *mut cusolver_int_t,
2026        d_info: *mut cusolver_int_t,
2027    ) -> cusolverStatus_t;
2028}
2029unsafe extern "C" {
2030    pub fn cusolverDnSXgesv(
2031        handle: cusolverDnHandle_t,
2032        n: cusolver_int_t,
2033        nrhs: cusolver_int_t,
2034        dA: *mut f32,
2035        ldda: cusolver_int_t,
2036        dipiv: *mut cusolver_int_t,
2037        dB: *mut f32,
2038        lddb: cusolver_int_t,
2039        dX: *mut f32,
2040        lddx: cusolver_int_t,
2041        dWorkspace: *mut ::core::ffi::c_void,
2042        lwork_bytes: size_t,
2043        iter: *mut cusolver_int_t,
2044        d_info: *mut cusolver_int_t,
2045    ) -> cusolverStatus_t;
2046}
2047unsafe extern "C" {
2048    pub fn cusolverDnZZgesv_bufferSize(
2049        handle: cusolverDnHandle_t,
2050        n: cusolver_int_t,
2051        nrhs: cusolver_int_t,
2052        dA: *mut cuDoubleComplex,
2053        ldda: cusolver_int_t,
2054        dipiv: *mut cusolver_int_t,
2055        dB: *mut cuDoubleComplex,
2056        lddb: cusolver_int_t,
2057        dX: *mut cuDoubleComplex,
2058        lddx: cusolver_int_t,
2059        dWorkspace: *mut ::core::ffi::c_void,
2060        lwork_bytes: *mut size_t,
2061    ) -> cusolverStatus_t;
2062}
2063unsafe extern "C" {
2064    pub fn cusolverDnZCgesv_bufferSize(
2065        handle: cusolverDnHandle_t,
2066        n: cusolver_int_t,
2067        nrhs: cusolver_int_t,
2068        dA: *mut cuDoubleComplex,
2069        ldda: cusolver_int_t,
2070        dipiv: *mut cusolver_int_t,
2071        dB: *mut cuDoubleComplex,
2072        lddb: cusolver_int_t,
2073        dX: *mut cuDoubleComplex,
2074        lddx: cusolver_int_t,
2075        dWorkspace: *mut ::core::ffi::c_void,
2076        lwork_bytes: *mut size_t,
2077    ) -> cusolverStatus_t;
2078}
2079unsafe extern "C" {
2080    pub fn cusolverDnZKgesv_bufferSize(
2081        handle: cusolverDnHandle_t,
2082        n: cusolver_int_t,
2083        nrhs: cusolver_int_t,
2084        dA: *mut cuDoubleComplex,
2085        ldda: cusolver_int_t,
2086        dipiv: *mut cusolver_int_t,
2087        dB: *mut cuDoubleComplex,
2088        lddb: cusolver_int_t,
2089        dX: *mut cuDoubleComplex,
2090        lddx: cusolver_int_t,
2091        dWorkspace: *mut ::core::ffi::c_void,
2092        lwork_bytes: *mut size_t,
2093    ) -> cusolverStatus_t;
2094}
2095unsafe extern "C" {
2096    pub fn cusolverDnZEgesv_bufferSize(
2097        handle: cusolverDnHandle_t,
2098        n: cusolver_int_t,
2099        nrhs: cusolver_int_t,
2100        dA: *mut cuDoubleComplex,
2101        ldda: cusolver_int_t,
2102        dipiv: *mut cusolver_int_t,
2103        dB: *mut cuDoubleComplex,
2104        lddb: cusolver_int_t,
2105        dX: *mut cuDoubleComplex,
2106        lddx: cusolver_int_t,
2107        dWorkspace: *mut ::core::ffi::c_void,
2108        lwork_bytes: *mut size_t,
2109    ) -> cusolverStatus_t;
2110}
2111unsafe extern "C" {
2112    pub fn cusolverDnZYgesv_bufferSize(
2113        handle: cusolverDnHandle_t,
2114        n: cusolver_int_t,
2115        nrhs: cusolver_int_t,
2116        dA: *mut cuDoubleComplex,
2117        ldda: cusolver_int_t,
2118        dipiv: *mut cusolver_int_t,
2119        dB: *mut cuDoubleComplex,
2120        lddb: cusolver_int_t,
2121        dX: *mut cuDoubleComplex,
2122        lddx: cusolver_int_t,
2123        dWorkspace: *mut ::core::ffi::c_void,
2124        lwork_bytes: *mut size_t,
2125    ) -> cusolverStatus_t;
2126}
2127unsafe extern "C" {
2128    pub fn cusolverDnCCgesv_bufferSize(
2129        handle: cusolverDnHandle_t,
2130        n: cusolver_int_t,
2131        nrhs: cusolver_int_t,
2132        dA: *mut cuComplex,
2133        ldda: cusolver_int_t,
2134        dipiv: *mut cusolver_int_t,
2135        dB: *mut cuComplex,
2136        lddb: cusolver_int_t,
2137        dX: *mut cuComplex,
2138        lddx: cusolver_int_t,
2139        dWorkspace: *mut ::core::ffi::c_void,
2140        lwork_bytes: *mut size_t,
2141    ) -> cusolverStatus_t;
2142}
2143unsafe extern "C" {
2144    pub fn cusolverDnCKgesv_bufferSize(
2145        handle: cusolverDnHandle_t,
2146        n: cusolver_int_t,
2147        nrhs: cusolver_int_t,
2148        dA: *mut cuComplex,
2149        ldda: cusolver_int_t,
2150        dipiv: *mut cusolver_int_t,
2151        dB: *mut cuComplex,
2152        lddb: cusolver_int_t,
2153        dX: *mut cuComplex,
2154        lddx: cusolver_int_t,
2155        dWorkspace: *mut ::core::ffi::c_void,
2156        lwork_bytes: *mut size_t,
2157    ) -> cusolverStatus_t;
2158}
2159unsafe extern "C" {
2160    pub fn cusolverDnCEgesv_bufferSize(
2161        handle: cusolverDnHandle_t,
2162        n: cusolver_int_t,
2163        nrhs: cusolver_int_t,
2164        dA: *mut cuComplex,
2165        ldda: cusolver_int_t,
2166        dipiv: *mut cusolver_int_t,
2167        dB: *mut cuComplex,
2168        lddb: cusolver_int_t,
2169        dX: *mut cuComplex,
2170        lddx: cusolver_int_t,
2171        dWorkspace: *mut ::core::ffi::c_void,
2172        lwork_bytes: *mut size_t,
2173    ) -> cusolverStatus_t;
2174}
2175unsafe extern "C" {
2176    pub fn cusolverDnCYgesv_bufferSize(
2177        handle: cusolverDnHandle_t,
2178        n: cusolver_int_t,
2179        nrhs: cusolver_int_t,
2180        dA: *mut cuComplex,
2181        ldda: cusolver_int_t,
2182        dipiv: *mut cusolver_int_t,
2183        dB: *mut cuComplex,
2184        lddb: cusolver_int_t,
2185        dX: *mut cuComplex,
2186        lddx: cusolver_int_t,
2187        dWorkspace: *mut ::core::ffi::c_void,
2188        lwork_bytes: *mut size_t,
2189    ) -> cusolverStatus_t;
2190}
2191unsafe extern "C" {
2192    pub fn cusolverDnDDgesv_bufferSize(
2193        handle: cusolverDnHandle_t,
2194        n: cusolver_int_t,
2195        nrhs: cusolver_int_t,
2196        dA: *mut f64,
2197        ldda: cusolver_int_t,
2198        dipiv: *mut cusolver_int_t,
2199        dB: *mut f64,
2200        lddb: cusolver_int_t,
2201        dX: *mut f64,
2202        lddx: cusolver_int_t,
2203        dWorkspace: *mut ::core::ffi::c_void,
2204        lwork_bytes: *mut size_t,
2205    ) -> cusolverStatus_t;
2206}
2207unsafe extern "C" {
2208    pub fn cusolverDnDSgesv_bufferSize(
2209        handle: cusolverDnHandle_t,
2210        n: cusolver_int_t,
2211        nrhs: cusolver_int_t,
2212        dA: *mut f64,
2213        ldda: cusolver_int_t,
2214        dipiv: *mut cusolver_int_t,
2215        dB: *mut f64,
2216        lddb: cusolver_int_t,
2217        dX: *mut f64,
2218        lddx: cusolver_int_t,
2219        dWorkspace: *mut ::core::ffi::c_void,
2220        lwork_bytes: *mut size_t,
2221    ) -> cusolverStatus_t;
2222}
2223unsafe extern "C" {
2224    pub fn cusolverDnDHgesv_bufferSize(
2225        handle: cusolverDnHandle_t,
2226        n: cusolver_int_t,
2227        nrhs: cusolver_int_t,
2228        dA: *mut f64,
2229        ldda: cusolver_int_t,
2230        dipiv: *mut cusolver_int_t,
2231        dB: *mut f64,
2232        lddb: cusolver_int_t,
2233        dX: *mut f64,
2234        lddx: cusolver_int_t,
2235        dWorkspace: *mut ::core::ffi::c_void,
2236        lwork_bytes: *mut size_t,
2237    ) -> cusolverStatus_t;
2238}
2239unsafe extern "C" {
2240    pub fn cusolverDnDBgesv_bufferSize(
2241        handle: cusolverDnHandle_t,
2242        n: cusolver_int_t,
2243        nrhs: cusolver_int_t,
2244        dA: *mut f64,
2245        ldda: cusolver_int_t,
2246        dipiv: *mut cusolver_int_t,
2247        dB: *mut f64,
2248        lddb: cusolver_int_t,
2249        dX: *mut f64,
2250        lddx: cusolver_int_t,
2251        dWorkspace: *mut ::core::ffi::c_void,
2252        lwork_bytes: *mut size_t,
2253    ) -> cusolverStatus_t;
2254}
2255unsafe extern "C" {
2256    pub fn cusolverDnDXgesv_bufferSize(
2257        handle: cusolverDnHandle_t,
2258        n: cusolver_int_t,
2259        nrhs: cusolver_int_t,
2260        dA: *mut f64,
2261        ldda: cusolver_int_t,
2262        dipiv: *mut cusolver_int_t,
2263        dB: *mut f64,
2264        lddb: cusolver_int_t,
2265        dX: *mut f64,
2266        lddx: cusolver_int_t,
2267        dWorkspace: *mut ::core::ffi::c_void,
2268        lwork_bytes: *mut size_t,
2269    ) -> cusolverStatus_t;
2270}
2271unsafe extern "C" {
2272    pub fn cusolverDnSSgesv_bufferSize(
2273        handle: cusolverDnHandle_t,
2274        n: cusolver_int_t,
2275        nrhs: cusolver_int_t,
2276        dA: *mut f32,
2277        ldda: cusolver_int_t,
2278        dipiv: *mut cusolver_int_t,
2279        dB: *mut f32,
2280        lddb: cusolver_int_t,
2281        dX: *mut f32,
2282        lddx: cusolver_int_t,
2283        dWorkspace: *mut ::core::ffi::c_void,
2284        lwork_bytes: *mut size_t,
2285    ) -> cusolverStatus_t;
2286}
2287unsafe extern "C" {
2288    pub fn cusolverDnSHgesv_bufferSize(
2289        handle: cusolverDnHandle_t,
2290        n: cusolver_int_t,
2291        nrhs: cusolver_int_t,
2292        dA: *mut f32,
2293        ldda: cusolver_int_t,
2294        dipiv: *mut cusolver_int_t,
2295        dB: *mut f32,
2296        lddb: cusolver_int_t,
2297        dX: *mut f32,
2298        lddx: cusolver_int_t,
2299        dWorkspace: *mut ::core::ffi::c_void,
2300        lwork_bytes: *mut size_t,
2301    ) -> cusolverStatus_t;
2302}
2303unsafe extern "C" {
2304    pub fn cusolverDnSBgesv_bufferSize(
2305        handle: cusolverDnHandle_t,
2306        n: cusolver_int_t,
2307        nrhs: cusolver_int_t,
2308        dA: *mut f32,
2309        ldda: cusolver_int_t,
2310        dipiv: *mut cusolver_int_t,
2311        dB: *mut f32,
2312        lddb: cusolver_int_t,
2313        dX: *mut f32,
2314        lddx: cusolver_int_t,
2315        dWorkspace: *mut ::core::ffi::c_void,
2316        lwork_bytes: *mut size_t,
2317    ) -> cusolverStatus_t;
2318}
2319unsafe extern "C" {
2320    pub fn cusolverDnSXgesv_bufferSize(
2321        handle: cusolverDnHandle_t,
2322        n: cusolver_int_t,
2323        nrhs: cusolver_int_t,
2324        dA: *mut f32,
2325        ldda: cusolver_int_t,
2326        dipiv: *mut cusolver_int_t,
2327        dB: *mut f32,
2328        lddb: cusolver_int_t,
2329        dX: *mut f32,
2330        lddx: cusolver_int_t,
2331        dWorkspace: *mut ::core::ffi::c_void,
2332        lwork_bytes: *mut size_t,
2333    ) -> cusolverStatus_t;
2334}
2335unsafe extern "C" {
2336    pub fn cusolverDnZZgels(
2337        handle: cusolverDnHandle_t,
2338        m: cusolver_int_t,
2339        n: cusolver_int_t,
2340        nrhs: cusolver_int_t,
2341        dA: *mut cuDoubleComplex,
2342        ldda: cusolver_int_t,
2343        dB: *mut cuDoubleComplex,
2344        lddb: cusolver_int_t,
2345        dX: *mut cuDoubleComplex,
2346        lddx: cusolver_int_t,
2347        dWorkspace: *mut ::core::ffi::c_void,
2348        lwork_bytes: size_t,
2349        iter: *mut cusolver_int_t,
2350        d_info: *mut cusolver_int_t,
2351    ) -> cusolverStatus_t;
2352}
2353unsafe extern "C" {
2354    pub fn cusolverDnZCgels(
2355        handle: cusolverDnHandle_t,
2356        m: cusolver_int_t,
2357        n: cusolver_int_t,
2358        nrhs: cusolver_int_t,
2359        dA: *mut cuDoubleComplex,
2360        ldda: cusolver_int_t,
2361        dB: *mut cuDoubleComplex,
2362        lddb: cusolver_int_t,
2363        dX: *mut cuDoubleComplex,
2364        lddx: cusolver_int_t,
2365        dWorkspace: *mut ::core::ffi::c_void,
2366        lwork_bytes: size_t,
2367        iter: *mut cusolver_int_t,
2368        d_info: *mut cusolver_int_t,
2369    ) -> cusolverStatus_t;
2370}
2371unsafe extern "C" {
2372    pub fn cusolverDnZKgels(
2373        handle: cusolverDnHandle_t,
2374        m: cusolver_int_t,
2375        n: cusolver_int_t,
2376        nrhs: cusolver_int_t,
2377        dA: *mut cuDoubleComplex,
2378        ldda: cusolver_int_t,
2379        dB: *mut cuDoubleComplex,
2380        lddb: cusolver_int_t,
2381        dX: *mut cuDoubleComplex,
2382        lddx: cusolver_int_t,
2383        dWorkspace: *mut ::core::ffi::c_void,
2384        lwork_bytes: size_t,
2385        iter: *mut cusolver_int_t,
2386        d_info: *mut cusolver_int_t,
2387    ) -> cusolverStatus_t;
2388}
2389unsafe extern "C" {
2390    pub fn cusolverDnZEgels(
2391        handle: cusolverDnHandle_t,
2392        m: cusolver_int_t,
2393        n: cusolver_int_t,
2394        nrhs: cusolver_int_t,
2395        dA: *mut cuDoubleComplex,
2396        ldda: cusolver_int_t,
2397        dB: *mut cuDoubleComplex,
2398        lddb: cusolver_int_t,
2399        dX: *mut cuDoubleComplex,
2400        lddx: cusolver_int_t,
2401        dWorkspace: *mut ::core::ffi::c_void,
2402        lwork_bytes: size_t,
2403        iter: *mut cusolver_int_t,
2404        d_info: *mut cusolver_int_t,
2405    ) -> cusolverStatus_t;
2406}
2407unsafe extern "C" {
2408    pub fn cusolverDnZYgels(
2409        handle: cusolverDnHandle_t,
2410        m: cusolver_int_t,
2411        n: cusolver_int_t,
2412        nrhs: cusolver_int_t,
2413        dA: *mut cuDoubleComplex,
2414        ldda: cusolver_int_t,
2415        dB: *mut cuDoubleComplex,
2416        lddb: cusolver_int_t,
2417        dX: *mut cuDoubleComplex,
2418        lddx: cusolver_int_t,
2419        dWorkspace: *mut ::core::ffi::c_void,
2420        lwork_bytes: size_t,
2421        iter: *mut cusolver_int_t,
2422        d_info: *mut cusolver_int_t,
2423    ) -> cusolverStatus_t;
2424}
2425unsafe extern "C" {
2426    pub fn cusolverDnCCgels(
2427        handle: cusolverDnHandle_t,
2428        m: cusolver_int_t,
2429        n: cusolver_int_t,
2430        nrhs: cusolver_int_t,
2431        dA: *mut cuComplex,
2432        ldda: cusolver_int_t,
2433        dB: *mut cuComplex,
2434        lddb: cusolver_int_t,
2435        dX: *mut cuComplex,
2436        lddx: cusolver_int_t,
2437        dWorkspace: *mut ::core::ffi::c_void,
2438        lwork_bytes: size_t,
2439        iter: *mut cusolver_int_t,
2440        d_info: *mut cusolver_int_t,
2441    ) -> cusolverStatus_t;
2442}
2443unsafe extern "C" {
2444    pub fn cusolverDnCKgels(
2445        handle: cusolverDnHandle_t,
2446        m: cusolver_int_t,
2447        n: cusolver_int_t,
2448        nrhs: cusolver_int_t,
2449        dA: *mut cuComplex,
2450        ldda: cusolver_int_t,
2451        dB: *mut cuComplex,
2452        lddb: cusolver_int_t,
2453        dX: *mut cuComplex,
2454        lddx: cusolver_int_t,
2455        dWorkspace: *mut ::core::ffi::c_void,
2456        lwork_bytes: size_t,
2457        iter: *mut cusolver_int_t,
2458        d_info: *mut cusolver_int_t,
2459    ) -> cusolverStatus_t;
2460}
2461unsafe extern "C" {
2462    pub fn cusolverDnCEgels(
2463        handle: cusolverDnHandle_t,
2464        m: cusolver_int_t,
2465        n: cusolver_int_t,
2466        nrhs: cusolver_int_t,
2467        dA: *mut cuComplex,
2468        ldda: cusolver_int_t,
2469        dB: *mut cuComplex,
2470        lddb: cusolver_int_t,
2471        dX: *mut cuComplex,
2472        lddx: cusolver_int_t,
2473        dWorkspace: *mut ::core::ffi::c_void,
2474        lwork_bytes: size_t,
2475        iter: *mut cusolver_int_t,
2476        d_info: *mut cusolver_int_t,
2477    ) -> cusolverStatus_t;
2478}
2479unsafe extern "C" {
2480    pub fn cusolverDnCYgels(
2481        handle: cusolverDnHandle_t,
2482        m: cusolver_int_t,
2483        n: cusolver_int_t,
2484        nrhs: cusolver_int_t,
2485        dA: *mut cuComplex,
2486        ldda: cusolver_int_t,
2487        dB: *mut cuComplex,
2488        lddb: cusolver_int_t,
2489        dX: *mut cuComplex,
2490        lddx: cusolver_int_t,
2491        dWorkspace: *mut ::core::ffi::c_void,
2492        lwork_bytes: size_t,
2493        iter: *mut cusolver_int_t,
2494        d_info: *mut cusolver_int_t,
2495    ) -> cusolverStatus_t;
2496}
2497unsafe extern "C" {
2498    pub fn cusolverDnDDgels(
2499        handle: cusolverDnHandle_t,
2500        m: cusolver_int_t,
2501        n: cusolver_int_t,
2502        nrhs: cusolver_int_t,
2503        dA: *mut f64,
2504        ldda: cusolver_int_t,
2505        dB: *mut f64,
2506        lddb: cusolver_int_t,
2507        dX: *mut f64,
2508        lddx: cusolver_int_t,
2509        dWorkspace: *mut ::core::ffi::c_void,
2510        lwork_bytes: size_t,
2511        iter: *mut cusolver_int_t,
2512        d_info: *mut cusolver_int_t,
2513    ) -> cusolverStatus_t;
2514}
2515unsafe extern "C" {
2516    pub fn cusolverDnDSgels(
2517        handle: cusolverDnHandle_t,
2518        m: cusolver_int_t,
2519        n: cusolver_int_t,
2520        nrhs: cusolver_int_t,
2521        dA: *mut f64,
2522        ldda: cusolver_int_t,
2523        dB: *mut f64,
2524        lddb: cusolver_int_t,
2525        dX: *mut f64,
2526        lddx: cusolver_int_t,
2527        dWorkspace: *mut ::core::ffi::c_void,
2528        lwork_bytes: size_t,
2529        iter: *mut cusolver_int_t,
2530        d_info: *mut cusolver_int_t,
2531    ) -> cusolverStatus_t;
2532}
2533unsafe extern "C" {
2534    pub fn cusolverDnDHgels(
2535        handle: cusolverDnHandle_t,
2536        m: cusolver_int_t,
2537        n: cusolver_int_t,
2538        nrhs: cusolver_int_t,
2539        dA: *mut f64,
2540        ldda: cusolver_int_t,
2541        dB: *mut f64,
2542        lddb: cusolver_int_t,
2543        dX: *mut f64,
2544        lddx: cusolver_int_t,
2545        dWorkspace: *mut ::core::ffi::c_void,
2546        lwork_bytes: size_t,
2547        iter: *mut cusolver_int_t,
2548        d_info: *mut cusolver_int_t,
2549    ) -> cusolverStatus_t;
2550}
2551unsafe extern "C" {
2552    pub fn cusolverDnDBgels(
2553        handle: cusolverDnHandle_t,
2554        m: cusolver_int_t,
2555        n: cusolver_int_t,
2556        nrhs: cusolver_int_t,
2557        dA: *mut f64,
2558        ldda: cusolver_int_t,
2559        dB: *mut f64,
2560        lddb: cusolver_int_t,
2561        dX: *mut f64,
2562        lddx: cusolver_int_t,
2563        dWorkspace: *mut ::core::ffi::c_void,
2564        lwork_bytes: size_t,
2565        iter: *mut cusolver_int_t,
2566        d_info: *mut cusolver_int_t,
2567    ) -> cusolverStatus_t;
2568}
2569unsafe extern "C" {
2570    pub fn cusolverDnDXgels(
2571        handle: cusolverDnHandle_t,
2572        m: cusolver_int_t,
2573        n: cusolver_int_t,
2574        nrhs: cusolver_int_t,
2575        dA: *mut f64,
2576        ldda: cusolver_int_t,
2577        dB: *mut f64,
2578        lddb: cusolver_int_t,
2579        dX: *mut f64,
2580        lddx: cusolver_int_t,
2581        dWorkspace: *mut ::core::ffi::c_void,
2582        lwork_bytes: size_t,
2583        iter: *mut cusolver_int_t,
2584        d_info: *mut cusolver_int_t,
2585    ) -> cusolverStatus_t;
2586}
2587unsafe extern "C" {
2588    pub fn cusolverDnSSgels(
2589        handle: cusolverDnHandle_t,
2590        m: cusolver_int_t,
2591        n: cusolver_int_t,
2592        nrhs: cusolver_int_t,
2593        dA: *mut f32,
2594        ldda: cusolver_int_t,
2595        dB: *mut f32,
2596        lddb: cusolver_int_t,
2597        dX: *mut f32,
2598        lddx: cusolver_int_t,
2599        dWorkspace: *mut ::core::ffi::c_void,
2600        lwork_bytes: size_t,
2601        iter: *mut cusolver_int_t,
2602        d_info: *mut cusolver_int_t,
2603    ) -> cusolverStatus_t;
2604}
2605unsafe extern "C" {
2606    pub fn cusolverDnSHgels(
2607        handle: cusolverDnHandle_t,
2608        m: cusolver_int_t,
2609        n: cusolver_int_t,
2610        nrhs: cusolver_int_t,
2611        dA: *mut f32,
2612        ldda: cusolver_int_t,
2613        dB: *mut f32,
2614        lddb: cusolver_int_t,
2615        dX: *mut f32,
2616        lddx: cusolver_int_t,
2617        dWorkspace: *mut ::core::ffi::c_void,
2618        lwork_bytes: size_t,
2619        iter: *mut cusolver_int_t,
2620        d_info: *mut cusolver_int_t,
2621    ) -> cusolverStatus_t;
2622}
2623unsafe extern "C" {
2624    pub fn cusolverDnSBgels(
2625        handle: cusolverDnHandle_t,
2626        m: cusolver_int_t,
2627        n: cusolver_int_t,
2628        nrhs: cusolver_int_t,
2629        dA: *mut f32,
2630        ldda: cusolver_int_t,
2631        dB: *mut f32,
2632        lddb: cusolver_int_t,
2633        dX: *mut f32,
2634        lddx: cusolver_int_t,
2635        dWorkspace: *mut ::core::ffi::c_void,
2636        lwork_bytes: size_t,
2637        iter: *mut cusolver_int_t,
2638        d_info: *mut cusolver_int_t,
2639    ) -> cusolverStatus_t;
2640}
2641unsafe extern "C" {
2642    pub fn cusolverDnSXgels(
2643        handle: cusolverDnHandle_t,
2644        m: cusolver_int_t,
2645        n: cusolver_int_t,
2646        nrhs: cusolver_int_t,
2647        dA: *mut f32,
2648        ldda: cusolver_int_t,
2649        dB: *mut f32,
2650        lddb: cusolver_int_t,
2651        dX: *mut f32,
2652        lddx: cusolver_int_t,
2653        dWorkspace: *mut ::core::ffi::c_void,
2654        lwork_bytes: size_t,
2655        iter: *mut cusolver_int_t,
2656        d_info: *mut cusolver_int_t,
2657    ) -> cusolverStatus_t;
2658}
2659unsafe extern "C" {
2660    pub fn cusolverDnZZgels_bufferSize(
2661        handle: cusolverDnHandle_t,
2662        m: cusolver_int_t,
2663        n: cusolver_int_t,
2664        nrhs: cusolver_int_t,
2665        dA: *mut cuDoubleComplex,
2666        ldda: cusolver_int_t,
2667        dB: *mut cuDoubleComplex,
2668        lddb: cusolver_int_t,
2669        dX: *mut cuDoubleComplex,
2670        lddx: cusolver_int_t,
2671        dWorkspace: *mut ::core::ffi::c_void,
2672        lwork_bytes: *mut size_t,
2673    ) -> cusolverStatus_t;
2674}
2675unsafe extern "C" {
2676    pub fn cusolverDnZCgels_bufferSize(
2677        handle: cusolverDnHandle_t,
2678        m: cusolver_int_t,
2679        n: cusolver_int_t,
2680        nrhs: cusolver_int_t,
2681        dA: *mut cuDoubleComplex,
2682        ldda: cusolver_int_t,
2683        dB: *mut cuDoubleComplex,
2684        lddb: cusolver_int_t,
2685        dX: *mut cuDoubleComplex,
2686        lddx: cusolver_int_t,
2687        dWorkspace: *mut ::core::ffi::c_void,
2688        lwork_bytes: *mut size_t,
2689    ) -> cusolverStatus_t;
2690}
2691unsafe extern "C" {
2692    pub fn cusolverDnZKgels_bufferSize(
2693        handle: cusolverDnHandle_t,
2694        m: cusolver_int_t,
2695        n: cusolver_int_t,
2696        nrhs: cusolver_int_t,
2697        dA: *mut cuDoubleComplex,
2698        ldda: cusolver_int_t,
2699        dB: *mut cuDoubleComplex,
2700        lddb: cusolver_int_t,
2701        dX: *mut cuDoubleComplex,
2702        lddx: cusolver_int_t,
2703        dWorkspace: *mut ::core::ffi::c_void,
2704        lwork_bytes: *mut size_t,
2705    ) -> cusolverStatus_t;
2706}
2707unsafe extern "C" {
2708    pub fn cusolverDnZEgels_bufferSize(
2709        handle: cusolverDnHandle_t,
2710        m: cusolver_int_t,
2711        n: cusolver_int_t,
2712        nrhs: cusolver_int_t,
2713        dA: *mut cuDoubleComplex,
2714        ldda: cusolver_int_t,
2715        dB: *mut cuDoubleComplex,
2716        lddb: cusolver_int_t,
2717        dX: *mut cuDoubleComplex,
2718        lddx: cusolver_int_t,
2719        dWorkspace: *mut ::core::ffi::c_void,
2720        lwork_bytes: *mut size_t,
2721    ) -> cusolverStatus_t;
2722}
2723unsafe extern "C" {
2724    pub fn cusolverDnZYgels_bufferSize(
2725        handle: cusolverDnHandle_t,
2726        m: cusolver_int_t,
2727        n: cusolver_int_t,
2728        nrhs: cusolver_int_t,
2729        dA: *mut cuDoubleComplex,
2730        ldda: cusolver_int_t,
2731        dB: *mut cuDoubleComplex,
2732        lddb: cusolver_int_t,
2733        dX: *mut cuDoubleComplex,
2734        lddx: cusolver_int_t,
2735        dWorkspace: *mut ::core::ffi::c_void,
2736        lwork_bytes: *mut size_t,
2737    ) -> cusolverStatus_t;
2738}
2739unsafe extern "C" {
2740    pub fn cusolverDnCCgels_bufferSize(
2741        handle: cusolverDnHandle_t,
2742        m: cusolver_int_t,
2743        n: cusolver_int_t,
2744        nrhs: cusolver_int_t,
2745        dA: *mut cuComplex,
2746        ldda: cusolver_int_t,
2747        dB: *mut cuComplex,
2748        lddb: cusolver_int_t,
2749        dX: *mut cuComplex,
2750        lddx: cusolver_int_t,
2751        dWorkspace: *mut ::core::ffi::c_void,
2752        lwork_bytes: *mut size_t,
2753    ) -> cusolverStatus_t;
2754}
2755unsafe extern "C" {
2756    pub fn cusolverDnCKgels_bufferSize(
2757        handle: cusolverDnHandle_t,
2758        m: cusolver_int_t,
2759        n: cusolver_int_t,
2760        nrhs: cusolver_int_t,
2761        dA: *mut cuComplex,
2762        ldda: cusolver_int_t,
2763        dB: *mut cuComplex,
2764        lddb: cusolver_int_t,
2765        dX: *mut cuComplex,
2766        lddx: cusolver_int_t,
2767        dWorkspace: *mut ::core::ffi::c_void,
2768        lwork_bytes: *mut size_t,
2769    ) -> cusolverStatus_t;
2770}
2771unsafe extern "C" {
2772    pub fn cusolverDnCEgels_bufferSize(
2773        handle: cusolverDnHandle_t,
2774        m: cusolver_int_t,
2775        n: cusolver_int_t,
2776        nrhs: cusolver_int_t,
2777        dA: *mut cuComplex,
2778        ldda: cusolver_int_t,
2779        dB: *mut cuComplex,
2780        lddb: cusolver_int_t,
2781        dX: *mut cuComplex,
2782        lddx: cusolver_int_t,
2783        dWorkspace: *mut ::core::ffi::c_void,
2784        lwork_bytes: *mut size_t,
2785    ) -> cusolverStatus_t;
2786}
2787unsafe extern "C" {
2788    pub fn cusolverDnCYgels_bufferSize(
2789        handle: cusolverDnHandle_t,
2790        m: cusolver_int_t,
2791        n: cusolver_int_t,
2792        nrhs: cusolver_int_t,
2793        dA: *mut cuComplex,
2794        ldda: cusolver_int_t,
2795        dB: *mut cuComplex,
2796        lddb: cusolver_int_t,
2797        dX: *mut cuComplex,
2798        lddx: cusolver_int_t,
2799        dWorkspace: *mut ::core::ffi::c_void,
2800        lwork_bytes: *mut size_t,
2801    ) -> cusolverStatus_t;
2802}
2803unsafe extern "C" {
2804    pub fn cusolverDnDDgels_bufferSize(
2805        handle: cusolverDnHandle_t,
2806        m: cusolver_int_t,
2807        n: cusolver_int_t,
2808        nrhs: cusolver_int_t,
2809        dA: *mut f64,
2810        ldda: cusolver_int_t,
2811        dB: *mut f64,
2812        lddb: cusolver_int_t,
2813        dX: *mut f64,
2814        lddx: cusolver_int_t,
2815        dWorkspace: *mut ::core::ffi::c_void,
2816        lwork_bytes: *mut size_t,
2817    ) -> cusolverStatus_t;
2818}
2819unsafe extern "C" {
2820    pub fn cusolverDnDSgels_bufferSize(
2821        handle: cusolverDnHandle_t,
2822        m: cusolver_int_t,
2823        n: cusolver_int_t,
2824        nrhs: cusolver_int_t,
2825        dA: *mut f64,
2826        ldda: cusolver_int_t,
2827        dB: *mut f64,
2828        lddb: cusolver_int_t,
2829        dX: *mut f64,
2830        lddx: cusolver_int_t,
2831        dWorkspace: *mut ::core::ffi::c_void,
2832        lwork_bytes: *mut size_t,
2833    ) -> cusolverStatus_t;
2834}
2835unsafe extern "C" {
2836    pub fn cusolverDnDHgels_bufferSize(
2837        handle: cusolverDnHandle_t,
2838        m: cusolver_int_t,
2839        n: cusolver_int_t,
2840        nrhs: cusolver_int_t,
2841        dA: *mut f64,
2842        ldda: cusolver_int_t,
2843        dB: *mut f64,
2844        lddb: cusolver_int_t,
2845        dX: *mut f64,
2846        lddx: cusolver_int_t,
2847        dWorkspace: *mut ::core::ffi::c_void,
2848        lwork_bytes: *mut size_t,
2849    ) -> cusolverStatus_t;
2850}
2851unsafe extern "C" {
2852    pub fn cusolverDnDBgels_bufferSize(
2853        handle: cusolverDnHandle_t,
2854        m: cusolver_int_t,
2855        n: cusolver_int_t,
2856        nrhs: cusolver_int_t,
2857        dA: *mut f64,
2858        ldda: cusolver_int_t,
2859        dB: *mut f64,
2860        lddb: cusolver_int_t,
2861        dX: *mut f64,
2862        lddx: cusolver_int_t,
2863        dWorkspace: *mut ::core::ffi::c_void,
2864        lwork_bytes: *mut size_t,
2865    ) -> cusolverStatus_t;
2866}
2867unsafe extern "C" {
2868    pub fn cusolverDnDXgels_bufferSize(
2869        handle: cusolverDnHandle_t,
2870        m: cusolver_int_t,
2871        n: cusolver_int_t,
2872        nrhs: cusolver_int_t,
2873        dA: *mut f64,
2874        ldda: cusolver_int_t,
2875        dB: *mut f64,
2876        lddb: cusolver_int_t,
2877        dX: *mut f64,
2878        lddx: cusolver_int_t,
2879        dWorkspace: *mut ::core::ffi::c_void,
2880        lwork_bytes: *mut size_t,
2881    ) -> cusolverStatus_t;
2882}
2883unsafe extern "C" {
2884    pub fn cusolverDnSSgels_bufferSize(
2885        handle: cusolverDnHandle_t,
2886        m: cusolver_int_t,
2887        n: cusolver_int_t,
2888        nrhs: cusolver_int_t,
2889        dA: *mut f32,
2890        ldda: cusolver_int_t,
2891        dB: *mut f32,
2892        lddb: cusolver_int_t,
2893        dX: *mut f32,
2894        lddx: cusolver_int_t,
2895        dWorkspace: *mut ::core::ffi::c_void,
2896        lwork_bytes: *mut size_t,
2897    ) -> cusolverStatus_t;
2898}
2899unsafe extern "C" {
2900    pub fn cusolverDnSHgels_bufferSize(
2901        handle: cusolverDnHandle_t,
2902        m: cusolver_int_t,
2903        n: cusolver_int_t,
2904        nrhs: cusolver_int_t,
2905        dA: *mut f32,
2906        ldda: cusolver_int_t,
2907        dB: *mut f32,
2908        lddb: cusolver_int_t,
2909        dX: *mut f32,
2910        lddx: cusolver_int_t,
2911        dWorkspace: *mut ::core::ffi::c_void,
2912        lwork_bytes: *mut size_t,
2913    ) -> cusolverStatus_t;
2914}
2915unsafe extern "C" {
2916    pub fn cusolverDnSBgels_bufferSize(
2917        handle: cusolverDnHandle_t,
2918        m: cusolver_int_t,
2919        n: cusolver_int_t,
2920        nrhs: cusolver_int_t,
2921        dA: *mut f32,
2922        ldda: cusolver_int_t,
2923        dB: *mut f32,
2924        lddb: cusolver_int_t,
2925        dX: *mut f32,
2926        lddx: cusolver_int_t,
2927        dWorkspace: *mut ::core::ffi::c_void,
2928        lwork_bytes: *mut size_t,
2929    ) -> cusolverStatus_t;
2930}
2931unsafe extern "C" {
2932    pub fn cusolverDnSXgels_bufferSize(
2933        handle: cusolverDnHandle_t,
2934        m: cusolver_int_t,
2935        n: cusolver_int_t,
2936        nrhs: cusolver_int_t,
2937        dA: *mut f32,
2938        ldda: cusolver_int_t,
2939        dB: *mut f32,
2940        lddb: cusolver_int_t,
2941        dX: *mut f32,
2942        lddx: cusolver_int_t,
2943        dWorkspace: *mut ::core::ffi::c_void,
2944        lwork_bytes: *mut size_t,
2945    ) -> cusolverStatus_t;
2946}
2947unsafe extern "C" {
2948    /// This function is designed to perform same functionality as `cusolverDn<T1><T2>gesv()` functions, but wrapped in a more generic and expert interface that gives user more control to parametrize the function as well as it provides more information on output. [`cusolverDnIRSXgesv`] allows additional control of the solver parameters such as setting:
2949    ///
2950    /// * the main precision (Inputs/Outputs precision) of the solver
2951    /// * the lowest precision to be used internally by the solver
2952    /// * the refinement solver type
2953    /// * the maximum allowed number of iterations in the refinement phase
2954    /// * the tolerance of the refinement solver
2955    /// * the fallback to main precision
2956    /// * and more
2957    ///
2958    /// through the configuration parameters structure `gesv_irs_params` and its helper functions. For more details about what configuration can be set and its meaning please refer to all the functions in the cuSolverDN Helper Function Section that start with `cusolverDnIRSParamsxxxx()`. Moreover, [`cusolverDnIRSXgesv`] provides additional information on the output such as the convergence history (e.g., the residual norms) at each iteration and the number of iterations needed to converge. For more details about what information can be retrieved and its meaning please refer to all the functions in the cuSolverDN Helper Function Section that start with `cusolverDnIRSInfosxxxx()`
2959    ///
2960    /// The function returns value describes the results of the solving process. A [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`] indicates that the function finished with success otherwise, it indicates if one of the API arguments is incorrect, or if the configurations of params/infos structure is incorrect or if the function did not finish with success. More details about the error can be found by checking the `niters` and the `dinfo` API parameters. See their description below for further details. User should provide the required workspace allocated on device for the [`cusolverDnIRSXgesv`] function. The amount of bytes required for the function can be queried by calling the respective function [`cusolverDnIRSXgesv_bufferSize`]. Note that, if the user would like a particular configuration to be set via the params structure, it should be set before the call to [`cusolverDnIRSXgesv_bufferSize`] to get the size of the required workspace.
2961    ///
2962    /// Tensor Float (TF32), introduced with NVIDIA Ampere architecture GPUs, is the most robust tensor core accelerated compute mode for the iterative refinement solver. It is able to solve the widest range of problems in HPC arising from different applications and provides up to 4X and 5X speedup for real and complex systems, respectively. On Volta and Turing architecture GPUs, half precision tensor core acceleration is recommended. In cases where the iterative refinement solver fails to converge to the desired accuracy (main precision, INOUT data precision), it is recommended to use main precision as internal lowest precision.
2963    ///
2964    /// The following table provides all possible combinations values for the lowest precision corresponding to the Inputs/Outputs data type. Note that if the lowest precision matches the Inputs/Outputs datatype, then the main precision factorization will be used.
2965    ///
2966    /// **Supported Inputs/Outputs data type and lower precision for the IRS solver**
2967    ///
2968    /// | **Inputs/Outputs Data Type (e.g., main precision)** | **Supported values for the lowest precision** |
2969    /// | --- | --- |
2970    /// | [`cusolverPrecType_t::CUSOLVER_C_64F`] | `CUSOLVER_C_64F, CUSOLVER_C_32F, CUSOLVER_C_16F, CUSOLVER_C_16BF, CUSOLVER_C_TF32` |
2971    /// | [`cusolverPrecType_t::CUSOLVER_C_32F`] | `CUSOLVER_C_32F, CUSOLVER_C_16F, CUSOLVER_C_16BF, CUSOLVER_C_TF32` |
2972    /// | [`cusolverPrecType_t::CUSOLVER_R_64F`] | `CUSOLVER_R_64F, CUSOLVER_R_32F, CUSOLVER_R_16F, CUSOLVER_R_16BF, CUSOLVER_R_TF32` |
2973    /// | [`cusolverPrecType_t::CUSOLVER_R_32F`] | `CUSOLVER_R_32F, CUSOLVER_R_16F, CUSOLVER_R_16BF, CUSOLVER_R_TF32` |
2974    ///
2975    /// The [`cusolverDnIRSXgesv_bufferSize`] function returns the required workspace buffer size in bytes for the corresponding `cusolverDnXgesv()` call with the given `gesv_irs_params` configuration.
2976    ///
2977    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The operation completed successfully.
2978    ///
2979    /// [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]:   The library was not initialized.
2980    ///
2981    /// [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]:   Invalid parameters were passed, for example:
2982    ///
2983    /// * `n<0`
2984    /// * `lda<max(1,n)`
2985    /// * `ldb<max(1,n)`
2986    /// * `ldx<max(1,n)`
2987    ///
2988    /// [`cusolverStatus_t::CUSOLVER_STATUS_ARCH_MISMATCH`]:   The IRS solver supports compute capability 7.0 and above. The lowest precision options CUSOLVER_[CR]_16BF and CUSOLVER_[CR]_TF32 are only available on compute capability 8.0 and above.
2989    ///
2990    /// [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_WORKSPACE`]:   `lwork_bytes` is smaller than the required workspace. Could happen if the users called [`cusolverDnIRSXgesv_bufferSize`] function, then changed some of the configurations setting such as the lowest precision.
2991    ///
2992    /// [`cusolverStatus_t::CUSOLVER_STATUS_IRS_OUT_OF_RANGE`]:   Numerical error related to niters <0, see niters description for more details.
2993    ///
2994    /// [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]:   An internal error occurred, check the `dinfo` and the `niters` arguments for more details.
2995    ///
2996    /// [`cusolverStatus_t::CUSOLVER_STATUS_IRS_PARAMS_NOT_INITIALIZED`]:   The configuration parameter `gesv_irs_params` structure was not created.
2997    ///
2998    /// [`cusolverStatus_t::CUSOLVER_STATUS_IRS_PARAMS_INVALID`]:   One of the configuration parameter in the `gesv_irs_params` structure is not valid.
2999    ///
3000    /// [`cusolverStatus_t::CUSOLVER_STATUS_IRS_PARAMS_INVALID_PREC`]:   The main and/or the lowest precision configuration parameter in the `gesv_irs_params` structure is not valid, check the table above for the supported combinations.
3001    ///
3002    /// [`cusolverStatus_t::CUSOLVER_STATUS_IRS_PARAMS_INVALID_MAXITER`]:   The maxiter configuration parameter in the `gesv_irs_params` structure is not valid.
3003    ///
3004    /// [`cusolverStatus_t::CUSOLVER_STATUS_IRS_PARAMS_INVALID_REFINE`]:   The refinement solver configuration parameter in the `gesv_irs_params` structure is not valid.
3005    ///
3006    /// [`cusolverStatus_t::CUSOLVER_STATUS_IRS_NOT_SUPPORTED`]:   One of the configuration parameter in the `gesv_irs_params` structure is not supported. For example if nrhs >1, and refinement solver was set to [`cusolverIRSRefinement_t::CUSOLVER_IRS_REFINE_GMRES`].
3007    ///
3008    /// [`cusolverStatus_t::CUSOLVER_STATUS_IRS_INFOS_NOT_INITIALIZED`]:   The information structure `gesv_irs_infos` was not created.
3009    ///
3010    /// [`cusolverStatus_t::CUSOLVER_STATUS_ALLOC_FAILED`]:   CPU memory allocation failed, most likely during the allocation of the residual array that store the residual norms.
3011    ///
3012    /// # Parameters
3013    ///
3014    /// - `handle`: Handle to the cusolverDn library context.
3015    /// - `gesv_irs_params`: Configuration parameters structure, can serve one or more calls to any IRS solver.
3016    /// - `gesv_irs_infos`: Info structure, where information about a particular solve will be stored. The `gesv_irs_infos` structure correspond to a particular call. Thus different calls requires different `gesv_irs_infos` structure otherwise, it will be overwritten.
3017    /// - `n`: Number of rows and columns of square matrix `A`. Should be non-negative.
3018    /// - `nrhs`: Number of right hand sides to solve. Should be non-negative. Note that, `nrhs` is limited to 1 if the selected IRS refinement solver is [`cusolverIRSRefinement_t::CUSOLVER_IRS_REFINE_GMRES`], [`cusolverIRSRefinement_t::CUSOLVER_IRS_REFINE_GMRES_GMRES`], [`cusolverIRSRefinement_t::CUSOLVER_IRS_REFINE_CLASSICAL_GMRES`].
3019    /// - `dA`: Matrix `A` with size `n-by-n`. Can’t be `NULL`. On return - will contain the factorization of the matrix A in the main precision (`A = P * L * U`, where P - permutation matrix defined by vector ipiv, L and U - lower and upper triangular matrices) if the iterative refinement solver was set to [`cusolverIRSRefinement_t::CUSOLVER_IRS_REFINE_NONE`] and the lowest precision is equal to the main precision (Inputs/Outputs datatype), or if the iterative refinement solver did not converge and the fallback to main precision was enabled (fallback enabled is the default setting); unchanged otherwise.
3020    /// - `ldda`: Leading dimension of two-dimensional array used to store matrix `A`. `lda >= n`.
3021    /// - `dB`: Set of right hand sides `B` of size `n-by-nrhs`. Can’t be `NULL`.
3022    /// - `lddb`: Leading dimension of two-dimensional array used to store matrix of right hand sides `B`. `ldb >= n`.
3023    /// - `dX`: Set of solution vectors `X` of size `n-by-nrhs`. Can’t be `NULL`.
3024    /// - `lddx`: Leading dimension of two-dimensional array used to store matrix of solution vectors `X`. `ldx >= n`.
3025    /// - `dWorkspace`: Pointer to an allocated workspace in device memory of size lwork_bytes.
3026    /// - `lwork_bytes`: Size of the allocated device workspace. Should be at least what was returned by [`cusolverDnIRSXgesv_bufferSize`] function.
3027    /// - `niters`: If iter is   * <0 : iterative refinement has failed, main precision (Inputs/Outputs precision) factorization has been performed if fallback is enabled. * -1 : taking into account machine parameters, n, nrhs, it is a priori not worth working in lower precision * -2 : overflow of an entry when moving from main to lower precision * -3 : failure during the factorization * -5 : overflow occurred during computation * -maxiter: solver stopped the iterative refinement after reaching maximum allowed iterations. * >0 : iter is a number of iterations solver performed to reach convergence criteria.
3028    ///
3029    /// # Return value
3030    ///
3031    /// - [`cusolverStatus_t::CUSOLVER_STATUS_ALLOC_FAILED`]: CPU memory allocation failed, most likely during the allocation of the residual array that store the residual norms.
3032    /// - [`cusolverStatus_t::CUSOLVER_STATUS_ARCH_MISMATCH`]: The IRS solver supports compute capability 7.0 and above. The lowest precision options CUSOLVER_[CR]_16BF and CUSOLVER_[CR]_TF32 are only available on compute capability 8.0 and above.
3033    /// - [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]: An internal error occurred, check the `dinfo` and the `niters` arguments for more details.
3034    /// - [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]: Invalid parameters were passed, for example:
3035    ///
3036    /// * `n<0`
3037    /// * `lda<max(1,n)`
3038    /// * `ldb<max(1,n)`
3039    /// * `ldx<max(1,n)`.
3040    /// - [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_WORKSPACE`]: `lwork_bytes` is smaller than the required workspace. Could happen if the users called [`cusolverDnIRSXgesv_bufferSize`] function, then changed some of the configurations setting such as the lowest precision.
3041    /// - [`cusolverStatus_t::CUSOLVER_STATUS_IRS_INFOS_NOT_INITIALIZED`]: The information structure `gesv_irs_infos` was not created.
3042    /// - [`cusolverStatus_t::CUSOLVER_STATUS_IRS_NOT_SUPPORTED`]: One of the configuration parameter in the `gesv_irs_params` structure is not supported. For example if nrhs >1, and refinement solver was set to [`cusolverIRSRefinement_t::CUSOLVER_IRS_REFINE_GMRES`].
3043    /// - [`cusolverStatus_t::CUSOLVER_STATUS_IRS_OUT_OF_RANGE`]: Numerical error related to niters <0, see niters description for more details.
3044    /// - [`cusolverStatus_t::CUSOLVER_STATUS_IRS_PARAMS_INVALID`]: One of the configuration parameter in the `gesv_irs_params` structure is not valid.
3045    /// - [`cusolverStatus_t::CUSOLVER_STATUS_IRS_PARAMS_INVALID_MAXITER`]: The maxiter configuration parameter in the `gesv_irs_params` structure is not valid.
3046    /// - [`cusolverStatus_t::CUSOLVER_STATUS_IRS_PARAMS_INVALID_PREC`]: The main and/or the lowest precision configuration parameter in the `gesv_irs_params` structure is not valid, check the table above for the supported combinations.
3047    /// - [`cusolverStatus_t::CUSOLVER_STATUS_IRS_PARAMS_INVALID_REFINE`]: The refinement solver configuration parameter in the `gesv_irs_params` structure is not valid.
3048    /// - [`cusolverStatus_t::CUSOLVER_STATUS_IRS_PARAMS_NOT_INITIALIZED`]: The configuration parameter `gesv_irs_params` structure was not created.
3049    /// - [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]: The library was not initialized.
3050    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The operation completed successfully.
3051    pub fn cusolverDnIRSXgesv(
3052        handle: cusolverDnHandle_t,
3053        gesv_irs_params: cusolverDnIRSParams_t,
3054        gesv_irs_infos: cusolverDnIRSInfos_t,
3055        n: cusolver_int_t,
3056        nrhs: cusolver_int_t,
3057        dA: *mut ::core::ffi::c_void,
3058        ldda: cusolver_int_t,
3059        dB: *mut ::core::ffi::c_void,
3060        lddb: cusolver_int_t,
3061        dX: *mut ::core::ffi::c_void,
3062        lddx: cusolver_int_t,
3063        dWorkspace: *mut ::core::ffi::c_void,
3064        lwork_bytes: size_t,
3065        niters: *mut cusolver_int_t,
3066        d_info: *mut cusolver_int_t,
3067    ) -> cusolverStatus_t;
3068}
3069unsafe extern "C" {
3070    pub fn cusolverDnIRSXgesv_bufferSize(
3071        handle: cusolverDnHandle_t,
3072        params: cusolverDnIRSParams_t,
3073        n: cusolver_int_t,
3074        nrhs: cusolver_int_t,
3075        lwork_bytes: *mut size_t,
3076    ) -> cusolverStatus_t;
3077}
3078unsafe extern "C" {
3079    /// This function is designed to perform same functionality as `cusolverDn<T1><T2>gels()` functions, but wrapped in a more generic and expert interface that gives user more control to parametrize the function as well as it provides more information on output. [`cusolverDnIRSXgels`] allows additional control of the solver parameters such as setting:
3080    ///
3081    /// * the main precision (Inputs/Outputs precision) of the solver,
3082    /// * the lowest precision to be used internally by the solver,
3083    /// * the refinement solver type
3084    /// * the maximum allowed number of iterations in the refinement phase
3085    /// * the tolerance of the refinement solver
3086    /// * the fallback to main precision
3087    /// * and others
3088    ///
3089    /// through the configuration parameters structure `gels_irs_params` and its helper functions. For more details about what configuration can be set and its meaning please refer to all the functions in the cuSolverDN Helper Function Section that start with `cusolverDnIRSParamsxxxx()`. Moreover, [`cusolverDnIRSXgels`] provides additional information on the output such as the convergence history (e.g., the residual norms) at each iteration and the number of iterations needed to converge. For more details about what information can be retrieved and its meaning please refer to all the functions in the cuSolverDN Helper Function Section that start with `cusolverDnIRSInfosxxxx()`.
3090    ///
3091    /// The function returns value describes the results of the solving process. A [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`] indicates that the function finished with success otherwise, it indicates if one of the API arguments is incorrect, or if the configurations of params/infos structure is incorrect or if the function did not finish with success. More details about the error can be found by checking the `niters` and the `dinfo` API parameters. See their description below for further details. Users should provide the required workspace allocated on device for the [`cusolverDnIRSXgels`] function. The amount of bytes required for the function can be queried by calling the respective function [`cusolverDnIRSXgels_bufferSize`]. Note that, if the user would like a particular configuration to be set via the params structure, it should be set before the call to [`cusolverDnIRSXgels_bufferSize`] to get the size of the required workspace.
3092    ///
3093    /// The following table provides all possible combinations values for the lowest precision corresponding to the Inputs/Outputs data type. Note that if the lowest precision matches the Inputs/Outputs datatype, then main precision factorization will be used
3094    ///
3095    /// Tensor Float (TF32), introduced with NVIDIA Ampere Architecture GPUs, is the most robust tensor core accelerated compute mode for the iterative refinement solver. It is able to solve the widest range of problems in HPC arising from different applications and provides up to 4X and 5X speedup for real and complex systems, respectively. On Volta and Turing architecture GPUs, half precision tensor core acceleration is recommended. In cases where the iterative refinement solver fails to converge to the desired accuracy (main precision, INOUT data precision), it is recommended to use main precision as internal lowest precision.
3096    ///
3097    /// **Supported Inputs/Outputs data type and lower precision for the IRS solver**
3098    ///
3099    /// | **Inputs/Outputs Data Type (e.g., main precision)** | **Supported values for the lowest precision** |
3100    /// | --- | --- |
3101    /// | [`cusolverPrecType_t::CUSOLVER_C_64F`] | `CUSOLVER_C_64F, CUSOLVER_C_32F, CUSOLVER_C_16F, CUSOLVER_C_16BF, CUSOLVER_C_TF32` |
3102    /// | [`cusolverPrecType_t::CUSOLVER_C_32F`] | `CUSOLVER_C_32F, CUSOLVER_C_16F, CUSOLVER_C_16BF, CUSOLVER_C_TF32` |
3103    /// | [`cusolverPrecType_t::CUSOLVER_R_64F`] | `CUSOLVER_R_64F, CUSOLVER_R_32F, CUSOLVER_R_16F, CUSOLVER_R_16BF, CUSOLVER_R_TF32` |
3104    /// | [`cusolverPrecType_t::CUSOLVER_R_32F`] | `CUSOLVER_R_32F, CUSOLVER_R_16F, CUSOLVER_R_16BF, CUSOLVER_R_TF32` |
3105    ///
3106    /// The [`cusolverDnIRSXgels_bufferSize`] function return the required workspace buffer size in bytes for the corresponding `cusolverDnXgels()` call with given `gels_irs_params` configuration.
3107    ///
3108    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The operation completed successfully.
3109    ///
3110    /// [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]:   The library was not initialized.
3111    ///
3112    /// [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]:   Invalid parameters were passed, for example:
3113    ///
3114    /// * `n<0`
3115    /// * `ldda<max(1,m)`
3116    /// * `lddb<max(1,m)`
3117    /// * `lddx<max(1,n)`
3118    ///
3119    /// [`cusolverStatus_t::CUSOLVER_STATUS_ARCH_MISMATCH`]:   The IRS solver supports compute capability 7.0 and above. The lowest precision options CUSOLVER_[CR]_16BF and CUSOLVER_[CR]_TF32 are only available on compute capability 8.0 and above.
3120    ///
3121    /// [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_WORKSPACE`]:   `lwork_bytes` is smaller than the required workspace. Could happen if the users called [`cusolverDnIRSXgels_bufferSize`] function, then changed some of the configurations setting such as the lowest precision.
3122    ///
3123    /// [`cusolverStatus_t::CUSOLVER_STATUS_IRS_OUT_OF_RANGE`]:   Numerical error related to `niters` <0; see `niters` description for more details.
3124    ///
3125    /// [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]:   An internal error occurred, check the `dinfo` and the `niters` arguments for more details.
3126    ///
3127    /// [`cusolverStatus_t::CUSOLVER_STATUS_IRS_PARAMS_NOT_INITIALIZED`]:   The configuration parameter `gels_irs_params` structure was not created.
3128    ///
3129    /// [`cusolverStatus_t::CUSOLVER_STATUS_IRS_PARAMS_INVALID`]:   One of the configuration parameter in the `gels_irs_params` structure is not valid.
3130    ///
3131    /// [`cusolverStatus_t::CUSOLVER_STATUS_IRS_PARAMS_INVALID_PREC`]:   The main and/or the lowest precision configuration parameter in the `gels_irs_params` structure is not valid, check the table above for the supported combinations.
3132    ///
3133    /// [`cusolverStatus_t::CUSOLVER_STATUS_IRS_PARAMS_INVALID_MAXITER`]:   The maxiter configuration parameter in the `gels_irs_params` structure is not valid.
3134    ///
3135    /// [`cusolverStatus_t::CUSOLVER_STATUS_IRS_PARAMS_INVALID_REFINE`]:   The refinement solver configuration parameter in the `gels_irs_params` structure is not valid.
3136    ///
3137    /// [`cusolverStatus_t::CUSOLVER_STATUS_IRS_NOT_SUPPORTED`]:   One of the configuration parameter in the `gels_irs_params` structure is not supported. For example if nrhs >1, and refinement solver was set to [`cusolverIRSRefinement_t::CUSOLVER_IRS_REFINE_GMRES`].
3138    ///
3139    /// [`cusolverStatus_t::CUSOLVER_STATUS_IRS_INFOS_NOT_INITIALIZED`]:   The information structure `gels_irs_infos` was not created.
3140    ///
3141    /// [`cusolverStatus_t::CUSOLVER_STATUS_ALLOC_FAILED`]:   CPU memory allocation failed, most likely during the allocation of the residual array that store the residual norms.
3142    ///
3143    /// # Parameters
3144    ///
3145    /// - `handle`: Handle to the cusolverDn library context.
3146    /// - `gels_irs_params`: Configuration parameters structure, can serve one or more calls to any IRS solver.
3147    /// - `gels_irs_infos`: Info structure, where information about a particular solve will be stored. The `gels_irs_infos` structure correspond to a particular call. Thus different calls requires different `gels_irs_infos` structure otherwise, it will be overwritten.
3148    /// - `m`: Number of rows of the matrix `A`. Should be non-negative and n<=m.
3149    /// - `n`: Number of columns of the matrix `A`. Should be non-negative and n<=m.
3150    /// - `nrhs`: Number of right hand sides to solve. Should be non-negative. Note that, `nrhs` is limited to 1 if the selected IRS refinement solver is [`cusolverIRSRefinement_t::CUSOLVER_IRS_REFINE_GMRES`], [`cusolverIRSRefinement_t::CUSOLVER_IRS_REFINE_GMRES_GMRES`], [`cusolverIRSRefinement_t::CUSOLVER_IRS_REFINE_CLASSICAL_GMRES`].
3151    /// - `dA`: Matrix `A` with size `m-by-n`. Can’t be `NULL`. On return - unchanged if the lowest precision is not equal to the main precision and the iterative refinement solver converged, - garbage otherwise.
3152    /// - `ldda`: Leading dimension of two-dimensional array used to store matrix `A`. `ldda >= m`.
3153    /// - `dB`: Set of right hand sides `B` of size `m-by-nrhs`. Can’t be `NULL`.
3154    /// - `lddb`: Leading dimension of two-dimensional array used to store matrix of right hand sides `B`. `lddb >= max(1,m)`.
3155    /// - `dX`: Set of solution vectors `X` of size `n-by-nrhs`. Can’t be `NULL`.
3156    /// - `lddx`: Leading dimension of two-dimensional array used to store matrix of solution vectors `X`. `lddx >= max(1,n)`.
3157    /// - `dWorkspace`: Pointer to an allocated workspace in device memory of size lwork_bytes.
3158    /// - `lwork_bytes`: Size of the allocated device workspace. Should be at least what was returned by [`cusolverDnIRSXgels_bufferSize`] function.
3159    /// - `niters`: If `iter` is   * <0 : iterative refinement has failed, main precision (Inputs/Outputs precision) factorization has been performed if fallback is enabled * -1 : taking into account machine parameters, n, nrhs, it is a priori not worth working in lower precision * -2 : overflow of an entry when moving from main to lower precision * -3 : failure during the factorization * -5 : overflow occurred during computation * `-maxiter`: solver stopped the iterative refinement after reaching maximum allowed iterations * >0 : iter is a number of iterations solver performed to reach convergence criteria.
3160    ///
3161    /// # Return value
3162    ///
3163    /// - [`cusolverStatus_t::CUSOLVER_STATUS_ALLOC_FAILED`]: CPU memory allocation failed, most likely during the allocation of the residual array that store the residual norms.
3164    /// - [`cusolverStatus_t::CUSOLVER_STATUS_ARCH_MISMATCH`]: The IRS solver supports compute capability 7.0 and above. The lowest precision options CUSOLVER_[CR]_16BF and CUSOLVER_[CR]_TF32 are only available on compute capability 8.0 and above.
3165    /// - [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]: An internal error occurred, check the `dinfo` and the `niters` arguments for more details.
3166    /// - [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]: Invalid parameters were passed, for example:
3167    ///
3168    /// * `n<0`
3169    /// * `ldda<max(1,m)`
3170    /// * `lddb<max(1,m)`
3171    /// * `lddx<max(1,n)`.
3172    /// - [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_WORKSPACE`]: `lwork_bytes` is smaller than the required workspace. Could happen if the users called [`cusolverDnIRSXgels_bufferSize`] function, then changed some of the configurations setting such as the lowest precision.
3173    /// - [`cusolverStatus_t::CUSOLVER_STATUS_IRS_INFOS_NOT_INITIALIZED`]: The information structure `gels_irs_infos` was not created.
3174    /// - [`cusolverStatus_t::CUSOLVER_STATUS_IRS_NOT_SUPPORTED`]: One of the configuration parameter in the `gels_irs_params` structure is not supported. For example if nrhs >1, and refinement solver was set to [`cusolverIRSRefinement_t::CUSOLVER_IRS_REFINE_GMRES`].
3175    /// - [`cusolverStatus_t::CUSOLVER_STATUS_IRS_OUT_OF_RANGE`]: Numerical error related to `niters` <0; see `niters` description for more details.
3176    /// - [`cusolverStatus_t::CUSOLVER_STATUS_IRS_PARAMS_INVALID`]: One of the configuration parameter in the `gels_irs_params` structure is not valid.
3177    /// - [`cusolverStatus_t::CUSOLVER_STATUS_IRS_PARAMS_INVALID_MAXITER`]: The maxiter configuration parameter in the `gels_irs_params` structure is not valid.
3178    /// - [`cusolverStatus_t::CUSOLVER_STATUS_IRS_PARAMS_INVALID_PREC`]: The main and/or the lowest precision configuration parameter in the `gels_irs_params` structure is not valid, check the table above for the supported combinations.
3179    /// - [`cusolverStatus_t::CUSOLVER_STATUS_IRS_PARAMS_INVALID_REFINE`]: The refinement solver configuration parameter in the `gels_irs_params` structure is not valid.
3180    /// - [`cusolverStatus_t::CUSOLVER_STATUS_IRS_PARAMS_NOT_INITIALIZED`]: The configuration parameter `gels_irs_params` structure was not created.
3181    /// - [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]: The library was not initialized.
3182    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The operation completed successfully.
3183    pub fn cusolverDnIRSXgels(
3184        handle: cusolverDnHandle_t,
3185        gels_irs_params: cusolverDnIRSParams_t,
3186        gels_irs_infos: cusolverDnIRSInfos_t,
3187        m: cusolver_int_t,
3188        n: cusolver_int_t,
3189        nrhs: cusolver_int_t,
3190        dA: *mut ::core::ffi::c_void,
3191        ldda: cusolver_int_t,
3192        dB: *mut ::core::ffi::c_void,
3193        lddb: cusolver_int_t,
3194        dX: *mut ::core::ffi::c_void,
3195        lddx: cusolver_int_t,
3196        dWorkspace: *mut ::core::ffi::c_void,
3197        lwork_bytes: size_t,
3198        niters: *mut cusolver_int_t,
3199        d_info: *mut cusolver_int_t,
3200    ) -> cusolverStatus_t;
3201}
3202unsafe extern "C" {
3203    pub fn cusolverDnIRSXgels_bufferSize(
3204        handle: cusolverDnHandle_t,
3205        params: cusolverDnIRSParams_t,
3206        m: cusolver_int_t,
3207        n: cusolver_int_t,
3208        nrhs: cusolver_int_t,
3209        lwork_bytes: *mut size_t,
3210    ) -> cusolverStatus_t;
3211}
3212unsafe extern "C" {
3213    pub fn cusolverDnSpotrf_bufferSize(
3214        handle: cusolverDnHandle_t,
3215        uplo: cublasFillMode_t,
3216        n: ::core::ffi::c_int,
3217        A: *mut f32,
3218        lda: ::core::ffi::c_int,
3219        Lwork: *mut ::core::ffi::c_int,
3220    ) -> cusolverStatus_t;
3221}
3222unsafe extern "C" {
3223    pub fn cusolverDnDpotrf_bufferSize(
3224        handle: cusolverDnHandle_t,
3225        uplo: cublasFillMode_t,
3226        n: ::core::ffi::c_int,
3227        A: *mut f64,
3228        lda: ::core::ffi::c_int,
3229        Lwork: *mut ::core::ffi::c_int,
3230    ) -> cusolverStatus_t;
3231}
3232unsafe extern "C" {
3233    pub fn cusolverDnCpotrf_bufferSize(
3234        handle: cusolverDnHandle_t,
3235        uplo: cublasFillMode_t,
3236        n: ::core::ffi::c_int,
3237        A: *mut cuComplex,
3238        lda: ::core::ffi::c_int,
3239        Lwork: *mut ::core::ffi::c_int,
3240    ) -> cusolverStatus_t;
3241}
3242unsafe extern "C" {
3243    pub fn cusolverDnZpotrf_bufferSize(
3244        handle: cusolverDnHandle_t,
3245        uplo: cublasFillMode_t,
3246        n: ::core::ffi::c_int,
3247        A: *mut cuDoubleComplex,
3248        lda: ::core::ffi::c_int,
3249        Lwork: *mut ::core::ffi::c_int,
3250    ) -> cusolverStatus_t;
3251}
3252unsafe extern "C" {
3253    /// These helper functions calculate the necessary size of work buffers.
3254    ///
3255    /// The S and D data types are real valued single and double precision, respectively.
3256    ///
3257    /// The C and Z data types are complex valued single and double precision, respectively.
3258    ///
3259    /// This function computes the Cholesky factorization of a Hermitian positive-definite matrix.
3260    ///
3261    /// `A` is an $n \times n$ Hermitian matrix, only the lower or upper part is meaningful. The input parameter `uplo` indicates which part of the matrix is used. The function will leave the other part untouched.
3262    ///
3263    /// If input parameter `uplo` is [`cublasFillMode_t::CUBLAS_FILL_MODE_LOWER`], only the lower triangular part of `A` is processed, and replaced by the lower triangular Cholesky factor `L`.
3264    ///
3265    /// $$
3266    /// A = L\\*L^{H}
3267    /// $$
3268    /// If input parameter `uplo` is [`cublasFillMode_t::CUBLAS_FILL_MODE_UPPER`], only upper triangular part of `A` is processed, and replaced by upper triangular Cholesky factor `U`.
3269    ///
3270    /// $$
3271    /// A = U^{H}\\*U
3272    /// $$
3273    /// The user has to provide working space which is pointed by input parameter `Workspace`. The input parameter `Lwork` is size of the working space, and it is returned by `potrf_bufferSize()`.
3274    ///
3275    /// If Cholesky factorization failed, i.e. some leading minor of `A` is not positive definite, or equivalently some diagonal elements of `L` or `U` is not a real number. The output parameter `devInfo` would indicate smallest leading minor of `A` which is not positive definite.
3276    ///
3277    /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
3278    ///
3279    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The operation completed successfully.
3280    ///
3281    /// [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]:   The library was not initialized.
3282    ///
3283    /// [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]:   Invalid parameters were passed (`n<0` or `lda<max(1,n)`).
3284    ///
3285    /// [`cusolverStatus_t::CUSOLVER_STATUS_ARCH_MISMATCH`]:   The device only supports compute capability 5.0 and above.
3286    ///
3287    /// [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]:   An internal operation failed.
3288    pub fn cusolverDnSpotrf(
3289        handle: cusolverDnHandle_t,
3290        uplo: cublasFillMode_t,
3291        n: ::core::ffi::c_int,
3292        A: *mut f32,
3293        lda: ::core::ffi::c_int,
3294        Workspace: *mut f32,
3295        Lwork: ::core::ffi::c_int,
3296        devInfo: *mut ::core::ffi::c_int,
3297    ) -> cusolverStatus_t;
3298}
3299unsafe extern "C" {
3300    /// These helper functions calculate the necessary size of work buffers.
3301    ///
3302    /// The S and D data types are real valued single and double precision, respectively.
3303    ///
3304    /// The C and Z data types are complex valued single and double precision, respectively.
3305    ///
3306    /// This function computes the Cholesky factorization of a Hermitian positive-definite matrix.
3307    ///
3308    /// `A` is an $n \times n$ Hermitian matrix, only the lower or upper part is meaningful. The input parameter `uplo` indicates which part of the matrix is used. The function will leave the other part untouched.
3309    ///
3310    /// If input parameter `uplo` is [`cublasFillMode_t::CUBLAS_FILL_MODE_LOWER`], only the lower triangular part of `A` is processed, and replaced by the lower triangular Cholesky factor `L`.
3311    ///
3312    /// $$
3313    /// A = L\\*L^{H}
3314    /// $$
3315    /// If input parameter `uplo` is [`cublasFillMode_t::CUBLAS_FILL_MODE_UPPER`], only upper triangular part of `A` is processed, and replaced by upper triangular Cholesky factor `U`.
3316    ///
3317    /// $$
3318    /// A = U^{H}\\*U
3319    /// $$
3320    /// The user has to provide working space which is pointed by input parameter `Workspace`. The input parameter `Lwork` is size of the working space, and it is returned by `potrf_bufferSize()`.
3321    ///
3322    /// If Cholesky factorization failed, i.e. some leading minor of `A` is not positive definite, or equivalently some diagonal elements of `L` or `U` is not a real number. The output parameter `devInfo` would indicate smallest leading minor of `A` which is not positive definite.
3323    ///
3324    /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
3325    ///
3326    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The operation completed successfully.
3327    ///
3328    /// [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]:   The library was not initialized.
3329    ///
3330    /// [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]:   Invalid parameters were passed (`n<0` or `lda<max(1,n)`).
3331    ///
3332    /// [`cusolverStatus_t::CUSOLVER_STATUS_ARCH_MISMATCH`]:   The device only supports compute capability 5.0 and above.
3333    ///
3334    /// [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]:   An internal operation failed.
3335    pub fn cusolverDnDpotrf(
3336        handle: cusolverDnHandle_t,
3337        uplo: cublasFillMode_t,
3338        n: ::core::ffi::c_int,
3339        A: *mut f64,
3340        lda: ::core::ffi::c_int,
3341        Workspace: *mut f64,
3342        Lwork: ::core::ffi::c_int,
3343        devInfo: *mut ::core::ffi::c_int,
3344    ) -> cusolverStatus_t;
3345}
3346unsafe extern "C" {
3347    /// These helper functions calculate the necessary size of work buffers.
3348    ///
3349    /// The S and D data types are real valued single and double precision, respectively.
3350    ///
3351    /// The C and Z data types are complex valued single and double precision, respectively.
3352    ///
3353    /// This function computes the Cholesky factorization of a Hermitian positive-definite matrix.
3354    ///
3355    /// `A` is an $n \times n$ Hermitian matrix, only the lower or upper part is meaningful. The input parameter `uplo` indicates which part of the matrix is used. The function will leave the other part untouched.
3356    ///
3357    /// If input parameter `uplo` is [`cublasFillMode_t::CUBLAS_FILL_MODE_LOWER`], only the lower triangular part of `A` is processed, and replaced by the lower triangular Cholesky factor `L`.
3358    ///
3359    /// $$
3360    /// A = L\\*L^{H}
3361    /// $$
3362    /// If input parameter `uplo` is [`cublasFillMode_t::CUBLAS_FILL_MODE_UPPER`], only upper triangular part of `A` is processed, and replaced by upper triangular Cholesky factor `U`.
3363    ///
3364    /// $$
3365    /// A = U^{H}\\*U
3366    /// $$
3367    /// The user has to provide working space which is pointed by input parameter `Workspace`. The input parameter `Lwork` is size of the working space, and it is returned by `potrf_bufferSize()`.
3368    ///
3369    /// If Cholesky factorization failed, i.e. some leading minor of `A` is not positive definite, or equivalently some diagonal elements of `L` or `U` is not a real number. The output parameter `devInfo` would indicate smallest leading minor of `A` which is not positive definite.
3370    ///
3371    /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
3372    ///
3373    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The operation completed successfully.
3374    ///
3375    /// [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]:   The library was not initialized.
3376    ///
3377    /// [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]:   Invalid parameters were passed (`n<0` or `lda<max(1,n)`).
3378    ///
3379    /// [`cusolverStatus_t::CUSOLVER_STATUS_ARCH_MISMATCH`]:   The device only supports compute capability 5.0 and above.
3380    ///
3381    /// [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]:   An internal operation failed.
3382    pub fn cusolverDnCpotrf(
3383        handle: cusolverDnHandle_t,
3384        uplo: cublasFillMode_t,
3385        n: ::core::ffi::c_int,
3386        A: *mut cuComplex,
3387        lda: ::core::ffi::c_int,
3388        Workspace: *mut cuComplex,
3389        Lwork: ::core::ffi::c_int,
3390        devInfo: *mut ::core::ffi::c_int,
3391    ) -> cusolverStatus_t;
3392}
3393unsafe extern "C" {
3394    /// These helper functions calculate the necessary size of work buffers.
3395    ///
3396    /// The S and D data types are real valued single and double precision, respectively.
3397    ///
3398    /// The C and Z data types are complex valued single and double precision, respectively.
3399    ///
3400    /// This function computes the Cholesky factorization of a Hermitian positive-definite matrix.
3401    ///
3402    /// `A` is an $n \times n$ Hermitian matrix, only the lower or upper part is meaningful. The input parameter `uplo` indicates which part of the matrix is used. The function will leave the other part untouched.
3403    ///
3404    /// If input parameter `uplo` is [`cublasFillMode_t::CUBLAS_FILL_MODE_LOWER`], only the lower triangular part of `A` is processed, and replaced by the lower triangular Cholesky factor `L`.
3405    ///
3406    /// $$
3407    /// A = L\\*L^{H}
3408    /// $$
3409    /// If input parameter `uplo` is [`cublasFillMode_t::CUBLAS_FILL_MODE_UPPER`], only upper triangular part of `A` is processed, and replaced by upper triangular Cholesky factor `U`.
3410    ///
3411    /// $$
3412    /// A = U^{H}\\*U
3413    /// $$
3414    /// The user has to provide working space which is pointed by input parameter `Workspace`. The input parameter `Lwork` is size of the working space, and it is returned by `potrf_bufferSize()`.
3415    ///
3416    /// If Cholesky factorization failed, i.e. some leading minor of `A` is not positive definite, or equivalently some diagonal elements of `L` or `U` is not a real number. The output parameter `devInfo` would indicate smallest leading minor of `A` which is not positive definite.
3417    ///
3418    /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
3419    ///
3420    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The operation completed successfully.
3421    ///
3422    /// [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]:   The library was not initialized.
3423    ///
3424    /// [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]:   Invalid parameters were passed (`n<0` or `lda<max(1,n)`).
3425    ///
3426    /// [`cusolverStatus_t::CUSOLVER_STATUS_ARCH_MISMATCH`]:   The device only supports compute capability 5.0 and above.
3427    ///
3428    /// [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]:   An internal operation failed.
3429    pub fn cusolverDnZpotrf(
3430        handle: cusolverDnHandle_t,
3431        uplo: cublasFillMode_t,
3432        n: ::core::ffi::c_int,
3433        A: *mut cuDoubleComplex,
3434        lda: ::core::ffi::c_int,
3435        Workspace: *mut cuDoubleComplex,
3436        Lwork: ::core::ffi::c_int,
3437        devInfo: *mut ::core::ffi::c_int,
3438    ) -> cusolverStatus_t;
3439}
3440unsafe extern "C" {
3441    /// This function solves a system of linear equations:
3442    ///
3443    /// $$
3444    /// A\\*X = B
3445    /// $$
3446    /// where `A` is an $n \times n$ Hermitian matrix, only lower or upper part is meaningful. The input parameter `uplo` indicates which part of the matrix is used. The function will leave the other part untouched.
3447    ///
3448    /// The user has to call `potrf` first to factorize matrix `A`. If input parameter `uplo` is [`cublasFillMode_t::CUBLAS_FILL_MODE_LOWER`], `A` is lower triangular Cholesky factor `L` corresponding to $A = L\\*L^H$. If input parameter `uplo` is [`cublasFillMode_t::CUBLAS_FILL_MODE_UPPER`], `A` is upper triangular Cholesky factor `U` corresponding to $A = U^{H}\\*U$.
3449    ///
3450    /// The operation is in-place, i.e. matrix `X` overwrites matrix `B` with the same leading dimension `ldb`.
3451    ///
3452    /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
3453    ///
3454    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The operation completed successfully.
3455    ///
3456    /// [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]:   The library was not initialized.
3457    ///
3458    /// [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]:   Invalid parameters were passed (`n<0`, `nrhs<0`, `lda<max(1,n)` or `ldb<max(1,n)`).
3459    ///
3460    /// [`cusolverStatus_t::CUSOLVER_STATUS_ARCH_MISMATCH`]:   The device only supports compute capability 5.0 and above.
3461    ///
3462    /// [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]:   An internal operation failed.
3463    pub fn cusolverDnSpotrs(
3464        handle: cusolverDnHandle_t,
3465        uplo: cublasFillMode_t,
3466        n: ::core::ffi::c_int,
3467        nrhs: ::core::ffi::c_int,
3468        A: *const f32,
3469        lda: ::core::ffi::c_int,
3470        B: *mut f32,
3471        ldb: ::core::ffi::c_int,
3472        devInfo: *mut ::core::ffi::c_int,
3473    ) -> cusolverStatus_t;
3474}
3475unsafe extern "C" {
3476    /// This function solves a system of linear equations:
3477    ///
3478    /// $$
3479    /// A\\*X = B
3480    /// $$
3481    /// where `A` is an $n \times n$ Hermitian matrix, only lower or upper part is meaningful. The input parameter `uplo` indicates which part of the matrix is used. The function will leave the other part untouched.
3482    ///
3483    /// The user has to call `potrf` first to factorize matrix `A`. If input parameter `uplo` is [`cublasFillMode_t::CUBLAS_FILL_MODE_LOWER`], `A` is lower triangular Cholesky factor `L` corresponding to $A = L\\*L^H$. If input parameter `uplo` is [`cublasFillMode_t::CUBLAS_FILL_MODE_UPPER`], `A` is upper triangular Cholesky factor `U` corresponding to $A = U^{H}\\*U$.
3484    ///
3485    /// The operation is in-place, i.e. matrix `X` overwrites matrix `B` with the same leading dimension `ldb`.
3486    ///
3487    /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
3488    ///
3489    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The operation completed successfully.
3490    ///
3491    /// [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]:   The library was not initialized.
3492    ///
3493    /// [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]:   Invalid parameters were passed (`n<0`, `nrhs<0`, `lda<max(1,n)` or `ldb<max(1,n)`).
3494    ///
3495    /// [`cusolverStatus_t::CUSOLVER_STATUS_ARCH_MISMATCH`]:   The device only supports compute capability 5.0 and above.
3496    ///
3497    /// [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]:   An internal operation failed.
3498    pub fn cusolverDnDpotrs(
3499        handle: cusolverDnHandle_t,
3500        uplo: cublasFillMode_t,
3501        n: ::core::ffi::c_int,
3502        nrhs: ::core::ffi::c_int,
3503        A: *const f64,
3504        lda: ::core::ffi::c_int,
3505        B: *mut f64,
3506        ldb: ::core::ffi::c_int,
3507        devInfo: *mut ::core::ffi::c_int,
3508    ) -> cusolverStatus_t;
3509}
3510unsafe extern "C" {
3511    /// This function solves a system of linear equations:
3512    ///
3513    /// $$
3514    /// A\\*X = B
3515    /// $$
3516    /// where `A` is an $n \times n$ Hermitian matrix, only lower or upper part is meaningful. The input parameter `uplo` indicates which part of the matrix is used. The function will leave the other part untouched.
3517    ///
3518    /// The user has to call `potrf` first to factorize matrix `A`. If input parameter `uplo` is [`cublasFillMode_t::CUBLAS_FILL_MODE_LOWER`], `A` is lower triangular Cholesky factor `L` corresponding to $A = L\\*L^H$. If input parameter `uplo` is [`cublasFillMode_t::CUBLAS_FILL_MODE_UPPER`], `A` is upper triangular Cholesky factor `U` corresponding to $A = U^{H}\\*U$.
3519    ///
3520    /// The operation is in-place, i.e. matrix `X` overwrites matrix `B` with the same leading dimension `ldb`.
3521    ///
3522    /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
3523    ///
3524    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The operation completed successfully.
3525    ///
3526    /// [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]:   The library was not initialized.
3527    ///
3528    /// [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]:   Invalid parameters were passed (`n<0`, `nrhs<0`, `lda<max(1,n)` or `ldb<max(1,n)`).
3529    ///
3530    /// [`cusolverStatus_t::CUSOLVER_STATUS_ARCH_MISMATCH`]:   The device only supports compute capability 5.0 and above.
3531    ///
3532    /// [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]:   An internal operation failed.
3533    pub fn cusolverDnCpotrs(
3534        handle: cusolverDnHandle_t,
3535        uplo: cublasFillMode_t,
3536        n: ::core::ffi::c_int,
3537        nrhs: ::core::ffi::c_int,
3538        A: *const cuComplex,
3539        lda: ::core::ffi::c_int,
3540        B: *mut cuComplex,
3541        ldb: ::core::ffi::c_int,
3542        devInfo: *mut ::core::ffi::c_int,
3543    ) -> cusolverStatus_t;
3544}
3545unsafe extern "C" {
3546    /// This function solves a system of linear equations:
3547    ///
3548    /// $$
3549    /// A\\*X = B
3550    /// $$
3551    /// where `A` is an $n \times n$ Hermitian matrix, only lower or upper part is meaningful. The input parameter `uplo` indicates which part of the matrix is used. The function will leave the other part untouched.
3552    ///
3553    /// The user has to call `potrf` first to factorize matrix `A`. If input parameter `uplo` is [`cublasFillMode_t::CUBLAS_FILL_MODE_LOWER`], `A` is lower triangular Cholesky factor `L` corresponding to $A = L\\*L^H$. If input parameter `uplo` is [`cublasFillMode_t::CUBLAS_FILL_MODE_UPPER`], `A` is upper triangular Cholesky factor `U` corresponding to $A = U^{H}\\*U$.
3554    ///
3555    /// The operation is in-place, i.e. matrix `X` overwrites matrix `B` with the same leading dimension `ldb`.
3556    ///
3557    /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
3558    ///
3559    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The operation completed successfully.
3560    ///
3561    /// [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]:   The library was not initialized.
3562    ///
3563    /// [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]:   Invalid parameters were passed (`n<0`, `nrhs<0`, `lda<max(1,n)` or `ldb<max(1,n)`).
3564    ///
3565    /// [`cusolverStatus_t::CUSOLVER_STATUS_ARCH_MISMATCH`]:   The device only supports compute capability 5.0 and above.
3566    ///
3567    /// [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]:   An internal operation failed.
3568    pub fn cusolverDnZpotrs(
3569        handle: cusolverDnHandle_t,
3570        uplo: cublasFillMode_t,
3571        n: ::core::ffi::c_int,
3572        nrhs: ::core::ffi::c_int,
3573        A: *const cuDoubleComplex,
3574        lda: ::core::ffi::c_int,
3575        B: *mut cuDoubleComplex,
3576        ldb: ::core::ffi::c_int,
3577        devInfo: *mut ::core::ffi::c_int,
3578    ) -> cusolverStatus_t;
3579}
3580unsafe extern "C" {
3581    /// The S and D data types are real valued single and double precision, respectively. Please visit [cuSOLVER Library Samples - potrfBatched](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/potrfBatched) for a code example.
3582    ///
3583    /// The C and Z data types are complex valued single and double precision, respectively.
3584    ///
3585    /// This function computes the Cholesky factorization of a sequence of Hermitian positive-definite matrices.
3586    ///
3587    /// Each `Aarray[i] for i=0,1,..., batchSize-1` is a $n \times n$ Hermitian matrix, only lower or upper part is meaningful. The input parameter `uplo` indicates which part of the matrix is used.
3588    ///
3589    /// If input parameter `uplo` is [`cublasFillMode_t::CUBLAS_FILL_MODE_LOWER`], only lower triangular part of `A` is processed, and replaced by lower triangular Cholesky factor `L`.
3590    ///
3591    /// $$
3592    /// A = L\\*L^{H}
3593    /// $$
3594    /// If input parameter `uplo` is [`cublasFillMode_t::CUBLAS_FILL_MODE_UPPER`], only upper triangular part of `A` is processed, and replaced by upper triangular Cholesky factor `U`.
3595    ///
3596    /// $$
3597    /// A = U^{H}\\*U
3598    /// $$
3599    /// If Cholesky factorization failed, i.e. some leading minor of `A` is not positive definite, or equivalently some diagonal elements of `L` or `U` is not a real number. The output parameter `infoArray` would indicate smallest leading minor of `A` which is not positive definite.
3600    ///
3601    /// `infoArray` is an integer array of size `batchsize`. If `potrfBatched` returns [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`], `infoArray[0] = -i` (less than zero), meaning that the `i-th` parameter is wrong (not counting handle). If `potrfBatched` returns [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`] but `infoArray[i] = k` is positive, then `i-th` matrix is not positive definite and the Cholesky factorization failed at row `k`.
3602    ///
3603    /// Remark: the other part of `A` is used as a workspace. For example, if `uplo` is [`cublasFillMode_t::CUBLAS_FILL_MODE_UPPER`], upper triangle of `A` contains Cholesky factor `U` and lower triangle of `A` is destroyed after `potrfBatched`.
3604    ///
3605    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The operation completed successfully.
3606    ///
3607    /// [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]:   The library was not initialized.
3608    ///
3609    /// [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]:   Invalid parameters were passed (`n<0` or `lda<max(1,n)` or `batchSize<1`).
3610    ///
3611    /// [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]:   An internal operation failed.
3612    pub fn cusolverDnSpotrfBatched(
3613        handle: cusolverDnHandle_t,
3614        uplo: cublasFillMode_t,
3615        n: ::core::ffi::c_int,
3616        Aarray: *mut *mut f32,
3617        lda: ::core::ffi::c_int,
3618        infoArray: *mut ::core::ffi::c_int,
3619        batchSize: ::core::ffi::c_int,
3620    ) -> cusolverStatus_t;
3621}
3622unsafe extern "C" {
3623    /// The S and D data types are real valued single and double precision, respectively. Please visit [cuSOLVER Library Samples - potrfBatched](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/potrfBatched) for a code example.
3624    ///
3625    /// The C and Z data types are complex valued single and double precision, respectively.
3626    ///
3627    /// This function computes the Cholesky factorization of a sequence of Hermitian positive-definite matrices.
3628    ///
3629    /// Each `Aarray[i] for i=0,1,..., batchSize-1` is a $n \times n$ Hermitian matrix, only lower or upper part is meaningful. The input parameter `uplo` indicates which part of the matrix is used.
3630    ///
3631    /// If input parameter `uplo` is [`cublasFillMode_t::CUBLAS_FILL_MODE_LOWER`], only lower triangular part of `A` is processed, and replaced by lower triangular Cholesky factor `L`.
3632    ///
3633    /// $$
3634    /// A = L\\*L^{H}
3635    /// $$
3636    /// If input parameter `uplo` is [`cublasFillMode_t::CUBLAS_FILL_MODE_UPPER`], only upper triangular part of `A` is processed, and replaced by upper triangular Cholesky factor `U`.
3637    ///
3638    /// $$
3639    /// A = U^{H}\\*U
3640    /// $$
3641    /// If Cholesky factorization failed, i.e. some leading minor of `A` is not positive definite, or equivalently some diagonal elements of `L` or `U` is not a real number. The output parameter `infoArray` would indicate smallest leading minor of `A` which is not positive definite.
3642    ///
3643    /// `infoArray` is an integer array of size `batchsize`. If `potrfBatched` returns [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`], `infoArray[0] = -i` (less than zero), meaning that the `i-th` parameter is wrong (not counting handle). If `potrfBatched` returns [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`] but `infoArray[i] = k` is positive, then `i-th` matrix is not positive definite and the Cholesky factorization failed at row `k`.
3644    ///
3645    /// Remark: the other part of `A` is used as a workspace. For example, if `uplo` is [`cublasFillMode_t::CUBLAS_FILL_MODE_UPPER`], upper triangle of `A` contains Cholesky factor `U` and lower triangle of `A` is destroyed after `potrfBatched`.
3646    ///
3647    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The operation completed successfully.
3648    ///
3649    /// [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]:   The library was not initialized.
3650    ///
3651    /// [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]:   Invalid parameters were passed (`n<0` or `lda<max(1,n)` or `batchSize<1`).
3652    ///
3653    /// [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]:   An internal operation failed.
3654    pub fn cusolverDnDpotrfBatched(
3655        handle: cusolverDnHandle_t,
3656        uplo: cublasFillMode_t,
3657        n: ::core::ffi::c_int,
3658        Aarray: *mut *mut f64,
3659        lda: ::core::ffi::c_int,
3660        infoArray: *mut ::core::ffi::c_int,
3661        batchSize: ::core::ffi::c_int,
3662    ) -> cusolverStatus_t;
3663}
3664unsafe extern "C" {
3665    /// The S and D data types are real valued single and double precision, respectively. Please visit [cuSOLVER Library Samples - potrfBatched](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/potrfBatched) for a code example.
3666    ///
3667    /// The C and Z data types are complex valued single and double precision, respectively.
3668    ///
3669    /// This function computes the Cholesky factorization of a sequence of Hermitian positive-definite matrices.
3670    ///
3671    /// Each `Aarray[i] for i=0,1,..., batchSize-1` is a $n \times n$ Hermitian matrix, only lower or upper part is meaningful. The input parameter `uplo` indicates which part of the matrix is used.
3672    ///
3673    /// If input parameter `uplo` is [`cublasFillMode_t::CUBLAS_FILL_MODE_LOWER`], only lower triangular part of `A` is processed, and replaced by lower triangular Cholesky factor `L`.
3674    ///
3675    /// $$
3676    /// A = L\\*L^{H}
3677    /// $$
3678    /// If input parameter `uplo` is [`cublasFillMode_t::CUBLAS_FILL_MODE_UPPER`], only upper triangular part of `A` is processed, and replaced by upper triangular Cholesky factor `U`.
3679    ///
3680    /// $$
3681    /// A = U^{H}\\*U
3682    /// $$
3683    /// If Cholesky factorization failed, i.e. some leading minor of `A` is not positive definite, or equivalently some diagonal elements of `L` or `U` is not a real number. The output parameter `infoArray` would indicate smallest leading minor of `A` which is not positive definite.
3684    ///
3685    /// `infoArray` is an integer array of size `batchsize`. If `potrfBatched` returns [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`], `infoArray[0] = -i` (less than zero), meaning that the `i-th` parameter is wrong (not counting handle). If `potrfBatched` returns [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`] but `infoArray[i] = k` is positive, then `i-th` matrix is not positive definite and the Cholesky factorization failed at row `k`.
3686    ///
3687    /// Remark: the other part of `A` is used as a workspace. For example, if `uplo` is [`cublasFillMode_t::CUBLAS_FILL_MODE_UPPER`], upper triangle of `A` contains Cholesky factor `U` and lower triangle of `A` is destroyed after `potrfBatched`.
3688    ///
3689    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The operation completed successfully.
3690    ///
3691    /// [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]:   The library was not initialized.
3692    ///
3693    /// [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]:   Invalid parameters were passed (`n<0` or `lda<max(1,n)` or `batchSize<1`).
3694    ///
3695    /// [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]:   An internal operation failed.
3696    pub fn cusolverDnCpotrfBatched(
3697        handle: cusolverDnHandle_t,
3698        uplo: cublasFillMode_t,
3699        n: ::core::ffi::c_int,
3700        Aarray: *mut *mut cuComplex,
3701        lda: ::core::ffi::c_int,
3702        infoArray: *mut ::core::ffi::c_int,
3703        batchSize: ::core::ffi::c_int,
3704    ) -> cusolverStatus_t;
3705}
3706unsafe extern "C" {
3707    /// The S and D data types are real valued single and double precision, respectively. Please visit [cuSOLVER Library Samples - potrfBatched](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/potrfBatched) for a code example.
3708    ///
3709    /// The C and Z data types are complex valued single and double precision, respectively.
3710    ///
3711    /// This function computes the Cholesky factorization of a sequence of Hermitian positive-definite matrices.
3712    ///
3713    /// Each `Aarray[i] for i=0,1,..., batchSize-1` is a $n \times n$ Hermitian matrix, only lower or upper part is meaningful. The input parameter `uplo` indicates which part of the matrix is used.
3714    ///
3715    /// If input parameter `uplo` is [`cublasFillMode_t::CUBLAS_FILL_MODE_LOWER`], only lower triangular part of `A` is processed, and replaced by lower triangular Cholesky factor `L`.
3716    ///
3717    /// $$
3718    /// A = L\\*L^{H}
3719    /// $$
3720    /// If input parameter `uplo` is [`cublasFillMode_t::CUBLAS_FILL_MODE_UPPER`], only upper triangular part of `A` is processed, and replaced by upper triangular Cholesky factor `U`.
3721    ///
3722    /// $$
3723    /// A = U^{H}\\*U
3724    /// $$
3725    /// If Cholesky factorization failed, i.e. some leading minor of `A` is not positive definite, or equivalently some diagonal elements of `L` or `U` is not a real number. The output parameter `infoArray` would indicate smallest leading minor of `A` which is not positive definite.
3726    ///
3727    /// `infoArray` is an integer array of size `batchsize`. If `potrfBatched` returns [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`], `infoArray[0] = -i` (less than zero), meaning that the `i-th` parameter is wrong (not counting handle). If `potrfBatched` returns [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`] but `infoArray[i] = k` is positive, then `i-th` matrix is not positive definite and the Cholesky factorization failed at row `k`.
3728    ///
3729    /// Remark: the other part of `A` is used as a workspace. For example, if `uplo` is [`cublasFillMode_t::CUBLAS_FILL_MODE_UPPER`], upper triangle of `A` contains Cholesky factor `U` and lower triangle of `A` is destroyed after `potrfBatched`.
3730    ///
3731    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The operation completed successfully.
3732    ///
3733    /// [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]:   The library was not initialized.
3734    ///
3735    /// [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]:   Invalid parameters were passed (`n<0` or `lda<max(1,n)` or `batchSize<1`).
3736    ///
3737    /// [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]:   An internal operation failed.
3738    pub fn cusolverDnZpotrfBatched(
3739        handle: cusolverDnHandle_t,
3740        uplo: cublasFillMode_t,
3741        n: ::core::ffi::c_int,
3742        Aarray: *mut *mut cuDoubleComplex,
3743        lda: ::core::ffi::c_int,
3744        infoArray: *mut ::core::ffi::c_int,
3745        batchSize: ::core::ffi::c_int,
3746    ) -> cusolverStatus_t;
3747}
3748unsafe extern "C" {
3749    /// This function solves a sequence of linear systems:
3750    ///
3751    /// $$
3752    /// {A\lbrack i\rbrack}\\*{X\lbrack i\rbrack} = {B\lbrack i\rbrack}
3753    /// $$
3754    /// where each `Aarray[i] for i=0,1,..., batchSize-1` is a $n \times n$ Hermitian matrix, only lower or upper part is meaningful. The input parameter `uplo` indicates which part of the matrix is used.
3755    ///
3756    /// The user has to call `potrfBatched` first to factorize matrix `Aarray[i]`. If input parameter `uplo` is [`cublasFillMode_t::CUBLAS_FILL_MODE_LOWER`], `A` is lower triangular Cholesky factor `L` corresponding to $A = L\\*L^{H}$. If input parameter `uplo` is [`cublasFillMode_t::CUBLAS_FILL_MODE_UPPER`], `A` is upper triangular Cholesky factor `U` corresponding to $A = U^{H}\\*U$.
3757    ///
3758    /// The operation is in-place, i.e. matrix `X` overwrites matrix `B` with the same leading dimension `ldb`.
3759    ///
3760    /// The output parameter `info` is a scalar. If `info = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
3761    ///
3762    /// Remark 1: only `nrhs=1` is supported.
3763    ///
3764    /// Remark 2: `infoArray` from `potrfBatched` indicates if the matrix is positive definite. `info` from `potrsBatched` only shows which input parameter is wrong (not counting handle).
3765    ///
3766    /// Remark 3: the other part of `A` is used as a workspace. For example, if `uplo` is [`cublasFillMode_t::CUBLAS_FILL_MODE_UPPER`], upper triangle of `A` contains Cholesky factor `U` and lower triangle of `A` is destroyed after `potrsBatched`.
3767    ///
3768    /// Please visit [cuSOLVER Library Samples - potrfBatched](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/potrfBatched) for a code example.
3769    ///
3770    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The operation completed successfully.
3771    ///
3772    /// [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]:   The library was not initialized.
3773    ///
3774    /// [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]:   Invalid parameters were passed (`n<0`, `nrhs<0`, `lda<max(1,n)`, `ldb<max(1,n)` or `batchSize<0`).
3775    ///
3776    /// [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]:   An internal operation failed.
3777    pub fn cusolverDnSpotrsBatched(
3778        handle: cusolverDnHandle_t,
3779        uplo: cublasFillMode_t,
3780        n: ::core::ffi::c_int,
3781        nrhs: ::core::ffi::c_int,
3782        A: *mut *mut f32,
3783        lda: ::core::ffi::c_int,
3784        B: *mut *mut f32,
3785        ldb: ::core::ffi::c_int,
3786        d_info: *mut ::core::ffi::c_int,
3787        batchSize: ::core::ffi::c_int,
3788    ) -> cusolverStatus_t;
3789}
3790unsafe extern "C" {
3791    /// This function solves a sequence of linear systems:
3792    ///
3793    /// $$
3794    /// {A\lbrack i\rbrack}\\*{X\lbrack i\rbrack} = {B\lbrack i\rbrack}
3795    /// $$
3796    /// where each `Aarray[i] for i=0,1,..., batchSize-1` is a $n \times n$ Hermitian matrix, only lower or upper part is meaningful. The input parameter `uplo` indicates which part of the matrix is used.
3797    ///
3798    /// The user has to call `potrfBatched` first to factorize matrix `Aarray[i]`. If input parameter `uplo` is [`cublasFillMode_t::CUBLAS_FILL_MODE_LOWER`], `A` is lower triangular Cholesky factor `L` corresponding to $A = L\\*L^{H}$. If input parameter `uplo` is [`cublasFillMode_t::CUBLAS_FILL_MODE_UPPER`], `A` is upper triangular Cholesky factor `U` corresponding to $A = U^{H}\\*U$.
3799    ///
3800    /// The operation is in-place, i.e. matrix `X` overwrites matrix `B` with the same leading dimension `ldb`.
3801    ///
3802    /// The output parameter `info` is a scalar. If `info = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
3803    ///
3804    /// Remark 1: only `nrhs=1` is supported.
3805    ///
3806    /// Remark 2: `infoArray` from `potrfBatched` indicates if the matrix is positive definite. `info` from `potrsBatched` only shows which input parameter is wrong (not counting handle).
3807    ///
3808    /// Remark 3: the other part of `A` is used as a workspace. For example, if `uplo` is [`cublasFillMode_t::CUBLAS_FILL_MODE_UPPER`], upper triangle of `A` contains Cholesky factor `U` and lower triangle of `A` is destroyed after `potrsBatched`.
3809    ///
3810    /// Please visit [cuSOLVER Library Samples - potrfBatched](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/potrfBatched) for a code example.
3811    ///
3812    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The operation completed successfully.
3813    ///
3814    /// [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]:   The library was not initialized.
3815    ///
3816    /// [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]:   Invalid parameters were passed (`n<0`, `nrhs<0`, `lda<max(1,n)`, `ldb<max(1,n)` or `batchSize<0`).
3817    ///
3818    /// [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]:   An internal operation failed.
3819    pub fn cusolverDnDpotrsBatched(
3820        handle: cusolverDnHandle_t,
3821        uplo: cublasFillMode_t,
3822        n: ::core::ffi::c_int,
3823        nrhs: ::core::ffi::c_int,
3824        A: *mut *mut f64,
3825        lda: ::core::ffi::c_int,
3826        B: *mut *mut f64,
3827        ldb: ::core::ffi::c_int,
3828        d_info: *mut ::core::ffi::c_int,
3829        batchSize: ::core::ffi::c_int,
3830    ) -> cusolverStatus_t;
3831}
3832unsafe extern "C" {
3833    /// This function solves a sequence of linear systems:
3834    ///
3835    /// $$
3836    /// {A\lbrack i\rbrack}\\*{X\lbrack i\rbrack} = {B\lbrack i\rbrack}
3837    /// $$
3838    /// where each `Aarray[i] for i=0,1,..., batchSize-1` is a $n \times n$ Hermitian matrix, only lower or upper part is meaningful. The input parameter `uplo` indicates which part of the matrix is used.
3839    ///
3840    /// The user has to call `potrfBatched` first to factorize matrix `Aarray[i]`. If input parameter `uplo` is [`cublasFillMode_t::CUBLAS_FILL_MODE_LOWER`], `A` is lower triangular Cholesky factor `L` corresponding to $A = L\\*L^{H}$. If input parameter `uplo` is [`cublasFillMode_t::CUBLAS_FILL_MODE_UPPER`], `A` is upper triangular Cholesky factor `U` corresponding to $A = U^{H}\\*U$.
3841    ///
3842    /// The operation is in-place, i.e. matrix `X` overwrites matrix `B` with the same leading dimension `ldb`.
3843    ///
3844    /// The output parameter `info` is a scalar. If `info = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
3845    ///
3846    /// Remark 1: only `nrhs=1` is supported.
3847    ///
3848    /// Remark 2: `infoArray` from `potrfBatched` indicates if the matrix is positive definite. `info` from `potrsBatched` only shows which input parameter is wrong (not counting handle).
3849    ///
3850    /// Remark 3: the other part of `A` is used as a workspace. For example, if `uplo` is [`cublasFillMode_t::CUBLAS_FILL_MODE_UPPER`], upper triangle of `A` contains Cholesky factor `U` and lower triangle of `A` is destroyed after `potrsBatched`.
3851    ///
3852    /// Please visit [cuSOLVER Library Samples - potrfBatched](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/potrfBatched) for a code example.
3853    ///
3854    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The operation completed successfully.
3855    ///
3856    /// [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]:   The library was not initialized.
3857    ///
3858    /// [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]:   Invalid parameters were passed (`n<0`, `nrhs<0`, `lda<max(1,n)`, `ldb<max(1,n)` or `batchSize<0`).
3859    ///
3860    /// [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]:   An internal operation failed.
3861    pub fn cusolverDnCpotrsBatched(
3862        handle: cusolverDnHandle_t,
3863        uplo: cublasFillMode_t,
3864        n: ::core::ffi::c_int,
3865        nrhs: ::core::ffi::c_int,
3866        A: *mut *mut cuComplex,
3867        lda: ::core::ffi::c_int,
3868        B: *mut *mut cuComplex,
3869        ldb: ::core::ffi::c_int,
3870        d_info: *mut ::core::ffi::c_int,
3871        batchSize: ::core::ffi::c_int,
3872    ) -> cusolverStatus_t;
3873}
3874unsafe extern "C" {
3875    /// This function solves a sequence of linear systems:
3876    ///
3877    /// $$
3878    /// {A\lbrack i\rbrack}\\*{X\lbrack i\rbrack} = {B\lbrack i\rbrack}
3879    /// $$
3880    /// where each `Aarray[i] for i=0,1,..., batchSize-1` is a $n \times n$ Hermitian matrix, only lower or upper part is meaningful. The input parameter `uplo` indicates which part of the matrix is used.
3881    ///
3882    /// The user has to call `potrfBatched` first to factorize matrix `Aarray[i]`. If input parameter `uplo` is [`cublasFillMode_t::CUBLAS_FILL_MODE_LOWER`], `A` is lower triangular Cholesky factor `L` corresponding to $A = L\\*L^{H}$. If input parameter `uplo` is [`cublasFillMode_t::CUBLAS_FILL_MODE_UPPER`], `A` is upper triangular Cholesky factor `U` corresponding to $A = U^{H}\\*U$.
3883    ///
3884    /// The operation is in-place, i.e. matrix `X` overwrites matrix `B` with the same leading dimension `ldb`.
3885    ///
3886    /// The output parameter `info` is a scalar. If `info = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
3887    ///
3888    /// Remark 1: only `nrhs=1` is supported.
3889    ///
3890    /// Remark 2: `infoArray` from `potrfBatched` indicates if the matrix is positive definite. `info` from `potrsBatched` only shows which input parameter is wrong (not counting handle).
3891    ///
3892    /// Remark 3: the other part of `A` is used as a workspace. For example, if `uplo` is [`cublasFillMode_t::CUBLAS_FILL_MODE_UPPER`], upper triangle of `A` contains Cholesky factor `U` and lower triangle of `A` is destroyed after `potrsBatched`.
3893    ///
3894    /// Please visit [cuSOLVER Library Samples - potrfBatched](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/potrfBatched) for a code example.
3895    ///
3896    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The operation completed successfully.
3897    ///
3898    /// [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]:   The library was not initialized.
3899    ///
3900    /// [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]:   Invalid parameters were passed (`n<0`, `nrhs<0`, `lda<max(1,n)`, `ldb<max(1,n)` or `batchSize<0`).
3901    ///
3902    /// [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]:   An internal operation failed.
3903    pub fn cusolverDnZpotrsBatched(
3904        handle: cusolverDnHandle_t,
3905        uplo: cublasFillMode_t,
3906        n: ::core::ffi::c_int,
3907        nrhs: ::core::ffi::c_int,
3908        A: *mut *mut cuDoubleComplex,
3909        lda: ::core::ffi::c_int,
3910        B: *mut *mut cuDoubleComplex,
3911        ldb: ::core::ffi::c_int,
3912        d_info: *mut ::core::ffi::c_int,
3913        batchSize: ::core::ffi::c_int,
3914    ) -> cusolverStatus_t;
3915}
3916unsafe extern "C" {
3917    pub fn cusolverDnSpotri_bufferSize(
3918        handle: cusolverDnHandle_t,
3919        uplo: cublasFillMode_t,
3920        n: ::core::ffi::c_int,
3921        A: *mut f32,
3922        lda: ::core::ffi::c_int,
3923        lwork: *mut ::core::ffi::c_int,
3924    ) -> cusolverStatus_t;
3925}
3926unsafe extern "C" {
3927    pub fn cusolverDnDpotri_bufferSize(
3928        handle: cusolverDnHandle_t,
3929        uplo: cublasFillMode_t,
3930        n: ::core::ffi::c_int,
3931        A: *mut f64,
3932        lda: ::core::ffi::c_int,
3933        lwork: *mut ::core::ffi::c_int,
3934    ) -> cusolverStatus_t;
3935}
3936unsafe extern "C" {
3937    pub fn cusolverDnCpotri_bufferSize(
3938        handle: cusolverDnHandle_t,
3939        uplo: cublasFillMode_t,
3940        n: ::core::ffi::c_int,
3941        A: *mut cuComplex,
3942        lda: ::core::ffi::c_int,
3943        lwork: *mut ::core::ffi::c_int,
3944    ) -> cusolverStatus_t;
3945}
3946unsafe extern "C" {
3947    pub fn cusolverDnZpotri_bufferSize(
3948        handle: cusolverDnHandle_t,
3949        uplo: cublasFillMode_t,
3950        n: ::core::ffi::c_int,
3951        A: *mut cuDoubleComplex,
3952        lda: ::core::ffi::c_int,
3953        lwork: *mut ::core::ffi::c_int,
3954    ) -> cusolverStatus_t;
3955}
3956unsafe extern "C" {
3957    /// These helper functions calculate the necessary size of work buffers.
3958    ///
3959    /// The S and D data types are real valued single and double precision, respectively.
3960    ///
3961    /// The C and Z data types are complex valued single and double precision, respectively.
3962    ///
3963    /// This function computes the inverse of a positive-definite matrix `A` using the Cholesky factorization:
3964    ///
3965    /// $$
3966    /// A = L\\*L^H = U^{H}\\*U
3967    /// $$
3968    /// computed by `potrf()`.
3969    ///
3970    /// `A` is an $n \times n$ matrix containing the triangular factor `L` or `U` computed by the Cholesky factorization. Only lower or upper part is meaningful and the input parameter `uplo` indicates which part of the matrix is used. The function would leave the other part untouched.
3971    ///
3972    /// If the input parameter `uplo` is [`cublasFillMode_t::CUBLAS_FILL_MODE_LOWER`], only lower triangular part of `A` is processed, and replaced the by lower triangular part of the inverse of `A`.
3973    ///
3974    /// If the input parameter `uplo` is [`cublasFillMode_t::CUBLAS_FILL_MODE_UPPER`], only upper triangular part of `A` is processed, and replaced by the upper triangular part of the inverse of `A`.
3975    ///
3976    /// The user has to provide the working space which is pointed to by input parameter `Workspace`. The input parameter `Lwork` is the size of the working space, returned by `potri_bufferSize()`.
3977    ///
3978    /// If the computation of the inverse fails, i.e. some leading minor of `L` or `U`, is null, the output parameter `devInfo` would indicate the smallest leading minor of `L` or `U` which is not positive definite.
3979    ///
3980    /// If the output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting the handle).
3981    ///
3982    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The operation completed successfully.
3983    ///
3984    /// [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]:   The library was not initialized.
3985    ///
3986    /// [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]:   Invalid parameters were passed (`n<0` or `lda<max(1,n)`).
3987    ///
3988    /// [`cusolverStatus_t::CUSOLVER_STATUS_ARCH_MISMATCH`]:   The device only supports compute capability 5.0 and above.
3989    ///
3990    /// [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]:   An internal operation failed.
3991    pub fn cusolverDnSpotri(
3992        handle: cusolverDnHandle_t,
3993        uplo: cublasFillMode_t,
3994        n: ::core::ffi::c_int,
3995        A: *mut f32,
3996        lda: ::core::ffi::c_int,
3997        work: *mut f32,
3998        lwork: ::core::ffi::c_int,
3999        devInfo: *mut ::core::ffi::c_int,
4000    ) -> cusolverStatus_t;
4001}
4002unsafe extern "C" {
4003    /// These helper functions calculate the necessary size of work buffers.
4004    ///
4005    /// The S and D data types are real valued single and double precision, respectively.
4006    ///
4007    /// The C and Z data types are complex valued single and double precision, respectively.
4008    ///
4009    /// This function computes the inverse of a positive-definite matrix `A` using the Cholesky factorization:
4010    ///
4011    /// $$
4012    /// A = L\\*L^H = U^{H}\\*U
4013    /// $$
4014    /// computed by `potrf()`.
4015    ///
4016    /// `A` is an $n \times n$ matrix containing the triangular factor `L` or `U` computed by the Cholesky factorization. Only lower or upper part is meaningful and the input parameter `uplo` indicates which part of the matrix is used. The function would leave the other part untouched.
4017    ///
4018    /// If the input parameter `uplo` is [`cublasFillMode_t::CUBLAS_FILL_MODE_LOWER`], only lower triangular part of `A` is processed, and replaced the by lower triangular part of the inverse of `A`.
4019    ///
4020    /// If the input parameter `uplo` is [`cublasFillMode_t::CUBLAS_FILL_MODE_UPPER`], only upper triangular part of `A` is processed, and replaced by the upper triangular part of the inverse of `A`.
4021    ///
4022    /// The user has to provide the working space which is pointed to by input parameter `Workspace`. The input parameter `Lwork` is the size of the working space, returned by `potri_bufferSize()`.
4023    ///
4024    /// If the computation of the inverse fails, i.e. some leading minor of `L` or `U`, is null, the output parameter `devInfo` would indicate the smallest leading minor of `L` or `U` which is not positive definite.
4025    ///
4026    /// If the output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting the handle).
4027    ///
4028    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The operation completed successfully.
4029    ///
4030    /// [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]:   The library was not initialized.
4031    ///
4032    /// [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]:   Invalid parameters were passed (`n<0` or `lda<max(1,n)`).
4033    ///
4034    /// [`cusolverStatus_t::CUSOLVER_STATUS_ARCH_MISMATCH`]:   The device only supports compute capability 5.0 and above.
4035    ///
4036    /// [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]:   An internal operation failed.
4037    pub fn cusolverDnDpotri(
4038        handle: cusolverDnHandle_t,
4039        uplo: cublasFillMode_t,
4040        n: ::core::ffi::c_int,
4041        A: *mut f64,
4042        lda: ::core::ffi::c_int,
4043        work: *mut f64,
4044        lwork: ::core::ffi::c_int,
4045        devInfo: *mut ::core::ffi::c_int,
4046    ) -> cusolverStatus_t;
4047}
4048unsafe extern "C" {
4049    /// These helper functions calculate the necessary size of work buffers.
4050    ///
4051    /// The S and D data types are real valued single and double precision, respectively.
4052    ///
4053    /// The C and Z data types are complex valued single and double precision, respectively.
4054    ///
4055    /// This function computes the inverse of a positive-definite matrix `A` using the Cholesky factorization:
4056    ///
4057    /// $$
4058    /// A = L\\*L^H = U^{H}\\*U
4059    /// $$
4060    /// computed by `potrf()`.
4061    ///
4062    /// `A` is an $n \times n$ matrix containing the triangular factor `L` or `U` computed by the Cholesky factorization. Only lower or upper part is meaningful and the input parameter `uplo` indicates which part of the matrix is used. The function would leave the other part untouched.
4063    ///
4064    /// If the input parameter `uplo` is [`cublasFillMode_t::CUBLAS_FILL_MODE_LOWER`], only lower triangular part of `A` is processed, and replaced the by lower triangular part of the inverse of `A`.
4065    ///
4066    /// If the input parameter `uplo` is [`cublasFillMode_t::CUBLAS_FILL_MODE_UPPER`], only upper triangular part of `A` is processed, and replaced by the upper triangular part of the inverse of `A`.
4067    ///
4068    /// The user has to provide the working space which is pointed to by input parameter `Workspace`. The input parameter `Lwork` is the size of the working space, returned by `potri_bufferSize()`.
4069    ///
4070    /// If the computation of the inverse fails, i.e. some leading minor of `L` or `U`, is null, the output parameter `devInfo` would indicate the smallest leading minor of `L` or `U` which is not positive definite.
4071    ///
4072    /// If the output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting the handle).
4073    ///
4074    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The operation completed successfully.
4075    ///
4076    /// [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]:   The library was not initialized.
4077    ///
4078    /// [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]:   Invalid parameters were passed (`n<0` or `lda<max(1,n)`).
4079    ///
4080    /// [`cusolverStatus_t::CUSOLVER_STATUS_ARCH_MISMATCH`]:   The device only supports compute capability 5.0 and above.
4081    ///
4082    /// [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]:   An internal operation failed.
4083    pub fn cusolverDnCpotri(
4084        handle: cusolverDnHandle_t,
4085        uplo: cublasFillMode_t,
4086        n: ::core::ffi::c_int,
4087        A: *mut cuComplex,
4088        lda: ::core::ffi::c_int,
4089        work: *mut cuComplex,
4090        lwork: ::core::ffi::c_int,
4091        devInfo: *mut ::core::ffi::c_int,
4092    ) -> cusolverStatus_t;
4093}
4094unsafe extern "C" {
4095    /// These helper functions calculate the necessary size of work buffers.
4096    ///
4097    /// The S and D data types are real valued single and double precision, respectively.
4098    ///
4099    /// The C and Z data types are complex valued single and double precision, respectively.
4100    ///
4101    /// This function computes the inverse of a positive-definite matrix `A` using the Cholesky factorization:
4102    ///
4103    /// $$
4104    /// A = L\\*L^H = U^{H}\\*U
4105    /// $$
4106    /// computed by `potrf()`.
4107    ///
4108    /// `A` is an $n \times n$ matrix containing the triangular factor `L` or `U` computed by the Cholesky factorization. Only lower or upper part is meaningful and the input parameter `uplo` indicates which part of the matrix is used. The function would leave the other part untouched.
4109    ///
4110    /// If the input parameter `uplo` is [`cublasFillMode_t::CUBLAS_FILL_MODE_LOWER`], only lower triangular part of `A` is processed, and replaced the by lower triangular part of the inverse of `A`.
4111    ///
4112    /// If the input parameter `uplo` is [`cublasFillMode_t::CUBLAS_FILL_MODE_UPPER`], only upper triangular part of `A` is processed, and replaced by the upper triangular part of the inverse of `A`.
4113    ///
4114    /// The user has to provide the working space which is pointed to by input parameter `Workspace`. The input parameter `Lwork` is the size of the working space, returned by `potri_bufferSize()`.
4115    ///
4116    /// If the computation of the inverse fails, i.e. some leading minor of `L` or `U`, is null, the output parameter `devInfo` would indicate the smallest leading minor of `L` or `U` which is not positive definite.
4117    ///
4118    /// If the output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting the handle).
4119    ///
4120    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The operation completed successfully.
4121    ///
4122    /// [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]:   The library was not initialized.
4123    ///
4124    /// [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]:   Invalid parameters were passed (`n<0` or `lda<max(1,n)`).
4125    ///
4126    /// [`cusolverStatus_t::CUSOLVER_STATUS_ARCH_MISMATCH`]:   The device only supports compute capability 5.0 and above.
4127    ///
4128    /// [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]:   An internal operation failed.
4129    pub fn cusolverDnZpotri(
4130        handle: cusolverDnHandle_t,
4131        uplo: cublasFillMode_t,
4132        n: ::core::ffi::c_int,
4133        A: *mut cuDoubleComplex,
4134        lda: ::core::ffi::c_int,
4135        work: *mut cuDoubleComplex,
4136        lwork: ::core::ffi::c_int,
4137        devInfo: *mut ::core::ffi::c_int,
4138    ) -> cusolverStatus_t;
4139}
4140unsafe extern "C" {
4141    pub fn cusolverDnXtrtri_bufferSize(
4142        handle: cusolverDnHandle_t,
4143        uplo: cublasFillMode_t,
4144        diag: cublasDiagType_t,
4145        n: i64,
4146        dataTypeA: cudaDataType,
4147        A: *mut ::core::ffi::c_void,
4148        lda: i64,
4149        workspaceInBytesOnDevice: *mut size_t,
4150        workspaceInBytesOnHost: *mut size_t,
4151    ) -> cusolverStatus_t;
4152}
4153unsafe extern "C" {
4154    /// The helper functions below can calculate the sizes needed for pre-allocated buffers.
4155    ///
4156    /// The following routine:
4157    ///
4158    /// computes the inverse of a triangular matrix using the generic API interface.
4159    ///
4160    /// `A` is an $n \times n$ triangular matrix, only lower or upper part is meaningful. The input parameter `uplo` indicates which part of the matrix is used. The function will leave the other part untouched.
4161    ///
4162    /// If input parameter `uplo` is [`cublasFillMode_t::CUBLAS_FILL_MODE_LOWER`], only lower triangular part of `A` is processed, and replaced by lower triangular inverse.
4163    ///
4164    /// If input parameter `uplo` is [`cublasFillMode_t::CUBLAS_FILL_MODE_UPPER`], only upper triangular part of `A` is processed, and replaced by upper triangular inverse.
4165    ///
4166    /// The user has to provide device and host work spaces which are pointed by input parameters `bufferOnDevice` and `bufferOnHost`. The input parameters `workspaceInBytesOnDevice` and `workspaceInBytesOnHost` are sizes in bytes of the device and host work spaces, and they are returned by [`cusolverDnXtrtri_bufferSize`].
4167    ///
4168    /// If matrix inversion fails, the output parameter `info = i` shows `A(i,i) = 0`.
4169    ///
4170    /// If output parameter `info = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
4171    ///
4172    /// Please visit [cuSOLVER Library Samples - Xtrtri](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/Xtrtri) for a code example.
4173    ///
4174    /// List of input arguments for [`cusolverDnXtrtri_bufferSize`] and [`cusolverDnXtrtri`]:
4175    ///
4176    /// **Valid data types**
4177    ///
4178    /// |  |  |
4179    /// | --- | --- |
4180    /// | `DataTypeA` | `Meaning` |
4181    /// | `CUDA_R_32F` | `STRTRI` |
4182    /// | `CUDA_R_64F` | `DTRTRI` |
4183    /// | `CUDA_C_32F` | `CTRTRI` |
4184    /// | `CUDA_C_64F` | `ZTRTRI` |
4185    ///
4186    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The operation completed successfully.
4187    ///
4188    /// [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]:   The library was not initialized.
4189    ///
4190    /// [`cusolverStatus_t::CUSOLVER_STATUS_NOT_SUPPORTED`]:   Data type is not supported.
4191    ///
4192    /// [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]:   Invalid parameters were passed (`n<0` or `lda<max(1,n)`).
4193    ///
4194    /// [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]:   An internal operation failed.
4195    ///
4196    /// # Parameters
4197    ///
4198    /// - `handle`: Handle to the cuSolverDN library context.
4199    /// - `uplo`: Indicates if matrix `A` lower or upper part is stored, the other part is not referenced.
4200    /// - `diag`: The enumerated unit diagonal type.
4201    /// - `n`: Number of rows and columns of matrix `A`.
4202    /// - `dataTypeA`: Data type of array `A`.
4203    /// - `A`: Array of dimension `lda * n` with `lda` is not less than `max(1,n)`.
4204    /// - `lda`: Leading dimension of two-dimensional array used to store matrix `A`.
4205    /// - `bufferOnDevice`: Device workspace. Array of type `void` of size `workspaceInBytesOnDevice` bytes.
4206    /// - `workspaceInBytesOnDevice`: Size in bytes of `bufferOnDevice`, returned by [`cusolverDnXtrtri_bufferSize`].
4207    /// - `bufferOnHost`: Host workspace. Array of type `void` of size `workspaceInBytesOnHost` bytes.
4208    /// - `workspaceInBytesOnHost`: Size in bytes of `bufferOnHost`, returned by [`cusolverDnXtrtri_bufferSize`].
4209    ///
4210    /// # Return value
4211    ///
4212    /// - [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]: An internal operation failed.
4213    /// - [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]: Invalid parameters were passed (`n<0` or `lda<max(1,n)`).
4214    /// - [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]: The library was not initialized.
4215    /// - [`cusolverStatus_t::CUSOLVER_STATUS_NOT_SUPPORTED`]: Data type is not supported.
4216    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The operation completed successfully.
4217    pub fn cusolverDnXtrtri(
4218        handle: cusolverDnHandle_t,
4219        uplo: cublasFillMode_t,
4220        diag: cublasDiagType_t,
4221        n: i64,
4222        dataTypeA: cudaDataType,
4223        A: *mut ::core::ffi::c_void,
4224        lda: i64,
4225        bufferOnDevice: *mut ::core::ffi::c_void,
4226        workspaceInBytesOnDevice: size_t,
4227        bufferOnHost: *mut ::core::ffi::c_void,
4228        workspaceInBytesOnHost: size_t,
4229        devInfo: *mut ::core::ffi::c_int,
4230    ) -> cusolverStatus_t;
4231}
4232unsafe extern "C" {
4233    pub fn cusolverDnSlauum_bufferSize(
4234        handle: cusolverDnHandle_t,
4235        uplo: cublasFillMode_t,
4236        n: ::core::ffi::c_int,
4237        A: *mut f32,
4238        lda: ::core::ffi::c_int,
4239        lwork: *mut ::core::ffi::c_int,
4240    ) -> cusolverStatus_t;
4241}
4242unsafe extern "C" {
4243    pub fn cusolverDnDlauum_bufferSize(
4244        handle: cusolverDnHandle_t,
4245        uplo: cublasFillMode_t,
4246        n: ::core::ffi::c_int,
4247        A: *mut f64,
4248        lda: ::core::ffi::c_int,
4249        lwork: *mut ::core::ffi::c_int,
4250    ) -> cusolverStatus_t;
4251}
4252unsafe extern "C" {
4253    pub fn cusolverDnClauum_bufferSize(
4254        handle: cusolverDnHandle_t,
4255        uplo: cublasFillMode_t,
4256        n: ::core::ffi::c_int,
4257        A: *mut cuComplex,
4258        lda: ::core::ffi::c_int,
4259        lwork: *mut ::core::ffi::c_int,
4260    ) -> cusolverStatus_t;
4261}
4262unsafe extern "C" {
4263    pub fn cusolverDnZlauum_bufferSize(
4264        handle: cusolverDnHandle_t,
4265        uplo: cublasFillMode_t,
4266        n: ::core::ffi::c_int,
4267        A: *mut cuDoubleComplex,
4268        lda: ::core::ffi::c_int,
4269        lwork: *mut ::core::ffi::c_int,
4270    ) -> cusolverStatus_t;
4271}
4272unsafe extern "C" {
4273    pub fn cusolverDnSlauum(
4274        handle: cusolverDnHandle_t,
4275        uplo: cublasFillMode_t,
4276        n: ::core::ffi::c_int,
4277        A: *mut f32,
4278        lda: ::core::ffi::c_int,
4279        work: *mut f32,
4280        lwork: ::core::ffi::c_int,
4281        devInfo: *mut ::core::ffi::c_int,
4282    ) -> cusolverStatus_t;
4283}
4284unsafe extern "C" {
4285    pub fn cusolverDnDlauum(
4286        handle: cusolverDnHandle_t,
4287        uplo: cublasFillMode_t,
4288        n: ::core::ffi::c_int,
4289        A: *mut f64,
4290        lda: ::core::ffi::c_int,
4291        work: *mut f64,
4292        lwork: ::core::ffi::c_int,
4293        devInfo: *mut ::core::ffi::c_int,
4294    ) -> cusolverStatus_t;
4295}
4296unsafe extern "C" {
4297    pub fn cusolverDnClauum(
4298        handle: cusolverDnHandle_t,
4299        uplo: cublasFillMode_t,
4300        n: ::core::ffi::c_int,
4301        A: *mut cuComplex,
4302        lda: ::core::ffi::c_int,
4303        work: *mut cuComplex,
4304        lwork: ::core::ffi::c_int,
4305        devInfo: *mut ::core::ffi::c_int,
4306    ) -> cusolverStatus_t;
4307}
4308unsafe extern "C" {
4309    pub fn cusolverDnZlauum(
4310        handle: cusolverDnHandle_t,
4311        uplo: cublasFillMode_t,
4312        n: ::core::ffi::c_int,
4313        A: *mut cuDoubleComplex,
4314        lda: ::core::ffi::c_int,
4315        work: *mut cuDoubleComplex,
4316        lwork: ::core::ffi::c_int,
4317        devInfo: *mut ::core::ffi::c_int,
4318    ) -> cusolverStatus_t;
4319}
4320unsafe extern "C" {
4321    pub fn cusolverDnSgetrf_bufferSize(
4322        handle: cusolverDnHandle_t,
4323        m: ::core::ffi::c_int,
4324        n: ::core::ffi::c_int,
4325        A: *mut f32,
4326        lda: ::core::ffi::c_int,
4327        Lwork: *mut ::core::ffi::c_int,
4328    ) -> cusolverStatus_t;
4329}
4330unsafe extern "C" {
4331    pub fn cusolverDnDgetrf_bufferSize(
4332        handle: cusolverDnHandle_t,
4333        m: ::core::ffi::c_int,
4334        n: ::core::ffi::c_int,
4335        A: *mut f64,
4336        lda: ::core::ffi::c_int,
4337        Lwork: *mut ::core::ffi::c_int,
4338    ) -> cusolverStatus_t;
4339}
4340unsafe extern "C" {
4341    pub fn cusolverDnCgetrf_bufferSize(
4342        handle: cusolverDnHandle_t,
4343        m: ::core::ffi::c_int,
4344        n: ::core::ffi::c_int,
4345        A: *mut cuComplex,
4346        lda: ::core::ffi::c_int,
4347        Lwork: *mut ::core::ffi::c_int,
4348    ) -> cusolverStatus_t;
4349}
4350unsafe extern "C" {
4351    pub fn cusolverDnZgetrf_bufferSize(
4352        handle: cusolverDnHandle_t,
4353        m: ::core::ffi::c_int,
4354        n: ::core::ffi::c_int,
4355        A: *mut cuDoubleComplex,
4356        lda: ::core::ffi::c_int,
4357        Lwork: *mut ::core::ffi::c_int,
4358    ) -> cusolverStatus_t;
4359}
4360unsafe extern "C" {
4361    /// These helper functions calculate the size of work buffers needed.
4362    ///
4363    /// Please visit [cuSOLVER Library Samples - getrf](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/getrf) for a code example.
4364    ///
4365    /// The S and D data types are real single and double precision, respectively.
4366    ///
4367    /// The C and Z data types are complex valued single and double precision, respectively.
4368    ///
4369    /// This function computes the LU factorization of an $m \times n$ matrix:
4370    ///
4371    /// $$
4372    /// P\\*A = L\\*U
4373    /// $$
4374    /// where `A` is an $m \times n$ matrix, `P` is a permutation matrix, `L` is a lower triangular matrix with unit diagonal, and `U` is an upper triangular matrix.
4375    ///
4376    /// The user has to provide working space which is pointed by input parameter `Workspace`. The input parameter `Lwork` is size of the working space, and it is returned by `getrf_bufferSize()`.
4377    ///
4378    /// If LU factorization failed, i.e. matrix `A` (`U`) is singular, The output parameter `devInfo=i` indicates `U(i,i) = 0`.
4379    ///
4380    /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
4381    ///
4382    /// If `devIpiv` is null, no pivoting is performed. The factorization is `A=L*U`, which is not numerically stable.
4383    ///
4384    /// No matter LU factorization failed or not, the output parameter `devIpiv` contains pivoting sequence, row `i` is interchanged with row `devIpiv(i)`.
4385    ///
4386    /// The user can combine `getrf` and `getrs` to complete a linear solver.
4387    ///
4388    /// Remark: `getrf` uses fastest implementation with large workspace of size `m*n`. The user can choose the legacy implementation with minimal workspace by `Getrf` and `cusolverDnSetAdvOptions(params, CUSOLVERDN_GETRF, CUSOLVER_ALG_1)`.
4389    ///
4390    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The operation completed successfully.
4391    ///
4392    /// [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]:   The library was not initialized.
4393    ///
4394    /// [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]:   Invalid parameters were passed (`m,n<0` or `lda<max(1,m)`).
4395    ///
4396    /// [`cusolverStatus_t::CUSOLVER_STATUS_ARCH_MISMATCH`]:   The device only supports compute capability 5.0 and above.
4397    ///
4398    /// [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]:   An internal operation failed.
4399    pub fn cusolverDnSgetrf(
4400        handle: cusolverDnHandle_t,
4401        m: ::core::ffi::c_int,
4402        n: ::core::ffi::c_int,
4403        A: *mut f32,
4404        lda: ::core::ffi::c_int,
4405        Workspace: *mut f32,
4406        devIpiv: *mut ::core::ffi::c_int,
4407        devInfo: *mut ::core::ffi::c_int,
4408    ) -> cusolverStatus_t;
4409}
4410unsafe extern "C" {
4411    /// These helper functions calculate the size of work buffers needed.
4412    ///
4413    /// Please visit [cuSOLVER Library Samples - getrf](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/getrf) for a code example.
4414    ///
4415    /// The S and D data types are real single and double precision, respectively.
4416    ///
4417    /// The C and Z data types are complex valued single and double precision, respectively.
4418    ///
4419    /// This function computes the LU factorization of an $m \times n$ matrix:
4420    ///
4421    /// $$
4422    /// P\\*A = L\\*U
4423    /// $$
4424    /// where `A` is an $m \times n$ matrix, `P` is a permutation matrix, `L` is a lower triangular matrix with unit diagonal, and `U` is an upper triangular matrix.
4425    ///
4426    /// The user has to provide working space which is pointed by input parameter `Workspace`. The input parameter `Lwork` is size of the working space, and it is returned by `getrf_bufferSize()`.
4427    ///
4428    /// If LU factorization failed, i.e. matrix `A` (`U`) is singular, The output parameter `devInfo=i` indicates `U(i,i) = 0`.
4429    ///
4430    /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
4431    ///
4432    /// If `devIpiv` is null, no pivoting is performed. The factorization is `A=L*U`, which is not numerically stable.
4433    ///
4434    /// No matter LU factorization failed or not, the output parameter `devIpiv` contains pivoting sequence, row `i` is interchanged with row `devIpiv(i)`.
4435    ///
4436    /// The user can combine `getrf` and `getrs` to complete a linear solver.
4437    ///
4438    /// Remark: `getrf` uses fastest implementation with large workspace of size `m*n`. The user can choose the legacy implementation with minimal workspace by `Getrf` and `cusolverDnSetAdvOptions(params, CUSOLVERDN_GETRF, CUSOLVER_ALG_1)`.
4439    ///
4440    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The operation completed successfully.
4441    ///
4442    /// [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]:   The library was not initialized.
4443    ///
4444    /// [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]:   Invalid parameters were passed (`m,n<0` or `lda<max(1,m)`).
4445    ///
4446    /// [`cusolverStatus_t::CUSOLVER_STATUS_ARCH_MISMATCH`]:   The device only supports compute capability 5.0 and above.
4447    ///
4448    /// [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]:   An internal operation failed.
4449    pub fn cusolverDnDgetrf(
4450        handle: cusolverDnHandle_t,
4451        m: ::core::ffi::c_int,
4452        n: ::core::ffi::c_int,
4453        A: *mut f64,
4454        lda: ::core::ffi::c_int,
4455        Workspace: *mut f64,
4456        devIpiv: *mut ::core::ffi::c_int,
4457        devInfo: *mut ::core::ffi::c_int,
4458    ) -> cusolverStatus_t;
4459}
4460unsafe extern "C" {
4461    /// These helper functions calculate the size of work buffers needed.
4462    ///
4463    /// Please visit [cuSOLVER Library Samples - getrf](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/getrf) for a code example.
4464    ///
4465    /// The S and D data types are real single and double precision, respectively.
4466    ///
4467    /// The C and Z data types are complex valued single and double precision, respectively.
4468    ///
4469    /// This function computes the LU factorization of an $m \times n$ matrix:
4470    ///
4471    /// $$
4472    /// P\\*A = L\\*U
4473    /// $$
4474    /// where `A` is an $m \times n$ matrix, `P` is a permutation matrix, `L` is a lower triangular matrix with unit diagonal, and `U` is an upper triangular matrix.
4475    ///
4476    /// The user has to provide working space which is pointed by input parameter `Workspace`. The input parameter `Lwork` is size of the working space, and it is returned by `getrf_bufferSize()`.
4477    ///
4478    /// If LU factorization failed, i.e. matrix `A` (`U`) is singular, The output parameter `devInfo=i` indicates `U(i,i) = 0`.
4479    ///
4480    /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
4481    ///
4482    /// If `devIpiv` is null, no pivoting is performed. The factorization is `A=L*U`, which is not numerically stable.
4483    ///
4484    /// No matter LU factorization failed or not, the output parameter `devIpiv` contains pivoting sequence, row `i` is interchanged with row `devIpiv(i)`.
4485    ///
4486    /// The user can combine `getrf` and `getrs` to complete a linear solver.
4487    ///
4488    /// Remark: `getrf` uses fastest implementation with large workspace of size `m*n`. The user can choose the legacy implementation with minimal workspace by `Getrf` and `cusolverDnSetAdvOptions(params, CUSOLVERDN_GETRF, CUSOLVER_ALG_1)`.
4489    ///
4490    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The operation completed successfully.
4491    ///
4492    /// [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]:   The library was not initialized.
4493    ///
4494    /// [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]:   Invalid parameters were passed (`m,n<0` or `lda<max(1,m)`).
4495    ///
4496    /// [`cusolverStatus_t::CUSOLVER_STATUS_ARCH_MISMATCH`]:   The device only supports compute capability 5.0 and above.
4497    ///
4498    /// [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]:   An internal operation failed.
4499    pub fn cusolverDnCgetrf(
4500        handle: cusolverDnHandle_t,
4501        m: ::core::ffi::c_int,
4502        n: ::core::ffi::c_int,
4503        A: *mut cuComplex,
4504        lda: ::core::ffi::c_int,
4505        Workspace: *mut cuComplex,
4506        devIpiv: *mut ::core::ffi::c_int,
4507        devInfo: *mut ::core::ffi::c_int,
4508    ) -> cusolverStatus_t;
4509}
4510unsafe extern "C" {
4511    /// These helper functions calculate the size of work buffers needed.
4512    ///
4513    /// Please visit [cuSOLVER Library Samples - getrf](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/getrf) for a code example.
4514    ///
4515    /// The S and D data types are real single and double precision, respectively.
4516    ///
4517    /// The C and Z data types are complex valued single and double precision, respectively.
4518    ///
4519    /// This function computes the LU factorization of an $m \times n$ matrix:
4520    ///
4521    /// $$
4522    /// P\\*A = L\\*U
4523    /// $$
4524    /// where `A` is an $m \times n$ matrix, `P` is a permutation matrix, `L` is a lower triangular matrix with unit diagonal, and `U` is an upper triangular matrix.
4525    ///
4526    /// The user has to provide working space which is pointed by input parameter `Workspace`. The input parameter `Lwork` is size of the working space, and it is returned by `getrf_bufferSize()`.
4527    ///
4528    /// If LU factorization failed, i.e. matrix `A` (`U`) is singular, The output parameter `devInfo=i` indicates `U(i,i) = 0`.
4529    ///
4530    /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
4531    ///
4532    /// If `devIpiv` is null, no pivoting is performed. The factorization is `A=L*U`, which is not numerically stable.
4533    ///
4534    /// No matter LU factorization failed or not, the output parameter `devIpiv` contains pivoting sequence, row `i` is interchanged with row `devIpiv(i)`.
4535    ///
4536    /// The user can combine `getrf` and `getrs` to complete a linear solver.
4537    ///
4538    /// Remark: `getrf` uses fastest implementation with large workspace of size `m*n`. The user can choose the legacy implementation with minimal workspace by `Getrf` and `cusolverDnSetAdvOptions(params, CUSOLVERDN_GETRF, CUSOLVER_ALG_1)`.
4539    ///
4540    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The operation completed successfully.
4541    ///
4542    /// [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]:   The library was not initialized.
4543    ///
4544    /// [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]:   Invalid parameters were passed (`m,n<0` or `lda<max(1,m)`).
4545    ///
4546    /// [`cusolverStatus_t::CUSOLVER_STATUS_ARCH_MISMATCH`]:   The device only supports compute capability 5.0 and above.
4547    ///
4548    /// [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]:   An internal operation failed.
4549    pub fn cusolverDnZgetrf(
4550        handle: cusolverDnHandle_t,
4551        m: ::core::ffi::c_int,
4552        n: ::core::ffi::c_int,
4553        A: *mut cuDoubleComplex,
4554        lda: ::core::ffi::c_int,
4555        Workspace: *mut cuDoubleComplex,
4556        devIpiv: *mut ::core::ffi::c_int,
4557        devInfo: *mut ::core::ffi::c_int,
4558    ) -> cusolverStatus_t;
4559}
4560unsafe extern "C" {
4561    pub fn cusolverDnSlaswp(
4562        handle: cusolverDnHandle_t,
4563        n: ::core::ffi::c_int,
4564        A: *mut f32,
4565        lda: ::core::ffi::c_int,
4566        k1: ::core::ffi::c_int,
4567        k2: ::core::ffi::c_int,
4568        devIpiv: *const ::core::ffi::c_int,
4569        incx: ::core::ffi::c_int,
4570    ) -> cusolverStatus_t;
4571}
4572unsafe extern "C" {
4573    pub fn cusolverDnDlaswp(
4574        handle: cusolverDnHandle_t,
4575        n: ::core::ffi::c_int,
4576        A: *mut f64,
4577        lda: ::core::ffi::c_int,
4578        k1: ::core::ffi::c_int,
4579        k2: ::core::ffi::c_int,
4580        devIpiv: *const ::core::ffi::c_int,
4581        incx: ::core::ffi::c_int,
4582    ) -> cusolverStatus_t;
4583}
4584unsafe extern "C" {
4585    pub fn cusolverDnClaswp(
4586        handle: cusolverDnHandle_t,
4587        n: ::core::ffi::c_int,
4588        A: *mut cuComplex,
4589        lda: ::core::ffi::c_int,
4590        k1: ::core::ffi::c_int,
4591        k2: ::core::ffi::c_int,
4592        devIpiv: *const ::core::ffi::c_int,
4593        incx: ::core::ffi::c_int,
4594    ) -> cusolverStatus_t;
4595}
4596unsafe extern "C" {
4597    pub fn cusolverDnZlaswp(
4598        handle: cusolverDnHandle_t,
4599        n: ::core::ffi::c_int,
4600        A: *mut cuDoubleComplex,
4601        lda: ::core::ffi::c_int,
4602        k1: ::core::ffi::c_int,
4603        k2: ::core::ffi::c_int,
4604        devIpiv: *const ::core::ffi::c_int,
4605        incx: ::core::ffi::c_int,
4606    ) -> cusolverStatus_t;
4607}
4608unsafe extern "C" {
4609    /// Please visit [cuSOLVER Library Samples - getrf](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/getrf) for a code example.
4610    ///
4611    /// This function solves a linear system of multiple right-hand sides:
4612    ///
4613    /// $$
4614    /// op(A)\\*X = B
4615    /// $$
4616    /// where `A` is an $n \times n$ matrix, and was LU-factored by `getrf`, that is, lower triangular part of A is `L`, and upper triangular part (including diagonal elements) of `A` is `U`. `B` is an $n\times {nrhs}$ right-hand side matrix.
4617    ///
4618    /// The input parameter `trans` is defined by
4619    ///
4620    /// ![image1](_images/op-trans.png)
4621    ///
4622    /// The input parameter `devIpiv` is an output of `getrf`. It contains pivot indices, which are used to permutate right-hand sides.
4623    ///
4624    /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
4625    ///
4626    /// The user can combine `getrf` and `getrs` to complete a linear solver.
4627    ///
4628    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The operation completed successfully.
4629    ///
4630    /// [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]:   The library was not initialized.
4631    ///
4632    /// [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]:   Invalid parameters were passed (`n<0` or `lda<max(1,n)` or `ldb<max(1,n)`).
4633    ///
4634    /// [`cusolverStatus_t::CUSOLVER_STATUS_ARCH_MISMATCH`]:   The device only supports compute capability 5.0 and above.
4635    ///
4636    /// [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]:   An internal operation failed.
4637    pub fn cusolverDnSgetrs(
4638        handle: cusolverDnHandle_t,
4639        trans: cublasOperation_t,
4640        n: ::core::ffi::c_int,
4641        nrhs: ::core::ffi::c_int,
4642        A: *const f32,
4643        lda: ::core::ffi::c_int,
4644        devIpiv: *const ::core::ffi::c_int,
4645        B: *mut f32,
4646        ldb: ::core::ffi::c_int,
4647        devInfo: *mut ::core::ffi::c_int,
4648    ) -> cusolverStatus_t;
4649}
4650unsafe extern "C" {
4651    /// Please visit [cuSOLVER Library Samples - getrf](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/getrf) for a code example.
4652    ///
4653    /// This function solves a linear system of multiple right-hand sides:
4654    ///
4655    /// $$
4656    /// op(A)\\*X = B
4657    /// $$
4658    /// where `A` is an $n \times n$ matrix, and was LU-factored by `getrf`, that is, lower triangular part of A is `L`, and upper triangular part (including diagonal elements) of `A` is `U`. `B` is an $n\times {nrhs}$ right-hand side matrix.
4659    ///
4660    /// The input parameter `trans` is defined by
4661    ///
4662    /// ![image1](_images/op-trans.png)
4663    ///
4664    /// The input parameter `devIpiv` is an output of `getrf`. It contains pivot indices, which are used to permutate right-hand sides.
4665    ///
4666    /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
4667    ///
4668    /// The user can combine `getrf` and `getrs` to complete a linear solver.
4669    ///
4670    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The operation completed successfully.
4671    ///
4672    /// [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]:   The library was not initialized.
4673    ///
4674    /// [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]:   Invalid parameters were passed (`n<0` or `lda<max(1,n)` or `ldb<max(1,n)`).
4675    ///
4676    /// [`cusolverStatus_t::CUSOLVER_STATUS_ARCH_MISMATCH`]:   The device only supports compute capability 5.0 and above.
4677    ///
4678    /// [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]:   An internal operation failed.
4679    pub fn cusolverDnDgetrs(
4680        handle: cusolverDnHandle_t,
4681        trans: cublasOperation_t,
4682        n: ::core::ffi::c_int,
4683        nrhs: ::core::ffi::c_int,
4684        A: *const f64,
4685        lda: ::core::ffi::c_int,
4686        devIpiv: *const ::core::ffi::c_int,
4687        B: *mut f64,
4688        ldb: ::core::ffi::c_int,
4689        devInfo: *mut ::core::ffi::c_int,
4690    ) -> cusolverStatus_t;
4691}
4692unsafe extern "C" {
4693    /// Please visit [cuSOLVER Library Samples - getrf](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/getrf) for a code example.
4694    ///
4695    /// This function solves a linear system of multiple right-hand sides:
4696    ///
4697    /// $$
4698    /// op(A)\\*X = B
4699    /// $$
4700    /// where `A` is an $n \times n$ matrix, and was LU-factored by `getrf`, that is, lower triangular part of A is `L`, and upper triangular part (including diagonal elements) of `A` is `U`. `B` is an $n\times {nrhs}$ right-hand side matrix.
4701    ///
4702    /// The input parameter `trans` is defined by
4703    ///
4704    /// ![image1](_images/op-trans.png)
4705    ///
4706    /// The input parameter `devIpiv` is an output of `getrf`. It contains pivot indices, which are used to permutate right-hand sides.
4707    ///
4708    /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
4709    ///
4710    /// The user can combine `getrf` and `getrs` to complete a linear solver.
4711    ///
4712    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The operation completed successfully.
4713    ///
4714    /// [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]:   The library was not initialized.
4715    ///
4716    /// [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]:   Invalid parameters were passed (`n<0` or `lda<max(1,n)` or `ldb<max(1,n)`).
4717    ///
4718    /// [`cusolverStatus_t::CUSOLVER_STATUS_ARCH_MISMATCH`]:   The device only supports compute capability 5.0 and above.
4719    ///
4720    /// [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]:   An internal operation failed.
4721    pub fn cusolverDnCgetrs(
4722        handle: cusolverDnHandle_t,
4723        trans: cublasOperation_t,
4724        n: ::core::ffi::c_int,
4725        nrhs: ::core::ffi::c_int,
4726        A: *const cuComplex,
4727        lda: ::core::ffi::c_int,
4728        devIpiv: *const ::core::ffi::c_int,
4729        B: *mut cuComplex,
4730        ldb: ::core::ffi::c_int,
4731        devInfo: *mut ::core::ffi::c_int,
4732    ) -> cusolverStatus_t;
4733}
4734unsafe extern "C" {
4735    /// Please visit [cuSOLVER Library Samples - getrf](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/getrf) for a code example.
4736    ///
4737    /// This function solves a linear system of multiple right-hand sides:
4738    ///
4739    /// $$
4740    /// op(A)\\*X = B
4741    /// $$
4742    /// where `A` is an $n \times n$ matrix, and was LU-factored by `getrf`, that is, lower triangular part of A is `L`, and upper triangular part (including diagonal elements) of `A` is `U`. `B` is an $n\times {nrhs}$ right-hand side matrix.
4743    ///
4744    /// The input parameter `trans` is defined by
4745    ///
4746    /// ![image1](_images/op-trans.png)
4747    ///
4748    /// The input parameter `devIpiv` is an output of `getrf`. It contains pivot indices, which are used to permutate right-hand sides.
4749    ///
4750    /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
4751    ///
4752    /// The user can combine `getrf` and `getrs` to complete a linear solver.
4753    ///
4754    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The operation completed successfully.
4755    ///
4756    /// [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]:   The library was not initialized.
4757    ///
4758    /// [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]:   Invalid parameters were passed (`n<0` or `lda<max(1,n)` or `ldb<max(1,n)`).
4759    ///
4760    /// [`cusolverStatus_t::CUSOLVER_STATUS_ARCH_MISMATCH`]:   The device only supports compute capability 5.0 and above.
4761    ///
4762    /// [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]:   An internal operation failed.
4763    pub fn cusolverDnZgetrs(
4764        handle: cusolverDnHandle_t,
4765        trans: cublasOperation_t,
4766        n: ::core::ffi::c_int,
4767        nrhs: ::core::ffi::c_int,
4768        A: *const cuDoubleComplex,
4769        lda: ::core::ffi::c_int,
4770        devIpiv: *const ::core::ffi::c_int,
4771        B: *mut cuDoubleComplex,
4772        ldb: ::core::ffi::c_int,
4773        devInfo: *mut ::core::ffi::c_int,
4774    ) -> cusolverStatus_t;
4775}
4776unsafe extern "C" {
4777    pub fn cusolverDnSgeqrf_bufferSize(
4778        handle: cusolverDnHandle_t,
4779        m: ::core::ffi::c_int,
4780        n: ::core::ffi::c_int,
4781        A: *mut f32,
4782        lda: ::core::ffi::c_int,
4783        lwork: *mut ::core::ffi::c_int,
4784    ) -> cusolverStatus_t;
4785}
4786unsafe extern "C" {
4787    pub fn cusolverDnDgeqrf_bufferSize(
4788        handle: cusolverDnHandle_t,
4789        m: ::core::ffi::c_int,
4790        n: ::core::ffi::c_int,
4791        A: *mut f64,
4792        lda: ::core::ffi::c_int,
4793        lwork: *mut ::core::ffi::c_int,
4794    ) -> cusolverStatus_t;
4795}
4796unsafe extern "C" {
4797    pub fn cusolverDnCgeqrf_bufferSize(
4798        handle: cusolverDnHandle_t,
4799        m: ::core::ffi::c_int,
4800        n: ::core::ffi::c_int,
4801        A: *mut cuComplex,
4802        lda: ::core::ffi::c_int,
4803        lwork: *mut ::core::ffi::c_int,
4804    ) -> cusolverStatus_t;
4805}
4806unsafe extern "C" {
4807    pub fn cusolverDnZgeqrf_bufferSize(
4808        handle: cusolverDnHandle_t,
4809        m: ::core::ffi::c_int,
4810        n: ::core::ffi::c_int,
4811        A: *mut cuDoubleComplex,
4812        lda: ::core::ffi::c_int,
4813        lwork: *mut ::core::ffi::c_int,
4814    ) -> cusolverStatus_t;
4815}
4816unsafe extern "C" {
4817    /// These helper functions calculate the size of work buffers needed.
4818    ///
4819    /// The S and D data types are real valued single and double precision, respectively.
4820    ///
4821    /// The C and Z data types are complex valued single and double precision, respectively.
4822    ///
4823    /// This function computes the QR factorization of an $m \times n$ matrix:
4824    ///
4825    /// $$
4826    /// A = Q\\*R
4827    /// $$
4828    /// where `A` is an $m \times n$ matrix, `Q` is an $m \times n$ matrix, and `R` is a $n \times n$ upper triangular matrix.
4829    ///
4830    /// The user has to provide working space which is pointed by input parameter `Workspace`. The input parameter `Lwork` is size of the working space, and it is returned by `geqrf_bufferSize()`.
4831    ///
4832    /// The matrix `R` is overwritten in upper triangular part of `A`, including diagonal elements.
4833    ///
4834    /// The matrix `Q` is not formed explicitly, instead, a sequence of householder vectors are stored in lower triangular part of `A`. The leading nonzero element of householder vector is assumed to be 1 such that output parameter `TAU` contains the scaling factor `τ`. If `v` is original householder vector, `q` is the new householder vector corresponding to `τ`, satisfying the following relation:
4835    ///
4836    /// $$
4837    /// I - 2\\*v\\*v^{H} = I - \tau\\*q\\*q^{H}
4838    /// $$
4839    /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
4840    ///
4841    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The operation completed successfully.
4842    ///
4843    /// [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]:   The library was not initialized.
4844    ///
4845    /// [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]:   Invalid parameters were passed (`m,n<0` or `lda<max(1,m)`).
4846    ///
4847    /// [`cusolverStatus_t::CUSOLVER_STATUS_ARCH_MISMATCH`]:   The device only supports compute capability 5.0 and above.
4848    ///
4849    /// [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]:   An internal operation failed.
4850    pub fn cusolverDnSgeqrf(
4851        handle: cusolverDnHandle_t,
4852        m: ::core::ffi::c_int,
4853        n: ::core::ffi::c_int,
4854        A: *mut f32,
4855        lda: ::core::ffi::c_int,
4856        TAU: *mut f32,
4857        Workspace: *mut f32,
4858        Lwork: ::core::ffi::c_int,
4859        devInfo: *mut ::core::ffi::c_int,
4860    ) -> cusolverStatus_t;
4861}
4862unsafe extern "C" {
4863    /// These helper functions calculate the size of work buffers needed.
4864    ///
4865    /// The S and D data types are real valued single and double precision, respectively.
4866    ///
4867    /// The C and Z data types are complex valued single and double precision, respectively.
4868    ///
4869    /// This function computes the QR factorization of an $m \times n$ matrix:
4870    ///
4871    /// $$
4872    /// A = Q\\*R
4873    /// $$
4874    /// where `A` is an $m \times n$ matrix, `Q` is an $m \times n$ matrix, and `R` is a $n \times n$ upper triangular matrix.
4875    ///
4876    /// The user has to provide working space which is pointed by input parameter `Workspace`. The input parameter `Lwork` is size of the working space, and it is returned by `geqrf_bufferSize()`.
4877    ///
4878    /// The matrix `R` is overwritten in upper triangular part of `A`, including diagonal elements.
4879    ///
4880    /// The matrix `Q` is not formed explicitly, instead, a sequence of householder vectors are stored in lower triangular part of `A`. The leading nonzero element of householder vector is assumed to be 1 such that output parameter `TAU` contains the scaling factor `τ`. If `v` is original householder vector, `q` is the new householder vector corresponding to `τ`, satisfying the following relation:
4881    ///
4882    /// $$
4883    /// I - 2\\*v\\*v^{H} = I - \tau\\*q\\*q^{H}
4884    /// $$
4885    /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
4886    ///
4887    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The operation completed successfully.
4888    ///
4889    /// [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]:   The library was not initialized.
4890    ///
4891    /// [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]:   Invalid parameters were passed (`m,n<0` or `lda<max(1,m)`).
4892    ///
4893    /// [`cusolverStatus_t::CUSOLVER_STATUS_ARCH_MISMATCH`]:   The device only supports compute capability 5.0 and above.
4894    ///
4895    /// [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]:   An internal operation failed.
4896    pub fn cusolverDnDgeqrf(
4897        handle: cusolverDnHandle_t,
4898        m: ::core::ffi::c_int,
4899        n: ::core::ffi::c_int,
4900        A: *mut f64,
4901        lda: ::core::ffi::c_int,
4902        TAU: *mut f64,
4903        Workspace: *mut f64,
4904        Lwork: ::core::ffi::c_int,
4905        devInfo: *mut ::core::ffi::c_int,
4906    ) -> cusolverStatus_t;
4907}
4908unsafe extern "C" {
4909    /// These helper functions calculate the size of work buffers needed.
4910    ///
4911    /// The S and D data types are real valued single and double precision, respectively.
4912    ///
4913    /// The C and Z data types are complex valued single and double precision, respectively.
4914    ///
4915    /// This function computes the QR factorization of an $m \times n$ matrix:
4916    ///
4917    /// $$
4918    /// A = Q\\*R
4919    /// $$
4920    /// where `A` is an $m \times n$ matrix, `Q` is an $m \times n$ matrix, and `R` is a $n \times n$ upper triangular matrix.
4921    ///
4922    /// The user has to provide working space which is pointed by input parameter `Workspace`. The input parameter `Lwork` is size of the working space, and it is returned by `geqrf_bufferSize()`.
4923    ///
4924    /// The matrix `R` is overwritten in upper triangular part of `A`, including diagonal elements.
4925    ///
4926    /// The matrix `Q` is not formed explicitly, instead, a sequence of householder vectors are stored in lower triangular part of `A`. The leading nonzero element of householder vector is assumed to be 1 such that output parameter `TAU` contains the scaling factor `τ`. If `v` is original householder vector, `q` is the new householder vector corresponding to `τ`, satisfying the following relation:
4927    ///
4928    /// $$
4929    /// I - 2\\*v\\*v^{H} = I - \tau\\*q\\*q^{H}
4930    /// $$
4931    /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
4932    ///
4933    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The operation completed successfully.
4934    ///
4935    /// [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]:   The library was not initialized.
4936    ///
4937    /// [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]:   Invalid parameters were passed (`m,n<0` or `lda<max(1,m)`).
4938    ///
4939    /// [`cusolverStatus_t::CUSOLVER_STATUS_ARCH_MISMATCH`]:   The device only supports compute capability 5.0 and above.
4940    ///
4941    /// [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]:   An internal operation failed.
4942    pub fn cusolverDnCgeqrf(
4943        handle: cusolverDnHandle_t,
4944        m: ::core::ffi::c_int,
4945        n: ::core::ffi::c_int,
4946        A: *mut cuComplex,
4947        lda: ::core::ffi::c_int,
4948        TAU: *mut cuComplex,
4949        Workspace: *mut cuComplex,
4950        Lwork: ::core::ffi::c_int,
4951        devInfo: *mut ::core::ffi::c_int,
4952    ) -> cusolverStatus_t;
4953}
4954unsafe extern "C" {
4955    /// These helper functions calculate the size of work buffers needed.
4956    ///
4957    /// The S and D data types are real valued single and double precision, respectively.
4958    ///
4959    /// The C and Z data types are complex valued single and double precision, respectively.
4960    ///
4961    /// This function computes the QR factorization of an $m \times n$ matrix:
4962    ///
4963    /// $$
4964    /// A = Q\\*R
4965    /// $$
4966    /// where `A` is an $m \times n$ matrix, `Q` is an $m \times n$ matrix, and `R` is a $n \times n$ upper triangular matrix.
4967    ///
4968    /// The user has to provide working space which is pointed by input parameter `Workspace`. The input parameter `Lwork` is size of the working space, and it is returned by `geqrf_bufferSize()`.
4969    ///
4970    /// The matrix `R` is overwritten in upper triangular part of `A`, including diagonal elements.
4971    ///
4972    /// The matrix `Q` is not formed explicitly, instead, a sequence of householder vectors are stored in lower triangular part of `A`. The leading nonzero element of householder vector is assumed to be 1 such that output parameter `TAU` contains the scaling factor `τ`. If `v` is original householder vector, `q` is the new householder vector corresponding to `τ`, satisfying the following relation:
4973    ///
4974    /// $$
4975    /// I - 2\\*v\\*v^{H} = I - \tau\\*q\\*q^{H}
4976    /// $$
4977    /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
4978    ///
4979    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The operation completed successfully.
4980    ///
4981    /// [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]:   The library was not initialized.
4982    ///
4983    /// [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]:   Invalid parameters were passed (`m,n<0` or `lda<max(1,m)`).
4984    ///
4985    /// [`cusolverStatus_t::CUSOLVER_STATUS_ARCH_MISMATCH`]:   The device only supports compute capability 5.0 and above.
4986    ///
4987    /// [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]:   An internal operation failed.
4988    pub fn cusolverDnZgeqrf(
4989        handle: cusolverDnHandle_t,
4990        m: ::core::ffi::c_int,
4991        n: ::core::ffi::c_int,
4992        A: *mut cuDoubleComplex,
4993        lda: ::core::ffi::c_int,
4994        TAU: *mut cuDoubleComplex,
4995        Workspace: *mut cuDoubleComplex,
4996        Lwork: ::core::ffi::c_int,
4997        devInfo: *mut ::core::ffi::c_int,
4998    ) -> cusolverStatus_t;
4999}
5000unsafe extern "C" {
5001    pub fn cusolverDnSorgqr_bufferSize(
5002        handle: cusolverDnHandle_t,
5003        m: ::core::ffi::c_int,
5004        n: ::core::ffi::c_int,
5005        k: ::core::ffi::c_int,
5006        A: *const f32,
5007        lda: ::core::ffi::c_int,
5008        tau: *const f32,
5009        lwork: *mut ::core::ffi::c_int,
5010    ) -> cusolverStatus_t;
5011}
5012unsafe extern "C" {
5013    pub fn cusolverDnDorgqr_bufferSize(
5014        handle: cusolverDnHandle_t,
5015        m: ::core::ffi::c_int,
5016        n: ::core::ffi::c_int,
5017        k: ::core::ffi::c_int,
5018        A: *const f64,
5019        lda: ::core::ffi::c_int,
5020        tau: *const f64,
5021        lwork: *mut ::core::ffi::c_int,
5022    ) -> cusolverStatus_t;
5023}
5024unsafe extern "C" {
5025    pub fn cusolverDnCungqr_bufferSize(
5026        handle: cusolverDnHandle_t,
5027        m: ::core::ffi::c_int,
5028        n: ::core::ffi::c_int,
5029        k: ::core::ffi::c_int,
5030        A: *const cuComplex,
5031        lda: ::core::ffi::c_int,
5032        tau: *const cuComplex,
5033        lwork: *mut ::core::ffi::c_int,
5034    ) -> cusolverStatus_t;
5035}
5036unsafe extern "C" {
5037    pub fn cusolverDnZungqr_bufferSize(
5038        handle: cusolverDnHandle_t,
5039        m: ::core::ffi::c_int,
5040        n: ::core::ffi::c_int,
5041        k: ::core::ffi::c_int,
5042        A: *const cuDoubleComplex,
5043        lda: ::core::ffi::c_int,
5044        tau: *const cuDoubleComplex,
5045        lwork: *mut ::core::ffi::c_int,
5046    ) -> cusolverStatus_t;
5047}
5048unsafe extern "C" {
5049    /// These helper functions calculate the size of work buffers needed. Please visit [cuSOLVER Library Samples - orgqr](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/orgqr) for a code example.
5050    ///
5051    /// The S and D data types are real valued single and double precision, respectively.
5052    ///
5053    /// The C and Z data types are complex valued single and double precision, respectively.
5054    ///
5055    /// This function overwrites $m \times n$ matrix `A` by:
5056    ///
5057    /// $$
5058    /// Q = {H(1)}\\*{H(2)}\\*{...}\\*{H(k)}
5059    /// $$
5060    /// where `Q` is a unitary matrix formed by a sequence of elementary reflection vectors stored in `A`.
5061    ///
5062    /// The user has to provide working space which is pointed by input parameter `work`. The input parameter `lwork` is size of the working space, and it is returned by `orgqr_bufferSize()`. Please note that the size in bytes of the working space is equal to `sizeof(<type>) * lwork`.
5063    ///
5064    /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
5065    ///
5066    /// The user can combine `geqrf`, `orgqr` to complete orthogonalization.
5067    ///
5068    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The operation completed successfully.
5069    ///
5070    /// [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]:   The library was not initialized.
5071    ///
5072    /// [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]:   Invalid parameters were passed (`m,n,k<0`, `n>m`, `k>n` or `lda<m`).
5073    ///
5074    /// [`cusolverStatus_t::CUSOLVER_STATUS_ARCH_MISMATCH`]:   The device only supports compute capability 5.0 and above.
5075    ///
5076    /// [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]:   An internal operation failed.
5077    pub fn cusolverDnSorgqr(
5078        handle: cusolverDnHandle_t,
5079        m: ::core::ffi::c_int,
5080        n: ::core::ffi::c_int,
5081        k: ::core::ffi::c_int,
5082        A: *mut f32,
5083        lda: ::core::ffi::c_int,
5084        tau: *const f32,
5085        work: *mut f32,
5086        lwork: ::core::ffi::c_int,
5087        info: *mut ::core::ffi::c_int,
5088    ) -> cusolverStatus_t;
5089}
5090unsafe extern "C" {
5091    /// These helper functions calculate the size of work buffers needed. Please visit [cuSOLVER Library Samples - orgqr](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/orgqr) for a code example.
5092    ///
5093    /// The S and D data types are real valued single and double precision, respectively.
5094    ///
5095    /// The C and Z data types are complex valued single and double precision, respectively.
5096    ///
5097    /// This function overwrites $m \times n$ matrix `A` by:
5098    ///
5099    /// $$
5100    /// Q = {H(1)}\\*{H(2)}\\*{...}\\*{H(k)}
5101    /// $$
5102    /// where `Q` is a unitary matrix formed by a sequence of elementary reflection vectors stored in `A`.
5103    ///
5104    /// The user has to provide working space which is pointed by input parameter `work`. The input parameter `lwork` is size of the working space, and it is returned by `orgqr_bufferSize()`. Please note that the size in bytes of the working space is equal to `sizeof(<type>) * lwork`.
5105    ///
5106    /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
5107    ///
5108    /// The user can combine `geqrf`, `orgqr` to complete orthogonalization.
5109    ///
5110    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The operation completed successfully.
5111    ///
5112    /// [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]:   The library was not initialized.
5113    ///
5114    /// [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]:   Invalid parameters were passed (`m,n,k<0`, `n>m`, `k>n` or `lda<m`).
5115    ///
5116    /// [`cusolverStatus_t::CUSOLVER_STATUS_ARCH_MISMATCH`]:   The device only supports compute capability 5.0 and above.
5117    ///
5118    /// [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]:   An internal operation failed.
5119    pub fn cusolverDnDorgqr(
5120        handle: cusolverDnHandle_t,
5121        m: ::core::ffi::c_int,
5122        n: ::core::ffi::c_int,
5123        k: ::core::ffi::c_int,
5124        A: *mut f64,
5125        lda: ::core::ffi::c_int,
5126        tau: *const f64,
5127        work: *mut f64,
5128        lwork: ::core::ffi::c_int,
5129        info: *mut ::core::ffi::c_int,
5130    ) -> cusolverStatus_t;
5131}
5132unsafe extern "C" {
5133    pub fn cusolverDnCungqr(
5134        handle: cusolverDnHandle_t,
5135        m: ::core::ffi::c_int,
5136        n: ::core::ffi::c_int,
5137        k: ::core::ffi::c_int,
5138        A: *mut cuComplex,
5139        lda: ::core::ffi::c_int,
5140        tau: *const cuComplex,
5141        work: *mut cuComplex,
5142        lwork: ::core::ffi::c_int,
5143        info: *mut ::core::ffi::c_int,
5144    ) -> cusolverStatus_t;
5145}
5146unsafe extern "C" {
5147    pub fn cusolverDnZungqr(
5148        handle: cusolverDnHandle_t,
5149        m: ::core::ffi::c_int,
5150        n: ::core::ffi::c_int,
5151        k: ::core::ffi::c_int,
5152        A: *mut cuDoubleComplex,
5153        lda: ::core::ffi::c_int,
5154        tau: *const cuDoubleComplex,
5155        work: *mut cuDoubleComplex,
5156        lwork: ::core::ffi::c_int,
5157        info: *mut ::core::ffi::c_int,
5158    ) -> cusolverStatus_t;
5159}
5160unsafe extern "C" {
5161    pub fn cusolverDnSormqr_bufferSize(
5162        handle: cusolverDnHandle_t,
5163        side: cublasSideMode_t,
5164        trans: cublasOperation_t,
5165        m: ::core::ffi::c_int,
5166        n: ::core::ffi::c_int,
5167        k: ::core::ffi::c_int,
5168        A: *const f32,
5169        lda: ::core::ffi::c_int,
5170        tau: *const f32,
5171        C: *const f32,
5172        ldc: ::core::ffi::c_int,
5173        lwork: *mut ::core::ffi::c_int,
5174    ) -> cusolverStatus_t;
5175}
5176unsafe extern "C" {
5177    pub fn cusolverDnDormqr_bufferSize(
5178        handle: cusolverDnHandle_t,
5179        side: cublasSideMode_t,
5180        trans: cublasOperation_t,
5181        m: ::core::ffi::c_int,
5182        n: ::core::ffi::c_int,
5183        k: ::core::ffi::c_int,
5184        A: *const f64,
5185        lda: ::core::ffi::c_int,
5186        tau: *const f64,
5187        C: *const f64,
5188        ldc: ::core::ffi::c_int,
5189        lwork: *mut ::core::ffi::c_int,
5190    ) -> cusolverStatus_t;
5191}
5192unsafe extern "C" {
5193    pub fn cusolverDnCunmqr_bufferSize(
5194        handle: cusolverDnHandle_t,
5195        side: cublasSideMode_t,
5196        trans: cublasOperation_t,
5197        m: ::core::ffi::c_int,
5198        n: ::core::ffi::c_int,
5199        k: ::core::ffi::c_int,
5200        A: *const cuComplex,
5201        lda: ::core::ffi::c_int,
5202        tau: *const cuComplex,
5203        C: *const cuComplex,
5204        ldc: ::core::ffi::c_int,
5205        lwork: *mut ::core::ffi::c_int,
5206    ) -> cusolverStatus_t;
5207}
5208unsafe extern "C" {
5209    pub fn cusolverDnZunmqr_bufferSize(
5210        handle: cusolverDnHandle_t,
5211        side: cublasSideMode_t,
5212        trans: cublasOperation_t,
5213        m: ::core::ffi::c_int,
5214        n: ::core::ffi::c_int,
5215        k: ::core::ffi::c_int,
5216        A: *const cuDoubleComplex,
5217        lda: ::core::ffi::c_int,
5218        tau: *const cuDoubleComplex,
5219        C: *const cuDoubleComplex,
5220        ldc: ::core::ffi::c_int,
5221        lwork: *mut ::core::ffi::c_int,
5222    ) -> cusolverStatus_t;
5223}
5224unsafe extern "C" {
5225    /// These helper functions calculate the size of work buffers needed. Please visit [cuSOLVER Library Samples - ormqr](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/ormqr) for a code example.
5226    ///
5227    /// The S and D data types are real valued single and double precision, respectively.
5228    ///
5229    /// The C and Z data types are complex valued single and double precision, respectively.
5230    ///
5231    /// This function overwrites $m \times n$ matrix `C` by
5232    ///
5233    /// ![image2](_images/c-side.png)
5234    ///
5235    /// The operation of `Q` is defined by
5236    ///
5237    /// ![image3](_images/op-q-transa.png)
5238    ///
5239    /// `Q` is a unitary matrix formed by a sequence of elementary reflection vectors from QR factorization (`geqrf`) of `A`.
5240    ///
5241    /// `Q`=`H(1)``H(2)` … `H(k)`
5242    ///
5243    /// `Q` is of order `m` if `side` = [`cublasSideMode_t::CUBLAS_SIDE_LEFT`] and of order `n` if `side` = [`cublasSideMode_t::CUBLAS_SIDE_RIGHT`].
5244    ///
5245    /// The user has to provide working space which is pointed by input parameter `work`. The input parameter `lwork` is size of the working space, and it is returned by `geqrf_bufferSize()` or `ormqr_bufferSize()`. Please note that the size in bytes of the working space is equal to `sizeof(<type>) * lwork`.
5246    ///
5247    /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
5248    ///
5249    /// The user can combine `geqrf`, `ormqr` and `trsm` to complete a linear solver or a least-square solver.
5250    ///
5251    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The operation completed successfully.
5252    ///
5253    /// [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]:   The library was not initialized.
5254    ///
5255    /// [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]:   Invalid parameters were passed (`m,n,k<0`, `k > m` if [`cublasSideMode_t::CUBLAS_SIDE_LEFT`], `k > n` if [`cublasSideMode_t::CUBLAS_SIDE_RIGHT`], wrong `lda` or `ldc` or invalid `trans`).
5256    ///
5257    /// [`cusolverStatus_t::CUSOLVER_STATUS_ARCH_MISMATCH`]:   The device only supports compute capability 5.0 and above.
5258    ///
5259    /// [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]:   An internal operation failed.
5260    pub fn cusolverDnSormqr(
5261        handle: cusolverDnHandle_t,
5262        side: cublasSideMode_t,
5263        trans: cublasOperation_t,
5264        m: ::core::ffi::c_int,
5265        n: ::core::ffi::c_int,
5266        k: ::core::ffi::c_int,
5267        A: *const f32,
5268        lda: ::core::ffi::c_int,
5269        tau: *const f32,
5270        C: *mut f32,
5271        ldc: ::core::ffi::c_int,
5272        work: *mut f32,
5273        lwork: ::core::ffi::c_int,
5274        devInfo: *mut ::core::ffi::c_int,
5275    ) -> cusolverStatus_t;
5276}
5277unsafe extern "C" {
5278    /// These helper functions calculate the size of work buffers needed. Please visit [cuSOLVER Library Samples - ormqr](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/ormqr) for a code example.
5279    ///
5280    /// The S and D data types are real valued single and double precision, respectively.
5281    ///
5282    /// The C and Z data types are complex valued single and double precision, respectively.
5283    ///
5284    /// This function overwrites $m \times n$ matrix `C` by
5285    ///
5286    /// ![image2](_images/c-side.png)
5287    ///
5288    /// The operation of `Q` is defined by
5289    ///
5290    /// ![image3](_images/op-q-transa.png)
5291    ///
5292    /// `Q` is a unitary matrix formed by a sequence of elementary reflection vectors from QR factorization (`geqrf`) of `A`.
5293    ///
5294    /// `Q`=`H(1)``H(2)` … `H(k)`
5295    ///
5296    /// `Q` is of order `m` if `side` = [`cublasSideMode_t::CUBLAS_SIDE_LEFT`] and of order `n` if `side` = [`cublasSideMode_t::CUBLAS_SIDE_RIGHT`].
5297    ///
5298    /// The user has to provide working space which is pointed by input parameter `work`. The input parameter `lwork` is size of the working space, and it is returned by `geqrf_bufferSize()` or `ormqr_bufferSize()`. Please note that the size in bytes of the working space is equal to `sizeof(<type>) * lwork`.
5299    ///
5300    /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
5301    ///
5302    /// The user can combine `geqrf`, `ormqr` and `trsm` to complete a linear solver or a least-square solver.
5303    ///
5304    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The operation completed successfully.
5305    ///
5306    /// [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]:   The library was not initialized.
5307    ///
5308    /// [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]:   Invalid parameters were passed (`m,n,k<0`, `k > m` if [`cublasSideMode_t::CUBLAS_SIDE_LEFT`], `k > n` if [`cublasSideMode_t::CUBLAS_SIDE_RIGHT`], wrong `lda` or `ldc` or invalid `trans`).
5309    ///
5310    /// [`cusolverStatus_t::CUSOLVER_STATUS_ARCH_MISMATCH`]:   The device only supports compute capability 5.0 and above.
5311    ///
5312    /// [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]:   An internal operation failed.
5313    pub fn cusolverDnDormqr(
5314        handle: cusolverDnHandle_t,
5315        side: cublasSideMode_t,
5316        trans: cublasOperation_t,
5317        m: ::core::ffi::c_int,
5318        n: ::core::ffi::c_int,
5319        k: ::core::ffi::c_int,
5320        A: *const f64,
5321        lda: ::core::ffi::c_int,
5322        tau: *const f64,
5323        C: *mut f64,
5324        ldc: ::core::ffi::c_int,
5325        work: *mut f64,
5326        lwork: ::core::ffi::c_int,
5327        devInfo: *mut ::core::ffi::c_int,
5328    ) -> cusolverStatus_t;
5329}
5330unsafe extern "C" {
5331    pub fn cusolverDnCunmqr(
5332        handle: cusolverDnHandle_t,
5333        side: cublasSideMode_t,
5334        trans: cublasOperation_t,
5335        m: ::core::ffi::c_int,
5336        n: ::core::ffi::c_int,
5337        k: ::core::ffi::c_int,
5338        A: *const cuComplex,
5339        lda: ::core::ffi::c_int,
5340        tau: *const cuComplex,
5341        C: *mut cuComplex,
5342        ldc: ::core::ffi::c_int,
5343        work: *mut cuComplex,
5344        lwork: ::core::ffi::c_int,
5345        devInfo: *mut ::core::ffi::c_int,
5346    ) -> cusolverStatus_t;
5347}
5348unsafe extern "C" {
5349    pub fn cusolverDnZunmqr(
5350        handle: cusolverDnHandle_t,
5351        side: cublasSideMode_t,
5352        trans: cublasOperation_t,
5353        m: ::core::ffi::c_int,
5354        n: ::core::ffi::c_int,
5355        k: ::core::ffi::c_int,
5356        A: *const cuDoubleComplex,
5357        lda: ::core::ffi::c_int,
5358        tau: *const cuDoubleComplex,
5359        C: *mut cuDoubleComplex,
5360        ldc: ::core::ffi::c_int,
5361        work: *mut cuDoubleComplex,
5362        lwork: ::core::ffi::c_int,
5363        devInfo: *mut ::core::ffi::c_int,
5364    ) -> cusolverStatus_t;
5365}
5366unsafe extern "C" {
5367    pub fn cusolverDnSsytrf_bufferSize(
5368        handle: cusolverDnHandle_t,
5369        n: ::core::ffi::c_int,
5370        A: *mut f32,
5371        lda: ::core::ffi::c_int,
5372        lwork: *mut ::core::ffi::c_int,
5373    ) -> cusolverStatus_t;
5374}
5375unsafe extern "C" {
5376    pub fn cusolverDnDsytrf_bufferSize(
5377        handle: cusolverDnHandle_t,
5378        n: ::core::ffi::c_int,
5379        A: *mut f64,
5380        lda: ::core::ffi::c_int,
5381        lwork: *mut ::core::ffi::c_int,
5382    ) -> cusolverStatus_t;
5383}
5384unsafe extern "C" {
5385    pub fn cusolverDnCsytrf_bufferSize(
5386        handle: cusolverDnHandle_t,
5387        n: ::core::ffi::c_int,
5388        A: *mut cuComplex,
5389        lda: ::core::ffi::c_int,
5390        lwork: *mut ::core::ffi::c_int,
5391    ) -> cusolverStatus_t;
5392}
5393unsafe extern "C" {
5394    pub fn cusolverDnZsytrf_bufferSize(
5395        handle: cusolverDnHandle_t,
5396        n: ::core::ffi::c_int,
5397        A: *mut cuDoubleComplex,
5398        lda: ::core::ffi::c_int,
5399        lwork: *mut ::core::ffi::c_int,
5400    ) -> cusolverStatus_t;
5401}
5402unsafe extern "C" {
5403    /// These helper functions calculate the size of the needed buffers.
5404    ///
5405    /// The S and D data types are real valued single and double precision, respectively.
5406    ///
5407    /// The C and Z data types are complex valued single and double precision, respectively.
5408    ///
5409    /// This function computes the factorization of a symmetric indefinite matrix using the Bunch-Kaufman diagonal pivoting.
5410    ///
5411    /// `A` is a $n \times n$ symmetric matrix, only lower or upper part is meaningful. The input parameter `uplo` indicates which part of the matrix is used. If `devIpiv` is null, no pivoting is performed, which is not numerically stable.
5412    ///
5413    /// If input parameter `uplo` is [`cublasFillMode_t::CUBLAS_FILL_MODE_LOWER`], only lower triangular part of `A` is processed, and replaced by lower triangular factor `L` and block diagonal matrix `D`. Each block of `D` is either 1x1 or 2x2 block, depending on pivoting.
5414    ///
5415    /// $$
5416    /// P\\*A\\*P^{T} = L\\*D\\*L^{T}
5417    /// $$
5418    /// If input parameter `uplo` is [`cublasFillMode_t::CUBLAS_FILL_MODE_UPPER`], only upper triangular part of `A` is processed, and replaced by upper triangular factor `U` and block diagonal matrix `D`.
5419    ///
5420    /// $$
5421    /// P\\*A\\*P^{T} = U\\*D\\*U^{T}
5422    /// $$
5423    /// The user has to provide working space which is pointed by input parameter `work`. The input parameter `lwork` is size of the working space, and it is returned by `sytrf_bufferSize()`. Please note that the size in bytes of the working space is equal to `sizeof(<type>) * lwork`. When no pivoting is performed, the other triangular part of the input matrix `A` is used as workspace.
5424    ///
5425    /// If Bunch-Kaufman factorization failed, i.e. `A` is singular. The output parameter `devInfo = i` would indicate `D(i,i)=0`.
5426    ///
5427    /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
5428    ///
5429    /// The output parameter `devIpiv` contains pivoting sequence. If `devIpiv(i) = k > 0`, `D(i,i)` is 1x1 block, and `i-th` row/column of `A` is interchanged with `k-th` row/column of `A`. If `uplo` is [`cublasFillMode_t::CUBLAS_FILL_MODE_UPPER`] and `devIpiv(i-1) = devIpiv(i) = -m < 0`, `D(i-1:i,i-1:i)` is a 2x2 block, and `(i-1)-th` row/column is interchanged with `m-th` row/column. If `uplo` is [`cublasFillMode_t::CUBLAS_FILL_MODE_LOWER`] and `devIpiv(i+1) = devIpiv(i) = -m < 0`, `D(i:i+1,i:i+1)` is a 2x2 block, and `(i+1)-th` row/column is interchanged with `m-th` row/column.
5430    ///
5431    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The operation completed successfully.
5432    ///
5433    /// [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]:   The library was not initialized.
5434    ///
5435    /// [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]:   Invalid parameters were passed (`n<0` or `lda<max(1,n)`).
5436    ///
5437    /// [`cusolverStatus_t::CUSOLVER_STATUS_ARCH_MISMATCH`]:   The device only supports compute capability 5.0 and above.
5438    ///
5439    /// [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]:   An internal operation failed.
5440    pub fn cusolverDnSsytrf(
5441        handle: cusolverDnHandle_t,
5442        uplo: cublasFillMode_t,
5443        n: ::core::ffi::c_int,
5444        A: *mut f32,
5445        lda: ::core::ffi::c_int,
5446        ipiv: *mut ::core::ffi::c_int,
5447        work: *mut f32,
5448        lwork: ::core::ffi::c_int,
5449        info: *mut ::core::ffi::c_int,
5450    ) -> cusolverStatus_t;
5451}
5452unsafe extern "C" {
5453    /// These helper functions calculate the size of the needed buffers.
5454    ///
5455    /// The S and D data types are real valued single and double precision, respectively.
5456    ///
5457    /// The C and Z data types are complex valued single and double precision, respectively.
5458    ///
5459    /// This function computes the factorization of a symmetric indefinite matrix using the Bunch-Kaufman diagonal pivoting.
5460    ///
5461    /// `A` is a $n \times n$ symmetric matrix, only lower or upper part is meaningful. The input parameter `uplo` indicates which part of the matrix is used. If `devIpiv` is null, no pivoting is performed, which is not numerically stable.
5462    ///
5463    /// If input parameter `uplo` is [`cublasFillMode_t::CUBLAS_FILL_MODE_LOWER`], only lower triangular part of `A` is processed, and replaced by lower triangular factor `L` and block diagonal matrix `D`. Each block of `D` is either 1x1 or 2x2 block, depending on pivoting.
5464    ///
5465    /// $$
5466    /// P\\*A\\*P^{T} = L\\*D\\*L^{T}
5467    /// $$
5468    /// If input parameter `uplo` is [`cublasFillMode_t::CUBLAS_FILL_MODE_UPPER`], only upper triangular part of `A` is processed, and replaced by upper triangular factor `U` and block diagonal matrix `D`.
5469    ///
5470    /// $$
5471    /// P\\*A\\*P^{T} = U\\*D\\*U^{T}
5472    /// $$
5473    /// The user has to provide working space which is pointed by input parameter `work`. The input parameter `lwork` is size of the working space, and it is returned by `sytrf_bufferSize()`. Please note that the size in bytes of the working space is equal to `sizeof(<type>) * lwork`. When no pivoting is performed, the other triangular part of the input matrix `A` is used as workspace.
5474    ///
5475    /// If Bunch-Kaufman factorization failed, i.e. `A` is singular. The output parameter `devInfo = i` would indicate `D(i,i)=0`.
5476    ///
5477    /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
5478    ///
5479    /// The output parameter `devIpiv` contains pivoting sequence. If `devIpiv(i) = k > 0`, `D(i,i)` is 1x1 block, and `i-th` row/column of `A` is interchanged with `k-th` row/column of `A`. If `uplo` is [`cublasFillMode_t::CUBLAS_FILL_MODE_UPPER`] and `devIpiv(i-1) = devIpiv(i) = -m < 0`, `D(i-1:i,i-1:i)` is a 2x2 block, and `(i-1)-th` row/column is interchanged with `m-th` row/column. If `uplo` is [`cublasFillMode_t::CUBLAS_FILL_MODE_LOWER`] and `devIpiv(i+1) = devIpiv(i) = -m < 0`, `D(i:i+1,i:i+1)` is a 2x2 block, and `(i+1)-th` row/column is interchanged with `m-th` row/column.
5480    ///
5481    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The operation completed successfully.
5482    ///
5483    /// [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]:   The library was not initialized.
5484    ///
5485    /// [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]:   Invalid parameters were passed (`n<0` or `lda<max(1,n)`).
5486    ///
5487    /// [`cusolverStatus_t::CUSOLVER_STATUS_ARCH_MISMATCH`]:   The device only supports compute capability 5.0 and above.
5488    ///
5489    /// [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]:   An internal operation failed.
5490    pub fn cusolverDnDsytrf(
5491        handle: cusolverDnHandle_t,
5492        uplo: cublasFillMode_t,
5493        n: ::core::ffi::c_int,
5494        A: *mut f64,
5495        lda: ::core::ffi::c_int,
5496        ipiv: *mut ::core::ffi::c_int,
5497        work: *mut f64,
5498        lwork: ::core::ffi::c_int,
5499        info: *mut ::core::ffi::c_int,
5500    ) -> cusolverStatus_t;
5501}
5502unsafe extern "C" {
5503    /// These helper functions calculate the size of the needed buffers.
5504    ///
5505    /// The S and D data types are real valued single and double precision, respectively.
5506    ///
5507    /// The C and Z data types are complex valued single and double precision, respectively.
5508    ///
5509    /// This function computes the factorization of a symmetric indefinite matrix using the Bunch-Kaufman diagonal pivoting.
5510    ///
5511    /// `A` is a $n \times n$ symmetric matrix, only lower or upper part is meaningful. The input parameter `uplo` indicates which part of the matrix is used. If `devIpiv` is null, no pivoting is performed, which is not numerically stable.
5512    ///
5513    /// If input parameter `uplo` is [`cublasFillMode_t::CUBLAS_FILL_MODE_LOWER`], only lower triangular part of `A` is processed, and replaced by lower triangular factor `L` and block diagonal matrix `D`. Each block of `D` is either 1x1 or 2x2 block, depending on pivoting.
5514    ///
5515    /// $$
5516    /// P\\*A\\*P^{T} = L\\*D\\*L^{T}
5517    /// $$
5518    /// If input parameter `uplo` is [`cublasFillMode_t::CUBLAS_FILL_MODE_UPPER`], only upper triangular part of `A` is processed, and replaced by upper triangular factor `U` and block diagonal matrix `D`.
5519    ///
5520    /// $$
5521    /// P\\*A\\*P^{T} = U\\*D\\*U^{T}
5522    /// $$
5523    /// The user has to provide working space which is pointed by input parameter `work`. The input parameter `lwork` is size of the working space, and it is returned by `sytrf_bufferSize()`. Please note that the size in bytes of the working space is equal to `sizeof(<type>) * lwork`. When no pivoting is performed, the other triangular part of the input matrix `A` is used as workspace.
5524    ///
5525    /// If Bunch-Kaufman factorization failed, i.e. `A` is singular. The output parameter `devInfo = i` would indicate `D(i,i)=0`.
5526    ///
5527    /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
5528    ///
5529    /// The output parameter `devIpiv` contains pivoting sequence. If `devIpiv(i) = k > 0`, `D(i,i)` is 1x1 block, and `i-th` row/column of `A` is interchanged with `k-th` row/column of `A`. If `uplo` is [`cublasFillMode_t::CUBLAS_FILL_MODE_UPPER`] and `devIpiv(i-1) = devIpiv(i) = -m < 0`, `D(i-1:i,i-1:i)` is a 2x2 block, and `(i-1)-th` row/column is interchanged with `m-th` row/column. If `uplo` is [`cublasFillMode_t::CUBLAS_FILL_MODE_LOWER`] and `devIpiv(i+1) = devIpiv(i) = -m < 0`, `D(i:i+1,i:i+1)` is a 2x2 block, and `(i+1)-th` row/column is interchanged with `m-th` row/column.
5530    ///
5531    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The operation completed successfully.
5532    ///
5533    /// [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]:   The library was not initialized.
5534    ///
5535    /// [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]:   Invalid parameters were passed (`n<0` or `lda<max(1,n)`).
5536    ///
5537    /// [`cusolverStatus_t::CUSOLVER_STATUS_ARCH_MISMATCH`]:   The device only supports compute capability 5.0 and above.
5538    ///
5539    /// [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]:   An internal operation failed.
5540    pub fn cusolverDnCsytrf(
5541        handle: cusolverDnHandle_t,
5542        uplo: cublasFillMode_t,
5543        n: ::core::ffi::c_int,
5544        A: *mut cuComplex,
5545        lda: ::core::ffi::c_int,
5546        ipiv: *mut ::core::ffi::c_int,
5547        work: *mut cuComplex,
5548        lwork: ::core::ffi::c_int,
5549        info: *mut ::core::ffi::c_int,
5550    ) -> cusolverStatus_t;
5551}
5552unsafe extern "C" {
5553    /// These helper functions calculate the size of the needed buffers.
5554    ///
5555    /// The S and D data types are real valued single and double precision, respectively.
5556    ///
5557    /// The C and Z data types are complex valued single and double precision, respectively.
5558    ///
5559    /// This function computes the factorization of a symmetric indefinite matrix using the Bunch-Kaufman diagonal pivoting.
5560    ///
5561    /// `A` is a $n \times n$ symmetric matrix, only lower or upper part is meaningful. The input parameter `uplo` indicates which part of the matrix is used. If `devIpiv` is null, no pivoting is performed, which is not numerically stable.
5562    ///
5563    /// If input parameter `uplo` is [`cublasFillMode_t::CUBLAS_FILL_MODE_LOWER`], only lower triangular part of `A` is processed, and replaced by lower triangular factor `L` and block diagonal matrix `D`. Each block of `D` is either 1x1 or 2x2 block, depending on pivoting.
5564    ///
5565    /// $$
5566    /// P\\*A\\*P^{T} = L\\*D\\*L^{T}
5567    /// $$
5568    /// If input parameter `uplo` is [`cublasFillMode_t::CUBLAS_FILL_MODE_UPPER`], only upper triangular part of `A` is processed, and replaced by upper triangular factor `U` and block diagonal matrix `D`.
5569    ///
5570    /// $$
5571    /// P\\*A\\*P^{T} = U\\*D\\*U^{T}
5572    /// $$
5573    /// The user has to provide working space which is pointed by input parameter `work`. The input parameter `lwork` is size of the working space, and it is returned by `sytrf_bufferSize()`. Please note that the size in bytes of the working space is equal to `sizeof(<type>) * lwork`. When no pivoting is performed, the other triangular part of the input matrix `A` is used as workspace.
5574    ///
5575    /// If Bunch-Kaufman factorization failed, i.e. `A` is singular. The output parameter `devInfo = i` would indicate `D(i,i)=0`.
5576    ///
5577    /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
5578    ///
5579    /// The output parameter `devIpiv` contains pivoting sequence. If `devIpiv(i) = k > 0`, `D(i,i)` is 1x1 block, and `i-th` row/column of `A` is interchanged with `k-th` row/column of `A`. If `uplo` is [`cublasFillMode_t::CUBLAS_FILL_MODE_UPPER`] and `devIpiv(i-1) = devIpiv(i) = -m < 0`, `D(i-1:i,i-1:i)` is a 2x2 block, and `(i-1)-th` row/column is interchanged with `m-th` row/column. If `uplo` is [`cublasFillMode_t::CUBLAS_FILL_MODE_LOWER`] and `devIpiv(i+1) = devIpiv(i) = -m < 0`, `D(i:i+1,i:i+1)` is a 2x2 block, and `(i+1)-th` row/column is interchanged with `m-th` row/column.
5580    ///
5581    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The operation completed successfully.
5582    ///
5583    /// [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]:   The library was not initialized.
5584    ///
5585    /// [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]:   Invalid parameters were passed (`n<0` or `lda<max(1,n)`).
5586    ///
5587    /// [`cusolverStatus_t::CUSOLVER_STATUS_ARCH_MISMATCH`]:   The device only supports compute capability 5.0 and above.
5588    ///
5589    /// [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]:   An internal operation failed.
5590    pub fn cusolverDnZsytrf(
5591        handle: cusolverDnHandle_t,
5592        uplo: cublasFillMode_t,
5593        n: ::core::ffi::c_int,
5594        A: *mut cuDoubleComplex,
5595        lda: ::core::ffi::c_int,
5596        ipiv: *mut ::core::ffi::c_int,
5597        work: *mut cuDoubleComplex,
5598        lwork: ::core::ffi::c_int,
5599        info: *mut ::core::ffi::c_int,
5600    ) -> cusolverStatus_t;
5601}
5602unsafe extern "C" {
5603    pub fn cusolverDnXsytrs_bufferSize(
5604        handle: cusolverDnHandle_t,
5605        uplo: cublasFillMode_t,
5606        n: i64,
5607        nrhs: i64,
5608        dataTypeA: cudaDataType,
5609        A: *const ::core::ffi::c_void,
5610        lda: i64,
5611        ipiv: *const i64,
5612        dataTypeB: cudaDataType,
5613        B: *mut ::core::ffi::c_void,
5614        ldb: i64,
5615        workspaceInBytesOnDevice: *mut size_t,
5616        workspaceInBytesOnHost: *mut size_t,
5617    ) -> cusolverStatus_t;
5618}
5619unsafe extern "C" {
5620    /// The helper functions below can calculate the sizes needed for pre-allocated buffers.
5621    ///
5622    /// The following routine:
5623    ///
5624    /// solves a system of linear equations using the generic API interface.
5625    ///
5626    /// `A` contains the factorization from `cusolverDn<t>sytrf()`, only lower or upper part is meaningful, the other part is not touched.
5627    ///
5628    /// If input parameter `uplo` is [`cublasFillMode_t::CUBLAS_FILL_MODE_LOWER`], the details of the factorization are stores as:
5629    ///
5630    /// $$
5631    /// A = L\\*D\\*L^{T}
5632    /// $$
5633    /// If input parameter `uplo` is [`cublasFillMode_t::CUBLAS_FILL_MODE_UPPER`], the details of the factorization are stores as:
5634    ///
5635    /// $$
5636    /// A = U\\*D\\*U^{T}
5637    /// $$
5638    /// The user has to provide the pivot indices that can be obtained by `cusolverDn<t>sytrf()` as well as device and host work spaces which are pointed by input parameters `bufferOnDevice` and `bufferOnHost`. The input parameters `workspaceInBytesOnDevice` and `workspaceInBytesOnHost` are sizes in bytes of the device and host work spaces, and they are returned by [`cusolverDnXsytrs_bufferSize`].
5639    /// To factorize and solve the symmetric system without pivoting, the user should set `devIpiv = NULL` when calling `cusolverDn<t>sytrf` and [`cusolverDnXsytrs`].
5640    ///
5641    /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
5642    ///
5643    /// List of input arguments for [`cusolverDnXsytrs_bufferSize`] and [`cusolverDnXsytrs`]:
5644    ///
5645    /// The generic API has two different types: `dataTypeA` is data type of the matrix `A`, `dataTypeB` is data type of the matrix `A`. [`cusolverDnXsytrs`] only supports the following four combinations:
5646    ///
5647    /// **Valid combination of data type and compute type**
5648    ///
5649    /// | **DataTypeA** | **DataTypeB** | **Meaning** |
5650    /// | --- | --- | --- |
5651    /// | `CUDA_R_32F` | `CUDA_R_32F` | `SSYTRS` |
5652    /// | `CUDA_R_64F` | `CUDA_R_64F` | `DSYTRS` |
5653    /// | `CUDA_C_32F` | `CUDA_C_32F` | `CSYTRS` |
5654    /// | `CUDA_C_64F` | `CUDA_C_64F` | `ZSYTRS` |
5655    ///
5656    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The operation completed successfully.
5657    ///
5658    /// [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]:   The library was not initialized.
5659    ///
5660    /// [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]:   Invalid parameters were passed (`n<0` or `lda<max(1,n)`).
5661    ///
5662    /// [`cusolverStatus_t::CUSOLVER_STATUS_MATRIX_TYPE_NOT_SUPPORTED`]:   Data type is not supported.
5663    ///
5664    /// [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]:   An internal operation failed.
5665    ///
5666    /// # Parameters
5667    ///
5668    /// - `handle`: Handle to the cuSolverDN library context.
5669    /// - `uplo`: Indicates if matrix `A` lower or upper part is stored, the other part is not referenced.
5670    /// - `n`: Number of rows and columns of matrix `A`.
5671    /// - `nrhs`: Number of right-hand sides.
5672    /// - `dataTypeA`: Data type of array `A`.
5673    /// - `A`: Array of dimension `lda * n` with `lda` is not less than `max(1,n)`.
5674    /// - `lda`: Leading dimension of two-dimensional array used to store matrix `A`.
5675    /// - `dataTypeB`: Data type of array `B`.
5676    /// - `B`: Array of dimension `ldb * nrhs` with `ldb` is not less than `max(1,nrhs)`.
5677    /// - `ldb`: Leading dimension of two-dimensional array used to store matrix `B`.
5678    /// - `bufferOnDevice`: Device workspace. Array of type `void` of size `workspaceInBytesOnDevice` bytes.
5679    /// - `workspaceInBytesOnDevice`: Size in bytes of `bufferOnDevice`, returned by [`cusolverDnXsytrs_bufferSize`].
5680    /// - `bufferOnHost`: Host workspace. Array of type `void` of size `workspaceInBytesOnHost` bytes.
5681    /// - `workspaceInBytesOnHost`: Size in bytes of `bufferOnHost`, returned by [`cusolverDnXsytrs_bufferSize`].
5682    ///
5683    /// # Return value
5684    ///
5685    /// - [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]: An internal operation failed.
5686    /// - [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]: Invalid parameters were passed (`n<0` or `lda<max(1,n)`).
5687    /// - [`cusolverStatus_t::CUSOLVER_STATUS_MATRIX_TYPE_NOT_SUPPORTED`]: Data type is not supported.
5688    /// - [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]: The library was not initialized.
5689    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The operation completed successfully.
5690    pub fn cusolverDnXsytrs(
5691        handle: cusolverDnHandle_t,
5692        uplo: cublasFillMode_t,
5693        n: i64,
5694        nrhs: i64,
5695        dataTypeA: cudaDataType,
5696        A: *const ::core::ffi::c_void,
5697        lda: i64,
5698        ipiv: *const i64,
5699        dataTypeB: cudaDataType,
5700        B: *mut ::core::ffi::c_void,
5701        ldb: i64,
5702        bufferOnDevice: *mut ::core::ffi::c_void,
5703        workspaceInBytesOnDevice: size_t,
5704        bufferOnHost: *mut ::core::ffi::c_void,
5705        workspaceInBytesOnHost: size_t,
5706        info: *mut ::core::ffi::c_int,
5707    ) -> cusolverStatus_t;
5708}
5709unsafe extern "C" {
5710    pub fn cusolverDnSsytri_bufferSize(
5711        handle: cusolverDnHandle_t,
5712        uplo: cublasFillMode_t,
5713        n: ::core::ffi::c_int,
5714        A: *mut f32,
5715        lda: ::core::ffi::c_int,
5716        ipiv: *const ::core::ffi::c_int,
5717        lwork: *mut ::core::ffi::c_int,
5718    ) -> cusolverStatus_t;
5719}
5720unsafe extern "C" {
5721    pub fn cusolverDnDsytri_bufferSize(
5722        handle: cusolverDnHandle_t,
5723        uplo: cublasFillMode_t,
5724        n: ::core::ffi::c_int,
5725        A: *mut f64,
5726        lda: ::core::ffi::c_int,
5727        ipiv: *const ::core::ffi::c_int,
5728        lwork: *mut ::core::ffi::c_int,
5729    ) -> cusolverStatus_t;
5730}
5731unsafe extern "C" {
5732    pub fn cusolverDnCsytri_bufferSize(
5733        handle: cusolverDnHandle_t,
5734        uplo: cublasFillMode_t,
5735        n: ::core::ffi::c_int,
5736        A: *mut cuComplex,
5737        lda: ::core::ffi::c_int,
5738        ipiv: *const ::core::ffi::c_int,
5739        lwork: *mut ::core::ffi::c_int,
5740    ) -> cusolverStatus_t;
5741}
5742unsafe extern "C" {
5743    pub fn cusolverDnZsytri_bufferSize(
5744        handle: cusolverDnHandle_t,
5745        uplo: cublasFillMode_t,
5746        n: ::core::ffi::c_int,
5747        A: *mut cuDoubleComplex,
5748        lda: ::core::ffi::c_int,
5749        ipiv: *const ::core::ffi::c_int,
5750        lwork: *mut ::core::ffi::c_int,
5751    ) -> cusolverStatus_t;
5752}
5753unsafe extern "C" {
5754    pub fn cusolverDnSsytri(
5755        handle: cusolverDnHandle_t,
5756        uplo: cublasFillMode_t,
5757        n: ::core::ffi::c_int,
5758        A: *mut f32,
5759        lda: ::core::ffi::c_int,
5760        ipiv: *const ::core::ffi::c_int,
5761        work: *mut f32,
5762        lwork: ::core::ffi::c_int,
5763        info: *mut ::core::ffi::c_int,
5764    ) -> cusolverStatus_t;
5765}
5766unsafe extern "C" {
5767    pub fn cusolverDnDsytri(
5768        handle: cusolverDnHandle_t,
5769        uplo: cublasFillMode_t,
5770        n: ::core::ffi::c_int,
5771        A: *mut f64,
5772        lda: ::core::ffi::c_int,
5773        ipiv: *const ::core::ffi::c_int,
5774        work: *mut f64,
5775        lwork: ::core::ffi::c_int,
5776        info: *mut ::core::ffi::c_int,
5777    ) -> cusolverStatus_t;
5778}
5779unsafe extern "C" {
5780    pub fn cusolverDnCsytri(
5781        handle: cusolverDnHandle_t,
5782        uplo: cublasFillMode_t,
5783        n: ::core::ffi::c_int,
5784        A: *mut cuComplex,
5785        lda: ::core::ffi::c_int,
5786        ipiv: *const ::core::ffi::c_int,
5787        work: *mut cuComplex,
5788        lwork: ::core::ffi::c_int,
5789        info: *mut ::core::ffi::c_int,
5790    ) -> cusolverStatus_t;
5791}
5792unsafe extern "C" {
5793    pub fn cusolverDnZsytri(
5794        handle: cusolverDnHandle_t,
5795        uplo: cublasFillMode_t,
5796        n: ::core::ffi::c_int,
5797        A: *mut cuDoubleComplex,
5798        lda: ::core::ffi::c_int,
5799        ipiv: *const ::core::ffi::c_int,
5800        work: *mut cuDoubleComplex,
5801        lwork: ::core::ffi::c_int,
5802        info: *mut ::core::ffi::c_int,
5803    ) -> cusolverStatus_t;
5804}
5805unsafe extern "C" {
5806    pub fn cusolverDnSgebrd_bufferSize(
5807        handle: cusolverDnHandle_t,
5808        m: ::core::ffi::c_int,
5809        n: ::core::ffi::c_int,
5810        Lwork: *mut ::core::ffi::c_int,
5811    ) -> cusolverStatus_t;
5812}
5813unsafe extern "C" {
5814    pub fn cusolverDnDgebrd_bufferSize(
5815        handle: cusolverDnHandle_t,
5816        m: ::core::ffi::c_int,
5817        n: ::core::ffi::c_int,
5818        Lwork: *mut ::core::ffi::c_int,
5819    ) -> cusolverStatus_t;
5820}
5821unsafe extern "C" {
5822    pub fn cusolverDnCgebrd_bufferSize(
5823        handle: cusolverDnHandle_t,
5824        m: ::core::ffi::c_int,
5825        n: ::core::ffi::c_int,
5826        Lwork: *mut ::core::ffi::c_int,
5827    ) -> cusolverStatus_t;
5828}
5829unsafe extern "C" {
5830    pub fn cusolverDnZgebrd_bufferSize(
5831        handle: cusolverDnHandle_t,
5832        m: ::core::ffi::c_int,
5833        n: ::core::ffi::c_int,
5834        Lwork: *mut ::core::ffi::c_int,
5835    ) -> cusolverStatus_t;
5836}
5837unsafe extern "C" {
5838    /// These helper functions calculate the size of work buffers needed.
5839    ///
5840    /// The S and D data types are real valued single and double precision, respectively.
5841    ///
5842    /// The C and Z data types are complex valued single and double precision, respectively.
5843    ///
5844    /// This function reduces a general $m \times n$ matrix `A` to a real upper or lower bidiagonal form `B` by an orthogonal transformation: $Q^{H}\\*A\\*P = B$
5845    ///
5846    /// If `m>=n`, `B` is upper bidiagonal; if `m<n`, `B` is lower bidiagonal.
5847    ///
5848    /// The matrix `Q` and `P` are overwritten into matrix `A` in the following sense:
5849    ///
5850    /// * if `m>=n`, the diagonal and the first superdiagonal are overwritten with the upper bidiagonal matrix `B`; the elements below the diagonal, with the array `TAUQ`, represent the orthogonal matrix `Q` as a product of elementary reflectors, and the elements above the first superdiagonal, with the array `TAUP`, represent the orthogonal matrix `P` as a product of elementary reflectors.
5851    /// * if `m<n`, the diagonal and the first subdiagonal are overwritten with the lower bidiagonal matrix `B`; the elements below the first subdiagonal, with the array `TAUQ`, represent the orthogonal matrix `Q` as a product of elementary reflectors, and the elements above the diagonal, with the array `TAUP`, represent the orthogonal matrix `P` as a product of elementary reflectors.
5852    ///
5853    /// The user has to provide working space which is pointed by input parameter `Work`. The input parameter `Lwork` is size of the working space, and it is returned by `gebrd_bufferSize()`.
5854    ///
5855    /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
5856    ///
5857    /// Remark: `gebrd` only supports `m>=n`.
5858    ///
5859    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The operation completed successfully.
5860    ///
5861    /// [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]:   The library was not initialized.
5862    ///
5863    /// [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]:   Invalid parameters were passed (`m,n<0`, or `lda<max(1,m)`).
5864    ///
5865    /// [`cusolverStatus_t::CUSOLVER_STATUS_ARCH_MISMATCH`]:   The device only supports compute capability 5.0 and above.
5866    ///
5867    /// [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]:   An internal operation failed.
5868    pub fn cusolverDnSgebrd(
5869        handle: cusolverDnHandle_t,
5870        m: ::core::ffi::c_int,
5871        n: ::core::ffi::c_int,
5872        A: *mut f32,
5873        lda: ::core::ffi::c_int,
5874        D: *mut f32,
5875        E: *mut f32,
5876        TAUQ: *mut f32,
5877        TAUP: *mut f32,
5878        Work: *mut f32,
5879        Lwork: ::core::ffi::c_int,
5880        devInfo: *mut ::core::ffi::c_int,
5881    ) -> cusolverStatus_t;
5882}
5883unsafe extern "C" {
5884    /// These helper functions calculate the size of work buffers needed.
5885    ///
5886    /// The S and D data types are real valued single and double precision, respectively.
5887    ///
5888    /// The C and Z data types are complex valued single and double precision, respectively.
5889    ///
5890    /// This function reduces a general $m \times n$ matrix `A` to a real upper or lower bidiagonal form `B` by an orthogonal transformation: $Q^{H}\\*A\\*P = B$
5891    ///
5892    /// If `m>=n`, `B` is upper bidiagonal; if `m<n`, `B` is lower bidiagonal.
5893    ///
5894    /// The matrix `Q` and `P` are overwritten into matrix `A` in the following sense:
5895    ///
5896    /// * if `m>=n`, the diagonal and the first superdiagonal are overwritten with the upper bidiagonal matrix `B`; the elements below the diagonal, with the array `TAUQ`, represent the orthogonal matrix `Q` as a product of elementary reflectors, and the elements above the first superdiagonal, with the array `TAUP`, represent the orthogonal matrix `P` as a product of elementary reflectors.
5897    /// * if `m<n`, the diagonal and the first subdiagonal are overwritten with the lower bidiagonal matrix `B`; the elements below the first subdiagonal, with the array `TAUQ`, represent the orthogonal matrix `Q` as a product of elementary reflectors, and the elements above the diagonal, with the array `TAUP`, represent the orthogonal matrix `P` as a product of elementary reflectors.
5898    ///
5899    /// The user has to provide working space which is pointed by input parameter `Work`. The input parameter `Lwork` is size of the working space, and it is returned by `gebrd_bufferSize()`.
5900    ///
5901    /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
5902    ///
5903    /// Remark: `gebrd` only supports `m>=n`.
5904    ///
5905    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The operation completed successfully.
5906    ///
5907    /// [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]:   The library was not initialized.
5908    ///
5909    /// [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]:   Invalid parameters were passed (`m,n<0`, or `lda<max(1,m)`).
5910    ///
5911    /// [`cusolverStatus_t::CUSOLVER_STATUS_ARCH_MISMATCH`]:   The device only supports compute capability 5.0 and above.
5912    ///
5913    /// [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]:   An internal operation failed.
5914    pub fn cusolverDnDgebrd(
5915        handle: cusolverDnHandle_t,
5916        m: ::core::ffi::c_int,
5917        n: ::core::ffi::c_int,
5918        A: *mut f64,
5919        lda: ::core::ffi::c_int,
5920        D: *mut f64,
5921        E: *mut f64,
5922        TAUQ: *mut f64,
5923        TAUP: *mut f64,
5924        Work: *mut f64,
5925        Lwork: ::core::ffi::c_int,
5926        devInfo: *mut ::core::ffi::c_int,
5927    ) -> cusolverStatus_t;
5928}
5929unsafe extern "C" {
5930    /// These helper functions calculate the size of work buffers needed.
5931    ///
5932    /// The S and D data types are real valued single and double precision, respectively.
5933    ///
5934    /// The C and Z data types are complex valued single and double precision, respectively.
5935    ///
5936    /// This function reduces a general $m \times n$ matrix `A` to a real upper or lower bidiagonal form `B` by an orthogonal transformation: $Q^{H}\\*A\\*P = B$
5937    ///
5938    /// If `m>=n`, `B` is upper bidiagonal; if `m<n`, `B` is lower bidiagonal.
5939    ///
5940    /// The matrix `Q` and `P` are overwritten into matrix `A` in the following sense:
5941    ///
5942    /// * if `m>=n`, the diagonal and the first superdiagonal are overwritten with the upper bidiagonal matrix `B`; the elements below the diagonal, with the array `TAUQ`, represent the orthogonal matrix `Q` as a product of elementary reflectors, and the elements above the first superdiagonal, with the array `TAUP`, represent the orthogonal matrix `P` as a product of elementary reflectors.
5943    /// * if `m<n`, the diagonal and the first subdiagonal are overwritten with the lower bidiagonal matrix `B`; the elements below the first subdiagonal, with the array `TAUQ`, represent the orthogonal matrix `Q` as a product of elementary reflectors, and the elements above the diagonal, with the array `TAUP`, represent the orthogonal matrix `P` as a product of elementary reflectors.
5944    ///
5945    /// The user has to provide working space which is pointed by input parameter `Work`. The input parameter `Lwork` is size of the working space, and it is returned by `gebrd_bufferSize()`.
5946    ///
5947    /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
5948    ///
5949    /// Remark: `gebrd` only supports `m>=n`.
5950    ///
5951    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The operation completed successfully.
5952    ///
5953    /// [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]:   The library was not initialized.
5954    ///
5955    /// [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]:   Invalid parameters were passed (`m,n<0`, or `lda<max(1,m)`).
5956    ///
5957    /// [`cusolverStatus_t::CUSOLVER_STATUS_ARCH_MISMATCH`]:   The device only supports compute capability 5.0 and above.
5958    ///
5959    /// [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]:   An internal operation failed.
5960    pub fn cusolverDnCgebrd(
5961        handle: cusolverDnHandle_t,
5962        m: ::core::ffi::c_int,
5963        n: ::core::ffi::c_int,
5964        A: *mut cuComplex,
5965        lda: ::core::ffi::c_int,
5966        D: *mut f32,
5967        E: *mut f32,
5968        TAUQ: *mut cuComplex,
5969        TAUP: *mut cuComplex,
5970        Work: *mut cuComplex,
5971        Lwork: ::core::ffi::c_int,
5972        devInfo: *mut ::core::ffi::c_int,
5973    ) -> cusolverStatus_t;
5974}
5975unsafe extern "C" {
5976    /// These helper functions calculate the size of work buffers needed.
5977    ///
5978    /// The S and D data types are real valued single and double precision, respectively.
5979    ///
5980    /// The C and Z data types are complex valued single and double precision, respectively.
5981    ///
5982    /// This function reduces a general $m \times n$ matrix `A` to a real upper or lower bidiagonal form `B` by an orthogonal transformation: $Q^{H}\\*A\\*P = B$
5983    ///
5984    /// If `m>=n`, `B` is upper bidiagonal; if `m<n`, `B` is lower bidiagonal.
5985    ///
5986    /// The matrix `Q` and `P` are overwritten into matrix `A` in the following sense:
5987    ///
5988    /// * if `m>=n`, the diagonal and the first superdiagonal are overwritten with the upper bidiagonal matrix `B`; the elements below the diagonal, with the array `TAUQ`, represent the orthogonal matrix `Q` as a product of elementary reflectors, and the elements above the first superdiagonal, with the array `TAUP`, represent the orthogonal matrix `P` as a product of elementary reflectors.
5989    /// * if `m<n`, the diagonal and the first subdiagonal are overwritten with the lower bidiagonal matrix `B`; the elements below the first subdiagonal, with the array `TAUQ`, represent the orthogonal matrix `Q` as a product of elementary reflectors, and the elements above the diagonal, with the array `TAUP`, represent the orthogonal matrix `P` as a product of elementary reflectors.
5990    ///
5991    /// The user has to provide working space which is pointed by input parameter `Work`. The input parameter `Lwork` is size of the working space, and it is returned by `gebrd_bufferSize()`.
5992    ///
5993    /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
5994    ///
5995    /// Remark: `gebrd` only supports `m>=n`.
5996    ///
5997    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The operation completed successfully.
5998    ///
5999    /// [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]:   The library was not initialized.
6000    ///
6001    /// [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]:   Invalid parameters were passed (`m,n<0`, or `lda<max(1,m)`).
6002    ///
6003    /// [`cusolverStatus_t::CUSOLVER_STATUS_ARCH_MISMATCH`]:   The device only supports compute capability 5.0 and above.
6004    ///
6005    /// [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]:   An internal operation failed.
6006    pub fn cusolverDnZgebrd(
6007        handle: cusolverDnHandle_t,
6008        m: ::core::ffi::c_int,
6009        n: ::core::ffi::c_int,
6010        A: *mut cuDoubleComplex,
6011        lda: ::core::ffi::c_int,
6012        D: *mut f64,
6013        E: *mut f64,
6014        TAUQ: *mut cuDoubleComplex,
6015        TAUP: *mut cuDoubleComplex,
6016        Work: *mut cuDoubleComplex,
6017        Lwork: ::core::ffi::c_int,
6018        devInfo: *mut ::core::ffi::c_int,
6019    ) -> cusolverStatus_t;
6020}
6021unsafe extern "C" {
6022    pub fn cusolverDnSorgbr_bufferSize(
6023        handle: cusolverDnHandle_t,
6024        side: cublasSideMode_t,
6025        m: ::core::ffi::c_int,
6026        n: ::core::ffi::c_int,
6027        k: ::core::ffi::c_int,
6028        A: *const f32,
6029        lda: ::core::ffi::c_int,
6030        tau: *const f32,
6031        lwork: *mut ::core::ffi::c_int,
6032    ) -> cusolverStatus_t;
6033}
6034unsafe extern "C" {
6035    pub fn cusolverDnDorgbr_bufferSize(
6036        handle: cusolverDnHandle_t,
6037        side: cublasSideMode_t,
6038        m: ::core::ffi::c_int,
6039        n: ::core::ffi::c_int,
6040        k: ::core::ffi::c_int,
6041        A: *const f64,
6042        lda: ::core::ffi::c_int,
6043        tau: *const f64,
6044        lwork: *mut ::core::ffi::c_int,
6045    ) -> cusolverStatus_t;
6046}
6047unsafe extern "C" {
6048    pub fn cusolverDnCungbr_bufferSize(
6049        handle: cusolverDnHandle_t,
6050        side: cublasSideMode_t,
6051        m: ::core::ffi::c_int,
6052        n: ::core::ffi::c_int,
6053        k: ::core::ffi::c_int,
6054        A: *const cuComplex,
6055        lda: ::core::ffi::c_int,
6056        tau: *const cuComplex,
6057        lwork: *mut ::core::ffi::c_int,
6058    ) -> cusolverStatus_t;
6059}
6060unsafe extern "C" {
6061    pub fn cusolverDnZungbr_bufferSize(
6062        handle: cusolverDnHandle_t,
6063        side: cublasSideMode_t,
6064        m: ::core::ffi::c_int,
6065        n: ::core::ffi::c_int,
6066        k: ::core::ffi::c_int,
6067        A: *const cuDoubleComplex,
6068        lda: ::core::ffi::c_int,
6069        tau: *const cuDoubleComplex,
6070        lwork: *mut ::core::ffi::c_int,
6071    ) -> cusolverStatus_t;
6072}
6073unsafe extern "C" {
6074    /// These helper functions calculate the size of work buffers needed.
6075    ///
6076    /// The S and D data types are real valued single and double precision, respectively.
6077    ///
6078    /// The C and Z data types are complex valued single and double precision, respectively.
6079    ///
6080    /// This function generates one of the unitary matrices `Q` or `P**H` determined by `gebrd` when reducing a matrix A to bidiagonal form: $Q^{H}\\*A\\*P = B$
6081    ///
6082    /// `Q` and `P**H` are defined as products of elementary reflectors H(i) or G(i) respectively.
6083    ///
6084    /// The user has to provide working space which is pointed by input parameter `work`. The input parameter `lwork` is size of the working space, and it is returned by `orgbr_bufferSize()`. Please note that the size in bytes of the working space is equal to `sizeof(<type>) * lwork`.
6085    ///
6086    /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
6087    ///
6088    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The operation completed successfully.
6089    ///
6090    /// [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]:   The library was not initialized.
6091    ///
6092    /// [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]:   Invalid parameters were passed (`m,n<0` or wrong `lda` ).
6093    ///
6094    /// [`cusolverStatus_t::CUSOLVER_STATUS_ARCH_MISMATCH`]:   The device only supports compute capability 5.0 and above.
6095    ///
6096    /// [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]:   An internal operation failed.
6097    pub fn cusolverDnSorgbr(
6098        handle: cusolverDnHandle_t,
6099        side: cublasSideMode_t,
6100        m: ::core::ffi::c_int,
6101        n: ::core::ffi::c_int,
6102        k: ::core::ffi::c_int,
6103        A: *mut f32,
6104        lda: ::core::ffi::c_int,
6105        tau: *const f32,
6106        work: *mut f32,
6107        lwork: ::core::ffi::c_int,
6108        info: *mut ::core::ffi::c_int,
6109    ) -> cusolverStatus_t;
6110}
6111unsafe extern "C" {
6112    /// These helper functions calculate the size of work buffers needed.
6113    ///
6114    /// The S and D data types are real valued single and double precision, respectively.
6115    ///
6116    /// The C and Z data types are complex valued single and double precision, respectively.
6117    ///
6118    /// This function generates one of the unitary matrices `Q` or `P**H` determined by `gebrd` when reducing a matrix A to bidiagonal form: $Q^{H}\\*A\\*P = B$
6119    ///
6120    /// `Q` and `P**H` are defined as products of elementary reflectors H(i) or G(i) respectively.
6121    ///
6122    /// The user has to provide working space which is pointed by input parameter `work`. The input parameter `lwork` is size of the working space, and it is returned by `orgbr_bufferSize()`. Please note that the size in bytes of the working space is equal to `sizeof(<type>) * lwork`.
6123    ///
6124    /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
6125    ///
6126    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The operation completed successfully.
6127    ///
6128    /// [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]:   The library was not initialized.
6129    ///
6130    /// [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]:   Invalid parameters were passed (`m,n<0` or wrong `lda` ).
6131    ///
6132    /// [`cusolverStatus_t::CUSOLVER_STATUS_ARCH_MISMATCH`]:   The device only supports compute capability 5.0 and above.
6133    ///
6134    /// [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]:   An internal operation failed.
6135    pub fn cusolverDnDorgbr(
6136        handle: cusolverDnHandle_t,
6137        side: cublasSideMode_t,
6138        m: ::core::ffi::c_int,
6139        n: ::core::ffi::c_int,
6140        k: ::core::ffi::c_int,
6141        A: *mut f64,
6142        lda: ::core::ffi::c_int,
6143        tau: *const f64,
6144        work: *mut f64,
6145        lwork: ::core::ffi::c_int,
6146        info: *mut ::core::ffi::c_int,
6147    ) -> cusolverStatus_t;
6148}
6149unsafe extern "C" {
6150    pub fn cusolverDnCungbr(
6151        handle: cusolverDnHandle_t,
6152        side: cublasSideMode_t,
6153        m: ::core::ffi::c_int,
6154        n: ::core::ffi::c_int,
6155        k: ::core::ffi::c_int,
6156        A: *mut cuComplex,
6157        lda: ::core::ffi::c_int,
6158        tau: *const cuComplex,
6159        work: *mut cuComplex,
6160        lwork: ::core::ffi::c_int,
6161        info: *mut ::core::ffi::c_int,
6162    ) -> cusolverStatus_t;
6163}
6164unsafe extern "C" {
6165    pub fn cusolverDnZungbr(
6166        handle: cusolverDnHandle_t,
6167        side: cublasSideMode_t,
6168        m: ::core::ffi::c_int,
6169        n: ::core::ffi::c_int,
6170        k: ::core::ffi::c_int,
6171        A: *mut cuDoubleComplex,
6172        lda: ::core::ffi::c_int,
6173        tau: *const cuDoubleComplex,
6174        work: *mut cuDoubleComplex,
6175        lwork: ::core::ffi::c_int,
6176        info: *mut ::core::ffi::c_int,
6177    ) -> cusolverStatus_t;
6178}
6179unsafe extern "C" {
6180    pub fn cusolverDnSsytrd_bufferSize(
6181        handle: cusolverDnHandle_t,
6182        uplo: cublasFillMode_t,
6183        n: ::core::ffi::c_int,
6184        A: *const f32,
6185        lda: ::core::ffi::c_int,
6186        d: *const f32,
6187        e: *const f32,
6188        tau: *const f32,
6189        lwork: *mut ::core::ffi::c_int,
6190    ) -> cusolverStatus_t;
6191}
6192unsafe extern "C" {
6193    pub fn cusolverDnDsytrd_bufferSize(
6194        handle: cusolverDnHandle_t,
6195        uplo: cublasFillMode_t,
6196        n: ::core::ffi::c_int,
6197        A: *const f64,
6198        lda: ::core::ffi::c_int,
6199        d: *const f64,
6200        e: *const f64,
6201        tau: *const f64,
6202        lwork: *mut ::core::ffi::c_int,
6203    ) -> cusolverStatus_t;
6204}
6205unsafe extern "C" {
6206    pub fn cusolverDnChetrd_bufferSize(
6207        handle: cusolverDnHandle_t,
6208        uplo: cublasFillMode_t,
6209        n: ::core::ffi::c_int,
6210        A: *const cuComplex,
6211        lda: ::core::ffi::c_int,
6212        d: *const f32,
6213        e: *const f32,
6214        tau: *const cuComplex,
6215        lwork: *mut ::core::ffi::c_int,
6216    ) -> cusolverStatus_t;
6217}
6218unsafe extern "C" {
6219    pub fn cusolverDnZhetrd_bufferSize(
6220        handle: cusolverDnHandle_t,
6221        uplo: cublasFillMode_t,
6222        n: ::core::ffi::c_int,
6223        A: *const cuDoubleComplex,
6224        lda: ::core::ffi::c_int,
6225        d: *const f64,
6226        e: *const f64,
6227        tau: *const cuDoubleComplex,
6228        lwork: *mut ::core::ffi::c_int,
6229    ) -> cusolverStatus_t;
6230}
6231unsafe extern "C" {
6232    /// These helper functions calculate the size of work buffers needed.
6233    ///
6234    /// The S and D data types are real valued single and double precision, respectively.
6235    ///
6236    /// The C and Z data types are complex valued single and double precision, respectively.
6237    ///
6238    /// This function reduces a general symmetric (Hermitian) $n \times n$ matrix `A` to real symmetric tridiagonal form `T` by an orthogonal transformation: $Q^{H}\\*A\\*Q = T$
6239    ///
6240    /// As an output, `A` contains `T` and householder reflection vectors. If `uplo` = [`cublasFillMode_t::CUBLAS_FILL_MODE_UPPER`], the diagonal and first superdiagonal of `A` are overwritten by the corresponding elements of the tridiagonal matrix `T`, and the elements above the first superdiagonal, with the array `tau`, represent the orthogonal matrix `Q` as a product of elementary reflectors; If `uplo` = [`cublasFillMode_t::CUBLAS_FILL_MODE_LOWER`], the diagonal and first subdiagonal of `A` are overwritten by the corresponding elements of the tridiagonal matrix `T`, and the elements below the first subdiagonal, with the array `tau`, represent the orthogonal matrix `Q` as a product of elementary reflectors.
6241    ///
6242    /// The user has to provide working space which is pointed by input parameter `work`. The input parameter `lwork` is size of the working space, and it is returned by `sytrd_bufferSize()`. Please note that the size in bytes of the working space is equal to `sizeof(<type>) * lwork`.
6243    ///
6244    /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle). Note that the problem size `n` is limited by a condition `n*lda < INT32_MAX` primarily due to the current implementation constraints.
6245    ///
6246    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The operation completed successfully.
6247    ///
6248    /// [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]:   The library was not initialized.
6249    ///
6250    /// [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]:   Invalid parameters were passed (`n<0`, or `lda<max(1,n)`, or `uplo` is not [`cublasFillMode_t::CUBLAS_FILL_MODE_LOWER`] or [`cublasFillMode_t::CUBLAS_FILL_MODE_UPPER`]).
6251    ///
6252    /// [`cusolverStatus_t::CUSOLVER_STATUS_ARCH_MISMATCH`]:   The device only supports compute capability 5.0 and above.
6253    ///
6254    /// [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]:   An internal operation failed.
6255    pub fn cusolverDnSsytrd(
6256        handle: cusolverDnHandle_t,
6257        uplo: cublasFillMode_t,
6258        n: ::core::ffi::c_int,
6259        A: *mut f32,
6260        lda: ::core::ffi::c_int,
6261        d: *mut f32,
6262        e: *mut f32,
6263        tau: *mut f32,
6264        work: *mut f32,
6265        lwork: ::core::ffi::c_int,
6266        info: *mut ::core::ffi::c_int,
6267    ) -> cusolverStatus_t;
6268}
6269unsafe extern "C" {
6270    /// These helper functions calculate the size of work buffers needed.
6271    ///
6272    /// The S and D data types are real valued single and double precision, respectively.
6273    ///
6274    /// The C and Z data types are complex valued single and double precision, respectively.
6275    ///
6276    /// This function reduces a general symmetric (Hermitian) $n \times n$ matrix `A` to real symmetric tridiagonal form `T` by an orthogonal transformation: $Q^{H}\\*A\\*Q = T$
6277    ///
6278    /// As an output, `A` contains `T` and householder reflection vectors. If `uplo` = [`cublasFillMode_t::CUBLAS_FILL_MODE_UPPER`], the diagonal and first superdiagonal of `A` are overwritten by the corresponding elements of the tridiagonal matrix `T`, and the elements above the first superdiagonal, with the array `tau`, represent the orthogonal matrix `Q` as a product of elementary reflectors; If `uplo` = [`cublasFillMode_t::CUBLAS_FILL_MODE_LOWER`], the diagonal and first subdiagonal of `A` are overwritten by the corresponding elements of the tridiagonal matrix `T`, and the elements below the first subdiagonal, with the array `tau`, represent the orthogonal matrix `Q` as a product of elementary reflectors.
6279    ///
6280    /// The user has to provide working space which is pointed by input parameter `work`. The input parameter `lwork` is size of the working space, and it is returned by `sytrd_bufferSize()`. Please note that the size in bytes of the working space is equal to `sizeof(<type>) * lwork`.
6281    ///
6282    /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle). Note that the problem size `n` is limited by a condition `n*lda < INT32_MAX` primarily due to the current implementation constraints.
6283    ///
6284    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The operation completed successfully.
6285    ///
6286    /// [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]:   The library was not initialized.
6287    ///
6288    /// [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]:   Invalid parameters were passed (`n<0`, or `lda<max(1,n)`, or `uplo` is not [`cublasFillMode_t::CUBLAS_FILL_MODE_LOWER`] or [`cublasFillMode_t::CUBLAS_FILL_MODE_UPPER`]).
6289    ///
6290    /// [`cusolverStatus_t::CUSOLVER_STATUS_ARCH_MISMATCH`]:   The device only supports compute capability 5.0 and above.
6291    ///
6292    /// [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]:   An internal operation failed.
6293    pub fn cusolverDnDsytrd(
6294        handle: cusolverDnHandle_t,
6295        uplo: cublasFillMode_t,
6296        n: ::core::ffi::c_int,
6297        A: *mut f64,
6298        lda: ::core::ffi::c_int,
6299        d: *mut f64,
6300        e: *mut f64,
6301        tau: *mut f64,
6302        work: *mut f64,
6303        lwork: ::core::ffi::c_int,
6304        info: *mut ::core::ffi::c_int,
6305    ) -> cusolverStatus_t;
6306}
6307unsafe extern "C" {
6308    pub fn cusolverDnChetrd(
6309        handle: cusolverDnHandle_t,
6310        uplo: cublasFillMode_t,
6311        n: ::core::ffi::c_int,
6312        A: *mut cuComplex,
6313        lda: ::core::ffi::c_int,
6314        d: *mut f32,
6315        e: *mut f32,
6316        tau: *mut cuComplex,
6317        work: *mut cuComplex,
6318        lwork: ::core::ffi::c_int,
6319        info: *mut ::core::ffi::c_int,
6320    ) -> cusolverStatus_t;
6321}
6322unsafe extern "C" {
6323    pub fn cusolverDnZhetrd(
6324        handle: cusolverDnHandle_t,
6325        uplo: cublasFillMode_t,
6326        n: ::core::ffi::c_int,
6327        A: *mut cuDoubleComplex,
6328        lda: ::core::ffi::c_int,
6329        d: *mut f64,
6330        e: *mut f64,
6331        tau: *mut cuDoubleComplex,
6332        work: *mut cuDoubleComplex,
6333        lwork: ::core::ffi::c_int,
6334        info: *mut ::core::ffi::c_int,
6335    ) -> cusolverStatus_t;
6336}
6337unsafe extern "C" {
6338    pub fn cusolverDnSorgtr_bufferSize(
6339        handle: cusolverDnHandle_t,
6340        uplo: cublasFillMode_t,
6341        n: ::core::ffi::c_int,
6342        A: *const f32,
6343        lda: ::core::ffi::c_int,
6344        tau: *const f32,
6345        lwork: *mut ::core::ffi::c_int,
6346    ) -> cusolverStatus_t;
6347}
6348unsafe extern "C" {
6349    pub fn cusolverDnDorgtr_bufferSize(
6350        handle: cusolverDnHandle_t,
6351        uplo: cublasFillMode_t,
6352        n: ::core::ffi::c_int,
6353        A: *const f64,
6354        lda: ::core::ffi::c_int,
6355        tau: *const f64,
6356        lwork: *mut ::core::ffi::c_int,
6357    ) -> cusolverStatus_t;
6358}
6359unsafe extern "C" {
6360    pub fn cusolverDnCungtr_bufferSize(
6361        handle: cusolverDnHandle_t,
6362        uplo: cublasFillMode_t,
6363        n: ::core::ffi::c_int,
6364        A: *const cuComplex,
6365        lda: ::core::ffi::c_int,
6366        tau: *const cuComplex,
6367        lwork: *mut ::core::ffi::c_int,
6368    ) -> cusolverStatus_t;
6369}
6370unsafe extern "C" {
6371    pub fn cusolverDnZungtr_bufferSize(
6372        handle: cusolverDnHandle_t,
6373        uplo: cublasFillMode_t,
6374        n: ::core::ffi::c_int,
6375        A: *const cuDoubleComplex,
6376        lda: ::core::ffi::c_int,
6377        tau: *const cuDoubleComplex,
6378        lwork: *mut ::core::ffi::c_int,
6379    ) -> cusolverStatus_t;
6380}
6381unsafe extern "C" {
6382    /// These helper functions calculate the size of work buffers needed.
6383    ///
6384    /// The S and D data types are real valued single and double precision, respectively.
6385    ///
6386    /// The C and Z data types are complex valued single and double precision, respectively.
6387    ///
6388    /// This function generates a unitary matrix `Q` which is defined as the product of n-1 elementary reflectors of order n, as returned by `sytrd`:
6389    ///
6390    /// The user has to provide working space which is pointed by input parameter `work`. The input parameter `lwork` is size of the working space, and it is returned by `orgtr_bufferSize()`. Please note that the size in bytes of the working space is equal to `sizeof(<type>) * lwork`.
6391    ///
6392    /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
6393    ///
6394    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The operation completed successfully.
6395    ///
6396    /// [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]:   The library was not initialized.
6397    ///
6398    /// [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]:   Invalid parameters were passed (`n<0` or wrong `lda`).
6399    ///
6400    /// [`cusolverStatus_t::CUSOLVER_STATUS_ARCH_MISMATCH`]:   The device only supports compute capability 5.0 and above.
6401    ///
6402    /// [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]:   An internal operation failed.
6403    pub fn cusolverDnSorgtr(
6404        handle: cusolverDnHandle_t,
6405        uplo: cublasFillMode_t,
6406        n: ::core::ffi::c_int,
6407        A: *mut f32,
6408        lda: ::core::ffi::c_int,
6409        tau: *const f32,
6410        work: *mut f32,
6411        lwork: ::core::ffi::c_int,
6412        info: *mut ::core::ffi::c_int,
6413    ) -> cusolverStatus_t;
6414}
6415unsafe extern "C" {
6416    /// These helper functions calculate the size of work buffers needed.
6417    ///
6418    /// The S and D data types are real valued single and double precision, respectively.
6419    ///
6420    /// The C and Z data types are complex valued single and double precision, respectively.
6421    ///
6422    /// This function generates a unitary matrix `Q` which is defined as the product of n-1 elementary reflectors of order n, as returned by `sytrd`:
6423    ///
6424    /// The user has to provide working space which is pointed by input parameter `work`. The input parameter `lwork` is size of the working space, and it is returned by `orgtr_bufferSize()`. Please note that the size in bytes of the working space is equal to `sizeof(<type>) * lwork`.
6425    ///
6426    /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
6427    ///
6428    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The operation completed successfully.
6429    ///
6430    /// [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]:   The library was not initialized.
6431    ///
6432    /// [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]:   Invalid parameters were passed (`n<0` or wrong `lda`).
6433    ///
6434    /// [`cusolverStatus_t::CUSOLVER_STATUS_ARCH_MISMATCH`]:   The device only supports compute capability 5.0 and above.
6435    ///
6436    /// [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]:   An internal operation failed.
6437    pub fn cusolverDnDorgtr(
6438        handle: cusolverDnHandle_t,
6439        uplo: cublasFillMode_t,
6440        n: ::core::ffi::c_int,
6441        A: *mut f64,
6442        lda: ::core::ffi::c_int,
6443        tau: *const f64,
6444        work: *mut f64,
6445        lwork: ::core::ffi::c_int,
6446        info: *mut ::core::ffi::c_int,
6447    ) -> cusolverStatus_t;
6448}
6449unsafe extern "C" {
6450    pub fn cusolverDnCungtr(
6451        handle: cusolverDnHandle_t,
6452        uplo: cublasFillMode_t,
6453        n: ::core::ffi::c_int,
6454        A: *mut cuComplex,
6455        lda: ::core::ffi::c_int,
6456        tau: *const cuComplex,
6457        work: *mut cuComplex,
6458        lwork: ::core::ffi::c_int,
6459        info: *mut ::core::ffi::c_int,
6460    ) -> cusolverStatus_t;
6461}
6462unsafe extern "C" {
6463    pub fn cusolverDnZungtr(
6464        handle: cusolverDnHandle_t,
6465        uplo: cublasFillMode_t,
6466        n: ::core::ffi::c_int,
6467        A: *mut cuDoubleComplex,
6468        lda: ::core::ffi::c_int,
6469        tau: *const cuDoubleComplex,
6470        work: *mut cuDoubleComplex,
6471        lwork: ::core::ffi::c_int,
6472        info: *mut ::core::ffi::c_int,
6473    ) -> cusolverStatus_t;
6474}
6475unsafe extern "C" {
6476    pub fn cusolverDnSormtr_bufferSize(
6477        handle: cusolverDnHandle_t,
6478        side: cublasSideMode_t,
6479        uplo: cublasFillMode_t,
6480        trans: cublasOperation_t,
6481        m: ::core::ffi::c_int,
6482        n: ::core::ffi::c_int,
6483        A: *const f32,
6484        lda: ::core::ffi::c_int,
6485        tau: *const f32,
6486        C: *const f32,
6487        ldc: ::core::ffi::c_int,
6488        lwork: *mut ::core::ffi::c_int,
6489    ) -> cusolverStatus_t;
6490}
6491unsafe extern "C" {
6492    pub fn cusolverDnDormtr_bufferSize(
6493        handle: cusolverDnHandle_t,
6494        side: cublasSideMode_t,
6495        uplo: cublasFillMode_t,
6496        trans: cublasOperation_t,
6497        m: ::core::ffi::c_int,
6498        n: ::core::ffi::c_int,
6499        A: *const f64,
6500        lda: ::core::ffi::c_int,
6501        tau: *const f64,
6502        C: *const f64,
6503        ldc: ::core::ffi::c_int,
6504        lwork: *mut ::core::ffi::c_int,
6505    ) -> cusolverStatus_t;
6506}
6507unsafe extern "C" {
6508    pub fn cusolverDnCunmtr_bufferSize(
6509        handle: cusolverDnHandle_t,
6510        side: cublasSideMode_t,
6511        uplo: cublasFillMode_t,
6512        trans: cublasOperation_t,
6513        m: ::core::ffi::c_int,
6514        n: ::core::ffi::c_int,
6515        A: *const cuComplex,
6516        lda: ::core::ffi::c_int,
6517        tau: *const cuComplex,
6518        C: *const cuComplex,
6519        ldc: ::core::ffi::c_int,
6520        lwork: *mut ::core::ffi::c_int,
6521    ) -> cusolverStatus_t;
6522}
6523unsafe extern "C" {
6524    pub fn cusolverDnZunmtr_bufferSize(
6525        handle: cusolverDnHandle_t,
6526        side: cublasSideMode_t,
6527        uplo: cublasFillMode_t,
6528        trans: cublasOperation_t,
6529        m: ::core::ffi::c_int,
6530        n: ::core::ffi::c_int,
6531        A: *const cuDoubleComplex,
6532        lda: ::core::ffi::c_int,
6533        tau: *const cuDoubleComplex,
6534        C: *const cuDoubleComplex,
6535        ldc: ::core::ffi::c_int,
6536        lwork: *mut ::core::ffi::c_int,
6537    ) -> cusolverStatus_t;
6538}
6539unsafe extern "C" {
6540    /// These helper functions calculate the size of work buffers needed.
6541    ///
6542    /// The S and D data types are real valued single and double precision, respectively.
6543    ///
6544    /// The C and Z data types are complex valued single and double precision, respectively.
6545    ///
6546    /// This function overwrites $m \times n$ matrix `C` by
6547    ///
6548    /// ![image2](_images/c-side.png)
6549    ///
6550    /// where `Q` is a unitary matrix formed by a sequence of elementary reflection vectors from `sytrd`.
6551    ///
6552    /// The operation on `Q` is defined by
6553    ///
6554    /// ![image3](_images/op-q-transa.png)
6555    ///
6556    /// The user has to provide working space which is pointed by input parameter `work`. The input parameter `lwork` is size of the working space, and it is returned by `ormtr_bufferSize()`. Please note that the size in bytes of the working space is equal to `sizeof(<type>) * lwork`.
6557    ///
6558    /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
6559    ///
6560    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The operation completed successfully.
6561    ///
6562    /// [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]:   The library was not initialized.
6563    ///
6564    /// [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]:   Invalid parameters were passed (`m,n<0` or wrong `lda` or `ldc`).
6565    ///
6566    /// [`cusolverStatus_t::CUSOLVER_STATUS_ARCH_MISMATCH`]:   The device only supports compute capability 5.0 and above.
6567    ///
6568    /// [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]:   An internal operation failed.
6569    pub fn cusolverDnSormtr(
6570        handle: cusolverDnHandle_t,
6571        side: cublasSideMode_t,
6572        uplo: cublasFillMode_t,
6573        trans: cublasOperation_t,
6574        m: ::core::ffi::c_int,
6575        n: ::core::ffi::c_int,
6576        A: *mut f32,
6577        lda: ::core::ffi::c_int,
6578        tau: *mut f32,
6579        C: *mut f32,
6580        ldc: ::core::ffi::c_int,
6581        work: *mut f32,
6582        lwork: ::core::ffi::c_int,
6583        info: *mut ::core::ffi::c_int,
6584    ) -> cusolverStatus_t;
6585}
6586unsafe extern "C" {
6587    /// These helper functions calculate the size of work buffers needed.
6588    ///
6589    /// The S and D data types are real valued single and double precision, respectively.
6590    ///
6591    /// The C and Z data types are complex valued single and double precision, respectively.
6592    ///
6593    /// This function overwrites $m \times n$ matrix `C` by
6594    ///
6595    /// ![image2](_images/c-side.png)
6596    ///
6597    /// where `Q` is a unitary matrix formed by a sequence of elementary reflection vectors from `sytrd`.
6598    ///
6599    /// The operation on `Q` is defined by
6600    ///
6601    /// ![image3](_images/op-q-transa.png)
6602    ///
6603    /// The user has to provide working space which is pointed by input parameter `work`. The input parameter `lwork` is size of the working space, and it is returned by `ormtr_bufferSize()`. Please note that the size in bytes of the working space is equal to `sizeof(<type>) * lwork`.
6604    ///
6605    /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
6606    ///
6607    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The operation completed successfully.
6608    ///
6609    /// [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]:   The library was not initialized.
6610    ///
6611    /// [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]:   Invalid parameters were passed (`m,n<0` or wrong `lda` or `ldc`).
6612    ///
6613    /// [`cusolverStatus_t::CUSOLVER_STATUS_ARCH_MISMATCH`]:   The device only supports compute capability 5.0 and above.
6614    ///
6615    /// [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]:   An internal operation failed.
6616    pub fn cusolverDnDormtr(
6617        handle: cusolverDnHandle_t,
6618        side: cublasSideMode_t,
6619        uplo: cublasFillMode_t,
6620        trans: cublasOperation_t,
6621        m: ::core::ffi::c_int,
6622        n: ::core::ffi::c_int,
6623        A: *mut f64,
6624        lda: ::core::ffi::c_int,
6625        tau: *mut f64,
6626        C: *mut f64,
6627        ldc: ::core::ffi::c_int,
6628        work: *mut f64,
6629        lwork: ::core::ffi::c_int,
6630        info: *mut ::core::ffi::c_int,
6631    ) -> cusolverStatus_t;
6632}
6633unsafe extern "C" {
6634    pub fn cusolverDnCunmtr(
6635        handle: cusolverDnHandle_t,
6636        side: cublasSideMode_t,
6637        uplo: cublasFillMode_t,
6638        trans: cublasOperation_t,
6639        m: ::core::ffi::c_int,
6640        n: ::core::ffi::c_int,
6641        A: *mut cuComplex,
6642        lda: ::core::ffi::c_int,
6643        tau: *mut cuComplex,
6644        C: *mut cuComplex,
6645        ldc: ::core::ffi::c_int,
6646        work: *mut cuComplex,
6647        lwork: ::core::ffi::c_int,
6648        info: *mut ::core::ffi::c_int,
6649    ) -> cusolverStatus_t;
6650}
6651unsafe extern "C" {
6652    pub fn cusolverDnZunmtr(
6653        handle: cusolverDnHandle_t,
6654        side: cublasSideMode_t,
6655        uplo: cublasFillMode_t,
6656        trans: cublasOperation_t,
6657        m: ::core::ffi::c_int,
6658        n: ::core::ffi::c_int,
6659        A: *mut cuDoubleComplex,
6660        lda: ::core::ffi::c_int,
6661        tau: *mut cuDoubleComplex,
6662        C: *mut cuDoubleComplex,
6663        ldc: ::core::ffi::c_int,
6664        work: *mut cuDoubleComplex,
6665        lwork: ::core::ffi::c_int,
6666        info: *mut ::core::ffi::c_int,
6667    ) -> cusolverStatus_t;
6668}
6669unsafe extern "C" {
6670    pub fn cusolverDnSgesvd_bufferSize(
6671        handle: cusolverDnHandle_t,
6672        m: ::core::ffi::c_int,
6673        n: ::core::ffi::c_int,
6674        lwork: *mut ::core::ffi::c_int,
6675    ) -> cusolverStatus_t;
6676}
6677unsafe extern "C" {
6678    pub fn cusolverDnDgesvd_bufferSize(
6679        handle: cusolverDnHandle_t,
6680        m: ::core::ffi::c_int,
6681        n: ::core::ffi::c_int,
6682        lwork: *mut ::core::ffi::c_int,
6683    ) -> cusolverStatus_t;
6684}
6685unsafe extern "C" {
6686    pub fn cusolverDnCgesvd_bufferSize(
6687        handle: cusolverDnHandle_t,
6688        m: ::core::ffi::c_int,
6689        n: ::core::ffi::c_int,
6690        lwork: *mut ::core::ffi::c_int,
6691    ) -> cusolverStatus_t;
6692}
6693unsafe extern "C" {
6694    pub fn cusolverDnZgesvd_bufferSize(
6695        handle: cusolverDnHandle_t,
6696        m: ::core::ffi::c_int,
6697        n: ::core::ffi::c_int,
6698        lwork: *mut ::core::ffi::c_int,
6699    ) -> cusolverStatus_t;
6700}
6701unsafe extern "C" {
6702    /// The helper functions below can calculate the sizes needed for pre-allocated buffer.
6703    ///
6704    /// The S and D data types are real valued single and double precision, respectively.
6705    ///
6706    /// The C and Z data types are complex valued single and double precision, respectively.
6707    ///
6708    /// This function computes the singular value decomposition (SVD) of an $m \times n$ matrix `A` and corresponding the left and/or right singular vectors. The SVD is written:
6709    ///
6710    /// $$
6711    /// A = U\\*\Sigma\\*V^{H}
6712    /// $$
6713    /// where $\Sigma$ is an $m \times n$ matrix which is zero except for its `min(m,n)` diagonal elements, `U` is an $m \times m$ unitary matrix, and `V` is an $n \times n$ unitary matrix. The diagonal elements of $\Sigma$ are the singular values of `A`; they are real and non-negative, and are returned in descending order. The first `min(m,n)` columns of `U` and `V` are the left and right singular vectors of `A`.
6714    ///
6715    /// The user has to provide working space which is pointed by input parameter `work`. The input parameter `lwork` is size of the working space, and it is returned by `gesvd_bufferSize()`. Please note that the size in bytes of the working space is equal to `sizeof(<type>) * lwork`.
6716    ///
6717    /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle). if `bdsqr` did not converge, `devInfo` specifies how many superdiagonals of an intermediate bidiagonal form did not converge to zero.
6718    ///
6719    /// The `rwork` is real array of dimension (min(m,n)-1). If `devInfo`>0 and `rwork` is not NULL, `rwork` contains the unconverged superdiagonal elements of an upper bidiagonal matrix. This is slightly different from LAPACK which puts unconverged superdiagonal elements in `work` if type is `real`; in `rwork` if type is `complex`. `rwork` can be a NULL pointer if the user does not want the information from superdiagonal.
6720    ///
6721    /// Please visit [cuSOLVER Library Samples - gesvd](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/gesvd) for a code example.
6722    ///
6723    /// Remark 1: `gesvd` only supports `m>=n`.
6724    ///
6725    /// Remark 2: the routine returns $V^{H}$, not `V`.
6726    ///
6727    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The operation completed successfully.
6728    ///
6729    /// [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]:   The library was not initialized.
6730    ///
6731    /// [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]:   Invalid parameters were passed (`m,n<0` or `lda<max(1,m)` or `ldu<max(1,m)` or `ldvt<max(1,n)`).
6732    ///
6733    /// [`cusolverStatus_t::CUSOLVER_STATUS_ARCH_MISMATCH`]:   The device only supports compute capability 5.0 and above.
6734    ///
6735    /// [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]:   An internal operation failed.
6736    pub fn cusolverDnSgesvd(
6737        handle: cusolverDnHandle_t,
6738        jobu: ::core::ffi::c_schar,
6739        jobvt: ::core::ffi::c_schar,
6740        m: ::core::ffi::c_int,
6741        n: ::core::ffi::c_int,
6742        A: *mut f32,
6743        lda: ::core::ffi::c_int,
6744        S: *mut f32,
6745        U: *mut f32,
6746        ldu: ::core::ffi::c_int,
6747        VT: *mut f32,
6748        ldvt: ::core::ffi::c_int,
6749        work: *mut f32,
6750        lwork: ::core::ffi::c_int,
6751        rwork: *mut f32,
6752        info: *mut ::core::ffi::c_int,
6753    ) -> cusolverStatus_t;
6754}
6755unsafe extern "C" {
6756    /// The helper functions below can calculate the sizes needed for pre-allocated buffer.
6757    ///
6758    /// The S and D data types are real valued single and double precision, respectively.
6759    ///
6760    /// The C and Z data types are complex valued single and double precision, respectively.
6761    ///
6762    /// This function computes the singular value decomposition (SVD) of an $m \times n$ matrix `A` and corresponding the left and/or right singular vectors. The SVD is written:
6763    ///
6764    /// $$
6765    /// A = U\\*\Sigma\\*V^{H}
6766    /// $$
6767    /// where $\Sigma$ is an $m \times n$ matrix which is zero except for its `min(m,n)` diagonal elements, `U` is an $m \times m$ unitary matrix, and `V` is an $n \times n$ unitary matrix. The diagonal elements of $\Sigma$ are the singular values of `A`; they are real and non-negative, and are returned in descending order. The first `min(m,n)` columns of `U` and `V` are the left and right singular vectors of `A`.
6768    ///
6769    /// The user has to provide working space which is pointed by input parameter `work`. The input parameter `lwork` is size of the working space, and it is returned by `gesvd_bufferSize()`. Please note that the size in bytes of the working space is equal to `sizeof(<type>) * lwork`.
6770    ///
6771    /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle). if `bdsqr` did not converge, `devInfo` specifies how many superdiagonals of an intermediate bidiagonal form did not converge to zero.
6772    ///
6773    /// The `rwork` is real array of dimension (min(m,n)-1). If `devInfo`>0 and `rwork` is not NULL, `rwork` contains the unconverged superdiagonal elements of an upper bidiagonal matrix. This is slightly different from LAPACK which puts unconverged superdiagonal elements in `work` if type is `real`; in `rwork` if type is `complex`. `rwork` can be a NULL pointer if the user does not want the information from superdiagonal.
6774    ///
6775    /// Please visit [cuSOLVER Library Samples - gesvd](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/gesvd) for a code example.
6776    ///
6777    /// Remark 1: `gesvd` only supports `m>=n`.
6778    ///
6779    /// Remark 2: the routine returns $V^{H}$, not `V`.
6780    ///
6781    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The operation completed successfully.
6782    ///
6783    /// [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]:   The library was not initialized.
6784    ///
6785    /// [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]:   Invalid parameters were passed (`m,n<0` or `lda<max(1,m)` or `ldu<max(1,m)` or `ldvt<max(1,n)`).
6786    ///
6787    /// [`cusolverStatus_t::CUSOLVER_STATUS_ARCH_MISMATCH`]:   The device only supports compute capability 5.0 and above.
6788    ///
6789    /// [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]:   An internal operation failed.
6790    pub fn cusolverDnDgesvd(
6791        handle: cusolverDnHandle_t,
6792        jobu: ::core::ffi::c_schar,
6793        jobvt: ::core::ffi::c_schar,
6794        m: ::core::ffi::c_int,
6795        n: ::core::ffi::c_int,
6796        A: *mut f64,
6797        lda: ::core::ffi::c_int,
6798        S: *mut f64,
6799        U: *mut f64,
6800        ldu: ::core::ffi::c_int,
6801        VT: *mut f64,
6802        ldvt: ::core::ffi::c_int,
6803        work: *mut f64,
6804        lwork: ::core::ffi::c_int,
6805        rwork: *mut f64,
6806        info: *mut ::core::ffi::c_int,
6807    ) -> cusolverStatus_t;
6808}
6809unsafe extern "C" {
6810    /// The helper functions below can calculate the sizes needed for pre-allocated buffer.
6811    ///
6812    /// The S and D data types are real valued single and double precision, respectively.
6813    ///
6814    /// The C and Z data types are complex valued single and double precision, respectively.
6815    ///
6816    /// This function computes the singular value decomposition (SVD) of an $m \times n$ matrix `A` and corresponding the left and/or right singular vectors. The SVD is written:
6817    ///
6818    /// $$
6819    /// A = U\\*\Sigma\\*V^{H}
6820    /// $$
6821    /// where $\Sigma$ is an $m \times n$ matrix which is zero except for its `min(m,n)` diagonal elements, `U` is an $m \times m$ unitary matrix, and `V` is an $n \times n$ unitary matrix. The diagonal elements of $\Sigma$ are the singular values of `A`; they are real and non-negative, and are returned in descending order. The first `min(m,n)` columns of `U` and `V` are the left and right singular vectors of `A`.
6822    ///
6823    /// The user has to provide working space which is pointed by input parameter `work`. The input parameter `lwork` is size of the working space, and it is returned by `gesvd_bufferSize()`. Please note that the size in bytes of the working space is equal to `sizeof(<type>) * lwork`.
6824    ///
6825    /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle). if `bdsqr` did not converge, `devInfo` specifies how many superdiagonals of an intermediate bidiagonal form did not converge to zero.
6826    ///
6827    /// The `rwork` is real array of dimension (min(m,n)-1). If `devInfo`>0 and `rwork` is not NULL, `rwork` contains the unconverged superdiagonal elements of an upper bidiagonal matrix. This is slightly different from LAPACK which puts unconverged superdiagonal elements in `work` if type is `real`; in `rwork` if type is `complex`. `rwork` can be a NULL pointer if the user does not want the information from superdiagonal.
6828    ///
6829    /// Please visit [cuSOLVER Library Samples - gesvd](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/gesvd) for a code example.
6830    ///
6831    /// Remark 1: `gesvd` only supports `m>=n`.
6832    ///
6833    /// Remark 2: the routine returns $V^{H}$, not `V`.
6834    ///
6835    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The operation completed successfully.
6836    ///
6837    /// [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]:   The library was not initialized.
6838    ///
6839    /// [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]:   Invalid parameters were passed (`m,n<0` or `lda<max(1,m)` or `ldu<max(1,m)` or `ldvt<max(1,n)`).
6840    ///
6841    /// [`cusolverStatus_t::CUSOLVER_STATUS_ARCH_MISMATCH`]:   The device only supports compute capability 5.0 and above.
6842    ///
6843    /// [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]:   An internal operation failed.
6844    pub fn cusolverDnCgesvd(
6845        handle: cusolverDnHandle_t,
6846        jobu: ::core::ffi::c_schar,
6847        jobvt: ::core::ffi::c_schar,
6848        m: ::core::ffi::c_int,
6849        n: ::core::ffi::c_int,
6850        A: *mut cuComplex,
6851        lda: ::core::ffi::c_int,
6852        S: *mut f32,
6853        U: *mut cuComplex,
6854        ldu: ::core::ffi::c_int,
6855        VT: *mut cuComplex,
6856        ldvt: ::core::ffi::c_int,
6857        work: *mut cuComplex,
6858        lwork: ::core::ffi::c_int,
6859        rwork: *mut f32,
6860        info: *mut ::core::ffi::c_int,
6861    ) -> cusolverStatus_t;
6862}
6863unsafe extern "C" {
6864    /// The helper functions below can calculate the sizes needed for pre-allocated buffer.
6865    ///
6866    /// The S and D data types are real valued single and double precision, respectively.
6867    ///
6868    /// The C and Z data types are complex valued single and double precision, respectively.
6869    ///
6870    /// This function computes the singular value decomposition (SVD) of an $m \times n$ matrix `A` and corresponding the left and/or right singular vectors. The SVD is written:
6871    ///
6872    /// $$
6873    /// A = U\\*\Sigma\\*V^{H}
6874    /// $$
6875    /// where $\Sigma$ is an $m \times n$ matrix which is zero except for its `min(m,n)` diagonal elements, `U` is an $m \times m$ unitary matrix, and `V` is an $n \times n$ unitary matrix. The diagonal elements of $\Sigma$ are the singular values of `A`; they are real and non-negative, and are returned in descending order. The first `min(m,n)` columns of `U` and `V` are the left and right singular vectors of `A`.
6876    ///
6877    /// The user has to provide working space which is pointed by input parameter `work`. The input parameter `lwork` is size of the working space, and it is returned by `gesvd_bufferSize()`. Please note that the size in bytes of the working space is equal to `sizeof(<type>) * lwork`.
6878    ///
6879    /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle). if `bdsqr` did not converge, `devInfo` specifies how many superdiagonals of an intermediate bidiagonal form did not converge to zero.
6880    ///
6881    /// The `rwork` is real array of dimension (min(m,n)-1). If `devInfo`>0 and `rwork` is not NULL, `rwork` contains the unconverged superdiagonal elements of an upper bidiagonal matrix. This is slightly different from LAPACK which puts unconverged superdiagonal elements in `work` if type is `real`; in `rwork` if type is `complex`. `rwork` can be a NULL pointer if the user does not want the information from superdiagonal.
6882    ///
6883    /// Please visit [cuSOLVER Library Samples - gesvd](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/gesvd) for a code example.
6884    ///
6885    /// Remark 1: `gesvd` only supports `m>=n`.
6886    ///
6887    /// Remark 2: the routine returns $V^{H}$, not `V`.
6888    ///
6889    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The operation completed successfully.
6890    ///
6891    /// [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]:   The library was not initialized.
6892    ///
6893    /// [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]:   Invalid parameters were passed (`m,n<0` or `lda<max(1,m)` or `ldu<max(1,m)` or `ldvt<max(1,n)`).
6894    ///
6895    /// [`cusolverStatus_t::CUSOLVER_STATUS_ARCH_MISMATCH`]:   The device only supports compute capability 5.0 and above.
6896    ///
6897    /// [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]:   An internal operation failed.
6898    pub fn cusolverDnZgesvd(
6899        handle: cusolverDnHandle_t,
6900        jobu: ::core::ffi::c_schar,
6901        jobvt: ::core::ffi::c_schar,
6902        m: ::core::ffi::c_int,
6903        n: ::core::ffi::c_int,
6904        A: *mut cuDoubleComplex,
6905        lda: ::core::ffi::c_int,
6906        S: *mut f64,
6907        U: *mut cuDoubleComplex,
6908        ldu: ::core::ffi::c_int,
6909        VT: *mut cuDoubleComplex,
6910        ldvt: ::core::ffi::c_int,
6911        work: *mut cuDoubleComplex,
6912        lwork: ::core::ffi::c_int,
6913        rwork: *mut f64,
6914        info: *mut ::core::ffi::c_int,
6915    ) -> cusolverStatus_t;
6916}
6917unsafe extern "C" {
6918    pub fn cusolverDnSsyevd_bufferSize(
6919        handle: cusolverDnHandle_t,
6920        jobz: cusolverEigMode_t,
6921        uplo: cublasFillMode_t,
6922        n: ::core::ffi::c_int,
6923        A: *const f32,
6924        lda: ::core::ffi::c_int,
6925        W: *const f32,
6926        lwork: *mut ::core::ffi::c_int,
6927    ) -> cusolverStatus_t;
6928}
6929unsafe extern "C" {
6930    pub fn cusolverDnDsyevd_bufferSize(
6931        handle: cusolverDnHandle_t,
6932        jobz: cusolverEigMode_t,
6933        uplo: cublasFillMode_t,
6934        n: ::core::ffi::c_int,
6935        A: *const f64,
6936        lda: ::core::ffi::c_int,
6937        W: *const f64,
6938        lwork: *mut ::core::ffi::c_int,
6939    ) -> cusolverStatus_t;
6940}
6941unsafe extern "C" {
6942    pub fn cusolverDnCheevd_bufferSize(
6943        handle: cusolverDnHandle_t,
6944        jobz: cusolverEigMode_t,
6945        uplo: cublasFillMode_t,
6946        n: ::core::ffi::c_int,
6947        A: *const cuComplex,
6948        lda: ::core::ffi::c_int,
6949        W: *const f32,
6950        lwork: *mut ::core::ffi::c_int,
6951    ) -> cusolverStatus_t;
6952}
6953unsafe extern "C" {
6954    pub fn cusolverDnZheevd_bufferSize(
6955        handle: cusolverDnHandle_t,
6956        jobz: cusolverEigMode_t,
6957        uplo: cublasFillMode_t,
6958        n: ::core::ffi::c_int,
6959        A: *const cuDoubleComplex,
6960        lda: ::core::ffi::c_int,
6961        W: *const f64,
6962        lwork: *mut ::core::ffi::c_int,
6963    ) -> cusolverStatus_t;
6964}
6965unsafe extern "C" {
6966    /// The helper functions below can calculate the sizes needed for pre-allocated buffer.
6967    ///
6968    /// The S and D data types are real valued single and double precision, respectively.
6969    ///
6970    /// The C and Z data types are complex valued single and double precision, respectively.
6971    ///
6972    /// This function computes eigenvalues and eigenvectors of a symmetric (Hermitian) $n \times n$ matrix `A`. The standard symmetric eigenvalue problem is:
6973    ///
6974    /// $$
6975    /// A\\*V = V\\*\Lambda
6976    /// $$
6977    /// where `Λ` is a real $n \times n$ diagonal matrix. `V` is an $n \times n$ unitary matrix. The diagonal elements of `Λ` are the eigenvalues of `A` in ascending order.
6978    ///
6979    /// The user has to provide working space which is pointed by input parameter `work`. The input parameter `lwork` is size of the working space, and it is returned by `syevd_bufferSize()`. Please note that the size in bytes of the working space is equal to `sizeof(<type>) * lwork`.
6980    ///
6981    /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle). If `devInfo = i` (greater than zero), `i` off-diagonal elements of an intermediate tridiagonal form did not converge to zero.
6982    ///
6983    /// If `jobz` = [`cusolverEigMode_t::CUSOLVER_EIG_MODE_VECTOR`], `A` contains the orthonormal eigenvectors of the matrix `A`. The eigenvectors are computed by a divide and conquer algorithm.
6984    ///
6985    /// Please visit [cuSOLVER Library Samples - syevd](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/syevd) for a code example.
6986    ///
6987    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The operation completed successfully.
6988    ///
6989    /// [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]:   The library was not initialized.
6990    ///
6991    /// [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]:   Invalid parameters were passed (`n<0`, or `lda<max(1,n)`, or `jobz` is not [`cusolverEigMode_t::CUSOLVER_EIG_MODE_NOVECTOR`] or [`cusolverEigMode_t::CUSOLVER_EIG_MODE_VECTOR`], or `uplo` is not [`cublasFillMode_t::CUBLAS_FILL_MODE_LOWER`] or [`cublasFillMode_t::CUBLAS_FILL_MODE_UPPER`]).
6992    ///
6993    /// [`cusolverStatus_t::CUSOLVER_STATUS_ARCH_MISMATCH`]:   The device only supports compute capability 5.0 and above.
6994    ///
6995    /// [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]:   An internal operation failed.
6996    pub fn cusolverDnSsyevd(
6997        handle: cusolverDnHandle_t,
6998        jobz: cusolverEigMode_t,
6999        uplo: cublasFillMode_t,
7000        n: ::core::ffi::c_int,
7001        A: *mut f32,
7002        lda: ::core::ffi::c_int,
7003        W: *mut f32,
7004        work: *mut f32,
7005        lwork: ::core::ffi::c_int,
7006        info: *mut ::core::ffi::c_int,
7007    ) -> cusolverStatus_t;
7008}
7009unsafe extern "C" {
7010    /// The helper functions below can calculate the sizes needed for pre-allocated buffer.
7011    ///
7012    /// The S and D data types are real valued single and double precision, respectively.
7013    ///
7014    /// The C and Z data types are complex valued single and double precision, respectively.
7015    ///
7016    /// This function computes eigenvalues and eigenvectors of a symmetric (Hermitian) $n \times n$ matrix `A`. The standard symmetric eigenvalue problem is:
7017    ///
7018    /// $$
7019    /// A\\*V = V\\*\Lambda
7020    /// $$
7021    /// where `Λ` is a real $n \times n$ diagonal matrix. `V` is an $n \times n$ unitary matrix. The diagonal elements of `Λ` are the eigenvalues of `A` in ascending order.
7022    ///
7023    /// The user has to provide working space which is pointed by input parameter `work`. The input parameter `lwork` is size of the working space, and it is returned by `syevd_bufferSize()`. Please note that the size in bytes of the working space is equal to `sizeof(<type>) * lwork`.
7024    ///
7025    /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle). If `devInfo = i` (greater than zero), `i` off-diagonal elements of an intermediate tridiagonal form did not converge to zero.
7026    ///
7027    /// If `jobz` = [`cusolverEigMode_t::CUSOLVER_EIG_MODE_VECTOR`], `A` contains the orthonormal eigenvectors of the matrix `A`. The eigenvectors are computed by a divide and conquer algorithm.
7028    ///
7029    /// Please visit [cuSOLVER Library Samples - syevd](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/syevd) for a code example.
7030    ///
7031    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The operation completed successfully.
7032    ///
7033    /// [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]:   The library was not initialized.
7034    ///
7035    /// [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]:   Invalid parameters were passed (`n<0`, or `lda<max(1,n)`, or `jobz` is not [`cusolverEigMode_t::CUSOLVER_EIG_MODE_NOVECTOR`] or [`cusolverEigMode_t::CUSOLVER_EIG_MODE_VECTOR`], or `uplo` is not [`cublasFillMode_t::CUBLAS_FILL_MODE_LOWER`] or [`cublasFillMode_t::CUBLAS_FILL_MODE_UPPER`]).
7036    ///
7037    /// [`cusolverStatus_t::CUSOLVER_STATUS_ARCH_MISMATCH`]:   The device only supports compute capability 5.0 and above.
7038    ///
7039    /// [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]:   An internal operation failed.
7040    pub fn cusolverDnDsyevd(
7041        handle: cusolverDnHandle_t,
7042        jobz: cusolverEigMode_t,
7043        uplo: cublasFillMode_t,
7044        n: ::core::ffi::c_int,
7045        A: *mut f64,
7046        lda: ::core::ffi::c_int,
7047        W: *mut f64,
7048        work: *mut f64,
7049        lwork: ::core::ffi::c_int,
7050        info: *mut ::core::ffi::c_int,
7051    ) -> cusolverStatus_t;
7052}
7053unsafe extern "C" {
7054    pub fn cusolverDnCheevd(
7055        handle: cusolverDnHandle_t,
7056        jobz: cusolverEigMode_t,
7057        uplo: cublasFillMode_t,
7058        n: ::core::ffi::c_int,
7059        A: *mut cuComplex,
7060        lda: ::core::ffi::c_int,
7061        W: *mut f32,
7062        work: *mut cuComplex,
7063        lwork: ::core::ffi::c_int,
7064        info: *mut ::core::ffi::c_int,
7065    ) -> cusolverStatus_t;
7066}
7067unsafe extern "C" {
7068    pub fn cusolverDnZheevd(
7069        handle: cusolverDnHandle_t,
7070        jobz: cusolverEigMode_t,
7071        uplo: cublasFillMode_t,
7072        n: ::core::ffi::c_int,
7073        A: *mut cuDoubleComplex,
7074        lda: ::core::ffi::c_int,
7075        W: *mut f64,
7076        work: *mut cuDoubleComplex,
7077        lwork: ::core::ffi::c_int,
7078        info: *mut ::core::ffi::c_int,
7079    ) -> cusolverStatus_t;
7080}
7081unsafe extern "C" {
7082    pub fn cusolverDnSsyevdx_bufferSize(
7083        handle: cusolverDnHandle_t,
7084        jobz: cusolverEigMode_t,
7085        range: cusolverEigRange_t,
7086        uplo: cublasFillMode_t,
7087        n: ::core::ffi::c_int,
7088        A: *const f32,
7089        lda: ::core::ffi::c_int,
7090        vl: f32,
7091        vu: f32,
7092        il: ::core::ffi::c_int,
7093        iu: ::core::ffi::c_int,
7094        meig: *mut ::core::ffi::c_int,
7095        W: *const f32,
7096        lwork: *mut ::core::ffi::c_int,
7097    ) -> cusolverStatus_t;
7098}
7099unsafe extern "C" {
7100    pub fn cusolverDnDsyevdx_bufferSize(
7101        handle: cusolverDnHandle_t,
7102        jobz: cusolverEigMode_t,
7103        range: cusolverEigRange_t,
7104        uplo: cublasFillMode_t,
7105        n: ::core::ffi::c_int,
7106        A: *const f64,
7107        lda: ::core::ffi::c_int,
7108        vl: f64,
7109        vu: f64,
7110        il: ::core::ffi::c_int,
7111        iu: ::core::ffi::c_int,
7112        meig: *mut ::core::ffi::c_int,
7113        W: *const f64,
7114        lwork: *mut ::core::ffi::c_int,
7115    ) -> cusolverStatus_t;
7116}
7117unsafe extern "C" {
7118    pub fn cusolverDnCheevdx_bufferSize(
7119        handle: cusolverDnHandle_t,
7120        jobz: cusolverEigMode_t,
7121        range: cusolverEigRange_t,
7122        uplo: cublasFillMode_t,
7123        n: ::core::ffi::c_int,
7124        A: *const cuComplex,
7125        lda: ::core::ffi::c_int,
7126        vl: f32,
7127        vu: f32,
7128        il: ::core::ffi::c_int,
7129        iu: ::core::ffi::c_int,
7130        meig: *mut ::core::ffi::c_int,
7131        W: *const f32,
7132        lwork: *mut ::core::ffi::c_int,
7133    ) -> cusolverStatus_t;
7134}
7135unsafe extern "C" {
7136    pub fn cusolverDnZheevdx_bufferSize(
7137        handle: cusolverDnHandle_t,
7138        jobz: cusolverEigMode_t,
7139        range: cusolverEigRange_t,
7140        uplo: cublasFillMode_t,
7141        n: ::core::ffi::c_int,
7142        A: *const cuDoubleComplex,
7143        lda: ::core::ffi::c_int,
7144        vl: f64,
7145        vu: f64,
7146        il: ::core::ffi::c_int,
7147        iu: ::core::ffi::c_int,
7148        meig: *mut ::core::ffi::c_int,
7149        W: *const f64,
7150        lwork: *mut ::core::ffi::c_int,
7151    ) -> cusolverStatus_t;
7152}
7153unsafe extern "C" {
7154    /// The helper functions below can calculate the sizes needed for pre-allocated buffer.
7155    ///
7156    /// The S and D data types are real valued single and double precision, respectively.
7157    ///
7158    /// The C and Z data types are complex valued single and double precision, respectively.
7159    ///
7160    /// This function computes all or selection of the eigenvalues and optionally eigenvectors of a symmetric (Hermitian) $n \times n$ matrix `A`. The standard symmetric eigenvalue problem is:
7161    ///
7162    /// $$
7163    /// A\\*V = V\\*\Lambda
7164    /// $$
7165    /// where `Λ` is a real `n×h_meig` diagonal matrix. `V` is an `n×h_meig` unitary matrix. `h_meig` is the number of eigenvalues/eigenvectors computed by the routine, `h_meig` is equal to `n` when the whole spectrum (e.g., `range` = [`cusolverEigRange_t::CUSOLVER_EIG_RANGE_ALL`]) is requested. The diagonal elements of `Λ` are the eigenvalues of `A` in ascending order.
7166    ///
7167    /// The user has to provide working space which is pointed by input parameter `work`. The input parameter `lwork` is size of the working space, and it is returned by `syevdx_bufferSize()`. Please note that the size in bytes of the working space is equal to `sizeof(<type>) * lwork`.
7168    ///
7169    /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle). If `devInfo = i` (greater than zero), `i` off-diagonal elements of an intermediate tridiagonal form did not converge to zero.
7170    ///
7171    /// If `jobz` = [`cusolverEigMode_t::CUSOLVER_EIG_MODE_VECTOR`], `A` contains the orthonormal eigenvectors of the matrix `A`. The eigenvectors are computed by a divide and conquer algorithm.
7172    ///
7173    /// Please visit [cuSOLVER Library Samples - syevdx](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/syevdx) for a code example.
7174    ///
7175    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The operation completed successfully.
7176    ///
7177    /// [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]:   The library was not initialized.
7178    ///
7179    /// [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]:   Invalid parameters were passed (`n<0`, or `lda<max(1,n)`, or `jobz` is not [`cusolverEigMode_t::CUSOLVER_EIG_MODE_NOVECTOR`] or [`cusolverEigMode_t::CUSOLVER_EIG_MODE_VECTOR`], or `range` is not [`cusolverEigRange_t::CUSOLVER_EIG_RANGE_ALL`] or [`cusolverEigRange_t::CUSOLVER_EIG_RANGE_V`] or [`cusolverEigRange_t::CUSOLVER_EIG_RANGE_I`], or `uplo` is not [`cublasFillMode_t::CUBLAS_FILL_MODE_LOWER`] or [`cublasFillMode_t::CUBLAS_FILL_MODE_UPPER`]).
7180    ///
7181    /// [`cusolverStatus_t::CUSOLVER_STATUS_ARCH_MISMATCH`]:   The device only supports compute capability 5.0 and above.
7182    ///
7183    /// [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]:   An internal operation failed.
7184    pub fn cusolverDnSsyevdx(
7185        handle: cusolverDnHandle_t,
7186        jobz: cusolverEigMode_t,
7187        range: cusolverEigRange_t,
7188        uplo: cublasFillMode_t,
7189        n: ::core::ffi::c_int,
7190        A: *mut f32,
7191        lda: ::core::ffi::c_int,
7192        vl: f32,
7193        vu: f32,
7194        il: ::core::ffi::c_int,
7195        iu: ::core::ffi::c_int,
7196        meig: *mut ::core::ffi::c_int,
7197        W: *mut f32,
7198        work: *mut f32,
7199        lwork: ::core::ffi::c_int,
7200        info: *mut ::core::ffi::c_int,
7201    ) -> cusolverStatus_t;
7202}
7203unsafe extern "C" {
7204    /// The helper functions below can calculate the sizes needed for pre-allocated buffer.
7205    ///
7206    /// The S and D data types are real valued single and double precision, respectively.
7207    ///
7208    /// The C and Z data types are complex valued single and double precision, respectively.
7209    ///
7210    /// This function computes all or selection of the eigenvalues and optionally eigenvectors of a symmetric (Hermitian) $n \times n$ matrix `A`. The standard symmetric eigenvalue problem is:
7211    ///
7212    /// $$
7213    /// A\\*V = V\\*\Lambda
7214    /// $$
7215    /// where `Λ` is a real `n×h_meig` diagonal matrix. `V` is an `n×h_meig` unitary matrix. `h_meig` is the number of eigenvalues/eigenvectors computed by the routine, `h_meig` is equal to `n` when the whole spectrum (e.g., `range` = [`cusolverEigRange_t::CUSOLVER_EIG_RANGE_ALL`]) is requested. The diagonal elements of `Λ` are the eigenvalues of `A` in ascending order.
7216    ///
7217    /// The user has to provide working space which is pointed by input parameter `work`. The input parameter `lwork` is size of the working space, and it is returned by `syevdx_bufferSize()`. Please note that the size in bytes of the working space is equal to `sizeof(<type>) * lwork`.
7218    ///
7219    /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle). If `devInfo = i` (greater than zero), `i` off-diagonal elements of an intermediate tridiagonal form did not converge to zero.
7220    ///
7221    /// If `jobz` = [`cusolverEigMode_t::CUSOLVER_EIG_MODE_VECTOR`], `A` contains the orthonormal eigenvectors of the matrix `A`. The eigenvectors are computed by a divide and conquer algorithm.
7222    ///
7223    /// Please visit [cuSOLVER Library Samples - syevdx](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/syevdx) for a code example.
7224    ///
7225    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The operation completed successfully.
7226    ///
7227    /// [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]:   The library was not initialized.
7228    ///
7229    /// [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]:   Invalid parameters were passed (`n<0`, or `lda<max(1,n)`, or `jobz` is not [`cusolverEigMode_t::CUSOLVER_EIG_MODE_NOVECTOR`] or [`cusolverEigMode_t::CUSOLVER_EIG_MODE_VECTOR`], or `range` is not [`cusolverEigRange_t::CUSOLVER_EIG_RANGE_ALL`] or [`cusolverEigRange_t::CUSOLVER_EIG_RANGE_V`] or [`cusolverEigRange_t::CUSOLVER_EIG_RANGE_I`], or `uplo` is not [`cublasFillMode_t::CUBLAS_FILL_MODE_LOWER`] or [`cublasFillMode_t::CUBLAS_FILL_MODE_UPPER`]).
7230    ///
7231    /// [`cusolverStatus_t::CUSOLVER_STATUS_ARCH_MISMATCH`]:   The device only supports compute capability 5.0 and above.
7232    ///
7233    /// [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]:   An internal operation failed.
7234    pub fn cusolverDnDsyevdx(
7235        handle: cusolverDnHandle_t,
7236        jobz: cusolverEigMode_t,
7237        range: cusolverEigRange_t,
7238        uplo: cublasFillMode_t,
7239        n: ::core::ffi::c_int,
7240        A: *mut f64,
7241        lda: ::core::ffi::c_int,
7242        vl: f64,
7243        vu: f64,
7244        il: ::core::ffi::c_int,
7245        iu: ::core::ffi::c_int,
7246        meig: *mut ::core::ffi::c_int,
7247        W: *mut f64,
7248        work: *mut f64,
7249        lwork: ::core::ffi::c_int,
7250        info: *mut ::core::ffi::c_int,
7251    ) -> cusolverStatus_t;
7252}
7253unsafe extern "C" {
7254    pub fn cusolverDnCheevdx(
7255        handle: cusolverDnHandle_t,
7256        jobz: cusolverEigMode_t,
7257        range: cusolverEigRange_t,
7258        uplo: cublasFillMode_t,
7259        n: ::core::ffi::c_int,
7260        A: *mut cuComplex,
7261        lda: ::core::ffi::c_int,
7262        vl: f32,
7263        vu: f32,
7264        il: ::core::ffi::c_int,
7265        iu: ::core::ffi::c_int,
7266        meig: *mut ::core::ffi::c_int,
7267        W: *mut f32,
7268        work: *mut cuComplex,
7269        lwork: ::core::ffi::c_int,
7270        info: *mut ::core::ffi::c_int,
7271    ) -> cusolverStatus_t;
7272}
7273unsafe extern "C" {
7274    pub fn cusolverDnZheevdx(
7275        handle: cusolverDnHandle_t,
7276        jobz: cusolverEigMode_t,
7277        range: cusolverEigRange_t,
7278        uplo: cublasFillMode_t,
7279        n: ::core::ffi::c_int,
7280        A: *mut cuDoubleComplex,
7281        lda: ::core::ffi::c_int,
7282        vl: f64,
7283        vu: f64,
7284        il: ::core::ffi::c_int,
7285        iu: ::core::ffi::c_int,
7286        meig: *mut ::core::ffi::c_int,
7287        W: *mut f64,
7288        work: *mut cuDoubleComplex,
7289        lwork: ::core::ffi::c_int,
7290        info: *mut ::core::ffi::c_int,
7291    ) -> cusolverStatus_t;
7292}
7293unsafe extern "C" {
7294    pub fn cusolverDnSsygvdx_bufferSize(
7295        handle: cusolverDnHandle_t,
7296        itype: cusolverEigType_t,
7297        jobz: cusolverEigMode_t,
7298        range: cusolverEigRange_t,
7299        uplo: cublasFillMode_t,
7300        n: ::core::ffi::c_int,
7301        A: *const f32,
7302        lda: ::core::ffi::c_int,
7303        B: *const f32,
7304        ldb: ::core::ffi::c_int,
7305        vl: f32,
7306        vu: f32,
7307        il: ::core::ffi::c_int,
7308        iu: ::core::ffi::c_int,
7309        meig: *mut ::core::ffi::c_int,
7310        W: *const f32,
7311        lwork: *mut ::core::ffi::c_int,
7312    ) -> cusolverStatus_t;
7313}
7314unsafe extern "C" {
7315    pub fn cusolverDnDsygvdx_bufferSize(
7316        handle: cusolverDnHandle_t,
7317        itype: cusolverEigType_t,
7318        jobz: cusolverEigMode_t,
7319        range: cusolverEigRange_t,
7320        uplo: cublasFillMode_t,
7321        n: ::core::ffi::c_int,
7322        A: *const f64,
7323        lda: ::core::ffi::c_int,
7324        B: *const f64,
7325        ldb: ::core::ffi::c_int,
7326        vl: f64,
7327        vu: f64,
7328        il: ::core::ffi::c_int,
7329        iu: ::core::ffi::c_int,
7330        meig: *mut ::core::ffi::c_int,
7331        W: *const f64,
7332        lwork: *mut ::core::ffi::c_int,
7333    ) -> cusolverStatus_t;
7334}
7335unsafe extern "C" {
7336    pub fn cusolverDnChegvdx_bufferSize(
7337        handle: cusolverDnHandle_t,
7338        itype: cusolverEigType_t,
7339        jobz: cusolverEigMode_t,
7340        range: cusolverEigRange_t,
7341        uplo: cublasFillMode_t,
7342        n: ::core::ffi::c_int,
7343        A: *const cuComplex,
7344        lda: ::core::ffi::c_int,
7345        B: *const cuComplex,
7346        ldb: ::core::ffi::c_int,
7347        vl: f32,
7348        vu: f32,
7349        il: ::core::ffi::c_int,
7350        iu: ::core::ffi::c_int,
7351        meig: *mut ::core::ffi::c_int,
7352        W: *const f32,
7353        lwork: *mut ::core::ffi::c_int,
7354    ) -> cusolverStatus_t;
7355}
7356unsafe extern "C" {
7357    pub fn cusolverDnZhegvdx_bufferSize(
7358        handle: cusolverDnHandle_t,
7359        itype: cusolverEigType_t,
7360        jobz: cusolverEigMode_t,
7361        range: cusolverEigRange_t,
7362        uplo: cublasFillMode_t,
7363        n: ::core::ffi::c_int,
7364        A: *const cuDoubleComplex,
7365        lda: ::core::ffi::c_int,
7366        B: *const cuDoubleComplex,
7367        ldb: ::core::ffi::c_int,
7368        vl: f64,
7369        vu: f64,
7370        il: ::core::ffi::c_int,
7371        iu: ::core::ffi::c_int,
7372        meig: *mut ::core::ffi::c_int,
7373        W: *const f64,
7374        lwork: *mut ::core::ffi::c_int,
7375    ) -> cusolverStatus_t;
7376}
7377unsafe extern "C" {
7378    /// The helper functions below can calculate the sizes needed for pre-allocated buffer.
7379    ///
7380    /// The S and D data types are real valued single and double precision, respectively.
7381    ///
7382    /// The C and Z data types are complex valued single and double precision, respectively.
7383    ///
7384    /// This function computes all or selection of the eigenvalues and optionally eigenvectors of a symmetric (Hermitian) $n \times n$ matrix-pair (`A`,`B`). The generalized symmetric-definite eigenvalue problem is
7385    ///
7386    /// ![image4](_images/eig-a-b-itype.png)
7387    ///
7388    /// where the matrix `B` is positive definite. `Λ` is a real $n \times {h_meig}$ diagonal matrix. The diagonal elements of `Λ` are the eigenvalues of (`A`, `B`) in ascending order. `V` is an $n \times {h_meig}$ orthogonal matrix. `h_meig` is the number of eigenvalues/eigenvectors computed by the routine, `h_meig` is equal to `n` when the whole spectrum (for example, `range` = [`cusolverEigRange_t::CUSOLVER_EIG_RANGE_ALL`]) is requested. The eigenvectors are normalized as follows:
7389    ///
7390    /// ![image5](_images/normalized-eigenvectors.png)
7391    ///
7392    /// The user has to provide working space which is pointed by input parameter `work`. The input parameter `lwork` is size of the working space, and it is returned by `sygvdx_bufferSize()`. Please note that the size in bytes of the working space is equal to `sizeof(<type>) * lwork`.
7393    ///
7394    /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle). If `devInfo = i` (i > 0 and i<=n) and `jobz` = [`cusolverEigMode_t::CUSOLVER_EIG_MODE_NOVECTOR`], `i` off-diagonal elements of an intermediate tridiagonal form did not converge to zero. If `devInfo = n + i` (i > 0), then the leading minor of order `i` of `B` is not positive definite. The factorization of `B` could not be completed and no eigenvalues or eigenvectors were computed.
7395    ///
7396    /// If `jobz` = [`cusolverEigMode_t::CUSOLVER_EIG_MODE_VECTOR`], `A` contains the orthogonal eigenvectors of the matrix `A`. The eigenvectors are computed by divide and conquer algorithm.
7397    ///
7398    /// Please visit [cuSOLVER Library Samples - sygvdx](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/sygvdx) for a code example.
7399    ///
7400    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The operation completed successfully.
7401    ///
7402    /// [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]:   The library was not initialized.
7403    ///
7404    /// [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]:   Invalid parameters were passed (`n<0`, or `lda<max(1,n)`, or `ldb<max(1,n)`, or `itype` is not [`cusolverEigType_t::CUSOLVER_EIG_TYPE_1`] or [`cusolverEigType_t::CUSOLVER_EIG_TYPE_2`] or [`cusolverEigType_t::CUSOLVER_EIG_TYPE_3`] or `jobz` is not [`cusolverEigMode_t::CUSOLVER_EIG_MODE_NOVECTOR`] or `CUSOLVER_EIG_MODE_VECTORL`, or `range` is not [`cusolverEigRange_t::CUSOLVER_EIG_RANGE_ALL`] or [`cusolverEigRange_t::CUSOLVER_EIG_RANGE_V`] or [`cusolverEigRange_t::CUSOLVER_EIG_RANGE_I`], or `uplo` is not [`cublasFillMode_t::CUBLAS_FILL_MODE_LOWER`] or [`cublasFillMode_t::CUBLAS_FILL_MODE_UPPER`]).
7405    ///
7406    /// [`cusolverStatus_t::CUSOLVER_STATUS_ARCH_MISMATCH`]:   The device only supports compute capability 5.0 and above.
7407    ///
7408    /// [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]:   An internal operation failed.
7409    pub fn cusolverDnSsygvdx(
7410        handle: cusolverDnHandle_t,
7411        itype: cusolverEigType_t,
7412        jobz: cusolverEigMode_t,
7413        range: cusolverEigRange_t,
7414        uplo: cublasFillMode_t,
7415        n: ::core::ffi::c_int,
7416        A: *mut f32,
7417        lda: ::core::ffi::c_int,
7418        B: *mut f32,
7419        ldb: ::core::ffi::c_int,
7420        vl: f32,
7421        vu: f32,
7422        il: ::core::ffi::c_int,
7423        iu: ::core::ffi::c_int,
7424        meig: *mut ::core::ffi::c_int,
7425        W: *mut f32,
7426        work: *mut f32,
7427        lwork: ::core::ffi::c_int,
7428        info: *mut ::core::ffi::c_int,
7429    ) -> cusolverStatus_t;
7430}
7431unsafe extern "C" {
7432    /// The helper functions below can calculate the sizes needed for pre-allocated buffer.
7433    ///
7434    /// The S and D data types are real valued single and double precision, respectively.
7435    ///
7436    /// The C and Z data types are complex valued single and double precision, respectively.
7437    ///
7438    /// This function computes all or selection of the eigenvalues and optionally eigenvectors of a symmetric (Hermitian) $n \times n$ matrix-pair (`A`,`B`). The generalized symmetric-definite eigenvalue problem is
7439    ///
7440    /// ![image4](_images/eig-a-b-itype.png)
7441    ///
7442    /// where the matrix `B` is positive definite. `Λ` is a real $n \times {h_meig}$ diagonal matrix. The diagonal elements of `Λ` are the eigenvalues of (`A`, `B`) in ascending order. `V` is an $n \times {h_meig}$ orthogonal matrix. `h_meig` is the number of eigenvalues/eigenvectors computed by the routine, `h_meig` is equal to `n` when the whole spectrum (for example, `range` = [`cusolverEigRange_t::CUSOLVER_EIG_RANGE_ALL`]) is requested. The eigenvectors are normalized as follows:
7443    ///
7444    /// ![image5](_images/normalized-eigenvectors.png)
7445    ///
7446    /// The user has to provide working space which is pointed by input parameter `work`. The input parameter `lwork` is size of the working space, and it is returned by `sygvdx_bufferSize()`. Please note that the size in bytes of the working space is equal to `sizeof(<type>) * lwork`.
7447    ///
7448    /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle). If `devInfo = i` (i > 0 and i<=n) and `jobz` = [`cusolverEigMode_t::CUSOLVER_EIG_MODE_NOVECTOR`], `i` off-diagonal elements of an intermediate tridiagonal form did not converge to zero. If `devInfo = n + i` (i > 0), then the leading minor of order `i` of `B` is not positive definite. The factorization of `B` could not be completed and no eigenvalues or eigenvectors were computed.
7449    ///
7450    /// If `jobz` = [`cusolverEigMode_t::CUSOLVER_EIG_MODE_VECTOR`], `A` contains the orthogonal eigenvectors of the matrix `A`. The eigenvectors are computed by divide and conquer algorithm.
7451    ///
7452    /// Please visit [cuSOLVER Library Samples - sygvdx](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/sygvdx) for a code example.
7453    ///
7454    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The operation completed successfully.
7455    ///
7456    /// [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]:   The library was not initialized.
7457    ///
7458    /// [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]:   Invalid parameters were passed (`n<0`, or `lda<max(1,n)`, or `ldb<max(1,n)`, or `itype` is not [`cusolverEigType_t::CUSOLVER_EIG_TYPE_1`] or [`cusolverEigType_t::CUSOLVER_EIG_TYPE_2`] or [`cusolverEigType_t::CUSOLVER_EIG_TYPE_3`] or `jobz` is not [`cusolverEigMode_t::CUSOLVER_EIG_MODE_NOVECTOR`] or `CUSOLVER_EIG_MODE_VECTORL`, or `range` is not [`cusolverEigRange_t::CUSOLVER_EIG_RANGE_ALL`] or [`cusolverEigRange_t::CUSOLVER_EIG_RANGE_V`] or [`cusolverEigRange_t::CUSOLVER_EIG_RANGE_I`], or `uplo` is not [`cublasFillMode_t::CUBLAS_FILL_MODE_LOWER`] or [`cublasFillMode_t::CUBLAS_FILL_MODE_UPPER`]).
7459    ///
7460    /// [`cusolverStatus_t::CUSOLVER_STATUS_ARCH_MISMATCH`]:   The device only supports compute capability 5.0 and above.
7461    ///
7462    /// [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]:   An internal operation failed.
7463    pub fn cusolverDnDsygvdx(
7464        handle: cusolverDnHandle_t,
7465        itype: cusolverEigType_t,
7466        jobz: cusolverEigMode_t,
7467        range: cusolverEigRange_t,
7468        uplo: cublasFillMode_t,
7469        n: ::core::ffi::c_int,
7470        A: *mut f64,
7471        lda: ::core::ffi::c_int,
7472        B: *mut f64,
7473        ldb: ::core::ffi::c_int,
7474        vl: f64,
7475        vu: f64,
7476        il: ::core::ffi::c_int,
7477        iu: ::core::ffi::c_int,
7478        meig: *mut ::core::ffi::c_int,
7479        W: *mut f64,
7480        work: *mut f64,
7481        lwork: ::core::ffi::c_int,
7482        info: *mut ::core::ffi::c_int,
7483    ) -> cusolverStatus_t;
7484}
7485unsafe extern "C" {
7486    pub fn cusolverDnChegvdx(
7487        handle: cusolverDnHandle_t,
7488        itype: cusolverEigType_t,
7489        jobz: cusolverEigMode_t,
7490        range: cusolverEigRange_t,
7491        uplo: cublasFillMode_t,
7492        n: ::core::ffi::c_int,
7493        A: *mut cuComplex,
7494        lda: ::core::ffi::c_int,
7495        B: *mut cuComplex,
7496        ldb: ::core::ffi::c_int,
7497        vl: f32,
7498        vu: f32,
7499        il: ::core::ffi::c_int,
7500        iu: ::core::ffi::c_int,
7501        meig: *mut ::core::ffi::c_int,
7502        W: *mut f32,
7503        work: *mut cuComplex,
7504        lwork: ::core::ffi::c_int,
7505        info: *mut ::core::ffi::c_int,
7506    ) -> cusolverStatus_t;
7507}
7508unsafe extern "C" {
7509    pub fn cusolverDnZhegvdx(
7510        handle: cusolverDnHandle_t,
7511        itype: cusolverEigType_t,
7512        jobz: cusolverEigMode_t,
7513        range: cusolverEigRange_t,
7514        uplo: cublasFillMode_t,
7515        n: ::core::ffi::c_int,
7516        A: *mut cuDoubleComplex,
7517        lda: ::core::ffi::c_int,
7518        B: *mut cuDoubleComplex,
7519        ldb: ::core::ffi::c_int,
7520        vl: f64,
7521        vu: f64,
7522        il: ::core::ffi::c_int,
7523        iu: ::core::ffi::c_int,
7524        meig: *mut ::core::ffi::c_int,
7525        W: *mut f64,
7526        work: *mut cuDoubleComplex,
7527        lwork: ::core::ffi::c_int,
7528        info: *mut ::core::ffi::c_int,
7529    ) -> cusolverStatus_t;
7530}
7531unsafe extern "C" {
7532    pub fn cusolverDnSsygvd_bufferSize(
7533        handle: cusolverDnHandle_t,
7534        itype: cusolverEigType_t,
7535        jobz: cusolverEigMode_t,
7536        uplo: cublasFillMode_t,
7537        n: ::core::ffi::c_int,
7538        A: *const f32,
7539        lda: ::core::ffi::c_int,
7540        B: *const f32,
7541        ldb: ::core::ffi::c_int,
7542        W: *const f32,
7543        lwork: *mut ::core::ffi::c_int,
7544    ) -> cusolverStatus_t;
7545}
7546unsafe extern "C" {
7547    pub fn cusolverDnDsygvd_bufferSize(
7548        handle: cusolverDnHandle_t,
7549        itype: cusolverEigType_t,
7550        jobz: cusolverEigMode_t,
7551        uplo: cublasFillMode_t,
7552        n: ::core::ffi::c_int,
7553        A: *const f64,
7554        lda: ::core::ffi::c_int,
7555        B: *const f64,
7556        ldb: ::core::ffi::c_int,
7557        W: *const f64,
7558        lwork: *mut ::core::ffi::c_int,
7559    ) -> cusolverStatus_t;
7560}
7561unsafe extern "C" {
7562    pub fn cusolverDnChegvd_bufferSize(
7563        handle: cusolverDnHandle_t,
7564        itype: cusolverEigType_t,
7565        jobz: cusolverEigMode_t,
7566        uplo: cublasFillMode_t,
7567        n: ::core::ffi::c_int,
7568        A: *const cuComplex,
7569        lda: ::core::ffi::c_int,
7570        B: *const cuComplex,
7571        ldb: ::core::ffi::c_int,
7572        W: *const f32,
7573        lwork: *mut ::core::ffi::c_int,
7574    ) -> cusolverStatus_t;
7575}
7576unsafe extern "C" {
7577    pub fn cusolverDnZhegvd_bufferSize(
7578        handle: cusolverDnHandle_t,
7579        itype: cusolverEigType_t,
7580        jobz: cusolverEigMode_t,
7581        uplo: cublasFillMode_t,
7582        n: ::core::ffi::c_int,
7583        A: *const cuDoubleComplex,
7584        lda: ::core::ffi::c_int,
7585        B: *const cuDoubleComplex,
7586        ldb: ::core::ffi::c_int,
7587        W: *const f64,
7588        lwork: *mut ::core::ffi::c_int,
7589    ) -> cusolverStatus_t;
7590}
7591unsafe extern "C" {
7592    /// The helper functions below can calculate the sizes needed for pre-allocated buffer.
7593    ///
7594    /// The S and D data types are real valued single and double precision, respectively.
7595    ///
7596    /// The C and Z data types are complex valued single and double precision, respectively.
7597    ///
7598    /// This function computes eigenvalues and eigenvectors of a symmetric (Hermitian) $n \times n$ matrix-pair (`A`,`B`). The generalized symmetric-definite eigenvalue problem is
7599    ///
7600    /// ![image4](_images/eig-a-b-itype.png)
7601    ///
7602    /// where the matrix `B` is positive definite. `Λ` is a real $n \times n$ diagonal matrix. The diagonal elements of `Λ` are the eigenvalues of (`A`, `B`) in ascending order. `V` is an $n \times n$ orthogonal matrix. The eigenvectors are normalized as follows:
7603    ///
7604    /// ![image5](_images/normalized-eigenvectors.png)
7605    ///
7606    /// The user has to provide working space which is pointed by input parameter `work`. The input parameter `lwork` is size of the working space, and it is returned by `sygvd_bufferSize()`. Please note that the size in bytes of the working space is equal to `sizeof(<type>) * lwork`.
7607    ///
7608    /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle). If `devInfo = i` (i > 0 and i<=n) and `jobz` = [`cusolverEigMode_t::CUSOLVER_EIG_MODE_NOVECTOR`], `i` off-diagonal elements of an intermediate tridiagonal form did not converge to zero. If `devInfo = N + i` (i > 0), then the leading minor of order `i` of `B` is not positive definite. The factorization of `B` could not be completed and no eigenvalues or eigenvectors were computed.
7609    ///
7610    /// if `jobz` = [`cusolverEigMode_t::CUSOLVER_EIG_MODE_VECTOR`], `A` contains the orthogonal eigenvectors of the matrix `A`. The eigenvectors are computed by divide and conquer algorithm.
7611    ///
7612    /// Please visit [cuSOLVER Library Samples - sygvd](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/sygvd) for a code example.
7613    ///
7614    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The operation completed successfully.
7615    ///
7616    /// [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]:   The library was not initialized.
7617    ///
7618    /// [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]:   Invalid parameters were passed (`n<0`, or `lda<max(1,n)`, or `ldb<max(1,n)`, or `itype` is not 1, 2 or 3, or `jobz` is not [`cusolverEigMode_t::CUSOLVER_EIG_MODE_NOVECTOR`] or [`cusolverEigMode_t::CUSOLVER_EIG_MODE_VECTOR`], or `uplo` is not [`cublasFillMode_t::CUBLAS_FILL_MODE_LOWER`] or [`cublasFillMode_t::CUBLAS_FILL_MODE_UPPER`]).
7619    ///
7620    /// [`cusolverStatus_t::CUSOLVER_STATUS_ARCH_MISMATCH`]:   The device only supports compute capability 5.0 and above.
7621    ///
7622    /// [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]:   An internal operation failed.
7623    pub fn cusolverDnSsygvd(
7624        handle: cusolverDnHandle_t,
7625        itype: cusolverEigType_t,
7626        jobz: cusolverEigMode_t,
7627        uplo: cublasFillMode_t,
7628        n: ::core::ffi::c_int,
7629        A: *mut f32,
7630        lda: ::core::ffi::c_int,
7631        B: *mut f32,
7632        ldb: ::core::ffi::c_int,
7633        W: *mut f32,
7634        work: *mut f32,
7635        lwork: ::core::ffi::c_int,
7636        info: *mut ::core::ffi::c_int,
7637    ) -> cusolverStatus_t;
7638}
7639unsafe extern "C" {
7640    /// The helper functions below can calculate the sizes needed for pre-allocated buffer.
7641    ///
7642    /// The S and D data types are real valued single and double precision, respectively.
7643    ///
7644    /// The C and Z data types are complex valued single and double precision, respectively.
7645    ///
7646    /// This function computes eigenvalues and eigenvectors of a symmetric (Hermitian) $n \times n$ matrix-pair (`A`,`B`). The generalized symmetric-definite eigenvalue problem is
7647    ///
7648    /// ![image4](_images/eig-a-b-itype.png)
7649    ///
7650    /// where the matrix `B` is positive definite. `Λ` is a real $n \times n$ diagonal matrix. The diagonal elements of `Λ` are the eigenvalues of (`A`, `B`) in ascending order. `V` is an $n \times n$ orthogonal matrix. The eigenvectors are normalized as follows:
7651    ///
7652    /// ![image5](_images/normalized-eigenvectors.png)
7653    ///
7654    /// The user has to provide working space which is pointed by input parameter `work`. The input parameter `lwork` is size of the working space, and it is returned by `sygvd_bufferSize()`. Please note that the size in bytes of the working space is equal to `sizeof(<type>) * lwork`.
7655    ///
7656    /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle). If `devInfo = i` (i > 0 and i<=n) and `jobz` = [`cusolverEigMode_t::CUSOLVER_EIG_MODE_NOVECTOR`], `i` off-diagonal elements of an intermediate tridiagonal form did not converge to zero. If `devInfo = N + i` (i > 0), then the leading minor of order `i` of `B` is not positive definite. The factorization of `B` could not be completed and no eigenvalues or eigenvectors were computed.
7657    ///
7658    /// if `jobz` = [`cusolverEigMode_t::CUSOLVER_EIG_MODE_VECTOR`], `A` contains the orthogonal eigenvectors of the matrix `A`. The eigenvectors are computed by divide and conquer algorithm.
7659    ///
7660    /// Please visit [cuSOLVER Library Samples - sygvd](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/sygvd) for a code example.
7661    ///
7662    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The operation completed successfully.
7663    ///
7664    /// [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]:   The library was not initialized.
7665    ///
7666    /// [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]:   Invalid parameters were passed (`n<0`, or `lda<max(1,n)`, or `ldb<max(1,n)`, or `itype` is not 1, 2 or 3, or `jobz` is not [`cusolverEigMode_t::CUSOLVER_EIG_MODE_NOVECTOR`] or [`cusolverEigMode_t::CUSOLVER_EIG_MODE_VECTOR`], or `uplo` is not [`cublasFillMode_t::CUBLAS_FILL_MODE_LOWER`] or [`cublasFillMode_t::CUBLAS_FILL_MODE_UPPER`]).
7667    ///
7668    /// [`cusolverStatus_t::CUSOLVER_STATUS_ARCH_MISMATCH`]:   The device only supports compute capability 5.0 and above.
7669    ///
7670    /// [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]:   An internal operation failed.
7671    pub fn cusolverDnDsygvd(
7672        handle: cusolverDnHandle_t,
7673        itype: cusolverEigType_t,
7674        jobz: cusolverEigMode_t,
7675        uplo: cublasFillMode_t,
7676        n: ::core::ffi::c_int,
7677        A: *mut f64,
7678        lda: ::core::ffi::c_int,
7679        B: *mut f64,
7680        ldb: ::core::ffi::c_int,
7681        W: *mut f64,
7682        work: *mut f64,
7683        lwork: ::core::ffi::c_int,
7684        info: *mut ::core::ffi::c_int,
7685    ) -> cusolverStatus_t;
7686}
7687unsafe extern "C" {
7688    pub fn cusolverDnChegvd(
7689        handle: cusolverDnHandle_t,
7690        itype: cusolverEigType_t,
7691        jobz: cusolverEigMode_t,
7692        uplo: cublasFillMode_t,
7693        n: ::core::ffi::c_int,
7694        A: *mut cuComplex,
7695        lda: ::core::ffi::c_int,
7696        B: *mut cuComplex,
7697        ldb: ::core::ffi::c_int,
7698        W: *mut f32,
7699        work: *mut cuComplex,
7700        lwork: ::core::ffi::c_int,
7701        info: *mut ::core::ffi::c_int,
7702    ) -> cusolverStatus_t;
7703}
7704unsafe extern "C" {
7705    pub fn cusolverDnZhegvd(
7706        handle: cusolverDnHandle_t,
7707        itype: cusolverEigType_t,
7708        jobz: cusolverEigMode_t,
7709        uplo: cublasFillMode_t,
7710        n: ::core::ffi::c_int,
7711        A: *mut cuDoubleComplex,
7712        lda: ::core::ffi::c_int,
7713        B: *mut cuDoubleComplex,
7714        ldb: ::core::ffi::c_int,
7715        W: *mut f64,
7716        work: *mut cuDoubleComplex,
7717        lwork: ::core::ffi::c_int,
7718        info: *mut ::core::ffi::c_int,
7719    ) -> cusolverStatus_t;
7720}
7721unsafe extern "C" {
7722    pub fn cusolverDnXsygvd_bufferSize(
7723        handle: cusolverDnHandle_t,
7724        params: cusolverDnParams_t,
7725        itype: cusolverEigType_t,
7726        jobz: cusolverEigMode_t,
7727        uplo: cublasFillMode_t,
7728        n: i64,
7729        dataTypeA: cudaDataType,
7730        d_A: *const ::core::ffi::c_void,
7731        lda: i64,
7732        dataTypeB: cudaDataType,
7733        d_B: *const ::core::ffi::c_void,
7734        ldb: i64,
7735        dataTypeW: cudaDataType,
7736        d_W: *const ::core::ffi::c_void,
7737        computeType: cudaDataType,
7738        workspaceInBytesOnDevice: *mut size_t,
7739        workspaceInBytesOnHost: *mut size_t,
7740    ) -> cusolverStatus_t;
7741}
7742unsafe extern "C" {
7743    /// The helper functions below can calculate the sizes needed for pre-allocated buffer.
7744    ///
7745    /// The following routine computes all the eigenvalues, and optionally, the eigenvectors of a generalized symmetric (Hermitian) definite eigenproblem.
7746    ///
7747    /// The generalized symmetric (Hermitian) definite eigenvalue problem is
7748    ///
7749    /// ![image4](_images/eig-a-b-itype.png)
7750    ///
7751    /// where the matrix `A` and `B` are $n \times n$; A is symmetric/Hermitian and B is symmetrix/Hermitian positive definite. The eigenvalues of (`A`, `B`) are computed and stored in the `W` vector in ascending order. `V` is an $n \times n$ orthogonal matrix. The eigenvectors are normalized as follows:v
7752    ///
7753    /// ![image5](_images/normalized-eigenvectors.png)
7754    ///
7755    /// The user has to provide device and host working spaces which are pointed by input parameters `bufferOnDevice` and `bufferOnHost`. The input parameters `workspaceInBytesOnDevice` (and `workspaceInBytesOnHost`) is size in bytes of the device (and host) working space, and it is returned by [`cusolverDnXsygvd_bufferSize`].
7756    ///
7757    /// If output parameter `info = -i` (less than zero), the `i-th` parameter is wrong (not counting handle). If `info = i` (i > 0 and i<=n) and `jobz` = [`cusolverEigMode_t::CUSOLVER_EIG_MODE_NOVECTOR`], `i` off-diagonal elements of an intermediate tridiagonal form did not converge to zero. If `info = n + i` (i > 0), then the leading minor of order `i` of `B` is not positive definite. The factorization of `B` could not be completed and no eigenvalues or eigenvectors were computed.
7758    ///
7759    /// If `jobz` = [`cusolverEigMode_t::CUSOLVER_EIG_MODE_VECTOR`], `A` contains the orthonormal eigenvectors of the matrix `A`. The eigenvectors are computed by a divide and conquer algorithm.
7760    ///
7761    /// Currently, [`cusolverDnXsygvd`] supports only the default algorithm.
7762    ///
7763    /// **Algorithms supported by cusolverDnXsygvd**
7764    ///
7765    /// |  |  |
7766    /// | --- | --- |
7767    /// | [`cusolverAlgMode_t::CUSOLVER_ALG_0`] or `NULL` | Default algorithm. |
7768    ///
7769    /// List of input arguments for [`cusolverDnXsygvd_bufferSize`] and [`cusolverDnXsygvd`]:
7770    ///
7771    /// The generic API has four different data types, `dataTypeA` is data type of the matrix `A`, `dataTypeB` is data type of the matrix `B`, `dataTypeW` is data type of the matrix `W` and `computeType` is compute type of the operation. [`cusolverDnXsygvd`] only supports the following four combinations.
7772    ///
7773    /// **Valid combination of data type and compute type**
7774    ///
7775    /// | **DataTypeA** | **DataTypeB** | **DataTypeW** | **ComputeType** | **Meaning** |
7776    /// | --- | --- | --- | --- | --- |
7777    /// | `CUDA_R_32F` | `CUDA_R_32F` | `CUDA_R_32F` | `CUDA_R_32F` | `SSYGVD` |
7778    /// | `CUDA_R_64F` | `CUDA_R_64F` | `CUDA_R_64F` | `CUDA_R_64F` | `DSYGVD` |
7779    /// | `CUDA_C_32F` | `CUDA_C_32F` | `CUDA_R_32F` | `CUDA_C_32F` | `CHEGVD` |
7780    /// | `CUDA_C_64F` | `CUDA_C_64F` | `CUDA_R_64F` | `CUDA_C_64F` | `ZHEGVD` |
7781    ///
7782    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The operation completed successfully.
7783    ///
7784    /// [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]:   The library was not initialized.
7785    ///
7786    /// [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]:   Invalid parameters were passed (`n<0`, or `lda<max(1,n)`, or `ldb<max(1,n)`, or `itype` is not 1, 2 or 3, or `jobz` is not [`cusolverEigMode_t::CUSOLVER_EIG_MODE_NOVECTOR`] or [`cusolverEigMode_t::CUSOLVER_EIG_MODE_VECTOR`], or `uplo` is not [`cublasFillMode_t::CUBLAS_FILL_MODE_LOWER`] or [`cublasFillMode_t::CUBLAS_FILL_MODE_UPPER`]), or the combination of `dataType{A,B,C}` and `computeType` are not supported.
7787    ///
7788    /// [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]:   An internal operation failed.
7789    ///
7790    /// # Parameters
7791    ///
7792    /// - `handle`: Handle to the cuSolverDN library context.
7793    /// - `params`: Structure with information collected by [`cusolverDnSetAdvOptions`].
7794    /// - `itype`: Specifies the problem type to be solved:   * `itype`=[`cusolverEigType_t::CUSOLVER_EIG_TYPE_1`]: A\*x = (lambda)\*B\*x. * `itype`=[`cusolverEigType_t::CUSOLVER_EIG_TYPE_2`]: A\*B\*x = (lambda)\*x. * `itype`=[`cusolverEigType_t::CUSOLVER_EIG_TYPE_3`]: B\*A\*x = (lambda)\*x.
7795    /// - `jobz`: Specifies options to either compute eigenvalue only or compute eigen-pair: `jobz` = [`cusolverEigMode_t::CUSOLVER_EIG_MODE_NOVECTOR`]: Compute eigenvalues only; `jobz` = [`cusolverEigMode_t::CUSOLVER_EIG_MODE_VECTOR`]: Compute eigenvalues and eigenvectors.
7796    /// - `uplo`: Specifies which part of `A` is stored. `uplo` = [`cublasFillMode_t::CUBLAS_FILL_MODE_LOWER`]: Lower triangle of `A` is stored. `uplo` = [`cublasFillMode_t::CUBLAS_FILL_MODE_UPPER`]: Upper triangle of `A` is stored.
7797    /// - `n`: Number of rows (or columns) of matrix `A`.
7798    /// - `dataTypeA`: Data type of array `A`.
7799    /// - `lda`: Leading dimension of two-dimensional array used to store matrix `A`.
7800    /// - `dataTypeB`: Data type of array `B`.
7801    /// - `ldb`: Leading dimension of two-dimensional array used to store matrix `B`.
7802    /// - `dataTypeW`: Data type of array `W`.
7803    /// - `computeType`: Data type of computation.
7804    /// - `bufferOnDevice`: Device workspace. Array of type `void` of size `workspaceInBytesOnDevice` bytes.
7805    /// - `workspaceInBytesOnDevice`: Size in bytes of `bufferOnDevice`, returned by [`cusolverDnXsygvd_bufferSize`].
7806    /// - `bufferOnHost`: Host workspace. Array of type `void` of size `workspaceInBytesOnHost` bytes.
7807    /// - `workspaceInBytesOnHost`: Size in bytes of `bufferOnHost`, returned by [`cusolverDnXsygvd_bufferSize`].
7808    ///
7809    /// # Return value
7810    ///
7811    /// - [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]: An internal operation failed.
7812    /// - [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]: Invalid parameters were passed (`n<0`, or `lda<max(1,n)`, or `ldb<max(1,n)`, or `itype` is not 1, 2 or 3, or `jobz` is not [`cusolverEigMode_t::CUSOLVER_EIG_MODE_NOVECTOR`] or [`cusolverEigMode_t::CUSOLVER_EIG_MODE_VECTOR`], or `uplo` is not [`cublasFillMode_t::CUBLAS_FILL_MODE_LOWER`] or [`cublasFillMode_t::CUBLAS_FILL_MODE_UPPER`]), or the combination of `dataType{A,B,C}` and `computeType` are not supported.
7813    /// - [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]: The library was not initialized.
7814    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The operation completed successfully.
7815    pub fn cusolverDnXsygvd(
7816        handle: cusolverDnHandle_t,
7817        params: cusolverDnParams_t,
7818        itype: cusolverEigType_t,
7819        jobz: cusolverEigMode_t,
7820        uplo: cublasFillMode_t,
7821        n: i64,
7822        dataTypeA: cudaDataType,
7823        d_A: *mut ::core::ffi::c_void,
7824        lda: i64,
7825        dataTypeB: cudaDataType,
7826        d_B: *mut ::core::ffi::c_void,
7827        ldb: i64,
7828        dataTypeW: cudaDataType,
7829        d_W: *mut ::core::ffi::c_void,
7830        computeType: cudaDataType,
7831        bufferOnDevice: *mut ::core::ffi::c_void,
7832        workspaceInBytesOnDevice: size_t,
7833        bufferOnHost: *mut ::core::ffi::c_void,
7834        workspaceInBytesOnHost: size_t,
7835        d_info: *mut ::core::ffi::c_int,
7836    ) -> cusolverStatus_t;
7837}
7838unsafe extern "C" {
7839    pub fn cusolverDnXsygvdx_bufferSize(
7840        handle: cusolverDnHandle_t,
7841        params: cusolverDnParams_t,
7842        itype: cusolverEigType_t,
7843        jobz: cusolverEigMode_t,
7844        uplo: cublasFillMode_t,
7845        n: i64,
7846        dataTypeA: cudaDataType,
7847        d_A: *const ::core::ffi::c_void,
7848        lda: i64,
7849        dataTypeB: cudaDataType,
7850        d_B: *const ::core::ffi::c_void,
7851        ldb: i64,
7852        vl: *mut ::core::ffi::c_void,
7853        vu: *mut ::core::ffi::c_void,
7854        il: i64,
7855        iu: i64,
7856        meig: *mut i64,
7857        dataTypeW: cudaDataType,
7858        d_W: *const ::core::ffi::c_void,
7859        computeType: cudaDataType,
7860        workspaceInBytesOnDevice: *mut size_t,
7861        workspaceInBytesOnHost: *mut size_t,
7862    ) -> cusolverStatus_t;
7863}
7864unsafe extern "C" {
7865    /// The helper function below can calculate the sizes needed for pre-allocated buffer.
7866    ///
7867    /// The following routine computes all or selection of the eigenvalues, and optionally, the eigenvectors of a generalized symmetric (Hermitian) definite eigenproblem.
7868    ///
7869    /// The generalized symmetric-definite eigenvalue problem is
7870    ///
7871    /// ![image4](_images/eig-a-b-itype.png)
7872    ///
7873    /// where the matrix `A` and `B` are $n \times n$; A is symmetric/Hermitian and B is symmetrix/Hermitian positive definite. The eigenvalues of (`A`, `B`) are computed and stored in the `W` vector in ascending order. `h_meig` represents the number of eigenvalues/eigenvectors computed by the routine, `h_meig` is equal to `n` when the whole spectrum (for example, `range` = [`cusolverEigRange_t::CUSOLVER_EIG_RANGE_ALL`]) is requested. `V` is an $n \times n$ orthogonal matrix. The eigenvectors are normalized as follows:
7874    ///
7875    /// ![image5](_images/normalized-eigenvectors.png)
7876    ///
7877    /// The user has to provide device and host working spaces which are pointed by input parameters `bufferOnDevice` and `bufferOnHost`. The input parameters `workspaceInBytesOnDevice` (and `workspaceInBytesOnHost`) is size in bytes of the device (and host) working space, and it is returned by [`cusolverDnXsygvdx_bufferSize`].
7878    ///
7879    /// If output parameter `info = -i` (less than zero), the `i-th` parameter is wrong (not counting handle). If `info = i` (i > 0 and i<=n) and `jobz` = [`cusolverEigMode_t::CUSOLVER_EIG_MODE_NOVECTOR`], `i` off-diagonal elements of an intermediate tridiagonal form did not converge to zero. If `info = n + i` (i > 0), then the leading minor of order `i` of `B` is not positive definite. The factorization of `B` could not be completed and no eigenvalues or eigenvectors were computed.
7880    ///
7881    /// If `jobz` = [`cusolverEigMode_t::CUSOLVER_EIG_MODE_VECTOR`], `A` contains the orthogonal eigenvectors of the matrix `A`. The eigenvectors are computed by divide and conquer algorithm.
7882    ///
7883    /// **Algorithms supported by cusolverDnXsygvdx**
7884    ///
7885    /// |  |  |
7886    /// | --- | --- |
7887    /// | [`cusolverAlgMode_t::CUSOLVER_ALG_0`] or `NULL` | Default algorithm. |
7888    ///
7889    /// List of input arguments for [`cusolverDnXsygvdx_bufferSize`] and [`cusolverDnXsygvdx`]:
7890    ///
7891    /// The generic API has four different types, `dataTypeA` is data type of the matrix `A`, `dataTypeB` is data type of the matrix `B`, `dataTypeW` is data type of the matrix `W` and `computeType` is compute type of the operation. [`cusolverDnXsygvdx`] only supports the following four combinations:
7892    ///
7893    /// **Valid combination of data type and compute type**
7894    ///
7895    /// | **DataTypeA** | **DataTypeB** | **DataTypeW** | **ComputeType** | **Meaning** |
7896    /// | --- | --- | --- | --- | --- |
7897    /// | `CUDA_R_32F` | `CUDA_R_32F` | `CUDA_R_32F` | `CUDA_R_32F` | `SSYGVDX` |
7898    /// | `CUDA_R_64F` | `CUDA_R_64F` | `CUDA_R_64F` | `CUDA_R_64F` | `DSYGVDX` |
7899    /// | `CUDA_C_32F` | `CUDA_C_32F` | `CUDA_R_32F` | `CUDA_C_32F` | `CHEGVDX` |
7900    /// | `CUDA_C_64F` | `CUDA_C_64F` | `CUDA_R_64F` | `CUDA_C_64F` | `ZHEGVDX` |
7901    ///
7902    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The operation completed successfully.
7903    ///
7904    /// [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]:   The library was not initialized.
7905    ///
7906    /// [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]:   Invalid parameters were passed (`n<0`, or `lda<max(1,n)`, or `ldb<max(1,n)`, or `itype` is not 1, 2 or 3, or `jobz` is not [`cusolverEigMode_t::CUSOLVER_EIG_MODE_NOVECTOR`] or [`cusolverEigMode_t::CUSOLVER_EIG_MODE_VECTOR`], or `range` is not [`cusolverEigRange_t::CUSOLVER_EIG_RANGE_ALL`] or [`cusolverEigRange_t::CUSOLVER_EIG_RANGE_V`] or [`cusolverEigRange_t::CUSOLVER_EIG_RANGE_I`], or `uplo` is not [`cublasFillMode_t::CUBLAS_FILL_MODE_LOWER`] or [`cublasFillMode_t::CUBLAS_FILL_MODE_UPPER`]), or the combination of `dataType{A,B,C}` and `computeType` are not supported.
7907    ///
7908    /// [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]:   An internal operation failed.
7909    ///
7910    /// # Parameters
7911    ///
7912    /// - `handle`: Handle to the cuSolverDN library context.
7913    /// - `params`: Structure with information collected by [`cusolverDnSetAdvOptions`].
7914    /// - `itype`: Specifies the problem type to be solved:   * `itype`=[`cusolverEigType_t::CUSOLVER_EIG_TYPE_1`]: A\*x = (lambda)\*B\*x. * `itype`=[`cusolverEigType_t::CUSOLVER_EIG_TYPE_2`]: A\*B\*x = (lambda)\*x. * `itype`=[`cusolverEigType_t::CUSOLVER_EIG_TYPE_3`]: B\*A\*x = (lambda)\*x.
7915    /// - `jobz`: Specifies options to either compute eigenvalue only or compute eigen-pair: `jobz` = [`cusolverEigMode_t::CUSOLVER_EIG_MODE_NOVECTOR`]: Compute eigenvalues only; `jobz` = [`cusolverEigMode_t::CUSOLVER_EIG_MODE_VECTOR`]: Compute eigenvalues and eigenvectors.
7916    /// - `range`: Specifies options to which selection of eigenvalues and optionally eigenvectors that need to be computed: `range` = [`cusolverEigRange_t::CUSOLVER_EIG_RANGE_ALL`]: all eigenvalues/eigenvectors will be found, will becomes the classical sygvd/hegvd routine; `range` = [`cusolverEigRange_t::CUSOLVER_EIG_RANGE_V`]: all eigenvalues/eigenvectors in the half-open interval (vl,vu] will be found; `range` = [`cusolverEigRange_t::CUSOLVER_EIG_RANGE_I`]: the il-th through iu-th eigenvalues/eigenvectors will be found;.
7917    /// - `uplo`: Specifies which part of `A` is stored. `uplo` = [`cublasFillMode_t::CUBLAS_FILL_MODE_LOWER`]: Lower triangle of `A` is stored. `uplo` = [`cublasFillMode_t::CUBLAS_FILL_MODE_UPPER`]: Upper triangle of `A` is stored.
7918    /// - `n`: Number of rows (or columns) of matrix `A`.
7919    /// - `dataTypeA`: Data type of array `A`.
7920    /// - `lda`: Leading dimension of two-dimensional array used to store matrix `A`.`lda` is not less than`max(1,n)`.
7921    /// - `dataTypeB`: Data type of array `B`.
7922    /// - `ldb`: Leading dimension of two-dimensional array used to store matrix `B`.
7923    /// - `dataTypeW`: Data type of array `W`.
7924    /// - `computeType`: Data type of computation.
7925    /// - `bufferOnDevice`: Device workspace. Array of type `void` of size `workspaceInBytesOnDevice` bytes.
7926    /// - `workspaceInBytesOnDevice`: Size in bytes of `bufferOnDevice`, returned by [`cusolverDnXsygvdx_bufferSize`].
7927    /// - `bufferOnHost`: Host workspace. Array of type `void` of size `workspaceInBytesOnHost` bytes.
7928    /// - `workspaceInBytesOnHost`: Size in bytes of `bufferOnHost`, returned by [`cusolverDnXsygvdx_bufferSize`].
7929    ///
7930    /// # Return value
7931    ///
7932    /// - [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]: An internal operation failed.
7933    /// - [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]: Invalid parameters were passed (`n<0`, or `lda<max(1,n)`, or `ldb<max(1,n)`, or `itype` is not 1, 2 or 3, or `jobz` is not [`cusolverEigMode_t::CUSOLVER_EIG_MODE_NOVECTOR`] or [`cusolverEigMode_t::CUSOLVER_EIG_MODE_VECTOR`], or `range` is not [`cusolverEigRange_t::CUSOLVER_EIG_RANGE_ALL`] or [`cusolverEigRange_t::CUSOLVER_EIG_RANGE_V`] or [`cusolverEigRange_t::CUSOLVER_EIG_RANGE_I`], or `uplo` is not [`cublasFillMode_t::CUBLAS_FILL_MODE_LOWER`] or [`cublasFillMode_t::CUBLAS_FILL_MODE_UPPER`]), or the combination of `dataType{A,B,C}` and `computeType` are not supported.
7934    /// - [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]: The library was not initialized.
7935    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The operation completed successfully.
7936    pub fn cusolverDnXsygvdx(
7937        handle: cusolverDnHandle_t,
7938        params: cusolverDnParams_t,
7939        itype: cusolverEigType_t,
7940        jobz: cusolverEigMode_t,
7941        range: cusolverEigRange_t,
7942        uplo: cublasFillMode_t,
7943        n: i64,
7944        dataTypeA: cudaDataType,
7945        d_A: *mut ::core::ffi::c_void,
7946        lda: i64,
7947        dataTypeB: cudaDataType,
7948        d_B: *mut ::core::ffi::c_void,
7949        ldb: i64,
7950        vl: *mut ::core::ffi::c_void,
7951        vu: *mut ::core::ffi::c_void,
7952        il: i64,
7953        iu: i64,
7954        meig: *mut i64,
7955        dataTypeW: cudaDataType,
7956        d_W: *mut ::core::ffi::c_void,
7957        computeType: cudaDataType,
7958        bufferOnDevice: *mut ::core::ffi::c_void,
7959        workspaceInBytesOnDevice: size_t,
7960        bufferOnHost: *mut ::core::ffi::c_void,
7961        workspaceInBytesOnHost: size_t,
7962        d_info: *mut ::core::ffi::c_int,
7963    ) -> cusolverStatus_t;
7964}
7965unsafe extern "C" {
7966    /// This function creates and initializes the structure of `syevj`, `syevjBatched` and `sygvj` to default values.
7967    ///
7968    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The structure was initialized successfully.
7969    ///
7970    /// [`cusolverStatus_t::CUSOLVER_STATUS_ALLOC_FAILED`]:   The resources could not be allocated.
7971    ///
7972    /// # Parameters
7973    ///
7974    /// - `info`: The pointer to the structure of `syevj`.
7975    ///
7976    /// # Return value
7977    ///
7978    /// - [`cusolverStatus_t::CUSOLVER_STATUS_ALLOC_FAILED`]: The resources could not be allocated.
7979    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The structure was initialized successfully.
7980    pub fn cusolverDnCreateSyevjInfo(info: *mut syevjInfo_t) -> cusolverStatus_t;
7981}
7982unsafe extern "C" {
7983    /// This function destroys and releases any memory required by the structure.
7984    ///
7985    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The resources were released successfully.
7986    ///
7987    /// # Parameters
7988    ///
7989    /// - `info`: The structure of `syevj`.
7990    ///
7991    /// # Return value
7992    ///
7993    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The resources were released successfully.
7994    pub fn cusolverDnDestroySyevjInfo(info: syevjInfo_t) -> cusolverStatus_t;
7995}
7996unsafe extern "C" {
7997    /// This function configures tolerance of `syevj`.
7998    ///
7999    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The operation completed successfully.
8000    ///
8001    /// # Parameters
8002    ///
8003    /// - `info`: The pointer to the structure of `syevj`.
8004    /// - `tolerance`: Accuracy of numerical eigenvalues.
8005    ///
8006    /// # Return value
8007    ///
8008    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The operation completed successfully.
8009    pub fn cusolverDnXsyevjSetTolerance(
8010        info: syevjInfo_t,
8011        tolerance: f64,
8012    ) -> cusolverStatus_t;
8013}
8014unsafe extern "C" {
8015    /// This function configures maximum number of sweeps in `syevj`. The default value is 100.
8016    ///
8017    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The operation completed successfully.
8018    ///
8019    /// # Parameters
8020    ///
8021    /// - `info`: The pointer to the structure of `syevj`.
8022    /// - `max_sweeps`: Maximum number of sweeps.
8023    ///
8024    /// # Return value
8025    ///
8026    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The operation completed successfully.
8027    pub fn cusolverDnXsyevjSetMaxSweeps(
8028        info: syevjInfo_t,
8029        max_sweeps: ::core::ffi::c_int,
8030    ) -> cusolverStatus_t;
8031}
8032unsafe extern "C" {
8033    /// If `sort_eig` is zero, the eigenvalues are not sorted. This function only works for `syevjBatched`. `syevj` and `sygvj` always sort eigenvalues in ascending order. By default, eigenvalues are always sorted in ascending order.
8034    ///
8035    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The operation completed successfully.
8036    ///
8037    /// # Parameters
8038    ///
8039    /// - `info`: The pointer to the structure of syevj.
8040    /// - `sort_eig`: If `sort_eig` is zero, the eigenvalues are not sorted.
8041    ///
8042    /// # Return value
8043    ///
8044    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The operation completed successfully.
8045    pub fn cusolverDnXsyevjSetSortEig(
8046        info: syevjInfo_t,
8047        sort_eig: ::core::ffi::c_int,
8048    ) -> cusolverStatus_t;
8049}
8050unsafe extern "C" {
8051    /// This function reports residual of `syevj` or `sygvj`. It does not support `syevjBatched`. If the user calls this function after `syevjBatched`, the error [`cusolverStatus_t::CUSOLVER_STATUS_NOT_SUPPORTED`] is returned.
8052    ///
8053    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The operation completed successfully.
8054    ///
8055    /// [`cusolverStatus_t::CUSOLVER_STATUS_NOT_SUPPORTED`]:   Does not support batched version.
8056    ///
8057    /// # Parameters
8058    ///
8059    /// - `handle`: Handle to the cuSolverDN library context.
8060    /// - `info`: The pointer to the structure of `syevj`.
8061    /// - `residual`: Residual of `syevj`.
8062    ///
8063    /// # Return value
8064    ///
8065    /// - [`cusolverStatus_t::CUSOLVER_STATUS_NOT_SUPPORTED`]: Does not support batched version.
8066    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The operation completed successfully.
8067    pub fn cusolverDnXsyevjGetResidual(
8068        handle: cusolverDnHandle_t,
8069        info: syevjInfo_t,
8070        residual: *mut f64,
8071    ) -> cusolverStatus_t;
8072}
8073unsafe extern "C" {
8074    /// This function reports number of executed sweeps of `syevj` or `sygvj`. It does not support `syevjBatched`. If the user calls this function after `syevjBatched`, the error [`cusolverStatus_t::CUSOLVER_STATUS_NOT_SUPPORTED`] is returned.
8075    ///
8076    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The operation completed successfully.
8077    ///
8078    /// [`cusolverStatus_t::CUSOLVER_STATUS_NOT_SUPPORTED`]:   Does not support batched version.
8079    ///
8080    /// # Parameters
8081    ///
8082    /// - `handle`: Handle to the cuSolverDN library context.
8083    /// - `info`: The pointer to the structure of `syevj`.
8084    /// - `executed_sweeps`: Number of executed sweeps.
8085    ///
8086    /// # Return value
8087    ///
8088    /// - [`cusolverStatus_t::CUSOLVER_STATUS_NOT_SUPPORTED`]: Does not support batched version.
8089    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The operation completed successfully.
8090    pub fn cusolverDnXsyevjGetSweeps(
8091        handle: cusolverDnHandle_t,
8092        info: syevjInfo_t,
8093        executed_sweeps: *mut ::core::ffi::c_int,
8094    ) -> cusolverStatus_t;
8095}
8096unsafe extern "C" {
8097    pub fn cusolverDnSsyevjBatched_bufferSize(
8098        handle: cusolverDnHandle_t,
8099        jobz: cusolverEigMode_t,
8100        uplo: cublasFillMode_t,
8101        n: ::core::ffi::c_int,
8102        A: *const f32,
8103        lda: ::core::ffi::c_int,
8104        W: *const f32,
8105        lwork: *mut ::core::ffi::c_int,
8106        params: syevjInfo_t,
8107        batchSize: ::core::ffi::c_int,
8108    ) -> cusolverStatus_t;
8109}
8110unsafe extern "C" {
8111    pub fn cusolverDnDsyevjBatched_bufferSize(
8112        handle: cusolverDnHandle_t,
8113        jobz: cusolverEigMode_t,
8114        uplo: cublasFillMode_t,
8115        n: ::core::ffi::c_int,
8116        A: *const f64,
8117        lda: ::core::ffi::c_int,
8118        W: *const f64,
8119        lwork: *mut ::core::ffi::c_int,
8120        params: syevjInfo_t,
8121        batchSize: ::core::ffi::c_int,
8122    ) -> cusolverStatus_t;
8123}
8124unsafe extern "C" {
8125    pub fn cusolverDnCheevjBatched_bufferSize(
8126        handle: cusolverDnHandle_t,
8127        jobz: cusolverEigMode_t,
8128        uplo: cublasFillMode_t,
8129        n: ::core::ffi::c_int,
8130        A: *const cuComplex,
8131        lda: ::core::ffi::c_int,
8132        W: *const f32,
8133        lwork: *mut ::core::ffi::c_int,
8134        params: syevjInfo_t,
8135        batchSize: ::core::ffi::c_int,
8136    ) -> cusolverStatus_t;
8137}
8138unsafe extern "C" {
8139    pub fn cusolverDnZheevjBatched_bufferSize(
8140        handle: cusolverDnHandle_t,
8141        jobz: cusolverEigMode_t,
8142        uplo: cublasFillMode_t,
8143        n: ::core::ffi::c_int,
8144        A: *const cuDoubleComplex,
8145        lda: ::core::ffi::c_int,
8146        W: *const f64,
8147        lwork: *mut ::core::ffi::c_int,
8148        params: syevjInfo_t,
8149        batchSize: ::core::ffi::c_int,
8150    ) -> cusolverStatus_t;
8151}
8152unsafe extern "C" {
8153    /// The helper functions below can calculate the sizes needed for pre-allocated buffer.
8154    ///
8155    /// The S and D data types are real valued single and double precision, respectively.
8156    ///
8157    /// The C and Z data types are complex valued single and double precision, respectively.
8158    ///
8159    /// This function computes eigenvalues and eigenvectors of a sequence of symmetric (Hermitian) $n \times n$ matrices:
8160    ///
8161    /// $$
8162    /// A_{j}\\*Q_{j} = Q_{j}\\*\Lambda_{j}
8163    /// $$
8164    /// where $\Lambda_{j}$ is a real $n \times n$ diagonal matrix. $Q_j$ is an $n \times n$ unitary matrix. The diagonal elements of $\Lambda_j$ are the eigenvalues of $A_j$ in either ascending order or non-sorting order.
8165    ///
8166    /// `syevjBatched` performs `syevj` on each matrix. It requires that all matrices are of the same size `n` and are packed in contiguous way,
8167    ///
8168    /// $$
8169    /// \begin{split}A = \begin{pmatrix}
8170    /// {A0} & {A1} & \cdots \\\\
8171    /// \end{pmatrix}\end{split}
8172    /// $$
8173    /// Each matrix is column-major with leading dimension `lda`, so the formula for random access is $A_{k}\operatorname{(i,j)} = {A\lbrack\ i\ +\ lda\\*j\ +\ lda\\*n\\*k\rbrack}$.
8174    ///
8175    /// The parameter `W` also contains eigenvalues of each matrix in contiguous way,
8176    ///
8177    /// $$
8178    /// \begin{split}W = \begin{pmatrix}
8179    /// {W0} & {W1} & \cdots \\\\
8180    /// \end{pmatrix}\end{split}
8181    /// $$
8182    /// The formula for random access of `W` is $W_{k}\operatorname{(j)} = {W\lbrack\ j\ +\ n\\*k\rbrack}$.
8183    ///
8184    /// Except for tolerance and maximum sweeps, `syevjBatched` can either sort the eigenvalues in ascending order (default) or chose as-is (without sorting) by the function [`cusolverDnXsyevjSetSortEig`]. If the user packs several tiny matrices into diagonal blocks of one matrix, non-sorting option can separate spectrum of those tiny matrices.
8185    ///
8186    /// `syevjBatched` cannot report residual and executed sweeps by function [`cusolverDnXsyevjGetResidual`] and [`cusolverDnXsyevjGetSweeps`]. Any call of the above two returns [`cusolverStatus_t::CUSOLVER_STATUS_NOT_SUPPORTED`]. The user needs to compute residual explicitly.
8187    ///
8188    /// The user has to provide working space pointed by input parameter `work`. The input parameter `lwork` is the size of the working space, and it is returned by `syevjBatched_bufferSize()`. Please note that the size in bytes of the working space is equal to `sizeof(<type>) * lwork`.
8189    ///
8190    /// The output parameter `info` is an integer array of size `batchSize`. If the function returns [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`], the first element `info[0] = -i` (less than zero) indicates `i-th` parameter is wrong (not counting handle). Otherwise, if `info[i] = n+1`, `syevjBatched` does not converge on `i-th` matrix under given tolerance and maximum sweeps.
8191    ///
8192    /// If `jobz` = [`cusolverEigMode_t::CUSOLVER_EIG_MODE_VECTOR`], $A_j$ contains the orthonormal eigenvectors $V_j$.
8193    ///
8194    /// Please visit [cuSOLVER Library Samples - syevjBatched](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/syevjBatched) for a code example.
8195    ///
8196    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The operation completed successfully.
8197    ///
8198    /// [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]:   The library was not initialized.
8199    ///
8200    /// [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]:   Invalid parameters were passed (`n<0`, or `lda<max(1,n)`, or `jobz` is not [`cusolverEigMode_t::CUSOLVER_EIG_MODE_NOVECTOR`] or [`cusolverEigMode_t::CUSOLVER_EIG_MODE_VECTOR`], or `uplo` is not [`cublasFillMode_t::CUBLAS_FILL_MODE_LOWER`] or [`cublasFillMode_t::CUBLAS_FILL_MODE_UPPER`]), or `batchSize<0`.
8201    ///
8202    /// [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]:   An internal operation failed.
8203    pub fn cusolverDnSsyevjBatched(
8204        handle: cusolverDnHandle_t,
8205        jobz: cusolverEigMode_t,
8206        uplo: cublasFillMode_t,
8207        n: ::core::ffi::c_int,
8208        A: *mut f32,
8209        lda: ::core::ffi::c_int,
8210        W: *mut f32,
8211        work: *mut f32,
8212        lwork: ::core::ffi::c_int,
8213        info: *mut ::core::ffi::c_int,
8214        params: syevjInfo_t,
8215        batchSize: ::core::ffi::c_int,
8216    ) -> cusolverStatus_t;
8217}
8218unsafe extern "C" {
8219    /// The helper functions below can calculate the sizes needed for pre-allocated buffer.
8220    ///
8221    /// The S and D data types are real valued single and double precision, respectively.
8222    ///
8223    /// The C and Z data types are complex valued single and double precision, respectively.
8224    ///
8225    /// This function computes eigenvalues and eigenvectors of a sequence of symmetric (Hermitian) $n \times n$ matrices:
8226    ///
8227    /// $$
8228    /// A_{j}\\*Q_{j} = Q_{j}\\*\Lambda_{j}
8229    /// $$
8230    /// where $\Lambda_{j}$ is a real $n \times n$ diagonal matrix. $Q_j$ is an $n \times n$ unitary matrix. The diagonal elements of $\Lambda_j$ are the eigenvalues of $A_j$ in either ascending order or non-sorting order.
8231    ///
8232    /// `syevjBatched` performs `syevj` on each matrix. It requires that all matrices are of the same size `n` and are packed in contiguous way,
8233    ///
8234    /// $$
8235    /// \begin{split}A = \begin{pmatrix}
8236    /// {A0} & {A1} & \cdots \\\\
8237    /// \end{pmatrix}\end{split}
8238    /// $$
8239    /// Each matrix is column-major with leading dimension `lda`, so the formula for random access is $A_{k}\operatorname{(i,j)} = {A\lbrack\ i\ +\ lda\\*j\ +\ lda\\*n\\*k\rbrack}$.
8240    ///
8241    /// The parameter `W` also contains eigenvalues of each matrix in contiguous way,
8242    ///
8243    /// $$
8244    /// \begin{split}W = \begin{pmatrix}
8245    /// {W0} & {W1} & \cdots \\\\
8246    /// \end{pmatrix}\end{split}
8247    /// $$
8248    /// The formula for random access of `W` is $W_{k}\operatorname{(j)} = {W\lbrack\ j\ +\ n\\*k\rbrack}$.
8249    ///
8250    /// Except for tolerance and maximum sweeps, `syevjBatched` can either sort the eigenvalues in ascending order (default) or chose as-is (without sorting) by the function [`cusolverDnXsyevjSetSortEig`]. If the user packs several tiny matrices into diagonal blocks of one matrix, non-sorting option can separate spectrum of those tiny matrices.
8251    ///
8252    /// `syevjBatched` cannot report residual and executed sweeps by function [`cusolverDnXsyevjGetResidual`] and [`cusolverDnXsyevjGetSweeps`]. Any call of the above two returns [`cusolverStatus_t::CUSOLVER_STATUS_NOT_SUPPORTED`]. The user needs to compute residual explicitly.
8253    ///
8254    /// The user has to provide working space pointed by input parameter `work`. The input parameter `lwork` is the size of the working space, and it is returned by `syevjBatched_bufferSize()`. Please note that the size in bytes of the working space is equal to `sizeof(<type>) * lwork`.
8255    ///
8256    /// The output parameter `info` is an integer array of size `batchSize`. If the function returns [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`], the first element `info[0] = -i` (less than zero) indicates `i-th` parameter is wrong (not counting handle). Otherwise, if `info[i] = n+1`, `syevjBatched` does not converge on `i-th` matrix under given tolerance and maximum sweeps.
8257    ///
8258    /// If `jobz` = [`cusolverEigMode_t::CUSOLVER_EIG_MODE_VECTOR`], $A_j$ contains the orthonormal eigenvectors $V_j$.
8259    ///
8260    /// Please visit [cuSOLVER Library Samples - syevjBatched](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/syevjBatched) for a code example.
8261    ///
8262    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The operation completed successfully.
8263    ///
8264    /// [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]:   The library was not initialized.
8265    ///
8266    /// [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]:   Invalid parameters were passed (`n<0`, or `lda<max(1,n)`, or `jobz` is not [`cusolverEigMode_t::CUSOLVER_EIG_MODE_NOVECTOR`] or [`cusolverEigMode_t::CUSOLVER_EIG_MODE_VECTOR`], or `uplo` is not [`cublasFillMode_t::CUBLAS_FILL_MODE_LOWER`] or [`cublasFillMode_t::CUBLAS_FILL_MODE_UPPER`]), or `batchSize<0`.
8267    ///
8268    /// [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]:   An internal operation failed.
8269    pub fn cusolverDnDsyevjBatched(
8270        handle: cusolverDnHandle_t,
8271        jobz: cusolverEigMode_t,
8272        uplo: cublasFillMode_t,
8273        n: ::core::ffi::c_int,
8274        A: *mut f64,
8275        lda: ::core::ffi::c_int,
8276        W: *mut f64,
8277        work: *mut f64,
8278        lwork: ::core::ffi::c_int,
8279        info: *mut ::core::ffi::c_int,
8280        params: syevjInfo_t,
8281        batchSize: ::core::ffi::c_int,
8282    ) -> cusolverStatus_t;
8283}
8284unsafe extern "C" {
8285    pub fn cusolverDnCheevjBatched(
8286        handle: cusolverDnHandle_t,
8287        jobz: cusolverEigMode_t,
8288        uplo: cublasFillMode_t,
8289        n: ::core::ffi::c_int,
8290        A: *mut cuComplex,
8291        lda: ::core::ffi::c_int,
8292        W: *mut f32,
8293        work: *mut cuComplex,
8294        lwork: ::core::ffi::c_int,
8295        info: *mut ::core::ffi::c_int,
8296        params: syevjInfo_t,
8297        batchSize: ::core::ffi::c_int,
8298    ) -> cusolverStatus_t;
8299}
8300unsafe extern "C" {
8301    pub fn cusolverDnZheevjBatched(
8302        handle: cusolverDnHandle_t,
8303        jobz: cusolverEigMode_t,
8304        uplo: cublasFillMode_t,
8305        n: ::core::ffi::c_int,
8306        A: *mut cuDoubleComplex,
8307        lda: ::core::ffi::c_int,
8308        W: *mut f64,
8309        work: *mut cuDoubleComplex,
8310        lwork: ::core::ffi::c_int,
8311        info: *mut ::core::ffi::c_int,
8312        params: syevjInfo_t,
8313        batchSize: ::core::ffi::c_int,
8314    ) -> cusolverStatus_t;
8315}
8316unsafe extern "C" {
8317    pub fn cusolverDnSsyevj_bufferSize(
8318        handle: cusolverDnHandle_t,
8319        jobz: cusolverEigMode_t,
8320        uplo: cublasFillMode_t,
8321        n: ::core::ffi::c_int,
8322        A: *const f32,
8323        lda: ::core::ffi::c_int,
8324        W: *const f32,
8325        lwork: *mut ::core::ffi::c_int,
8326        params: syevjInfo_t,
8327    ) -> cusolverStatus_t;
8328}
8329unsafe extern "C" {
8330    pub fn cusolverDnDsyevj_bufferSize(
8331        handle: cusolverDnHandle_t,
8332        jobz: cusolverEigMode_t,
8333        uplo: cublasFillMode_t,
8334        n: ::core::ffi::c_int,
8335        A: *const f64,
8336        lda: ::core::ffi::c_int,
8337        W: *const f64,
8338        lwork: *mut ::core::ffi::c_int,
8339        params: syevjInfo_t,
8340    ) -> cusolverStatus_t;
8341}
8342unsafe extern "C" {
8343    pub fn cusolverDnCheevj_bufferSize(
8344        handle: cusolverDnHandle_t,
8345        jobz: cusolverEigMode_t,
8346        uplo: cublasFillMode_t,
8347        n: ::core::ffi::c_int,
8348        A: *const cuComplex,
8349        lda: ::core::ffi::c_int,
8350        W: *const f32,
8351        lwork: *mut ::core::ffi::c_int,
8352        params: syevjInfo_t,
8353    ) -> cusolverStatus_t;
8354}
8355unsafe extern "C" {
8356    pub fn cusolverDnZheevj_bufferSize(
8357        handle: cusolverDnHandle_t,
8358        jobz: cusolverEigMode_t,
8359        uplo: cublasFillMode_t,
8360        n: ::core::ffi::c_int,
8361        A: *const cuDoubleComplex,
8362        lda: ::core::ffi::c_int,
8363        W: *const f64,
8364        lwork: *mut ::core::ffi::c_int,
8365        params: syevjInfo_t,
8366    ) -> cusolverStatus_t;
8367}
8368unsafe extern "C" {
8369    /// The helper functions below can calculate the sizes needed for pre-allocated buffer.
8370    ///
8371    /// The S and D data types are real valued single and double precision, respectively.
8372    ///
8373    /// The C and Z data types are complex valued single and double precision, respectively.
8374    ///
8375    /// This function computes eigenvalues and eigenvectors of a symmetric (Hermitian) $n \times n$ matrix `A`. The standard symmetric eigenvalue problem is:
8376    ///
8377    /// $$
8378    /// A\\*Q = Q\\*\Lambda
8379    /// $$
8380    /// where `Λ` is a real $n \times n$ diagonal matrix. `Q` is an $n \times n$ unitary matrix. The diagonal elements of `Λ` are the eigenvalues of `A` in ascending order.
8381    ///
8382    /// `syevj` has the same functionality as `syevd`. The difference is that `syevd` uses QR algorithm and `syevj` uses Jacobi method. The parallelism of Jacobi method gives GPU better performance on small and medium size matrices. Moreover the user can configure `syevj` to perform approximation up to certain accuracy.
8383    ///
8384    /// How does it work?
8385    ///
8386    /// `syevj` iteratively generates a sequence of unitary matrices to transform matrix `A` to the following form:
8387    ///
8388    /// $$
8389    /// V^{H}\\*A\\*V = W + E
8390    /// $$
8391    /// where `W` is diagonal and `E` is symmetric without diagonal.
8392    ///
8393    /// During the iterations, the Frobenius norm of `E` decreases monotonically. As `E` goes down to zero, `W` is the set of eigenvalues. In practice, Jacobi method stops if:
8394    ///
8395    /// $$
8396    /// {\\|E\\|}_{F}\leq\operatorname{eps}\\*{\\|A\\|}_{F}
8397    /// $$
8398    /// where `eps` is the given tolerance.
8399    ///
8400    /// `syevj` has two parameters to control the accuracy. First parameter is tolerance (`eps`). The default value is machine accuracy but The user can use function [`cusolverDnXsyevjSetTolerance`] to set a priori tolerance. The second parameter is maximum number of sweeps which controls number of iterations of Jacobi method. The default value is 100 but the user can use function [`cusolverDnXsyevjSetMaxSweeps`] to set a proper bound. The experiments show 15 sweeps are good enough to converge to machine accuracy. `syevj` stops either tolerance is met or maximum number of sweeps is met.
8401    ///
8402    /// The Jacobi method has quadratic convergence, so the accuracy is not proportional to number of sweeps. To guarantee certain accuracy, the user should configure tolerance only.
8403    ///
8404    /// After `syevj`, the user can query residual by function [`cusolverDnXsyevjGetResidual`] and number of executed sweeps by function [`cusolverDnXsyevjGetSweeps`]. However the user needs to be aware that residual is the Frobenius norm of `E`, not accuracy of individual eigenvalue, i.e.
8405    ///
8406    /// $$
8407    /// {residual}={\\|E\\|}_{F} = {{\\|}\Lambda - W{\\|}}_{F}
8408    /// $$
8409    /// The same as `syevd`, the user has to provide working space pointed by input parameter `work`. The input parameter `lwork` is the size of the working space, and it is returned by `syevj_bufferSize()`. Please note that the size in bytes of the working space is equal to `sizeof(<type>) * lwork`.
8410    ///
8411    /// If output parameter `info = -i` (less than zero), the `i-th` parameter is wrong (not counting handle). If `info = n+1`, `syevj` does not converge under given tolerance and maximum sweeps.
8412    ///
8413    /// If the user sets an improper tolerance, `syevj` may not converge. For example, tolerance should not be smaller than machine accuracy.
8414    ///
8415    /// If `jobz` = [`cusolverEigMode_t::CUSOLVER_EIG_MODE_VECTOR`], `A` contains the orthonormal eigenvectors `V`.
8416    ///
8417    /// Please visit [cuSOLVER Library Samples - syevj](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/syevj) for a code example.
8418    ///
8419    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The operation completed successfully.
8420    ///
8421    /// [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]:   The library was not initialized.
8422    ///
8423    /// [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]:   Invalid parameters were passed (`n<0`, or `lda<max(1,n)`, or `jobz` is not [`cusolverEigMode_t::CUSOLVER_EIG_MODE_NOVECTOR`] or [`cusolverEigMode_t::CUSOLVER_EIG_MODE_VECTOR`], or `uplo` is not [`cublasFillMode_t::CUBLAS_FILL_MODE_LOWER`] or [`cublasFillMode_t::CUBLAS_FILL_MODE_UPPER`]).
8424    ///
8425    /// [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]:   An internal operation failed.
8426    pub fn cusolverDnSsyevj(
8427        handle: cusolverDnHandle_t,
8428        jobz: cusolverEigMode_t,
8429        uplo: cublasFillMode_t,
8430        n: ::core::ffi::c_int,
8431        A: *mut f32,
8432        lda: ::core::ffi::c_int,
8433        W: *mut f32,
8434        work: *mut f32,
8435        lwork: ::core::ffi::c_int,
8436        info: *mut ::core::ffi::c_int,
8437        params: syevjInfo_t,
8438    ) -> cusolverStatus_t;
8439}
8440unsafe extern "C" {
8441    /// The helper functions below can calculate the sizes needed for pre-allocated buffer.
8442    ///
8443    /// The S and D data types are real valued single and double precision, respectively.
8444    ///
8445    /// The C and Z data types are complex valued single and double precision, respectively.
8446    ///
8447    /// This function computes eigenvalues and eigenvectors of a symmetric (Hermitian) $n \times n$ matrix `A`. The standard symmetric eigenvalue problem is:
8448    ///
8449    /// $$
8450    /// A\\*Q = Q\\*\Lambda
8451    /// $$
8452    /// where `Λ` is a real $n \times n$ diagonal matrix. `Q` is an $n \times n$ unitary matrix. The diagonal elements of `Λ` are the eigenvalues of `A` in ascending order.
8453    ///
8454    /// `syevj` has the same functionality as `syevd`. The difference is that `syevd` uses QR algorithm and `syevj` uses Jacobi method. The parallelism of Jacobi method gives GPU better performance on small and medium size matrices. Moreover the user can configure `syevj` to perform approximation up to certain accuracy.
8455    ///
8456    /// How does it work?
8457    ///
8458    /// `syevj` iteratively generates a sequence of unitary matrices to transform matrix `A` to the following form:
8459    ///
8460    /// $$
8461    /// V^{H}\\*A\\*V = W + E
8462    /// $$
8463    /// where `W` is diagonal and `E` is symmetric without diagonal.
8464    ///
8465    /// During the iterations, the Frobenius norm of `E` decreases monotonically. As `E` goes down to zero, `W` is the set of eigenvalues. In practice, Jacobi method stops if:
8466    ///
8467    /// $$
8468    /// {\\|E\\|}_{F}\leq\operatorname{eps}\\*{\\|A\\|}_{F}
8469    /// $$
8470    /// where `eps` is the given tolerance.
8471    ///
8472    /// `syevj` has two parameters to control the accuracy. First parameter is tolerance (`eps`). The default value is machine accuracy but The user can use function [`cusolverDnXsyevjSetTolerance`] to set a priori tolerance. The second parameter is maximum number of sweeps which controls number of iterations of Jacobi method. The default value is 100 but the user can use function [`cusolverDnXsyevjSetMaxSweeps`] to set a proper bound. The experiments show 15 sweeps are good enough to converge to machine accuracy. `syevj` stops either tolerance is met or maximum number of sweeps is met.
8473    ///
8474    /// The Jacobi method has quadratic convergence, so the accuracy is not proportional to number of sweeps. To guarantee certain accuracy, the user should configure tolerance only.
8475    ///
8476    /// After `syevj`, the user can query residual by function [`cusolverDnXsyevjGetResidual`] and number of executed sweeps by function [`cusolverDnXsyevjGetSweeps`]. However the user needs to be aware that residual is the Frobenius norm of `E`, not accuracy of individual eigenvalue, i.e.
8477    ///
8478    /// $$
8479    /// {residual}={\\|E\\|}_{F} = {{\\|}\Lambda - W{\\|}}_{F}
8480    /// $$
8481    /// The same as `syevd`, the user has to provide working space pointed by input parameter `work`. The input parameter `lwork` is the size of the working space, and it is returned by `syevj_bufferSize()`. Please note that the size in bytes of the working space is equal to `sizeof(<type>) * lwork`.
8482    ///
8483    /// If output parameter `info = -i` (less than zero), the `i-th` parameter is wrong (not counting handle). If `info = n+1`, `syevj` does not converge under given tolerance and maximum sweeps.
8484    ///
8485    /// If the user sets an improper tolerance, `syevj` may not converge. For example, tolerance should not be smaller than machine accuracy.
8486    ///
8487    /// If `jobz` = [`cusolverEigMode_t::CUSOLVER_EIG_MODE_VECTOR`], `A` contains the orthonormal eigenvectors `V`.
8488    ///
8489    /// Please visit [cuSOLVER Library Samples - syevj](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/syevj) for a code example.
8490    ///
8491    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The operation completed successfully.
8492    ///
8493    /// [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]:   The library was not initialized.
8494    ///
8495    /// [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]:   Invalid parameters were passed (`n<0`, or `lda<max(1,n)`, or `jobz` is not [`cusolverEigMode_t::CUSOLVER_EIG_MODE_NOVECTOR`] or [`cusolverEigMode_t::CUSOLVER_EIG_MODE_VECTOR`], or `uplo` is not [`cublasFillMode_t::CUBLAS_FILL_MODE_LOWER`] or [`cublasFillMode_t::CUBLAS_FILL_MODE_UPPER`]).
8496    ///
8497    /// [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]:   An internal operation failed.
8498    pub fn cusolverDnDsyevj(
8499        handle: cusolverDnHandle_t,
8500        jobz: cusolverEigMode_t,
8501        uplo: cublasFillMode_t,
8502        n: ::core::ffi::c_int,
8503        A: *mut f64,
8504        lda: ::core::ffi::c_int,
8505        W: *mut f64,
8506        work: *mut f64,
8507        lwork: ::core::ffi::c_int,
8508        info: *mut ::core::ffi::c_int,
8509        params: syevjInfo_t,
8510    ) -> cusolverStatus_t;
8511}
8512unsafe extern "C" {
8513    pub fn cusolverDnCheevj(
8514        handle: cusolverDnHandle_t,
8515        jobz: cusolverEigMode_t,
8516        uplo: cublasFillMode_t,
8517        n: ::core::ffi::c_int,
8518        A: *mut cuComplex,
8519        lda: ::core::ffi::c_int,
8520        W: *mut f32,
8521        work: *mut cuComplex,
8522        lwork: ::core::ffi::c_int,
8523        info: *mut ::core::ffi::c_int,
8524        params: syevjInfo_t,
8525    ) -> cusolverStatus_t;
8526}
8527unsafe extern "C" {
8528    pub fn cusolverDnZheevj(
8529        handle: cusolverDnHandle_t,
8530        jobz: cusolverEigMode_t,
8531        uplo: cublasFillMode_t,
8532        n: ::core::ffi::c_int,
8533        A: *mut cuDoubleComplex,
8534        lda: ::core::ffi::c_int,
8535        W: *mut f64,
8536        work: *mut cuDoubleComplex,
8537        lwork: ::core::ffi::c_int,
8538        info: *mut ::core::ffi::c_int,
8539        params: syevjInfo_t,
8540    ) -> cusolverStatus_t;
8541}
8542unsafe extern "C" {
8543    pub fn cusolverDnSsygvj_bufferSize(
8544        handle: cusolverDnHandle_t,
8545        itype: cusolverEigType_t,
8546        jobz: cusolverEigMode_t,
8547        uplo: cublasFillMode_t,
8548        n: ::core::ffi::c_int,
8549        A: *const f32,
8550        lda: ::core::ffi::c_int,
8551        B: *const f32,
8552        ldb: ::core::ffi::c_int,
8553        W: *const f32,
8554        lwork: *mut ::core::ffi::c_int,
8555        params: syevjInfo_t,
8556    ) -> cusolverStatus_t;
8557}
8558unsafe extern "C" {
8559    pub fn cusolverDnDsygvj_bufferSize(
8560        handle: cusolverDnHandle_t,
8561        itype: cusolverEigType_t,
8562        jobz: cusolverEigMode_t,
8563        uplo: cublasFillMode_t,
8564        n: ::core::ffi::c_int,
8565        A: *const f64,
8566        lda: ::core::ffi::c_int,
8567        B: *const f64,
8568        ldb: ::core::ffi::c_int,
8569        W: *const f64,
8570        lwork: *mut ::core::ffi::c_int,
8571        params: syevjInfo_t,
8572    ) -> cusolverStatus_t;
8573}
8574unsafe extern "C" {
8575    pub fn cusolverDnChegvj_bufferSize(
8576        handle: cusolverDnHandle_t,
8577        itype: cusolverEigType_t,
8578        jobz: cusolverEigMode_t,
8579        uplo: cublasFillMode_t,
8580        n: ::core::ffi::c_int,
8581        A: *const cuComplex,
8582        lda: ::core::ffi::c_int,
8583        B: *const cuComplex,
8584        ldb: ::core::ffi::c_int,
8585        W: *const f32,
8586        lwork: *mut ::core::ffi::c_int,
8587        params: syevjInfo_t,
8588    ) -> cusolverStatus_t;
8589}
8590unsafe extern "C" {
8591    pub fn cusolverDnZhegvj_bufferSize(
8592        handle: cusolverDnHandle_t,
8593        itype: cusolverEigType_t,
8594        jobz: cusolverEigMode_t,
8595        uplo: cublasFillMode_t,
8596        n: ::core::ffi::c_int,
8597        A: *const cuDoubleComplex,
8598        lda: ::core::ffi::c_int,
8599        B: *const cuDoubleComplex,
8600        ldb: ::core::ffi::c_int,
8601        W: *const f64,
8602        lwork: *mut ::core::ffi::c_int,
8603        params: syevjInfo_t,
8604    ) -> cusolverStatus_t;
8605}
8606unsafe extern "C" {
8607    /// The helper functions below can calculate the sizes needed for pre-allocated buffer.
8608    ///
8609    /// The S and D data types are real valued single and double precision, respectively.
8610    ///
8611    /// The C and Z data types are complex valued single and double precision, respectively.
8612    ///
8613    /// This function computes eigenvalues and eigenvectors of a symmetric (Hermitian) $n \times n$ matrix-pair (`A`,`B`). The generalized symmetric-definite eigenvalue problem is
8614    ///
8615    /// ![image4](_images/eig-a-b-itype.png)
8616    ///
8617    /// where the matrix `B` is positive definite. `Λ` is a real $n \times n$ diagonal matrix. The diagonal elements of `Λ` are the eigenvalues of (`A`, `B`) in ascending order. `V` is an $n \times n$ orthogonal matrix. The eigenvectors are normalized as follows:
8618    ///
8619    /// ![image5](_images/normalized-eigenvectors.png)
8620    ///
8621    /// This function has the same functionality as `sygvd` except that `syevd` in `sygvd` is replaced by `syevj` in `sygvj`. Therefore, `sygvj` inherits properties of `syevj`, the user can use [`cusolverDnXsyevjSetTolerance`] and [`cusolverDnXsyevjSetMaxSweeps`] to configure tolerance and maximum sweeps.
8622    ///
8623    /// However the meaning of residual is different from `syevj`. `sygvj` first computes Cholesky factorization of matrix `B`,
8624    ///
8625    /// $$
8626    /// B = L\\*L^{H}
8627    /// $$
8628    /// transform the problem to standard eigenvalue problem, then calls `syevj`.
8629    ///
8630    /// For example, the standard eigenvalue problem of type I is:
8631    ///
8632    /// $$
8633    /// M\\*Q = Q\\*\Lambda
8634    /// $$
8635    /// where matrix `M` is symmetric:
8636    ///
8637    /// $$
8638    /// M = L^{-1}\\*A\\*L^{-H}
8639    /// $$
8640    /// The residual is the result of `syevj` on matrix `M`, not `A`.
8641    ///
8642    /// The user has to provide working space which is pointed by input parameter `work`. The input parameter `lwork` is the size of the working space, and it is returned by `sygvj_bufferSize()`. Please note that the size in bytes of the working space is equal to `sizeof(<type>) * lwork`.
8643    ///
8644    /// If output parameter `info = -i` (less than zero), the `i-th` parameter is wrong (not counting handle). If `info = i` (i > 0 and i<=n), `B` is not positive definite, the factorization of `B` could not be completed and no eigenvalues or eigenvectors were computed. If `info = n+1`, `syevj` does not converge under given tolerance and maximum sweeps. In this case, the eigenvalues and eigenvectors are still computed because non-convergence comes from improper tolerance of maximum sweeps.
8645    ///
8646    /// if `jobz` = [`cusolverEigMode_t::CUSOLVER_EIG_MODE_VECTOR`], `A` contains the orthogonal eigenvectors `V`.
8647    ///
8648    /// Please visit [cuSOLVER Library Samples - sygvj](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/sygvj) for a code example.
8649    ///
8650    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The operation completed successfully.
8651    ///
8652    /// [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]:   The library was not initialized.
8653    ///
8654    /// [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]:   Invalid parameters were passed (`n<0`, or `lda<max(1,n)`, or `ldb<max(1,n)`, or `itype` is not 1, 2 or 3, or `jobz` is not [`cusolverEigMode_t::CUSOLVER_EIG_MODE_NOVECTOR`] or [`cusolverEigMode_t::CUSOLVER_EIG_MODE_VECTOR`], or `uplo` is not [`cublasFillMode_t::CUBLAS_FILL_MODE_LOWER`] or [`cublasFillMode_t::CUBLAS_FILL_MODE_UPPER`]).
8655    ///
8656    /// [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]:   An internal operation failed.
8657    pub fn cusolverDnSsygvj(
8658        handle: cusolverDnHandle_t,
8659        itype: cusolverEigType_t,
8660        jobz: cusolverEigMode_t,
8661        uplo: cublasFillMode_t,
8662        n: ::core::ffi::c_int,
8663        A: *mut f32,
8664        lda: ::core::ffi::c_int,
8665        B: *mut f32,
8666        ldb: ::core::ffi::c_int,
8667        W: *mut f32,
8668        work: *mut f32,
8669        lwork: ::core::ffi::c_int,
8670        info: *mut ::core::ffi::c_int,
8671        params: syevjInfo_t,
8672    ) -> cusolverStatus_t;
8673}
8674unsafe extern "C" {
8675    /// The helper functions below can calculate the sizes needed for pre-allocated buffer.
8676    ///
8677    /// The S and D data types are real valued single and double precision, respectively.
8678    ///
8679    /// The C and Z data types are complex valued single and double precision, respectively.
8680    ///
8681    /// This function computes eigenvalues and eigenvectors of a symmetric (Hermitian) $n \times n$ matrix-pair (`A`,`B`). The generalized symmetric-definite eigenvalue problem is
8682    ///
8683    /// ![image4](_images/eig-a-b-itype.png)
8684    ///
8685    /// where the matrix `B` is positive definite. `Λ` is a real $n \times n$ diagonal matrix. The diagonal elements of `Λ` are the eigenvalues of (`A`, `B`) in ascending order. `V` is an $n \times n$ orthogonal matrix. The eigenvectors are normalized as follows:
8686    ///
8687    /// ![image5](_images/normalized-eigenvectors.png)
8688    ///
8689    /// This function has the same functionality as `sygvd` except that `syevd` in `sygvd` is replaced by `syevj` in `sygvj`. Therefore, `sygvj` inherits properties of `syevj`, the user can use [`cusolverDnXsyevjSetTolerance`] and [`cusolverDnXsyevjSetMaxSweeps`] to configure tolerance and maximum sweeps.
8690    ///
8691    /// However the meaning of residual is different from `syevj`. `sygvj` first computes Cholesky factorization of matrix `B`,
8692    ///
8693    /// $$
8694    /// B = L\\*L^{H}
8695    /// $$
8696    /// transform the problem to standard eigenvalue problem, then calls `syevj`.
8697    ///
8698    /// For example, the standard eigenvalue problem of type I is:
8699    ///
8700    /// $$
8701    /// M\\*Q = Q\\*\Lambda
8702    /// $$
8703    /// where matrix `M` is symmetric:
8704    ///
8705    /// $$
8706    /// M = L^{-1}\\*A\\*L^{-H}
8707    /// $$
8708    /// The residual is the result of `syevj` on matrix `M`, not `A`.
8709    ///
8710    /// The user has to provide working space which is pointed by input parameter `work`. The input parameter `lwork` is the size of the working space, and it is returned by `sygvj_bufferSize()`. Please note that the size in bytes of the working space is equal to `sizeof(<type>) * lwork`.
8711    ///
8712    /// If output parameter `info = -i` (less than zero), the `i-th` parameter is wrong (not counting handle). If `info = i` (i > 0 and i<=n), `B` is not positive definite, the factorization of `B` could not be completed and no eigenvalues or eigenvectors were computed. If `info = n+1`, `syevj` does not converge under given tolerance and maximum sweeps. In this case, the eigenvalues and eigenvectors are still computed because non-convergence comes from improper tolerance of maximum sweeps.
8713    ///
8714    /// if `jobz` = [`cusolverEigMode_t::CUSOLVER_EIG_MODE_VECTOR`], `A` contains the orthogonal eigenvectors `V`.
8715    ///
8716    /// Please visit [cuSOLVER Library Samples - sygvj](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/sygvj) for a code example.
8717    ///
8718    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The operation completed successfully.
8719    ///
8720    /// [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]:   The library was not initialized.
8721    ///
8722    /// [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]:   Invalid parameters were passed (`n<0`, or `lda<max(1,n)`, or `ldb<max(1,n)`, or `itype` is not 1, 2 or 3, or `jobz` is not [`cusolverEigMode_t::CUSOLVER_EIG_MODE_NOVECTOR`] or [`cusolverEigMode_t::CUSOLVER_EIG_MODE_VECTOR`], or `uplo` is not [`cublasFillMode_t::CUBLAS_FILL_MODE_LOWER`] or [`cublasFillMode_t::CUBLAS_FILL_MODE_UPPER`]).
8723    ///
8724    /// [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]:   An internal operation failed.
8725    pub fn cusolverDnDsygvj(
8726        handle: cusolverDnHandle_t,
8727        itype: cusolverEigType_t,
8728        jobz: cusolverEigMode_t,
8729        uplo: cublasFillMode_t,
8730        n: ::core::ffi::c_int,
8731        A: *mut f64,
8732        lda: ::core::ffi::c_int,
8733        B: *mut f64,
8734        ldb: ::core::ffi::c_int,
8735        W: *mut f64,
8736        work: *mut f64,
8737        lwork: ::core::ffi::c_int,
8738        info: *mut ::core::ffi::c_int,
8739        params: syevjInfo_t,
8740    ) -> cusolverStatus_t;
8741}
8742unsafe extern "C" {
8743    pub fn cusolverDnChegvj(
8744        handle: cusolverDnHandle_t,
8745        itype: cusolverEigType_t,
8746        jobz: cusolverEigMode_t,
8747        uplo: cublasFillMode_t,
8748        n: ::core::ffi::c_int,
8749        A: *mut cuComplex,
8750        lda: ::core::ffi::c_int,
8751        B: *mut cuComplex,
8752        ldb: ::core::ffi::c_int,
8753        W: *mut f32,
8754        work: *mut cuComplex,
8755        lwork: ::core::ffi::c_int,
8756        info: *mut ::core::ffi::c_int,
8757        params: syevjInfo_t,
8758    ) -> cusolverStatus_t;
8759}
8760unsafe extern "C" {
8761    pub fn cusolverDnZhegvj(
8762        handle: cusolverDnHandle_t,
8763        itype: cusolverEigType_t,
8764        jobz: cusolverEigMode_t,
8765        uplo: cublasFillMode_t,
8766        n: ::core::ffi::c_int,
8767        A: *mut cuDoubleComplex,
8768        lda: ::core::ffi::c_int,
8769        B: *mut cuDoubleComplex,
8770        ldb: ::core::ffi::c_int,
8771        W: *mut f64,
8772        work: *mut cuDoubleComplex,
8773        lwork: ::core::ffi::c_int,
8774        info: *mut ::core::ffi::c_int,
8775        params: syevjInfo_t,
8776    ) -> cusolverStatus_t;
8777}
8778unsafe extern "C" {
8779    /// This function creates and initializes the structure of `gesvdj` and `gesvdjBatched` to default values.
8780    ///
8781    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The structure was initialized successfully.
8782    ///
8783    /// [`cusolverStatus_t::CUSOLVER_STATUS_ALLOC_FAILED`]:   The resources could not be allocated.
8784    ///
8785    /// # Parameters
8786    ///
8787    /// - `info`: The pointer to the structure of `gesvdj`.
8788    ///
8789    /// # Return value
8790    ///
8791    /// - [`cusolverStatus_t::CUSOLVER_STATUS_ALLOC_FAILED`]: The resources could not be allocated.
8792    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The structure was initialized successfully.
8793    pub fn cusolverDnCreateGesvdjInfo(info: *mut gesvdjInfo_t) -> cusolverStatus_t;
8794}
8795unsafe extern "C" {
8796    /// This function destroys and releases any memory required by the structure.
8797    ///
8798    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The resources were released successfully.
8799    ///
8800    /// # Parameters
8801    ///
8802    /// - `info`: The structure of `gesvdj`.
8803    ///
8804    /// # Return value
8805    ///
8806    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The resources were released successfully.
8807    pub fn cusolverDnDestroyGesvdjInfo(info: gesvdjInfo_t) -> cusolverStatus_t;
8808}
8809unsafe extern "C" {
8810    /// This function configures tolerance of `gesvdj`.
8811    ///
8812    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The operation completed successfully.
8813    ///
8814    /// # Parameters
8815    ///
8816    /// - `info`: The pointer to the structure of `gesvdj`.
8817    /// - `tolerance`: Accuracy of numerical singular values.
8818    ///
8819    /// # Return value
8820    ///
8821    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The operation completed successfully.
8822    pub fn cusolverDnXgesvdjSetTolerance(
8823        info: gesvdjInfo_t,
8824        tolerance: f64,
8825    ) -> cusolverStatus_t;
8826}
8827unsafe extern "C" {
8828    /// This function configures the maximum number of sweeps in `gesvdj`. The default value is 100.
8829    ///
8830    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The operation completed successfully.
8831    ///
8832    /// # Parameters
8833    ///
8834    /// - `info`: The pointer to the structure of `gesvdj`.
8835    /// - `max_sweeps`: Maximum number of sweeps.
8836    ///
8837    /// # Return value
8838    ///
8839    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The operation completed successfully.
8840    pub fn cusolverDnXgesvdjSetMaxSweeps(
8841        info: gesvdjInfo_t,
8842        max_sweeps: ::core::ffi::c_int,
8843    ) -> cusolverStatus_t;
8844}
8845unsafe extern "C" {
8846    /// If `sort_svd` is zero, the singular values are not sorted. This function only works for `gesvdjBatched`. `gesvdj` always sorts singular values in descending order. By default, singular values are always sorted in descending order.
8847    ///
8848    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The operation completed successfully.
8849    ///
8850    /// # Parameters
8851    ///
8852    /// - `info`: The pointer to the structure of `gesvdj`.
8853    /// - `sort_svd`: If `sort_svd` is zero, the singular values are not sorted.
8854    ///
8855    /// # Return value
8856    ///
8857    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The operation completed successfully.
8858    pub fn cusolverDnXgesvdjSetSortEig(
8859        info: gesvdjInfo_t,
8860        sort_svd: ::core::ffi::c_int,
8861    ) -> cusolverStatus_t;
8862}
8863unsafe extern "C" {
8864    /// This function reports the Frobenius norm of the internal residual returned by `gesvdj`. Note that this is *not* the Frobenious norm of the exact residual calculated as:
8865    ///
8866    /// $$
8867    /// {\\|{S} - {U}^{H}\\*{A}\\*{V}\\|}_{F}
8868    /// $$
8869    /// This function does not support `gesvdjBatched`. If the user calls this function after `gesvdjBatched`, the error [`cusolverStatus_t::CUSOLVER_STATUS_NOT_SUPPORTED`] is returned.
8870    ///
8871    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The operation completed successfully.
8872    ///
8873    /// [`cusolverStatus_t::CUSOLVER_STATUS_NOT_SUPPORTED`]:   Does not support batched version.
8874    ///
8875    /// # Parameters
8876    ///
8877    /// - `handle`: Handle to the cuSolverDN library context.
8878    /// - `info`: The pointer to the structure of `gesvdj`.
8879    /// - `residual`: Residual of `gesvdj`.
8880    ///
8881    /// # Return value
8882    ///
8883    /// - [`cusolverStatus_t::CUSOLVER_STATUS_NOT_SUPPORTED`]: Does not support batched version.
8884    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The operation completed successfully.
8885    pub fn cusolverDnXgesvdjGetResidual(
8886        handle: cusolverDnHandle_t,
8887        info: gesvdjInfo_t,
8888        residual: *mut f64,
8889    ) -> cusolverStatus_t;
8890}
8891unsafe extern "C" {
8892    /// This function reports number of executed sweeps of `gesvdj`. It does not support `gesvdjBatched`. If the user calls this function after `gesvdjBatched`, the error [`cusolverStatus_t::CUSOLVER_STATUS_NOT_SUPPORTED`] is returned.
8893    ///
8894    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The operation completed successfully.
8895    ///
8896    /// [`cusolverStatus_t::CUSOLVER_STATUS_NOT_SUPPORTED`]:   Does not support batched version.
8897    ///
8898    /// # Parameters
8899    ///
8900    /// - `handle`: Handle to the cuSolverDN library context.
8901    /// - `info`: The pointer to the structure of `gesvdj`.
8902    /// - `executed_sweeps`: Number of executed sweeps.
8903    ///
8904    /// # Return value
8905    ///
8906    /// - [`cusolverStatus_t::CUSOLVER_STATUS_NOT_SUPPORTED`]: Does not support batched version.
8907    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The operation completed successfully.
8908    pub fn cusolverDnXgesvdjGetSweeps(
8909        handle: cusolverDnHandle_t,
8910        info: gesvdjInfo_t,
8911        executed_sweeps: *mut ::core::ffi::c_int,
8912    ) -> cusolverStatus_t;
8913}
8914unsafe extern "C" {
8915    pub fn cusolverDnSgesvdjBatched_bufferSize(
8916        handle: cusolverDnHandle_t,
8917        jobz: cusolverEigMode_t,
8918        m: ::core::ffi::c_int,
8919        n: ::core::ffi::c_int,
8920        A: *const f32,
8921        lda: ::core::ffi::c_int,
8922        S: *const f32,
8923        U: *const f32,
8924        ldu: ::core::ffi::c_int,
8925        V: *const f32,
8926        ldv: ::core::ffi::c_int,
8927        lwork: *mut ::core::ffi::c_int,
8928        params: gesvdjInfo_t,
8929        batchSize: ::core::ffi::c_int,
8930    ) -> cusolverStatus_t;
8931}
8932unsafe extern "C" {
8933    pub fn cusolverDnDgesvdjBatched_bufferSize(
8934        handle: cusolverDnHandle_t,
8935        jobz: cusolverEigMode_t,
8936        m: ::core::ffi::c_int,
8937        n: ::core::ffi::c_int,
8938        A: *const f64,
8939        lda: ::core::ffi::c_int,
8940        S: *const f64,
8941        U: *const f64,
8942        ldu: ::core::ffi::c_int,
8943        V: *const f64,
8944        ldv: ::core::ffi::c_int,
8945        lwork: *mut ::core::ffi::c_int,
8946        params: gesvdjInfo_t,
8947        batchSize: ::core::ffi::c_int,
8948    ) -> cusolverStatus_t;
8949}
8950unsafe extern "C" {
8951    pub fn cusolverDnCgesvdjBatched_bufferSize(
8952        handle: cusolverDnHandle_t,
8953        jobz: cusolverEigMode_t,
8954        m: ::core::ffi::c_int,
8955        n: ::core::ffi::c_int,
8956        A: *const cuComplex,
8957        lda: ::core::ffi::c_int,
8958        S: *const f32,
8959        U: *const cuComplex,
8960        ldu: ::core::ffi::c_int,
8961        V: *const cuComplex,
8962        ldv: ::core::ffi::c_int,
8963        lwork: *mut ::core::ffi::c_int,
8964        params: gesvdjInfo_t,
8965        batchSize: ::core::ffi::c_int,
8966    ) -> cusolverStatus_t;
8967}
8968unsafe extern "C" {
8969    pub fn cusolverDnZgesvdjBatched_bufferSize(
8970        handle: cusolverDnHandle_t,
8971        jobz: cusolverEigMode_t,
8972        m: ::core::ffi::c_int,
8973        n: ::core::ffi::c_int,
8974        A: *const cuDoubleComplex,
8975        lda: ::core::ffi::c_int,
8976        S: *const f64,
8977        U: *const cuDoubleComplex,
8978        ldu: ::core::ffi::c_int,
8979        V: *const cuDoubleComplex,
8980        ldv: ::core::ffi::c_int,
8981        lwork: *mut ::core::ffi::c_int,
8982        params: gesvdjInfo_t,
8983        batchSize: ::core::ffi::c_int,
8984    ) -> cusolverStatus_t;
8985}
8986unsafe extern "C" {
8987    /// The helper functions below can calculate the sizes needed for pre-allocated buffer.
8988    ///
8989    /// The S and D data types are real valued single and double precision, respectively.
8990    ///
8991    /// The C and Z data types are complex valued single and double precision, respectively.
8992    ///
8993    /// This function computes singular values and singular vectors of a sequence of general $m \times n$ matrices:
8994    ///
8995    /// $$
8996    /// A_{j} = U_{j}\\*\Sigma_{j}\\*V_{j}^{H}
8997    /// $$
8998    /// where $\Sigma_{j}$ is a real $m \times n$ diagonal matrix which is zero except for its `min(m,n)` diagonal elements. $U_{j}$ (left singular vectors) is an $m \times m$ unitary matrix and $V_{j}$ (right singular vectors) is a $n \times n$ unitary matrix. The diagonal elements of $\Sigma_{j}$ are the singular values of $A_{j}$ in either descending order or non-sorting order.
8999    ///
9000    /// `gesvdjBatched` performs `gesvdj` on each matrix. It requires that all matrices are of the same size `m,n` no greater than 32 and are packed in contiguous way,
9001    ///
9002    /// $$
9003    /// \begin{split}A = \begin{pmatrix}
9004    /// {A0} & {A1} & \cdots \\\\
9005    /// \end{pmatrix}\end{split}
9006    /// $$
9007    /// Each matrix is column-major with leading dimension `lda`, so the formula for random access is $A_{k}\operatorname{(i,j)} = {A\lbrack\ i\ +\ lda\\*j\ +\ lda\\*n\\*k\rbrack}$.
9008    ///
9009    /// The parameter `S` also contains singular values of each matrix in contiguous way,
9010    ///
9011    /// $$
9012    /// \begin{split}S = \begin{pmatrix}
9013    /// {S0} & {S1} & \cdots \\\\
9014    /// \end{pmatrix}\end{split}
9015    /// $$
9016    /// The formula for random access of `S` is $S_{k}\operatorname{(j)} = {S\lbrack\ j\ +\ min(m,n)\\*k\rbrack}$.
9017    ///
9018    /// Except for tolerance and maximum sweeps, `gesvdjBatched` can either sort the singular values in descending order (default) or chose as-is (without sorting) by the function [`cusolverDnXgesvdjSetSortEig`]. If the user packs several tiny matrices into diagonal blocks of one matrix, non-sorting option can separate singular values of those tiny matrices.
9019    ///
9020    /// `gesvdjBatched` cannot report residual and executed sweeps by function [`cusolverDnXgesvdjGetResidual`] and [`cusolverDnXgesvdjGetSweeps`]. Any call of the above two returns [`cusolverStatus_t::CUSOLVER_STATUS_NOT_SUPPORTED`]. The user needs to compute residual explicitly.
9021    ///
9022    /// The user has to provide working space pointed by input parameter `work`. The input parameter `lwork` is the size of the working space, and it is returned by `gesvdjBatched_bufferSize()`. Please note that the size in bytes of the working space is equal to `sizeof(<type>) * lwork`.
9023    ///
9024    /// The output parameter `info` is an integer array of size `batchSize`. If the function returns [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`], the first element `info[0] = -i` (less than zero) indicates `i-th` parameter is wrong (not counting handle). Otherwise, if `info[i] = min(m,n)+1`, `gesvdjBatched` does not converge on `i-th` matrix under given tolerance and maximum sweeps.
9025    ///
9026    /// Please visit [cuSOLVER Library Samples - gesvdjBatched](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/gesvdjBatched) for a code example.
9027    ///
9028    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The operation completed successfully.
9029    ///
9030    /// [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]:   The library was not initialized.
9031    ///
9032    /// [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]:   Invalid parameters were passed (`m,n<0` or `lda<max(1,m)` or `ldu<max(1,m)` or `ldv<max(1,n)` or `jobz` is not [`cusolverEigMode_t::CUSOLVER_EIG_MODE_NOVECTOR`] or [`cusolverEigMode_t::CUSOLVER_EIG_MODE_VECTOR`], or `batchSize<0`).
9033    ///
9034    /// [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]:   An internal operation failed.
9035    pub fn cusolverDnSgesvdjBatched(
9036        handle: cusolverDnHandle_t,
9037        jobz: cusolverEigMode_t,
9038        m: ::core::ffi::c_int,
9039        n: ::core::ffi::c_int,
9040        A: *mut f32,
9041        lda: ::core::ffi::c_int,
9042        S: *mut f32,
9043        U: *mut f32,
9044        ldu: ::core::ffi::c_int,
9045        V: *mut f32,
9046        ldv: ::core::ffi::c_int,
9047        work: *mut f32,
9048        lwork: ::core::ffi::c_int,
9049        info: *mut ::core::ffi::c_int,
9050        params: gesvdjInfo_t,
9051        batchSize: ::core::ffi::c_int,
9052    ) -> cusolverStatus_t;
9053}
9054unsafe extern "C" {
9055    /// The helper functions below can calculate the sizes needed for pre-allocated buffer.
9056    ///
9057    /// The S and D data types are real valued single and double precision, respectively.
9058    ///
9059    /// The C and Z data types are complex valued single and double precision, respectively.
9060    ///
9061    /// This function computes singular values and singular vectors of a sequence of general $m \times n$ matrices:
9062    ///
9063    /// $$
9064    /// A_{j} = U_{j}\\*\Sigma_{j}\\*V_{j}^{H}
9065    /// $$
9066    /// where $\Sigma_{j}$ is a real $m \times n$ diagonal matrix which is zero except for its `min(m,n)` diagonal elements. $U_{j}$ (left singular vectors) is an $m \times m$ unitary matrix and $V_{j}$ (right singular vectors) is a $n \times n$ unitary matrix. The diagonal elements of $\Sigma_{j}$ are the singular values of $A_{j}$ in either descending order or non-sorting order.
9067    ///
9068    /// `gesvdjBatched` performs `gesvdj` on each matrix. It requires that all matrices are of the same size `m,n` no greater than 32 and are packed in contiguous way,
9069    ///
9070    /// $$
9071    /// \begin{split}A = \begin{pmatrix}
9072    /// {A0} & {A1} & \cdots \\\\
9073    /// \end{pmatrix}\end{split}
9074    /// $$
9075    /// Each matrix is column-major with leading dimension `lda`, so the formula for random access is $A_{k}\operatorname{(i,j)} = {A\lbrack\ i\ +\ lda\\*j\ +\ lda\\*n\\*k\rbrack}$.
9076    ///
9077    /// The parameter `S` also contains singular values of each matrix in contiguous way,
9078    ///
9079    /// $$
9080    /// \begin{split}S = \begin{pmatrix}
9081    /// {S0} & {S1} & \cdots \\\\
9082    /// \end{pmatrix}\end{split}
9083    /// $$
9084    /// The formula for random access of `S` is $S_{k}\operatorname{(j)} = {S\lbrack\ j\ +\ min(m,n)\\*k\rbrack}$.
9085    ///
9086    /// Except for tolerance and maximum sweeps, `gesvdjBatched` can either sort the singular values in descending order (default) or chose as-is (without sorting) by the function [`cusolverDnXgesvdjSetSortEig`]. If the user packs several tiny matrices into diagonal blocks of one matrix, non-sorting option can separate singular values of those tiny matrices.
9087    ///
9088    /// `gesvdjBatched` cannot report residual and executed sweeps by function [`cusolverDnXgesvdjGetResidual`] and [`cusolverDnXgesvdjGetSweeps`]. Any call of the above two returns [`cusolverStatus_t::CUSOLVER_STATUS_NOT_SUPPORTED`]. The user needs to compute residual explicitly.
9089    ///
9090    /// The user has to provide working space pointed by input parameter `work`. The input parameter `lwork` is the size of the working space, and it is returned by `gesvdjBatched_bufferSize()`. Please note that the size in bytes of the working space is equal to `sizeof(<type>) * lwork`.
9091    ///
9092    /// The output parameter `info` is an integer array of size `batchSize`. If the function returns [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`], the first element `info[0] = -i` (less than zero) indicates `i-th` parameter is wrong (not counting handle). Otherwise, if `info[i] = min(m,n)+1`, `gesvdjBatched` does not converge on `i-th` matrix under given tolerance and maximum sweeps.
9093    ///
9094    /// Please visit [cuSOLVER Library Samples - gesvdjBatched](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/gesvdjBatched) for a code example.
9095    ///
9096    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The operation completed successfully.
9097    ///
9098    /// [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]:   The library was not initialized.
9099    ///
9100    /// [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]:   Invalid parameters were passed (`m,n<0` or `lda<max(1,m)` or `ldu<max(1,m)` or `ldv<max(1,n)` or `jobz` is not [`cusolverEigMode_t::CUSOLVER_EIG_MODE_NOVECTOR`] or [`cusolverEigMode_t::CUSOLVER_EIG_MODE_VECTOR`], or `batchSize<0`).
9101    ///
9102    /// [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]:   An internal operation failed.
9103    pub fn cusolverDnDgesvdjBatched(
9104        handle: cusolverDnHandle_t,
9105        jobz: cusolverEigMode_t,
9106        m: ::core::ffi::c_int,
9107        n: ::core::ffi::c_int,
9108        A: *mut f64,
9109        lda: ::core::ffi::c_int,
9110        S: *mut f64,
9111        U: *mut f64,
9112        ldu: ::core::ffi::c_int,
9113        V: *mut f64,
9114        ldv: ::core::ffi::c_int,
9115        work: *mut f64,
9116        lwork: ::core::ffi::c_int,
9117        info: *mut ::core::ffi::c_int,
9118        params: gesvdjInfo_t,
9119        batchSize: ::core::ffi::c_int,
9120    ) -> cusolverStatus_t;
9121}
9122unsafe extern "C" {
9123    /// The helper functions below can calculate the sizes needed for pre-allocated buffer.
9124    ///
9125    /// The S and D data types are real valued single and double precision, respectively.
9126    ///
9127    /// The C and Z data types are complex valued single and double precision, respectively.
9128    ///
9129    /// This function computes singular values and singular vectors of a sequence of general $m \times n$ matrices:
9130    ///
9131    /// $$
9132    /// A_{j} = U_{j}\\*\Sigma_{j}\\*V_{j}^{H}
9133    /// $$
9134    /// where $\Sigma_{j}$ is a real $m \times n$ diagonal matrix which is zero except for its `min(m,n)` diagonal elements. $U_{j}$ (left singular vectors) is an $m \times m$ unitary matrix and $V_{j}$ (right singular vectors) is a $n \times n$ unitary matrix. The diagonal elements of $\Sigma_{j}$ are the singular values of $A_{j}$ in either descending order or non-sorting order.
9135    ///
9136    /// `gesvdjBatched` performs `gesvdj` on each matrix. It requires that all matrices are of the same size `m,n` no greater than 32 and are packed in contiguous way,
9137    ///
9138    /// $$
9139    /// \begin{split}A = \begin{pmatrix}
9140    /// {A0} & {A1} & \cdots \\\\
9141    /// \end{pmatrix}\end{split}
9142    /// $$
9143    /// Each matrix is column-major with leading dimension `lda`, so the formula for random access is $A_{k}\operatorname{(i,j)} = {A\lbrack\ i\ +\ lda\\*j\ +\ lda\\*n\\*k\rbrack}$.
9144    ///
9145    /// The parameter `S` also contains singular values of each matrix in contiguous way,
9146    ///
9147    /// $$
9148    /// \begin{split}S = \begin{pmatrix}
9149    /// {S0} & {S1} & \cdots \\\\
9150    /// \end{pmatrix}\end{split}
9151    /// $$
9152    /// The formula for random access of `S` is $S_{k}\operatorname{(j)} = {S\lbrack\ j\ +\ min(m,n)\\*k\rbrack}$.
9153    ///
9154    /// Except for tolerance and maximum sweeps, `gesvdjBatched` can either sort the singular values in descending order (default) or chose as-is (without sorting) by the function [`cusolverDnXgesvdjSetSortEig`]. If the user packs several tiny matrices into diagonal blocks of one matrix, non-sorting option can separate singular values of those tiny matrices.
9155    ///
9156    /// `gesvdjBatched` cannot report residual and executed sweeps by function [`cusolverDnXgesvdjGetResidual`] and [`cusolverDnXgesvdjGetSweeps`]. Any call of the above two returns [`cusolverStatus_t::CUSOLVER_STATUS_NOT_SUPPORTED`]. The user needs to compute residual explicitly.
9157    ///
9158    /// The user has to provide working space pointed by input parameter `work`. The input parameter `lwork` is the size of the working space, and it is returned by `gesvdjBatched_bufferSize()`. Please note that the size in bytes of the working space is equal to `sizeof(<type>) * lwork`.
9159    ///
9160    /// The output parameter `info` is an integer array of size `batchSize`. If the function returns [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`], the first element `info[0] = -i` (less than zero) indicates `i-th` parameter is wrong (not counting handle). Otherwise, if `info[i] = min(m,n)+1`, `gesvdjBatched` does not converge on `i-th` matrix under given tolerance and maximum sweeps.
9161    ///
9162    /// Please visit [cuSOLVER Library Samples - gesvdjBatched](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/gesvdjBatched) for a code example.
9163    ///
9164    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The operation completed successfully.
9165    ///
9166    /// [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]:   The library was not initialized.
9167    ///
9168    /// [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]:   Invalid parameters were passed (`m,n<0` or `lda<max(1,m)` or `ldu<max(1,m)` or `ldv<max(1,n)` or `jobz` is not [`cusolverEigMode_t::CUSOLVER_EIG_MODE_NOVECTOR`] or [`cusolverEigMode_t::CUSOLVER_EIG_MODE_VECTOR`], or `batchSize<0`).
9169    ///
9170    /// [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]:   An internal operation failed.
9171    pub fn cusolverDnCgesvdjBatched(
9172        handle: cusolverDnHandle_t,
9173        jobz: cusolverEigMode_t,
9174        m: ::core::ffi::c_int,
9175        n: ::core::ffi::c_int,
9176        A: *mut cuComplex,
9177        lda: ::core::ffi::c_int,
9178        S: *mut f32,
9179        U: *mut cuComplex,
9180        ldu: ::core::ffi::c_int,
9181        V: *mut cuComplex,
9182        ldv: ::core::ffi::c_int,
9183        work: *mut cuComplex,
9184        lwork: ::core::ffi::c_int,
9185        info: *mut ::core::ffi::c_int,
9186        params: gesvdjInfo_t,
9187        batchSize: ::core::ffi::c_int,
9188    ) -> cusolverStatus_t;
9189}
9190unsafe extern "C" {
9191    /// The helper functions below can calculate the sizes needed for pre-allocated buffer.
9192    ///
9193    /// The S and D data types are real valued single and double precision, respectively.
9194    ///
9195    /// The C and Z data types are complex valued single and double precision, respectively.
9196    ///
9197    /// This function computes singular values and singular vectors of a sequence of general $m \times n$ matrices:
9198    ///
9199    /// $$
9200    /// A_{j} = U_{j}\\*\Sigma_{j}\\*V_{j}^{H}
9201    /// $$
9202    /// where $\Sigma_{j}$ is a real $m \times n$ diagonal matrix which is zero except for its `min(m,n)` diagonal elements. $U_{j}$ (left singular vectors) is an $m \times m$ unitary matrix and $V_{j}$ (right singular vectors) is a $n \times n$ unitary matrix. The diagonal elements of $\Sigma_{j}$ are the singular values of $A_{j}$ in either descending order or non-sorting order.
9203    ///
9204    /// `gesvdjBatched` performs `gesvdj` on each matrix. It requires that all matrices are of the same size `m,n` no greater than 32 and are packed in contiguous way,
9205    ///
9206    /// $$
9207    /// \begin{split}A = \begin{pmatrix}
9208    /// {A0} & {A1} & \cdots \\\\
9209    /// \end{pmatrix}\end{split}
9210    /// $$
9211    /// Each matrix is column-major with leading dimension `lda`, so the formula for random access is $A_{k}\operatorname{(i,j)} = {A\lbrack\ i\ +\ lda\\*j\ +\ lda\\*n\\*k\rbrack}$.
9212    ///
9213    /// The parameter `S` also contains singular values of each matrix in contiguous way,
9214    ///
9215    /// $$
9216    /// \begin{split}S = \begin{pmatrix}
9217    /// {S0} & {S1} & \cdots \\\\
9218    /// \end{pmatrix}\end{split}
9219    /// $$
9220    /// The formula for random access of `S` is $S_{k}\operatorname{(j)} = {S\lbrack\ j\ +\ min(m,n)\\*k\rbrack}$.
9221    ///
9222    /// Except for tolerance and maximum sweeps, `gesvdjBatched` can either sort the singular values in descending order (default) or chose as-is (without sorting) by the function [`cusolverDnXgesvdjSetSortEig`]. If the user packs several tiny matrices into diagonal blocks of one matrix, non-sorting option can separate singular values of those tiny matrices.
9223    ///
9224    /// `gesvdjBatched` cannot report residual and executed sweeps by function [`cusolverDnXgesvdjGetResidual`] and [`cusolverDnXgesvdjGetSweeps`]. Any call of the above two returns [`cusolverStatus_t::CUSOLVER_STATUS_NOT_SUPPORTED`]. The user needs to compute residual explicitly.
9225    ///
9226    /// The user has to provide working space pointed by input parameter `work`. The input parameter `lwork` is the size of the working space, and it is returned by `gesvdjBatched_bufferSize()`. Please note that the size in bytes of the working space is equal to `sizeof(<type>) * lwork`.
9227    ///
9228    /// The output parameter `info` is an integer array of size `batchSize`. If the function returns [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`], the first element `info[0] = -i` (less than zero) indicates `i-th` parameter is wrong (not counting handle). Otherwise, if `info[i] = min(m,n)+1`, `gesvdjBatched` does not converge on `i-th` matrix under given tolerance and maximum sweeps.
9229    ///
9230    /// Please visit [cuSOLVER Library Samples - gesvdjBatched](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/gesvdjBatched) for a code example.
9231    ///
9232    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The operation completed successfully.
9233    ///
9234    /// [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]:   The library was not initialized.
9235    ///
9236    /// [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]:   Invalid parameters were passed (`m,n<0` or `lda<max(1,m)` or `ldu<max(1,m)` or `ldv<max(1,n)` or `jobz` is not [`cusolverEigMode_t::CUSOLVER_EIG_MODE_NOVECTOR`] or [`cusolverEigMode_t::CUSOLVER_EIG_MODE_VECTOR`], or `batchSize<0`).
9237    ///
9238    /// [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]:   An internal operation failed.
9239    pub fn cusolverDnZgesvdjBatched(
9240        handle: cusolverDnHandle_t,
9241        jobz: cusolverEigMode_t,
9242        m: ::core::ffi::c_int,
9243        n: ::core::ffi::c_int,
9244        A: *mut cuDoubleComplex,
9245        lda: ::core::ffi::c_int,
9246        S: *mut f64,
9247        U: *mut cuDoubleComplex,
9248        ldu: ::core::ffi::c_int,
9249        V: *mut cuDoubleComplex,
9250        ldv: ::core::ffi::c_int,
9251        work: *mut cuDoubleComplex,
9252        lwork: ::core::ffi::c_int,
9253        info: *mut ::core::ffi::c_int,
9254        params: gesvdjInfo_t,
9255        batchSize: ::core::ffi::c_int,
9256    ) -> cusolverStatus_t;
9257}
9258unsafe extern "C" {
9259    pub fn cusolverDnSgesvdj_bufferSize(
9260        handle: cusolverDnHandle_t,
9261        jobz: cusolverEigMode_t,
9262        econ: ::core::ffi::c_int,
9263        m: ::core::ffi::c_int,
9264        n: ::core::ffi::c_int,
9265        A: *const f32,
9266        lda: ::core::ffi::c_int,
9267        S: *const f32,
9268        U: *const f32,
9269        ldu: ::core::ffi::c_int,
9270        V: *const f32,
9271        ldv: ::core::ffi::c_int,
9272        lwork: *mut ::core::ffi::c_int,
9273        params: gesvdjInfo_t,
9274    ) -> cusolverStatus_t;
9275}
9276unsafe extern "C" {
9277    pub fn cusolverDnDgesvdj_bufferSize(
9278        handle: cusolverDnHandle_t,
9279        jobz: cusolverEigMode_t,
9280        econ: ::core::ffi::c_int,
9281        m: ::core::ffi::c_int,
9282        n: ::core::ffi::c_int,
9283        A: *const f64,
9284        lda: ::core::ffi::c_int,
9285        S: *const f64,
9286        U: *const f64,
9287        ldu: ::core::ffi::c_int,
9288        V: *const f64,
9289        ldv: ::core::ffi::c_int,
9290        lwork: *mut ::core::ffi::c_int,
9291        params: gesvdjInfo_t,
9292    ) -> cusolverStatus_t;
9293}
9294unsafe extern "C" {
9295    pub fn cusolverDnCgesvdj_bufferSize(
9296        handle: cusolverDnHandle_t,
9297        jobz: cusolverEigMode_t,
9298        econ: ::core::ffi::c_int,
9299        m: ::core::ffi::c_int,
9300        n: ::core::ffi::c_int,
9301        A: *const cuComplex,
9302        lda: ::core::ffi::c_int,
9303        S: *const f32,
9304        U: *const cuComplex,
9305        ldu: ::core::ffi::c_int,
9306        V: *const cuComplex,
9307        ldv: ::core::ffi::c_int,
9308        lwork: *mut ::core::ffi::c_int,
9309        params: gesvdjInfo_t,
9310    ) -> cusolverStatus_t;
9311}
9312unsafe extern "C" {
9313    pub fn cusolverDnZgesvdj_bufferSize(
9314        handle: cusolverDnHandle_t,
9315        jobz: cusolverEigMode_t,
9316        econ: ::core::ffi::c_int,
9317        m: ::core::ffi::c_int,
9318        n: ::core::ffi::c_int,
9319        A: *const cuDoubleComplex,
9320        lda: ::core::ffi::c_int,
9321        S: *const f64,
9322        U: *const cuDoubleComplex,
9323        ldu: ::core::ffi::c_int,
9324        V: *const cuDoubleComplex,
9325        ldv: ::core::ffi::c_int,
9326        lwork: *mut ::core::ffi::c_int,
9327        params: gesvdjInfo_t,
9328    ) -> cusolverStatus_t;
9329}
9330unsafe extern "C" {
9331    /// The helper functions below can calculate the sizes needed for pre-allocated buffer.
9332    ///
9333    /// The S and D data types are real valued single and double precision, respectively.
9334    ///
9335    /// The C and Z data types are complex valued single and double precision, respectively.
9336    ///
9337    /// This function computes the singular value decomposition (SVD) of an $m \times n$ matrix `A` and corresponding the left and/or right singular vectors. The SVD is written:
9338    ///
9339    /// $$
9340    /// A = U\\*\Sigma\\*V^{H}
9341    /// $$
9342    /// where $\Sigma$ is an $m \times n$ matrix which is zero except for its `min(m,n)` diagonal elements, `U` is an $m \times m$ unitary matrix, and `V` is an $n \times n$ unitary matrix. The diagonal elements of $\Sigma$ are the singular values of `A`; they are real and non-negative, and are returned in descending order. The first `min(m,n)` columns of `U` and `V` are the left and right singular vectors of `A`.
9343    ///
9344    /// `gesvdj` has the same functionality as `gesvd`. The difference is that `gesvd` uses QR algorithm and `gesvdj` uses Jacobi method. The parallelism of Jacobi method gives GPU better performance on small and medium size matrices. Moreover the user can configure `gesvdj` to perform approximation up to certain accuracy.
9345    ///
9346    /// `gesvdj` iteratively generates a sequence of unitary matrices to transform matrix `A` to the following form:
9347    ///
9348    /// $$
9349    /// U^{H}\\*A\\*V = S + E
9350    /// $$
9351    /// where `S` is diagonal and diagonal of `E` is zero.
9352    ///
9353    /// During the iterations, the Frobenius norm of `E` decreases monotonically. As `E` goes down to zero, `S` is the set of singular values. In practice, Jacobi method stops if:
9354    ///
9355    /// $$
9356    /// {\\|E\\|}_{F}\leq\operatorname{eps}\\*{\\|A\\|}_{F}
9357    /// $$
9358    /// where `eps` is given tolerance. Note that if the real residual norm:
9359    ///
9360    /// $$
9361    /// {\\|{S} - {U}^{H}\\*{A}\\*{V}\\|}_{F}
9362    /// $$
9363    /// is computed, it will differ from ${\\|{E}\\|}_{F}$ up to roundoff errors of order $N = max(m, n)$, to still have the standard SVD accuracy expectation:
9364    ///
9365    /// $$
9366    /// \frac{\\|S - U^{H} \\* A \\* V\\|_F}{O(N) \\* \\|A\\|_F} \leq \frac{\\|E\\|_F}{\\|A\\|_F} \leq \operatorname{eps}
9367    /// $$
9368    /// $O(N)$ is typically $N$, but the constant depends on the number of sweeps, which gives an upper roundoff error bound of $sweeps \\* N$.
9369    ///
9370    /// `gesvdj` has two parameters to control the accuracy. First parameter is tolerance (`eps`). The default value is machine accuracy but The user can use function [`cusolverDnXgesvdjSetTolerance`] to set a priori tolerance. The second parameter is maximum number of sweeps which controls number of iterations of Jacobi method. The default value is 100 but the user can use function [`cusolverDnXgesvdjSetMaxSweeps`] to set a proper bound. The experiments show 15 sweeps are good enough to converge to machine accuracy. `gesvdj` stops either tolerance is met or maximum number of sweeps is met.
9371    ///
9372    /// Jacobi method has quadratic convergence, so the accuracy is not proportional to number of sweeps. To guarantee certain accuracy, the user should configure tolerance only.
9373    ///
9374    /// The user has to provide working space which is pointed by input parameter `work`. The input parameter `lwork` is the size of the working space, and it is returned by `gesvdj_bufferSize()`. Please note that the size in bytes of the working space is equal to `sizeof(<type>) * lwork`.
9375    ///
9376    /// If output parameter `info = -i` (less than zero), the `i-th` parameter is wrong (not counting handle). If `info = min(m,n)+1`, `gesvdj` does not converge under given tolerance and maximum sweeps.
9377    ///
9378    /// If the user sets an improper tolerance, `gesvdj` may not converge. For example, tolerance should not be smaller than machine accuracy.
9379    ///
9380    /// Please visit [cuSOLVER Library Samples - gesvdj](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/gesvdj) for a code example.
9381    ///
9382    /// Remark 1: `gesvdj` supports any combination of `m` and `n`.
9383    ///
9384    /// Remark 2: the routine returns `V`, not $V^{H}$. This is different from `gesvd`.
9385    ///
9386    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The operation completed successfully.
9387    ///
9388    /// [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]:   The library was not initialized.
9389    ///
9390    /// [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]:   Invalid parameters were passed (`m,n<0` or `lda<max(1,m)` or `ldu<max(1,m)` or `ldv<max(1,n)` or `jobz` is not [`cusolverEigMode_t::CUSOLVER_EIG_MODE_NOVECTOR`] or [`cusolverEigMode_t::CUSOLVER_EIG_MODE_VECTOR`] ).
9391    ///
9392    /// [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]:   An internal operation failed.
9393    pub fn cusolverDnSgesvdj(
9394        handle: cusolverDnHandle_t,
9395        jobz: cusolverEigMode_t,
9396        econ: ::core::ffi::c_int,
9397        m: ::core::ffi::c_int,
9398        n: ::core::ffi::c_int,
9399        A: *mut f32,
9400        lda: ::core::ffi::c_int,
9401        S: *mut f32,
9402        U: *mut f32,
9403        ldu: ::core::ffi::c_int,
9404        V: *mut f32,
9405        ldv: ::core::ffi::c_int,
9406        work: *mut f32,
9407        lwork: ::core::ffi::c_int,
9408        info: *mut ::core::ffi::c_int,
9409        params: gesvdjInfo_t,
9410    ) -> cusolverStatus_t;
9411}
9412unsafe extern "C" {
9413    /// The helper functions below can calculate the sizes needed for pre-allocated buffer.
9414    ///
9415    /// The S and D data types are real valued single and double precision, respectively.
9416    ///
9417    /// The C and Z data types are complex valued single and double precision, respectively.
9418    ///
9419    /// This function computes the singular value decomposition (SVD) of an $m \times n$ matrix `A` and corresponding the left and/or right singular vectors. The SVD is written:
9420    ///
9421    /// $$
9422    /// A = U\\*\Sigma\\*V^{H}
9423    /// $$
9424    /// where $\Sigma$ is an $m \times n$ matrix which is zero except for its `min(m,n)` diagonal elements, `U` is an $m \times m$ unitary matrix, and `V` is an $n \times n$ unitary matrix. The diagonal elements of $\Sigma$ are the singular values of `A`; they are real and non-negative, and are returned in descending order. The first `min(m,n)` columns of `U` and `V` are the left and right singular vectors of `A`.
9425    ///
9426    /// `gesvdj` has the same functionality as `gesvd`. The difference is that `gesvd` uses QR algorithm and `gesvdj` uses Jacobi method. The parallelism of Jacobi method gives GPU better performance on small and medium size matrices. Moreover the user can configure `gesvdj` to perform approximation up to certain accuracy.
9427    ///
9428    /// `gesvdj` iteratively generates a sequence of unitary matrices to transform matrix `A` to the following form:
9429    ///
9430    /// $$
9431    /// U^{H}\\*A\\*V = S + E
9432    /// $$
9433    /// where `S` is diagonal and diagonal of `E` is zero.
9434    ///
9435    /// During the iterations, the Frobenius norm of `E` decreases monotonically. As `E` goes down to zero, `S` is the set of singular values. In practice, Jacobi method stops if:
9436    ///
9437    /// $$
9438    /// {\\|E\\|}_{F}\leq\operatorname{eps}\\*{\\|A\\|}_{F}
9439    /// $$
9440    /// where `eps` is given tolerance. Note that if the real residual norm:
9441    ///
9442    /// $$
9443    /// {\\|{S} - {U}^{H}\\*{A}\\*{V}\\|}_{F}
9444    /// $$
9445    /// is computed, it will differ from ${\\|{E}\\|}_{F}$ up to roundoff errors of order $N = max(m, n)$, to still have the standard SVD accuracy expectation:
9446    ///
9447    /// $$
9448    /// \frac{\\|S - U^{H} \\* A \\* V\\|_F}{O(N) \\* \\|A\\|_F} \leq \frac{\\|E\\|_F}{\\|A\\|_F} \leq \operatorname{eps}
9449    /// $$
9450    /// $O(N)$ is typically $N$, but the constant depends on the number of sweeps, which gives an upper roundoff error bound of $sweeps \\* N$.
9451    ///
9452    /// `gesvdj` has two parameters to control the accuracy. First parameter is tolerance (`eps`). The default value is machine accuracy but The user can use function [`cusolverDnXgesvdjSetTolerance`] to set a priori tolerance. The second parameter is maximum number of sweeps which controls number of iterations of Jacobi method. The default value is 100 but the user can use function [`cusolverDnXgesvdjSetMaxSweeps`] to set a proper bound. The experiments show 15 sweeps are good enough to converge to machine accuracy. `gesvdj` stops either tolerance is met or maximum number of sweeps is met.
9453    ///
9454    /// Jacobi method has quadratic convergence, so the accuracy is not proportional to number of sweeps. To guarantee certain accuracy, the user should configure tolerance only.
9455    ///
9456    /// The user has to provide working space which is pointed by input parameter `work`. The input parameter `lwork` is the size of the working space, and it is returned by `gesvdj_bufferSize()`. Please note that the size in bytes of the working space is equal to `sizeof(<type>) * lwork`.
9457    ///
9458    /// If output parameter `info = -i` (less than zero), the `i-th` parameter is wrong (not counting handle). If `info = min(m,n)+1`, `gesvdj` does not converge under given tolerance and maximum sweeps.
9459    ///
9460    /// If the user sets an improper tolerance, `gesvdj` may not converge. For example, tolerance should not be smaller than machine accuracy.
9461    ///
9462    /// Please visit [cuSOLVER Library Samples - gesvdj](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/gesvdj) for a code example.
9463    ///
9464    /// Remark 1: `gesvdj` supports any combination of `m` and `n`.
9465    ///
9466    /// Remark 2: the routine returns `V`, not $V^{H}$. This is different from `gesvd`.
9467    ///
9468    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The operation completed successfully.
9469    ///
9470    /// [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]:   The library was not initialized.
9471    ///
9472    /// [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]:   Invalid parameters were passed (`m,n<0` or `lda<max(1,m)` or `ldu<max(1,m)` or `ldv<max(1,n)` or `jobz` is not [`cusolverEigMode_t::CUSOLVER_EIG_MODE_NOVECTOR`] or [`cusolverEigMode_t::CUSOLVER_EIG_MODE_VECTOR`] ).
9473    ///
9474    /// [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]:   An internal operation failed.
9475    pub fn cusolverDnDgesvdj(
9476        handle: cusolverDnHandle_t,
9477        jobz: cusolverEigMode_t,
9478        econ: ::core::ffi::c_int,
9479        m: ::core::ffi::c_int,
9480        n: ::core::ffi::c_int,
9481        A: *mut f64,
9482        lda: ::core::ffi::c_int,
9483        S: *mut f64,
9484        U: *mut f64,
9485        ldu: ::core::ffi::c_int,
9486        V: *mut f64,
9487        ldv: ::core::ffi::c_int,
9488        work: *mut f64,
9489        lwork: ::core::ffi::c_int,
9490        info: *mut ::core::ffi::c_int,
9491        params: gesvdjInfo_t,
9492    ) -> cusolverStatus_t;
9493}
9494unsafe extern "C" {
9495    /// The helper functions below can calculate the sizes needed for pre-allocated buffer.
9496    ///
9497    /// The S and D data types are real valued single and double precision, respectively.
9498    ///
9499    /// The C and Z data types are complex valued single and double precision, respectively.
9500    ///
9501    /// This function computes the singular value decomposition (SVD) of an $m \times n$ matrix `A` and corresponding the left and/or right singular vectors. The SVD is written:
9502    ///
9503    /// $$
9504    /// A = U\\*\Sigma\\*V^{H}
9505    /// $$
9506    /// where $\Sigma$ is an $m \times n$ matrix which is zero except for its `min(m,n)` diagonal elements, `U` is an $m \times m$ unitary matrix, and `V` is an $n \times n$ unitary matrix. The diagonal elements of $\Sigma$ are the singular values of `A`; they are real and non-negative, and are returned in descending order. The first `min(m,n)` columns of `U` and `V` are the left and right singular vectors of `A`.
9507    ///
9508    /// `gesvdj` has the same functionality as `gesvd`. The difference is that `gesvd` uses QR algorithm and `gesvdj` uses Jacobi method. The parallelism of Jacobi method gives GPU better performance on small and medium size matrices. Moreover the user can configure `gesvdj` to perform approximation up to certain accuracy.
9509    ///
9510    /// `gesvdj` iteratively generates a sequence of unitary matrices to transform matrix `A` to the following form:
9511    ///
9512    /// $$
9513    /// U^{H}\\*A\\*V = S + E
9514    /// $$
9515    /// where `S` is diagonal and diagonal of `E` is zero.
9516    ///
9517    /// During the iterations, the Frobenius norm of `E` decreases monotonically. As `E` goes down to zero, `S` is the set of singular values. In practice, Jacobi method stops if:
9518    ///
9519    /// $$
9520    /// {\\|E\\|}_{F}\leq\operatorname{eps}\\*{\\|A\\|}_{F}
9521    /// $$
9522    /// where `eps` is given tolerance. Note that if the real residual norm:
9523    ///
9524    /// $$
9525    /// {\\|{S} - {U}^{H}\\*{A}\\*{V}\\|}_{F}
9526    /// $$
9527    /// is computed, it will differ from ${\\|{E}\\|}_{F}$ up to roundoff errors of order $N = max(m, n)$, to still have the standard SVD accuracy expectation:
9528    ///
9529    /// $$
9530    /// \frac{\\|S - U^{H} \\* A \\* V\\|_F}{O(N) \\* \\|A\\|_F} \leq \frac{\\|E\\|_F}{\\|A\\|_F} \leq \operatorname{eps}
9531    /// $$
9532    /// $O(N)$ is typically $N$, but the constant depends on the number of sweeps, which gives an upper roundoff error bound of $sweeps \\* N$.
9533    ///
9534    /// `gesvdj` has two parameters to control the accuracy. First parameter is tolerance (`eps`). The default value is machine accuracy but The user can use function [`cusolverDnXgesvdjSetTolerance`] to set a priori tolerance. The second parameter is maximum number of sweeps which controls number of iterations of Jacobi method. The default value is 100 but the user can use function [`cusolverDnXgesvdjSetMaxSweeps`] to set a proper bound. The experiments show 15 sweeps are good enough to converge to machine accuracy. `gesvdj` stops either tolerance is met or maximum number of sweeps is met.
9535    ///
9536    /// Jacobi method has quadratic convergence, so the accuracy is not proportional to number of sweeps. To guarantee certain accuracy, the user should configure tolerance only.
9537    ///
9538    /// The user has to provide working space which is pointed by input parameter `work`. The input parameter `lwork` is the size of the working space, and it is returned by `gesvdj_bufferSize()`. Please note that the size in bytes of the working space is equal to `sizeof(<type>) * lwork`.
9539    ///
9540    /// If output parameter `info = -i` (less than zero), the `i-th` parameter is wrong (not counting handle). If `info = min(m,n)+1`, `gesvdj` does not converge under given tolerance and maximum sweeps.
9541    ///
9542    /// If the user sets an improper tolerance, `gesvdj` may not converge. For example, tolerance should not be smaller than machine accuracy.
9543    ///
9544    /// Please visit [cuSOLVER Library Samples - gesvdj](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/gesvdj) for a code example.
9545    ///
9546    /// Remark 1: `gesvdj` supports any combination of `m` and `n`.
9547    ///
9548    /// Remark 2: the routine returns `V`, not $V^{H}$. This is different from `gesvd`.
9549    ///
9550    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The operation completed successfully.
9551    ///
9552    /// [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]:   The library was not initialized.
9553    ///
9554    /// [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]:   Invalid parameters were passed (`m,n<0` or `lda<max(1,m)` or `ldu<max(1,m)` or `ldv<max(1,n)` or `jobz` is not [`cusolverEigMode_t::CUSOLVER_EIG_MODE_NOVECTOR`] or [`cusolverEigMode_t::CUSOLVER_EIG_MODE_VECTOR`] ).
9555    ///
9556    /// [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]:   An internal operation failed.
9557    pub fn cusolverDnCgesvdj(
9558        handle: cusolverDnHandle_t,
9559        jobz: cusolverEigMode_t,
9560        econ: ::core::ffi::c_int,
9561        m: ::core::ffi::c_int,
9562        n: ::core::ffi::c_int,
9563        A: *mut cuComplex,
9564        lda: ::core::ffi::c_int,
9565        S: *mut f32,
9566        U: *mut cuComplex,
9567        ldu: ::core::ffi::c_int,
9568        V: *mut cuComplex,
9569        ldv: ::core::ffi::c_int,
9570        work: *mut cuComplex,
9571        lwork: ::core::ffi::c_int,
9572        info: *mut ::core::ffi::c_int,
9573        params: gesvdjInfo_t,
9574    ) -> cusolverStatus_t;
9575}
9576unsafe extern "C" {
9577    /// The helper functions below can calculate the sizes needed for pre-allocated buffer.
9578    ///
9579    /// The S and D data types are real valued single and double precision, respectively.
9580    ///
9581    /// The C and Z data types are complex valued single and double precision, respectively.
9582    ///
9583    /// This function computes the singular value decomposition (SVD) of an $m \times n$ matrix `A` and corresponding the left and/or right singular vectors. The SVD is written:
9584    ///
9585    /// $$
9586    /// A = U\\*\Sigma\\*V^{H}
9587    /// $$
9588    /// where $\Sigma$ is an $m \times n$ matrix which is zero except for its `min(m,n)` diagonal elements, `U` is an $m \times m$ unitary matrix, and `V` is an $n \times n$ unitary matrix. The diagonal elements of $\Sigma$ are the singular values of `A`; they are real and non-negative, and are returned in descending order. The first `min(m,n)` columns of `U` and `V` are the left and right singular vectors of `A`.
9589    ///
9590    /// `gesvdj` has the same functionality as `gesvd`. The difference is that `gesvd` uses QR algorithm and `gesvdj` uses Jacobi method. The parallelism of Jacobi method gives GPU better performance on small and medium size matrices. Moreover the user can configure `gesvdj` to perform approximation up to certain accuracy.
9591    ///
9592    /// `gesvdj` iteratively generates a sequence of unitary matrices to transform matrix `A` to the following form:
9593    ///
9594    /// $$
9595    /// U^{H}\\*A\\*V = S + E
9596    /// $$
9597    /// where `S` is diagonal and diagonal of `E` is zero.
9598    ///
9599    /// During the iterations, the Frobenius norm of `E` decreases monotonically. As `E` goes down to zero, `S` is the set of singular values. In practice, Jacobi method stops if:
9600    ///
9601    /// $$
9602    /// {\\|E\\|}_{F}\leq\operatorname{eps}\\*{\\|A\\|}_{F}
9603    /// $$
9604    /// where `eps` is given tolerance. Note that if the real residual norm:
9605    ///
9606    /// $$
9607    /// {\\|{S} - {U}^{H}\\*{A}\\*{V}\\|}_{F}
9608    /// $$
9609    /// is computed, it will differ from ${\\|{E}\\|}_{F}$ up to roundoff errors of order $N = max(m, n)$, to still have the standard SVD accuracy expectation:
9610    ///
9611    /// $$
9612    /// \frac{\\|S - U^{H} \\* A \\* V\\|_F}{O(N) \\* \\|A\\|_F} \leq \frac{\\|E\\|_F}{\\|A\\|_F} \leq \operatorname{eps}
9613    /// $$
9614    /// $O(N)$ is typically $N$, but the constant depends on the number of sweeps, which gives an upper roundoff error bound of $sweeps \\* N$.
9615    ///
9616    /// `gesvdj` has two parameters to control the accuracy. First parameter is tolerance (`eps`). The default value is machine accuracy but The user can use function [`cusolverDnXgesvdjSetTolerance`] to set a priori tolerance. The second parameter is maximum number of sweeps which controls number of iterations of Jacobi method. The default value is 100 but the user can use function [`cusolverDnXgesvdjSetMaxSweeps`] to set a proper bound. The experiments show 15 sweeps are good enough to converge to machine accuracy. `gesvdj` stops either tolerance is met or maximum number of sweeps is met.
9617    ///
9618    /// Jacobi method has quadratic convergence, so the accuracy is not proportional to number of sweeps. To guarantee certain accuracy, the user should configure tolerance only.
9619    ///
9620    /// The user has to provide working space which is pointed by input parameter `work`. The input parameter `lwork` is the size of the working space, and it is returned by `gesvdj_bufferSize()`. Please note that the size in bytes of the working space is equal to `sizeof(<type>) * lwork`.
9621    ///
9622    /// If output parameter `info = -i` (less than zero), the `i-th` parameter is wrong (not counting handle). If `info = min(m,n)+1`, `gesvdj` does not converge under given tolerance and maximum sweeps.
9623    ///
9624    /// If the user sets an improper tolerance, `gesvdj` may not converge. For example, tolerance should not be smaller than machine accuracy.
9625    ///
9626    /// Please visit [cuSOLVER Library Samples - gesvdj](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/gesvdj) for a code example.
9627    ///
9628    /// Remark 1: `gesvdj` supports any combination of `m` and `n`.
9629    ///
9630    /// Remark 2: the routine returns `V`, not $V^{H}$. This is different from `gesvd`.
9631    ///
9632    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The operation completed successfully.
9633    ///
9634    /// [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]:   The library was not initialized.
9635    ///
9636    /// [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]:   Invalid parameters were passed (`m,n<0` or `lda<max(1,m)` or `ldu<max(1,m)` or `ldv<max(1,n)` or `jobz` is not [`cusolverEigMode_t::CUSOLVER_EIG_MODE_NOVECTOR`] or [`cusolverEigMode_t::CUSOLVER_EIG_MODE_VECTOR`] ).
9637    ///
9638    /// [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]:   An internal operation failed.
9639    pub fn cusolverDnZgesvdj(
9640        handle: cusolverDnHandle_t,
9641        jobz: cusolverEigMode_t,
9642        econ: ::core::ffi::c_int,
9643        m: ::core::ffi::c_int,
9644        n: ::core::ffi::c_int,
9645        A: *mut cuDoubleComplex,
9646        lda: ::core::ffi::c_int,
9647        S: *mut f64,
9648        U: *mut cuDoubleComplex,
9649        ldu: ::core::ffi::c_int,
9650        V: *mut cuDoubleComplex,
9651        ldv: ::core::ffi::c_int,
9652        work: *mut cuDoubleComplex,
9653        lwork: ::core::ffi::c_int,
9654        info: *mut ::core::ffi::c_int,
9655        params: gesvdjInfo_t,
9656    ) -> cusolverStatus_t;
9657}
9658unsafe extern "C" {
9659    pub fn cusolverDnSgesvdaStridedBatched_bufferSize(
9660        handle: cusolverDnHandle_t,
9661        jobz: cusolverEigMode_t,
9662        rank: ::core::ffi::c_int,
9663        m: ::core::ffi::c_int,
9664        n: ::core::ffi::c_int,
9665        d_A: *const f32,
9666        lda: ::core::ffi::c_int,
9667        strideA: ::core::ffi::c_longlong,
9668        d_S: *const f32,
9669        strideS: ::core::ffi::c_longlong,
9670        d_U: *const f32,
9671        ldu: ::core::ffi::c_int,
9672        strideU: ::core::ffi::c_longlong,
9673        d_V: *const f32,
9674        ldv: ::core::ffi::c_int,
9675        strideV: ::core::ffi::c_longlong,
9676        lwork: *mut ::core::ffi::c_int,
9677        batchSize: ::core::ffi::c_int,
9678    ) -> cusolverStatus_t;
9679}
9680unsafe extern "C" {
9681    pub fn cusolverDnDgesvdaStridedBatched_bufferSize(
9682        handle: cusolverDnHandle_t,
9683        jobz: cusolverEigMode_t,
9684        rank: ::core::ffi::c_int,
9685        m: ::core::ffi::c_int,
9686        n: ::core::ffi::c_int,
9687        d_A: *const f64,
9688        lda: ::core::ffi::c_int,
9689        strideA: ::core::ffi::c_longlong,
9690        d_S: *const f64,
9691        strideS: ::core::ffi::c_longlong,
9692        d_U: *const f64,
9693        ldu: ::core::ffi::c_int,
9694        strideU: ::core::ffi::c_longlong,
9695        d_V: *const f64,
9696        ldv: ::core::ffi::c_int,
9697        strideV: ::core::ffi::c_longlong,
9698        lwork: *mut ::core::ffi::c_int,
9699        batchSize: ::core::ffi::c_int,
9700    ) -> cusolverStatus_t;
9701}
9702unsafe extern "C" {
9703    pub fn cusolverDnCgesvdaStridedBatched_bufferSize(
9704        handle: cusolverDnHandle_t,
9705        jobz: cusolverEigMode_t,
9706        rank: ::core::ffi::c_int,
9707        m: ::core::ffi::c_int,
9708        n: ::core::ffi::c_int,
9709        d_A: *const cuComplex,
9710        lda: ::core::ffi::c_int,
9711        strideA: ::core::ffi::c_longlong,
9712        d_S: *const f32,
9713        strideS: ::core::ffi::c_longlong,
9714        d_U: *const cuComplex,
9715        ldu: ::core::ffi::c_int,
9716        strideU: ::core::ffi::c_longlong,
9717        d_V: *const cuComplex,
9718        ldv: ::core::ffi::c_int,
9719        strideV: ::core::ffi::c_longlong,
9720        lwork: *mut ::core::ffi::c_int,
9721        batchSize: ::core::ffi::c_int,
9722    ) -> cusolverStatus_t;
9723}
9724unsafe extern "C" {
9725    pub fn cusolverDnZgesvdaStridedBatched_bufferSize(
9726        handle: cusolverDnHandle_t,
9727        jobz: cusolverEigMode_t,
9728        rank: ::core::ffi::c_int,
9729        m: ::core::ffi::c_int,
9730        n: ::core::ffi::c_int,
9731        d_A: *const cuDoubleComplex,
9732        lda: ::core::ffi::c_int,
9733        strideA: ::core::ffi::c_longlong,
9734        d_S: *const f64,
9735        strideS: ::core::ffi::c_longlong,
9736        d_U: *const cuDoubleComplex,
9737        ldu: ::core::ffi::c_int,
9738        strideU: ::core::ffi::c_longlong,
9739        d_V: *const cuDoubleComplex,
9740        ldv: ::core::ffi::c_int,
9741        strideV: ::core::ffi::c_longlong,
9742        lwork: *mut ::core::ffi::c_int,
9743        batchSize: ::core::ffi::c_int,
9744    ) -> cusolverStatus_t;
9745}
9746unsafe extern "C" {
9747    /// The helper functions below can calculate the sizes needed for pre-allocated buffer.
9748    ///
9749    /// The S and D data types are real valued single and double precision, respectively.
9750    ///
9751    /// The C and Z data types are complex valued single and double precision, respectively.
9752    ///
9753    /// This function `gesvda` (`a` stands for approximate) approximates the singular value decomposition of a tall skinny $m \times n$ matrix `A` and corresponding the left and right singular vectors. The economy form of SVD is written by:
9754    ///
9755    /// $$
9756    /// A = U\\*\Sigma\\*V^{H}
9757    /// $$
9758    /// where $\Sigma$ is an $n \times n$ matrix. `U` is an $m \times n$ unitary matrix, and `V` is an $n \times n$ unitary matrix. The diagonal elements of $\Sigma$ are the singular values of `A`; they are real and non-negative, and are returned in descending order. `U` and `V` are the left and right singular vectors of `A`.
9759    ///
9760    /// `gesvda` computes eigenvalues of `A**T*A`, or `A**H*A` (if `A` is complex), to approximate singular values and singular vectors. It generates matrices `U` and `V` and transforms the matrix `A` to the following form:
9761    ///
9762    /// $$
9763    /// U^{H}\\*A\\*V = S + E
9764    /// $$
9765    /// where `S` is diagonal and `E` depends on rounding errors. To certain conditions, `U`, `V` and `S` approximate singular values and singular vectors up to machine zero of single precision. In general, `V` is unitary, `S` is more accurate than `U`. If singular value is far from zero, then left singular vector `U` is accurate. In other words, the accuracy of singular values and left singular vectors depend on the distance between singular value and zero. Since the computation of `A**T*A`, or `A**H*A` can greatly amplify errors, it is recommended to use `gesvda` only with well-conditioned data.
9766    ///
9767    /// The input parameter `rank` decides the number of singular values and singular vectors are computed in parameter `S`, `U` and `V`.
9768    ///
9769    /// The output parameter `h_RnrmF` computes Frobenius norm of residual. To compute `h_RnrmF`, `info != NULL` is required.
9770    ///
9771    /// $$
9772    /// A - U\\*S\\*V^{H}
9773    /// $$
9774    /// if the parameter `rank` is equal `n`. Otherwise, `h_RnrmF` reports:
9775    ///
9776    /// $$
9777    /// {\\|}U\\*S\\*V^{H}{\\|} - {\\|S\\|}
9778    /// $$
9779    /// in Frobenius norm sense, that is, how far `U` is from unitary.
9780    ///
9781    /// `gesvdaStridedBatched` performs `gesvda` on each matrix. It requires that all matrices are of the same size `m,n` and are packed in a contiguous way,
9782    ///
9783    /// $$
9784    /// \begin{split}A = \begin{pmatrix}
9785    /// {A0} & {A1} & \cdots \\\\
9786    /// \end{pmatrix}\end{split}
9787    /// $$
9788    /// Each matrix is column-major with leading dimension `lda`, so the formula for random access is $A_{k}\operatorname{(i,j)} = {A\lbrack\ i\ +\ lda\\*j\ +\ strideA\\*k\rbrack}$. Similarly, the formula for random access of `S` is $S_{k}\operatorname{(j)} = {S\lbrack\ j\ +\ StrideS\\*k\rbrack}$, the formula for random access of `U` is $U_{k}\operatorname{(i,j)} = {U\lbrack\ i\ +\ ldu\\*j\ +\ strideU\\*k\rbrack}$ and the formula for random access of `V` is $V_{k}\operatorname{(i,j)} = {V\lbrack\ i\ +\ ldv\\*j\ +\ strideV\\*k\rbrack}$.
9789    ///
9790    /// The user has to provide working space which is pointed by input parameter `work`. The input parameter `lwork` is the size of the working space, and it is returned by `gesvdaStridedBatched_bufferSize()`. Please note that the size in bytes of the working space is equal to `sizeof(<type>) * lwork`.
9791    ///
9792    /// The output parameter `info` is an integer array of size `batchSize`. If the function returns [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`], the first element `info[0] = -i` (less than zero) indicates `i-th` parameter is wrong (not counting handle). Otherwise, if `info[i] = min(m,n)+1`, `gesvdaStridedBatched` did not converge on the `i-th` matrix. If `0 < info[i] < min(m,n)+1`, `gesvdaStridedBatched` could not compute an SVD of the `i-th` matrix fully; the leading singular values `Si[k]`, `0 <= k <= info[i]-1`, and corresponding singular vectors may still be useful. In this case, if `h_RnrmF` is requested, `h_RnrmF` reports the residual as if `rank` was set to `info[i]-1`.
9793    ///
9794    /// Note that the problem size is limited by the condition `batchSize*stride{A/S/U/V}<=INT32_MAX` primarily due to the current implementation constraints.
9795    ///
9796    /// Please visit [cuSOLVER Library Samples - gesvdaStridedBatched](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/gesvdaStridedBatched) for a code example.
9797    ///
9798    /// Remark 1: The routine returns `V`, not $V^{H}$. This is different from `gesvd`.
9799    ///
9800    /// Remark 2: The routine only supports `m >=n`.
9801    ///
9802    /// Remark 3: It is recommended to use an FP64 data type, that is `DgesvdaStridedBatched` or `ZgesvdaStridedBatched`.
9803    ///
9804    /// Remark 4: If the user is confident on the accuracy of singular values and singular vectors, for example, certain conditions hold (required singular value is far from zero), then the performance can be improved by passing a null pointer to `h_RnrmF`, i.e. no computation of the residual norm.
9805    ///
9806    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The operation completed successfully.
9807    ///
9808    /// [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]:   The library was not initialized.
9809    ///
9810    /// [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]:   Invalid parameters were passed (`m,n<0` or `batchSize*stride{A/S/U/V}>INT32_MAX` or `lda<max(1,m)` or `ldu<max(1,m)` or `ldv<max(1,n)` or `strideA<lda*n` or `strideS<rank` or `strideU<ldu*rank` or `strideV<ldv*rank` or `batchSize<1` or `jobz` is not [`cusolverEigMode_t::CUSOLVER_EIG_MODE_NOVECTOR`] or [`cusolverEigMode_t::CUSOLVER_EIG_MODE_VECTOR`]).
9811    ///
9812    /// [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]:   An internal operation failed.
9813    pub fn cusolverDnSgesvdaStridedBatched(
9814        handle: cusolverDnHandle_t,
9815        jobz: cusolverEigMode_t,
9816        rank: ::core::ffi::c_int,
9817        m: ::core::ffi::c_int,
9818        n: ::core::ffi::c_int,
9819        d_A: *const f32,
9820        lda: ::core::ffi::c_int,
9821        strideA: ::core::ffi::c_longlong,
9822        d_S: *mut f32,
9823        strideS: ::core::ffi::c_longlong,
9824        d_U: *mut f32,
9825        ldu: ::core::ffi::c_int,
9826        strideU: ::core::ffi::c_longlong,
9827        d_V: *mut f32,
9828        ldv: ::core::ffi::c_int,
9829        strideV: ::core::ffi::c_longlong,
9830        d_work: *mut f32,
9831        lwork: ::core::ffi::c_int,
9832        d_info: *mut ::core::ffi::c_int,
9833        h_R_nrmF: *mut f64,
9834        batchSize: ::core::ffi::c_int,
9835    ) -> cusolverStatus_t;
9836}
9837unsafe extern "C" {
9838    /// The helper functions below can calculate the sizes needed for pre-allocated buffer.
9839    ///
9840    /// The S and D data types are real valued single and double precision, respectively.
9841    ///
9842    /// The C and Z data types are complex valued single and double precision, respectively.
9843    ///
9844    /// This function `gesvda` (`a` stands for approximate) approximates the singular value decomposition of a tall skinny $m \times n$ matrix `A` and corresponding the left and right singular vectors. The economy form of SVD is written by:
9845    ///
9846    /// $$
9847    /// A = U\\*\Sigma\\*V^{H}
9848    /// $$
9849    /// where $\Sigma$ is an $n \times n$ matrix. `U` is an $m \times n$ unitary matrix, and `V` is an $n \times n$ unitary matrix. The diagonal elements of $\Sigma$ are the singular values of `A`; they are real and non-negative, and are returned in descending order. `U` and `V` are the left and right singular vectors of `A`.
9850    ///
9851    /// `gesvda` computes eigenvalues of `A**T*A`, or `A**H*A` (if `A` is complex), to approximate singular values and singular vectors. It generates matrices `U` and `V` and transforms the matrix `A` to the following form:
9852    ///
9853    /// $$
9854    /// U^{H}\\*A\\*V = S + E
9855    /// $$
9856    /// where `S` is diagonal and `E` depends on rounding errors. To certain conditions, `U`, `V` and `S` approximate singular values and singular vectors up to machine zero of single precision. In general, `V` is unitary, `S` is more accurate than `U`. If singular value is far from zero, then left singular vector `U` is accurate. In other words, the accuracy of singular values and left singular vectors depend on the distance between singular value and zero. Since the computation of `A**T*A`, or `A**H*A` can greatly amplify errors, it is recommended to use `gesvda` only with well-conditioned data.
9857    ///
9858    /// The input parameter `rank` decides the number of singular values and singular vectors are computed in parameter `S`, `U` and `V`.
9859    ///
9860    /// The output parameter `h_RnrmF` computes Frobenius norm of residual. To compute `h_RnrmF`, `info != NULL` is required.
9861    ///
9862    /// $$
9863    /// A - U\\*S\\*V^{H}
9864    /// $$
9865    /// if the parameter `rank` is equal `n`. Otherwise, `h_RnrmF` reports:
9866    ///
9867    /// $$
9868    /// {\\|}U\\*S\\*V^{H}{\\|} - {\\|S\\|}
9869    /// $$
9870    /// in Frobenius norm sense, that is, how far `U` is from unitary.
9871    ///
9872    /// `gesvdaStridedBatched` performs `gesvda` on each matrix. It requires that all matrices are of the same size `m,n` and are packed in a contiguous way,
9873    ///
9874    /// $$
9875    /// \begin{split}A = \begin{pmatrix}
9876    /// {A0} & {A1} & \cdots \\\\
9877    /// \end{pmatrix}\end{split}
9878    /// $$
9879    /// Each matrix is column-major with leading dimension `lda`, so the formula for random access is $A_{k}\operatorname{(i,j)} = {A\lbrack\ i\ +\ lda\\*j\ +\ strideA\\*k\rbrack}$. Similarly, the formula for random access of `S` is $S_{k}\operatorname{(j)} = {S\lbrack\ j\ +\ StrideS\\*k\rbrack}$, the formula for random access of `U` is $U_{k}\operatorname{(i,j)} = {U\lbrack\ i\ +\ ldu\\*j\ +\ strideU\\*k\rbrack}$ and the formula for random access of `V` is $V_{k}\operatorname{(i,j)} = {V\lbrack\ i\ +\ ldv\\*j\ +\ strideV\\*k\rbrack}$.
9880    ///
9881    /// The user has to provide working space which is pointed by input parameter `work`. The input parameter `lwork` is the size of the working space, and it is returned by `gesvdaStridedBatched_bufferSize()`. Please note that the size in bytes of the working space is equal to `sizeof(<type>) * lwork`.
9882    ///
9883    /// The output parameter `info` is an integer array of size `batchSize`. If the function returns [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`], the first element `info[0] = -i` (less than zero) indicates `i-th` parameter is wrong (not counting handle). Otherwise, if `info[i] = min(m,n)+1`, `gesvdaStridedBatched` did not converge on the `i-th` matrix. If `0 < info[i] < min(m,n)+1`, `gesvdaStridedBatched` could not compute an SVD of the `i-th` matrix fully; the leading singular values `Si[k]`, `0 <= k <= info[i]-1`, and corresponding singular vectors may still be useful. In this case, if `h_RnrmF` is requested, `h_RnrmF` reports the residual as if `rank` was set to `info[i]-1`.
9884    ///
9885    /// Note that the problem size is limited by the condition `batchSize*stride{A/S/U/V}<=INT32_MAX` primarily due to the current implementation constraints.
9886    ///
9887    /// Please visit [cuSOLVER Library Samples - gesvdaStridedBatched](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/gesvdaStridedBatched) for a code example.
9888    ///
9889    /// Remark 1: The routine returns `V`, not $V^{H}$. This is different from `gesvd`.
9890    ///
9891    /// Remark 2: The routine only supports `m >=n`.
9892    ///
9893    /// Remark 3: It is recommended to use an FP64 data type, that is `DgesvdaStridedBatched` or `ZgesvdaStridedBatched`.
9894    ///
9895    /// Remark 4: If the user is confident on the accuracy of singular values and singular vectors, for example, certain conditions hold (required singular value is far from zero), then the performance can be improved by passing a null pointer to `h_RnrmF`, i.e. no computation of the residual norm.
9896    ///
9897    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The operation completed successfully.
9898    ///
9899    /// [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]:   The library was not initialized.
9900    ///
9901    /// [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]:   Invalid parameters were passed (`m,n<0` or `batchSize*stride{A/S/U/V}>INT32_MAX` or `lda<max(1,m)` or `ldu<max(1,m)` or `ldv<max(1,n)` or `strideA<lda*n` or `strideS<rank` or `strideU<ldu*rank` or `strideV<ldv*rank` or `batchSize<1` or `jobz` is not [`cusolverEigMode_t::CUSOLVER_EIG_MODE_NOVECTOR`] or [`cusolverEigMode_t::CUSOLVER_EIG_MODE_VECTOR`]).
9902    ///
9903    /// [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]:   An internal operation failed.
9904    pub fn cusolverDnDgesvdaStridedBatched(
9905        handle: cusolverDnHandle_t,
9906        jobz: cusolverEigMode_t,
9907        rank: ::core::ffi::c_int,
9908        m: ::core::ffi::c_int,
9909        n: ::core::ffi::c_int,
9910        d_A: *const f64,
9911        lda: ::core::ffi::c_int,
9912        strideA: ::core::ffi::c_longlong,
9913        d_S: *mut f64,
9914        strideS: ::core::ffi::c_longlong,
9915        d_U: *mut f64,
9916        ldu: ::core::ffi::c_int,
9917        strideU: ::core::ffi::c_longlong,
9918        d_V: *mut f64,
9919        ldv: ::core::ffi::c_int,
9920        strideV: ::core::ffi::c_longlong,
9921        d_work: *mut f64,
9922        lwork: ::core::ffi::c_int,
9923        d_info: *mut ::core::ffi::c_int,
9924        h_R_nrmF: *mut f64,
9925        batchSize: ::core::ffi::c_int,
9926    ) -> cusolverStatus_t;
9927}
9928unsafe extern "C" {
9929    /// The helper functions below can calculate the sizes needed for pre-allocated buffer.
9930    ///
9931    /// The S and D data types are real valued single and double precision, respectively.
9932    ///
9933    /// The C and Z data types are complex valued single and double precision, respectively.
9934    ///
9935    /// This function `gesvda` (`a` stands for approximate) approximates the singular value decomposition of a tall skinny $m \times n$ matrix `A` and corresponding the left and right singular vectors. The economy form of SVD is written by:
9936    ///
9937    /// $$
9938    /// A = U\\*\Sigma\\*V^{H}
9939    /// $$
9940    /// where $\Sigma$ is an $n \times n$ matrix. `U` is an $m \times n$ unitary matrix, and `V` is an $n \times n$ unitary matrix. The diagonal elements of $\Sigma$ are the singular values of `A`; they are real and non-negative, and are returned in descending order. `U` and `V` are the left and right singular vectors of `A`.
9941    ///
9942    /// `gesvda` computes eigenvalues of `A**T*A`, or `A**H*A` (if `A` is complex), to approximate singular values and singular vectors. It generates matrices `U` and `V` and transforms the matrix `A` to the following form:
9943    ///
9944    /// $$
9945    /// U^{H}\\*A\\*V = S + E
9946    /// $$
9947    /// where `S` is diagonal and `E` depends on rounding errors. To certain conditions, `U`, `V` and `S` approximate singular values and singular vectors up to machine zero of single precision. In general, `V` is unitary, `S` is more accurate than `U`. If singular value is far from zero, then left singular vector `U` is accurate. In other words, the accuracy of singular values and left singular vectors depend on the distance between singular value and zero. Since the computation of `A**T*A`, or `A**H*A` can greatly amplify errors, it is recommended to use `gesvda` only with well-conditioned data.
9948    ///
9949    /// The input parameter `rank` decides the number of singular values and singular vectors are computed in parameter `S`, `U` and `V`.
9950    ///
9951    /// The output parameter `h_RnrmF` computes Frobenius norm of residual. To compute `h_RnrmF`, `info != NULL` is required.
9952    ///
9953    /// $$
9954    /// A - U\\*S\\*V^{H}
9955    /// $$
9956    /// if the parameter `rank` is equal `n`. Otherwise, `h_RnrmF` reports:
9957    ///
9958    /// $$
9959    /// {\\|}U\\*S\\*V^{H}{\\|} - {\\|S\\|}
9960    /// $$
9961    /// in Frobenius norm sense, that is, how far `U` is from unitary.
9962    ///
9963    /// `gesvdaStridedBatched` performs `gesvda` on each matrix. It requires that all matrices are of the same size `m,n` and are packed in a contiguous way,
9964    ///
9965    /// $$
9966    /// \begin{split}A = \begin{pmatrix}
9967    /// {A0} & {A1} & \cdots \\\\
9968    /// \end{pmatrix}\end{split}
9969    /// $$
9970    /// Each matrix is column-major with leading dimension `lda`, so the formula for random access is $A_{k}\operatorname{(i,j)} = {A\lbrack\ i\ +\ lda\\*j\ +\ strideA\\*k\rbrack}$. Similarly, the formula for random access of `S` is $S_{k}\operatorname{(j)} = {S\lbrack\ j\ +\ StrideS\\*k\rbrack}$, the formula for random access of `U` is $U_{k}\operatorname{(i,j)} = {U\lbrack\ i\ +\ ldu\\*j\ +\ strideU\\*k\rbrack}$ and the formula for random access of `V` is $V_{k}\operatorname{(i,j)} = {V\lbrack\ i\ +\ ldv\\*j\ +\ strideV\\*k\rbrack}$.
9971    ///
9972    /// The user has to provide working space which is pointed by input parameter `work`. The input parameter `lwork` is the size of the working space, and it is returned by `gesvdaStridedBatched_bufferSize()`. Please note that the size in bytes of the working space is equal to `sizeof(<type>) * lwork`.
9973    ///
9974    /// The output parameter `info` is an integer array of size `batchSize`. If the function returns [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`], the first element `info[0] = -i` (less than zero) indicates `i-th` parameter is wrong (not counting handle). Otherwise, if `info[i] = min(m,n)+1`, `gesvdaStridedBatched` did not converge on the `i-th` matrix. If `0 < info[i] < min(m,n)+1`, `gesvdaStridedBatched` could not compute an SVD of the `i-th` matrix fully; the leading singular values `Si[k]`, `0 <= k <= info[i]-1`, and corresponding singular vectors may still be useful. In this case, if `h_RnrmF` is requested, `h_RnrmF` reports the residual as if `rank` was set to `info[i]-1`.
9975    ///
9976    /// Note that the problem size is limited by the condition `batchSize*stride{A/S/U/V}<=INT32_MAX` primarily due to the current implementation constraints.
9977    ///
9978    /// Please visit [cuSOLVER Library Samples - gesvdaStridedBatched](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/gesvdaStridedBatched) for a code example.
9979    ///
9980    /// Remark 1: The routine returns `V`, not $V^{H}$. This is different from `gesvd`.
9981    ///
9982    /// Remark 2: The routine only supports `m >=n`.
9983    ///
9984    /// Remark 3: It is recommended to use an FP64 data type, that is `DgesvdaStridedBatched` or `ZgesvdaStridedBatched`.
9985    ///
9986    /// Remark 4: If the user is confident on the accuracy of singular values and singular vectors, for example, certain conditions hold (required singular value is far from zero), then the performance can be improved by passing a null pointer to `h_RnrmF`, i.e. no computation of the residual norm.
9987    ///
9988    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The operation completed successfully.
9989    ///
9990    /// [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]:   The library was not initialized.
9991    ///
9992    /// [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]:   Invalid parameters were passed (`m,n<0` or `batchSize*stride{A/S/U/V}>INT32_MAX` or `lda<max(1,m)` or `ldu<max(1,m)` or `ldv<max(1,n)` or `strideA<lda*n` or `strideS<rank` or `strideU<ldu*rank` or `strideV<ldv*rank` or `batchSize<1` or `jobz` is not [`cusolverEigMode_t::CUSOLVER_EIG_MODE_NOVECTOR`] or [`cusolverEigMode_t::CUSOLVER_EIG_MODE_VECTOR`]).
9993    ///
9994    /// [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]:   An internal operation failed.
9995    pub fn cusolverDnCgesvdaStridedBatched(
9996        handle: cusolverDnHandle_t,
9997        jobz: cusolverEigMode_t,
9998        rank: ::core::ffi::c_int,
9999        m: ::core::ffi::c_int,
10000        n: ::core::ffi::c_int,
10001        d_A: *const cuComplex,
10002        lda: ::core::ffi::c_int,
10003        strideA: ::core::ffi::c_longlong,
10004        d_S: *mut f32,
10005        strideS: ::core::ffi::c_longlong,
10006        d_U: *mut cuComplex,
10007        ldu: ::core::ffi::c_int,
10008        strideU: ::core::ffi::c_longlong,
10009        d_V: *mut cuComplex,
10010        ldv: ::core::ffi::c_int,
10011        strideV: ::core::ffi::c_longlong,
10012        d_work: *mut cuComplex,
10013        lwork: ::core::ffi::c_int,
10014        d_info: *mut ::core::ffi::c_int,
10015        h_R_nrmF: *mut f64,
10016        batchSize: ::core::ffi::c_int,
10017    ) -> cusolverStatus_t;
10018}
10019unsafe extern "C" {
10020    /// The helper functions below can calculate the sizes needed for pre-allocated buffer.
10021    ///
10022    /// The S and D data types are real valued single and double precision, respectively.
10023    ///
10024    /// The C and Z data types are complex valued single and double precision, respectively.
10025    ///
10026    /// This function `gesvda` (`a` stands for approximate) approximates the singular value decomposition of a tall skinny $m \times n$ matrix `A` and corresponding the left and right singular vectors. The economy form of SVD is written by:
10027    ///
10028    /// $$
10029    /// A = U\\*\Sigma\\*V^{H}
10030    /// $$
10031    /// where $\Sigma$ is an $n \times n$ matrix. `U` is an $m \times n$ unitary matrix, and `V` is an $n \times n$ unitary matrix. The diagonal elements of $\Sigma$ are the singular values of `A`; they are real and non-negative, and are returned in descending order. `U` and `V` are the left and right singular vectors of `A`.
10032    ///
10033    /// `gesvda` computes eigenvalues of `A**T*A`, or `A**H*A` (if `A` is complex), to approximate singular values and singular vectors. It generates matrices `U` and `V` and transforms the matrix `A` to the following form:
10034    ///
10035    /// $$
10036    /// U^{H}\\*A\\*V = S + E
10037    /// $$
10038    /// where `S` is diagonal and `E` depends on rounding errors. To certain conditions, `U`, `V` and `S` approximate singular values and singular vectors up to machine zero of single precision. In general, `V` is unitary, `S` is more accurate than `U`. If singular value is far from zero, then left singular vector `U` is accurate. In other words, the accuracy of singular values and left singular vectors depend on the distance between singular value and zero. Since the computation of `A**T*A`, or `A**H*A` can greatly amplify errors, it is recommended to use `gesvda` only with well-conditioned data.
10039    ///
10040    /// The input parameter `rank` decides the number of singular values and singular vectors are computed in parameter `S`, `U` and `V`.
10041    ///
10042    /// The output parameter `h_RnrmF` computes Frobenius norm of residual. To compute `h_RnrmF`, `info != NULL` is required.
10043    ///
10044    /// $$
10045    /// A - U\\*S\\*V^{H}
10046    /// $$
10047    /// if the parameter `rank` is equal `n`. Otherwise, `h_RnrmF` reports:
10048    ///
10049    /// $$
10050    /// {\\|}U\\*S\\*V^{H}{\\|} - {\\|S\\|}
10051    /// $$
10052    /// in Frobenius norm sense, that is, how far `U` is from unitary.
10053    ///
10054    /// `gesvdaStridedBatched` performs `gesvda` on each matrix. It requires that all matrices are of the same size `m,n` and are packed in a contiguous way,
10055    ///
10056    /// $$
10057    /// \begin{split}A = \begin{pmatrix}
10058    /// {A0} & {A1} & \cdots \\\\
10059    /// \end{pmatrix}\end{split}
10060    /// $$
10061    /// Each matrix is column-major with leading dimension `lda`, so the formula for random access is $A_{k}\operatorname{(i,j)} = {A\lbrack\ i\ +\ lda\\*j\ +\ strideA\\*k\rbrack}$. Similarly, the formula for random access of `S` is $S_{k}\operatorname{(j)} = {S\lbrack\ j\ +\ StrideS\\*k\rbrack}$, the formula for random access of `U` is $U_{k}\operatorname{(i,j)} = {U\lbrack\ i\ +\ ldu\\*j\ +\ strideU\\*k\rbrack}$ and the formula for random access of `V` is $V_{k}\operatorname{(i,j)} = {V\lbrack\ i\ +\ ldv\\*j\ +\ strideV\\*k\rbrack}$.
10062    ///
10063    /// The user has to provide working space which is pointed by input parameter `work`. The input parameter `lwork` is the size of the working space, and it is returned by `gesvdaStridedBatched_bufferSize()`. Please note that the size in bytes of the working space is equal to `sizeof(<type>) * lwork`.
10064    ///
10065    /// The output parameter `info` is an integer array of size `batchSize`. If the function returns [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`], the first element `info[0] = -i` (less than zero) indicates `i-th` parameter is wrong (not counting handle). Otherwise, if `info[i] = min(m,n)+1`, `gesvdaStridedBatched` did not converge on the `i-th` matrix. If `0 < info[i] < min(m,n)+1`, `gesvdaStridedBatched` could not compute an SVD of the `i-th` matrix fully; the leading singular values `Si[k]`, `0 <= k <= info[i]-1`, and corresponding singular vectors may still be useful. In this case, if `h_RnrmF` is requested, `h_RnrmF` reports the residual as if `rank` was set to `info[i]-1`.
10066    ///
10067    /// Note that the problem size is limited by the condition `batchSize*stride{A/S/U/V}<=INT32_MAX` primarily due to the current implementation constraints.
10068    ///
10069    /// Please visit [cuSOLVER Library Samples - gesvdaStridedBatched](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/gesvdaStridedBatched) for a code example.
10070    ///
10071    /// Remark 1: The routine returns `V`, not $V^{H}$. This is different from `gesvd`.
10072    ///
10073    /// Remark 2: The routine only supports `m >=n`.
10074    ///
10075    /// Remark 3: It is recommended to use an FP64 data type, that is `DgesvdaStridedBatched` or `ZgesvdaStridedBatched`.
10076    ///
10077    /// Remark 4: If the user is confident on the accuracy of singular values and singular vectors, for example, certain conditions hold (required singular value is far from zero), then the performance can be improved by passing a null pointer to `h_RnrmF`, i.e. no computation of the residual norm.
10078    ///
10079    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The operation completed successfully.
10080    ///
10081    /// [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]:   The library was not initialized.
10082    ///
10083    /// [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]:   Invalid parameters were passed (`m,n<0` or `batchSize*stride{A/S/U/V}>INT32_MAX` or `lda<max(1,m)` or `ldu<max(1,m)` or `ldv<max(1,n)` or `strideA<lda*n` or `strideS<rank` or `strideU<ldu*rank` or `strideV<ldv*rank` or `batchSize<1` or `jobz` is not [`cusolverEigMode_t::CUSOLVER_EIG_MODE_NOVECTOR`] or [`cusolverEigMode_t::CUSOLVER_EIG_MODE_VECTOR`]).
10084    ///
10085    /// [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]:   An internal operation failed.
10086    pub fn cusolverDnZgesvdaStridedBatched(
10087        handle: cusolverDnHandle_t,
10088        jobz: cusolverEigMode_t,
10089        rank: ::core::ffi::c_int,
10090        m: ::core::ffi::c_int,
10091        n: ::core::ffi::c_int,
10092        d_A: *const cuDoubleComplex,
10093        lda: ::core::ffi::c_int,
10094        strideA: ::core::ffi::c_longlong,
10095        d_S: *mut f64,
10096        strideS: ::core::ffi::c_longlong,
10097        d_U: *mut cuDoubleComplex,
10098        ldu: ::core::ffi::c_int,
10099        strideU: ::core::ffi::c_longlong,
10100        d_V: *mut cuDoubleComplex,
10101        ldv: ::core::ffi::c_int,
10102        strideV: ::core::ffi::c_longlong,
10103        d_work: *mut cuDoubleComplex,
10104        lwork: ::core::ffi::c_int,
10105        d_info: *mut ::core::ffi::c_int,
10106        h_R_nrmF: *mut f64,
10107        batchSize: ::core::ffi::c_int,
10108    ) -> cusolverStatus_t;
10109}
10110unsafe extern "C" {
10111    /// This function creates and initializes the structure of `64-bit API` to default values.
10112    ///
10113    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The structure was initialized successfully.
10114    ///
10115    /// [`cusolverStatus_t::CUSOLVER_STATUS_ALLOC_FAILED`]:   The resources could not be allocated.
10116    ///
10117    /// # Parameters
10118    ///
10119    /// - `params`: The pointer to the structure of `64-bit API`.
10120    ///
10121    /// # Return value
10122    ///
10123    /// - [`cusolverStatus_t::CUSOLVER_STATUS_ALLOC_FAILED`]: The resources could not be allocated.
10124    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The structure was initialized successfully.
10125    pub fn cusolverDnCreateParams(params: *mut cusolverDnParams_t) -> cusolverStatus_t;
10126}
10127unsafe extern "C" {
10128    /// This function destroys and releases any memory required by the structure.
10129    ///
10130    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The resources were released successfully.
10131    ///
10132    /// # Parameters
10133    ///
10134    /// - `params`: The structure of `64-bit API`.
10135    ///
10136    /// # Return value
10137    ///
10138    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The resources were released successfully.
10139    pub fn cusolverDnDestroyParams(params: cusolverDnParams_t) -> cusolverStatus_t;
10140}
10141unsafe extern "C" {
10142    /// This function configures algorithm `algo` of `function`, a `64-bit API` routine.
10143    ///
10144    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The operation completed successfully.
10145    ///
10146    /// [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]:   Wrong combination of `function` and `algo`.
10147    ///
10148    /// # Parameters
10149    ///
10150    /// - `params`: The pointer to the structure of `64-bit API`.
10151    /// - `function`: The routine to be configured.
10152    /// - `algo`: The algorithm to be configured.
10153    ///
10154    /// # Return value
10155    ///
10156    /// - [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]: Wrong combination of `function` and `algo`.
10157    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The operation completed successfully.
10158    pub fn cusolverDnSetAdvOptions(
10159        params: cusolverDnParams_t,
10160        function: cusolverDnFunction_t,
10161        algo: cusolverAlgMode_t,
10162    ) -> cusolverStatus_t;
10163}
10164unsafe extern "C" {
10165    pub fn cusolverDnXpotrf_bufferSize(
10166        handle: cusolverDnHandle_t,
10167        params: cusolverDnParams_t,
10168        uplo: cublasFillMode_t,
10169        n: i64,
10170        dataTypeA: cudaDataType,
10171        A: *const ::core::ffi::c_void,
10172        lda: i64,
10173        computeType: cudaDataType,
10174        workspaceInBytesOnDevice: *mut size_t,
10175        workspaceInBytesOnHost: *mut size_t,
10176    ) -> cusolverStatus_t;
10177}
10178unsafe extern "C" {
10179    /// The helper functions below can calculate the sizes needed for pre-allocated buffer.
10180    ///
10181    /// The following routine:
10182    ///
10183    /// computes the Cholesky factorization of a Hermitian positive-definite matrix using the generic API interface.
10184    ///
10185    /// `A` is a $n \times n$ Hermitian matrix, only lower or upper part is meaningful. The input parameter `uplo` indicates which part of the matrix is used. The function will leave the other part untouched.
10186    ///
10187    /// If input parameter `uplo` is [`cublasFillMode_t::CUBLAS_FILL_MODE_LOWER`], only lower triangular part of `A` is processed, and replaced by lower triangular Cholesky factor `L`.
10188    ///
10189    /// $$
10190    /// A = L\\*L^{H}
10191    /// $$
10192    /// If input parameter `uplo` is [`cublasFillMode_t::CUBLAS_FILL_MODE_UPPER`], only upper triangular part of `A` is processed, and replaced by upper triangular Cholesky factor `U`.
10193    ///
10194    /// $$
10195    /// A = U^{H}\\*U
10196    /// $$
10197    /// The user has to provide device and host working spaces which are pointed by input parameters `bufferOnDevice` and `bufferOnHost`. The input parameters `workspaceInBytesOnDevice` (and `workspaceInBytesOnHost`) is size in bytes of the device (and host) working space, and it is returned by [`cusolverDnXpotrf_bufferSize`].
10198    ///
10199    /// If Cholesky factorization failed, i.e. some leading minor of `A` is not positive definite, or equivalently some diagonal elements of `L` or `U` is not a real number. The output parameter `info` would indicate smallest leading minor of `A` which is not positive definite.
10200    ///
10201    /// If output parameter `info = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
10202    ///
10203    /// Currently, [`cusolverDnXpotrf`] supports only the default algorithm.
10204    ///
10205    /// Please visit [cuSOLVER Library Samples - Xpotrf](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/Xpotrf) for a code example.
10206    ///
10207    /// **Algorithms supported by cusolverDnXpotrf**
10208    ///
10209    /// |  |  |
10210    /// | --- | --- |
10211    /// | [`cusolverAlgMode_t::CUSOLVER_ALG_0`] or `NULL` | Default algorithm. |
10212    ///
10213    /// List of input arguments for [`cusolverDnXpotrf_bufferSize`] and [`cusolverDnXpotrf`]:
10214    ///
10215    /// The generic API has two different types, `dataTypeA` is data type of the matrix `A`, `computeType` is compute type of the operation. [`cusolverDnXpotrf`] only supports the following four combinations.
10216    ///
10217    /// **Valid combination of data type and compute type**
10218    ///
10219    /// | **DataTypeA** | **ComputeType** | **Meaning** |
10220    /// | --- | --- | --- |
10221    /// | `CUDA_R_32F` | `CUDA_R_32F` | `SPOTRF` |
10222    /// | `CUDA_R_64F` | `CUDA_R_64F` | `DPOTRF` |
10223    /// | `CUDA_C_32F` | `CUDA_C_32F` | `CPOTRF` |
10224    /// | `CUDA_C_64F` | `CUDA_C_64F` | `ZPOTRF` |
10225    ///
10226    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The operation completed successfully.
10227    ///
10228    /// [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]:   The library was not initialized.
10229    ///
10230    /// [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]:   Invalid parameters were passed (`n<0` or `lda<max(1,n)`).
10231    ///
10232    /// [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]:   An internal operation failed.
10233    ///
10234    /// # Parameters
10235    ///
10236    /// - `handle`: Handle to the cuSolverDN library context.
10237    /// - `params`: Structure with information collected by [`cusolverDnSetAdvOptions`].
10238    /// - `uplo`: Indicates if matrix `A` lower or upper part is stored, the other part is not referenced.
10239    /// - `n`: Number of rows and columns of matrix `A`.
10240    /// - `dataTypeA`: Data type of array `A`.
10241    /// - `A`: Array of dimension `lda * n` with `lda` is not less than `max(1,n)`.
10242    /// - `lda`: Leading dimension of two-dimensional array used to store matrix `A`.
10243    /// - `computeType`: Data type of computation.
10244    /// - `bufferOnDevice`: Device workspace. Array of type `void` of size `workspaceInBytesOnDevice` bytes.
10245    /// - `workspaceInBytesOnDevice`: Size in bytes of `bufferOnDevice`, returned by [`cusolverDnXpotrf_bufferSize`].
10246    /// - `bufferOnHost`: Host workspace. Array of type `void` of size `workspaceInBytesOnHost` bytes.
10247    /// - `workspaceInBytesOnHost`: Size in bytes of `bufferOnHost`, returned by [`cusolverDnXpotrf_bufferSize`].
10248    /// - `info`: If `info = 0`, the Cholesky factorization is successful. If `info = -i`, the `i-th` parameter is wrong (not counting handle). If `info = i`, the leading minor of order `i` is not positive definite.
10249    ///
10250    /// # Return value
10251    ///
10252    /// - [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]: An internal operation failed.
10253    /// - [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]: Invalid parameters were passed (`n<0` or `lda<max(1,n)`).
10254    /// - [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]: The library was not initialized.
10255    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The operation completed successfully.
10256    pub fn cusolverDnXpotrf(
10257        handle: cusolverDnHandle_t,
10258        params: cusolverDnParams_t,
10259        uplo: cublasFillMode_t,
10260        n: i64,
10261        dataTypeA: cudaDataType,
10262        A: *mut ::core::ffi::c_void,
10263        lda: i64,
10264        computeType: cudaDataType,
10265        bufferOnDevice: *mut ::core::ffi::c_void,
10266        workspaceInBytesOnDevice: size_t,
10267        bufferOnHost: *mut ::core::ffi::c_void,
10268        workspaceInBytesOnHost: size_t,
10269        info: *mut ::core::ffi::c_int,
10270    ) -> cusolverStatus_t;
10271}
10272unsafe extern "C" {
10273    /// This function solves a system of linear equations:
10274    ///
10275    /// $$
10276    /// A\\*X = B
10277    /// $$
10278    /// where `A` is a $n \times n$ Hermitian matrix, only lower or upper part is meaningful using the generic API interface. The input parameter `uplo` indicates which part of the matrix is used. The function will leave the other part untouched.
10279    ///
10280    /// The user has to call [`cusolverDnXpotrf`] first to factorize matrix `A`. If input parameter `uplo` is [`cublasFillMode_t::CUBLAS_FILL_MODE_LOWER`], `A` is lower triangular Cholesky factor `L` corresponding to $A = L\\*L^{H}$. If input parameter `uplo` is [`cublasFillMode_t::CUBLAS_FILL_MODE_UPPER`], `A` is upper triangular Cholesky factor `U` corresponding to $A = U^{H}\\*U$.
10281    ///
10282    /// The operation is in-place, i.e. matrix `X` overwrites matrix `B` with the same leading dimension `ldb`.
10283    ///
10284    /// If output parameter `info = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
10285    ///
10286    /// Currently, [`cusolverDnXpotrs`] supports only the default algorithm.
10287    ///
10288    /// Please visit [cuSOLVER Library Samples - Xpotrf](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/Xpotrf) for a code example.
10289    ///
10290    /// **Algorithms supported by cusolverDnXpotrs**
10291    ///
10292    /// |  |  |
10293    /// | --- | --- |
10294    /// | [`cusolverAlgMode_t::CUSOLVER_ALG_0`] or `NULL` | Default algorithm. |
10295    ///
10296    /// List of input arguments for [`cusolverDnXpotrs`]:
10297    ///
10298    /// The generic API has two different types, `dataTypeA` is data type of the matrix `A`, `dataTypeB` is data type of the matrix `B`. [`cusolverDnXpotrs`] only supports the following four combinations.
10299    ///
10300    /// **Valid combination of data type and compute type**
10301    ///
10302    /// | **dataTypeA** | **dataTypeB** | **Meaning** |
10303    /// | --- | --- | --- |
10304    /// | `CUDA_R_32F` | `CUDA_R_32F` | `SPOTRS` |
10305    /// | `CUDA_R_64F` | `CUDA_R_64F` | `DPOTRS` |
10306    /// | `CUDA_C_32F` | `CUDA_C_32F` | `CPOTRS` |
10307    /// | `CUDA_C_64F` | `CUDA_C_64F` | `ZPOTRS` |
10308    ///
10309    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The operation completed successfully.
10310    ///
10311    /// [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]:   The library was not initialized.
10312    ///
10313    /// [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]:   Invalid parameters were passed (`n<0`, `nrhs<0`, `lda<max(1,n)` or `ldb<max(1,n)`).
10314    ///
10315    /// [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]:   An internal operation failed.
10316    ///
10317    /// # Parameters
10318    ///
10319    /// - `handle`: Handle to the cuSolverDN library context.
10320    /// - `params`: Structure with information collected by [`cusolverDnSetAdvOptions`].
10321    /// - `uplo`: Indicates if matrix `A` lower or upper part is stored, the other part is not referenced.
10322    /// - `n`: Number of rows and columns of matrix `A`.
10323    /// - `nrhs`: Number of columns of matrix `X` and `B`.
10324    /// - `dataTypeA`: Data type of array `A`.
10325    /// - `A`: Array of dimension `lda * n` with `lda` is not less than `max(1,n)`. `A` is either lower Cholesky factor `L` or upper Cholesky factor `U`.
10326    /// - `lda`: Leading dimension of two-dimensional array used to store matrix `A`.
10327    /// - `dataTypeB`: Data type of array `B`.
10328    /// - `B`: Array of dimension `ldb * nrhs`. `ldb` is not less than `max(1,n)`. As an input, `B` is right hand side matrix. As an output, `B` is the solution matrix.
10329    /// - `info`: If `info = 0`, the Cholesky factorization is successful. if `info = -i`, the `i-th` parameter is wrong (not counting handle).
10330    ///
10331    /// # Return value
10332    ///
10333    /// - [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]: An internal operation failed.
10334    /// - [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]: Invalid parameters were passed (`n<0`, `nrhs<0`, `lda<max(1,n)` or `ldb<max(1,n)`).
10335    /// - [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]: The library was not initialized.
10336    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The operation completed successfully.
10337    pub fn cusolverDnXpotrs(
10338        handle: cusolverDnHandle_t,
10339        params: cusolverDnParams_t,
10340        uplo: cublasFillMode_t,
10341        n: i64,
10342        nrhs: i64,
10343        dataTypeA: cudaDataType,
10344        A: *const ::core::ffi::c_void,
10345        lda: i64,
10346        dataTypeB: cudaDataType,
10347        B: *mut ::core::ffi::c_void,
10348        ldb: i64,
10349        info: *mut ::core::ffi::c_int,
10350    ) -> cusolverStatus_t;
10351}
10352unsafe extern "C" {
10353    pub fn cusolverDnXgeqrf_bufferSize(
10354        handle: cusolverDnHandle_t,
10355        params: cusolverDnParams_t,
10356        m: i64,
10357        n: i64,
10358        dataTypeA: cudaDataType,
10359        A: *const ::core::ffi::c_void,
10360        lda: i64,
10361        dataTypeTau: cudaDataType,
10362        tau: *const ::core::ffi::c_void,
10363        computeType: cudaDataType,
10364        workspaceInBytesOnDevice: *mut size_t,
10365        workspaceInBytesOnHost: *mut size_t,
10366    ) -> cusolverStatus_t;
10367}
10368unsafe extern "C" {
10369    /// The helper functions below can calculate the sizes needed for pre-allocated buffer.
10370    ///
10371    /// The following routine:
10372    ///
10373    /// computes the QR factorization of a $m \times n$ matrix:
10374    ///
10375    /// $$
10376    /// A = Q\\*R
10377    /// $$
10378    /// where `A` is an $m \times n$ matrix, `Q` is a $m \times n$ matrix, and `R` is an $n \times n$ upper triangular matrix using the generic API interface.
10379    ///
10380    /// The user has to provide device and host working spaces which are pointed by input parameters `bufferOnDevice` and `bufferOnHost`. The input parameters `workspaceInBytesOnDevice` (and `workspaceInBytesOnHost`) is size in bytes of the device (and host) working space, and it is returned by [`cusolverDnXgeqrf_bufferSize`].
10381    ///
10382    /// The matrix `R` is overwritten in upper triangular part of `A`, including diagonal elements.
10383    ///
10384    /// The matrix `Q` is not formed explicitly, instead, a sequence of householder vectors are stored in lower triangular part of `A`. The leading nonzero element of householder vector is assumed to be 1 such that output parameter `TAU` contains the scaling factor `τ`. If `v` is original householder vector, `q` is the new householder vector corresponding to `τ`, satisfying the following relation:
10385    ///
10386    /// $$
10387    /// I - 2\\*v\\*v^{H} = I - \tau\\*q\\*q^{H}
10388    /// $$
10389    /// If output parameter `info = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
10390    ///
10391    /// Currently, [`cusolverDnXgeqrf`] supports only the default algorithm.
10392    ///
10393    /// Please visit [cuSOLVER Library Samples - Xgeqrf](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/Xgeqrf) for a code example.
10394    ///
10395    /// **Algorithms supported by cusolverDnXgeqrf**
10396    ///
10397    /// |  |  |
10398    /// | --- | --- |
10399    /// | [`cusolverAlgMode_t::CUSOLVER_ALG_0`] or `NULL` | Default algorithm. |
10400    ///
10401    /// List of input arguments for [`cusolverDnXgeqrf_bufferSize`] and [`cusolverDnXgeqrf`]:
10402    ///
10403    /// The generic API has two different types, `dataTypeA` is data type of the matrix `A`, `dataTypeTau` is data type of the array `tau` and `computeType` is compute type of the operation. [`cusolverDnXgeqrf`] only supports the following four combinations.
10404    ///
10405    /// **Valid combination of data type and compute type**
10406    ///
10407    /// | **DataTypeA** | **ComputeType** | **Meaning** |
10408    /// | --- | --- | --- |
10409    /// | `CUDA_R_32F` | `CUDA_R_32F` | `SGEQRF` |
10410    /// | `CUDA_R_64F` | `CUDA_R_64F` | `DGEQRF` |
10411    /// | `CUDA_C_32F` | `CUDA_C_32F` | `CGEQRF` |
10412    /// | `CUDA_C_64F` | `CUDA_C_64F` | `ZGEQRF` |
10413    ///
10414    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The operation completed successfully.
10415    ///
10416    /// [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]:   The library was not initialized.
10417    ///
10418    /// [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]:   Invalid parameters were passed (`m,n<0` or `lda<max(1,m)`).
10419    ///
10420    /// [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]:   An internal operation failed.
10421    ///
10422    /// # Parameters
10423    ///
10424    /// - `handle`: Handle to the cuSolverDN library context.
10425    /// - `params`: Structure with information collected by [`cusolverDnSetAdvOptions`].
10426    /// - `m`: Number of rows of matrix `A`.
10427    /// - `n`: Number of columns of matrix `A`.
10428    /// - `dataTypeA`: Data type of array `A`.
10429    /// - `A`: Array of dimension `lda * n` with `lda` is not less than `max(1,m)`.
10430    /// - `lda`: Leading dimension of two-dimensional array used to store matrix `A`.
10431    /// - `dataTypeTau`: Data type of array `tau`.
10432    /// - `tau`: Array of dimension at least `min(m,n)`.
10433    /// - `computeType`: Data type of computation.
10434    /// - `bufferOnDevice`: Device workspace. Array of type `void` of size `workspaceInBytesOnDevice` bytes.
10435    /// - `workspaceInBytesOnDevice`: Size in bytes of `bufferOnDevice`, returned by [`cusolverDnXgeqrf_bufferSize`].
10436    /// - `bufferOnHost`: Host workspace. Array of type `void` of size `workspaceInBytesOnHost` bytes.
10437    /// - `workspaceInBytesOnHost`: Size in bytes of `bufferOnHost`, returned by [`cusolverDnXgeqrf_bufferSize`].
10438    /// - `info`: If `info = 0`, the QR factorization is successful. If `info = -i`, the `i-th` parameter is wrong (not counting handle).
10439    ///
10440    /// # Return value
10441    ///
10442    /// - [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]: An internal operation failed.
10443    /// - [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]: Invalid parameters were passed (`m,n<0` or `lda<max(1,m)`).
10444    /// - [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]: The library was not initialized.
10445    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The operation completed successfully.
10446    pub fn cusolverDnXgeqrf(
10447        handle: cusolverDnHandle_t,
10448        params: cusolverDnParams_t,
10449        m: i64,
10450        n: i64,
10451        dataTypeA: cudaDataType,
10452        A: *mut ::core::ffi::c_void,
10453        lda: i64,
10454        dataTypeTau: cudaDataType,
10455        tau: *mut ::core::ffi::c_void,
10456        computeType: cudaDataType,
10457        bufferOnDevice: *mut ::core::ffi::c_void,
10458        workspaceInBytesOnDevice: size_t,
10459        bufferOnHost: *mut ::core::ffi::c_void,
10460        workspaceInBytesOnHost: size_t,
10461        info: *mut ::core::ffi::c_int,
10462    ) -> cusolverStatus_t;
10463}
10464unsafe extern "C" {
10465    pub fn cusolverDnXgetrf_bufferSize(
10466        handle: cusolverDnHandle_t,
10467        params: cusolverDnParams_t,
10468        m: i64,
10469        n: i64,
10470        dataTypeA: cudaDataType,
10471        A: *const ::core::ffi::c_void,
10472        lda: i64,
10473        computeType: cudaDataType,
10474        workspaceInBytesOnDevice: *mut size_t,
10475        workspaceInBytesOnHost: *mut size_t,
10476    ) -> cusolverStatus_t;
10477}
10478unsafe extern "C" {
10479    /// The helper function below can calculate the sizes needed for pre-allocated buffer.
10480    ///
10481    /// The function below
10482    ///
10483    /// computes the LU factorization of a $m \times n$ matrix:
10484    ///
10485    /// $$
10486    /// P\\*A = L\\*U
10487    /// $$
10488    /// where `A` is a $m \times n$ matrix, `P` is a permutation matrix, `L` is a lower triangular matrix with unit diagonal, and `U` is an upper triangular matrix using the generic API interface.
10489    ///
10490    /// If LU factorization failed, i.e. matrix `A` (`U`) is singular, The output parameter `info=i` indicates `U(i,i) = 0`.
10491    ///
10492    /// If output parameter `info = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
10493    ///
10494    /// If `ipiv` is null, no pivoting is performed. The factorization is `A=L*U`, which is not numerically stable.
10495    ///
10496    /// No matter LU factorization failed or not, the output parameter `ipiv` contains pivoting sequence, row `i` is interchanged with row `ipiv(i)`.
10497    ///
10498    /// The user has to provide device and host working spaces which are pointed by input parameters `bufferOnDevice` and `bufferOnHost`. The input parameters `workspaceInBytesOnDevice` (and `workspaceInBytesOnHost`) is size in bytes of the device (and host) working space, and it is returned by [`cusolverDnXgetrf_bufferSize`].
10499    ///
10500    /// The user can combine [`cusolverDnXgetrf`] and `cusolverDnGetrs` to complete a linear solver.
10501    ///
10502    /// Currently, [`cusolverDnXgetrf`] supports two algorithms. To select legacy implementation, the user has to call [`cusolverDnSetAdvOptions`].
10503    ///
10504    /// Please visit [cuSOLVER Library Samples - Xgetrf](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/Xgetrf) for a code example.
10505    ///
10506    /// **Algorithms supported by cusolverDnXgetrf**
10507    ///
10508    /// |  |  |
10509    /// | --- | --- |
10510    /// | [`cusolverAlgMode_t::CUSOLVER_ALG_0`] or `NULL` | Default algorithm. The fastest, requires a large workspace of `m*n` elements. |
10511    /// | [`cusolverAlgMode_t::CUSOLVER_ALG_1`] | Legacy implementation |
10512    ///
10513    /// List of input arguments for [`cusolverDnXgetrf_bufferSize`] and [`cusolverDnXgetrf`]:
10514    ///
10515    /// The generic API has two different types, `dataTypeA` is data type of the matrix `A`, `computeType` is compute type of the operation. [`cusolverDnXgetrf`] only supports the following four combinations.
10516    ///
10517    /// **Valid combination of data type and compute type**
10518    ///
10519    /// | **DataTypeA** | **ComputeType** | **Meaning** |
10520    /// | --- | --- | --- |
10521    /// | `CUDA_R_32F` | `CUDA_R_32F` | `SGETRF` |
10522    /// | `CUDA_R_64F` | `CUDA_R_64F` | `DGETRF` |
10523    /// | `CUDA_C_32F` | `CUDA_C_32F` | `CGETRF` |
10524    /// | `CUDA_C_64F` | `CUDA_C_64F` | `ZGETRF` |
10525    ///
10526    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The operation completed successfully.
10527    ///
10528    /// [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]:   The library was not initialized.
10529    ///
10530    /// [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]:   Invalid parameters were passed (`m,n<0` or `lda<max(1,m)`).
10531    ///
10532    /// [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]:   An internal operation failed.
10533    ///
10534    /// # Parameters
10535    ///
10536    /// - `handle`: Handle to the cuSolverDN library context.
10537    /// - `params`: Structure with information collected by [`cusolverDnSetAdvOptions`].
10538    /// - `m`: Number of rows of matrix `A`.
10539    /// - `n`: Number of columns of matrix `A`.
10540    /// - `dataTypeA`: Data type of array `A`.
10541    /// - `A`: type> array of dimension `lda * n` with `lda` is not less than `max(1,m)`.
10542    /// - `lda`: Leading dimension of two-dimensional array used to store matrix `A`.
10543    /// - `ipiv`: Array of size at least `min(m,n)`, containing pivot indices.
10544    /// - `computeType`: Data type of computation.
10545    /// - `bufferOnDevice`: Device workspace. Array of type `void` of size `workspaceInBytesOnDevice` bytes.
10546    /// - `workspaceInBytesOnDevice`: Size in bytes of `bufferOnDevice`, returned by [`cusolverDnXgetrf_bufferSize`].
10547    /// - `bufferOnHost`: Host workspace. Array of type `void` of size `workspaceInBytesOnHost` bytes.
10548    /// - `workspaceInBytesOnHost`: Size in bytes of `bufferOnHost`, returned by [`cusolverDnXgetrf_bufferSize`].
10549    /// - `info`: If `info = 0`, the LU factorization is successful. if `info = -i`, the `i-th` parameter is wrong (not counting handle). If `info = i`, the `U(i,i) = 0`.
10550    ///
10551    /// # Return value
10552    ///
10553    /// - [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]: An internal operation failed.
10554    /// - [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]: Invalid parameters were passed (`m,n<0` or `lda<max(1,m)`).
10555    /// - [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]: The library was not initialized.
10556    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The operation completed successfully.
10557    pub fn cusolverDnXgetrf(
10558        handle: cusolverDnHandle_t,
10559        params: cusolverDnParams_t,
10560        m: i64,
10561        n: i64,
10562        dataTypeA: cudaDataType,
10563        A: *mut ::core::ffi::c_void,
10564        lda: i64,
10565        ipiv: *mut i64,
10566        computeType: cudaDataType,
10567        bufferOnDevice: *mut ::core::ffi::c_void,
10568        workspaceInBytesOnDevice: size_t,
10569        bufferOnHost: *mut ::core::ffi::c_void,
10570        workspaceInBytesOnHost: size_t,
10571        info: *mut ::core::ffi::c_int,
10572    ) -> cusolverStatus_t;
10573}
10574unsafe extern "C" {
10575    /// This function solves a linear system of multiple right-hand sides:
10576    ///
10577    /// $$
10578    /// op(A)\\*X = B
10579    /// $$
10580    /// where `A` is an $n \times n$ matrix, and was LU-factored by [`cusolverDnXgetrf`], that is, lower triangular part of A is `L`, and upper triangular part (including diagonal elements) of `A` is `U`. `B` is an $n \times {nrhs}$ right-hand side matrix using the generic API interface.
10581    ///
10582    /// The input parameter `trans` is defined by
10583    ///
10584    /// ![image1](_images/op-trans.png)
10585    ///
10586    /// The input parameter `ipiv` is an output of [`cusolverDnXgetrf`]. It contains pivot indices, which are used to permutate right-hand sides.
10587    ///
10588    /// If output parameter `info = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
10589    ///
10590    /// The user can combine [`cusolverDnXgetrf`] and [`cusolverDnXgetrs`] to complete a linear solver.
10591    ///
10592    /// Currently, [`cusolverDnXgetrs`] supports only the default algorithm.
10593    ///
10594    /// Please visit [cuSOLVER Library Samples - Xgetrf](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/Xgetrf) for a code example.
10595    ///
10596    /// **Algorithms supported by cusolverDnXgetrs**
10597    ///
10598    /// |  |  |
10599    /// | --- | --- |
10600    /// | [`cusolverAlgMode_t::CUSOLVER_ALG_0`] or `NULL` | Default algorithm. |
10601    ///
10602    /// List of input arguments for [`cusolverDnXgetrs`]:
10603    ///
10604    /// The generic API has two different types: `dataTypeA` is data type of the matrix `A` and `dataTypeB` is data type of the matrix `B`. [`cusolverDnXgetrs`] only supports the following four combinations:
10605    ///
10606    /// **Valid combination of data type and compute type**
10607    ///
10608    /// | **DataTypeA** | **dataTypeB** | **Meaning** |
10609    /// | --- | --- | --- |
10610    /// | `CUDA_R_32F` | `CUDA_R_32F` | `SGETRS` |
10611    /// | `CUDA_R_64F` | `CUDA_R_64F` | `DGETRS` |
10612    /// | `CUDA_C_32F` | `CUDA_C_32F` | `CGETRS` |
10613    /// | `CUDA_C_64F` | `CUDA_C_64F` | `ZGETRS` |
10614    ///
10615    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The operation completed successfully.
10616    ///
10617    /// [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]:   The library was not initialized.
10618    ///
10619    /// [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]:   Invalid parameters were passed (`n<0` or `lda<max(1,n)` or `ldb<max(1,n)`).
10620    ///
10621    /// [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]:   An internal operation failed.
10622    ///
10623    /// # Parameters
10624    ///
10625    /// - `handle`: Handle to the cuSolverDN library context.
10626    /// - `params`: Structure with information collected by [`cusolverDnSetAdvOptions`].
10627    /// - `trans`: Operation `op(A)` that is non- or (conj.) transpose.
10628    /// - `n`: Number of rows and columns of matrix `A`.
10629    /// - `nrhs`: Number of right-hand sides.
10630    /// - `dataTypeA`: Data type of array `A`.
10631    /// - `A`: Array of dimension `lda * n` with `lda` is not less than `max(1,n)`.
10632    /// - `lda`: Leading dimension of two-dimensional array used to store matrix `A`.
10633    /// - `ipiv`: Array of size at least `n`, containing pivot indices.
10634    /// - `dataTypeB`: Data type of array `B`.
10635    /// - `B`: type> array of dimension `ldb * nrhs` with `ldb` is not less than `max(1,n)`.
10636    /// - `ldb`: Leading dimension of two-dimensional array used to store matrix `B`.
10637    /// - `info`: If `info = 0`, the operation is successful. If `info = -i`, the `i-th` parameter is wrong (not counting handle).
10638    ///
10639    /// # Return value
10640    ///
10641    /// - [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]: An internal operation failed.
10642    /// - [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]: Invalid parameters were passed (`n<0` or `lda<max(1,n)` or `ldb<max(1,n)`).
10643    /// - [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]: The library was not initialized.
10644    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The operation completed successfully.
10645    pub fn cusolverDnXgetrs(
10646        handle: cusolverDnHandle_t,
10647        params: cusolverDnParams_t,
10648        trans: cublasOperation_t,
10649        n: i64,
10650        nrhs: i64,
10651        dataTypeA: cudaDataType,
10652        A: *const ::core::ffi::c_void,
10653        lda: i64,
10654        ipiv: *const i64,
10655        dataTypeB: cudaDataType,
10656        B: *mut ::core::ffi::c_void,
10657        ldb: i64,
10658        info: *mut ::core::ffi::c_int,
10659    ) -> cusolverStatus_t;
10660}
10661unsafe extern "C" {
10662    pub fn cusolverDnXsyevd_bufferSize(
10663        handle: cusolverDnHandle_t,
10664        params: cusolverDnParams_t,
10665        jobz: cusolverEigMode_t,
10666        uplo: cublasFillMode_t,
10667        n: i64,
10668        dataTypeA: cudaDataType,
10669        A: *const ::core::ffi::c_void,
10670        lda: i64,
10671        dataTypeW: cudaDataType,
10672        W: *const ::core::ffi::c_void,
10673        computeType: cudaDataType,
10674        workspaceInBytesOnDevice: *mut size_t,
10675        workspaceInBytesOnHost: *mut size_t,
10676    ) -> cusolverStatus_t;
10677}
10678unsafe extern "C" {
10679    /// The helper functions below can calculate the sizes needed for pre-allocated buffer.
10680    ///
10681    /// The following routine:
10682    ///
10683    /// computes eigenvalues and eigenvectors of a symmetric (Hermitian) $n \times n$ matrix `A` using the generic API interface. The standard symmetric eigenvalue problem is:
10684    ///
10685    /// $$
10686    /// A\\*V = V\\*\Lambda
10687    /// $$
10688    /// where `Λ` is a real $n \times n$ diagonal matrix. `V` is an $n \times n$ unitary matrix. The diagonal elements of `Λ` are the eigenvalues of `A` in ascending order.
10689    ///
10690    /// The user has to provide device and host working spaces which are pointed by input parameters `bufferOnDevice` and `bufferOnHost`. The input parameters `workspaceInBytesOnDevice` (and `workspaceInBytesOnHost`) is size in bytes of the device (and host) working space, and it is returned by [`cusolverDnXsyevd_bufferSize`].
10691    ///
10692    /// If output parameter `info = -i` (less than zero), the `i-th` parameter is wrong (not counting handle). If `info = i` (greater than zero), `i` off-diagonal elements of an intermediate tridiagonal form did not converge to zero.
10693    ///
10694    /// If `jobz` = [`cusolverEigMode_t::CUSOLVER_EIG_MODE_VECTOR`], `A` contains the orthonormal eigenvectors of the matrix `A`. The eigenvectors are computed by a divide and conquer algorithm.
10695    ///
10696    /// Please visit [cuSOLVER Library Samples - Xsyevd](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/Xsyevd) for a code example.
10697    ///
10698    /// Currently, [`cusolverDnXsyevd`] supports only the default algorithm.
10699    ///
10700    /// **Algorithms supported by cusolverDnXsyevd**
10701    ///
10702    /// |  |  |
10703    /// | --- | --- |
10704    /// | [`cusolverAlgMode_t::CUSOLVER_ALG_0`] or `NULL` | Default algorithm. |
10705    ///
10706    /// List of input arguments for [`cusolverDnXsyevd_bufferSize`] and [`cusolverDnXsyevd`]:
10707    ///
10708    /// The generic API has three different types, `dataTypeA` is data type of the matrix `A`, `dataTypeW` is data type of the matrix `W` and `computeType` is compute type of the operation. [`cusolverDnXsyevd`] only supports the following four combinations.
10709    ///
10710    /// **Valid combination of data type and compute type**
10711    ///
10712    /// | **DataTypeA** | **DataTypeW** | **ComputeType** | **Meaning** |
10713    /// | --- | --- | --- | --- |
10714    /// | `CUDA_R_32F` | `CUDA_R_32F` | `CUDA_R_32F` | `SSYEVD` |
10715    /// | `CUDA_R_64F` | `CUDA_R_64F` | `CUDA_R_64F` | `DSYEVD` |
10716    /// | `CUDA_C_32F` | `CUDA_R_32F` | `CUDA_C_32F` | `CHEEVD` |
10717    /// | `CUDA_C_64F` | `CUDA_R_64F` | `CUDA_C_64F` | `ZHEEVD` |
10718    ///
10719    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The operation completed successfully.
10720    ///
10721    /// [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]:   The library was not initialized.
10722    ///
10723    /// [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]:   Invalid parameters were passed (`n<0`, or `lda<max(1,n)`, or `jobz` is not [`cusolverEigMode_t::CUSOLVER_EIG_MODE_NOVECTOR`] or [`cusolverEigMode_t::CUSOLVER_EIG_MODE_VECTOR`], or `uplo` is not [`cublasFillMode_t::CUBLAS_FILL_MODE_LOWER`] or [`cublasFillMode_t::CUBLAS_FILL_MODE_UPPER`]).
10724    ///
10725    /// [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]:   An internal operation failed.
10726    ///
10727    /// # Parameters
10728    ///
10729    /// - `handle`: Handle to the cuSolverDN library context.
10730    /// - `params`: Structure with information collected by [`cusolverDnSetAdvOptions`].
10731    /// - `jobz`: Specifies options to either compute eigenvalue only or compute eigen-pair: `jobz` = [`cusolverEigMode_t::CUSOLVER_EIG_MODE_NOVECTOR`]: Compute eigenvalues only; `jobz` = [`cusolverEigMode_t::CUSOLVER_EIG_MODE_VECTOR`]: Compute eigenvalues and eigenvectors.
10732    /// - `uplo`: Specifies which part of `A` is stored. `uplo` = [`cublasFillMode_t::CUBLAS_FILL_MODE_LOWER`]: Lower triangle of `A` is stored. `uplo` = [`cublasFillMode_t::CUBLAS_FILL_MODE_UPPER`]: Upper triangle of `A` is stored.
10733    /// - `n`: Number of rows (or columns) of matrix `A`.
10734    /// - `dataTypeA`: Data type of array `A`.
10735    /// - `A`: Array of dimension `lda * n` with `lda` is not less than `max(1,n)`. If `uplo` = [`cublasFillMode_t::CUBLAS_FILL_MODE_UPPER`], the leading n-by-n upper triangular part of `A` contains the upper triangular part of the matrix `A`. If `uplo` = [`cublasFillMode_t::CUBLAS_FILL_MODE_LOWER`], the leading n-by-n lower triangular part of `A` contains the lower triangular part of the matrix `A`. On exit, if `jobz` = [`cusolverEigMode_t::CUSOLVER_EIG_MODE_VECTOR`], and `info` = 0, `A` contains the orthonormal eigenvectors of the matrix `A`. If `jobz` = [`cusolverEigMode_t::CUSOLVER_EIG_MODE_NOVECTOR`], the contents of `A` are destroyed.
10736    /// - `lda`: Leading dimension of two-dimensional array used to store matrix `A`.
10737    /// - `dataTypeW`: Data type of array `W`.
10738    /// - `W`: A real array of dimension `n`. The eigenvalue values of `A`, in ascending order, i.e., sorted so that `W(i) <= W(i+1)`.
10739    /// - `computeType`: Data type of computation.
10740    /// - `bufferOnDevice`: Device workspace. Array of type `void` of size `workspaceInBytesOnDevice` bytes.
10741    /// - `workspaceInBytesOnDevice`: Size in bytes of `bufferOnDevice`, returned by [`cusolverDnXsyevd_bufferSize`].
10742    /// - `bufferOnHost`: Host workspace. Array of type `void` of size `workspaceInBytesOnHost` bytes.
10743    /// - `workspaceInBytesOnHost`: Size in bytes of `bufferOnHost`, returned by [`cusolverDnXsyevd_bufferSize`].
10744    /// - `info`: If `info = 0`, the operation is successful. If `info = -i`, the `i-th` parameter is wrong (not counting handle). If `info = i (> 0)`, `info` indicates `i` off-diagonal elements of an intermediate tridiagonal form did not converge to zero.
10745    ///
10746    /// # Return value
10747    ///
10748    /// - [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]: An internal operation failed.
10749    /// - [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]: Invalid parameters were passed (`n<0`, or `lda<max(1,n)`, or `jobz` is not [`cusolverEigMode_t::CUSOLVER_EIG_MODE_NOVECTOR`] or [`cusolverEigMode_t::CUSOLVER_EIG_MODE_VECTOR`], or `uplo` is not [`cublasFillMode_t::CUBLAS_FILL_MODE_LOWER`] or [`cublasFillMode_t::CUBLAS_FILL_MODE_UPPER`]).
10750    /// - [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]: The library was not initialized.
10751    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The operation completed successfully.
10752    pub fn cusolverDnXsyevd(
10753        handle: cusolverDnHandle_t,
10754        params: cusolverDnParams_t,
10755        jobz: cusolverEigMode_t,
10756        uplo: cublasFillMode_t,
10757        n: i64,
10758        dataTypeA: cudaDataType,
10759        A: *mut ::core::ffi::c_void,
10760        lda: i64,
10761        dataTypeW: cudaDataType,
10762        W: *mut ::core::ffi::c_void,
10763        computeType: cudaDataType,
10764        bufferOnDevice: *mut ::core::ffi::c_void,
10765        workspaceInBytesOnDevice: size_t,
10766        bufferOnHost: *mut ::core::ffi::c_void,
10767        workspaceInBytesOnHost: size_t,
10768        info: *mut ::core::ffi::c_int,
10769    ) -> cusolverStatus_t;
10770}
10771unsafe extern "C" {
10772    pub fn cusolverDnXsyevBatched_bufferSize(
10773        handle: cusolverDnHandle_t,
10774        params: cusolverDnParams_t,
10775        jobz: cusolverEigMode_t,
10776        uplo: cublasFillMode_t,
10777        n: i64,
10778        dataTypeA: cudaDataType,
10779        A: *const ::core::ffi::c_void,
10780        lda: i64,
10781        dataTypeW: cudaDataType,
10782        W: *const ::core::ffi::c_void,
10783        computeType: cudaDataType,
10784        workspaceInBytesOnDevice: *mut size_t,
10785        workspaceInBytesOnHost: *mut size_t,
10786        batchSize: i64,
10787    ) -> cusolverStatus_t;
10788}
10789unsafe extern "C" {
10790    /// The helper functions below can calculate the sizes needed for pre-allocated buffer.
10791    ///
10792    /// The following routine:
10793    ///
10794    /// computes eigenvalues and eigenvectors of a sequence of symmetric (Hermitian) $n \times n$ matrices:
10795    ///
10796    /// $$
10797    /// A_j\\*V_j = V_j\\*\Lambda_j
10798    /// $$
10799    /// where $\Lambda_j$ is a real $n \times n$ diagonal matrix. $V_j$ is an $n \times n$ unitary matrix. The diagonal elements of $\Lambda_j$ are the eigenvalues of $A_j$ in ascending order.
10800    ///
10801    /// `syevBatched` performs an eigendecomposition on each matrix. It requires that all matrices are of the same size `n` and are packed in a contiguous way,
10802    ///
10803    /// $$
10804    /// \begin{split}A = \begin{pmatrix}
10805    /// {A0} & {A1} & \cdots \\\\
10806    /// \end{pmatrix}\end{split}
10807    /// $$
10808    /// Each matrix is column-major with leading dimension `lda`, so the formula for random access is $A_{k}\operatorname{(i,j)} = {A\lbrack\ i\ +\ lda\\*j\ +\ lda\\*n\\*k\rbrack}$.
10809    ///
10810    /// The parameter `W` also contains the eigenvalues of each matrix in a contiguous way,
10811    ///
10812    /// $$
10813    /// \begin{split}W = \begin{pmatrix}
10814    /// {W0} & {W1} & \cdots \\\\
10815    /// \end{pmatrix}\end{split}
10816    /// $$
10817    /// The formula for random access of `W` is $W_{k}\operatorname{(j)} = {W\lbrack\ j\ +\ n\\*k\rbrack}$.
10818    ///
10819    /// The user has to provide device and host working space which are pointed to by the input parameters `bufferOnDevice` and `bufferOnHost`. The input parameters `workspaceInBytesOnDevice` and `workspaceInBytesOnHost` denote the size in bytes of the device and host working space, and returned by [`cusolverDnXsyevBatched_bufferSize`].
10820    ///
10821    /// The output parameter `info` is an integer array of size `batchSize`. If the function returns [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`], the first element `info[0] = -i` (less than zero) indicates the `i-th` parameter is wrong (not counting handle). Otherwise, if `info[i] > 0`, `syevBatched` does not converge on the `i-th` matrix.
10822    ///
10823    /// If `jobz` = [`cusolverEigMode_t::CUSOLVER_EIG_MODE_VECTOR`], $A_{j}$ contains the orthonormal eigenvectors of the matrix $A_{j}$.
10824    ///
10825    /// Note that the problem size is limited by the condition `n*lda*batchSize<=INT32_MAX` primarily due to the current implementation constraints.
10826    ///
10827    /// **Algorithms supported by cusolverDnXsyevBatched**
10828    ///
10829    /// |  |  |
10830    /// | --- | --- |
10831    /// | [`cusolverAlgMode_t::CUSOLVER_ALG_0`] or `NULL` | Default. May switch between algorithms for best performance. |
10832    /// | [`cusolverAlgMode_t::CUSOLVER_ALG_1`] | Uses a single algorithm for consistent accuracy over all n. |
10833    ///
10834    /// List of input arguments for [`cusolverDnXsyevBatched_bufferSize`] and [`cusolverDnXsyevBatched`]:
10835    ///
10836    /// The generic API has three different types, `dataTypeA` is data type of the matrix `A`, `dataTypeW` is data type of the array `W` and `computeType` is compute type of the operation. [`cusolverDnXsyevBatched`] only supports the following four combinations:
10837    ///
10838    /// **Valid combination of data type and compute type**
10839    ///
10840    /// | **DataTypeA** | **DataTypeW** | **ComputeType** | **Meaning** |
10841    /// | --- | --- | --- | --- |
10842    /// | `CUDA_R_32F` | `CUDA_R_32F` | `CUDA_R_32F` | `SSYEVBATCHED` |
10843    /// | `CUDA_R_64F` | `CUDA_R_64F` | `CUDA_R_64F` | `DSYEVBATCHED` |
10844    /// | `CUDA_C_32F` | `CUDA_R_32F` | `CUDA_C_32F` | `CSYEVBATCHED` |
10845    /// | `CUDA_C_64F` | `CUDA_R_64F` | `CUDA_C_64F` | `ZSYEVBATCHED` |
10846    ///
10847    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The operation completed successfully.
10848    ///
10849    /// [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]:   The library was not initialized.
10850    ///
10851    /// [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]:   Invalid parameters were passed (`n<0`, or `n*lda*batchSize>INT32_MAX`, or `lda<max(1,n)`, or `jobz` is not [`cusolverEigMode_t::CUSOLVER_EIG_MODE_NOVECTOR`] or `uplo` is not [`cublasFillMode_t::CUBLAS_FILL_MODE_LOWER`] or [`cublasFillMode_t::CUBLAS_FILL_MODE_UPPER`] or `batchSize<0`).
10852    ///
10853    /// [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]:   An internal operation failed.
10854    ///
10855    /// # Parameters
10856    ///
10857    /// - `handle`: Handle to the cuSolverDN library context.
10858    /// - `params`: Structure with information collected by [`cusolverDnSetAdvOptions`].
10859    /// - `jobz`: Specifies options to either compute eigenvalue only or compute eigen-pair: `jobz` = [`cusolverEigMode_t::CUSOLVER_EIG_MODE_NOVECTOR`]: Compute eigenvalues only; `jobz` = [`cusolverEigMode_t::CUSOLVER_EIG_MODE_VECTOR`]: Compute eigenvalues and eigenvectors.
10860    /// - `uplo`: Specifies which part of `A` is stored. `uplo` = [`cublasFillMode_t::CUBLAS_FILL_MODE_LOWER`]: Lower triangle of `A` is stored. `uplo` = [`cublasFillMode_t::CUBLAS_FILL_MODE_UPPER`]: Upper triangle of `A` is stored.
10861    /// - `n`: Number of rows (or columns) of matrix `A`.
10862    /// - `dataTypeA`: Data type of array `A`.
10863    /// - `A`: Array of dimension `lda * n * batchSize` with `lda` is not less than `max(1,n)`. If `uplo` = [`cublasFillMode_t::CUBLAS_FILL_MODE_UPPER`], the leading n-by-n upper triangular part of `Aj` contains the upper triangular part of the matrix `Aj`. If `uplo` = [`cublasFillMode_t::CUBLAS_FILL_MODE_LOWER`], the leading n-by-n lower triangular part of `Aj` contains the lower triangular part of the matrix `Aj`. On exit, if `jobz` = [`cusolverEigMode_t::CUSOLVER_EIG_MODE_VECTOR`], and `info[j]` = 0, `Aj` contains the orthonormal eigenvectors of the matrix `Aj`. If `jobz` = [`cusolverEigMode_t::CUSOLVER_EIG_MODE_NOVECTOR`], the contents of `Aj` are destroyed.
10864    /// - `lda`: Leading dimension of two-dimensional array used to store matrix `Aj`.`lda` is not less than`max(1,n)`.
10865    /// - `dataTypeW`: Data type of array `W`.
10866    /// - `W`: A real array of dimension `n * batchSize`. The eigenvalue values of `Aj`, in ascending order, i.e., sorted so that `Wj(i) <= Wj(i+1)`.
10867    /// - `computeType`: Data type of computation.
10868    /// - `bufferOnDevice`: Device workspace. Array of type `void` of size `workspaceInBytesOnDevice` bytes.
10869    /// - `workspaceInBytesOnDevice`: Size in bytes of `bufferOnDevice`, returned by [`cusolverDnXsyevBatched_bufferSize`].
10870    /// - `bufferOnHost`: Host workspace. Array of type `void` of size `workspaceInBytesOnHost` bytes.
10871    /// - `workspaceInBytesOnHost`: Size in bytes of `bufferOnHost`, returned by [`cusolverDnXsyevBatched_bufferSize`].
10872    /// - `info`: An integer array of dimension `batchSize`. If [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`] is returned, `info[0] = -i` (less than zero) indicates `i-th` parameter is wrong (not counting handle). Otherwise, if `info[i] = 0`, the operation is successful. If `info[i] > 0`, `syevBatched` does not converge on the `i-th` matrix.
10873    /// - `batchSize`: Number of matrices. `batchSize` is not less than 1.
10874    ///
10875    /// # Return value
10876    ///
10877    /// - [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]: An internal operation failed.
10878    /// - [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]: Invalid parameters were passed (`n<0`, or `n*lda*batchSize>INT32_MAX`, or `lda<max(1,n)`, or `jobz` is not [`cusolverEigMode_t::CUSOLVER_EIG_MODE_NOVECTOR`] or `uplo` is not [`cublasFillMode_t::CUBLAS_FILL_MODE_LOWER`] or [`cublasFillMode_t::CUBLAS_FILL_MODE_UPPER`] or `batchSize<0`).
10879    /// - [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]: The library was not initialized.
10880    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The operation completed successfully.
10881    pub fn cusolverDnXsyevBatched(
10882        handle: cusolverDnHandle_t,
10883        params: cusolverDnParams_t,
10884        jobz: cusolverEigMode_t,
10885        uplo: cublasFillMode_t,
10886        n: i64,
10887        dataTypeA: cudaDataType,
10888        A: *mut ::core::ffi::c_void,
10889        lda: i64,
10890        dataTypeW: cudaDataType,
10891        W: *mut ::core::ffi::c_void,
10892        computeType: cudaDataType,
10893        bufferOnDevice: *mut ::core::ffi::c_void,
10894        workspaceInBytesOnDevice: size_t,
10895        bufferOnHost: *mut ::core::ffi::c_void,
10896        workspaceInBytesOnHost: size_t,
10897        info: *mut ::core::ffi::c_int,
10898        batchSize: i64,
10899    ) -> cusolverStatus_t;
10900}
10901unsafe extern "C" {
10902    pub fn cusolverDnXsyevdx_bufferSize(
10903        handle: cusolverDnHandle_t,
10904        params: cusolverDnParams_t,
10905        jobz: cusolverEigMode_t,
10906        range: cusolverEigRange_t,
10907        uplo: cublasFillMode_t,
10908        n: i64,
10909        dataTypeA: cudaDataType,
10910        A: *const ::core::ffi::c_void,
10911        lda: i64,
10912        vl: *mut ::core::ffi::c_void,
10913        vu: *mut ::core::ffi::c_void,
10914        il: i64,
10915        iu: i64,
10916        h_meig: *mut i64,
10917        dataTypeW: cudaDataType,
10918        W: *const ::core::ffi::c_void,
10919        computeType: cudaDataType,
10920        workspaceInBytesOnDevice: *mut size_t,
10921        workspaceInBytesOnHost: *mut size_t,
10922    ) -> cusolverStatus_t;
10923}
10924unsafe extern "C" {
10925    /// The helper functions below can calculate the sizes needed for pre-allocated buffer.
10926    ///
10927    /// The following routine:
10928    ///
10929    /// computes all or selection of the eigenvalues and optionally eigenvectors of a symmetric (Hermitian) $n \times n$ matrix `A` using the generic API interface. The standard symmetric eigenvalue problem is:
10930    ///
10931    /// $$
10932    /// A\\*V = V\\*\Lambda
10933    /// $$
10934    /// where `Λ` is a real `n×h_meig` diagonal matrix. `V` is an `n×h_meig` unitary matrix. `h_meig` is the number of eigenvalues/eigenvectors computed by the routine, `h_meig` is equal to `n` when the whole spectrum (e.g., `range` = [`cusolverEigRange_t::CUSOLVER_EIG_RANGE_ALL`]) is requested. The diagonal elements of `Λ` are the eigenvalues of `A` in ascending order.
10935    ///
10936    /// The user has to provide device and host working spaces which are pointed by input parameters `bufferOnDevice` and `bufferOnHost`. The input parameters `workspaceInBytesOnDevice` (and `workspaceInBytesOnHost`) is size in bytes of the device (and host) working space, and it is returned by [`cusolverDnXsyevdx_bufferSize`].
10937    ///
10938    /// If output parameter `info = -i` (less than zero), the `i-th` parameter is wrong (not counting handle). If `info = i` (greater than zero), `i` off-diagonal elements of an intermediate tridiagonal form did not converge to zero.
10939    ///
10940    /// if `jobz` = [`cusolverEigMode_t::CUSOLVER_EIG_MODE_VECTOR`], `A` contains the orthonormal eigenvectors of the matrix `A`. The eigenvectors are computed by a divide and conquer algorithm.
10941    ///
10942    /// Currently, [`cusolverDnXsyevdx`] supports only the default algorithm.
10943    ///
10944    /// Please visit [cuSOLVER Library Samples - Xsyevdx](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/Xsyevdx) for a code example.
10945    ///
10946    /// **Algorithms supported by cusolverDnXsyevdx**
10947    ///
10948    /// |  |  |
10949    /// | --- | --- |
10950    /// | [`cusolverAlgMode_t::CUSOLVER_ALG_0`] or `NULL` | Default algorithm. |
10951    ///
10952    /// List of input arguments for [`cusolverDnXsyevdx_bufferSize`] and [`cusolverDnXsyevdx`]:
10953    ///
10954    /// The generic API has three different types, `dataTypeA` is data type of the matrix `A`, `dataTypeW` is data type of the matrix `W` and `computeType` is compute type of the operation. [`cusolverDnXsyevdx`] only supports the following four combinations:
10955    ///
10956    /// **Valid combination of data type and compute type**
10957    ///
10958    /// | **DataTypeA** | **DataTypeW** | **ComputeType** | **Meaning** |
10959    /// | --- | --- | --- | --- |
10960    /// | `CUDA_R_32F` | `CUDA_R_32F` | `CUDA_R_32F` | `SSYEVDX` |
10961    /// | `CUDA_R_64F` | `CUDA_R_64F` | `CUDA_R_64F` | `DSYEVDX` |
10962    /// | `CUDA_C_32F` | `CUDA_R_32F` | `CUDA_C_32F` | `CHEEVDX` |
10963    /// | `CUDA_C_64F` | `CUDA_R_64F` | `CUDA_C_64F` | `ZHEEVDX` |
10964    ///
10965    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The operation completed successfully.
10966    ///
10967    /// [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]:   The library was not initialized.
10968    ///
10969    /// [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]:   Invalid parameters were passed (`n<0`, or `lda<max(1,n)`, or `jobz` is not [`cusolverEigMode_t::CUSOLVER_EIG_MODE_NOVECTOR`] or [`cusolverEigMode_t::CUSOLVER_EIG_MODE_VECTOR`], or `range` is not [`cusolverEigRange_t::CUSOLVER_EIG_RANGE_ALL`] or [`cusolverEigRange_t::CUSOLVER_EIG_RANGE_V`] or [`cusolverEigRange_t::CUSOLVER_EIG_RANGE_I`], or `uplo` is not [`cublasFillMode_t::CUBLAS_FILL_MODE_LOWER`] or [`cublasFillMode_t::CUBLAS_FILL_MODE_UPPER`]).
10970    ///
10971    /// [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]:   An internal operation failed.
10972    ///
10973    /// # Parameters
10974    ///
10975    /// - `handle`: Handle to the cuSolverDN library context.
10976    /// - `params`: Structure with information collected by [`cusolverDnSetAdvOptions`].
10977    /// - `jobz`: Specifies options to either compute eigenvalue only or compute eigen-pair: `jobz` = [`cusolverEigMode_t::CUSOLVER_EIG_MODE_NOVECTOR`]: Compute eigenvalues only; `jobz` = [`cusolverEigMode_t::CUSOLVER_EIG_MODE_VECTOR`]: Compute eigenvalues and eigenvectors.
10978    /// - `range`: Specifies options to which selection of eigenvalues and optionally eigenvectors that need to be computed: `range` = [`cusolverEigRange_t::CUSOLVER_EIG_RANGE_ALL`]: all eigenvalues/eigenvectors will be found, will becomes the classical syevd/heevd routine; `range` = [`cusolverEigRange_t::CUSOLVER_EIG_RANGE_V`]: all eigenvalues/eigenvectors in the half-open interval (vl,vu] will be found; `range` = [`cusolverEigRange_t::CUSOLVER_EIG_RANGE_I`]: the il-th through iu-th eigenvalues/eigenvectors will be found;.
10979    /// - `uplo`: Specifies which part of `A` is stored. `uplo` = [`cublasFillMode_t::CUBLAS_FILL_MODE_LOWER`]: Lower triangle of `A` is stored. `uplo` = [`cublasFillMode_t::CUBLAS_FILL_MODE_UPPER`]: Upper triangle of `A` is stored.
10980    /// - `n`: Number of rows (or columns) of matrix `A`.
10981    /// - `dataTypeA`: Data type of array `A`.
10982    /// - `A`: Array of dimension `lda * n` with `lda` is not less than `max(1,n)`. If `uplo` = [`cublasFillMode_t::CUBLAS_FILL_MODE_UPPER`], the leading n-by-n upper triangular part of `A` contains the upper triangular part of the matrix `A`. If `uplo` = [`cublasFillMode_t::CUBLAS_FILL_MODE_LOWER`], the leading n-by-n lower triangular part of `A` contains the lower triangular part of the matrix `A`. On exit, if `jobz` = [`cusolverEigMode_t::CUSOLVER_EIG_MODE_VECTOR`], and `info` = 0, `A` contains the orthonormal eigenvectors of the matrix `A`. If `jobz` = [`cusolverEigMode_t::CUSOLVER_EIG_MODE_NOVECTOR`], the contents of `A` are destroyed.
10983    /// - `lda`: Leading dimension of two-dimensional array used to store matrix `A`.`lda` is not less than`max(1,n)`.
10984    /// - `dataTypeW`: Data type of array `W`.
10985    /// - `W`: A real array of dimension `n`. The eigenvalue values of `A`, in ascending order, i.e., sorted so that `W(i) <= W(i+1)`.
10986    /// - `computeType`: Data type of computation.
10987    /// - `bufferOnDevice`: Device workspace. Array of type `void` of size `workspaceInBytesOnDevice` bytes.
10988    /// - `workspaceInBytesOnDevice`: Size in bytes of `bufferOnDevice`, returned by [`cusolverDnXsyevdx_bufferSize`].
10989    /// - `bufferOnHost`: Host workspace. Array of type `void` of size `workspaceInBytesOnHost` bytes.
10990    /// - `workspaceInBytesOnHost`: Size in bytes of `bufferOnHost`, returned by [`cusolverDnXsyevdx_bufferSize`].
10991    /// - `info`: If `info = 0`, the operation is successful. if `info = -i`, the `i-th` parameter is wrong (not counting handle). If `info = i (> 0)`, `info` indicates `i` off-diagonal elements of an intermediate tridiagonal form did not converge to zero.
10992    ///
10993    /// # Return value
10994    ///
10995    /// - [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]: An internal operation failed.
10996    /// - [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]: Invalid parameters were passed (`n<0`, or `lda<max(1,n)`, or `jobz` is not [`cusolverEigMode_t::CUSOLVER_EIG_MODE_NOVECTOR`] or [`cusolverEigMode_t::CUSOLVER_EIG_MODE_VECTOR`], or `range` is not [`cusolverEigRange_t::CUSOLVER_EIG_RANGE_ALL`] or [`cusolverEigRange_t::CUSOLVER_EIG_RANGE_V`] or [`cusolverEigRange_t::CUSOLVER_EIG_RANGE_I`], or `uplo` is not [`cublasFillMode_t::CUBLAS_FILL_MODE_LOWER`] or [`cublasFillMode_t::CUBLAS_FILL_MODE_UPPER`]).
10997    /// - [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]: The library was not initialized.
10998    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The operation completed successfully.
10999    pub fn cusolverDnXsyevdx(
11000        handle: cusolverDnHandle_t,
11001        params: cusolverDnParams_t,
11002        jobz: cusolverEigMode_t,
11003        range: cusolverEigRange_t,
11004        uplo: cublasFillMode_t,
11005        n: i64,
11006        dataTypeA: cudaDataType,
11007        A: *mut ::core::ffi::c_void,
11008        lda: i64,
11009        vl: *mut ::core::ffi::c_void,
11010        vu: *mut ::core::ffi::c_void,
11011        il: i64,
11012        iu: i64,
11013        meig64: *mut i64,
11014        dataTypeW: cudaDataType,
11015        W: *mut ::core::ffi::c_void,
11016        computeType: cudaDataType,
11017        bufferOnDevice: *mut ::core::ffi::c_void,
11018        workspaceInBytesOnDevice: size_t,
11019        bufferOnHost: *mut ::core::ffi::c_void,
11020        workspaceInBytesOnHost: size_t,
11021        info: *mut ::core::ffi::c_int,
11022    ) -> cusolverStatus_t;
11023}
11024unsafe extern "C" {
11025    pub fn cusolverDnXgeev_bufferSize(
11026        handle: cusolverDnHandle_t,
11027        params: cusolverDnParams_t,
11028        jobvl: cusolverEigMode_t,
11029        jobvr: cusolverEigMode_t,
11030        n: i64,
11031        dataTypeA: cudaDataType,
11032        A: *const ::core::ffi::c_void,
11033        lda: i64,
11034        dataTypeW: cudaDataType,
11035        W: *const ::core::ffi::c_void,
11036        dataTypeVL: cudaDataType,
11037        VL: *const ::core::ffi::c_void,
11038        ldvl: i64,
11039        dataTypeVR: cudaDataType,
11040        VR: *const ::core::ffi::c_void,
11041        ldvr: i64,
11042        computeType: cudaDataType,
11043        workspaceInBytesOnDevice: *mut size_t,
11044        workspaceInBytesOnHost: *mut size_t,
11045    ) -> cusolverStatus_t;
11046}
11047unsafe extern "C" {
11048    /// The helper functions below can calculate the sizes needed for pre-allocated buffer.
11049    ///
11050    /// The following routine:
11051    ///
11052    /// computes for an n-by-n real non-symmetric or complex non-Hermitian matrix `A` the eigenvalues and, optionally, the left and/or right eigenvectors. The right eigenvector `v(j)` of `A` satisfies:
11053    ///
11054    /// $$
11055    /// A\\*v(j) = w(j)\\*v(j)
11056    /// $$
11057    /// where `w(j)` is its eigenvalue. The left eigenvalue `u(j)` of `A` satisfies:
11058    ///
11059    /// $$
11060    /// u(j)^{H}\\*A = w(j)\\*v(j)^{H}
11061    /// $$
11062    /// where $u(j)^{H}$ denotes the conjugate-transpose of `u(j)`.
11063    ///
11064    /// The computed eigenvectors are normalized to have Euclidean norm equal to 1 and largest component real.
11065    ///
11066    /// If `A` is real-valued, there are two options to return the eigenvalues in `W`. The first options sets all data types to real-valued types. Then `W` holds `2*n` entries. The first n entries hold the real parts and the last n entries hold the imaginary parts. The LAPACK interface with separate arrays for the real parts `WR` and the imaginary parts `WI` can be recovered by settings pointers `WR = W`, `WI = W+n`. The second option uses a complex data type for `W`. Then `W` is n entries long; each real eigenvalue is stored as a complex number and for each complex conjugate pair, both eigenvalues are returned. The computation is still executed fully in real arithmetic.
11067    ///
11068    /// The user has to provide device and host working space which are pointed to by the input parameters `bufferOnDevice` and `bufferOnHost`. The input parameters `workspaceInBytesOnDevice` and `workspaceInBytesOnHost` denote the size in bytes of the device and host working space, and returned by [`cusolverDnXgeev_bufferSize`].
11069    ///
11070    /// If the output parameter `info = -i` (less than zero), the `i-th` parameter is wrong (not counting handle). If `info = 0`, the QR algorithm converged and `W` contains the computed eigenvalues of `A` and, if requested, the corresponding left and/or right eigenvectors have been computed. If `info = i` (greater than zero), the QR algorithm failed to compute all the eigenvalues and no eigenvectors have been computed. The elements `i+1:n` of `W` contain eigenvalues which have converged.
11071    ///
11072    /// Remark 1: `geev` only supports the computation of right eigenvectors. So, `jobvl` = [`cusolverEigMode_t::CUSOLVER_EIG_MODE_NOVECTOR`] must be set.
11073    ///
11074    /// Remark 2: `geev` uses balancing to improve the conditioning of the eigenvalues and eigenvectors.
11075    ///
11076    /// Remark 3: `geev` is a hybrid CPU-GPU algorithm. Best performance is attained with pinned host memory.
11077    ///
11078    /// Currently, [`cusolverDnXgeev`] supports only the default algorithm.
11079    ///
11080    /// Please visit [cuSOLVER Library Samples - Xgeev](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/Xgeev) for a code example.
11081    ///
11082    /// **Table of algorithms supported by cusolverDnXgeev**
11083    ///
11084    /// |  |  |
11085    /// | --- | --- |
11086    /// | [`cusolverAlgMode_t::CUSOLVER_ALG_0`] or `NULL` | Default algorithm. |
11087    ///
11088    /// List of input arguments for [`cusolverDnXgeev_bufferSize`] and [`cusolverDnXgeev`]:
11089    ///
11090    /// The generic API has five different types, `dataTypeA` is the data type of the matrix `A`, `dataTypeW` is the data type of the array `W`, `dataTypeVL` is the data type of the matrix `VL`, `dataTypeVR` is the data type of the matrix `VR` and `computeType` is compute type of the operation. [`cusolverDnXgeev`] only supports the following four combinations:
11091    ///
11092    /// **Valid combination of data type and compute type**
11093    ///
11094    /// | **DataTypeA** | **DataTypeW** | **DataTypeVL** | **DataTypeVR** | **ComputeType** | **Meaning** |
11095    /// | --- | --- | --- | --- | --- | --- |
11096    /// | `CUDA_R_32F` | `CUDA_R_32F` | `CUDA_R_32F` | `CUDA_R_32F` | `CUDA_R_32F` | `SGEEV` |
11097    /// | `CUDA_R_32F` | `CUDA_C_32F` | `CUDA_R_32F` | `CUDA_R_32F` | `CUDA_R_32F` | 32F mixed real-complex |
11098    /// | `CUDA_R_64F` | `CUDA_R_64F` | `CUDA_R_64F` | `CUDA_R_64F` | `CUDA_R_64F` | `DGEEV` |
11099    /// | `CUDA_R_64F` | `CUDA_C_64F` | `CUDA_R_64F` | `CUDA_R_64F` | `CUDA_R_64F` | 64F mixed real-complex |
11100    /// | `CUDA_C_32F` | `CUDA_C_32F` | `CUDA_C_32F` | `CUDA_C_32F` | `CUDA_C_32F` | `CGEEV` |
11101    /// | `CUDA_C_64F` | `CUDA_C_64F` | `CUDA_C_64F` | `CUDA_C_64F` | `CUDA_C_64F` | `ZGEEV` |
11102    ///
11103    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The operation completed successfully.
11104    ///
11105    /// [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]:   The library was not initialized.
11106    ///
11107    /// [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]:   Invalid parameters were passed (`jobvl` is not [`cusolverEigMode_t::CUSOLVER_EIG_MODE_NOVECTOR`] or [`cusolverEigMode_t::CUSOLVER_EIG_MODE_VECTOR`], or `jobvr` is not [`cusolverEigMode_t::CUSOLVER_EIG_MODE_NOVECTOR`] or [`cusolverEigMode_t::CUSOLVER_EIG_MODE_VECTOR`], `n<0`, or `lda < max(1,n)`, or `ldvl < n` if `jobvl` is [`cusolverEigMode_t::CUSOLVER_EIG_MODE_VECTOR`], or `ldvr < n` if `jobvr` is [`cusolverEigMode_t::CUSOLVER_EIG_MODE_VECTOR`]).
11108    ///
11109    /// [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]:   An internal operation failed.
11110    ///
11111    /// # Parameters
11112    ///
11113    /// - `handle`: Handle to the cuSolverDN library context.
11114    /// - `params`: Structure with information collected by [`cusolverDnSetAdvOptions`].
11115    /// - `jobvl`: Specifies whether or not to compute left eigenvectors. `jobvl` = [`cusolverEigMode_t::CUSOLVER_EIG_MODE_NOVECTOR`]: Do not compute left eigenvectors of A; `jobvl` = [`cusolverEigMode_t::CUSOLVER_EIG_MODE_VECTOR`]: Compute left eigenvectors of A.
11116    /// - `jobvr`: Specifies whether or not to compute right eigenvectors. `jobvl` = [`cusolverEigMode_t::CUSOLVER_EIG_MODE_NOVECTOR`]: Do not compute left eigenvectors of A; `jobvl` = [`cusolverEigMode_t::CUSOLVER_EIG_MODE_VECTOR`]: Compute left eigenvectors of A.
11117    /// - `n`: Number of rows (or columns) of matrix `A`.
11118    /// - `dataTypeA`: Data type of array `A`.
11119    /// - `A`: Array of dimension `lda * n` with `lda` is not less than `max(1,n)`. On entry, the n-by-n matrix `A`. On exit, `A` has been overwritten.
11120    /// - `lda`: Leading dimension of two-dimensional array used to store matrix `A`.
11121    /// - `dataTypeW`: Data type of array `W`.
11122    /// - `W`: Array holding the computed eigenvalues of `A`. Its length is `2*n` if `dataTypeA` = `CUDA_R_32F` and `dataTypeW` = `CUDA_R_32F` or `dataTypeA` = `CUDA_R_64F` and `dataTypeW` = `CUDA_R_64F` and the first n entries of `W` hold the real parts and the last n entries of `W` hold the imaginary parts of the eigenvalues. Otherwise, the length is n.
11123    /// - `dataTypeVL`: Data type of array `VL`.
11124    /// - `VL`: Array of dimension `ldvl * n`. If `jobvl` = [`cusolverEigMode_t::CUSOLVER_EIG_MODE_VECTOR`], the left eigenvectors `u(j)` are stored one after another in the columns of `VL`, in the same order as their eigenvalues. If `datatypeVL` is complex or the `j-th` eigenvalue is real, then `u(j) = VL(:,j)`, the `j-th` column of `VL`. If `dataTypeVL` is real and the `j-th` and `(j+1)-st` eigenvalues form a complex conjugate pair, then `u(j) = VL(:,j) + i*VL(:,j+1)` and `u(j+1) = VL(:,j) - i*VL(:,j+1)`. If `jobvl` = [`cusolverEigMode_t::CUSOLVER_EIG_MODE_NOVECTOR`], `VL` is not referenced.
11125    /// - `ldvl`: Leading dimension of two-dimensional array used to store matrix `VL` with `ldvl >= 1`. If `jobvl` = [`cusolverEigMode_t::CUSOLVER_EIG_MODE_VECTOR`], `ldvl >= n`.
11126    /// - `dataTypeVR`: Data type of array `VR`.
11127    /// - `VR`: Array of dimension `ldvr * n`. If `jobvr` = [`cusolverEigMode_t::CUSOLVER_EIG_MODE_VECTOR`], the right eigenvectors `v(j)` are stored one after another in the columns of `VR`, in the same order as their eigenvalues. If `datatypeVR` is complex or the `j-th` eigenvalue is real, then `v(j) = VR(:,j)`, the `j-th` column of `VR`. If `dataTypeVR` is real and the `j-th` and `(j+1)-st` eigenvalues form a complex conjugate pair, then `v(j) = VR(:,j) + i*VR(:,j+1)` and `v(j+1) = VR(:,j) - i*VR(:,j+1)`. If `jobvr` = [`cusolverEigMode_t::CUSOLVER_EIG_MODE_NOVECTOR`], `VR` is not referenced.
11128    /// - `ldvr`: Leading dimension of two-dimensional array used to store matrix `VR` with `ldvr >= 1`. If `jobvr` = [`cusolverEigMode_t::CUSOLVER_EIG_MODE_VECTOR`], `ldvr >= n`.
11129    /// - `computeType`: Data type of computation.
11130    /// - `bufferOnDevice`: Device workspace. Array of type `void` of size `workspaceInBytesOnDevice` bytes.
11131    /// - `workspaceInBytesOnDevice`: Size in bytes of `bufferOnDevice`, returned by [`cusolverDnXgeev_bufferSize`].
11132    /// - `bufferOnHost`: Host workspace. Array of type `void` of size `workspaceInBytesOnHost` bytes.
11133    /// - `workspaceInBytesOnHost`: Size in bytes of `bufferOnHost`, returned by [`cusolverDnXgeev_bufferSize`].
11134    /// - `info`: If `info = 0`, the operation is successful. If `info = -i`, the `i-th` parameter is wrong (not counting handle). If `info = i` (greater than zero), the QR algorithm failed to compute all the eigenvalues and no eigenvectors have been computed; elements `i+1:n` of `W` contain eigenvalues which have converged.
11135    ///
11136    /// # Return value
11137    ///
11138    /// - [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]: An internal operation failed.
11139    /// - [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]: Invalid parameters were passed (`jobvl` is not [`cusolverEigMode_t::CUSOLVER_EIG_MODE_NOVECTOR`] or [`cusolverEigMode_t::CUSOLVER_EIG_MODE_VECTOR`], or `jobvr` is not [`cusolverEigMode_t::CUSOLVER_EIG_MODE_NOVECTOR`] or [`cusolverEigMode_t::CUSOLVER_EIG_MODE_VECTOR`], `n<0`, or `lda < max(1,n)`, or `ldvl < n` if `jobvl` is [`cusolverEigMode_t::CUSOLVER_EIG_MODE_VECTOR`], or `ldvr < n` if `jobvr` is [`cusolverEigMode_t::CUSOLVER_EIG_MODE_VECTOR`]).
11140    /// - [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]: The library was not initialized.
11141    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The operation completed successfully.
11142    pub fn cusolverDnXgeev(
11143        handle: cusolverDnHandle_t,
11144        params: cusolverDnParams_t,
11145        jobvl: cusolverEigMode_t,
11146        jobvr: cusolverEigMode_t,
11147        n: i64,
11148        dataTypeA: cudaDataType,
11149        A: *mut ::core::ffi::c_void,
11150        lda: i64,
11151        dataTypeW: cudaDataType,
11152        W: *mut ::core::ffi::c_void,
11153        dataTypeVL: cudaDataType,
11154        VL: *mut ::core::ffi::c_void,
11155        ldvl: i64,
11156        dataTypeVR: cudaDataType,
11157        VR: *mut ::core::ffi::c_void,
11158        ldvr: i64,
11159        computeType: cudaDataType,
11160        bufferOnDevice: *mut ::core::ffi::c_void,
11161        workspaceInBytesOnDevice: size_t,
11162        bufferOnHost: *mut ::core::ffi::c_void,
11163        workspaceInBytesOnHost: size_t,
11164        info: *mut ::core::ffi::c_int,
11165    ) -> cusolverStatus_t;
11166}
11167unsafe extern "C" {
11168    pub fn cusolverDnXgesvd_bufferSize(
11169        handle: cusolverDnHandle_t,
11170        params: cusolverDnParams_t,
11171        jobu: ::core::ffi::c_schar,
11172        jobvt: ::core::ffi::c_schar,
11173        m: i64,
11174        n: i64,
11175        dataTypeA: cudaDataType,
11176        A: *const ::core::ffi::c_void,
11177        lda: i64,
11178        dataTypeS: cudaDataType,
11179        S: *const ::core::ffi::c_void,
11180        dataTypeU: cudaDataType,
11181        U: *const ::core::ffi::c_void,
11182        ldu: i64,
11183        dataTypeVT: cudaDataType,
11184        VT: *const ::core::ffi::c_void,
11185        ldvt: i64,
11186        computeType: cudaDataType,
11187        workspaceInBytesOnDevice: *mut size_t,
11188        workspaceInBytesOnHost: *mut size_t,
11189    ) -> cusolverStatus_t;
11190}
11191unsafe extern "C" {
11192    /// The helper functions below can calculate the sizes needed for pre-allocated buffer.
11193    ///
11194    /// The following routine:
11195    ///
11196    /// This function computes the singular value decomposition (SVD) of an $m \times n$ matrix `A` and corresponding the left and/or right singular vectors. The SVD is written:
11197    ///
11198    /// $$
11199    /// A = U\\*\Sigma\\*V^{H}
11200    /// $$
11201    /// where $\Sigma$ is an $m \times n$ matrix which is zero except for its `min(m,n)` diagonal elements, `U` is an $m \times m$ unitary matrix, and `V` is an $n \times n$ unitary matrix. The diagonal elements of $\Sigma$ are the singular values of `A`; they are real and non-negative, and are returned in descending order. The first `min(m,n)` columns of `U` and `V` are the left and right singular vectors of `A`.
11202    ///
11203    /// The user has to provide device and host working spaces which are pointed by input parameters `bufferOnDevice` and `bufferOnHost`. The input parameters `workspaceInBytesOnDevice` (and `workspaceInBytesOnHost`) is size in bytes of the device (and host) working space, and it is returned by [`cusolverDnXgesvd_bufferSize`].
11204    ///
11205    /// If output parameter `info = -i` (less than zero), the `i-th` parameter is wrong (not counting handle). if `bdsqr` did not converge, `info` specifies how many superdiagonals of an intermediate bidiagonal form did not converge to zero.
11206    ///
11207    /// Currently, [`cusolverDnXgesvd`] supports only the default algorithm.
11208    ///
11209    /// **Algorithms supported by cusolverDnXgesvd**
11210    ///
11211    /// |  |  |
11212    /// | --- | --- |
11213    /// | [`cusolverAlgMode_t::CUSOLVER_ALG_0`] or `NULL` | Default algorithm. |
11214    ///
11215    /// Please visit [cuSOLVER Library Samples - Xgesvd](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/Xgesvd) for a code example.
11216    ///
11217    /// Remark 1: `gesvd` only supports `m>=n`.
11218    ///
11219    /// Remark 2: the routine returns $V^H$, not `V`.
11220    ///
11221    /// List of input arguments for [`cusolverDnXgesvd_bufferSize`] and [`cusolverDnXgesvd`]:
11222    ///
11223    /// The generic API has three different types, `dataTypeA` is data type of the matrix `A`, `dataTypeS` is data type of the vector `S` and `dataTypeU` is data type of the matrix `U`, `dataTypeVT` is data type of the matrix `VT`, `computeType` is compute type of the operation. [`cusolverDnXgesvd`] only supports the following four combinations.
11224    ///
11225    /// **Valid combination of data type and compute type**
11226    ///
11227    /// | **DataTypeA** | **DataTypeS** | **DataTypeU** | **DataTypeVT** | **ComputeType** | **Meaning** |
11228    /// | --- | --- | --- | --- | --- | --- |
11229    /// | `CUDA_R_32F` | `CUDA_R_32F` | `CUDA_R_32F` | `CUDA_R_32F` | `CUDA_R_32F` | `SGESVD` |
11230    /// | `CUDA_R_64F` | `CUDA_R_64F` | `CUDA_R_64F` | `CUDA_R_64F` | `CUDA_R_64F` | `DGESVD` |
11231    /// | `CUDA_C_32F` | `CUDA_R_32F` | `CUDA_C_32F` | `CUDA_C_32F` | `CUDA_C_32F` | `CGESVD` |
11232    /// | `CUDA_C_64F` | `CUDA_R_64F` | `CUDA_C_64F` | `CUDA_C_64F` | `CUDA_C_64F` | `ZGESVD` |
11233    ///
11234    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The operation completed successfully.
11235    ///
11236    /// [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]:   The library was not initialized.
11237    ///
11238    /// [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]:   Invalid parameters were passed (`m,n<0`, or `lda<max(1,m)`, or `ldu<1`, or if ``` jobu``='S' or 'A' ``ldu<m ```, or `ldvt<1`, or if `jobvt` = ‘A’ `ldvt<n`, or if `jobvt` = ‘S’ `ldvt<min(m,n)`, or `jobu`, `jobvt` are none of ‘N’, ‘O’, ‘S’, ‘A’, or `jobu` = `jobvt` = ‘O’ ).
11239    ///
11240    /// [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]:   An internal operation failed.
11241    ///
11242    /// # Parameters
11243    ///
11244    /// - `handle`: Handle to the cuSolverDN library context.
11245    /// - `params`: Structure with information collected by [`cusolverDnSetAdvOptions`].
11246    /// - `jobu`: Specifies options for computing all or part of the matrix `U`: = ‘A’: all m columns of U are returned in array U: = ‘S’: the first min(m,n) columns of U (the left singular vectors) are returned in the array U; = ‘O’: the first min(m,n) columns of U (the left singular vectors) are overwritten on the array A; = ‘N’: no columns of U (no left singular vectors) are computed.
11247    /// - `jobvt`: Specifies options for computing all or part of the matrix V\*\*T: = ‘A’: all N rows of V\*\*T are returned in the array VT; = ‘S’: the first min(m,n) rows of V\*\*T (the right singular vectors) are returned in the array VT; = ‘O’: the first min(m,n) rows of V\*\*T (the right singular vectors) are overwritten on the array A; = ‘N’: no rows of V\*\*T (no right singular vectors) are computed.
11248    /// - `m`: Number of rows of matrix `A`.
11249    /// - `n`: Number of columns of matrix `A`.
11250    /// - `dataTypeA`: Data type of array `A`.
11251    /// - `A`: Array of dimension `lda * n` with `lda` is not less than `max(1,m)`. On exit, if `jobu` = ‘O’, `A` is overwritten with `U`; if `jobvt` = ‘O’, `A` is overwritten with `VT`; otherwise, the contents of `A` are destroyed.
11252    /// - `lda`: Leading dimension of two-dimensional array used to store matrix `A`.
11253    /// - `dataTypeS`: Data type of array `S`.
11254    /// - `S`: Real array of dimension `min(m,n)`. The singular values of A, sorted so that `S(i) >= S(i+1)`.
11255    /// - `dataTypeU`: Data type of array `U`.
11256    /// - `U`: Array of dimension `ldu * m` with `ldu` is not less than `max(1,m)`. If `jobu` = ‘A’, `U` contains the $m \times m$ unitary matrix `U`. If `jobu` = ‘S’, `U` contains the first min(m,n) columns of U. If `jobu` = ‘N’ or ‘O’, `U` is not referenced.
11257    /// - `ldu`: Leading dimension of two-dimensional array used to store matrix `U`. If `jobu` = ‘A’ or ‘S’, `ldu >= max(1,m)`. Otherwise, `ldu >= 1`.
11258    /// - `dataTypeVT`: Data type of array `VT`.
11259    /// - `VT`: Array of dimension `ldvt * n` with `ldvt` is not less than `max(1,n)`. If `jobvt` = ‘A’,``VT`` contains the $n \times n$ unitary matrix V\*\*T. If `jobvt` = ‘S’, `VT` contains the first min(m,n) rows of V\*\*T. If `jobvt` = ‘N’ or ‘O’, `VT` is not referenced.
11260    /// - `ldvt`: Leading dimension of two-dimensional array used to store matrix `VT`. If `jobvt` = ‘A’, `ldvt >= max(1,n)`. If `jobvt` = ‘S’, `ldvt >= max(1,min(m,n))`. Otherwise, `ldvt >= 1`.
11261    /// - `computeType`: Data type of computation.
11262    /// - `bufferOnDevice`: Device workspace. Array of type `void` of size `workspaceInBytesOnDevice` bytes.
11263    /// - `workspaceInBytesOnDevice`: Size in bytes of `bufferOnDevice`, returned by [`cusolverDnXgesvd_bufferSize`].
11264    /// - `bufferOnHost`: Host workspace. Array of type `void` of size `workspaceInBytesOnHost` bytes.
11265    /// - `workspaceInBytesOnHost`: Size in bytes of `bufferOnHost`, returned by [`cusolverDnXgesvd_bufferSize`].
11266    /// - `info`: If `info = 0`, the operation is successful. If `info = -i`, the `i-th` parameter is wrong (not counting handle). If `info > 0`, `info` indicates how many superdiagonals of an intermediate bidiagonal form did not converge to zero.
11267    ///
11268    /// # Return value
11269    ///
11270    /// - [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]: An internal operation failed.
11271    /// - [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]: Invalid parameters were passed (`m,n<0`, or `lda<max(1,m)`, or `ldu<1`, or if ``` jobu``='S' or 'A' ``ldu<m ```, or `ldvt<1`, or if `jobvt` = ‘A’ `ldvt<n`, or if `jobvt` = ‘S’ `ldvt<min(m,n)`, or `jobu`, `jobvt` are none of ‘N’, ‘O’, ‘S’, ‘A’, or `jobu` = `jobvt` = ‘O’ ).
11272    /// - [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]: The library was not initialized.
11273    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The operation completed successfully.
11274    pub fn cusolverDnXgesvd(
11275        handle: cusolverDnHandle_t,
11276        params: cusolverDnParams_t,
11277        jobu: ::core::ffi::c_schar,
11278        jobvt: ::core::ffi::c_schar,
11279        m: i64,
11280        n: i64,
11281        dataTypeA: cudaDataType,
11282        A: *mut ::core::ffi::c_void,
11283        lda: i64,
11284        dataTypeS: cudaDataType,
11285        S: *mut ::core::ffi::c_void,
11286        dataTypeU: cudaDataType,
11287        U: *mut ::core::ffi::c_void,
11288        ldu: i64,
11289        dataTypeVT: cudaDataType,
11290        VT: *mut ::core::ffi::c_void,
11291        ldvt: i64,
11292        computeType: cudaDataType,
11293        bufferOnDevice: *mut ::core::ffi::c_void,
11294        workspaceInBytesOnDevice: size_t,
11295        bufferOnHost: *mut ::core::ffi::c_void,
11296        workspaceInBytesOnHost: size_t,
11297        info: *mut ::core::ffi::c_int,
11298    ) -> cusolverStatus_t;
11299}
11300unsafe extern "C" {
11301    pub fn cusolverDnXgesvdp_bufferSize(
11302        handle: cusolverDnHandle_t,
11303        params: cusolverDnParams_t,
11304        jobz: cusolverEigMode_t,
11305        econ: ::core::ffi::c_int,
11306        m: i64,
11307        n: i64,
11308        dataTypeA: cudaDataType,
11309        A: *const ::core::ffi::c_void,
11310        lda: i64,
11311        dataTypeS: cudaDataType,
11312        S: *const ::core::ffi::c_void,
11313        dataTypeU: cudaDataType,
11314        U: *const ::core::ffi::c_void,
11315        ldu: i64,
11316        dataTypeV: cudaDataType,
11317        V: *const ::core::ffi::c_void,
11318        ldv: i64,
11319        computeType: cudaDataType,
11320        workspaceInBytesOnDevice: *mut size_t,
11321        workspaceInBytesOnHost: *mut size_t,
11322    ) -> cusolverStatus_t;
11323}
11324unsafe extern "C" {
11325    /// The helper functions below can calculate the sizes needed for pre-allocated buffer.
11326    ///
11327    /// The routine below:
11328    ///
11329    /// This function computes the singular value decomposition (SVD) of an $m \times n$ matrix `A` and corresponding the left and/or right singular vectors. The SVD is written:
11330    ///
11331    /// $$
11332    /// A = U\\*\Sigma\\*V^H
11333    /// $$
11334    /// where $\Sigma$ is an $m \times n$ matrix which is zero except for its `min(m,n)` diagonal elements, `U` is an $m \times m$ unitary matrix, and `V` is an $n \times n$ unitary matrix. The diagonal elements of $\Sigma$ are the singular values of `A`; they are real and non-negative, and are returned in descending order. The first `min(m,n)` columns of `U` and `V` are the left and right singular vectors of `A`.
11335    ///
11336    /// [`cusolverDnXgesvdp`] combines polar decomposition in [14] and [`cusolverDnXsyevd`] to compute SVD. It is much faster than [`cusolverDnXgesvd`] which is based on QR algorithm. However polar decomposition in [14] may not deliver a full unitary matrix when the matrix A has a singular value close to zero. To workaround the issue when the singular value is close to zero, we add a small perturbation so polar decomposition can deliver the correct result. The consequence is inaccurate singular values shifted by this perturbation. The output parameter `h_err_sigma` is the magnitude of this perturbation. In other words, `h_err_sigma` shows the accuracy of SVD.
11337    ///
11338    /// The user has to provide device and host working spaces which are pointed by input parameters `bufferOnDevice` and `bufferOnHost`. The input parameters `workspaceInBytesOnDevice` (and `workspaceInBytesOnHost`) is size in bytes of the device (and host) working space, and it is returned by [`cusolverDnXgesvdp_bufferSize`].
11339    ///
11340    /// If output parameter `info = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
11341    ///
11342    /// Currently, [`cusolverDnXgesvdp`] supports only the default algorithm.
11343    ///
11344    /// **Algorithms supported by cusolverDnXgesvdp**
11345    ///
11346    /// |  |  |
11347    /// | --- | --- |
11348    /// | [`cusolverAlgMode_t::CUSOLVER_ALG_0`] or `NULL` | Default algorithm. |
11349    ///
11350    /// Please visit [cuSOLVER Library Samples - Xgesvdp](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/Xgesvdp) for a code example.
11351    ///
11352    /// Remark 1: `gesvdp` supports `n>=m` as well.
11353    ///
11354    /// Remark 2: the routine returns `V`, not $V^{H}$
11355    ///
11356    /// List of input arguments for [`cusolverDnXgesvdp_bufferSize`] and [`cusolverDnXgesvdp`]:
11357    ///
11358    /// The generic API has three different types, `dataTypeA` is data type of the matrix `A`, `dataTypeS` is data type of the vector `S` and `dataTypeU` is data type of the matrix `U`, `dataTypeV` is data type of the matrix `V`, `computeType` is compute type of the operation. [`cusolverDnXgesvdp`] only supports the following four combinations:
11359    ///
11360    /// **Valid combination of data type and compute type**
11361    ///
11362    /// | **DataTypeA** | **DataTypeS** | **DataTypeU** | **DataTypeV** | **ComputeType** | **Meaning** |
11363    /// | --- | --- | --- | --- | --- | --- |
11364    /// | `CUDA_R_32F` | `CUDA_R_32F` | `CUDA_R_32F` | `CUDA_R_32F` | `CUDA_R_32F` | `SGESVDP` |
11365    /// | `CUDA_R_64F` | `CUDA_R_64F` | `CUDA_R_64F` | `CUDA_R_64F` | `CUDA_R_64F` | `DGESVDP` |
11366    /// | `CUDA_C_32F` | `CUDA_R_32F` | `CUDA_C_32F` | `CUDA_C_32F` | `CUDA_C_32F` | `CGESVDP` |
11367    /// | `CUDA_C_64F` | `CUDA_R_64F` | `CUDA_C_64F` | `CUDA_C_64F` | `CUDA_C_64F` | `ZGESVDP` |
11368    ///
11369    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The operation completed successfully.
11370    ///
11371    /// [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]:   The library was not initialized.
11372    ///
11373    /// [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]:   Invalid parameters were passed (`m,n<0` or `lda<max(1,m)` or `ldu<max(1,m)` or `ldv<max(1,n)`).
11374    ///
11375    /// [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]:   An internal operation failed.
11376    ///
11377    /// # Parameters
11378    ///
11379    /// - `handle`: Handle to the cuSolverDN library context.
11380    /// - `params`: Structure with information collected by [`cusolverDnSetAdvOptions`].
11381    /// - `jobz`: Specifies options to either compute singular values only or compute singular vectors as well:  `jobz` = [`cusolverEigMode_t::CUSOLVER_EIG_MODE_NOVECTOR`]: Compute singular values only.  `jobz` = [`cusolverEigMode_t::CUSOLVER_EIG_MODE_VECTOR`]: Compute singular values and singular vectors.
11382    /// - `econ`: `econ = 1` for economy size for `U` and `V`.
11383    /// - `m`: Number of rows of matrix `A`.
11384    /// - `n`: Number of columns of matrix `A`.
11385    /// - `dataTypeA`: Data type of array `A`.
11386    /// - `A`: Array of dimension `lda * n` with `lda` is not less than `max(1,m)`. On exit, the contents of `A` are destroyed.
11387    /// - `lda`: Leading dimension of two-dimensional array used to store matrix `A`.
11388    /// - `dataTypeS`: Data type of array `S`.
11389    /// - `S`: Real array of dimension `min(m,n)`. The singular values of A, sorted so that `S(i) >= S(i+1)`.
11390    /// - `dataTypeU`: Data type of array `U`.
11391    /// - `U`: Array of dimension `ldu * m` with `ldu` is not less than `max(1,m)`. `U` contains the $m \times m$ unitary matrix `U`. If `econ=1`, only reports first `min(m,n)` columns of `U`.
11392    /// - `ldu`: Leading dimension of two-dimensional array used to store matrix `U`.
11393    /// - `dataTypeV`: Data type of array `V`.
11394    /// - `V`: Array of dimension `ldv * n` with `ldv` is not less than `max(1,n)`. `V` contains the $n \times n$ unitary matrix V. if `econ=1`, only reports first `min(m,n)` columns of `V`.
11395    /// - `ldv`: Leading dimension of two-dimensional array used to store matrix `V`.
11396    /// - `computeType`: Data type of computation.
11397    /// - `bufferOnDevice`: Device workspace. Array of type `void` of size `workspaceInBytesOnDevice` bytes.
11398    /// - `workspaceInBytesOnDevice`: Size in bytes of `bufferOnDevice`, returned by [`cusolverDnXgesvdp_bufferSize`].
11399    /// - `bufferOnHost`: Host workspace. Array of type `void` of size `workspaceInBytesOnHost` bytes.
11400    /// - `workspaceInBytesOnHost`: Size in bytes of `bufferOnHost`, returned by [`cusolverDnXgesvdp_bufferSize`].
11401    /// - `h_err_sigma`: Magnitude of the perturbation, showing the accuracy of SVD.
11402    ///
11403    /// # Return value
11404    ///
11405    /// - [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]: An internal operation failed.
11406    /// - [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]: Invalid parameters were passed (`m,n<0` or `lda<max(1,m)` or `ldu<max(1,m)` or `ldv<max(1,n)`).
11407    /// - [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]: The library was not initialized.
11408    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The operation completed successfully.
11409    pub fn cusolverDnXgesvdp(
11410        handle: cusolverDnHandle_t,
11411        params: cusolverDnParams_t,
11412        jobz: cusolverEigMode_t,
11413        econ: ::core::ffi::c_int,
11414        m: i64,
11415        n: i64,
11416        dataTypeA: cudaDataType,
11417        A: *mut ::core::ffi::c_void,
11418        lda: i64,
11419        dataTypeS: cudaDataType,
11420        S: *mut ::core::ffi::c_void,
11421        dataTypeU: cudaDataType,
11422        U: *mut ::core::ffi::c_void,
11423        ldu: i64,
11424        dataTypeV: cudaDataType,
11425        V: *mut ::core::ffi::c_void,
11426        ldv: i64,
11427        computeType: cudaDataType,
11428        bufferOnDevice: *mut ::core::ffi::c_void,
11429        workspaceInBytesOnDevice: size_t,
11430        bufferOnHost: *mut ::core::ffi::c_void,
11431        workspaceInBytesOnHost: size_t,
11432        d_info: *mut ::core::ffi::c_int,
11433        h_err_sigma: *mut f64,
11434    ) -> cusolverStatus_t;
11435}
11436unsafe extern "C" {
11437    pub fn cusolverDnXgesvdr_bufferSize(
11438        handle: cusolverDnHandle_t,
11439        params: cusolverDnParams_t,
11440        jobu: ::core::ffi::c_schar,
11441        jobv: ::core::ffi::c_schar,
11442        m: i64,
11443        n: i64,
11444        k: i64,
11445        p: i64,
11446        niters: i64,
11447        dataTypeA: cudaDataType,
11448        A: *const ::core::ffi::c_void,
11449        lda: i64,
11450        dataTypeSrand: cudaDataType,
11451        Srand: *const ::core::ffi::c_void,
11452        dataTypeUrand: cudaDataType,
11453        Urand: *const ::core::ffi::c_void,
11454        ldUrand: i64,
11455        dataTypeVrand: cudaDataType,
11456        Vrand: *const ::core::ffi::c_void,
11457        ldVrand: i64,
11458        computeType: cudaDataType,
11459        workspaceInBytesOnDevice: *mut size_t,
11460        workspaceInBytesOnHost: *mut size_t,
11461    ) -> cusolverStatus_t;
11462}
11463unsafe extern "C" {
11464    /// The helper functions below can calculate the sizes needed for pre-allocated buffer.
11465    ///
11466    /// The routine below
11467    ///
11468    /// This function computes the approximated rank-k singular value decomposition (k-SVD) of an $m \times n$ matrix `A` and the corresponding left and/or right singular vectors. The k-SVD is written as:
11469    ///
11470    /// $$
11471    /// A_{k}\approx U\\*\Sigma\\*V^{H}
11472    /// $$
11473    /// where $\Sigma$ is a $k \times k$ matrix which is zero except for its diagonal elements, `U` is an $m \times k$ orthonormal matrix, and `V` is an $k \times n$ orthonormal matrix. The diagonal elements of $\Sigma$ are the approximated singular values of `A`; they are real and non-negative, and are returned in descending order. The columns of `U` and `V` are the top-`k` left and right singular vectors of `A`.
11474    ///
11475    /// [`cusolverDnXgesvdr`] implements randomized methods described in [15] to compute k-SVD that is accurate with high probability if the conditions described in [15] hold. [`cusolverDnXgesvdr`] is intended to compute a very small portion of the spectrum (meaning that `k` is very small compared to `min(m,n)`). of `A` fast and with good quality, specially when the dimensions of the matrix are large.
11476    ///
11477    /// The accuracy of the method depends on the spectrum of `A`, the number of power iterations `niters`, the oversampling parameter `p` and the ratio between `p` and the dimensions of the matrix `A`. Larger values of oversampling `p` or larger number of iterations `niters` might produce more accurate approximations, but it will also increase the run time of [`cusolverDnXgesvdr`].
11478    ///
11479    /// Our recommendation is to use two iterations and set the oversampling to at least `2k`. Once the solver provides enough accuracy, adjust the values of `k` and `niters` for better performance.
11480    ///
11481    /// The user has to provide device and host working spaces which are pointed by input parameters `bufferOnDevice` and `bufferOnHost`. The input parameters `workspaceInBytesOnDevice` (and `workspaceInBytesOnHost`) is size in bytes of the device (and host) working space, and it is returned by [`cusolverDnXgesvdr_bufferSize`].
11482    ///
11483    /// If output parameter `info = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
11484    ///
11485    /// Currently, [`cusolverDnXgesvdr`] supports only the default algorithm.
11486    ///
11487    /// **Algorithms supported by cusolverDnXgesvdr**
11488    ///
11489    /// |  |  |
11490    /// | --- | --- |
11491    /// | [`cusolverAlgMode_t::CUSOLVER_ALG_0`] or `NULL` | Default algorithm. |
11492    ///
11493    /// Please visit [cuSOLVER Library Samples - Xgesvdr](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/Xgesvdr) for a code example.
11494    ///
11495    /// Remark 1: `gesvdr` supports `n>=m` as well.
11496    ///
11497    /// Remark 2: the routine returns `V`, not $V^{H}$
11498    ///
11499    /// List of input arguments for [`cusolverDnXgesvdr_bufferSize`] and [`cusolverDnXgesvdr`]:
11500    ///
11501    /// The generic API has five different types, `dataTypeA` is data type of the matrix `A`, `dataTypeS` is data type of the vector `S` and `dataTypeU` is data type of the matrix `U`, `dataTypeV` is data type of the matrix `V`, `computeType` is compute type of the operation. [`cusolverDnXgesvdr`] only supports the following four combinations.
11502    ///
11503    /// **Valid combination of data type and compute type**
11504    ///
11505    /// | **DataTypeA** | **DataTypeS** | **DataTypeU** | **DataTypeV** | **ComputeType** | **Meaning** |
11506    /// | --- | --- | --- | --- | --- | --- |
11507    /// | `CUDA_R_32F` | `CUDA_R_32F` | `CUDA_R_32F` | `CUDA_R_32F` | `CUDA_R_32F` | `SGESVDR` |
11508    /// | `CUDA_R_64F` | `CUDA_R_64F` | `CUDA_R_64F` | `CUDA_R_64F` | `CUDA_R_64F` | `DGESVDR` |
11509    /// | `CUDA_C_32F` | `CUDA_R_32F` | `CUDA_C_32F` | `CUDA_C_32F` | `CUDA_C_32F` | `CGESVDR` |
11510    /// | `CUDA_C_64F` | `CUDA_R_64F` | `CUDA_C_64F` | `CUDA_C_64F` | `CUDA_C_64F` | `ZGESVDR` |
11511    ///
11512    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The operation completed successfully.
11513    ///
11514    /// [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]:   The library was not initialized.
11515    ///
11516    /// [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]:   Invalid parameters were passed (`m,n<0` or `lda<max(1,m)` or `ldu<max(1,m)` or `ldv<max(1,n)` ).
11517    ///
11518    /// [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]:   An internal operation failed.
11519    ///
11520    /// # Parameters
11521    ///
11522    /// - `handle`: Handle to the cuSolverDN library context.
11523    /// - `params`: Structure with information collected by [`cusolverDnSetAdvOptions`].
11524    /// - `jobu`: Specifies options for computing all or part of the matrix `U`: = ‘S’: the first k columns of U (the left singular vectors) are returned in the array U; = ‘N’: no columns of U (no left singular vectors) are computed.
11525    /// - `jobv`: Specifies options for computing all or part of the matrix V: = ‘S’: the first k rows of V (the right singular vectors) are returned in the array V; = ‘N’: no rows of V (no right singular vectors) are computed.
11526    /// - `m`: Number of rows of matrix `A`.
11527    /// - `n`: Number of columns of matrix `A`.
11528    /// - `k`: Rank of the k-SVD decomposition of matrix `A`. `rank` is less than `min(m,n)`.
11529    /// - `p`: Oversampling. The size of the subspace will be `(k + p)`. `(k+p)` is less than `min(m,n)`.
11530    /// - `niters`: Number of iteration of power method.
11531    /// - `dataTypeA`: Data type of array `A`.
11532    /// - `A`: Array of dimension `lda * n` with `lda` is not less than `max(1,m)`. On exit, the contents of `A` are destroyed.
11533    /// - `lda`: Leading dimension of two-dimensional array used to store matrix `A`.
11534    /// - `computeType`: Data type of computation.
11535    /// - `bufferOnDevice`: Device workspace. Array of type `void` of size `workspaceInBytesOnDevice` bytes.
11536    /// - `workspaceInBytesOnDevice`: Size in bytes of `bufferOnDevice`, returned by [`cusolverDnXgesvdr_bufferSize`].
11537    /// - `bufferOnHost`: Host workspace. Array of type `void` of size `workspaceInBytesOnHost` bytes.
11538    /// - `workspaceInBytesOnHost`: Size in bytes of `bufferOnHost`, returned by [`cusolverDnXgesvdr_bufferSize`].
11539    /// - `d_info`: If `info = 0`, the operation is successful. If `info = -i`, the `i-th` parameter is wrong (not counting handle).
11540    ///
11541    /// # Return value
11542    ///
11543    /// - [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]: An internal operation failed.
11544    /// - [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]: Invalid parameters were passed (`m,n<0` or `lda<max(1,m)` or `ldu<max(1,m)` or `ldv<max(1,n)` ).
11545    /// - [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]: The library was not initialized.
11546    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The operation completed successfully.
11547    pub fn cusolverDnXgesvdr(
11548        handle: cusolverDnHandle_t,
11549        params: cusolverDnParams_t,
11550        jobu: ::core::ffi::c_schar,
11551        jobv: ::core::ffi::c_schar,
11552        m: i64,
11553        n: i64,
11554        k: i64,
11555        p: i64,
11556        niters: i64,
11557        dataTypeA: cudaDataType,
11558        A: *mut ::core::ffi::c_void,
11559        lda: i64,
11560        dataTypeSrand: cudaDataType,
11561        Srand: *mut ::core::ffi::c_void,
11562        dataTypeUrand: cudaDataType,
11563        Urand: *mut ::core::ffi::c_void,
11564        ldUrand: i64,
11565        dataTypeVrand: cudaDataType,
11566        Vrand: *mut ::core::ffi::c_void,
11567        ldVrand: i64,
11568        computeType: cudaDataType,
11569        bufferOnDevice: *mut ::core::ffi::c_void,
11570        workspaceInBytesOnDevice: size_t,
11571        bufferOnHost: *mut ::core::ffi::c_void,
11572        workspaceInBytesOnHost: size_t,
11573        d_info: *mut ::core::ffi::c_int,
11574    ) -> cusolverStatus_t;
11575}
11576unsafe extern "C" {
11577    pub fn cusolverDnXlarft_bufferSize(
11578        handle: cusolverDnHandle_t,
11579        params: cusolverDnParams_t,
11580        direct: cusolverDirectMode_t,
11581        storev: cusolverStorevMode_t,
11582        n: i64,
11583        k: i64,
11584        dataTypeV: cudaDataType,
11585        V: *const ::core::ffi::c_void,
11586        ldv: i64,
11587        dataTypeTau: cudaDataType,
11588        tau: *const ::core::ffi::c_void,
11589        dataTypeT: cudaDataType,
11590        T: *mut ::core::ffi::c_void,
11591        ldt: i64,
11592        computeType: cudaDataType,
11593        workspaceInBytesOnDevice: *mut size_t,
11594        workspaceInBytesOnHost: *mut size_t,
11595    ) -> cusolverStatus_t;
11596}
11597unsafe extern "C" {
11598    /// The helper functions below can calculate the sizes needed for pre-allocated buffer.
11599    ///
11600    /// The following routine:
11601    ///
11602    /// forms the triangular factor `T` of a real block reflector `H` of order `n`, which is defined as a product of `k` elementary reflectors.
11603    /// If:
11604    ///
11605    /// Only `storev == CUBLAS_STOREV_COLUMNWISE` is supported, which indicates that the vector defining the elementary reflector `H(i)` is stored in the i-th column of the array `V`, and $H = I - V \\* T \\* V^{T}$ ($H = I - V \\* T \\* V^{H}$ for complex types).
11606    ///
11607    /// The user has to provide device and host working spaces which are pointed by input parameters `bufferOnDevice` and `bufferOnHost`. The input parameters `workspaceInBytesOnDevice` (and `workspaceInBytesOnHost`) is size in bytes of the device (and host) working space, and it is returned by [`cusolverDnXlarft_bufferSize`].
11608    ///
11609    /// Currently, only `n >= k` scenario is supported.
11610    ///
11611    /// The generic API has four different types:
11612    ///
11613    /// [`cusolverDnXlarft`] only supports the following four combinations.
11614    ///
11615    /// **Valid combinations of data types and compute types**
11616    ///
11617    /// | **DataTypeV** | **DataTypeTau** | **DataTypeT** | **ComputeType** | **Meaning** |
11618    /// | --- | --- | --- | --- | --- |
11619    /// | `CUDA_R_32F` | `CUDA_R_32F` | `CUDA_R_32F` | `CUDA_R_32F` | `SLARFT` |
11620    /// | `CUDA_R_64F` | `CUDA_R_64F` | `CUDA_R_64F` | `CUDA_R_64F` | `DLARFT` |
11621    /// | `CUDA_C_32F` | `CUDA_C_32F` | `CUDA_C_32F` | `CUDA_C_32F` | `CLARFT` |
11622    /// | `CUDA_C_64F` | `CUDA_C_64F` | `CUDA_C_64F` | `CUDA_C_64F` | `ZLARFT` |
11623    ///
11624    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   The operation completed successfully.
11625    ///
11626    /// [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]:   The library was not initialized.
11627    ///
11628    /// [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]:   Invalid parameters were passed (`n == 0`, `k > n`, or `storev == CUBLAS_STOREV_ROWWISE`).
11629    ///
11630    /// [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]:   An internal operation failed.
11631    ///
11632    /// # Parameters
11633    ///
11634    /// - `handle`: Handle to the cuSolverDN library context.
11635    /// - `params`: Structure with information collected by [`cusolverDnSetAdvOptions`].
11636    /// - `direct`: Specifies the order in which the elementary reflectors are multiplied to form the block reflector.
11637    /// - `storev`: Specifies how the vectors which define the elementary reflectors are stored.
11638    /// - `n`: The order of the block reflector `H`. `n >= 0`.
11639    /// - `k`: The order of the triangular factor `T` (= the number of elementary reflectors). `k >= 1`.
11640    /// - `dataTypeV`: Data type of array `V`.
11641    /// - `V`: The matrix `V` of dimension `lda * k`.
11642    /// - `ldv`: Leading dimension of the array `V`. `ldv >= max(1,n)`.
11643    /// - `dataTypeTau`: Data type of array `tau`.
11644    /// - `tau`: Dimension `k`. `tau(i)` must contain the scalar factor of the elementary reflector `H(i)`.
11645    /// - `dataTypeT`: Data type of array `T`.
11646    /// - `T`: Dimension `ldt * k`. The $k \times k$ triangular factor `T` of the block reflector. If `direct == CUBLAS_DIRECT_FORWARD`, `T` is upper triangular; if `direct == CUBLAS_DIRECT_BACKWARD`, `T` is lower triangular.
11647    /// - `ldt`: The leading dimension of the array `T`. `ldt >= k`.
11648    /// - `computeType`: Data type of computation.
11649    /// - `bufferOnDevice`: Device workspace. Array of type `void` of size `workspaceInBytesOnDevice` bytes.
11650    /// - `workspaceInBytesOnDevice`: Size in bytes of `bufferOnDevice`, returned by [`cusolverDnXlarft_bufferSize`].
11651    /// - `bufferOnHost`: Host workspace. Array of type `void` of size `workspaceInBytesOnHost` bytes.
11652    /// - `workspaceInBytesOnHost`: Size in bytes of `bufferOnHost`, returned by [`cusolverDnXlarft_bufferSize`].
11653    ///
11654    /// # Return value
11655    ///
11656    /// - [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]: An internal operation failed.
11657    /// - [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]: Invalid parameters were passed (`n == 0`, `k > n`, or `storev == CUBLAS_STOREV_ROWWISE`).
11658    /// - [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]: The library was not initialized.
11659    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The operation completed successfully.
11660    pub fn cusolverDnXlarft(
11661        handle: cusolverDnHandle_t,
11662        params: cusolverDnParams_t,
11663        direct: cusolverDirectMode_t,
11664        storev: cusolverStorevMode_t,
11665        n: i64,
11666        k: i64,
11667        dataTypeV: cudaDataType,
11668        V: *const ::core::ffi::c_void,
11669        ldv: i64,
11670        dataTypeTau: cudaDataType,
11671        tau: *const ::core::ffi::c_void,
11672        dataTypeT: cudaDataType,
11673        T: *mut ::core::ffi::c_void,
11674        ldt: i64,
11675        computeType: cudaDataType,
11676        bufferOnDevice: *mut ::core::ffi::c_void,
11677        workspaceInBytesOnDevice: size_t,
11678        bufferOnHost: *mut ::core::ffi::c_void,
11679        workspaceInBytesOnHost: size_t,
11680    ) -> cusolverStatus_t;
11681}
11682/// cusolverDnLoggerCallback_t is a callback function pointer type.
11683///
11684/// Use the below function to set the callback function: [`cusolverDnLoggerSetCallback`].
11685pub type cusolverDnLoggerCallback_t = ::core::option::Option<
11686    unsafe extern "C" fn(
11687        logLevel: ::core::ffi::c_int,
11688        functionName: *const ::core::ffi::c_char,
11689        message: *const ::core::ffi::c_char,
11690    ),
11691>;
11692unsafe extern "C" {
11693    /// This function sets the logging callback function.
11694    ///
11695    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   If the callback function was successfully set.
11696    ///
11697    /// See [`cusolverStatus_t`] for a complete list of valid return codes.
11698    ///
11699    /// # Parameters
11700    ///
11701    /// - `callback`: Pointer to a callback function. See [`cusolverDnLoggerCallback_t`].
11702    ///
11703    /// # Return value
11704    ///
11705    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: If the callback function was successfully set.
11706    pub fn cusolverDnLoggerSetCallback(
11707        callback: cusolverDnLoggerCallback_t,
11708    ) -> cusolverStatus_t;
11709}
11710unsafe extern "C" {
11711    /// This 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.
11712    ///
11713    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   If logging file was successfully set.
11714    ///
11715    /// See [`cusolverStatus_t`] for a complete list of valid return codes.
11716    ///
11717    /// # Parameters
11718    ///
11719    /// - `file`: Pointer to an open file. File should have write permission.
11720    ///
11721    /// # Return value
11722    ///
11723    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: If logging file was successfully set.
11724    pub fn cusolverDnLoggerSetFile(file: *mut FILE) -> cusolverStatus_t;
11725}
11726unsafe extern "C" {
11727    /// This function opens a logging output file in the given path.
11728    ///
11729    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   If the logging file was successfully opened.
11730    ///
11731    /// See [`cusolverStatus_t`] for a complete list of valid return codes.
11732    ///
11733    /// # Parameters
11734    ///
11735    /// - `logFile`: Path of the logging output file.
11736    ///
11737    /// # Return value
11738    ///
11739    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: If the logging file was successfully opened.
11740    pub fn cusolverDnLoggerOpenFile(
11741        logFile: *const ::core::ffi::c_char,
11742    ) -> cusolverStatus_t;
11743}
11744unsafe extern "C" {
11745    /// This function sets the value of the logging level.
11746    ///
11747    /// [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]:   If the value was not a valid logging level. See cuSOLVERDn Logging.
11748    ///
11749    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   If the logging level was successfully set.
11750    ///
11751    /// See [`cusolverStatus_t`] for a complete list of valid return codes.
11752    ///
11753    /// # Parameters
11754    ///
11755    /// - `level`: Value of the logging level. See cuSOLVERDn Logging.
11756    ///
11757    /// # Return value
11758    ///
11759    /// - [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]: If the value was not a valid logging level. See cuSOLVERDn Logging.
11760    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: If the logging level was successfully set.
11761    pub fn cusolverDnLoggerSetLevel(level: ::core::ffi::c_int) -> cusolverStatus_t;
11762}
11763unsafe extern "C" {
11764    /// This function sets the value of the logging mask.
11765    ///
11766    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   If the logging mask was successfully set.
11767    ///
11768    /// See [`cusolverStatus_t`] for a complete list of valid return codes.
11769    ///
11770    /// # Parameters
11771    ///
11772    /// - `mask`: Value of the logging mask. See cuSOLVERDn Logging.
11773    ///
11774    /// # Return value
11775    ///
11776    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: If the logging mask was successfully set.
11777    pub fn cusolverDnLoggerSetMask(mask: ::core::ffi::c_int) -> cusolverStatus_t;
11778}
11779unsafe extern "C" {
11780    /// This function disables logging for the entire run.
11781    ///
11782    /// [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]:   If logging was successfully disabled.
11783    ///
11784    /// See [`cusolverStatus_t`] for a complete list of valid return codes.
11785    ///
11786    /// # Return value
11787    ///
11788    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: If logging was successfully disabled.
11789    pub fn cusolverDnLoggerForceDisable() -> cusolverStatus_t;
11790}