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#[repr(u32)]
401#[derive(
402    Debug,
403    Copy,
404    Clone,
405    Hash,
406    PartialOrd,
407    Ord,
408    PartialEq,
409    Eq,
410    TryFromPrimitive,
411    IntoPrimitive,
412)]
413pub enum cusolverStatus_t {
414    /// The operation completed successfully.
415    CUSOLVER_STATUS_SUCCESS = 0,
416    /// 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.
417    ///
418    /// **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.
419    CUSOLVER_STATUS_NOT_INITIALIZED = 1,
420    /// Resource allocation failed inside the cuSolver library. This is usually caused by a `cudaMalloc()` failure.
421    ///
422    /// **To correct:** prior to the function call, deallocate previously allocated memory as much as possible.
423    CUSOLVER_STATUS_ALLOC_FAILED = 2,
424    /// An unsupported value or parameter was passed to the function (a negative vector size, for example).
425    ///
426    /// **To correct:** ensure that all the parameters being passed have valid values.
427    CUSOLVER_STATUS_INVALID_VALUE = 3,
428    /// The function requires a feature absent from the device architecture; usually caused by the lack of support for atomic operations or double precision.
429    ///
430    /// **To correct:** compile and run the application on a device with compute capability 5.0 or above.
431    CUSOLVER_STATUS_ARCH_MISMATCH = 4,
432    CUSOLVER_STATUS_MAPPING_ERROR = 5,
433    /// 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.
434    ///
435    /// **To correct:** check that the hardware, an appropriate version of the driver, and the cuSolver library are correctly installed.
436    CUSOLVER_STATUS_EXECUTION_FAILED = 6,
437    /// An internal cuSolver operation failed. This error is usually caused by a `cudaMemcpyAsync()` failure.
438    ///
439    /// **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.
440    CUSOLVER_STATUS_INTERNAL_ERROR = 7,
441    /// The matrix type is not supported by this function. This is usually caused by passing an invalid matrix descriptor to the function.
442    ///
443    /// **To correct:** check that the fields in `descrA` were set correctly.
444    CUSOLVER_STATUS_MATRIX_TYPE_NOT_SUPPORTED = 8,
445    /// The parameter combination is not supported, for example batched version is not supported or `M &lt; N` is not supported.
446    ///
447    /// **To correct:** consult the documentation, and use a supported configuration.
448    CUSOLVER_STATUS_NOT_SUPPORTED = 9,
449    CUSOLVER_STATUS_ZERO_PIVOT = 10,
450    CUSOLVER_STATUS_INVALID_LICENSE = 11,
451    CUSOLVER_STATUS_IRS_PARAMS_NOT_INITIALIZED = 12,
452    CUSOLVER_STATUS_IRS_PARAMS_INVALID = 13,
453    CUSOLVER_STATUS_IRS_PARAMS_INVALID_PREC = 14,
454    CUSOLVER_STATUS_IRS_PARAMS_INVALID_REFINE = 15,
455    CUSOLVER_STATUS_IRS_PARAMS_INVALID_MAXITER = 16,
456    CUSOLVER_STATUS_IRS_INTERNAL_ERROR = 20,
457    CUSOLVER_STATUS_IRS_NOT_SUPPORTED = 21,
458    CUSOLVER_STATUS_IRS_OUT_OF_RANGE = 22,
459    CUSOLVER_STATUS_IRS_NRHS_NOT_SUPPORTED_FOR_REFINE_GMRES = 23,
460    CUSOLVER_STATUS_IRS_INFOS_NOT_INITIALIZED = 25,
461    CUSOLVER_STATUS_IRS_INFOS_NOT_DESTROYED = 26,
462    CUSOLVER_STATUS_IRS_MATRIX_SINGULAR = 30,
463    CUSOLVER_STATUS_INVALID_WORKSPACE = 31,
464}
465/// The [`cusolverEigType_t`] type indicates which type of eigenvalue the solver is.
466///
467/// 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.
468#[repr(u32)]
469#[derive(
470    Debug,
471    Copy,
472    Clone,
473    Hash,
474    PartialOrd,
475    Ord,
476    PartialEq,
477    Eq,
478    TryFromPrimitive,
479    IntoPrimitive,
480)]
481pub enum cusolverEigType_t {
482    /// A\*x = lambda\*B\*x.
483    CUSOLVER_EIG_TYPE_1 = 1,
484    /// A\*B\*x = lambda\*x.
485    CUSOLVER_EIG_TYPE_2 = 2,
486    /// B\*A\*x = lambda\*x.
487    CUSOLVER_EIG_TYPE_3 = 3,
488}
489/// The [`cusolverEigMode_t`] type indicates whether or not eigenvectors are computed.
490///
491/// 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.
492#[repr(u32)]
493#[derive(
494    Debug,
495    Copy,
496    Clone,
497    Hash,
498    PartialOrd,
499    Ord,
500    PartialEq,
501    Eq,
502    TryFromPrimitive,
503    IntoPrimitive,
504)]
505pub enum cusolverEigMode_t {
506    /// Only eigenvalues are computed.
507    CUSOLVER_EIG_MODE_NOVECTOR = 0,
508    /// Both eigenvalues and eigenvectors are computed.
509    CUSOLVER_EIG_MODE_VECTOR = 1,
510}
511#[repr(u32)]
512#[derive(
513    Debug,
514    Copy,
515    Clone,
516    Hash,
517    PartialOrd,
518    Ord,
519    PartialEq,
520    Eq,
521    TryFromPrimitive,
522    IntoPrimitive,
523)]
524pub enum cusolverEigRange_t {
525    CUSOLVER_EIG_RANGE_ALL = 1001,
526    CUSOLVER_EIG_RANGE_I = 1002,
527    CUSOLVER_EIG_RANGE_V = 1003,
528}
529#[repr(u32)]
530#[derive(
531    Debug,
532    Copy,
533    Clone,
534    Hash,
535    PartialOrd,
536    Ord,
537    PartialEq,
538    Eq,
539    TryFromPrimitive,
540    IntoPrimitive,
541)]
542pub enum cusolverNorm_t {
543    CUSOLVER_INF_NORM = 104,
544    CUSOLVER_MAX_NORM = 105,
545    CUSOLVER_ONE_NORM = 106,
546    CUSOLVER_FRO_NORM = 107,
547}
548/// 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.
549///
550/// *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.*.
551#[repr(u32)]
552#[derive(
553    Debug,
554    Copy,
555    Clone,
556    Hash,
557    PartialOrd,
558    Ord,
559    PartialEq,
560    Eq,
561    TryFromPrimitive,
562    IntoPrimitive,
563)]
564pub enum cusolverIRSRefinement_t {
565    /// Solver is not set; this value is what is set when creating the `params` structure. IRS solver will return an error.
566    CUSOLVER_IRS_REFINE_NOT_SET = 1100,
567    /// 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()`.
568    CUSOLVER_IRS_REFINE_NONE = 1101,
569    /// Classical iterative refinement solver. Similar to the one used in LAPACK routines.
570    CUSOLVER_IRS_REFINE_CLASSICAL = 1102,
571    /// 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`].
572    CUSOLVER_IRS_REFINE_CLASSICAL_GMRES = 1103,
573    /// 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.
574    CUSOLVER_IRS_REFINE_GMRES = 1104,
575    /// 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.
576    CUSOLVER_IRS_REFINE_GMRES_GMRES = 1105,
577    CUSOLVER_IRS_REFINE_GMRES_NOPCOND = 1106,
578    CUSOLVER_PREC_DD = 1150,
579    CUSOLVER_PREC_SS = 1151,
580    CUSOLVER_PREC_SHT = 1152,
581}
582#[repr(u32)]
583#[derive(
584    Debug,
585    Copy,
586    Clone,
587    Hash,
588    PartialOrd,
589    Ord,
590    PartialEq,
591    Eq,
592    TryFromPrimitive,
593    IntoPrimitive,
594)]
595pub enum cusolverPrecType_t {
596    CUSOLVER_R_8I = 1201,
597    CUSOLVER_R_8U = 1202,
598    CUSOLVER_R_64F = 1203,
599    CUSOLVER_R_32F = 1204,
600    CUSOLVER_R_16F = 1205,
601    CUSOLVER_R_16BF = 1206,
602    CUSOLVER_R_TF32 = 1207,
603    CUSOLVER_R_AP = 1208,
604    CUSOLVER_C_8I = 1211,
605    CUSOLVER_C_8U = 1212,
606    CUSOLVER_C_64F = 1213,
607    CUSOLVER_C_32F = 1214,
608    CUSOLVER_C_16F = 1215,
609    CUSOLVER_C_16BF = 1216,
610    CUSOLVER_C_TF32 = 1217,
611    CUSOLVER_C_AP = 1218,
612}
613/// 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.
614///
615/// The default algorithm is [`cusolverAlgMode_t::CUSOLVER_ALG_0`]. The user can also provide `NULL` to use the default algorithm.
616#[repr(u32)]
617#[derive(
618    Debug,
619    Copy,
620    Clone,
621    Hash,
622    PartialOrd,
623    Ord,
624    PartialEq,
625    Eq,
626    TryFromPrimitive,
627    IntoPrimitive,
628)]
629pub enum cusolverAlgMode_t {
630    CUSOLVER_ALG_0 = 0,
631    CUSOLVER_ALG_1 = 1,
632    CUSOLVER_ALG_2 = 2,
633}
634/// Specifies how the vectors which define the elementary reflectors are stored.
635#[repr(u32)]
636#[derive(
637    Debug,
638    Copy,
639    Clone,
640    Hash,
641    PartialOrd,
642    Ord,
643    PartialEq,
644    Eq,
645    TryFromPrimitive,
646    IntoPrimitive,
647)]
648pub enum cusolverStorevMode_t {
649    /// Columnwise.
650    CUBLAS_STOREV_COLUMNWISE = 0,
651    /// Rowwise.
652    CUBLAS_STOREV_ROWWISE = 1,
653}
654/// Specifies the order in which the elementary reflectors are multiplied to form the block reflector.
655#[repr(u32)]
656#[derive(
657    Debug,
658    Copy,
659    Clone,
660    Hash,
661    PartialOrd,
662    Ord,
663    PartialEq,
664    Eq,
665    TryFromPrimitive,
666    IntoPrimitive,
667)]
668pub enum cusolverDirectMode_t {
669    /// Forward.
670    CUBLAS_DIRECT_FORWARD = 0,
671    /// Backward.
672    CUBLAS_DIRECT_BACKWARD = 1,
673}
674/// 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.
675#[repr(u32)]
676#[derive(
677    Debug,
678    Copy,
679    Clone,
680    Hash,
681    PartialOrd,
682    Ord,
683    PartialEq,
684    Eq,
685    TryFromPrimitive,
686    IntoPrimitive,
687)]
688pub enum cusolverDeterministicMode_t {
689    /// Compute deterministic results.
690    CUSOLVER_DETERMINISTIC_RESULTS = 1,
691    /// Allow non-deterministic results.
692    CUSOLVER_ALLOW_NON_DETERMINISTIC_RESULTS = 2,
693}
694/// The [`cusolverMathMode_t`] type is used in [`cusolverDnSetMathMode`] to choose compute precision modes as defined in the following table:
695///
696/// The following combinations of [`cusolverMathMode_t`] using the bitwise OR operator are allowed:
697///
698/// * [`cusolverMathMode_t::CUSOLVER_FP32_FP64_EMULATED_MATH`] = [`cusolverMathMode_t::CUSOLVER_FP32_EMULATED_BF16X9_MATH`] | [`cusolverMathMode_t::CUSOLVER_FP64_EMULATED_FIXEDPOINT_MATH`].
699#[repr(u32)]
700#[derive(
701    Debug,
702    Copy,
703    Clone,
704    Hash,
705    PartialOrd,
706    Ord,
707    PartialEq,
708    Eq,
709    TryFromPrimitive,
710    IntoPrimitive,
711)]
712pub enum cusolverMathMode_t {
713    /// This is the default math mode. Tensor Cores will be used whenever possible.
714    CUSOLVER_DEFAULT_MATH = 1,
715    /// Use FP32 emulation according to the configured emulation strategy (see [`cusolverDnSetEmulationStrategy`]).
716    CUSOLVER_FP32_EMULATED_BF16X9_MATH = 2,
717    /// Use FP64 emulation according to the configured emulation strategy (see [`cusolverDnSetEmulationStrategy`]).
718    CUSOLVER_FP64_EMULATED_FIXEDPOINT_MATH = 4,
719    /// Combination of [`cusolverMathMode_t::CUSOLVER_FP32_EMULATED_BF16X9_MATH`] and [`cusolverMathMode_t::CUSOLVER_FP64_EMULATED_FIXEDPOINT_MATH`].
720    CUSOLVER_FP32_FP64_EMULATED_MATH = 6,
721}
722unsafe extern "C" {
723    pub fn cusolverGetProperty(
724        type_: libraryPropertyType,
725        value: *mut ::core::ffi::c_int,
726    ) -> cusolverStatus_t;
727}
728unsafe extern "C" {
729    pub fn cusolverGetVersion(version: *mut ::core::ffi::c_int) -> cusolverStatus_t;
730}
731unsafe extern "C" {
732    /// 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.
733    /// 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.
734    /// For the default stream and in all the other cases, cuBLAS will manage its own workspace.
735    ///
736    /// # Parameters
737    ///
738    /// - `handle`: The pointer to the handle to the cuSolverDN context.
739    ///
740    /// # Return value
741    ///
742    /// - [`cusolverStatus_t::CUSOLVER_STATUS_ALLOC_FAILED`]: The resources could not be allocated.
743    /// - [`cusolverStatus_t::CUSOLVER_STATUS_ARCH_MISMATCH`]: The device only supports compute capability 5.0 and above.
744    /// - [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]: The CUDA Runtime initialization failed.
745    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The initialization succeeded.
746    pub fn cusolverDnCreate(handle: *mut cusolverDnHandle_t) -> cusolverStatus_t;
747}
748unsafe extern "C" {
749    /// This function releases CPU-side resources used by the cuSolverDN library.
750    ///
751    /// # Parameters
752    ///
753    /// - `handle`: Handle to the cuSolverDN library context.
754    ///
755    /// # Return value
756    ///
757    /// - [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]: The library was not initialized.
758    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The shutdown succeeded.
759    pub fn cusolverDnDestroy(handle: cusolverDnHandle_t) -> cusolverStatus_t;
760}
761unsafe extern "C" {
762    /// This function sets the stream to be used by the cuSolverDN library to execute its routines.
763    ///
764    /// # Parameters
765    ///
766    /// - `handle`: Handle to the cuSolverDN library context.
767    /// - `streamId`: The stream to be used by the library.
768    ///
769    /// # Return value
770    ///
771    /// - [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]: The library was not initialized.
772    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The stream was set successfully.
773    pub fn cusolverDnSetStream(
774        handle: cusolverDnHandle_t,
775        streamId: cudaStream_t,
776    ) -> cusolverStatus_t;
777}
778unsafe extern "C" {
779    /// This function queries the stream to be used by the cuSolverDN library to execute its routines.
780    ///
781    /// # Parameters
782    ///
783    /// - `handle`: Handle to the cuSolverDN library context.
784    /// - `streamId`: The stream which is used by `handle`.
785    ///
786    /// # Return value
787    ///
788    /// - [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]: The library was not initialized.
789    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The stream was set successfully.
790    pub fn cusolverDnGetStream(
791        handle: cusolverDnHandle_t,
792        streamId: *mut cudaStream_t,
793    ) -> cusolverStatus_t;
794}
795unsafe extern "C" {
796    /// This function sets the deterministic mode of all cuSolverDN functions for `handle`. For improved performance,
797    /// non-deterministic results can be allowed. Affected functions are `cusolverDn&lt;t>geqrf()`, `cusolverDn&lt;t>syevd()`, `cusolverDn&lt;t>syevdx()`, `cusolverDn&lt;t>gesvd()` (if `m > n`), `cusolverDn&lt;t>gesvdj()`, [`cusolverDnXgeqrf`], [`cusolverDnXsyevd`], [`cusolverDnXsyevdx`], [`cusolverDnXgesvd`] (if `m > n`), [`cusolverDnXgesvdr`] and [`cusolverDnXgesvdp`].
798    ///
799    /// # Parameters
800    ///
801    /// - `handle`: Handle to the cuSolverDN library context.
802    /// - `mode`: The deterministic mode to be used with `handle`.
803    ///
804    /// # Return value
805    ///
806    /// - [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]: An internal error occurred.
807    /// - [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]: The library was not initialized.
808    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The modes were set successfully.
809    pub fn cusolverDnSetDeterministicMode(
810        handle: cusolverDnHandle_t,
811        mode: cusolverDeterministicMode_t,
812    ) -> cusolverStatus_t;
813}
814unsafe extern "C" {
815    /// This function queries the deterministic mode which is set for `handle`.
816    ///
817    /// # Parameters
818    ///
819    /// - `handle`: Handle to the cuSolverDN library context.
820    /// - `mode`: The deterministic mode of `handle`.
821    ///
822    /// # Return value
823    ///
824    /// - [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]: `mode` is a `NULL` pointer.
825    /// - [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]: The library was not initialized.
826    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The modes were queried successfully.
827    pub fn cusolverDnGetDeterministicMode(
828        handle: cusolverDnHandle_t,
829        mode: *mut cusolverDeterministicMode_t,
830    ) -> cusolverStatus_t;
831}
832unsafe extern "C" {
833    /// 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.
834    ///
835    /// # Parameters
836    ///
837    /// - `handle`: Handle to the cuSolverDN library context.
838    ///
839    /// # Return value
840    ///
841    /// - [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]: An internal error occurred.
842    /// - [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]: An invalid mode was given.
843    /// - [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]: The library was not initialized.
844    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The mode was set successfully.
845    pub fn cusolverDnSetMathMode(
846        handle: cusolverDnHandle_t,
847        mode: cusolverMathMode_t,
848    ) -> cusolverStatus_t;
849}
850unsafe extern "C" {
851    /// 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.
852    ///
853    /// # Parameters
854    ///
855    /// - `handle`: Handle to the cuSolverDN library context.
856    ///
857    /// # Return value
858    ///
859    /// - [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]: `modes` is a `NULL` pointer.
860    /// - [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]: The library was not initialized.
861    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The mode was set successfully.
862    pub fn cusolverDnGetMathMode(
863        handle: cusolverDnHandle_t,
864        mode: *mut cusolverMathMode_t,
865    ) -> cusolverStatus_t;
866}
867unsafe extern "C" {
868    /// 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).
869    ///
870    /// The emulation strategy set by this API only has an effect, **once** one of the following math modes is enabled (see also [`cusolverMathMode_t`]):
871    ///
872    /// * [`cusolverMathMode_t::CUSOLVER_FP32_EMULATED_BF16X9_MATH`]
873    /// * [`cusolverMathMode_t::CUSOLVER_FP64_EMULATED_FIXEDPOINT_MATH`]
874    /// * [`cusolverMathMode_t::CUSOLVER_FP32_FP64_EMULATED_MATH`].
875    ///
876    /// # Parameters
877    ///
878    /// - `handle`: Handle to the cuSolverDN library context.
879    /// - `strategy`: The emulation strategy to be used with `handle`.
880    ///
881    /// # Return value
882    ///
883    /// - [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]: An internal error occurred.
884    /// - [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]: strategy was not a supported emulation strategy.
885    /// - [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]: The library was not initialized.
886    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The strategy was set successfully.
887    pub fn cusolverDnSetEmulationStrategy(
888        handle: cusolverDnHandle_t,
889        strategy: cudaEmulationStrategy_t,
890    ) -> cusolverStatus_t;
891}
892unsafe extern "C" {
893    /// This function queries the emulation strategy which is set for `handle`.
894    ///
895    /// The emulation strategy returned by this API only has an effect, **once** one of the following math modes is enabled (see also [`cusolverMathMode_t`]):
896    ///
897    /// * [`cusolverMathMode_t::CUSOLVER_FP32_EMULATED_BF16X9_MATH`]
898    /// * [`cusolverMathMode_t::CUSOLVER_FP64_EMULATED_FIXEDPOINT_MATH`]
899    /// * [`cusolverMathMode_t::CUSOLVER_FP32_FP64_EMULATED_MATH`].
900    ///
901    /// # Parameters
902    ///
903    /// - `handle`: Handle to the cuSolverDN library context.
904    /// - `strategy`: The emulation strategy of `handle`.
905    ///
906    /// # Return value
907    ///
908    /// - [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]: `emulationStrategy` is a `NULL` pointer.
909    /// - [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]: The library was not initialized.
910    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The strategy was queried successfully.
911    pub fn cusolverDnGetEmulationStrategy(
912        handle: cusolverDnHandle_t,
913        strategy: *mut cudaEmulationStrategy_t,
914    ) -> cusolverStatus_t;
915}
916unsafe extern "C" {
917    /// 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`].
918    ///
919    /// The mantissa control set by this API only has an effect, **once** one of the following math modes is enabled (see also [`cusolverMathMode_t`]):
920    ///
921    /// * [`cusolverMathMode_t::CUSOLVER_FP64_EMULATED_FIXEDPOINT_MATH`]
922    /// * [`cusolverMathMode_t::CUSOLVER_FP32_FP64_EMULATED_MATH`].
923    ///
924    /// # Parameters
925    ///
926    /// - `handle`: Handle to the cuSolverDN library context.
927    /// - `control`: The mantissa control mode to be used with `handle`.
928    ///
929    /// # Return value
930    ///
931    /// - [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]: An internal error occurred.
932    /// - [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]: `control` is not a valid [`cudaEmulationMantissaControl_t`] value.
933    /// - [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]: The library was not initialized.
934    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The mantissa control was set successfully.
935    pub fn cusolverDnSetFixedPointEmulationMantissaControl(
936        handle: cusolverDnHandle_t,
937        control: cudaEmulationMantissaControl_t,
938    ) -> cusolverStatus_t;
939}
940unsafe extern "C" {
941    /// This function queries how the number of mantissa bits is determined for fixed point FP64 emulation.
942    ///
943    /// The mantissa control returned by this API only has an effect, **once** one of the following math modes is enabled (see also [`cusolverMathMode_t`]):
944    ///
945    /// * [`cusolverMathMode_t::CUSOLVER_FP64_EMULATED_FIXEDPOINT_MATH`]
946    /// * [`cusolverMathMode_t::CUSOLVER_FP32_FP64_EMULATED_MATH`].
947    ///
948    /// # Parameters
949    ///
950    /// - `handle`: Handle to the cuSolverDN library context.
951    /// - `control`: The mantissa control mode of `handle`.
952    ///
953    /// # Return value
954    ///
955    /// - [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]: `control` is a `NULL` pointer.
956    /// - [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]: The library was not initialized.
957    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The mantissa control was queried successfully.
958    pub fn cusolverDnGetFixedPointEmulationMantissaControl(
959        handle: cusolverDnHandle_t,
960        control: *mut cudaEmulationMantissaControl_t,
961    ) -> cusolverStatus_t;
962}
963unsafe extern "C" {
964    /// This function sets the maximum number of mantissa bits for fixed point FP64 emulation.
965    ///
966    /// 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`]):
967    ///
968    /// * [`cusolverMathMode_t::CUSOLVER_FP64_EMULATED_FIXEDPOINT_MATH`]
969    /// * [`cusolverMathMode_t::CUSOLVER_FP32_FP64_EMULATED_MATH`].
970    ///
971    /// # Parameters
972    ///
973    /// - `handle`: Handle to the cuSolverDN library context.
974    /// - `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).
975    ///
976    /// # Return value
977    ///
978    /// - [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]: An internal error occurred.
979    /// - [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]: `mantissaBitCount` is less than `0`.
980    /// - [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]: The library was not initialized.
981    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The mantissa bit count was set successfully.
982    pub fn cusolverDnSetFixedPointEmulationMaxMantissaBitCount(
983        handle: cusolverDnHandle_t,
984        mantissaBitCount: ::core::ffi::c_int,
985    ) -> cusolverStatus_t;
986}
987unsafe extern "C" {
988    /// This function queries the maximum number of mantissa bits used for fixed point FP64 emulation.
989    ///
990    /// 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`]):
991    ///
992    /// * [`cusolverMathMode_t::CUSOLVER_FP64_EMULATED_FIXEDPOINT_MATH`]
993    /// * [`cusolverMathMode_t::CUSOLVER_FP32_FP64_EMULATED_MATH`].
994    ///
995    /// # Parameters
996    ///
997    /// - `handle`: Handle to the cuSolverDN library context.
998    /// - `mantissaBitCount`: The maximum number of mantissa bits used.
999    ///
1000    /// # Return value
1001    ///
1002    /// - [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]: `mantissaBitCount` is a `NULL` pointer.
1003    /// - [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]: The library was not initialized.
1004    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The mantissa bit count was queried successfully.
1005    pub fn cusolverDnGetFixedPointEmulationMaxMantissaBitCount(
1006        handle: cusolverDnHandle_t,
1007        mantissaBitCount: *mut ::core::ffi::c_int,
1008    ) -> cusolverStatus_t;
1009}
1010unsafe extern "C" {
1011    /// This function sets the mantissa bit offset for fixed point FP64 emulation in case of dynamic mantissa control mode.
1012    ///
1013    /// 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`]):
1014    ///
1015    /// * [`cusolverMathMode_t::CUSOLVER_FP64_EMULATED_FIXEDPOINT_MATH`]
1016    /// * [`cusolverMathMode_t::CUSOLVER_FP32_FP64_EMULATED_MATH`]
1017    ///
1018    /// **And** the following mantissa control is enabled (see also [`cusolverDnSetFixedPointEmulationMantissaControl`]):
1019    ///
1020    /// * `CUDA_EMULATION_MANTISSA_CONTROL_DYNAMIC`
1021    ///
1022    /// 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.
1023    ///
1024    /// 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.
1025    ///
1026    /// # Parameters
1027    ///
1028    /// - `handle`: Handle to the cuSolverDN library context.
1029    /// - `mantissaBitOffset`: The mantissa bit offset (default = `0`) to be used when the mantissa control is `CUDA_EMULATION_MANTISSA_CONTROL_DYNAMIC`.
1030    ///
1031    /// # Return value
1032    ///
1033    /// - [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]: An internal error occurred.
1034    /// - [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]: The library was not initialized.
1035    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The mantissa bit offset was set successfully.
1036    pub fn cusolverDnSetFixedPointEmulationMantissaBitOffset(
1037        handle: cusolverDnHandle_t,
1038        mantissaBitOffset: ::core::ffi::c_int,
1039    ) -> cusolverStatus_t;
1040}
1041unsafe extern "C" {
1042    /// This function queries the mantissa bit offset for fixed point FP64 emulation in case of dynamic mantissa control mode.
1043    ///
1044    /// 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`]):
1045    ///
1046    /// * [`cusolverMathMode_t::CUSOLVER_FP64_EMULATED_FIXEDPOINT_MATH`]
1047    /// * [`cusolverMathMode_t::CUSOLVER_FP32_FP64_EMULATED_MATH`]
1048    ///
1049    /// **And** the following mantissa control is enabled (see also [`cusolverDnSetFixedPointEmulationMantissaControl`]):
1050    ///
1051    /// * `CUDA_EMULATION_MANTISSA_CONTROL_DYNAMIC`
1052    ///
1053    /// 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.
1054    ///
1055    /// # Parameters
1056    ///
1057    /// - `handle`: Handle to the cuSolverDN library context.
1058    /// - `mantissaBitOffset`: The mantissa bit offset used when `CUDA_EMULATION_MANTISSA_CONTROL_DYNAMIC` is in use.
1059    ///
1060    /// # Return value
1061    ///
1062    /// - [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]: `mantissaBitOffset` is a `NULL` pointer.
1063    /// - [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]: The library was not initialized.
1064    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The mantissa bit offset was queried successfully.
1065    pub fn cusolverDnGetFixedPointEmulationMantissaBitOffset(
1066        handle: cusolverDnHandle_t,
1067        mantissaBitOffset: *mut ::core::ffi::c_int,
1068    ) -> cusolverStatus_t;
1069}
1070unsafe extern "C" {
1071    /// This function sets the handling of special floating point values for `handle`, which is used **once** floating point emulation is allowed.
1072    ///
1073    /// 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`]):
1074    ///
1075    /// * [`cusolverMathMode_t::CUSOLVER_FP32_EMULATED_BF16X9_MATH`]
1076    /// * [`cusolverMathMode_t::CUSOLVER_FP64_EMULATED_FIXEDPOINT_MATH`]
1077    /// * [`cusolverMathMode_t::CUSOLVER_FP32_FP64_EMULATED_MATH`].
1078    ///
1079    /// # Parameters
1080    ///
1081    /// - `handle`: Handle to the cuSolverDN library context.
1082    /// - `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.
1083    ///
1084    /// # Return value
1085    ///
1086    /// - [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]: An internal error occurred.
1087    /// - [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]: The library was not initialized.
1088    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The special value support was set successfully.
1089    pub fn cusolverDnSetEmulationSpecialValuesSupport(
1090        handle: cusolverDnHandle_t,
1091        mask: cudaEmulationSpecialValuesSupport_t,
1092    ) -> cusolverStatus_t;
1093}
1094unsafe extern "C" {
1095    /// This function queries the special floating point value support which is set for `handle` if floating point emulation is allowed.
1096    ///
1097    /// 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`]):
1098    ///
1099    /// * [`cusolverMathMode_t::CUSOLVER_FP32_EMULATED_BF16X9_MATH`]
1100    /// * [`cusolverMathMode_t::CUSOLVER_FP64_EMULATED_FIXEDPOINT_MATH`]
1101    /// * [`cusolverMathMode_t::CUSOLVER_FP32_FP64_EMULATED_MATH`]
1102    ///
1103    /// Otherwise, special floating point values are handled as expected.
1104    ///
1105    /// # Parameters
1106    ///
1107    /// - `handle`: Handle to the cuSolverDN library context.
1108    /// - `mask`: The special value support of `handle`. Please see [`cudaEmulationSpecialValuesSupport_t`] for more information about the allowed values of `mask`.
1109    ///
1110    /// # Return value
1111    ///
1112    /// - [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]: `mask` is a `NULL` pointer.
1113    /// - [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]: The library was not initialized.
1114    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The special value handling was queried successfully.
1115    pub fn cusolverDnGetEmulationSpecialValuesSupport(
1116        handle: cusolverDnHandle_t,
1117        mask: *mut cudaEmulationSpecialValuesSupport_t,
1118    ) -> cusolverStatus_t;
1119}
1120unsafe extern "C" {
1121    /// 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.
1122    ///
1123    /// # Return value
1124    ///
1125    /// - [`cusolverStatus_t::CUSOLVER_STATUS_ALLOC_FAILED`]: The resources could not be allocated.
1126    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The structure was created and initialized successfully.
1127    pub fn cusolverDnIRSParamsCreate(
1128        params_ptr: *mut cusolverDnIRSParams_t,
1129    ) -> cusolverStatus_t;
1130}
1131unsafe extern "C" {
1132    /// This function destroys and releases any memory required by the Params structure.
1133    ///
1134    /// # Parameters
1135    ///
1136    /// - `params`: The `cusolverDnIRSParams_t Params` structure.
1137    ///
1138    /// # Return value
1139    ///
1140    /// - [`cusolverStatus_t::CUSOLVER_STATUS_IRS_INFOS_NOT_DESTROYED`]: Not all the `Infos` structure associated with this `Params` structure have been destroyed yet.
1141    /// - [`cusolverStatus_t::CUSOLVER_STATUS_IRS_PARAMS_NOT_INITIALIZED`]: The `Params` structure was not created.
1142    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The resources were released successfully.
1143    pub fn cusolverDnIRSParamsDestroy(params: cusolverDnIRSParams_t) -> cusolverStatus_t;
1144}
1145unsafe extern "C" {
1146    /// 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.
1147    ///
1148    /// [`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.
1149    ///
1150    /// [`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()`.
1151    ///
1152    /// [`cusolverIRSRefinement_t::CUSOLVER_IRS_REFINE_CLASSICAL`]:   Classical iterative refinement solver. Similar to the one used in LAPACK routines.
1153    ///
1154    /// [`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.
1155    ///
1156    /// [`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`].
1157    ///
1158    /// [`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.
1159    ///
1160    /// # Parameters
1161    ///
1162    /// - `params`: The [`cusolverDnIRSParams_t`]`Params` structure.
1163    ///
1164    /// # Return value
1165    ///
1166    /// - [`cusolverIRSRefinement_t::CUSOLVER_IRS_REFINE_CLASSICAL`]: Classical iterative refinement solver. Similar to the one used in LAPACK routines.
1167    /// - [`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`].
1168    /// - [`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.
1169    /// - [`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.
1170    /// - [`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()`.
1171    /// - [`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.
1172    /// - [`cusolverStatus_t::CUSOLVER_STATUS_IRS_PARAMS_NOT_INITIALIZED`]: The `Params` structure was not created.
1173    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The operation completed successfully.
1174    pub fn cusolverDnIRSParamsSetRefinementSolver(
1175        params: cusolverDnIRSParams_t,
1176        refinement_solver: cusolverIRSRefinement_t,
1177    ) -> cusolverStatus_t;
1178}
1179unsafe extern "C" {
1180    /// 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.
1181    ///
1182    /// # Parameters
1183    ///
1184    /// - `params`: The `cusolverDnIRSParams_t Params` structure.
1185    /// - `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.
1186    ///
1187    /// # Return value
1188    ///
1189    /// - [`cusolverStatus_t::CUSOLVER_STATUS_IRS_PARAMS_NOT_INITIALIZED`]: The `Params` structure was not created.
1190    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The operation completed successfully.
1191    pub fn cusolverDnIRSParamsSetSolverMainPrecision(
1192        params: cusolverDnIRSParams_t,
1193        solver_main_precision: cusolverPrecType_t,
1194    ) -> cusolverStatus_t;
1195}
1196unsafe extern "C" {
1197    /// 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.
1198    ///
1199    /// # Parameters
1200    ///
1201    /// - `params`: The `cusolverDnIRSParams_t Params` structure.
1202    ///
1203    /// # Return value
1204    ///
1205    /// - [`cusolverStatus_t::CUSOLVER_STATUS_IRS_PARAMS_NOT_INITIALIZED`]: The Params structure was not created.
1206    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The operation completed successfully.
1207    pub fn cusolverDnIRSParamsSetSolverLowestPrecision(
1208        params: cusolverDnIRSParams_t,
1209        solver_lowest_precision: cusolverPrecType_t,
1210    ) -> cusolverStatus_t;
1211}
1212unsafe extern "C" {
1213    /// 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.
1214    ///
1215    /// **Supported Inputs/Outputs data type and lower precision for the IRS solver**
1216    ///
1217    /// | **Inputs/Outputs Data Type (e.g., main precision)** | **Supported values for the lowest precision** |
1218    /// | --- | --- |
1219    /// | [`cusolverPrecType_t::CUSOLVER_C_64F`] | `CUSOLVER_C_64F, CUSOLVER_C_32F, CUSOLVER_C_16F, CUSOLVER_C_16BF, CUSOLVER_C_TF32` |
1220    /// | [`cusolverPrecType_t::CUSOLVER_C_32F`] | `CUSOLVER_C_32F, CUSOLVER_C_16F, CUSOLVER_C_16BF, CUSOLVER_C_TF32` |
1221    /// | [`cusolverPrecType_t::CUSOLVER_R_64F`] | `CUSOLVER_R_64F, CUSOLVER_R_32F, CUSOLVER_R_16F, CUSOLVER_R_16BF, CUSOLVER_R_TF32` |
1222    /// | [`cusolverPrecType_t::CUSOLVER_R_32F`] | `CUSOLVER_R_32F, CUSOLVER_R_16F, CUSOLVER_R_16BF, CUSOLVER_R_TF32` |
1223    ///
1224    /// # Parameters
1225    ///
1226    /// - `params`: The `cusolverDnIRSParams_t Params` structure.
1227    /// - `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.
1228    /// - `solver_lowest_precision`: Allowed lowest compute type (for example CUSOLVER_R_16F for half precision computation). See the table below for the supported precisions.
1229    ///
1230    /// # Return value
1231    ///
1232    /// - [`cusolverStatus_t::CUSOLVER_STATUS_IRS_PARAMS_NOT_INITIALIZED`]: The `Params` structure was not created.
1233    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The operation completed successfully.
1234    pub fn cusolverDnIRSParamsSetSolverPrecisions(
1235        params: cusolverDnIRSParams_t,
1236        solver_main_precision: cusolverPrecType_t,
1237        solver_lowest_precision: cusolverPrecType_t,
1238    ) -> cusolverStatus_t;
1239}
1240unsafe extern "C" {
1241    /// This function sets the tolerance for the refinement solver. By default it is such that all the RHS satisfy:
1242    ///
1243    /// `RNRM &lt; SQRT(N)`XNRM`ANRM`EPS`BWDMAX` where
1244    ///
1245    /// * RNRM is the infinity-norm of the residual
1246    /// * XNRM is the infinity-norm of the solution
1247    /// * ANRM is the infinity-operator-norm of the matrix A
1248    /// * EPS is the machine epsilon for the Inputs/Outputs datatype that matches LAPACK &lt;X>LAMCH(‘Epsilon’)
1249    /// * BWDMAX, the value BWDMAX is fixed to 1.0
1250    ///
1251    /// 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.
1252    ///
1253    /// # Parameters
1254    ///
1255    /// - `params`: The `cusolverDnIRSParams_t Params` structure.
1256    /// - `val`: Double precision real value to which the refinement tolerance will be set.
1257    ///
1258    /// # Return value
1259    ///
1260    /// - [`cusolverStatus_t::CUSOLVER_STATUS_IRS_PARAMS_NOT_INITIALIZED`]: The `Params` structure was not created.
1261    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The operation completed successfully.
1262    pub fn cusolverDnIRSParamsSetTol(
1263        params: cusolverDnIRSParams_t,
1264        val: f64,
1265    ) -> cusolverStatus_t;
1266}
1267unsafe extern "C" {
1268    /// 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 sets 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.
1269    ///
1270    /// # Parameters
1271    ///
1272    /// - `params`: The `cusolverDnIRSParams_t Params` structure.
1273    /// - `val`: Double precision real value to which the tolerance of the inner refinement solver will be set.
1274    ///
1275    /// # Return value
1276    ///
1277    /// - [`cusolverStatus_t::CUSOLVER_STATUS_IRS_PARAMS_NOT_INITIALIZED`]: The `Params` structure was not created.
1278    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The operation completed successfully.
1279    pub fn cusolverDnIRSParamsSetTolInner(
1280        params: cusolverDnIRSParams_t,
1281        val: f64,
1282    ) -> cusolverStatus_t;
1283}
1284unsafe extern "C" {
1285    /// 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.
1286    ///
1287    /// # Parameters
1288    ///
1289    /// - `params`: The `cusolverDnIRSParams_t Params` structure.
1290    ///
1291    /// # Return value
1292    ///
1293    /// - [`cusolverStatus_t::CUSOLVER_STATUS_IRS_PARAMS_NOT_INITIALIZED`]: The `Params` structure was not created.
1294    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The operation completed successfully.
1295    pub fn cusolverDnIRSParamsSetMaxIters(
1296        params: cusolverDnIRSParams_t,
1297        maxiters: cusolver_int_t,
1298    ) -> cusolverStatus_t;
1299}
1300unsafe extern "C" {
1301    /// 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)`.
1302    ///
1303    /// # Parameters
1304    ///
1305    /// - `params`: The `cusolverDnIRSParams_t Params` structure.
1306    /// - `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`.
1307    ///
1308    /// # Return value
1309    ///
1310    /// - [`cusolverStatus_t::CUSOLVER_STATUS_IRS_PARAMS_INVALID`]: If the value was larger than `MaxIters`.
1311    /// - [`cusolverStatus_t::CUSOLVER_STATUS_IRS_PARAMS_NOT_INITIALIZED`]: The `Params` structure was not created.
1312    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The operation completed successfully.
1313    pub fn cusolverDnIRSParamsSetMaxItersInner(
1314        params: cusolverDnIRSParams_t,
1315        maxiters_inner: cusolver_int_t,
1316    ) -> cusolverStatus_t;
1317}
1318unsafe extern "C" {
1319    /// 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.
1320    ///
1321    /// # Parameters
1322    ///
1323    /// - `params`: The `cusolverDnIRSParams_t Params` structure.
1324    /// - `maxiters`: The maximal number of iterations that is currently set.
1325    ///
1326    /// # Return value
1327    ///
1328    /// - [`cusolverStatus_t::CUSOLVER_STATUS_IRS_PARAMS_NOT_INITIALIZED`]: The `Params` structure was not created.
1329    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The operation completed successfully.
1330    pub fn cusolverDnIRSParamsGetMaxIters(
1331        params: cusolverDnIRSParams_t,
1332        maxiters: *mut cusolver_int_t,
1333    ) -> cusolverStatus_t;
1334}
1335unsafe extern "C" {
1336    /// 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` &lt; 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.
1337    ///
1338    /// # Parameters
1339    ///
1340    /// - `params`: The `cusolverDnIRSParams_t Params` structure.
1341    ///
1342    /// # Return value
1343    ///
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 cusolverDnIRSParamsEnableFallback(
1347        params: cusolverDnIRSParams_t,
1348    ) -> cusolverStatus_t;
1349}
1350unsafe extern "C" {
1351    /// 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` &lt; 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`].
1352    ///
1353    /// # Parameters
1354    ///
1355    /// - `params`: The `cusolverDnIRSParams_t Params` structure.
1356    ///
1357    /// # Return value
1358    ///
1359    /// - [`cusolverStatus_t::CUSOLVER_STATUS_IRS_PARAMS_NOT_INITIALIZED`]: The `Params` structure was not created.
1360    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The operation completed successfully.
1361    pub fn cusolverDnIRSParamsDisableFallback(
1362        params: cusolverDnIRSParams_t,
1363    ) -> cusolverStatus_t;
1364}
1365unsafe extern "C" {
1366    /// 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.
1367    ///
1368    /// # Return value
1369    ///
1370    /// - [`cusolverStatus_t::CUSOLVER_STATUS_IRS_INFOS_NOT_INITIALIZED`]: The `Infos` structure was not created.
1371    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The resources were released successfully.
1372    pub fn cusolverDnIRSInfosDestroy(infos: cusolverDnIRSInfos_t) -> cusolverStatus_t;
1373}
1374unsafe extern "C" {
1375    /// 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.
1376    ///
1377    /// # Return value
1378    ///
1379    /// - [`cusolverStatus_t::CUSOLVER_STATUS_ALLOC_FAILED`]: The resources could not be allocated.
1380    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The structure was initialized successfully.
1381    pub fn cusolverDnIRSInfosCreate(
1382        infos_ptr: *mut cusolverDnIRSInfos_t,
1383    ) -> cusolverStatus_t;
1384}
1385unsafe extern "C" {
1386    /// 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()`.
1387    ///
1388    /// # Parameters
1389    ///
1390    /// - `infos`: The `cusolverDnIRSInfos_t Infos` structure.
1391    /// - `niters`: The total number of iterations performed by the IRS solver.
1392    ///
1393    /// # Return value
1394    ///
1395    /// - [`cusolverStatus_t::CUSOLVER_STATUS_IRS_INFOS_NOT_INITIALIZED`]: The `Infos` structure was not created.
1396    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The operation completed successfully.
1397    pub fn cusolverDnIRSInfosGetNiters(
1398        infos: cusolverDnIRSInfos_t,
1399        niters: *mut cusolver_int_t,
1400    ) -> cusolverStatus_t;
1401}
1402unsafe extern "C" {
1403    /// 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.
1404    ///
1405    /// # Parameters
1406    ///
1407    /// - `infos`: The `cusolverDnIRSInfos_t Infos` structure.
1408    /// - `outer_niters`: The number of iterations of the outer refinement loop of the IRS solver.
1409    ///
1410    /// # Return value
1411    ///
1412    /// - [`cusolverStatus_t::CUSOLVER_STATUS_IRS_INFOS_NOT_INITIALIZED`]: The `Infos` structure was not created.
1413    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The operation completed successfully.
1414    pub fn cusolverDnIRSInfosGetOuterNiters(
1415        infos: cusolverDnIRSInfos_t,
1416        outer_niters: *mut cusolver_int_t,
1417    ) -> cusolverStatus_t;
1418}
1419unsafe extern "C" {
1420    /// 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.
1421    ///
1422    /// # Parameters
1423    ///
1424    /// - `infos`: The `cusolverDnIRSInfos_t Infos` structure.
1425    ///
1426    /// # Return value
1427    ///
1428    /// - [`cusolverStatus_t::CUSOLVER_STATUS_IRS_INFOS_NOT_INITIALIZED`]: The `Infos` structure was not created.
1429    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The operation completed successfully.
1430    pub fn cusolverDnIRSInfosRequestResidual(
1431        infos: cusolverDnIRSInfos_t,
1432    ) -> cusolverStatus_t;
1433}
1434unsafe extern "C" {
1435    /// 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`.
1436    ///
1437    /// 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.
1438    ///
1439    /// 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.
1440    ///
1441    /// If the refinement solver was [`cusolverIRSRefinement_t::CUSOLVER_IRS_REFINE_CLASSICAL_GMRES`] or [`cusolverIRSRefinement_t::CUSOLVER_IRS_REFINE_GMRES_GMRES`], then OuterNiters &lt;= 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.
1442    ///
1443    /// 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.
1444    ///
1445    /// 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.
1446    ///
1447    /// # Parameters
1448    ///
1449    /// - `infos`: The `cusolverDnIRSInfos_t Infos` structure.
1450    /// - `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.
1451    ///
1452    /// # Return value
1453    ///
1454    /// - [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]: This function was called without calling [`cusolverDnIRSInfosRequestResidual`] in advance.
1455    /// - [`cusolverStatus_t::CUSOLVER_STATUS_IRS_INFOS_NOT_INITIALIZED`]: The `Infos` structure was not created.
1456    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The operation completed successfully.
1457    pub fn cusolverDnIRSInfosGetResidualHistory(
1458        infos: cusolverDnIRSInfos_t,
1459        residual_history: *mut *mut ::core::ffi::c_void,
1460    ) -> cusolverStatus_t;
1461}
1462unsafe extern "C" {
1463    /// 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.
1464    ///
1465    /// # Parameters
1466    ///
1467    /// - `infos`: The `cusolverDnIRSInfos_t Infos` structure.
1468    /// - `maxiters`: The maximal number of iterations that is currently set.
1469    ///
1470    /// # Return value
1471    ///
1472    /// - [`cusolverStatus_t::CUSOLVER_STATUS_IRS_INFOS_NOT_INITIALIZED`]: The `Infos` structure was not created.
1473    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The operation completed successfully.
1474    pub fn cusolverDnIRSInfosGetMaxIters(
1475        infos: cusolverDnIRSInfos_t,
1476        maxiters: *mut cusolver_int_t,
1477    ) -> cusolverStatus_t;
1478}
1479unsafe extern "C" {
1480    pub fn cusolverDnZZgesv(
1481        handle: cusolverDnHandle_t,
1482        n: cusolver_int_t,
1483        nrhs: cusolver_int_t,
1484        dA: *mut cuDoubleComplex,
1485        ldda: cusolver_int_t,
1486        dipiv: *mut cusolver_int_t,
1487        dB: *mut cuDoubleComplex,
1488        lddb: cusolver_int_t,
1489        dX: *mut cuDoubleComplex,
1490        lddx: cusolver_int_t,
1491        dWorkspace: *mut ::core::ffi::c_void,
1492        lwork_bytes: size_t,
1493        iter: *mut cusolver_int_t,
1494        d_info: *mut cusolver_int_t,
1495    ) -> cusolverStatus_t;
1496}
1497unsafe extern "C" {
1498    pub fn cusolverDnZCgesv(
1499        handle: cusolverDnHandle_t,
1500        n: cusolver_int_t,
1501        nrhs: cusolver_int_t,
1502        dA: *mut cuDoubleComplex,
1503        ldda: cusolver_int_t,
1504        dipiv: *mut cusolver_int_t,
1505        dB: *mut cuDoubleComplex,
1506        lddb: cusolver_int_t,
1507        dX: *mut cuDoubleComplex,
1508        lddx: cusolver_int_t,
1509        dWorkspace: *mut ::core::ffi::c_void,
1510        lwork_bytes: size_t,
1511        iter: *mut cusolver_int_t,
1512        d_info: *mut cusolver_int_t,
1513    ) -> cusolverStatus_t;
1514}
1515unsafe extern "C" {
1516    pub fn cusolverDnZKgesv(
1517        handle: cusolverDnHandle_t,
1518        n: cusolver_int_t,
1519        nrhs: cusolver_int_t,
1520        dA: *mut cuDoubleComplex,
1521        ldda: cusolver_int_t,
1522        dipiv: *mut cusolver_int_t,
1523        dB: *mut cuDoubleComplex,
1524        lddb: cusolver_int_t,
1525        dX: *mut cuDoubleComplex,
1526        lddx: cusolver_int_t,
1527        dWorkspace: *mut ::core::ffi::c_void,
1528        lwork_bytes: size_t,
1529        iter: *mut cusolver_int_t,
1530        d_info: *mut cusolver_int_t,
1531    ) -> cusolverStatus_t;
1532}
1533unsafe extern "C" {
1534    pub fn cusolverDnZEgesv(
1535        handle: cusolverDnHandle_t,
1536        n: cusolver_int_t,
1537        nrhs: cusolver_int_t,
1538        dA: *mut cuDoubleComplex,
1539        ldda: cusolver_int_t,
1540        dipiv: *mut cusolver_int_t,
1541        dB: *mut cuDoubleComplex,
1542        lddb: cusolver_int_t,
1543        dX: *mut cuDoubleComplex,
1544        lddx: cusolver_int_t,
1545        dWorkspace: *mut ::core::ffi::c_void,
1546        lwork_bytes: size_t,
1547        iter: *mut cusolver_int_t,
1548        d_info: *mut cusolver_int_t,
1549    ) -> cusolverStatus_t;
1550}
1551unsafe extern "C" {
1552    pub fn cusolverDnZYgesv(
1553        handle: cusolverDnHandle_t,
1554        n: cusolver_int_t,
1555        nrhs: cusolver_int_t,
1556        dA: *mut cuDoubleComplex,
1557        ldda: cusolver_int_t,
1558        dipiv: *mut cusolver_int_t,
1559        dB: *mut cuDoubleComplex,
1560        lddb: cusolver_int_t,
1561        dX: *mut cuDoubleComplex,
1562        lddx: cusolver_int_t,
1563        dWorkspace: *mut ::core::ffi::c_void,
1564        lwork_bytes: size_t,
1565        iter: *mut cusolver_int_t,
1566        d_info: *mut cusolver_int_t,
1567    ) -> cusolverStatus_t;
1568}
1569unsafe extern "C" {
1570    pub fn cusolverDnCCgesv(
1571        handle: cusolverDnHandle_t,
1572        n: cusolver_int_t,
1573        nrhs: cusolver_int_t,
1574        dA: *mut cuComplex,
1575        ldda: cusolver_int_t,
1576        dipiv: *mut cusolver_int_t,
1577        dB: *mut cuComplex,
1578        lddb: cusolver_int_t,
1579        dX: *mut cuComplex,
1580        lddx: cusolver_int_t,
1581        dWorkspace: *mut ::core::ffi::c_void,
1582        lwork_bytes: size_t,
1583        iter: *mut cusolver_int_t,
1584        d_info: *mut cusolver_int_t,
1585    ) -> cusolverStatus_t;
1586}
1587unsafe extern "C" {
1588    pub fn cusolverDnCEgesv(
1589        handle: cusolverDnHandle_t,
1590        n: cusolver_int_t,
1591        nrhs: cusolver_int_t,
1592        dA: *mut cuComplex,
1593        ldda: cusolver_int_t,
1594        dipiv: *mut cusolver_int_t,
1595        dB: *mut cuComplex,
1596        lddb: cusolver_int_t,
1597        dX: *mut cuComplex,
1598        lddx: cusolver_int_t,
1599        dWorkspace: *mut ::core::ffi::c_void,
1600        lwork_bytes: size_t,
1601        iter: *mut cusolver_int_t,
1602        d_info: *mut cusolver_int_t,
1603    ) -> cusolverStatus_t;
1604}
1605unsafe extern "C" {
1606    pub fn cusolverDnCKgesv(
1607        handle: cusolverDnHandle_t,
1608        n: cusolver_int_t,
1609        nrhs: cusolver_int_t,
1610        dA: *mut cuComplex,
1611        ldda: cusolver_int_t,
1612        dipiv: *mut cusolver_int_t,
1613        dB: *mut cuComplex,
1614        lddb: cusolver_int_t,
1615        dX: *mut cuComplex,
1616        lddx: cusolver_int_t,
1617        dWorkspace: *mut ::core::ffi::c_void,
1618        lwork_bytes: size_t,
1619        iter: *mut cusolver_int_t,
1620        d_info: *mut cusolver_int_t,
1621    ) -> cusolverStatus_t;
1622}
1623unsafe extern "C" {
1624    pub fn cusolverDnCYgesv(
1625        handle: cusolverDnHandle_t,
1626        n: cusolver_int_t,
1627        nrhs: cusolver_int_t,
1628        dA: *mut cuComplex,
1629        ldda: cusolver_int_t,
1630        dipiv: *mut cusolver_int_t,
1631        dB: *mut cuComplex,
1632        lddb: cusolver_int_t,
1633        dX: *mut cuComplex,
1634        lddx: cusolver_int_t,
1635        dWorkspace: *mut ::core::ffi::c_void,
1636        lwork_bytes: size_t,
1637        iter: *mut cusolver_int_t,
1638        d_info: *mut cusolver_int_t,
1639    ) -> cusolverStatus_t;
1640}
1641unsafe extern "C" {
1642    pub fn cusolverDnDDgesv(
1643        handle: cusolverDnHandle_t,
1644        n: cusolver_int_t,
1645        nrhs: cusolver_int_t,
1646        dA: *mut f64,
1647        ldda: cusolver_int_t,
1648        dipiv: *mut cusolver_int_t,
1649        dB: *mut f64,
1650        lddb: cusolver_int_t,
1651        dX: *mut f64,
1652        lddx: cusolver_int_t,
1653        dWorkspace: *mut ::core::ffi::c_void,
1654        lwork_bytes: size_t,
1655        iter: *mut cusolver_int_t,
1656        d_info: *mut cusolver_int_t,
1657    ) -> cusolverStatus_t;
1658}
1659unsafe extern "C" {
1660    pub fn cusolverDnDSgesv(
1661        handle: cusolverDnHandle_t,
1662        n: cusolver_int_t,
1663        nrhs: cusolver_int_t,
1664        dA: *mut f64,
1665        ldda: cusolver_int_t,
1666        dipiv: *mut cusolver_int_t,
1667        dB: *mut f64,
1668        lddb: cusolver_int_t,
1669        dX: *mut f64,
1670        lddx: cusolver_int_t,
1671        dWorkspace: *mut ::core::ffi::c_void,
1672        lwork_bytes: size_t,
1673        iter: *mut cusolver_int_t,
1674        d_info: *mut cusolver_int_t,
1675    ) -> cusolverStatus_t;
1676}
1677unsafe extern "C" {
1678    pub fn cusolverDnDHgesv(
1679        handle: cusolverDnHandle_t,
1680        n: cusolver_int_t,
1681        nrhs: cusolver_int_t,
1682        dA: *mut f64,
1683        ldda: cusolver_int_t,
1684        dipiv: *mut cusolver_int_t,
1685        dB: *mut f64,
1686        lddb: cusolver_int_t,
1687        dX: *mut f64,
1688        lddx: cusolver_int_t,
1689        dWorkspace: *mut ::core::ffi::c_void,
1690        lwork_bytes: size_t,
1691        iter: *mut cusolver_int_t,
1692        d_info: *mut cusolver_int_t,
1693    ) -> cusolverStatus_t;
1694}
1695unsafe extern "C" {
1696    pub fn cusolverDnDBgesv(
1697        handle: cusolverDnHandle_t,
1698        n: cusolver_int_t,
1699        nrhs: cusolver_int_t,
1700        dA: *mut f64,
1701        ldda: cusolver_int_t,
1702        dipiv: *mut cusolver_int_t,
1703        dB: *mut f64,
1704        lddb: cusolver_int_t,
1705        dX: *mut f64,
1706        lddx: cusolver_int_t,
1707        dWorkspace: *mut ::core::ffi::c_void,
1708        lwork_bytes: size_t,
1709        iter: *mut cusolver_int_t,
1710        d_info: *mut cusolver_int_t,
1711    ) -> cusolverStatus_t;
1712}
1713unsafe extern "C" {
1714    pub fn cusolverDnDXgesv(
1715        handle: cusolverDnHandle_t,
1716        n: cusolver_int_t,
1717        nrhs: cusolver_int_t,
1718        dA: *mut f64,
1719        ldda: cusolver_int_t,
1720        dipiv: *mut cusolver_int_t,
1721        dB: *mut f64,
1722        lddb: cusolver_int_t,
1723        dX: *mut f64,
1724        lddx: cusolver_int_t,
1725        dWorkspace: *mut ::core::ffi::c_void,
1726        lwork_bytes: size_t,
1727        iter: *mut cusolver_int_t,
1728        d_info: *mut cusolver_int_t,
1729    ) -> cusolverStatus_t;
1730}
1731unsafe extern "C" {
1732    pub fn cusolverDnSSgesv(
1733        handle: cusolverDnHandle_t,
1734        n: cusolver_int_t,
1735        nrhs: cusolver_int_t,
1736        dA: *mut f32,
1737        ldda: cusolver_int_t,
1738        dipiv: *mut cusolver_int_t,
1739        dB: *mut f32,
1740        lddb: cusolver_int_t,
1741        dX: *mut f32,
1742        lddx: cusolver_int_t,
1743        dWorkspace: *mut ::core::ffi::c_void,
1744        lwork_bytes: size_t,
1745        iter: *mut cusolver_int_t,
1746        d_info: *mut cusolver_int_t,
1747    ) -> cusolverStatus_t;
1748}
1749unsafe extern "C" {
1750    pub fn cusolverDnSHgesv(
1751        handle: cusolverDnHandle_t,
1752        n: cusolver_int_t,
1753        nrhs: cusolver_int_t,
1754        dA: *mut f32,
1755        ldda: cusolver_int_t,
1756        dipiv: *mut cusolver_int_t,
1757        dB: *mut f32,
1758        lddb: cusolver_int_t,
1759        dX: *mut f32,
1760        lddx: cusolver_int_t,
1761        dWorkspace: *mut ::core::ffi::c_void,
1762        lwork_bytes: size_t,
1763        iter: *mut cusolver_int_t,
1764        d_info: *mut cusolver_int_t,
1765    ) -> cusolverStatus_t;
1766}
1767unsafe extern "C" {
1768    pub fn cusolverDnSBgesv(
1769        handle: cusolverDnHandle_t,
1770        n: cusolver_int_t,
1771        nrhs: cusolver_int_t,
1772        dA: *mut f32,
1773        ldda: cusolver_int_t,
1774        dipiv: *mut cusolver_int_t,
1775        dB: *mut f32,
1776        lddb: cusolver_int_t,
1777        dX: *mut f32,
1778        lddx: cusolver_int_t,
1779        dWorkspace: *mut ::core::ffi::c_void,
1780        lwork_bytes: size_t,
1781        iter: *mut cusolver_int_t,
1782        d_info: *mut cusolver_int_t,
1783    ) -> cusolverStatus_t;
1784}
1785unsafe extern "C" {
1786    pub fn cusolverDnSXgesv(
1787        handle: cusolverDnHandle_t,
1788        n: cusolver_int_t,
1789        nrhs: cusolver_int_t,
1790        dA: *mut f32,
1791        ldda: cusolver_int_t,
1792        dipiv: *mut cusolver_int_t,
1793        dB: *mut f32,
1794        lddb: cusolver_int_t,
1795        dX: *mut f32,
1796        lddx: cusolver_int_t,
1797        dWorkspace: *mut ::core::ffi::c_void,
1798        lwork_bytes: size_t,
1799        iter: *mut cusolver_int_t,
1800        d_info: *mut cusolver_int_t,
1801    ) -> cusolverStatus_t;
1802}
1803unsafe extern "C" {
1804    pub fn cusolverDnZZgesv_bufferSize(
1805        handle: cusolverDnHandle_t,
1806        n: cusolver_int_t,
1807        nrhs: cusolver_int_t,
1808        dA: *mut cuDoubleComplex,
1809        ldda: cusolver_int_t,
1810        dipiv: *mut cusolver_int_t,
1811        dB: *mut cuDoubleComplex,
1812        lddb: cusolver_int_t,
1813        dX: *mut cuDoubleComplex,
1814        lddx: cusolver_int_t,
1815        dWorkspace: *mut ::core::ffi::c_void,
1816        lwork_bytes: *mut size_t,
1817    ) -> cusolverStatus_t;
1818}
1819unsafe extern "C" {
1820    pub fn cusolverDnZCgesv_bufferSize(
1821        handle: cusolverDnHandle_t,
1822        n: cusolver_int_t,
1823        nrhs: cusolver_int_t,
1824        dA: *mut cuDoubleComplex,
1825        ldda: cusolver_int_t,
1826        dipiv: *mut cusolver_int_t,
1827        dB: *mut cuDoubleComplex,
1828        lddb: cusolver_int_t,
1829        dX: *mut cuDoubleComplex,
1830        lddx: cusolver_int_t,
1831        dWorkspace: *mut ::core::ffi::c_void,
1832        lwork_bytes: *mut size_t,
1833    ) -> cusolverStatus_t;
1834}
1835unsafe extern "C" {
1836    pub fn cusolverDnZKgesv_bufferSize(
1837        handle: cusolverDnHandle_t,
1838        n: cusolver_int_t,
1839        nrhs: cusolver_int_t,
1840        dA: *mut cuDoubleComplex,
1841        ldda: cusolver_int_t,
1842        dipiv: *mut cusolver_int_t,
1843        dB: *mut cuDoubleComplex,
1844        lddb: cusolver_int_t,
1845        dX: *mut cuDoubleComplex,
1846        lddx: cusolver_int_t,
1847        dWorkspace: *mut ::core::ffi::c_void,
1848        lwork_bytes: *mut size_t,
1849    ) -> cusolverStatus_t;
1850}
1851unsafe extern "C" {
1852    pub fn cusolverDnZEgesv_bufferSize(
1853        handle: cusolverDnHandle_t,
1854        n: cusolver_int_t,
1855        nrhs: cusolver_int_t,
1856        dA: *mut cuDoubleComplex,
1857        ldda: cusolver_int_t,
1858        dipiv: *mut cusolver_int_t,
1859        dB: *mut cuDoubleComplex,
1860        lddb: cusolver_int_t,
1861        dX: *mut cuDoubleComplex,
1862        lddx: cusolver_int_t,
1863        dWorkspace: *mut ::core::ffi::c_void,
1864        lwork_bytes: *mut size_t,
1865    ) -> cusolverStatus_t;
1866}
1867unsafe extern "C" {
1868    pub fn cusolverDnZYgesv_bufferSize(
1869        handle: cusolverDnHandle_t,
1870        n: cusolver_int_t,
1871        nrhs: cusolver_int_t,
1872        dA: *mut cuDoubleComplex,
1873        ldda: cusolver_int_t,
1874        dipiv: *mut cusolver_int_t,
1875        dB: *mut cuDoubleComplex,
1876        lddb: cusolver_int_t,
1877        dX: *mut cuDoubleComplex,
1878        lddx: cusolver_int_t,
1879        dWorkspace: *mut ::core::ffi::c_void,
1880        lwork_bytes: *mut size_t,
1881    ) -> cusolverStatus_t;
1882}
1883unsafe extern "C" {
1884    pub fn cusolverDnCCgesv_bufferSize(
1885        handle: cusolverDnHandle_t,
1886        n: cusolver_int_t,
1887        nrhs: cusolver_int_t,
1888        dA: *mut cuComplex,
1889        ldda: cusolver_int_t,
1890        dipiv: *mut cusolver_int_t,
1891        dB: *mut cuComplex,
1892        lddb: cusolver_int_t,
1893        dX: *mut cuComplex,
1894        lddx: cusolver_int_t,
1895        dWorkspace: *mut ::core::ffi::c_void,
1896        lwork_bytes: *mut size_t,
1897    ) -> cusolverStatus_t;
1898}
1899unsafe extern "C" {
1900    pub fn cusolverDnCKgesv_bufferSize(
1901        handle: cusolverDnHandle_t,
1902        n: cusolver_int_t,
1903        nrhs: cusolver_int_t,
1904        dA: *mut cuComplex,
1905        ldda: cusolver_int_t,
1906        dipiv: *mut cusolver_int_t,
1907        dB: *mut cuComplex,
1908        lddb: cusolver_int_t,
1909        dX: *mut cuComplex,
1910        lddx: cusolver_int_t,
1911        dWorkspace: *mut ::core::ffi::c_void,
1912        lwork_bytes: *mut size_t,
1913    ) -> cusolverStatus_t;
1914}
1915unsafe extern "C" {
1916    pub fn cusolverDnCEgesv_bufferSize(
1917        handle: cusolverDnHandle_t,
1918        n: cusolver_int_t,
1919        nrhs: cusolver_int_t,
1920        dA: *mut cuComplex,
1921        ldda: cusolver_int_t,
1922        dipiv: *mut cusolver_int_t,
1923        dB: *mut cuComplex,
1924        lddb: cusolver_int_t,
1925        dX: *mut cuComplex,
1926        lddx: cusolver_int_t,
1927        dWorkspace: *mut ::core::ffi::c_void,
1928        lwork_bytes: *mut size_t,
1929    ) -> cusolverStatus_t;
1930}
1931unsafe extern "C" {
1932    pub fn cusolverDnCYgesv_bufferSize(
1933        handle: cusolverDnHandle_t,
1934        n: cusolver_int_t,
1935        nrhs: cusolver_int_t,
1936        dA: *mut cuComplex,
1937        ldda: cusolver_int_t,
1938        dipiv: *mut cusolver_int_t,
1939        dB: *mut cuComplex,
1940        lddb: cusolver_int_t,
1941        dX: *mut cuComplex,
1942        lddx: cusolver_int_t,
1943        dWorkspace: *mut ::core::ffi::c_void,
1944        lwork_bytes: *mut size_t,
1945    ) -> cusolverStatus_t;
1946}
1947unsafe extern "C" {
1948    pub fn cusolverDnDDgesv_bufferSize(
1949        handle: cusolverDnHandle_t,
1950        n: cusolver_int_t,
1951        nrhs: cusolver_int_t,
1952        dA: *mut f64,
1953        ldda: cusolver_int_t,
1954        dipiv: *mut cusolver_int_t,
1955        dB: *mut f64,
1956        lddb: cusolver_int_t,
1957        dX: *mut f64,
1958        lddx: cusolver_int_t,
1959        dWorkspace: *mut ::core::ffi::c_void,
1960        lwork_bytes: *mut size_t,
1961    ) -> cusolverStatus_t;
1962}
1963unsafe extern "C" {
1964    pub fn cusolverDnDSgesv_bufferSize(
1965        handle: cusolverDnHandle_t,
1966        n: cusolver_int_t,
1967        nrhs: cusolver_int_t,
1968        dA: *mut f64,
1969        ldda: cusolver_int_t,
1970        dipiv: *mut cusolver_int_t,
1971        dB: *mut f64,
1972        lddb: cusolver_int_t,
1973        dX: *mut f64,
1974        lddx: cusolver_int_t,
1975        dWorkspace: *mut ::core::ffi::c_void,
1976        lwork_bytes: *mut size_t,
1977    ) -> cusolverStatus_t;
1978}
1979unsafe extern "C" {
1980    pub fn cusolverDnDHgesv_bufferSize(
1981        handle: cusolverDnHandle_t,
1982        n: cusolver_int_t,
1983        nrhs: cusolver_int_t,
1984        dA: *mut f64,
1985        ldda: cusolver_int_t,
1986        dipiv: *mut cusolver_int_t,
1987        dB: *mut f64,
1988        lddb: cusolver_int_t,
1989        dX: *mut f64,
1990        lddx: cusolver_int_t,
1991        dWorkspace: *mut ::core::ffi::c_void,
1992        lwork_bytes: *mut size_t,
1993    ) -> cusolverStatus_t;
1994}
1995unsafe extern "C" {
1996    pub fn cusolverDnDBgesv_bufferSize(
1997        handle: cusolverDnHandle_t,
1998        n: cusolver_int_t,
1999        nrhs: cusolver_int_t,
2000        dA: *mut f64,
2001        ldda: cusolver_int_t,
2002        dipiv: *mut cusolver_int_t,
2003        dB: *mut f64,
2004        lddb: cusolver_int_t,
2005        dX: *mut f64,
2006        lddx: cusolver_int_t,
2007        dWorkspace: *mut ::core::ffi::c_void,
2008        lwork_bytes: *mut size_t,
2009    ) -> cusolverStatus_t;
2010}
2011unsafe extern "C" {
2012    pub fn cusolverDnDXgesv_bufferSize(
2013        handle: cusolverDnHandle_t,
2014        n: cusolver_int_t,
2015        nrhs: cusolver_int_t,
2016        dA: *mut f64,
2017        ldda: cusolver_int_t,
2018        dipiv: *mut cusolver_int_t,
2019        dB: *mut f64,
2020        lddb: cusolver_int_t,
2021        dX: *mut f64,
2022        lddx: cusolver_int_t,
2023        dWorkspace: *mut ::core::ffi::c_void,
2024        lwork_bytes: *mut size_t,
2025    ) -> cusolverStatus_t;
2026}
2027unsafe extern "C" {
2028    pub fn cusolverDnSSgesv_bufferSize(
2029        handle: cusolverDnHandle_t,
2030        n: cusolver_int_t,
2031        nrhs: cusolver_int_t,
2032        dA: *mut f32,
2033        ldda: cusolver_int_t,
2034        dipiv: *mut cusolver_int_t,
2035        dB: *mut f32,
2036        lddb: cusolver_int_t,
2037        dX: *mut f32,
2038        lddx: cusolver_int_t,
2039        dWorkspace: *mut ::core::ffi::c_void,
2040        lwork_bytes: *mut size_t,
2041    ) -> cusolverStatus_t;
2042}
2043unsafe extern "C" {
2044    pub fn cusolverDnSHgesv_bufferSize(
2045        handle: cusolverDnHandle_t,
2046        n: cusolver_int_t,
2047        nrhs: cusolver_int_t,
2048        dA: *mut f32,
2049        ldda: cusolver_int_t,
2050        dipiv: *mut cusolver_int_t,
2051        dB: *mut f32,
2052        lddb: cusolver_int_t,
2053        dX: *mut f32,
2054        lddx: cusolver_int_t,
2055        dWorkspace: *mut ::core::ffi::c_void,
2056        lwork_bytes: *mut size_t,
2057    ) -> cusolverStatus_t;
2058}
2059unsafe extern "C" {
2060    pub fn cusolverDnSBgesv_bufferSize(
2061        handle: cusolverDnHandle_t,
2062        n: cusolver_int_t,
2063        nrhs: cusolver_int_t,
2064        dA: *mut f32,
2065        ldda: cusolver_int_t,
2066        dipiv: *mut cusolver_int_t,
2067        dB: *mut f32,
2068        lddb: cusolver_int_t,
2069        dX: *mut f32,
2070        lddx: cusolver_int_t,
2071        dWorkspace: *mut ::core::ffi::c_void,
2072        lwork_bytes: *mut size_t,
2073    ) -> cusolverStatus_t;
2074}
2075unsafe extern "C" {
2076    pub fn cusolverDnSXgesv_bufferSize(
2077        handle: cusolverDnHandle_t,
2078        n: cusolver_int_t,
2079        nrhs: cusolver_int_t,
2080        dA: *mut f32,
2081        ldda: cusolver_int_t,
2082        dipiv: *mut cusolver_int_t,
2083        dB: *mut f32,
2084        lddb: cusolver_int_t,
2085        dX: *mut f32,
2086        lddx: cusolver_int_t,
2087        dWorkspace: *mut ::core::ffi::c_void,
2088        lwork_bytes: *mut size_t,
2089    ) -> cusolverStatus_t;
2090}
2091unsafe extern "C" {
2092    pub fn cusolverDnZZgels(
2093        handle: cusolverDnHandle_t,
2094        m: cusolver_int_t,
2095        n: cusolver_int_t,
2096        nrhs: cusolver_int_t,
2097        dA: *mut cuDoubleComplex,
2098        ldda: cusolver_int_t,
2099        dB: *mut cuDoubleComplex,
2100        lddb: cusolver_int_t,
2101        dX: *mut cuDoubleComplex,
2102        lddx: cusolver_int_t,
2103        dWorkspace: *mut ::core::ffi::c_void,
2104        lwork_bytes: size_t,
2105        iter: *mut cusolver_int_t,
2106        d_info: *mut cusolver_int_t,
2107    ) -> cusolverStatus_t;
2108}
2109unsafe extern "C" {
2110    pub fn cusolverDnZCgels(
2111        handle: cusolverDnHandle_t,
2112        m: cusolver_int_t,
2113        n: cusolver_int_t,
2114        nrhs: cusolver_int_t,
2115        dA: *mut cuDoubleComplex,
2116        ldda: cusolver_int_t,
2117        dB: *mut cuDoubleComplex,
2118        lddb: cusolver_int_t,
2119        dX: *mut cuDoubleComplex,
2120        lddx: cusolver_int_t,
2121        dWorkspace: *mut ::core::ffi::c_void,
2122        lwork_bytes: size_t,
2123        iter: *mut cusolver_int_t,
2124        d_info: *mut cusolver_int_t,
2125    ) -> cusolverStatus_t;
2126}
2127unsafe extern "C" {
2128    pub fn cusolverDnZKgels(
2129        handle: cusolverDnHandle_t,
2130        m: cusolver_int_t,
2131        n: cusolver_int_t,
2132        nrhs: cusolver_int_t,
2133        dA: *mut cuDoubleComplex,
2134        ldda: cusolver_int_t,
2135        dB: *mut cuDoubleComplex,
2136        lddb: cusolver_int_t,
2137        dX: *mut cuDoubleComplex,
2138        lddx: cusolver_int_t,
2139        dWorkspace: *mut ::core::ffi::c_void,
2140        lwork_bytes: size_t,
2141        iter: *mut cusolver_int_t,
2142        d_info: *mut cusolver_int_t,
2143    ) -> cusolverStatus_t;
2144}
2145unsafe extern "C" {
2146    pub fn cusolverDnZEgels(
2147        handle: cusolverDnHandle_t,
2148        m: cusolver_int_t,
2149        n: cusolver_int_t,
2150        nrhs: cusolver_int_t,
2151        dA: *mut cuDoubleComplex,
2152        ldda: cusolver_int_t,
2153        dB: *mut cuDoubleComplex,
2154        lddb: cusolver_int_t,
2155        dX: *mut cuDoubleComplex,
2156        lddx: cusolver_int_t,
2157        dWorkspace: *mut ::core::ffi::c_void,
2158        lwork_bytes: size_t,
2159        iter: *mut cusolver_int_t,
2160        d_info: *mut cusolver_int_t,
2161    ) -> cusolverStatus_t;
2162}
2163unsafe extern "C" {
2164    pub fn cusolverDnZYgels(
2165        handle: cusolverDnHandle_t,
2166        m: cusolver_int_t,
2167        n: cusolver_int_t,
2168        nrhs: cusolver_int_t,
2169        dA: *mut cuDoubleComplex,
2170        ldda: cusolver_int_t,
2171        dB: *mut cuDoubleComplex,
2172        lddb: cusolver_int_t,
2173        dX: *mut cuDoubleComplex,
2174        lddx: cusolver_int_t,
2175        dWorkspace: *mut ::core::ffi::c_void,
2176        lwork_bytes: size_t,
2177        iter: *mut cusolver_int_t,
2178        d_info: *mut cusolver_int_t,
2179    ) -> cusolverStatus_t;
2180}
2181unsafe extern "C" {
2182    pub fn cusolverDnCCgels(
2183        handle: cusolverDnHandle_t,
2184        m: cusolver_int_t,
2185        n: cusolver_int_t,
2186        nrhs: cusolver_int_t,
2187        dA: *mut cuComplex,
2188        ldda: cusolver_int_t,
2189        dB: *mut cuComplex,
2190        lddb: cusolver_int_t,
2191        dX: *mut cuComplex,
2192        lddx: cusolver_int_t,
2193        dWorkspace: *mut ::core::ffi::c_void,
2194        lwork_bytes: size_t,
2195        iter: *mut cusolver_int_t,
2196        d_info: *mut cusolver_int_t,
2197    ) -> cusolverStatus_t;
2198}
2199unsafe extern "C" {
2200    pub fn cusolverDnCKgels(
2201        handle: cusolverDnHandle_t,
2202        m: cusolver_int_t,
2203        n: cusolver_int_t,
2204        nrhs: cusolver_int_t,
2205        dA: *mut cuComplex,
2206        ldda: cusolver_int_t,
2207        dB: *mut cuComplex,
2208        lddb: cusolver_int_t,
2209        dX: *mut cuComplex,
2210        lddx: cusolver_int_t,
2211        dWorkspace: *mut ::core::ffi::c_void,
2212        lwork_bytes: size_t,
2213        iter: *mut cusolver_int_t,
2214        d_info: *mut cusolver_int_t,
2215    ) -> cusolverStatus_t;
2216}
2217unsafe extern "C" {
2218    pub fn cusolverDnCEgels(
2219        handle: cusolverDnHandle_t,
2220        m: cusolver_int_t,
2221        n: cusolver_int_t,
2222        nrhs: cusolver_int_t,
2223        dA: *mut cuComplex,
2224        ldda: cusolver_int_t,
2225        dB: *mut cuComplex,
2226        lddb: cusolver_int_t,
2227        dX: *mut cuComplex,
2228        lddx: cusolver_int_t,
2229        dWorkspace: *mut ::core::ffi::c_void,
2230        lwork_bytes: size_t,
2231        iter: *mut cusolver_int_t,
2232        d_info: *mut cusolver_int_t,
2233    ) -> cusolverStatus_t;
2234}
2235unsafe extern "C" {
2236    pub fn cusolverDnCYgels(
2237        handle: cusolverDnHandle_t,
2238        m: cusolver_int_t,
2239        n: cusolver_int_t,
2240        nrhs: cusolver_int_t,
2241        dA: *mut cuComplex,
2242        ldda: cusolver_int_t,
2243        dB: *mut cuComplex,
2244        lddb: cusolver_int_t,
2245        dX: *mut cuComplex,
2246        lddx: cusolver_int_t,
2247        dWorkspace: *mut ::core::ffi::c_void,
2248        lwork_bytes: size_t,
2249        iter: *mut cusolver_int_t,
2250        d_info: *mut cusolver_int_t,
2251    ) -> cusolverStatus_t;
2252}
2253unsafe extern "C" {
2254    pub fn cusolverDnDDgels(
2255        handle: cusolverDnHandle_t,
2256        m: cusolver_int_t,
2257        n: cusolver_int_t,
2258        nrhs: cusolver_int_t,
2259        dA: *mut f64,
2260        ldda: cusolver_int_t,
2261        dB: *mut f64,
2262        lddb: cusolver_int_t,
2263        dX: *mut f64,
2264        lddx: cusolver_int_t,
2265        dWorkspace: *mut ::core::ffi::c_void,
2266        lwork_bytes: size_t,
2267        iter: *mut cusolver_int_t,
2268        d_info: *mut cusolver_int_t,
2269    ) -> cusolverStatus_t;
2270}
2271unsafe extern "C" {
2272    pub fn cusolverDnDSgels(
2273        handle: cusolverDnHandle_t,
2274        m: cusolver_int_t,
2275        n: cusolver_int_t,
2276        nrhs: cusolver_int_t,
2277        dA: *mut f64,
2278        ldda: cusolver_int_t,
2279        dB: *mut f64,
2280        lddb: cusolver_int_t,
2281        dX: *mut f64,
2282        lddx: cusolver_int_t,
2283        dWorkspace: *mut ::core::ffi::c_void,
2284        lwork_bytes: size_t,
2285        iter: *mut cusolver_int_t,
2286        d_info: *mut cusolver_int_t,
2287    ) -> cusolverStatus_t;
2288}
2289unsafe extern "C" {
2290    pub fn cusolverDnDHgels(
2291        handle: cusolverDnHandle_t,
2292        m: cusolver_int_t,
2293        n: cusolver_int_t,
2294        nrhs: cusolver_int_t,
2295        dA: *mut f64,
2296        ldda: cusolver_int_t,
2297        dB: *mut f64,
2298        lddb: cusolver_int_t,
2299        dX: *mut f64,
2300        lddx: cusolver_int_t,
2301        dWorkspace: *mut ::core::ffi::c_void,
2302        lwork_bytes: size_t,
2303        iter: *mut cusolver_int_t,
2304        d_info: *mut cusolver_int_t,
2305    ) -> cusolverStatus_t;
2306}
2307unsafe extern "C" {
2308    pub fn cusolverDnDBgels(
2309        handle: cusolverDnHandle_t,
2310        m: cusolver_int_t,
2311        n: cusolver_int_t,
2312        nrhs: cusolver_int_t,
2313        dA: *mut f64,
2314        ldda: cusolver_int_t,
2315        dB: *mut f64,
2316        lddb: cusolver_int_t,
2317        dX: *mut f64,
2318        lddx: cusolver_int_t,
2319        dWorkspace: *mut ::core::ffi::c_void,
2320        lwork_bytes: size_t,
2321        iter: *mut cusolver_int_t,
2322        d_info: *mut cusolver_int_t,
2323    ) -> cusolverStatus_t;
2324}
2325unsafe extern "C" {
2326    pub fn cusolverDnDXgels(
2327        handle: cusolverDnHandle_t,
2328        m: cusolver_int_t,
2329        n: cusolver_int_t,
2330        nrhs: cusolver_int_t,
2331        dA: *mut f64,
2332        ldda: cusolver_int_t,
2333        dB: *mut f64,
2334        lddb: cusolver_int_t,
2335        dX: *mut f64,
2336        lddx: cusolver_int_t,
2337        dWorkspace: *mut ::core::ffi::c_void,
2338        lwork_bytes: size_t,
2339        iter: *mut cusolver_int_t,
2340        d_info: *mut cusolver_int_t,
2341    ) -> cusolverStatus_t;
2342}
2343unsafe extern "C" {
2344    pub fn cusolverDnSSgels(
2345        handle: cusolverDnHandle_t,
2346        m: cusolver_int_t,
2347        n: cusolver_int_t,
2348        nrhs: cusolver_int_t,
2349        dA: *mut f32,
2350        ldda: cusolver_int_t,
2351        dB: *mut f32,
2352        lddb: cusolver_int_t,
2353        dX: *mut f32,
2354        lddx: cusolver_int_t,
2355        dWorkspace: *mut ::core::ffi::c_void,
2356        lwork_bytes: size_t,
2357        iter: *mut cusolver_int_t,
2358        d_info: *mut cusolver_int_t,
2359    ) -> cusolverStatus_t;
2360}
2361unsafe extern "C" {
2362    pub fn cusolverDnSHgels(
2363        handle: cusolverDnHandle_t,
2364        m: cusolver_int_t,
2365        n: cusolver_int_t,
2366        nrhs: cusolver_int_t,
2367        dA: *mut f32,
2368        ldda: cusolver_int_t,
2369        dB: *mut f32,
2370        lddb: cusolver_int_t,
2371        dX: *mut f32,
2372        lddx: cusolver_int_t,
2373        dWorkspace: *mut ::core::ffi::c_void,
2374        lwork_bytes: size_t,
2375        iter: *mut cusolver_int_t,
2376        d_info: *mut cusolver_int_t,
2377    ) -> cusolverStatus_t;
2378}
2379unsafe extern "C" {
2380    pub fn cusolverDnSBgels(
2381        handle: cusolverDnHandle_t,
2382        m: cusolver_int_t,
2383        n: cusolver_int_t,
2384        nrhs: cusolver_int_t,
2385        dA: *mut f32,
2386        ldda: cusolver_int_t,
2387        dB: *mut f32,
2388        lddb: cusolver_int_t,
2389        dX: *mut f32,
2390        lddx: cusolver_int_t,
2391        dWorkspace: *mut ::core::ffi::c_void,
2392        lwork_bytes: size_t,
2393        iter: *mut cusolver_int_t,
2394        d_info: *mut cusolver_int_t,
2395    ) -> cusolverStatus_t;
2396}
2397unsafe extern "C" {
2398    pub fn cusolverDnSXgels(
2399        handle: cusolverDnHandle_t,
2400        m: cusolver_int_t,
2401        n: cusolver_int_t,
2402        nrhs: cusolver_int_t,
2403        dA: *mut f32,
2404        ldda: cusolver_int_t,
2405        dB: *mut f32,
2406        lddb: cusolver_int_t,
2407        dX: *mut f32,
2408        lddx: cusolver_int_t,
2409        dWorkspace: *mut ::core::ffi::c_void,
2410        lwork_bytes: size_t,
2411        iter: *mut cusolver_int_t,
2412        d_info: *mut cusolver_int_t,
2413    ) -> cusolverStatus_t;
2414}
2415unsafe extern "C" {
2416    pub fn cusolverDnZZgels_bufferSize(
2417        handle: cusolverDnHandle_t,
2418        m: cusolver_int_t,
2419        n: cusolver_int_t,
2420        nrhs: cusolver_int_t,
2421        dA: *mut cuDoubleComplex,
2422        ldda: cusolver_int_t,
2423        dB: *mut cuDoubleComplex,
2424        lddb: cusolver_int_t,
2425        dX: *mut cuDoubleComplex,
2426        lddx: cusolver_int_t,
2427        dWorkspace: *mut ::core::ffi::c_void,
2428        lwork_bytes: *mut size_t,
2429    ) -> cusolverStatus_t;
2430}
2431unsafe extern "C" {
2432    pub fn cusolverDnZCgels_bufferSize(
2433        handle: cusolverDnHandle_t,
2434        m: cusolver_int_t,
2435        n: cusolver_int_t,
2436        nrhs: cusolver_int_t,
2437        dA: *mut cuDoubleComplex,
2438        ldda: cusolver_int_t,
2439        dB: *mut cuDoubleComplex,
2440        lddb: cusolver_int_t,
2441        dX: *mut cuDoubleComplex,
2442        lddx: cusolver_int_t,
2443        dWorkspace: *mut ::core::ffi::c_void,
2444        lwork_bytes: *mut size_t,
2445    ) -> cusolverStatus_t;
2446}
2447unsafe extern "C" {
2448    pub fn cusolverDnZKgels_bufferSize(
2449        handle: cusolverDnHandle_t,
2450        m: cusolver_int_t,
2451        n: cusolver_int_t,
2452        nrhs: cusolver_int_t,
2453        dA: *mut cuDoubleComplex,
2454        ldda: cusolver_int_t,
2455        dB: *mut cuDoubleComplex,
2456        lddb: cusolver_int_t,
2457        dX: *mut cuDoubleComplex,
2458        lddx: cusolver_int_t,
2459        dWorkspace: *mut ::core::ffi::c_void,
2460        lwork_bytes: *mut size_t,
2461    ) -> cusolverStatus_t;
2462}
2463unsafe extern "C" {
2464    pub fn cusolverDnZEgels_bufferSize(
2465        handle: cusolverDnHandle_t,
2466        m: cusolver_int_t,
2467        n: cusolver_int_t,
2468        nrhs: cusolver_int_t,
2469        dA: *mut cuDoubleComplex,
2470        ldda: cusolver_int_t,
2471        dB: *mut cuDoubleComplex,
2472        lddb: cusolver_int_t,
2473        dX: *mut cuDoubleComplex,
2474        lddx: cusolver_int_t,
2475        dWorkspace: *mut ::core::ffi::c_void,
2476        lwork_bytes: *mut size_t,
2477    ) -> cusolverStatus_t;
2478}
2479unsafe extern "C" {
2480    pub fn cusolverDnZYgels_bufferSize(
2481        handle: cusolverDnHandle_t,
2482        m: cusolver_int_t,
2483        n: cusolver_int_t,
2484        nrhs: cusolver_int_t,
2485        dA: *mut cuDoubleComplex,
2486        ldda: cusolver_int_t,
2487        dB: *mut cuDoubleComplex,
2488        lddb: cusolver_int_t,
2489        dX: *mut cuDoubleComplex,
2490        lddx: cusolver_int_t,
2491        dWorkspace: *mut ::core::ffi::c_void,
2492        lwork_bytes: *mut size_t,
2493    ) -> cusolverStatus_t;
2494}
2495unsafe extern "C" {
2496    pub fn cusolverDnCCgels_bufferSize(
2497        handle: cusolverDnHandle_t,
2498        m: cusolver_int_t,
2499        n: cusolver_int_t,
2500        nrhs: cusolver_int_t,
2501        dA: *mut cuComplex,
2502        ldda: cusolver_int_t,
2503        dB: *mut cuComplex,
2504        lddb: cusolver_int_t,
2505        dX: *mut cuComplex,
2506        lddx: cusolver_int_t,
2507        dWorkspace: *mut ::core::ffi::c_void,
2508        lwork_bytes: *mut size_t,
2509    ) -> cusolverStatus_t;
2510}
2511unsafe extern "C" {
2512    pub fn cusolverDnCKgels_bufferSize(
2513        handle: cusolverDnHandle_t,
2514        m: cusolver_int_t,
2515        n: cusolver_int_t,
2516        nrhs: cusolver_int_t,
2517        dA: *mut cuComplex,
2518        ldda: cusolver_int_t,
2519        dB: *mut cuComplex,
2520        lddb: cusolver_int_t,
2521        dX: *mut cuComplex,
2522        lddx: cusolver_int_t,
2523        dWorkspace: *mut ::core::ffi::c_void,
2524        lwork_bytes: *mut size_t,
2525    ) -> cusolverStatus_t;
2526}
2527unsafe extern "C" {
2528    pub fn cusolverDnCEgels_bufferSize(
2529        handle: cusolverDnHandle_t,
2530        m: cusolver_int_t,
2531        n: cusolver_int_t,
2532        nrhs: cusolver_int_t,
2533        dA: *mut cuComplex,
2534        ldda: cusolver_int_t,
2535        dB: *mut cuComplex,
2536        lddb: cusolver_int_t,
2537        dX: *mut cuComplex,
2538        lddx: cusolver_int_t,
2539        dWorkspace: *mut ::core::ffi::c_void,
2540        lwork_bytes: *mut size_t,
2541    ) -> cusolverStatus_t;
2542}
2543unsafe extern "C" {
2544    pub fn cusolverDnCYgels_bufferSize(
2545        handle: cusolverDnHandle_t,
2546        m: cusolver_int_t,
2547        n: cusolver_int_t,
2548        nrhs: cusolver_int_t,
2549        dA: *mut cuComplex,
2550        ldda: cusolver_int_t,
2551        dB: *mut cuComplex,
2552        lddb: cusolver_int_t,
2553        dX: *mut cuComplex,
2554        lddx: cusolver_int_t,
2555        dWorkspace: *mut ::core::ffi::c_void,
2556        lwork_bytes: *mut size_t,
2557    ) -> cusolverStatus_t;
2558}
2559unsafe extern "C" {
2560    pub fn cusolverDnDDgels_bufferSize(
2561        handle: cusolverDnHandle_t,
2562        m: cusolver_int_t,
2563        n: cusolver_int_t,
2564        nrhs: cusolver_int_t,
2565        dA: *mut f64,
2566        ldda: cusolver_int_t,
2567        dB: *mut f64,
2568        lddb: cusolver_int_t,
2569        dX: *mut f64,
2570        lddx: cusolver_int_t,
2571        dWorkspace: *mut ::core::ffi::c_void,
2572        lwork_bytes: *mut size_t,
2573    ) -> cusolverStatus_t;
2574}
2575unsafe extern "C" {
2576    pub fn cusolverDnDSgels_bufferSize(
2577        handle: cusolverDnHandle_t,
2578        m: cusolver_int_t,
2579        n: cusolver_int_t,
2580        nrhs: cusolver_int_t,
2581        dA: *mut f64,
2582        ldda: cusolver_int_t,
2583        dB: *mut f64,
2584        lddb: cusolver_int_t,
2585        dX: *mut f64,
2586        lddx: cusolver_int_t,
2587        dWorkspace: *mut ::core::ffi::c_void,
2588        lwork_bytes: *mut size_t,
2589    ) -> cusolverStatus_t;
2590}
2591unsafe extern "C" {
2592    pub fn cusolverDnDHgels_bufferSize(
2593        handle: cusolverDnHandle_t,
2594        m: cusolver_int_t,
2595        n: cusolver_int_t,
2596        nrhs: cusolver_int_t,
2597        dA: *mut f64,
2598        ldda: cusolver_int_t,
2599        dB: *mut f64,
2600        lddb: cusolver_int_t,
2601        dX: *mut f64,
2602        lddx: cusolver_int_t,
2603        dWorkspace: *mut ::core::ffi::c_void,
2604        lwork_bytes: *mut size_t,
2605    ) -> cusolverStatus_t;
2606}
2607unsafe extern "C" {
2608    pub fn cusolverDnDBgels_bufferSize(
2609        handle: cusolverDnHandle_t,
2610        m: cusolver_int_t,
2611        n: cusolver_int_t,
2612        nrhs: cusolver_int_t,
2613        dA: *mut f64,
2614        ldda: cusolver_int_t,
2615        dB: *mut f64,
2616        lddb: cusolver_int_t,
2617        dX: *mut f64,
2618        lddx: cusolver_int_t,
2619        dWorkspace: *mut ::core::ffi::c_void,
2620        lwork_bytes: *mut size_t,
2621    ) -> cusolverStatus_t;
2622}
2623unsafe extern "C" {
2624    pub fn cusolverDnDXgels_bufferSize(
2625        handle: cusolverDnHandle_t,
2626        m: cusolver_int_t,
2627        n: cusolver_int_t,
2628        nrhs: cusolver_int_t,
2629        dA: *mut f64,
2630        ldda: cusolver_int_t,
2631        dB: *mut f64,
2632        lddb: cusolver_int_t,
2633        dX: *mut f64,
2634        lddx: cusolver_int_t,
2635        dWorkspace: *mut ::core::ffi::c_void,
2636        lwork_bytes: *mut size_t,
2637    ) -> cusolverStatus_t;
2638}
2639unsafe extern "C" {
2640    pub fn cusolverDnSSgels_bufferSize(
2641        handle: cusolverDnHandle_t,
2642        m: cusolver_int_t,
2643        n: cusolver_int_t,
2644        nrhs: cusolver_int_t,
2645        dA: *mut f32,
2646        ldda: cusolver_int_t,
2647        dB: *mut f32,
2648        lddb: cusolver_int_t,
2649        dX: *mut f32,
2650        lddx: cusolver_int_t,
2651        dWorkspace: *mut ::core::ffi::c_void,
2652        lwork_bytes: *mut size_t,
2653    ) -> cusolverStatus_t;
2654}
2655unsafe extern "C" {
2656    pub fn cusolverDnSHgels_bufferSize(
2657        handle: cusolverDnHandle_t,
2658        m: cusolver_int_t,
2659        n: cusolver_int_t,
2660        nrhs: cusolver_int_t,
2661        dA: *mut f32,
2662        ldda: cusolver_int_t,
2663        dB: *mut f32,
2664        lddb: cusolver_int_t,
2665        dX: *mut f32,
2666        lddx: cusolver_int_t,
2667        dWorkspace: *mut ::core::ffi::c_void,
2668        lwork_bytes: *mut size_t,
2669    ) -> cusolverStatus_t;
2670}
2671unsafe extern "C" {
2672    pub fn cusolverDnSBgels_bufferSize(
2673        handle: cusolverDnHandle_t,
2674        m: cusolver_int_t,
2675        n: cusolver_int_t,
2676        nrhs: cusolver_int_t,
2677        dA: *mut f32,
2678        ldda: cusolver_int_t,
2679        dB: *mut f32,
2680        lddb: cusolver_int_t,
2681        dX: *mut f32,
2682        lddx: cusolver_int_t,
2683        dWorkspace: *mut ::core::ffi::c_void,
2684        lwork_bytes: *mut size_t,
2685    ) -> cusolverStatus_t;
2686}
2687unsafe extern "C" {
2688    pub fn cusolverDnSXgels_bufferSize(
2689        handle: cusolverDnHandle_t,
2690        m: cusolver_int_t,
2691        n: cusolver_int_t,
2692        nrhs: cusolver_int_t,
2693        dA: *mut f32,
2694        ldda: cusolver_int_t,
2695        dB: *mut f32,
2696        lddb: cusolver_int_t,
2697        dX: *mut f32,
2698        lddx: cusolver_int_t,
2699        dWorkspace: *mut ::core::ffi::c_void,
2700        lwork_bytes: *mut size_t,
2701    ) -> cusolverStatus_t;
2702}
2703unsafe extern "C" {
2704    /// This function is designed to perform same functionality as `cusolverDn&lt;T1>&lt;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:
2705    ///
2706    /// * the main precision (Inputs/Outputs precision) of the solver
2707    /// * the lowest precision to be used internally by the solver
2708    /// * the refinement solver type
2709    /// * the maximum allowed number of iterations in the refinement phase
2710    /// * the tolerance of the refinement solver
2711    /// * the fallback to main precision
2712    /// * and more
2713    ///
2714    /// 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()`
2715    ///
2716    /// 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.
2717    ///
2718    /// 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.
2719    ///
2720    /// 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.
2721    ///
2722    /// **Supported Inputs/Outputs data type and lower precision for the IRS solver**
2723    ///
2724    /// | **Inputs/Outputs Data Type (e.g., main precision)** | **Supported values for the lowest precision** |
2725    /// | --- | --- |
2726    /// | [`cusolverPrecType_t::CUSOLVER_C_64F`] | `CUSOLVER_C_64F, CUSOLVER_C_32F, CUSOLVER_C_16F, CUSOLVER_C_16BF, CUSOLVER_C_TF32` |
2727    /// | [`cusolverPrecType_t::CUSOLVER_C_32F`] | `CUSOLVER_C_32F, CUSOLVER_C_16F, CUSOLVER_C_16BF, CUSOLVER_C_TF32` |
2728    /// | [`cusolverPrecType_t::CUSOLVER_R_64F`] | `CUSOLVER_R_64F, CUSOLVER_R_32F, CUSOLVER_R_16F, CUSOLVER_R_16BF, CUSOLVER_R_TF32` |
2729    /// | [`cusolverPrecType_t::CUSOLVER_R_32F`] | `CUSOLVER_R_32F, CUSOLVER_R_16F, CUSOLVER_R_16BF, CUSOLVER_R_TF32` |
2730    ///
2731    /// The [`cusolverDnIRSXgesv_bufferSize`] function returns the required workspace buffer size in bytes for the corresponding `cusolverDnXgesv()` call with the given `gesv_irs_params` configuration.
2732    ///
2733    /// * `n&lt;0`
2734    /// * `lda&lt;max(1,n)`
2735    /// * `ldb&lt;max(1,n)`
2736    /// * `ldx&lt;max(1,n)`.
2737    ///
2738    /// # Parameters
2739    ///
2740    /// - `handle`: Handle to the cusolverDn library context.
2741    /// - `gesv_irs_params`: Configuration parameters structure, can serve one or more calls to any IRS solver.
2742    /// - `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.
2743    /// - `n`: Number of rows and columns of square matrix `A`. Should be non-negative.
2744    /// - `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`].
2745    /// - `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.
2746    /// - `ldda`: Leading dimension of two-dimensional array used to store matrix `A`. `lda >= n`.
2747    /// - `dB`: Set of right hand sides `B` of size `n-by-nrhs`. Can’t be `NULL`.
2748    /// - `lddb`: Leading dimension of two-dimensional array used to store matrix of right hand sides `B`. `ldb >= n`.
2749    /// - `dX`: Set of solution vectors `X` of size `n-by-nrhs`. Can’t be `NULL`.
2750    /// - `lddx`: Leading dimension of two-dimensional array used to store matrix of solution vectors `X`. `ldx >= n`.
2751    /// - `dWorkspace`: Pointer to an allocated workspace in device memory of size lwork_bytes.
2752    /// - `lwork_bytes`: Size of the allocated device workspace. Should be at least what was returned by [`cusolverDnIRSXgesv_bufferSize`] function.
2753    /// - `niters`: If iter is   * &lt;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.
2754    ///
2755    /// # Return value
2756    ///
2757    /// - [`cusolverStatus_t::CUSOLVER_STATUS_ALLOC_FAILED`]: CPU memory allocation failed, most likely during the allocation of the residual array that store the residual norms.
2758    /// - [`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.
2759    /// - [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]: An internal error occurred, check the `dinfo` and the `niters` arguments for more details.
2760    /// - [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]: Invalid parameters were passed, for example:
2761    ///
2762    /// * `n&lt;0`
2763    /// * `lda&lt;max(1,n)`
2764    /// * `ldb&lt;max(1,n)`
2765    /// * `ldx&lt;max(1,n)`.
2766    /// - [`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.
2767    /// - [`cusolverStatus_t::CUSOLVER_STATUS_IRS_INFOS_NOT_INITIALIZED`]: The information structure `gesv_irs_infos` was not created.
2768    /// - [`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`].
2769    /// - [`cusolverStatus_t::CUSOLVER_STATUS_IRS_OUT_OF_RANGE`]: Numerical error related to niters &lt;0, see niters description for more details.
2770    /// - [`cusolverStatus_t::CUSOLVER_STATUS_IRS_PARAMS_INVALID`]: One of the configuration parameter in the `gesv_irs_params` structure is not valid.
2771    /// - [`cusolverStatus_t::CUSOLVER_STATUS_IRS_PARAMS_INVALID_MAXITER`]: The maxiter configuration parameter in the `gesv_irs_params` structure is not valid.
2772    /// - [`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.
2773    /// - [`cusolverStatus_t::CUSOLVER_STATUS_IRS_PARAMS_INVALID_REFINE`]: The refinement solver configuration parameter in the `gesv_irs_params` structure is not valid.
2774    /// - [`cusolverStatus_t::CUSOLVER_STATUS_IRS_PARAMS_NOT_INITIALIZED`]: The configuration parameter `gesv_irs_params` structure was not created.
2775    /// - [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]: The library was not initialized.
2776    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The operation completed successfully.
2777    pub fn cusolverDnIRSXgesv(
2778        handle: cusolverDnHandle_t,
2779        gesv_irs_params: cusolverDnIRSParams_t,
2780        gesv_irs_infos: cusolverDnIRSInfos_t,
2781        n: cusolver_int_t,
2782        nrhs: cusolver_int_t,
2783        dA: *mut ::core::ffi::c_void,
2784        ldda: cusolver_int_t,
2785        dB: *mut ::core::ffi::c_void,
2786        lddb: cusolver_int_t,
2787        dX: *mut ::core::ffi::c_void,
2788        lddx: cusolver_int_t,
2789        dWorkspace: *mut ::core::ffi::c_void,
2790        lwork_bytes: size_t,
2791        niters: *mut cusolver_int_t,
2792        d_info: *mut cusolver_int_t,
2793    ) -> cusolverStatus_t;
2794}
2795unsafe extern "C" {
2796    pub fn cusolverDnIRSXgesv_bufferSize(
2797        handle: cusolverDnHandle_t,
2798        params: cusolverDnIRSParams_t,
2799        n: cusolver_int_t,
2800        nrhs: cusolver_int_t,
2801        lwork_bytes: *mut size_t,
2802    ) -> cusolverStatus_t;
2803}
2804unsafe extern "C" {
2805    /// This function is designed to perform same functionality as `cusolverDn&lt;T1>&lt;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:
2806    ///
2807    /// * the main precision (Inputs/Outputs precision) of the solver,
2808    /// * the lowest precision to be used internally by the solver,
2809    /// * the refinement solver type
2810    /// * the maximum allowed number of iterations in the refinement phase
2811    /// * the tolerance of the refinement solver
2812    /// * the fallback to main precision
2813    /// * and others
2814    ///
2815    /// 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()`.
2816    ///
2817    /// 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.
2818    ///
2819    /// 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
2820    ///
2821    /// 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.
2822    ///
2823    /// **Supported Inputs/Outputs data type and lower precision for the IRS solver**
2824    ///
2825    /// | **Inputs/Outputs Data Type (e.g., main precision)** | **Supported values for the lowest precision** |
2826    /// | --- | --- |
2827    /// | [`cusolverPrecType_t::CUSOLVER_C_64F`] | `CUSOLVER_C_64F, CUSOLVER_C_32F, CUSOLVER_C_16F, CUSOLVER_C_16BF, CUSOLVER_C_TF32` |
2828    /// | [`cusolverPrecType_t::CUSOLVER_C_32F`] | `CUSOLVER_C_32F, CUSOLVER_C_16F, CUSOLVER_C_16BF, CUSOLVER_C_TF32` |
2829    /// | [`cusolverPrecType_t::CUSOLVER_R_64F`] | `CUSOLVER_R_64F, CUSOLVER_R_32F, CUSOLVER_R_16F, CUSOLVER_R_16BF, CUSOLVER_R_TF32` |
2830    /// | [`cusolverPrecType_t::CUSOLVER_R_32F`] | `CUSOLVER_R_32F, CUSOLVER_R_16F, CUSOLVER_R_16BF, CUSOLVER_R_TF32` |
2831    ///
2832    /// The [`cusolverDnIRSXgels_bufferSize`] function return the required workspace buffer size in bytes for the corresponding `cusolverDnXgels()` call with given `gels_irs_params` configuration.
2833    ///
2834    /// * `n&lt;0`
2835    /// * `ldda&lt;max(1,m)`
2836    /// * `lddb&lt;max(1,m)`
2837    /// * `lddx&lt;max(1,n)`.
2838    ///
2839    /// # Parameters
2840    ///
2841    /// - `handle`: Handle to the cusolverDn library context.
2842    /// - `gels_irs_params`: Configuration parameters structure, can serve one or more calls to any IRS solver.
2843    /// - `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.
2844    /// - `m`: Number of rows of the matrix `A`. Should be non-negative and n&lt;=m.
2845    /// - `n`: Number of columns of the matrix `A`. Should be non-negative and n&lt;=m.
2846    /// - `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`].
2847    /// - `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.
2848    /// - `ldda`: Leading dimension of two-dimensional array used to store matrix `A`. `ldda >= m`.
2849    /// - `dB`: Set of right hand sides `B` of size `m-by-nrhs`. Can’t be `NULL`.
2850    /// - `lddb`: Leading dimension of two-dimensional array used to store matrix of right hand sides `B`. `lddb >= max(1,m)`.
2851    /// - `dX`: Set of solution vectors `X` of size `n-by-nrhs`. Can’t be `NULL`.
2852    /// - `lddx`: Leading dimension of two-dimensional array used to store matrix of solution vectors `X`. `lddx >= max(1,n)`.
2853    /// - `dWorkspace`: Pointer to an allocated workspace in device memory of size lwork_bytes.
2854    /// - `lwork_bytes`: Size of the allocated device workspace. Should be at least what was returned by [`cusolverDnIRSXgels_bufferSize`] function.
2855    /// - `niters`: If `iter` is   * &lt;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.
2856    ///
2857    /// # Return value
2858    ///
2859    /// - [`cusolverStatus_t::CUSOLVER_STATUS_ALLOC_FAILED`]: CPU memory allocation failed, most likely during the allocation of the residual array that store the residual norms.
2860    /// - [`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.
2861    /// - [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]: An internal error occurred, check the `dinfo` and the `niters` arguments for more details.
2862    /// - [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]: Invalid parameters were passed, for example:
2863    ///
2864    /// * `n&lt;0`
2865    /// * `ldda&lt;max(1,m)`
2866    /// * `lddb&lt;max(1,m)`
2867    /// * `lddx&lt;max(1,n)`.
2868    /// - [`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.
2869    /// - [`cusolverStatus_t::CUSOLVER_STATUS_IRS_INFOS_NOT_INITIALIZED`]: The information structure `gels_irs_infos` was not created.
2870    /// - [`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`].
2871    /// - [`cusolverStatus_t::CUSOLVER_STATUS_IRS_OUT_OF_RANGE`]: Numerical error related to `niters` &lt;0; see `niters` description for more details.
2872    /// - [`cusolverStatus_t::CUSOLVER_STATUS_IRS_PARAMS_INVALID`]: One of the configuration parameter in the `gels_irs_params` structure is not valid.
2873    /// - [`cusolverStatus_t::CUSOLVER_STATUS_IRS_PARAMS_INVALID_MAXITER`]: The maxiter configuration parameter in the `gels_irs_params` structure is not valid.
2874    /// - [`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.
2875    /// - [`cusolverStatus_t::CUSOLVER_STATUS_IRS_PARAMS_INVALID_REFINE`]: The refinement solver configuration parameter in the `gels_irs_params` structure is not valid.
2876    /// - [`cusolverStatus_t::CUSOLVER_STATUS_IRS_PARAMS_NOT_INITIALIZED`]: The configuration parameter `gels_irs_params` structure was not created.
2877    /// - [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]: The library was not initialized.
2878    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The operation completed successfully.
2879    pub fn cusolverDnIRSXgels(
2880        handle: cusolverDnHandle_t,
2881        gels_irs_params: cusolverDnIRSParams_t,
2882        gels_irs_infos: cusolverDnIRSInfos_t,
2883        m: cusolver_int_t,
2884        n: cusolver_int_t,
2885        nrhs: cusolver_int_t,
2886        dA: *mut ::core::ffi::c_void,
2887        ldda: cusolver_int_t,
2888        dB: *mut ::core::ffi::c_void,
2889        lddb: cusolver_int_t,
2890        dX: *mut ::core::ffi::c_void,
2891        lddx: cusolver_int_t,
2892        dWorkspace: *mut ::core::ffi::c_void,
2893        lwork_bytes: size_t,
2894        niters: *mut cusolver_int_t,
2895        d_info: *mut cusolver_int_t,
2896    ) -> cusolverStatus_t;
2897}
2898unsafe extern "C" {
2899    pub fn cusolverDnIRSXgels_bufferSize(
2900        handle: cusolverDnHandle_t,
2901        params: cusolverDnIRSParams_t,
2902        m: cusolver_int_t,
2903        n: cusolver_int_t,
2904        nrhs: cusolver_int_t,
2905        lwork_bytes: *mut size_t,
2906    ) -> cusolverStatus_t;
2907}
2908unsafe extern "C" {
2909    pub fn cusolverDnSpotrf_bufferSize(
2910        handle: cusolverDnHandle_t,
2911        uplo: cublasFillMode_t,
2912        n: ::core::ffi::c_int,
2913        A: *mut f32,
2914        lda: ::core::ffi::c_int,
2915        Lwork: *mut ::core::ffi::c_int,
2916    ) -> cusolverStatus_t;
2917}
2918unsafe extern "C" {
2919    pub fn cusolverDnDpotrf_bufferSize(
2920        handle: cusolverDnHandle_t,
2921        uplo: cublasFillMode_t,
2922        n: ::core::ffi::c_int,
2923        A: *mut f64,
2924        lda: ::core::ffi::c_int,
2925        Lwork: *mut ::core::ffi::c_int,
2926    ) -> cusolverStatus_t;
2927}
2928unsafe extern "C" {
2929    pub fn cusolverDnCpotrf_bufferSize(
2930        handle: cusolverDnHandle_t,
2931        uplo: cublasFillMode_t,
2932        n: ::core::ffi::c_int,
2933        A: *mut cuComplex,
2934        lda: ::core::ffi::c_int,
2935        Lwork: *mut ::core::ffi::c_int,
2936    ) -> cusolverStatus_t;
2937}
2938unsafe extern "C" {
2939    pub fn cusolverDnZpotrf_bufferSize(
2940        handle: cusolverDnHandle_t,
2941        uplo: cublasFillMode_t,
2942        n: ::core::ffi::c_int,
2943        A: *mut cuDoubleComplex,
2944        lda: ::core::ffi::c_int,
2945        Lwork: *mut ::core::ffi::c_int,
2946    ) -> cusolverStatus_t;
2947}
2948unsafe extern "C" {
2949    /// These helper functions calculate the necessary size of work buffers.
2950    ///
2951    /// The S and D data types are real valued single and double precision, respectively.
2952    ///
2953    /// The C and Z data types are complex valued single and double precision, respectively.
2954    ///
2955    /// This function computes the Cholesky factorization of a Hermitian positive-definite matrix.
2956    ///
2957    /// `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.
2958    ///
2959    /// 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`.
2960    /// $$
2961    /// A = L\\*L^{H}
2962    /// $$
2963    ///
2964    /// 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`.
2965    /// $$
2966    /// A = U^{H}\\*U
2967    /// $$
2968    ///
2969    /// 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()`.
2970    ///
2971    /// 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.
2972    ///
2973    /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
2974    pub fn cusolverDnSpotrf(
2975        handle: cusolverDnHandle_t,
2976        uplo: cublasFillMode_t,
2977        n: ::core::ffi::c_int,
2978        A: *mut f32,
2979        lda: ::core::ffi::c_int,
2980        Workspace: *mut f32,
2981        Lwork: ::core::ffi::c_int,
2982        devInfo: *mut ::core::ffi::c_int,
2983    ) -> cusolverStatus_t;
2984}
2985unsafe extern "C" {
2986    /// These helper functions calculate the necessary size of work buffers.
2987    ///
2988    /// The S and D data types are real valued single and double precision, respectively.
2989    ///
2990    /// The C and Z data types are complex valued single and double precision, respectively.
2991    ///
2992    /// This function computes the Cholesky factorization of a Hermitian positive-definite matrix.
2993    ///
2994    /// `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.
2995    ///
2996    /// 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`.
2997    /// $$
2998    /// A = L\\*L^{H}
2999    /// $$
3000    ///
3001    /// 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`.
3002    /// $$
3003    /// A = U^{H}\\*U
3004    /// $$
3005    ///
3006    /// 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()`.
3007    ///
3008    /// 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.
3009    ///
3010    /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
3011    pub fn cusolverDnDpotrf(
3012        handle: cusolverDnHandle_t,
3013        uplo: cublasFillMode_t,
3014        n: ::core::ffi::c_int,
3015        A: *mut f64,
3016        lda: ::core::ffi::c_int,
3017        Workspace: *mut f64,
3018        Lwork: ::core::ffi::c_int,
3019        devInfo: *mut ::core::ffi::c_int,
3020    ) -> cusolverStatus_t;
3021}
3022unsafe extern "C" {
3023    /// These helper functions calculate the necessary size of work buffers.
3024    ///
3025    /// The S and D data types are real valued single and double precision, respectively.
3026    ///
3027    /// The C and Z data types are complex valued single and double precision, respectively.
3028    ///
3029    /// This function computes the Cholesky factorization of a Hermitian positive-definite matrix.
3030    ///
3031    /// `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.
3032    ///
3033    /// 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`.
3034    /// $$
3035    /// A = L\\*L^{H}
3036    /// $$
3037    ///
3038    /// 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`.
3039    /// $$
3040    /// A = U^{H}\\*U
3041    /// $$
3042    ///
3043    /// 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()`.
3044    ///
3045    /// 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.
3046    ///
3047    /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
3048    pub fn cusolverDnCpotrf(
3049        handle: cusolverDnHandle_t,
3050        uplo: cublasFillMode_t,
3051        n: ::core::ffi::c_int,
3052        A: *mut cuComplex,
3053        lda: ::core::ffi::c_int,
3054        Workspace: *mut cuComplex,
3055        Lwork: ::core::ffi::c_int,
3056        devInfo: *mut ::core::ffi::c_int,
3057    ) -> cusolverStatus_t;
3058}
3059unsafe extern "C" {
3060    /// These helper functions calculate the necessary size of work buffers.
3061    ///
3062    /// The S and D data types are real valued single and double precision, respectively.
3063    ///
3064    /// The C and Z data types are complex valued single and double precision, respectively.
3065    ///
3066    /// This function computes the Cholesky factorization of a Hermitian positive-definite matrix.
3067    ///
3068    /// `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.
3069    ///
3070    /// 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`.
3071    /// $$
3072    /// A = L\\*L^{H}
3073    /// $$
3074    ///
3075    /// 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`.
3076    /// $$
3077    /// A = U^{H}\\*U
3078    /// $$
3079    ///
3080    /// 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()`.
3081    ///
3082    /// 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.
3083    ///
3084    /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
3085    pub fn cusolverDnZpotrf(
3086        handle: cusolverDnHandle_t,
3087        uplo: cublasFillMode_t,
3088        n: ::core::ffi::c_int,
3089        A: *mut cuDoubleComplex,
3090        lda: ::core::ffi::c_int,
3091        Workspace: *mut cuDoubleComplex,
3092        Lwork: ::core::ffi::c_int,
3093        devInfo: *mut ::core::ffi::c_int,
3094    ) -> cusolverStatus_t;
3095}
3096unsafe extern "C" {
3097    /// This function solves a system of linear equations:
3098    /// $$
3099    /// A\\*X = B
3100    /// $$
3101    ///
3102    /// 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.
3103    ///
3104    /// 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$.
3105    ///
3106    /// The operation is in-place, i.e. matrix `X` overwrites matrix `B` with the same leading dimension `ldb`.
3107    ///
3108    /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
3109    pub fn cusolverDnSpotrs(
3110        handle: cusolverDnHandle_t,
3111        uplo: cublasFillMode_t,
3112        n: ::core::ffi::c_int,
3113        nrhs: ::core::ffi::c_int,
3114        A: *const f32,
3115        lda: ::core::ffi::c_int,
3116        B: *mut f32,
3117        ldb: ::core::ffi::c_int,
3118        devInfo: *mut ::core::ffi::c_int,
3119    ) -> cusolverStatus_t;
3120}
3121unsafe extern "C" {
3122    /// This function solves a system of linear equations:
3123    /// $$
3124    /// A\\*X = B
3125    /// $$
3126    ///
3127    /// 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.
3128    ///
3129    /// 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$.
3130    ///
3131    /// The operation is in-place, i.e. matrix `X` overwrites matrix `B` with the same leading dimension `ldb`.
3132    ///
3133    /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
3134    pub fn cusolverDnDpotrs(
3135        handle: cusolverDnHandle_t,
3136        uplo: cublasFillMode_t,
3137        n: ::core::ffi::c_int,
3138        nrhs: ::core::ffi::c_int,
3139        A: *const f64,
3140        lda: ::core::ffi::c_int,
3141        B: *mut f64,
3142        ldb: ::core::ffi::c_int,
3143        devInfo: *mut ::core::ffi::c_int,
3144    ) -> cusolverStatus_t;
3145}
3146unsafe extern "C" {
3147    /// This function solves a system of linear equations:
3148    /// $$
3149    /// A\\*X = B
3150    /// $$
3151    ///
3152    /// 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.
3153    ///
3154    /// 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$.
3155    ///
3156    /// The operation is in-place, i.e. matrix `X` overwrites matrix `B` with the same leading dimension `ldb`.
3157    ///
3158    /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
3159    pub fn cusolverDnCpotrs(
3160        handle: cusolverDnHandle_t,
3161        uplo: cublasFillMode_t,
3162        n: ::core::ffi::c_int,
3163        nrhs: ::core::ffi::c_int,
3164        A: *const cuComplex,
3165        lda: ::core::ffi::c_int,
3166        B: *mut cuComplex,
3167        ldb: ::core::ffi::c_int,
3168        devInfo: *mut ::core::ffi::c_int,
3169    ) -> cusolverStatus_t;
3170}
3171unsafe extern "C" {
3172    /// This function solves a system of linear equations:
3173    /// $$
3174    /// A\\*X = B
3175    /// $$
3176    ///
3177    /// 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.
3178    ///
3179    /// 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$.
3180    ///
3181    /// The operation is in-place, i.e. matrix `X` overwrites matrix `B` with the same leading dimension `ldb`.
3182    ///
3183    /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
3184    pub fn cusolverDnZpotrs(
3185        handle: cusolverDnHandle_t,
3186        uplo: cublasFillMode_t,
3187        n: ::core::ffi::c_int,
3188        nrhs: ::core::ffi::c_int,
3189        A: *const cuDoubleComplex,
3190        lda: ::core::ffi::c_int,
3191        B: *mut cuDoubleComplex,
3192        ldb: ::core::ffi::c_int,
3193        devInfo: *mut ::core::ffi::c_int,
3194    ) -> cusolverStatus_t;
3195}
3196unsafe extern "C" {
3197    /// 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.
3198    ///
3199    /// The C and Z data types are complex valued single and double precision, respectively.
3200    ///
3201    /// This function computes the Cholesky factorization of a sequence of Hermitian positive-definite matrices.
3202    ///
3203    /// 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.
3204    ///
3205    /// 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`.
3206    /// $$
3207    /// A = L\\*L^{H}
3208    /// $$
3209    ///
3210    /// 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`.
3211    /// $$
3212    /// A = U^{H}\\*U
3213    /// $$
3214    ///
3215    /// 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.
3216    ///
3217    /// `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`.
3218    ///
3219    /// 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`.
3220    pub fn cusolverDnSpotrfBatched(
3221        handle: cusolverDnHandle_t,
3222        uplo: cublasFillMode_t,
3223        n: ::core::ffi::c_int,
3224        Aarray: *mut *mut f32,
3225        lda: ::core::ffi::c_int,
3226        infoArray: *mut ::core::ffi::c_int,
3227        batchSize: ::core::ffi::c_int,
3228    ) -> cusolverStatus_t;
3229}
3230unsafe extern "C" {
3231    /// 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.
3232    ///
3233    /// The C and Z data types are complex valued single and double precision, respectively.
3234    ///
3235    /// This function computes the Cholesky factorization of a sequence of Hermitian positive-definite matrices.
3236    ///
3237    /// 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.
3238    ///
3239    /// 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`.
3240    /// $$
3241    /// A = L\\*L^{H}
3242    /// $$
3243    ///
3244    /// 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`.
3245    /// $$
3246    /// A = U^{H}\\*U
3247    /// $$
3248    ///
3249    /// 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.
3250    ///
3251    /// `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`.
3252    ///
3253    /// 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`.
3254    pub fn cusolverDnDpotrfBatched(
3255        handle: cusolverDnHandle_t,
3256        uplo: cublasFillMode_t,
3257        n: ::core::ffi::c_int,
3258        Aarray: *mut *mut f64,
3259        lda: ::core::ffi::c_int,
3260        infoArray: *mut ::core::ffi::c_int,
3261        batchSize: ::core::ffi::c_int,
3262    ) -> cusolverStatus_t;
3263}
3264unsafe extern "C" {
3265    /// 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.
3266    ///
3267    /// The C and Z data types are complex valued single and double precision, respectively.
3268    ///
3269    /// This function computes the Cholesky factorization of a sequence of Hermitian positive-definite matrices.
3270    ///
3271    /// 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.
3272    ///
3273    /// 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`.
3274    /// $$
3275    /// A = L\\*L^{H}
3276    /// $$
3277    ///
3278    /// 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`.
3279    /// $$
3280    /// A = U^{H}\\*U
3281    /// $$
3282    ///
3283    /// 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.
3284    ///
3285    /// `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`.
3286    ///
3287    /// 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`.
3288    pub fn cusolverDnCpotrfBatched(
3289        handle: cusolverDnHandle_t,
3290        uplo: cublasFillMode_t,
3291        n: ::core::ffi::c_int,
3292        Aarray: *mut *mut cuComplex,
3293        lda: ::core::ffi::c_int,
3294        infoArray: *mut ::core::ffi::c_int,
3295        batchSize: ::core::ffi::c_int,
3296    ) -> cusolverStatus_t;
3297}
3298unsafe extern "C" {
3299    /// 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.
3300    ///
3301    /// The C and Z data types are complex valued single and double precision, respectively.
3302    ///
3303    /// This function computes the Cholesky factorization of a sequence of Hermitian positive-definite matrices.
3304    ///
3305    /// 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.
3306    ///
3307    /// 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`.
3308    /// $$
3309    /// A = L\\*L^{H}
3310    /// $$
3311    ///
3312    /// 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`.
3313    /// $$
3314    /// A = U^{H}\\*U
3315    /// $$
3316    ///
3317    /// 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.
3318    ///
3319    /// `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`.
3320    ///
3321    /// 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`.
3322    pub fn cusolverDnZpotrfBatched(
3323        handle: cusolverDnHandle_t,
3324        uplo: cublasFillMode_t,
3325        n: ::core::ffi::c_int,
3326        Aarray: *mut *mut cuDoubleComplex,
3327        lda: ::core::ffi::c_int,
3328        infoArray: *mut ::core::ffi::c_int,
3329        batchSize: ::core::ffi::c_int,
3330    ) -> cusolverStatus_t;
3331}
3332unsafe extern "C" {
3333    /// This function solves a sequence of linear systems:
3334    /// $$
3335    /// {A\lbrack i\rbrack}\\*{X\lbrack i\rbrack} = {B\lbrack i\rbrack}
3336    /// $$
3337    ///
3338    /// 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.
3339    ///
3340    /// 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$.
3341    ///
3342    /// The operation is in-place, i.e. matrix `X` overwrites matrix `B` with the same leading dimension `ldb`.
3343    ///
3344    /// The output parameter `info` is a scalar. If `info = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
3345    ///
3346    /// Remark 1: only `nrhs=1` is supported.
3347    ///
3348    /// 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).
3349    ///
3350    /// 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`.
3351    ///
3352    /// Please visit [cuSOLVER Library Samples - potrfBatched](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/potrfBatched) for a code example.
3353    pub fn cusolverDnSpotrsBatched(
3354        handle: cusolverDnHandle_t,
3355        uplo: cublasFillMode_t,
3356        n: ::core::ffi::c_int,
3357        nrhs: ::core::ffi::c_int,
3358        A: *mut *mut f32,
3359        lda: ::core::ffi::c_int,
3360        B: *mut *mut f32,
3361        ldb: ::core::ffi::c_int,
3362        d_info: *mut ::core::ffi::c_int,
3363        batchSize: ::core::ffi::c_int,
3364    ) -> cusolverStatus_t;
3365}
3366unsafe extern "C" {
3367    /// This function solves a sequence of linear systems:
3368    /// $$
3369    /// {A\lbrack i\rbrack}\\*{X\lbrack i\rbrack} = {B\lbrack i\rbrack}
3370    /// $$
3371    ///
3372    /// 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.
3373    ///
3374    /// 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$.
3375    ///
3376    /// The operation is in-place, i.e. matrix `X` overwrites matrix `B` with the same leading dimension `ldb`.
3377    ///
3378    /// The output parameter `info` is a scalar. If `info = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
3379    ///
3380    /// Remark 1: only `nrhs=1` is supported.
3381    ///
3382    /// 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).
3383    ///
3384    /// 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`.
3385    ///
3386    /// Please visit [cuSOLVER Library Samples - potrfBatched](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/potrfBatched) for a code example.
3387    pub fn cusolverDnDpotrsBatched(
3388        handle: cusolverDnHandle_t,
3389        uplo: cublasFillMode_t,
3390        n: ::core::ffi::c_int,
3391        nrhs: ::core::ffi::c_int,
3392        A: *mut *mut f64,
3393        lda: ::core::ffi::c_int,
3394        B: *mut *mut f64,
3395        ldb: ::core::ffi::c_int,
3396        d_info: *mut ::core::ffi::c_int,
3397        batchSize: ::core::ffi::c_int,
3398    ) -> cusolverStatus_t;
3399}
3400unsafe extern "C" {
3401    /// This function solves a sequence of linear systems:
3402    /// $$
3403    /// {A\lbrack i\rbrack}\\*{X\lbrack i\rbrack} = {B\lbrack i\rbrack}
3404    /// $$
3405    ///
3406    /// 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.
3407    ///
3408    /// 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$.
3409    ///
3410    /// The operation is in-place, i.e. matrix `X` overwrites matrix `B` with the same leading dimension `ldb`.
3411    ///
3412    /// The output parameter `info` is a scalar. If `info = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
3413    ///
3414    /// Remark 1: only `nrhs=1` is supported.
3415    ///
3416    /// 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).
3417    ///
3418    /// 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`.
3419    ///
3420    /// Please visit [cuSOLVER Library Samples - potrfBatched](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/potrfBatched) for a code example.
3421    pub fn cusolverDnCpotrsBatched(
3422        handle: cusolverDnHandle_t,
3423        uplo: cublasFillMode_t,
3424        n: ::core::ffi::c_int,
3425        nrhs: ::core::ffi::c_int,
3426        A: *mut *mut cuComplex,
3427        lda: ::core::ffi::c_int,
3428        B: *mut *mut cuComplex,
3429        ldb: ::core::ffi::c_int,
3430        d_info: *mut ::core::ffi::c_int,
3431        batchSize: ::core::ffi::c_int,
3432    ) -> cusolverStatus_t;
3433}
3434unsafe extern "C" {
3435    /// This function solves a sequence of linear systems:
3436    /// $$
3437    /// {A\lbrack i\rbrack}\\*{X\lbrack i\rbrack} = {B\lbrack i\rbrack}
3438    /// $$
3439    ///
3440    /// 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.
3441    ///
3442    /// 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$.
3443    ///
3444    /// The operation is in-place, i.e. matrix `X` overwrites matrix `B` with the same leading dimension `ldb`.
3445    ///
3446    /// The output parameter `info` is a scalar. If `info = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
3447    ///
3448    /// Remark 1: only `nrhs=1` is supported.
3449    ///
3450    /// 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).
3451    ///
3452    /// 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`.
3453    ///
3454    /// Please visit [cuSOLVER Library Samples - potrfBatched](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/potrfBatched) for a code example.
3455    pub fn cusolverDnZpotrsBatched(
3456        handle: cusolverDnHandle_t,
3457        uplo: cublasFillMode_t,
3458        n: ::core::ffi::c_int,
3459        nrhs: ::core::ffi::c_int,
3460        A: *mut *mut cuDoubleComplex,
3461        lda: ::core::ffi::c_int,
3462        B: *mut *mut cuDoubleComplex,
3463        ldb: ::core::ffi::c_int,
3464        d_info: *mut ::core::ffi::c_int,
3465        batchSize: ::core::ffi::c_int,
3466    ) -> cusolverStatus_t;
3467}
3468unsafe extern "C" {
3469    pub fn cusolverDnSpotri_bufferSize(
3470        handle: cusolverDnHandle_t,
3471        uplo: cublasFillMode_t,
3472        n: ::core::ffi::c_int,
3473        A: *mut f32,
3474        lda: ::core::ffi::c_int,
3475        lwork: *mut ::core::ffi::c_int,
3476    ) -> cusolverStatus_t;
3477}
3478unsafe extern "C" {
3479    pub fn cusolverDnDpotri_bufferSize(
3480        handle: cusolverDnHandle_t,
3481        uplo: cublasFillMode_t,
3482        n: ::core::ffi::c_int,
3483        A: *mut f64,
3484        lda: ::core::ffi::c_int,
3485        lwork: *mut ::core::ffi::c_int,
3486    ) -> cusolverStatus_t;
3487}
3488unsafe extern "C" {
3489    pub fn cusolverDnCpotri_bufferSize(
3490        handle: cusolverDnHandle_t,
3491        uplo: cublasFillMode_t,
3492        n: ::core::ffi::c_int,
3493        A: *mut cuComplex,
3494        lda: ::core::ffi::c_int,
3495        lwork: *mut ::core::ffi::c_int,
3496    ) -> cusolverStatus_t;
3497}
3498unsafe extern "C" {
3499    pub fn cusolverDnZpotri_bufferSize(
3500        handle: cusolverDnHandle_t,
3501        uplo: cublasFillMode_t,
3502        n: ::core::ffi::c_int,
3503        A: *mut cuDoubleComplex,
3504        lda: ::core::ffi::c_int,
3505        lwork: *mut ::core::ffi::c_int,
3506    ) -> cusolverStatus_t;
3507}
3508unsafe extern "C" {
3509    /// These helper functions calculate the necessary size of work buffers.
3510    ///
3511    /// The S and D data types are real valued single and double precision, respectively.
3512    ///
3513    /// The C and Z data types are complex valued single and double precision, respectively.
3514    ///
3515    /// This function computes the inverse of a positive-definite matrix `A` using the Cholesky factorization:
3516    /// $$
3517    /// A = L\\*L^H = U^{H}\\*U
3518    /// $$
3519    ///
3520    /// computed by `potrf()`.
3521    ///
3522    /// `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.
3523    ///
3524    /// 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`.
3525    ///
3526    /// 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`.
3527    ///
3528    /// 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()`.
3529    ///
3530    /// 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.
3531    ///
3532    /// If the output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting the handle).
3533    pub fn cusolverDnSpotri(
3534        handle: cusolverDnHandle_t,
3535        uplo: cublasFillMode_t,
3536        n: ::core::ffi::c_int,
3537        A: *mut f32,
3538        lda: ::core::ffi::c_int,
3539        work: *mut f32,
3540        lwork: ::core::ffi::c_int,
3541        devInfo: *mut ::core::ffi::c_int,
3542    ) -> cusolverStatus_t;
3543}
3544unsafe extern "C" {
3545    /// These helper functions calculate the necessary size of work buffers.
3546    ///
3547    /// The S and D data types are real valued single and double precision, respectively.
3548    ///
3549    /// The C and Z data types are complex valued single and double precision, respectively.
3550    ///
3551    /// This function computes the inverse of a positive-definite matrix `A` using the Cholesky factorization:
3552    /// $$
3553    /// A = L\\*L^H = U^{H}\\*U
3554    /// $$
3555    ///
3556    /// computed by `potrf()`.
3557    ///
3558    /// `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.
3559    ///
3560    /// 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`.
3561    ///
3562    /// 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`.
3563    ///
3564    /// 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()`.
3565    ///
3566    /// 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.
3567    ///
3568    /// If the output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting the handle).
3569    pub fn cusolverDnDpotri(
3570        handle: cusolverDnHandle_t,
3571        uplo: cublasFillMode_t,
3572        n: ::core::ffi::c_int,
3573        A: *mut f64,
3574        lda: ::core::ffi::c_int,
3575        work: *mut f64,
3576        lwork: ::core::ffi::c_int,
3577        devInfo: *mut ::core::ffi::c_int,
3578    ) -> cusolverStatus_t;
3579}
3580unsafe extern "C" {
3581    /// These helper functions calculate the necessary size of work buffers.
3582    ///
3583    /// The S and D data types are real valued single and double precision, respectively.
3584    ///
3585    /// The C and Z data types are complex valued single and double precision, respectively.
3586    ///
3587    /// This function computes the inverse of a positive-definite matrix `A` using the Cholesky factorization:
3588    /// $$
3589    /// A = L\\*L^H = U^{H}\\*U
3590    /// $$
3591    ///
3592    /// computed by `potrf()`.
3593    ///
3594    /// `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.
3595    ///
3596    /// 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`.
3597    ///
3598    /// 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`.
3599    ///
3600    /// 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()`.
3601    ///
3602    /// 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.
3603    ///
3604    /// If the output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting the handle).
3605    pub fn cusolverDnCpotri(
3606        handle: cusolverDnHandle_t,
3607        uplo: cublasFillMode_t,
3608        n: ::core::ffi::c_int,
3609        A: *mut cuComplex,
3610        lda: ::core::ffi::c_int,
3611        work: *mut cuComplex,
3612        lwork: ::core::ffi::c_int,
3613        devInfo: *mut ::core::ffi::c_int,
3614    ) -> cusolverStatus_t;
3615}
3616unsafe extern "C" {
3617    /// These helper functions calculate the necessary size of work buffers.
3618    ///
3619    /// The S and D data types are real valued single and double precision, respectively.
3620    ///
3621    /// The C and Z data types are complex valued single and double precision, respectively.
3622    ///
3623    /// This function computes the inverse of a positive-definite matrix `A` using the Cholesky factorization:
3624    /// $$
3625    /// A = L\\*L^H = U^{H}\\*U
3626    /// $$
3627    ///
3628    /// computed by `potrf()`.
3629    ///
3630    /// `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.
3631    ///
3632    /// 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`.
3633    ///
3634    /// 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`.
3635    ///
3636    /// 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()`.
3637    ///
3638    /// 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.
3639    ///
3640    /// If the output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting the handle).
3641    pub fn cusolverDnZpotri(
3642        handle: cusolverDnHandle_t,
3643        uplo: cublasFillMode_t,
3644        n: ::core::ffi::c_int,
3645        A: *mut cuDoubleComplex,
3646        lda: ::core::ffi::c_int,
3647        work: *mut cuDoubleComplex,
3648        lwork: ::core::ffi::c_int,
3649        devInfo: *mut ::core::ffi::c_int,
3650    ) -> cusolverStatus_t;
3651}
3652unsafe extern "C" {
3653    pub fn cusolverDnXtrtri_bufferSize(
3654        handle: cusolverDnHandle_t,
3655        uplo: cublasFillMode_t,
3656        diag: cublasDiagType_t,
3657        n: i64,
3658        dataTypeA: cudaDataType,
3659        A: *mut ::core::ffi::c_void,
3660        lda: i64,
3661        workspaceInBytesOnDevice: *mut size_t,
3662        workspaceInBytesOnHost: *mut size_t,
3663    ) -> cusolverStatus_t;
3664}
3665unsafe extern "C" {
3666    /// The helper functions below can calculate the sizes needed for pre-allocated buffers.
3667    ///
3668    /// The following routine:
3669    ///
3670    /// computes the inverse of a triangular matrix using the generic API interface.
3671    ///
3672    /// `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.
3673    ///
3674    /// 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.
3675    ///
3676    /// 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.
3677    ///
3678    /// 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`].
3679    ///
3680    /// If matrix inversion fails, the output parameter `info = i` shows `A(i,i) = 0`.
3681    ///
3682    /// If output parameter `info = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
3683    ///
3684    /// Please visit [cuSOLVER Library Samples - Xtrtri](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/Xtrtri) for a code example.
3685    ///
3686    /// List of input arguments for [`cusolverDnXtrtri_bufferSize`] and [`cusolverDnXtrtri`]:
3687    ///
3688    /// **Valid data types**
3689    ///
3690    /// |  |  |
3691    /// | --- | --- |
3692    /// | `DataTypeA` | `Meaning` |
3693    /// | `CUDA_R_32F` | `STRTRI` |
3694    /// | `CUDA_R_64F` | `DTRTRI` |
3695    /// | `CUDA_C_32F` | `CTRTRI` |
3696    /// | `CUDA_C_64F` | `ZTRTRI` |
3697    ///
3698    /// # Parameters
3699    ///
3700    /// - `handle`: Handle to the cuSolverDN library context.
3701    /// - `uplo`: Indicates if matrix `A` lower or upper part is stored, the other part is not referenced.
3702    /// - `diag`: The enumerated unit diagonal type.
3703    /// - `n`: Number of rows and columns of matrix `A`.
3704    /// - `dataTypeA`: Data type of array `A`.
3705    /// - `A`: Array of dimension `lda * n` with `lda` is not less than `max(1,n)`.
3706    /// - `lda`: Leading dimension of two-dimensional array used to store matrix `A`.
3707    /// - `bufferOnDevice`: Device workspace. Array of type `void` of size `workspaceInBytesOnDevice` bytes.
3708    /// - `workspaceInBytesOnDevice`: Size in bytes of `bufferOnDevice`, returned by [`cusolverDnXtrtri_bufferSize`].
3709    /// - `bufferOnHost`: Host workspace. Array of type `void` of size `workspaceInBytesOnHost` bytes.
3710    /// - `workspaceInBytesOnHost`: Size in bytes of `bufferOnHost`, returned by [`cusolverDnXtrtri_bufferSize`].
3711    ///
3712    /// # Return value
3713    ///
3714    /// - [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]: An internal operation failed.
3715    /// - [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]: Invalid parameters were passed (`n&lt;0` or `lda&lt;max(1,n)`).
3716    /// - [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]: The library was not initialized.
3717    /// - [`cusolverStatus_t::CUSOLVER_STATUS_NOT_SUPPORTED`]: Data type is not supported.
3718    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The operation completed successfully.
3719    pub fn cusolverDnXtrtri(
3720        handle: cusolverDnHandle_t,
3721        uplo: cublasFillMode_t,
3722        diag: cublasDiagType_t,
3723        n: i64,
3724        dataTypeA: cudaDataType,
3725        A: *mut ::core::ffi::c_void,
3726        lda: i64,
3727        bufferOnDevice: *mut ::core::ffi::c_void,
3728        workspaceInBytesOnDevice: size_t,
3729        bufferOnHost: *mut ::core::ffi::c_void,
3730        workspaceInBytesOnHost: size_t,
3731        devInfo: *mut ::core::ffi::c_int,
3732    ) -> cusolverStatus_t;
3733}
3734unsafe extern "C" {
3735    pub fn cusolverDnSlauum_bufferSize(
3736        handle: cusolverDnHandle_t,
3737        uplo: cublasFillMode_t,
3738        n: ::core::ffi::c_int,
3739        A: *mut f32,
3740        lda: ::core::ffi::c_int,
3741        lwork: *mut ::core::ffi::c_int,
3742    ) -> cusolverStatus_t;
3743}
3744unsafe extern "C" {
3745    pub fn cusolverDnDlauum_bufferSize(
3746        handle: cusolverDnHandle_t,
3747        uplo: cublasFillMode_t,
3748        n: ::core::ffi::c_int,
3749        A: *mut f64,
3750        lda: ::core::ffi::c_int,
3751        lwork: *mut ::core::ffi::c_int,
3752    ) -> cusolverStatus_t;
3753}
3754unsafe extern "C" {
3755    pub fn cusolverDnClauum_bufferSize(
3756        handle: cusolverDnHandle_t,
3757        uplo: cublasFillMode_t,
3758        n: ::core::ffi::c_int,
3759        A: *mut cuComplex,
3760        lda: ::core::ffi::c_int,
3761        lwork: *mut ::core::ffi::c_int,
3762    ) -> cusolverStatus_t;
3763}
3764unsafe extern "C" {
3765    pub fn cusolverDnZlauum_bufferSize(
3766        handle: cusolverDnHandle_t,
3767        uplo: cublasFillMode_t,
3768        n: ::core::ffi::c_int,
3769        A: *mut cuDoubleComplex,
3770        lda: ::core::ffi::c_int,
3771        lwork: *mut ::core::ffi::c_int,
3772    ) -> cusolverStatus_t;
3773}
3774unsafe extern "C" {
3775    pub fn cusolverDnSlauum(
3776        handle: cusolverDnHandle_t,
3777        uplo: cublasFillMode_t,
3778        n: ::core::ffi::c_int,
3779        A: *mut f32,
3780        lda: ::core::ffi::c_int,
3781        work: *mut f32,
3782        lwork: ::core::ffi::c_int,
3783        devInfo: *mut ::core::ffi::c_int,
3784    ) -> cusolverStatus_t;
3785}
3786unsafe extern "C" {
3787    pub fn cusolverDnDlauum(
3788        handle: cusolverDnHandle_t,
3789        uplo: cublasFillMode_t,
3790        n: ::core::ffi::c_int,
3791        A: *mut f64,
3792        lda: ::core::ffi::c_int,
3793        work: *mut f64,
3794        lwork: ::core::ffi::c_int,
3795        devInfo: *mut ::core::ffi::c_int,
3796    ) -> cusolverStatus_t;
3797}
3798unsafe extern "C" {
3799    pub fn cusolverDnClauum(
3800        handle: cusolverDnHandle_t,
3801        uplo: cublasFillMode_t,
3802        n: ::core::ffi::c_int,
3803        A: *mut cuComplex,
3804        lda: ::core::ffi::c_int,
3805        work: *mut cuComplex,
3806        lwork: ::core::ffi::c_int,
3807        devInfo: *mut ::core::ffi::c_int,
3808    ) -> cusolverStatus_t;
3809}
3810unsafe extern "C" {
3811    pub fn cusolverDnZlauum(
3812        handle: cusolverDnHandle_t,
3813        uplo: cublasFillMode_t,
3814        n: ::core::ffi::c_int,
3815        A: *mut cuDoubleComplex,
3816        lda: ::core::ffi::c_int,
3817        work: *mut cuDoubleComplex,
3818        lwork: ::core::ffi::c_int,
3819        devInfo: *mut ::core::ffi::c_int,
3820    ) -> cusolverStatus_t;
3821}
3822unsafe extern "C" {
3823    pub fn cusolverDnSgetrf_bufferSize(
3824        handle: cusolverDnHandle_t,
3825        m: ::core::ffi::c_int,
3826        n: ::core::ffi::c_int,
3827        A: *mut f32,
3828        lda: ::core::ffi::c_int,
3829        Lwork: *mut ::core::ffi::c_int,
3830    ) -> cusolverStatus_t;
3831}
3832unsafe extern "C" {
3833    pub fn cusolverDnDgetrf_bufferSize(
3834        handle: cusolverDnHandle_t,
3835        m: ::core::ffi::c_int,
3836        n: ::core::ffi::c_int,
3837        A: *mut f64,
3838        lda: ::core::ffi::c_int,
3839        Lwork: *mut ::core::ffi::c_int,
3840    ) -> cusolverStatus_t;
3841}
3842unsafe extern "C" {
3843    pub fn cusolverDnCgetrf_bufferSize(
3844        handle: cusolverDnHandle_t,
3845        m: ::core::ffi::c_int,
3846        n: ::core::ffi::c_int,
3847        A: *mut cuComplex,
3848        lda: ::core::ffi::c_int,
3849        Lwork: *mut ::core::ffi::c_int,
3850    ) -> cusolverStatus_t;
3851}
3852unsafe extern "C" {
3853    pub fn cusolverDnZgetrf_bufferSize(
3854        handle: cusolverDnHandle_t,
3855        m: ::core::ffi::c_int,
3856        n: ::core::ffi::c_int,
3857        A: *mut cuDoubleComplex,
3858        lda: ::core::ffi::c_int,
3859        Lwork: *mut ::core::ffi::c_int,
3860    ) -> cusolverStatus_t;
3861}
3862unsafe extern "C" {
3863    /// These helper functions calculate the size of work buffers needed.
3864    ///
3865    /// Please visit [cuSOLVER Library Samples - getrf](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/getrf) for a code example.
3866    ///
3867    /// The S and D data types are real single and double precision, respectively.
3868    ///
3869    /// The C and Z data types are complex valued single and double precision, respectively.
3870    ///
3871    /// This function computes the LU factorization of an $m \times n$ matrix:
3872    /// $$
3873    /// P\\*A = L\\*U
3874    /// $$
3875    ///
3876    /// 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.
3877    ///
3878    /// 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()`.
3879    ///
3880    /// If LU factorization failed, i.e. matrix `A` (`U`) is singular, The output parameter `devInfo=i` indicates `U(i,i) = 0`.
3881    ///
3882    /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
3883    ///
3884    /// If `devIpiv` is null, no pivoting is performed. The factorization is `A=L*U`, which is not numerically stable.
3885    ///
3886    /// No matter LU factorization failed or not, the output parameter `devIpiv` contains pivoting sequence, row `i` is interchanged with row `devIpiv(i)`.
3887    ///
3888    /// The user can combine `getrf` and `getrs` to complete a linear solver.
3889    ///
3890    /// 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)`.
3891    pub fn cusolverDnSgetrf(
3892        handle: cusolverDnHandle_t,
3893        m: ::core::ffi::c_int,
3894        n: ::core::ffi::c_int,
3895        A: *mut f32,
3896        lda: ::core::ffi::c_int,
3897        Workspace: *mut f32,
3898        devIpiv: *mut ::core::ffi::c_int,
3899        devInfo: *mut ::core::ffi::c_int,
3900    ) -> cusolverStatus_t;
3901}
3902unsafe extern "C" {
3903    /// These helper functions calculate the size of work buffers needed.
3904    ///
3905    /// Please visit [cuSOLVER Library Samples - getrf](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/getrf) for a code example.
3906    ///
3907    /// The S and D data types are real single and double precision, respectively.
3908    ///
3909    /// The C and Z data types are complex valued single and double precision, respectively.
3910    ///
3911    /// This function computes the LU factorization of an $m \times n$ matrix:
3912    /// $$
3913    /// P\\*A = L\\*U
3914    /// $$
3915    ///
3916    /// 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.
3917    ///
3918    /// 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()`.
3919    ///
3920    /// If LU factorization failed, i.e. matrix `A` (`U`) is singular, The output parameter `devInfo=i` indicates `U(i,i) = 0`.
3921    ///
3922    /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
3923    ///
3924    /// If `devIpiv` is null, no pivoting is performed. The factorization is `A=L*U`, which is not numerically stable.
3925    ///
3926    /// No matter LU factorization failed or not, the output parameter `devIpiv` contains pivoting sequence, row `i` is interchanged with row `devIpiv(i)`.
3927    ///
3928    /// The user can combine `getrf` and `getrs` to complete a linear solver.
3929    ///
3930    /// 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)`.
3931    pub fn cusolverDnDgetrf(
3932        handle: cusolverDnHandle_t,
3933        m: ::core::ffi::c_int,
3934        n: ::core::ffi::c_int,
3935        A: *mut f64,
3936        lda: ::core::ffi::c_int,
3937        Workspace: *mut f64,
3938        devIpiv: *mut ::core::ffi::c_int,
3939        devInfo: *mut ::core::ffi::c_int,
3940    ) -> cusolverStatus_t;
3941}
3942unsafe extern "C" {
3943    /// These helper functions calculate the size of work buffers needed.
3944    ///
3945    /// Please visit [cuSOLVER Library Samples - getrf](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/getrf) for a code example.
3946    ///
3947    /// The S and D data types are real single and double precision, respectively.
3948    ///
3949    /// The C and Z data types are complex valued single and double precision, respectively.
3950    ///
3951    /// This function computes the LU factorization of an $m \times n$ matrix:
3952    /// $$
3953    /// P\\*A = L\\*U
3954    /// $$
3955    ///
3956    /// 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.
3957    ///
3958    /// 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()`.
3959    ///
3960    /// If LU factorization failed, i.e. matrix `A` (`U`) is singular, The output parameter `devInfo=i` indicates `U(i,i) = 0`.
3961    ///
3962    /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
3963    ///
3964    /// If `devIpiv` is null, no pivoting is performed. The factorization is `A=L*U`, which is not numerically stable.
3965    ///
3966    /// No matter LU factorization failed or not, the output parameter `devIpiv` contains pivoting sequence, row `i` is interchanged with row `devIpiv(i)`.
3967    ///
3968    /// The user can combine `getrf` and `getrs` to complete a linear solver.
3969    ///
3970    /// 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)`.
3971    pub fn cusolverDnCgetrf(
3972        handle: cusolverDnHandle_t,
3973        m: ::core::ffi::c_int,
3974        n: ::core::ffi::c_int,
3975        A: *mut cuComplex,
3976        lda: ::core::ffi::c_int,
3977        Workspace: *mut cuComplex,
3978        devIpiv: *mut ::core::ffi::c_int,
3979        devInfo: *mut ::core::ffi::c_int,
3980    ) -> cusolverStatus_t;
3981}
3982unsafe extern "C" {
3983    /// These helper functions calculate the size of work buffers needed.
3984    ///
3985    /// Please visit [cuSOLVER Library Samples - getrf](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/getrf) for a code example.
3986    ///
3987    /// The S and D data types are real single and double precision, respectively.
3988    ///
3989    /// The C and Z data types are complex valued single and double precision, respectively.
3990    ///
3991    /// This function computes the LU factorization of an $m \times n$ matrix:
3992    /// $$
3993    /// P\\*A = L\\*U
3994    /// $$
3995    ///
3996    /// 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.
3997    ///
3998    /// 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()`.
3999    ///
4000    /// If LU factorization failed, i.e. matrix `A` (`U`) is singular, The output parameter `devInfo=i` indicates `U(i,i) = 0`.
4001    ///
4002    /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
4003    ///
4004    /// If `devIpiv` is null, no pivoting is performed. The factorization is `A=L*U`, which is not numerically stable.
4005    ///
4006    /// No matter LU factorization failed or not, the output parameter `devIpiv` contains pivoting sequence, row `i` is interchanged with row `devIpiv(i)`.
4007    ///
4008    /// The user can combine `getrf` and `getrs` to complete a linear solver.
4009    ///
4010    /// 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)`.
4011    pub fn cusolverDnZgetrf(
4012        handle: cusolverDnHandle_t,
4013        m: ::core::ffi::c_int,
4014        n: ::core::ffi::c_int,
4015        A: *mut cuDoubleComplex,
4016        lda: ::core::ffi::c_int,
4017        Workspace: *mut cuDoubleComplex,
4018        devIpiv: *mut ::core::ffi::c_int,
4019        devInfo: *mut ::core::ffi::c_int,
4020    ) -> cusolverStatus_t;
4021}
4022unsafe extern "C" {
4023    pub fn cusolverDnSlaswp(
4024        handle: cusolverDnHandle_t,
4025        n: ::core::ffi::c_int,
4026        A: *mut f32,
4027        lda: ::core::ffi::c_int,
4028        k1: ::core::ffi::c_int,
4029        k2: ::core::ffi::c_int,
4030        devIpiv: *const ::core::ffi::c_int,
4031        incx: ::core::ffi::c_int,
4032    ) -> cusolverStatus_t;
4033}
4034unsafe extern "C" {
4035    pub fn cusolverDnDlaswp(
4036        handle: cusolverDnHandle_t,
4037        n: ::core::ffi::c_int,
4038        A: *mut f64,
4039        lda: ::core::ffi::c_int,
4040        k1: ::core::ffi::c_int,
4041        k2: ::core::ffi::c_int,
4042        devIpiv: *const ::core::ffi::c_int,
4043        incx: ::core::ffi::c_int,
4044    ) -> cusolverStatus_t;
4045}
4046unsafe extern "C" {
4047    pub fn cusolverDnClaswp(
4048        handle: cusolverDnHandle_t,
4049        n: ::core::ffi::c_int,
4050        A: *mut cuComplex,
4051        lda: ::core::ffi::c_int,
4052        k1: ::core::ffi::c_int,
4053        k2: ::core::ffi::c_int,
4054        devIpiv: *const ::core::ffi::c_int,
4055        incx: ::core::ffi::c_int,
4056    ) -> cusolverStatus_t;
4057}
4058unsafe extern "C" {
4059    pub fn cusolverDnZlaswp(
4060        handle: cusolverDnHandle_t,
4061        n: ::core::ffi::c_int,
4062        A: *mut cuDoubleComplex,
4063        lda: ::core::ffi::c_int,
4064        k1: ::core::ffi::c_int,
4065        k2: ::core::ffi::c_int,
4066        devIpiv: *const ::core::ffi::c_int,
4067        incx: ::core::ffi::c_int,
4068    ) -> cusolverStatus_t;
4069}
4070unsafe extern "C" {
4071    /// Please visit [cuSOLVER Library Samples - getrf](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/getrf) for a code example.
4072    ///
4073    /// This function solves a linear system of multiple right-hand sides:
4074    /// $$
4075    /// op(A)\\*X = B
4076    /// $$
4077    ///
4078    /// 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.
4079    ///
4080    /// The input parameter `trans` is defined by:
4081    /// $$
4082    /// \operatorname{op}(A) =
4083    /// \begin{cases}
4084    /// A & \text{if } trans = \text{CUBLAS_OP_N} \\
4085    /// A^T & \text{if } trans = \text{CUBLAS_OP_T} \\
4086    /// A^H & \text{if } trans = \text{CUBLAS_OP_C}
4087    /// \end{cases}
4088    /// $$
4089    ///
4090    /// The input parameter `devIpiv` is an output of `getrf`. It contains pivot indices, which are used to permutate right-hand sides.
4091    ///
4092    /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
4093    ///
4094    /// The user can combine `getrf` and `getrs` to complete a linear solver.
4095    pub fn cusolverDnSgetrs(
4096        handle: cusolverDnHandle_t,
4097        trans: cublasOperation_t,
4098        n: ::core::ffi::c_int,
4099        nrhs: ::core::ffi::c_int,
4100        A: *const f32,
4101        lda: ::core::ffi::c_int,
4102        devIpiv: *const ::core::ffi::c_int,
4103        B: *mut f32,
4104        ldb: ::core::ffi::c_int,
4105        devInfo: *mut ::core::ffi::c_int,
4106    ) -> cusolverStatus_t;
4107}
4108unsafe extern "C" {
4109    /// Please visit [cuSOLVER Library Samples - getrf](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/getrf) for a code example.
4110    ///
4111    /// This function solves a linear system of multiple right-hand sides:
4112    /// $$
4113    /// op(A)\\*X = B
4114    /// $$
4115    ///
4116    /// 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.
4117    ///
4118    /// The input parameter `trans` is defined by:
4119    /// $$
4120    /// \operatorname{op}(A) =
4121    /// \begin{cases}
4122    /// A & \text{if } trans = \text{CUBLAS_OP_N} \\
4123    /// A^T & \text{if } trans = \text{CUBLAS_OP_T} \\
4124    /// A^H & \text{if } trans = \text{CUBLAS_OP_C}
4125    /// \end{cases}
4126    /// $$
4127    ///
4128    /// The input parameter `devIpiv` is an output of `getrf`. It contains pivot indices, which are used to permutate right-hand sides.
4129    ///
4130    /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
4131    ///
4132    /// The user can combine `getrf` and `getrs` to complete a linear solver.
4133    pub fn cusolverDnDgetrs(
4134        handle: cusolverDnHandle_t,
4135        trans: cublasOperation_t,
4136        n: ::core::ffi::c_int,
4137        nrhs: ::core::ffi::c_int,
4138        A: *const f64,
4139        lda: ::core::ffi::c_int,
4140        devIpiv: *const ::core::ffi::c_int,
4141        B: *mut f64,
4142        ldb: ::core::ffi::c_int,
4143        devInfo: *mut ::core::ffi::c_int,
4144    ) -> cusolverStatus_t;
4145}
4146unsafe extern "C" {
4147    /// Please visit [cuSOLVER Library Samples - getrf](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/getrf) for a code example.
4148    ///
4149    /// This function solves a linear system of multiple right-hand sides:
4150    /// $$
4151    /// op(A)\\*X = B
4152    /// $$
4153    ///
4154    /// 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.
4155    ///
4156    /// The input parameter `trans` is defined by:
4157    /// $$
4158    /// \operatorname{op}(A) =
4159    /// \begin{cases}
4160    /// A & \text{if } trans = \text{CUBLAS_OP_N} \\
4161    /// A^T & \text{if } trans = \text{CUBLAS_OP_T} \\
4162    /// A^H & \text{if } trans = \text{CUBLAS_OP_C}
4163    /// \end{cases}
4164    /// $$
4165    ///
4166    /// The input parameter `devIpiv` is an output of `getrf`. It contains pivot indices, which are used to permutate right-hand sides.
4167    ///
4168    /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
4169    ///
4170    /// The user can combine `getrf` and `getrs` to complete a linear solver.
4171    pub fn cusolverDnCgetrs(
4172        handle: cusolverDnHandle_t,
4173        trans: cublasOperation_t,
4174        n: ::core::ffi::c_int,
4175        nrhs: ::core::ffi::c_int,
4176        A: *const cuComplex,
4177        lda: ::core::ffi::c_int,
4178        devIpiv: *const ::core::ffi::c_int,
4179        B: *mut cuComplex,
4180        ldb: ::core::ffi::c_int,
4181        devInfo: *mut ::core::ffi::c_int,
4182    ) -> cusolverStatus_t;
4183}
4184unsafe extern "C" {
4185    /// Please visit [cuSOLVER Library Samples - getrf](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/getrf) for a code example.
4186    ///
4187    /// This function solves a linear system of multiple right-hand sides:
4188    /// $$
4189    /// op(A)\\*X = B
4190    /// $$
4191    ///
4192    /// 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.
4193    ///
4194    /// The input parameter `trans` is defined by:
4195    /// $$
4196    /// \operatorname{op}(A) =
4197    /// \begin{cases}
4198    /// A & \text{if } trans = \text{CUBLAS_OP_N} \\
4199    /// A^T & \text{if } trans = \text{CUBLAS_OP_T} \\
4200    /// A^H & \text{if } trans = \text{CUBLAS_OP_C}
4201    /// \end{cases}
4202    /// $$
4203    ///
4204    /// The input parameter `devIpiv` is an output of `getrf`. It contains pivot indices, which are used to permutate right-hand sides.
4205    ///
4206    /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
4207    ///
4208    /// The user can combine `getrf` and `getrs` to complete a linear solver.
4209    pub fn cusolverDnZgetrs(
4210        handle: cusolverDnHandle_t,
4211        trans: cublasOperation_t,
4212        n: ::core::ffi::c_int,
4213        nrhs: ::core::ffi::c_int,
4214        A: *const cuDoubleComplex,
4215        lda: ::core::ffi::c_int,
4216        devIpiv: *const ::core::ffi::c_int,
4217        B: *mut cuDoubleComplex,
4218        ldb: ::core::ffi::c_int,
4219        devInfo: *mut ::core::ffi::c_int,
4220    ) -> cusolverStatus_t;
4221}
4222unsafe extern "C" {
4223    pub fn cusolverDnSgeqrf_bufferSize(
4224        handle: cusolverDnHandle_t,
4225        m: ::core::ffi::c_int,
4226        n: ::core::ffi::c_int,
4227        A: *mut f32,
4228        lda: ::core::ffi::c_int,
4229        lwork: *mut ::core::ffi::c_int,
4230    ) -> cusolverStatus_t;
4231}
4232unsafe extern "C" {
4233    pub fn cusolverDnDgeqrf_bufferSize(
4234        handle: cusolverDnHandle_t,
4235        m: ::core::ffi::c_int,
4236        n: ::core::ffi::c_int,
4237        A: *mut f64,
4238        lda: ::core::ffi::c_int,
4239        lwork: *mut ::core::ffi::c_int,
4240    ) -> cusolverStatus_t;
4241}
4242unsafe extern "C" {
4243    pub fn cusolverDnCgeqrf_bufferSize(
4244        handle: cusolverDnHandle_t,
4245        m: ::core::ffi::c_int,
4246        n: ::core::ffi::c_int,
4247        A: *mut cuComplex,
4248        lda: ::core::ffi::c_int,
4249        lwork: *mut ::core::ffi::c_int,
4250    ) -> cusolverStatus_t;
4251}
4252unsafe extern "C" {
4253    pub fn cusolverDnZgeqrf_bufferSize(
4254        handle: cusolverDnHandle_t,
4255        m: ::core::ffi::c_int,
4256        n: ::core::ffi::c_int,
4257        A: *mut cuDoubleComplex,
4258        lda: ::core::ffi::c_int,
4259        lwork: *mut ::core::ffi::c_int,
4260    ) -> cusolverStatus_t;
4261}
4262unsafe extern "C" {
4263    /// These helper functions calculate the size of work buffers needed.
4264    ///
4265    /// The S and D data types are real valued single and double precision, respectively.
4266    ///
4267    /// The C and Z data types are complex valued single and double precision, respectively.
4268    ///
4269    /// This function computes the QR factorization of an $m \times n$ matrix:
4270    /// $$
4271    /// A = Q\\*R
4272    /// $$
4273    ///
4274    /// 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.
4275    ///
4276    /// 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()`.
4277    ///
4278    /// The matrix `R` is overwritten in upper triangular part of `A`, including diagonal elements.
4279    ///
4280    /// 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:
4281    /// $$
4282    /// I - 2\\*v\\*v^{H} = I - \tau\\*q\\*q^{H}
4283    /// $$
4284    ///
4285    /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
4286    pub fn cusolverDnSgeqrf(
4287        handle: cusolverDnHandle_t,
4288        m: ::core::ffi::c_int,
4289        n: ::core::ffi::c_int,
4290        A: *mut f32,
4291        lda: ::core::ffi::c_int,
4292        TAU: *mut f32,
4293        Workspace: *mut f32,
4294        Lwork: ::core::ffi::c_int,
4295        devInfo: *mut ::core::ffi::c_int,
4296    ) -> cusolverStatus_t;
4297}
4298unsafe extern "C" {
4299    /// These helper functions calculate the size of work buffers needed.
4300    ///
4301    /// The S and D data types are real valued single and double precision, respectively.
4302    ///
4303    /// The C and Z data types are complex valued single and double precision, respectively.
4304    ///
4305    /// This function computes the QR factorization of an $m \times n$ matrix:
4306    /// $$
4307    /// A = Q\\*R
4308    /// $$
4309    ///
4310    /// 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.
4311    ///
4312    /// 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()`.
4313    ///
4314    /// The matrix `R` is overwritten in upper triangular part of `A`, including diagonal elements.
4315    ///
4316    /// 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:
4317    /// $$
4318    /// I - 2\\*v\\*v^{H} = I - \tau\\*q\\*q^{H}
4319    /// $$
4320    ///
4321    /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
4322    pub fn cusolverDnDgeqrf(
4323        handle: cusolverDnHandle_t,
4324        m: ::core::ffi::c_int,
4325        n: ::core::ffi::c_int,
4326        A: *mut f64,
4327        lda: ::core::ffi::c_int,
4328        TAU: *mut f64,
4329        Workspace: *mut f64,
4330        Lwork: ::core::ffi::c_int,
4331        devInfo: *mut ::core::ffi::c_int,
4332    ) -> cusolverStatus_t;
4333}
4334unsafe extern "C" {
4335    /// These helper functions calculate the size of work buffers needed.
4336    ///
4337    /// The S and D data types are real valued single and double precision, respectively.
4338    ///
4339    /// The C and Z data types are complex valued single and double precision, respectively.
4340    ///
4341    /// This function computes the QR factorization of an $m \times n$ matrix:
4342    /// $$
4343    /// A = Q\\*R
4344    /// $$
4345    ///
4346    /// 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.
4347    ///
4348    /// 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()`.
4349    ///
4350    /// The matrix `R` is overwritten in upper triangular part of `A`, including diagonal elements.
4351    ///
4352    /// 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:
4353    /// $$
4354    /// I - 2\\*v\\*v^{H} = I - \tau\\*q\\*q^{H}
4355    /// $$
4356    ///
4357    /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
4358    pub fn cusolverDnCgeqrf(
4359        handle: cusolverDnHandle_t,
4360        m: ::core::ffi::c_int,
4361        n: ::core::ffi::c_int,
4362        A: *mut cuComplex,
4363        lda: ::core::ffi::c_int,
4364        TAU: *mut cuComplex,
4365        Workspace: *mut cuComplex,
4366        Lwork: ::core::ffi::c_int,
4367        devInfo: *mut ::core::ffi::c_int,
4368    ) -> cusolverStatus_t;
4369}
4370unsafe extern "C" {
4371    /// These helper functions calculate the size of work buffers needed.
4372    ///
4373    /// The S and D data types are real valued single and double precision, respectively.
4374    ///
4375    /// The C and Z data types are complex valued single and double precision, respectively.
4376    ///
4377    /// This function computes the QR factorization of an $m \times n$ matrix:
4378    /// $$
4379    /// A = Q\\*R
4380    /// $$
4381    ///
4382    /// 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.
4383    ///
4384    /// 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()`.
4385    ///
4386    /// The matrix `R` is overwritten in upper triangular part of `A`, including diagonal elements.
4387    ///
4388    /// 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:
4389    /// $$
4390    /// I - 2\\*v\\*v^{H} = I - \tau\\*q\\*q^{H}
4391    /// $$
4392    ///
4393    /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
4394    pub fn cusolverDnZgeqrf(
4395        handle: cusolverDnHandle_t,
4396        m: ::core::ffi::c_int,
4397        n: ::core::ffi::c_int,
4398        A: *mut cuDoubleComplex,
4399        lda: ::core::ffi::c_int,
4400        TAU: *mut cuDoubleComplex,
4401        Workspace: *mut cuDoubleComplex,
4402        Lwork: ::core::ffi::c_int,
4403        devInfo: *mut ::core::ffi::c_int,
4404    ) -> cusolverStatus_t;
4405}
4406unsafe extern "C" {
4407    pub fn cusolverDnSorgqr_bufferSize(
4408        handle: cusolverDnHandle_t,
4409        m: ::core::ffi::c_int,
4410        n: ::core::ffi::c_int,
4411        k: ::core::ffi::c_int,
4412        A: *const f32,
4413        lda: ::core::ffi::c_int,
4414        tau: *const f32,
4415        lwork: *mut ::core::ffi::c_int,
4416    ) -> cusolverStatus_t;
4417}
4418unsafe extern "C" {
4419    pub fn cusolverDnDorgqr_bufferSize(
4420        handle: cusolverDnHandle_t,
4421        m: ::core::ffi::c_int,
4422        n: ::core::ffi::c_int,
4423        k: ::core::ffi::c_int,
4424        A: *const f64,
4425        lda: ::core::ffi::c_int,
4426        tau: *const f64,
4427        lwork: *mut ::core::ffi::c_int,
4428    ) -> cusolverStatus_t;
4429}
4430unsafe extern "C" {
4431    pub fn cusolverDnCungqr_bufferSize(
4432        handle: cusolverDnHandle_t,
4433        m: ::core::ffi::c_int,
4434        n: ::core::ffi::c_int,
4435        k: ::core::ffi::c_int,
4436        A: *const cuComplex,
4437        lda: ::core::ffi::c_int,
4438        tau: *const cuComplex,
4439        lwork: *mut ::core::ffi::c_int,
4440    ) -> cusolverStatus_t;
4441}
4442unsafe extern "C" {
4443    pub fn cusolverDnZungqr_bufferSize(
4444        handle: cusolverDnHandle_t,
4445        m: ::core::ffi::c_int,
4446        n: ::core::ffi::c_int,
4447        k: ::core::ffi::c_int,
4448        A: *const cuDoubleComplex,
4449        lda: ::core::ffi::c_int,
4450        tau: *const cuDoubleComplex,
4451        lwork: *mut ::core::ffi::c_int,
4452    ) -> cusolverStatus_t;
4453}
4454unsafe extern "C" {
4455    /// 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.
4456    ///
4457    /// The S and D data types are real valued single and double precision, respectively.
4458    ///
4459    /// The C and Z data types are complex valued single and double precision, respectively.
4460    ///
4461    /// This function overwrites $m \times n$ matrix `A` by:
4462    /// $$
4463    /// Q = {H(1)}\\*{H(2)}\\*{...}\\*{H(k)}
4464    /// $$
4465    ///
4466    /// where `Q` is a unitary matrix formed by a sequence of elementary reflection vectors stored in `A`.
4467    ///
4468    /// 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(&lt;type>) * lwork`.
4469    ///
4470    /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
4471    ///
4472    /// The user can combine `geqrf`, `orgqr` to complete orthogonalization.
4473    pub fn cusolverDnSorgqr(
4474        handle: cusolverDnHandle_t,
4475        m: ::core::ffi::c_int,
4476        n: ::core::ffi::c_int,
4477        k: ::core::ffi::c_int,
4478        A: *mut f32,
4479        lda: ::core::ffi::c_int,
4480        tau: *const f32,
4481        work: *mut f32,
4482        lwork: ::core::ffi::c_int,
4483        info: *mut ::core::ffi::c_int,
4484    ) -> cusolverStatus_t;
4485}
4486unsafe extern "C" {
4487    /// 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.
4488    ///
4489    /// The S and D data types are real valued single and double precision, respectively.
4490    ///
4491    /// The C and Z data types are complex valued single and double precision, respectively.
4492    ///
4493    /// This function overwrites $m \times n$ matrix `A` by:
4494    /// $$
4495    /// Q = {H(1)}\\*{H(2)}\\*{...}\\*{H(k)}
4496    /// $$
4497    ///
4498    /// where `Q` is a unitary matrix formed by a sequence of elementary reflection vectors stored in `A`.
4499    ///
4500    /// 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(&lt;type>) * lwork`.
4501    ///
4502    /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
4503    ///
4504    /// The user can combine `geqrf`, `orgqr` to complete orthogonalization.
4505    pub fn cusolverDnDorgqr(
4506        handle: cusolverDnHandle_t,
4507        m: ::core::ffi::c_int,
4508        n: ::core::ffi::c_int,
4509        k: ::core::ffi::c_int,
4510        A: *mut f64,
4511        lda: ::core::ffi::c_int,
4512        tau: *const f64,
4513        work: *mut f64,
4514        lwork: ::core::ffi::c_int,
4515        info: *mut ::core::ffi::c_int,
4516    ) -> cusolverStatus_t;
4517}
4518unsafe extern "C" {
4519    pub fn cusolverDnCungqr(
4520        handle: cusolverDnHandle_t,
4521        m: ::core::ffi::c_int,
4522        n: ::core::ffi::c_int,
4523        k: ::core::ffi::c_int,
4524        A: *mut cuComplex,
4525        lda: ::core::ffi::c_int,
4526        tau: *const cuComplex,
4527        work: *mut cuComplex,
4528        lwork: ::core::ffi::c_int,
4529        info: *mut ::core::ffi::c_int,
4530    ) -> cusolverStatus_t;
4531}
4532unsafe extern "C" {
4533    pub fn cusolverDnZungqr(
4534        handle: cusolverDnHandle_t,
4535        m: ::core::ffi::c_int,
4536        n: ::core::ffi::c_int,
4537        k: ::core::ffi::c_int,
4538        A: *mut cuDoubleComplex,
4539        lda: ::core::ffi::c_int,
4540        tau: *const cuDoubleComplex,
4541        work: *mut cuDoubleComplex,
4542        lwork: ::core::ffi::c_int,
4543        info: *mut ::core::ffi::c_int,
4544    ) -> cusolverStatus_t;
4545}
4546unsafe extern "C" {
4547    pub fn cusolverDnSormqr_bufferSize(
4548        handle: cusolverDnHandle_t,
4549        side: cublasSideMode_t,
4550        trans: cublasOperation_t,
4551        m: ::core::ffi::c_int,
4552        n: ::core::ffi::c_int,
4553        k: ::core::ffi::c_int,
4554        A: *const f32,
4555        lda: ::core::ffi::c_int,
4556        tau: *const f32,
4557        C: *const f32,
4558        ldc: ::core::ffi::c_int,
4559        lwork: *mut ::core::ffi::c_int,
4560    ) -> cusolverStatus_t;
4561}
4562unsafe extern "C" {
4563    pub fn cusolverDnDormqr_bufferSize(
4564        handle: cusolverDnHandle_t,
4565        side: cublasSideMode_t,
4566        trans: cublasOperation_t,
4567        m: ::core::ffi::c_int,
4568        n: ::core::ffi::c_int,
4569        k: ::core::ffi::c_int,
4570        A: *const f64,
4571        lda: ::core::ffi::c_int,
4572        tau: *const f64,
4573        C: *const f64,
4574        ldc: ::core::ffi::c_int,
4575        lwork: *mut ::core::ffi::c_int,
4576    ) -> cusolverStatus_t;
4577}
4578unsafe extern "C" {
4579    pub fn cusolverDnCunmqr_bufferSize(
4580        handle: cusolverDnHandle_t,
4581        side: cublasSideMode_t,
4582        trans: cublasOperation_t,
4583        m: ::core::ffi::c_int,
4584        n: ::core::ffi::c_int,
4585        k: ::core::ffi::c_int,
4586        A: *const cuComplex,
4587        lda: ::core::ffi::c_int,
4588        tau: *const cuComplex,
4589        C: *const cuComplex,
4590        ldc: ::core::ffi::c_int,
4591        lwork: *mut ::core::ffi::c_int,
4592    ) -> cusolverStatus_t;
4593}
4594unsafe extern "C" {
4595    pub fn cusolverDnZunmqr_bufferSize(
4596        handle: cusolverDnHandle_t,
4597        side: cublasSideMode_t,
4598        trans: cublasOperation_t,
4599        m: ::core::ffi::c_int,
4600        n: ::core::ffi::c_int,
4601        k: ::core::ffi::c_int,
4602        A: *const cuDoubleComplex,
4603        lda: ::core::ffi::c_int,
4604        tau: *const cuDoubleComplex,
4605        C: *const cuDoubleComplex,
4606        ldc: ::core::ffi::c_int,
4607        lwork: *mut ::core::ffi::c_int,
4608    ) -> cusolverStatus_t;
4609}
4610unsafe extern "C" {
4611    /// 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.
4612    ///
4613    /// The S and D data types are real valued single and double precision, respectively.
4614    ///
4615    /// The C and Z data types are complex valued single and double precision, respectively.
4616    ///
4617    /// This function overwrites $m \times n$ matrix `C` by:
4618    /// $$
4619    /// C =
4620    /// \begin{cases}
4621    /// \operatorname{op}(Q) * C & \text{if } side = \text{CUBLAS_SIDE_LEFT} \\
4622    /// C * \operatorname{op}(Q) & \text{if } side = \text{CUBLAS_SIDE_RIGHT}
4623    /// \end{cases}
4624    /// $$
4625    ///
4626    /// The operation of `Q` is defined by:
4627    /// $$
4628    /// \operatorname{op}(Q) =
4629    /// \begin{cases}
4630    /// Q & \text{if } transa = \text{CUBLAS_OP_N} \\
4631    /// Q^T & \text{if } transa = \text{CUBLAS_OP_T} \\
4632    /// Q^H & \text{if } transa = \text{CUBLAS_OP_C}
4633    /// \end{cases}
4634    /// $$
4635    ///
4636    /// `Q` is a unitary matrix formed by a sequence of elementary reflection vectors from QR factorization (`geqrf`) of `A`.
4637    ///
4638    /// `Q`=`H(1) ``H(2)` … `H(k)`
4639    ///
4640    /// `Q` is of order `m` if `side` = [`cublasSideMode_t::CUBLAS_SIDE_LEFT`] and of order `n` if `side` = [`cublasSideMode_t::CUBLAS_SIDE_RIGHT`].
4641    ///
4642    /// 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(&lt;type>) * lwork`.
4643    ///
4644    /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
4645    ///
4646    /// The user can combine `geqrf`, `ormqr` and `trsm` to complete a linear solver or a least-square solver.
4647    pub fn cusolverDnSormqr(
4648        handle: cusolverDnHandle_t,
4649        side: cublasSideMode_t,
4650        trans: cublasOperation_t,
4651        m: ::core::ffi::c_int,
4652        n: ::core::ffi::c_int,
4653        k: ::core::ffi::c_int,
4654        A: *const f32,
4655        lda: ::core::ffi::c_int,
4656        tau: *const f32,
4657        C: *mut f32,
4658        ldc: ::core::ffi::c_int,
4659        work: *mut f32,
4660        lwork: ::core::ffi::c_int,
4661        devInfo: *mut ::core::ffi::c_int,
4662    ) -> cusolverStatus_t;
4663}
4664unsafe extern "C" {
4665    /// 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.
4666    ///
4667    /// The S and D data types are real valued single and double precision, respectively.
4668    ///
4669    /// The C and Z data types are complex valued single and double precision, respectively.
4670    ///
4671    /// This function overwrites $m \times n$ matrix `C` by:
4672    /// $$
4673    /// C =
4674    /// \begin{cases}
4675    /// \operatorname{op}(Q) * C & \text{if } side = \text{CUBLAS_SIDE_LEFT} \\
4676    /// C * \operatorname{op}(Q) & \text{if } side = \text{CUBLAS_SIDE_RIGHT}
4677    /// \end{cases}
4678    /// $$
4679    ///
4680    /// The operation of `Q` is defined by:
4681    /// $$
4682    /// \operatorname{op}(Q) =
4683    /// \begin{cases}
4684    /// Q & \text{if } transa = \text{CUBLAS_OP_N} \\
4685    /// Q^T & \text{if } transa = \text{CUBLAS_OP_T} \\
4686    /// Q^H & \text{if } transa = \text{CUBLAS_OP_C}
4687    /// \end{cases}
4688    /// $$
4689    ///
4690    /// `Q` is a unitary matrix formed by a sequence of elementary reflection vectors from QR factorization (`geqrf`) of `A`.
4691    ///
4692    /// `Q`=`H(1) ``H(2)` … `H(k)`
4693    ///
4694    /// `Q` is of order `m` if `side` = [`cublasSideMode_t::CUBLAS_SIDE_LEFT`] and of order `n` if `side` = [`cublasSideMode_t::CUBLAS_SIDE_RIGHT`].
4695    ///
4696    /// 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(&lt;type>) * lwork`.
4697    ///
4698    /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
4699    ///
4700    /// The user can combine `geqrf`, `ormqr` and `trsm` to complete a linear solver or a least-square solver.
4701    pub fn cusolverDnDormqr(
4702        handle: cusolverDnHandle_t,
4703        side: cublasSideMode_t,
4704        trans: cublasOperation_t,
4705        m: ::core::ffi::c_int,
4706        n: ::core::ffi::c_int,
4707        k: ::core::ffi::c_int,
4708        A: *const f64,
4709        lda: ::core::ffi::c_int,
4710        tau: *const f64,
4711        C: *mut f64,
4712        ldc: ::core::ffi::c_int,
4713        work: *mut f64,
4714        lwork: ::core::ffi::c_int,
4715        devInfo: *mut ::core::ffi::c_int,
4716    ) -> cusolverStatus_t;
4717}
4718unsafe extern "C" {
4719    pub fn cusolverDnCunmqr(
4720        handle: cusolverDnHandle_t,
4721        side: cublasSideMode_t,
4722        trans: cublasOperation_t,
4723        m: ::core::ffi::c_int,
4724        n: ::core::ffi::c_int,
4725        k: ::core::ffi::c_int,
4726        A: *const cuComplex,
4727        lda: ::core::ffi::c_int,
4728        tau: *const cuComplex,
4729        C: *mut cuComplex,
4730        ldc: ::core::ffi::c_int,
4731        work: *mut cuComplex,
4732        lwork: ::core::ffi::c_int,
4733        devInfo: *mut ::core::ffi::c_int,
4734    ) -> cusolverStatus_t;
4735}
4736unsafe extern "C" {
4737    pub fn cusolverDnZunmqr(
4738        handle: cusolverDnHandle_t,
4739        side: cublasSideMode_t,
4740        trans: cublasOperation_t,
4741        m: ::core::ffi::c_int,
4742        n: ::core::ffi::c_int,
4743        k: ::core::ffi::c_int,
4744        A: *const cuDoubleComplex,
4745        lda: ::core::ffi::c_int,
4746        tau: *const cuDoubleComplex,
4747        C: *mut cuDoubleComplex,
4748        ldc: ::core::ffi::c_int,
4749        work: *mut cuDoubleComplex,
4750        lwork: ::core::ffi::c_int,
4751        devInfo: *mut ::core::ffi::c_int,
4752    ) -> cusolverStatus_t;
4753}
4754unsafe extern "C" {
4755    pub fn cusolverDnSsytrf_bufferSize(
4756        handle: cusolverDnHandle_t,
4757        n: ::core::ffi::c_int,
4758        A: *mut f32,
4759        lda: ::core::ffi::c_int,
4760        lwork: *mut ::core::ffi::c_int,
4761    ) -> cusolverStatus_t;
4762}
4763unsafe extern "C" {
4764    pub fn cusolverDnDsytrf_bufferSize(
4765        handle: cusolverDnHandle_t,
4766        n: ::core::ffi::c_int,
4767        A: *mut f64,
4768        lda: ::core::ffi::c_int,
4769        lwork: *mut ::core::ffi::c_int,
4770    ) -> cusolverStatus_t;
4771}
4772unsafe extern "C" {
4773    pub fn cusolverDnCsytrf_bufferSize(
4774        handle: cusolverDnHandle_t,
4775        n: ::core::ffi::c_int,
4776        A: *mut cuComplex,
4777        lda: ::core::ffi::c_int,
4778        lwork: *mut ::core::ffi::c_int,
4779    ) -> cusolverStatus_t;
4780}
4781unsafe extern "C" {
4782    pub fn cusolverDnZsytrf_bufferSize(
4783        handle: cusolverDnHandle_t,
4784        n: ::core::ffi::c_int,
4785        A: *mut cuDoubleComplex,
4786        lda: ::core::ffi::c_int,
4787        lwork: *mut ::core::ffi::c_int,
4788    ) -> cusolverStatus_t;
4789}
4790unsafe extern "C" {
4791    /// These helper functions calculate the size of the needed buffers.
4792    ///
4793    /// The S and D data types are real valued single and double precision, respectively.
4794    ///
4795    /// The C and Z data types are complex valued single and double precision, respectively.
4796    ///
4797    /// This function computes the factorization of a symmetric indefinite matrix using the Bunch-Kaufman diagonal pivoting.
4798    ///
4799    /// `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.
4800    ///
4801    /// 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.
4802    /// $$
4803    /// P\\*A\\*P^{T} = L\\*D\\*L^{T}
4804    /// $$
4805    ///
4806    /// 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`.
4807    /// $$
4808    /// P\\*A\\*P^{T} = U\\*D\\*U^{T}
4809    /// $$
4810    ///
4811    /// 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(&lt;type>) * lwork`. When no pivoting is performed, the other triangular part of the input matrix `A` is used as workspace.
4812    ///
4813    /// If Bunch-Kaufman factorization failed, i.e. `A` is singular. The output parameter `devInfo = i` would indicate `D(i,i)=0`.
4814    ///
4815    /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
4816    ///
4817    /// 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 &lt; 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 &lt; 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.
4818    pub fn cusolverDnSsytrf(
4819        handle: cusolverDnHandle_t,
4820        uplo: cublasFillMode_t,
4821        n: ::core::ffi::c_int,
4822        A: *mut f32,
4823        lda: ::core::ffi::c_int,
4824        ipiv: *mut ::core::ffi::c_int,
4825        work: *mut f32,
4826        lwork: ::core::ffi::c_int,
4827        info: *mut ::core::ffi::c_int,
4828    ) -> cusolverStatus_t;
4829}
4830unsafe extern "C" {
4831    /// These helper functions calculate the size of the needed buffers.
4832    ///
4833    /// The S and D data types are real valued single and double precision, respectively.
4834    ///
4835    /// The C and Z data types are complex valued single and double precision, respectively.
4836    ///
4837    /// This function computes the factorization of a symmetric indefinite matrix using the Bunch-Kaufman diagonal pivoting.
4838    ///
4839    /// `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.
4840    ///
4841    /// 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.
4842    /// $$
4843    /// P\\*A\\*P^{T} = L\\*D\\*L^{T}
4844    /// $$
4845    ///
4846    /// 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`.
4847    /// $$
4848    /// P\\*A\\*P^{T} = U\\*D\\*U^{T}
4849    /// $$
4850    ///
4851    /// 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(&lt;type>) * lwork`. When no pivoting is performed, the other triangular part of the input matrix `A` is used as workspace.
4852    ///
4853    /// If Bunch-Kaufman factorization failed, i.e. `A` is singular. The output parameter `devInfo = i` would indicate `D(i,i)=0`.
4854    ///
4855    /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
4856    ///
4857    /// 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 &lt; 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 &lt; 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.
4858    pub fn cusolverDnDsytrf(
4859        handle: cusolverDnHandle_t,
4860        uplo: cublasFillMode_t,
4861        n: ::core::ffi::c_int,
4862        A: *mut f64,
4863        lda: ::core::ffi::c_int,
4864        ipiv: *mut ::core::ffi::c_int,
4865        work: *mut f64,
4866        lwork: ::core::ffi::c_int,
4867        info: *mut ::core::ffi::c_int,
4868    ) -> cusolverStatus_t;
4869}
4870unsafe extern "C" {
4871    /// These helper functions calculate the size of the needed buffers.
4872    ///
4873    /// The S and D data types are real valued single and double precision, respectively.
4874    ///
4875    /// The C and Z data types are complex valued single and double precision, respectively.
4876    ///
4877    /// This function computes the factorization of a symmetric indefinite matrix using the Bunch-Kaufman diagonal pivoting.
4878    ///
4879    /// `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.
4880    ///
4881    /// 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.
4882    /// $$
4883    /// P\\*A\\*P^{T} = L\\*D\\*L^{T}
4884    /// $$
4885    ///
4886    /// 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`.
4887    /// $$
4888    /// P\\*A\\*P^{T} = U\\*D\\*U^{T}
4889    /// $$
4890    ///
4891    /// 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(&lt;type>) * lwork`. When no pivoting is performed, the other triangular part of the input matrix `A` is used as workspace.
4892    ///
4893    /// If Bunch-Kaufman factorization failed, i.e. `A` is singular. The output parameter `devInfo = i` would indicate `D(i,i)=0`.
4894    ///
4895    /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
4896    ///
4897    /// 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 &lt; 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 &lt; 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.
4898    pub fn cusolverDnCsytrf(
4899        handle: cusolverDnHandle_t,
4900        uplo: cublasFillMode_t,
4901        n: ::core::ffi::c_int,
4902        A: *mut cuComplex,
4903        lda: ::core::ffi::c_int,
4904        ipiv: *mut ::core::ffi::c_int,
4905        work: *mut cuComplex,
4906        lwork: ::core::ffi::c_int,
4907        info: *mut ::core::ffi::c_int,
4908    ) -> cusolverStatus_t;
4909}
4910unsafe extern "C" {
4911    /// These helper functions calculate the size of the needed buffers.
4912    ///
4913    /// The S and D data types are real valued single and double precision, respectively.
4914    ///
4915    /// The C and Z data types are complex valued single and double precision, respectively.
4916    ///
4917    /// This function computes the factorization of a symmetric indefinite matrix using the Bunch-Kaufman diagonal pivoting.
4918    ///
4919    /// `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.
4920    ///
4921    /// 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.
4922    /// $$
4923    /// P\\*A\\*P^{T} = L\\*D\\*L^{T}
4924    /// $$
4925    ///
4926    /// 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`.
4927    /// $$
4928    /// P\\*A\\*P^{T} = U\\*D\\*U^{T}
4929    /// $$
4930    ///
4931    /// 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(&lt;type>) * lwork`. When no pivoting is performed, the other triangular part of the input matrix `A` is used as workspace.
4932    ///
4933    /// If Bunch-Kaufman factorization failed, i.e. `A` is singular. The output parameter `devInfo = i` would indicate `D(i,i)=0`.
4934    ///
4935    /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
4936    ///
4937    /// 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 &lt; 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 &lt; 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.
4938    pub fn cusolverDnZsytrf(
4939        handle: cusolverDnHandle_t,
4940        uplo: cublasFillMode_t,
4941        n: ::core::ffi::c_int,
4942        A: *mut cuDoubleComplex,
4943        lda: ::core::ffi::c_int,
4944        ipiv: *mut ::core::ffi::c_int,
4945        work: *mut cuDoubleComplex,
4946        lwork: ::core::ffi::c_int,
4947        info: *mut ::core::ffi::c_int,
4948    ) -> cusolverStatus_t;
4949}
4950unsafe extern "C" {
4951    pub fn cusolverDnXsytrs_bufferSize(
4952        handle: cusolverDnHandle_t,
4953        uplo: cublasFillMode_t,
4954        n: i64,
4955        nrhs: i64,
4956        dataTypeA: cudaDataType,
4957        A: *const ::core::ffi::c_void,
4958        lda: i64,
4959        ipiv: *const i64,
4960        dataTypeB: cudaDataType,
4961        B: *mut ::core::ffi::c_void,
4962        ldb: i64,
4963        workspaceInBytesOnDevice: *mut size_t,
4964        workspaceInBytesOnHost: *mut size_t,
4965    ) -> cusolverStatus_t;
4966}
4967unsafe extern "C" {
4968    /// The helper functions below can calculate the sizes needed for pre-allocated buffers.
4969    ///
4970    /// The following routine:
4971    ///
4972    /// solves a system of linear equations using the generic API interface.
4973    ///
4974    /// `A` contains the factorization from `cusolverDn&lt;t>sytrf()`, only lower or upper part is meaningful, the other part is not touched.
4975    ///
4976    /// If input parameter `uplo` is [`cublasFillMode_t::CUBLAS_FILL_MODE_LOWER`], the details of the factorization are stores as:
4977    /// $$
4978    /// A = L\\*D\\*L^{T}
4979    /// $$
4980    ///
4981    /// If input parameter `uplo` is [`cublasFillMode_t::CUBLAS_FILL_MODE_UPPER`], the details of the factorization are stores as:
4982    /// $$
4983    /// A = U\\*D\\*U^{T}
4984    /// $$
4985    ///
4986    /// The user has to provide the pivot indices that can be obtained by `cusolverDn&lt;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`].
4987    /// To factorize and solve the symmetric system without pivoting, the user should set `devIpiv = NULL` when calling `cusolverDn&lt;t>sytrf` and [`cusolverDnXsytrs`].
4988    ///
4989    /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
4990    ///
4991    /// List of input arguments for [`cusolverDnXsytrs_bufferSize`] and [`cusolverDnXsytrs`]:
4992    ///
4993    /// 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:
4994    ///
4995    /// **Valid combination of data type and compute type**
4996    ///
4997    /// | **DataTypeA** | **DataTypeB** | **Meaning** |
4998    /// | --- | --- | --- |
4999    /// | `CUDA_R_32F` | `CUDA_R_32F` | `SSYTRS` |
5000    /// | `CUDA_R_64F` | `CUDA_R_64F` | `DSYTRS` |
5001    /// | `CUDA_C_32F` | `CUDA_C_32F` | `CSYTRS` |
5002    /// | `CUDA_C_64F` | `CUDA_C_64F` | `ZSYTRS` |
5003    ///
5004    /// # Parameters
5005    ///
5006    /// - `handle`: Handle to the cuSolverDN library context.
5007    /// - `uplo`: Indicates if matrix `A` lower or upper part is stored, the other part is not referenced.
5008    /// - `n`: Number of rows and columns of matrix `A`.
5009    /// - `nrhs`: Number of right-hand sides.
5010    /// - `dataTypeA`: Data type of array `A`.
5011    /// - `A`: Array of dimension `lda * n` with `lda` is not less than `max(1,n)`.
5012    /// - `lda`: Leading dimension of two-dimensional array used to store matrix `A`.
5013    /// - `dataTypeB`: Data type of array `B`.
5014    /// - `B`: Array of dimension `ldb * nrhs` with `ldb` is not less than `max(1,nrhs)`.
5015    /// - `ldb`: Leading dimension of two-dimensional array used to store matrix `B`.
5016    /// - `bufferOnDevice`: Device workspace. Array of type `void` of size `workspaceInBytesOnDevice` bytes.
5017    /// - `workspaceInBytesOnDevice`: Size in bytes of `bufferOnDevice`, returned by [`cusolverDnXsytrs_bufferSize`].
5018    /// - `bufferOnHost`: Host workspace. Array of type `void` of size `workspaceInBytesOnHost` bytes.
5019    /// - `workspaceInBytesOnHost`: Size in bytes of `bufferOnHost`, returned by [`cusolverDnXsytrs_bufferSize`].
5020    ///
5021    /// # Return value
5022    ///
5023    /// - [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]: An internal operation failed.
5024    /// - [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]: Invalid parameters were passed (`n&lt;0` or `lda&lt;max(1,n)`).
5025    /// - [`cusolverStatus_t::CUSOLVER_STATUS_MATRIX_TYPE_NOT_SUPPORTED`]: Data type is not supported.
5026    /// - [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]: The library was not initialized.
5027    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The operation completed successfully.
5028    pub fn cusolverDnXsytrs(
5029        handle: cusolverDnHandle_t,
5030        uplo: cublasFillMode_t,
5031        n: i64,
5032        nrhs: i64,
5033        dataTypeA: cudaDataType,
5034        A: *const ::core::ffi::c_void,
5035        lda: i64,
5036        ipiv: *const i64,
5037        dataTypeB: cudaDataType,
5038        B: *mut ::core::ffi::c_void,
5039        ldb: i64,
5040        bufferOnDevice: *mut ::core::ffi::c_void,
5041        workspaceInBytesOnDevice: size_t,
5042        bufferOnHost: *mut ::core::ffi::c_void,
5043        workspaceInBytesOnHost: size_t,
5044        info: *mut ::core::ffi::c_int,
5045    ) -> cusolverStatus_t;
5046}
5047unsafe extern "C" {
5048    pub fn cusolverDnSsytri_bufferSize(
5049        handle: cusolverDnHandle_t,
5050        uplo: cublasFillMode_t,
5051        n: ::core::ffi::c_int,
5052        A: *mut f32,
5053        lda: ::core::ffi::c_int,
5054        ipiv: *const ::core::ffi::c_int,
5055        lwork: *mut ::core::ffi::c_int,
5056    ) -> cusolverStatus_t;
5057}
5058unsafe extern "C" {
5059    pub fn cusolverDnDsytri_bufferSize(
5060        handle: cusolverDnHandle_t,
5061        uplo: cublasFillMode_t,
5062        n: ::core::ffi::c_int,
5063        A: *mut f64,
5064        lda: ::core::ffi::c_int,
5065        ipiv: *const ::core::ffi::c_int,
5066        lwork: *mut ::core::ffi::c_int,
5067    ) -> cusolverStatus_t;
5068}
5069unsafe extern "C" {
5070    pub fn cusolverDnCsytri_bufferSize(
5071        handle: cusolverDnHandle_t,
5072        uplo: cublasFillMode_t,
5073        n: ::core::ffi::c_int,
5074        A: *mut cuComplex,
5075        lda: ::core::ffi::c_int,
5076        ipiv: *const ::core::ffi::c_int,
5077        lwork: *mut ::core::ffi::c_int,
5078    ) -> cusolverStatus_t;
5079}
5080unsafe extern "C" {
5081    pub fn cusolverDnZsytri_bufferSize(
5082        handle: cusolverDnHandle_t,
5083        uplo: cublasFillMode_t,
5084        n: ::core::ffi::c_int,
5085        A: *mut cuDoubleComplex,
5086        lda: ::core::ffi::c_int,
5087        ipiv: *const ::core::ffi::c_int,
5088        lwork: *mut ::core::ffi::c_int,
5089    ) -> cusolverStatus_t;
5090}
5091unsafe extern "C" {
5092    pub fn cusolverDnSsytri(
5093        handle: cusolverDnHandle_t,
5094        uplo: cublasFillMode_t,
5095        n: ::core::ffi::c_int,
5096        A: *mut f32,
5097        lda: ::core::ffi::c_int,
5098        ipiv: *const ::core::ffi::c_int,
5099        work: *mut f32,
5100        lwork: ::core::ffi::c_int,
5101        info: *mut ::core::ffi::c_int,
5102    ) -> cusolverStatus_t;
5103}
5104unsafe extern "C" {
5105    pub fn cusolverDnDsytri(
5106        handle: cusolverDnHandle_t,
5107        uplo: cublasFillMode_t,
5108        n: ::core::ffi::c_int,
5109        A: *mut f64,
5110        lda: ::core::ffi::c_int,
5111        ipiv: *const ::core::ffi::c_int,
5112        work: *mut f64,
5113        lwork: ::core::ffi::c_int,
5114        info: *mut ::core::ffi::c_int,
5115    ) -> cusolverStatus_t;
5116}
5117unsafe extern "C" {
5118    pub fn cusolverDnCsytri(
5119        handle: cusolverDnHandle_t,
5120        uplo: cublasFillMode_t,
5121        n: ::core::ffi::c_int,
5122        A: *mut cuComplex,
5123        lda: ::core::ffi::c_int,
5124        ipiv: *const ::core::ffi::c_int,
5125        work: *mut cuComplex,
5126        lwork: ::core::ffi::c_int,
5127        info: *mut ::core::ffi::c_int,
5128    ) -> cusolverStatus_t;
5129}
5130unsafe extern "C" {
5131    pub fn cusolverDnZsytri(
5132        handle: cusolverDnHandle_t,
5133        uplo: cublasFillMode_t,
5134        n: ::core::ffi::c_int,
5135        A: *mut cuDoubleComplex,
5136        lda: ::core::ffi::c_int,
5137        ipiv: *const ::core::ffi::c_int,
5138        work: *mut cuDoubleComplex,
5139        lwork: ::core::ffi::c_int,
5140        info: *mut ::core::ffi::c_int,
5141    ) -> cusolverStatus_t;
5142}
5143unsafe extern "C" {
5144    pub fn cusolverDnSgebrd_bufferSize(
5145        handle: cusolverDnHandle_t,
5146        m: ::core::ffi::c_int,
5147        n: ::core::ffi::c_int,
5148        Lwork: *mut ::core::ffi::c_int,
5149    ) -> cusolverStatus_t;
5150}
5151unsafe extern "C" {
5152    pub fn cusolverDnDgebrd_bufferSize(
5153        handle: cusolverDnHandle_t,
5154        m: ::core::ffi::c_int,
5155        n: ::core::ffi::c_int,
5156        Lwork: *mut ::core::ffi::c_int,
5157    ) -> cusolverStatus_t;
5158}
5159unsafe extern "C" {
5160    pub fn cusolverDnCgebrd_bufferSize(
5161        handle: cusolverDnHandle_t,
5162        m: ::core::ffi::c_int,
5163        n: ::core::ffi::c_int,
5164        Lwork: *mut ::core::ffi::c_int,
5165    ) -> cusolverStatus_t;
5166}
5167unsafe extern "C" {
5168    pub fn cusolverDnZgebrd_bufferSize(
5169        handle: cusolverDnHandle_t,
5170        m: ::core::ffi::c_int,
5171        n: ::core::ffi::c_int,
5172        Lwork: *mut ::core::ffi::c_int,
5173    ) -> cusolverStatus_t;
5174}
5175unsafe extern "C" {
5176    /// These helper functions calculate the size of work buffers needed.
5177    ///
5178    /// The S and D data types are real valued single and double precision, respectively.
5179    ///
5180    /// The C and Z data types are complex valued single and double precision, respectively.
5181    ///
5182    /// 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$
5183    ///
5184    /// If `m>=n`, `B` is upper bidiagonal; if `m&lt;n`, `B` is lower bidiagonal.
5185    ///
5186    /// The matrix `Q` and `P` are overwritten into matrix `A` in the following sense:
5187    ///
5188    /// * 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.
5189    /// * if `m&lt;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.
5190    ///
5191    /// 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()`.
5192    ///
5193    /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
5194    ///
5195    /// Remark: `gebrd` only supports `m>=n`.
5196    pub fn cusolverDnSgebrd(
5197        handle: cusolverDnHandle_t,
5198        m: ::core::ffi::c_int,
5199        n: ::core::ffi::c_int,
5200        A: *mut f32,
5201        lda: ::core::ffi::c_int,
5202        D: *mut f32,
5203        E: *mut f32,
5204        TAUQ: *mut f32,
5205        TAUP: *mut f32,
5206        Work: *mut f32,
5207        Lwork: ::core::ffi::c_int,
5208        devInfo: *mut ::core::ffi::c_int,
5209    ) -> cusolverStatus_t;
5210}
5211unsafe extern "C" {
5212    /// These helper functions calculate the size of work buffers needed.
5213    ///
5214    /// The S and D data types are real valued single and double precision, respectively.
5215    ///
5216    /// The C and Z data types are complex valued single and double precision, respectively.
5217    ///
5218    /// 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$
5219    ///
5220    /// If `m>=n`, `B` is upper bidiagonal; if `m&lt;n`, `B` is lower bidiagonal.
5221    ///
5222    /// The matrix `Q` and `P` are overwritten into matrix `A` in the following sense:
5223    ///
5224    /// * 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.
5225    /// * if `m&lt;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.
5226    ///
5227    /// 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()`.
5228    ///
5229    /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
5230    ///
5231    /// Remark: `gebrd` only supports `m>=n`.
5232    pub fn cusolverDnDgebrd(
5233        handle: cusolverDnHandle_t,
5234        m: ::core::ffi::c_int,
5235        n: ::core::ffi::c_int,
5236        A: *mut f64,
5237        lda: ::core::ffi::c_int,
5238        D: *mut f64,
5239        E: *mut f64,
5240        TAUQ: *mut f64,
5241        TAUP: *mut f64,
5242        Work: *mut f64,
5243        Lwork: ::core::ffi::c_int,
5244        devInfo: *mut ::core::ffi::c_int,
5245    ) -> cusolverStatus_t;
5246}
5247unsafe extern "C" {
5248    /// These helper functions calculate the size of work buffers needed.
5249    ///
5250    /// The S and D data types are real valued single and double precision, respectively.
5251    ///
5252    /// The C and Z data types are complex valued single and double precision, respectively.
5253    ///
5254    /// 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$
5255    ///
5256    /// If `m>=n`, `B` is upper bidiagonal; if `m&lt;n`, `B` is lower bidiagonal.
5257    ///
5258    /// The matrix `Q` and `P` are overwritten into matrix `A` in the following sense:
5259    ///
5260    /// * 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.
5261    /// * if `m&lt;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.
5262    ///
5263    /// 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()`.
5264    ///
5265    /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
5266    ///
5267    /// Remark: `gebrd` only supports `m>=n`.
5268    pub fn cusolverDnCgebrd(
5269        handle: cusolverDnHandle_t,
5270        m: ::core::ffi::c_int,
5271        n: ::core::ffi::c_int,
5272        A: *mut cuComplex,
5273        lda: ::core::ffi::c_int,
5274        D: *mut f32,
5275        E: *mut f32,
5276        TAUQ: *mut cuComplex,
5277        TAUP: *mut cuComplex,
5278        Work: *mut cuComplex,
5279        Lwork: ::core::ffi::c_int,
5280        devInfo: *mut ::core::ffi::c_int,
5281    ) -> cusolverStatus_t;
5282}
5283unsafe extern "C" {
5284    /// These helper functions calculate the size of work buffers needed.
5285    ///
5286    /// The S and D data types are real valued single and double precision, respectively.
5287    ///
5288    /// The C and Z data types are complex valued single and double precision, respectively.
5289    ///
5290    /// 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$
5291    ///
5292    /// If `m>=n`, `B` is upper bidiagonal; if `m&lt;n`, `B` is lower bidiagonal.
5293    ///
5294    /// The matrix `Q` and `P` are overwritten into matrix `A` in the following sense:
5295    ///
5296    /// * 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.
5297    /// * if `m&lt;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.
5298    ///
5299    /// 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()`.
5300    ///
5301    /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
5302    ///
5303    /// Remark: `gebrd` only supports `m>=n`.
5304    pub fn cusolverDnZgebrd(
5305        handle: cusolverDnHandle_t,
5306        m: ::core::ffi::c_int,
5307        n: ::core::ffi::c_int,
5308        A: *mut cuDoubleComplex,
5309        lda: ::core::ffi::c_int,
5310        D: *mut f64,
5311        E: *mut f64,
5312        TAUQ: *mut cuDoubleComplex,
5313        TAUP: *mut cuDoubleComplex,
5314        Work: *mut cuDoubleComplex,
5315        Lwork: ::core::ffi::c_int,
5316        devInfo: *mut ::core::ffi::c_int,
5317    ) -> cusolverStatus_t;
5318}
5319unsafe extern "C" {
5320    pub fn cusolverDnSorgbr_bufferSize(
5321        handle: cusolverDnHandle_t,
5322        side: cublasSideMode_t,
5323        m: ::core::ffi::c_int,
5324        n: ::core::ffi::c_int,
5325        k: ::core::ffi::c_int,
5326        A: *const f32,
5327        lda: ::core::ffi::c_int,
5328        tau: *const f32,
5329        lwork: *mut ::core::ffi::c_int,
5330    ) -> cusolverStatus_t;
5331}
5332unsafe extern "C" {
5333    pub fn cusolverDnDorgbr_bufferSize(
5334        handle: cusolverDnHandle_t,
5335        side: cublasSideMode_t,
5336        m: ::core::ffi::c_int,
5337        n: ::core::ffi::c_int,
5338        k: ::core::ffi::c_int,
5339        A: *const f64,
5340        lda: ::core::ffi::c_int,
5341        tau: *const f64,
5342        lwork: *mut ::core::ffi::c_int,
5343    ) -> cusolverStatus_t;
5344}
5345unsafe extern "C" {
5346    pub fn cusolverDnCungbr_bufferSize(
5347        handle: cusolverDnHandle_t,
5348        side: cublasSideMode_t,
5349        m: ::core::ffi::c_int,
5350        n: ::core::ffi::c_int,
5351        k: ::core::ffi::c_int,
5352        A: *const cuComplex,
5353        lda: ::core::ffi::c_int,
5354        tau: *const cuComplex,
5355        lwork: *mut ::core::ffi::c_int,
5356    ) -> cusolverStatus_t;
5357}
5358unsafe extern "C" {
5359    pub fn cusolverDnZungbr_bufferSize(
5360        handle: cusolverDnHandle_t,
5361        side: cublasSideMode_t,
5362        m: ::core::ffi::c_int,
5363        n: ::core::ffi::c_int,
5364        k: ::core::ffi::c_int,
5365        A: *const cuDoubleComplex,
5366        lda: ::core::ffi::c_int,
5367        tau: *const cuDoubleComplex,
5368        lwork: *mut ::core::ffi::c_int,
5369    ) -> cusolverStatus_t;
5370}
5371unsafe extern "C" {
5372    /// These helper functions calculate the size of work buffers needed.
5373    ///
5374    /// The S and D data types are real valued single and double precision, respectively.
5375    ///
5376    /// The C and Z data types are complex valued single and double precision, respectively.
5377    ///
5378    /// 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$
5379    ///
5380    /// `Q` and `P**H` are defined as products of elementary reflectors H(i) or G(i) respectively.
5381    ///
5382    /// 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(&lt;type>) * lwork`.
5383    ///
5384    /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
5385    pub fn cusolverDnSorgbr(
5386        handle: cusolverDnHandle_t,
5387        side: cublasSideMode_t,
5388        m: ::core::ffi::c_int,
5389        n: ::core::ffi::c_int,
5390        k: ::core::ffi::c_int,
5391        A: *mut f32,
5392        lda: ::core::ffi::c_int,
5393        tau: *const f32,
5394        work: *mut f32,
5395        lwork: ::core::ffi::c_int,
5396        info: *mut ::core::ffi::c_int,
5397    ) -> cusolverStatus_t;
5398}
5399unsafe extern "C" {
5400    /// These helper functions calculate the size of work buffers needed.
5401    ///
5402    /// The S and D data types are real valued single and double precision, respectively.
5403    ///
5404    /// The C and Z data types are complex valued single and double precision, respectively.
5405    ///
5406    /// 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$
5407    ///
5408    /// `Q` and `P**H` are defined as products of elementary reflectors H(i) or G(i) respectively.
5409    ///
5410    /// 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(&lt;type>) * lwork`.
5411    ///
5412    /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
5413    pub fn cusolverDnDorgbr(
5414        handle: cusolverDnHandle_t,
5415        side: cublasSideMode_t,
5416        m: ::core::ffi::c_int,
5417        n: ::core::ffi::c_int,
5418        k: ::core::ffi::c_int,
5419        A: *mut f64,
5420        lda: ::core::ffi::c_int,
5421        tau: *const f64,
5422        work: *mut f64,
5423        lwork: ::core::ffi::c_int,
5424        info: *mut ::core::ffi::c_int,
5425    ) -> cusolverStatus_t;
5426}
5427unsafe extern "C" {
5428    pub fn cusolverDnCungbr(
5429        handle: cusolverDnHandle_t,
5430        side: cublasSideMode_t,
5431        m: ::core::ffi::c_int,
5432        n: ::core::ffi::c_int,
5433        k: ::core::ffi::c_int,
5434        A: *mut cuComplex,
5435        lda: ::core::ffi::c_int,
5436        tau: *const cuComplex,
5437        work: *mut cuComplex,
5438        lwork: ::core::ffi::c_int,
5439        info: *mut ::core::ffi::c_int,
5440    ) -> cusolverStatus_t;
5441}
5442unsafe extern "C" {
5443    pub fn cusolverDnZungbr(
5444        handle: cusolverDnHandle_t,
5445        side: cublasSideMode_t,
5446        m: ::core::ffi::c_int,
5447        n: ::core::ffi::c_int,
5448        k: ::core::ffi::c_int,
5449        A: *mut cuDoubleComplex,
5450        lda: ::core::ffi::c_int,
5451        tau: *const cuDoubleComplex,
5452        work: *mut cuDoubleComplex,
5453        lwork: ::core::ffi::c_int,
5454        info: *mut ::core::ffi::c_int,
5455    ) -> cusolverStatus_t;
5456}
5457unsafe extern "C" {
5458    pub fn cusolverDnSsytrd_bufferSize(
5459        handle: cusolverDnHandle_t,
5460        uplo: cublasFillMode_t,
5461        n: ::core::ffi::c_int,
5462        A: *const f32,
5463        lda: ::core::ffi::c_int,
5464        d: *const f32,
5465        e: *const f32,
5466        tau: *const f32,
5467        lwork: *mut ::core::ffi::c_int,
5468    ) -> cusolverStatus_t;
5469}
5470unsafe extern "C" {
5471    pub fn cusolverDnDsytrd_bufferSize(
5472        handle: cusolverDnHandle_t,
5473        uplo: cublasFillMode_t,
5474        n: ::core::ffi::c_int,
5475        A: *const f64,
5476        lda: ::core::ffi::c_int,
5477        d: *const f64,
5478        e: *const f64,
5479        tau: *const f64,
5480        lwork: *mut ::core::ffi::c_int,
5481    ) -> cusolverStatus_t;
5482}
5483unsafe extern "C" {
5484    pub fn cusolverDnChetrd_bufferSize(
5485        handle: cusolverDnHandle_t,
5486        uplo: cublasFillMode_t,
5487        n: ::core::ffi::c_int,
5488        A: *const cuComplex,
5489        lda: ::core::ffi::c_int,
5490        d: *const f32,
5491        e: *const f32,
5492        tau: *const cuComplex,
5493        lwork: *mut ::core::ffi::c_int,
5494    ) -> cusolverStatus_t;
5495}
5496unsafe extern "C" {
5497    pub fn cusolverDnZhetrd_bufferSize(
5498        handle: cusolverDnHandle_t,
5499        uplo: cublasFillMode_t,
5500        n: ::core::ffi::c_int,
5501        A: *const cuDoubleComplex,
5502        lda: ::core::ffi::c_int,
5503        d: *const f64,
5504        e: *const f64,
5505        tau: *const cuDoubleComplex,
5506        lwork: *mut ::core::ffi::c_int,
5507    ) -> cusolverStatus_t;
5508}
5509unsafe extern "C" {
5510    /// These helper functions calculate the size of work buffers needed.
5511    ///
5512    /// The S and D data types are real valued single and double precision, respectively.
5513    ///
5514    /// The C and Z data types are complex valued single and double precision, respectively.
5515    ///
5516    /// 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$
5517    ///
5518    /// 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.
5519    ///
5520    /// 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(&lt;type>) * lwork`.
5521    ///
5522    /// 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 &lt; INT32_MAX` primarily due to the current implementation constraints.
5523    pub fn cusolverDnSsytrd(
5524        handle: cusolverDnHandle_t,
5525        uplo: cublasFillMode_t,
5526        n: ::core::ffi::c_int,
5527        A: *mut f32,
5528        lda: ::core::ffi::c_int,
5529        d: *mut f32,
5530        e: *mut f32,
5531        tau: *mut f32,
5532        work: *mut f32,
5533        lwork: ::core::ffi::c_int,
5534        info: *mut ::core::ffi::c_int,
5535    ) -> cusolverStatus_t;
5536}
5537unsafe extern "C" {
5538    /// These helper functions calculate the size of work buffers needed.
5539    ///
5540    /// The S and D data types are real valued single and double precision, respectively.
5541    ///
5542    /// The C and Z data types are complex valued single and double precision, respectively.
5543    ///
5544    /// 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$
5545    ///
5546    /// 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.
5547    ///
5548    /// 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(&lt;type>) * lwork`.
5549    ///
5550    /// 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 &lt; INT32_MAX` primarily due to the current implementation constraints.
5551    pub fn cusolverDnDsytrd(
5552        handle: cusolverDnHandle_t,
5553        uplo: cublasFillMode_t,
5554        n: ::core::ffi::c_int,
5555        A: *mut f64,
5556        lda: ::core::ffi::c_int,
5557        d: *mut f64,
5558        e: *mut f64,
5559        tau: *mut f64,
5560        work: *mut f64,
5561        lwork: ::core::ffi::c_int,
5562        info: *mut ::core::ffi::c_int,
5563    ) -> cusolverStatus_t;
5564}
5565unsafe extern "C" {
5566    pub fn cusolverDnChetrd(
5567        handle: cusolverDnHandle_t,
5568        uplo: cublasFillMode_t,
5569        n: ::core::ffi::c_int,
5570        A: *mut cuComplex,
5571        lda: ::core::ffi::c_int,
5572        d: *mut f32,
5573        e: *mut f32,
5574        tau: *mut cuComplex,
5575        work: *mut cuComplex,
5576        lwork: ::core::ffi::c_int,
5577        info: *mut ::core::ffi::c_int,
5578    ) -> cusolverStatus_t;
5579}
5580unsafe extern "C" {
5581    pub fn cusolverDnZhetrd(
5582        handle: cusolverDnHandle_t,
5583        uplo: cublasFillMode_t,
5584        n: ::core::ffi::c_int,
5585        A: *mut cuDoubleComplex,
5586        lda: ::core::ffi::c_int,
5587        d: *mut f64,
5588        e: *mut f64,
5589        tau: *mut cuDoubleComplex,
5590        work: *mut cuDoubleComplex,
5591        lwork: ::core::ffi::c_int,
5592        info: *mut ::core::ffi::c_int,
5593    ) -> cusolverStatus_t;
5594}
5595unsafe extern "C" {
5596    pub fn cusolverDnSorgtr_bufferSize(
5597        handle: cusolverDnHandle_t,
5598        uplo: cublasFillMode_t,
5599        n: ::core::ffi::c_int,
5600        A: *const f32,
5601        lda: ::core::ffi::c_int,
5602        tau: *const f32,
5603        lwork: *mut ::core::ffi::c_int,
5604    ) -> cusolverStatus_t;
5605}
5606unsafe extern "C" {
5607    pub fn cusolverDnDorgtr_bufferSize(
5608        handle: cusolverDnHandle_t,
5609        uplo: cublasFillMode_t,
5610        n: ::core::ffi::c_int,
5611        A: *const f64,
5612        lda: ::core::ffi::c_int,
5613        tau: *const f64,
5614        lwork: *mut ::core::ffi::c_int,
5615    ) -> cusolverStatus_t;
5616}
5617unsafe extern "C" {
5618    pub fn cusolverDnCungtr_bufferSize(
5619        handle: cusolverDnHandle_t,
5620        uplo: cublasFillMode_t,
5621        n: ::core::ffi::c_int,
5622        A: *const cuComplex,
5623        lda: ::core::ffi::c_int,
5624        tau: *const cuComplex,
5625        lwork: *mut ::core::ffi::c_int,
5626    ) -> cusolverStatus_t;
5627}
5628unsafe extern "C" {
5629    pub fn cusolverDnZungtr_bufferSize(
5630        handle: cusolverDnHandle_t,
5631        uplo: cublasFillMode_t,
5632        n: ::core::ffi::c_int,
5633        A: *const cuDoubleComplex,
5634        lda: ::core::ffi::c_int,
5635        tau: *const cuDoubleComplex,
5636        lwork: *mut ::core::ffi::c_int,
5637    ) -> cusolverStatus_t;
5638}
5639unsafe extern "C" {
5640    /// These helper functions calculate the size of work buffers needed.
5641    ///
5642    /// The S and D data types are real valued single and double precision, respectively.
5643    ///
5644    /// The C and Z data types are complex valued single and double precision, respectively.
5645    ///
5646    /// 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`:
5647    ///
5648    /// 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(&lt;type>) * lwork`.
5649    ///
5650    /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
5651    pub fn cusolverDnSorgtr(
5652        handle: cusolverDnHandle_t,
5653        uplo: cublasFillMode_t,
5654        n: ::core::ffi::c_int,
5655        A: *mut f32,
5656        lda: ::core::ffi::c_int,
5657        tau: *const f32,
5658        work: *mut f32,
5659        lwork: ::core::ffi::c_int,
5660        info: *mut ::core::ffi::c_int,
5661    ) -> cusolverStatus_t;
5662}
5663unsafe extern "C" {
5664    /// These helper functions calculate the size of work buffers needed.
5665    ///
5666    /// The S and D data types are real valued single and double precision, respectively.
5667    ///
5668    /// The C and Z data types are complex valued single and double precision, respectively.
5669    ///
5670    /// 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`:
5671    ///
5672    /// 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(&lt;type>) * lwork`.
5673    ///
5674    /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
5675    pub fn cusolverDnDorgtr(
5676        handle: cusolverDnHandle_t,
5677        uplo: cublasFillMode_t,
5678        n: ::core::ffi::c_int,
5679        A: *mut f64,
5680        lda: ::core::ffi::c_int,
5681        tau: *const f64,
5682        work: *mut f64,
5683        lwork: ::core::ffi::c_int,
5684        info: *mut ::core::ffi::c_int,
5685    ) -> cusolverStatus_t;
5686}
5687unsafe extern "C" {
5688    pub fn cusolverDnCungtr(
5689        handle: cusolverDnHandle_t,
5690        uplo: cublasFillMode_t,
5691        n: ::core::ffi::c_int,
5692        A: *mut cuComplex,
5693        lda: ::core::ffi::c_int,
5694        tau: *const cuComplex,
5695        work: *mut cuComplex,
5696        lwork: ::core::ffi::c_int,
5697        info: *mut ::core::ffi::c_int,
5698    ) -> cusolverStatus_t;
5699}
5700unsafe extern "C" {
5701    pub fn cusolverDnZungtr(
5702        handle: cusolverDnHandle_t,
5703        uplo: cublasFillMode_t,
5704        n: ::core::ffi::c_int,
5705        A: *mut cuDoubleComplex,
5706        lda: ::core::ffi::c_int,
5707        tau: *const cuDoubleComplex,
5708        work: *mut cuDoubleComplex,
5709        lwork: ::core::ffi::c_int,
5710        info: *mut ::core::ffi::c_int,
5711    ) -> cusolverStatus_t;
5712}
5713unsafe extern "C" {
5714    pub fn cusolverDnSormtr_bufferSize(
5715        handle: cusolverDnHandle_t,
5716        side: cublasSideMode_t,
5717        uplo: cublasFillMode_t,
5718        trans: cublasOperation_t,
5719        m: ::core::ffi::c_int,
5720        n: ::core::ffi::c_int,
5721        A: *const f32,
5722        lda: ::core::ffi::c_int,
5723        tau: *const f32,
5724        C: *const f32,
5725        ldc: ::core::ffi::c_int,
5726        lwork: *mut ::core::ffi::c_int,
5727    ) -> cusolverStatus_t;
5728}
5729unsafe extern "C" {
5730    pub fn cusolverDnDormtr_bufferSize(
5731        handle: cusolverDnHandle_t,
5732        side: cublasSideMode_t,
5733        uplo: cublasFillMode_t,
5734        trans: cublasOperation_t,
5735        m: ::core::ffi::c_int,
5736        n: ::core::ffi::c_int,
5737        A: *const f64,
5738        lda: ::core::ffi::c_int,
5739        tau: *const f64,
5740        C: *const f64,
5741        ldc: ::core::ffi::c_int,
5742        lwork: *mut ::core::ffi::c_int,
5743    ) -> cusolverStatus_t;
5744}
5745unsafe extern "C" {
5746    pub fn cusolverDnCunmtr_bufferSize(
5747        handle: cusolverDnHandle_t,
5748        side: cublasSideMode_t,
5749        uplo: cublasFillMode_t,
5750        trans: cublasOperation_t,
5751        m: ::core::ffi::c_int,
5752        n: ::core::ffi::c_int,
5753        A: *const cuComplex,
5754        lda: ::core::ffi::c_int,
5755        tau: *const cuComplex,
5756        C: *const cuComplex,
5757        ldc: ::core::ffi::c_int,
5758        lwork: *mut ::core::ffi::c_int,
5759    ) -> cusolverStatus_t;
5760}
5761unsafe extern "C" {
5762    pub fn cusolverDnZunmtr_bufferSize(
5763        handle: cusolverDnHandle_t,
5764        side: cublasSideMode_t,
5765        uplo: cublasFillMode_t,
5766        trans: cublasOperation_t,
5767        m: ::core::ffi::c_int,
5768        n: ::core::ffi::c_int,
5769        A: *const cuDoubleComplex,
5770        lda: ::core::ffi::c_int,
5771        tau: *const cuDoubleComplex,
5772        C: *const cuDoubleComplex,
5773        ldc: ::core::ffi::c_int,
5774        lwork: *mut ::core::ffi::c_int,
5775    ) -> cusolverStatus_t;
5776}
5777unsafe extern "C" {
5778    /// These helper functions calculate the size of work buffers needed.
5779    ///
5780    /// The S and D data types are real valued single and double precision, respectively.
5781    ///
5782    /// The C and Z data types are complex valued single and double precision, respectively.
5783    ///
5784    /// This function overwrites $m \times n$ matrix `C` by:
5785    /// $$
5786    /// C =
5787    /// \begin{cases}
5788    /// \operatorname{op}(Q) * C & \text{if } side = \text{CUBLAS_SIDE_LEFT} \\
5789    /// C * \operatorname{op}(Q) & \text{if } side = \text{CUBLAS_SIDE_RIGHT}
5790    /// \end{cases}
5791    /// $$
5792    ///
5793    /// where `Q` is a unitary matrix formed by a sequence of elementary reflection vectors from `sytrd`.
5794    ///
5795    /// The operation on `Q` is defined by:
5796    /// $$
5797    /// \operatorname{op}(Q) =
5798    /// \begin{cases}
5799    /// Q & \text{if } transa = \text{CUBLAS_OP_N} \\
5800    /// Q^T & \text{if } transa = \text{CUBLAS_OP_T} \\
5801    /// Q^H & \text{if } transa = \text{CUBLAS_OP_C}
5802    /// \end{cases}
5803    /// $$
5804    ///
5805    /// 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(&lt;type>) * lwork`.
5806    ///
5807    /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
5808    pub fn cusolverDnSormtr(
5809        handle: cusolverDnHandle_t,
5810        side: cublasSideMode_t,
5811        uplo: cublasFillMode_t,
5812        trans: cublasOperation_t,
5813        m: ::core::ffi::c_int,
5814        n: ::core::ffi::c_int,
5815        A: *mut f32,
5816        lda: ::core::ffi::c_int,
5817        tau: *mut f32,
5818        C: *mut f32,
5819        ldc: ::core::ffi::c_int,
5820        work: *mut f32,
5821        lwork: ::core::ffi::c_int,
5822        info: *mut ::core::ffi::c_int,
5823    ) -> cusolverStatus_t;
5824}
5825unsafe extern "C" {
5826    /// These helper functions calculate the size of work buffers needed.
5827    ///
5828    /// The S and D data types are real valued single and double precision, respectively.
5829    ///
5830    /// The C and Z data types are complex valued single and double precision, respectively.
5831    ///
5832    /// This function overwrites $m \times n$ matrix `C` by:
5833    /// $$
5834    /// C =
5835    /// \begin{cases}
5836    /// \operatorname{op}(Q) * C & \text{if } side = \text{CUBLAS_SIDE_LEFT} \\
5837    /// C * \operatorname{op}(Q) & \text{if } side = \text{CUBLAS_SIDE_RIGHT}
5838    /// \end{cases}
5839    /// $$
5840    ///
5841    /// where `Q` is a unitary matrix formed by a sequence of elementary reflection vectors from `sytrd`.
5842    ///
5843    /// The operation on `Q` is defined by:
5844    /// $$
5845    /// \operatorname{op}(Q) =
5846    /// \begin{cases}
5847    /// Q & \text{if } transa = \text{CUBLAS_OP_N} \\
5848    /// Q^T & \text{if } transa = \text{CUBLAS_OP_T} \\
5849    /// Q^H & \text{if } transa = \text{CUBLAS_OP_C}
5850    /// \end{cases}
5851    /// $$
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 `ormtr_bufferSize()`. Please note that the size in bytes of the working space is equal to `sizeof(&lt;type>) * lwork`.
5854    ///
5855    /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
5856    pub fn cusolverDnDormtr(
5857        handle: cusolverDnHandle_t,
5858        side: cublasSideMode_t,
5859        uplo: cublasFillMode_t,
5860        trans: cublasOperation_t,
5861        m: ::core::ffi::c_int,
5862        n: ::core::ffi::c_int,
5863        A: *mut f64,
5864        lda: ::core::ffi::c_int,
5865        tau: *mut f64,
5866        C: *mut f64,
5867        ldc: ::core::ffi::c_int,
5868        work: *mut f64,
5869        lwork: ::core::ffi::c_int,
5870        info: *mut ::core::ffi::c_int,
5871    ) -> cusolverStatus_t;
5872}
5873unsafe extern "C" {
5874    pub fn cusolverDnCunmtr(
5875        handle: cusolverDnHandle_t,
5876        side: cublasSideMode_t,
5877        uplo: cublasFillMode_t,
5878        trans: cublasOperation_t,
5879        m: ::core::ffi::c_int,
5880        n: ::core::ffi::c_int,
5881        A: *mut cuComplex,
5882        lda: ::core::ffi::c_int,
5883        tau: *mut cuComplex,
5884        C: *mut cuComplex,
5885        ldc: ::core::ffi::c_int,
5886        work: *mut cuComplex,
5887        lwork: ::core::ffi::c_int,
5888        info: *mut ::core::ffi::c_int,
5889    ) -> cusolverStatus_t;
5890}
5891unsafe extern "C" {
5892    pub fn cusolverDnZunmtr(
5893        handle: cusolverDnHandle_t,
5894        side: cublasSideMode_t,
5895        uplo: cublasFillMode_t,
5896        trans: cublasOperation_t,
5897        m: ::core::ffi::c_int,
5898        n: ::core::ffi::c_int,
5899        A: *mut cuDoubleComplex,
5900        lda: ::core::ffi::c_int,
5901        tau: *mut cuDoubleComplex,
5902        C: *mut cuDoubleComplex,
5903        ldc: ::core::ffi::c_int,
5904        work: *mut cuDoubleComplex,
5905        lwork: ::core::ffi::c_int,
5906        info: *mut ::core::ffi::c_int,
5907    ) -> cusolverStatus_t;
5908}
5909unsafe extern "C" {
5910    pub fn cusolverDnSgesvd_bufferSize(
5911        handle: cusolverDnHandle_t,
5912        m: ::core::ffi::c_int,
5913        n: ::core::ffi::c_int,
5914        lwork: *mut ::core::ffi::c_int,
5915    ) -> cusolverStatus_t;
5916}
5917unsafe extern "C" {
5918    pub fn cusolverDnDgesvd_bufferSize(
5919        handle: cusolverDnHandle_t,
5920        m: ::core::ffi::c_int,
5921        n: ::core::ffi::c_int,
5922        lwork: *mut ::core::ffi::c_int,
5923    ) -> cusolverStatus_t;
5924}
5925unsafe extern "C" {
5926    pub fn cusolverDnCgesvd_bufferSize(
5927        handle: cusolverDnHandle_t,
5928        m: ::core::ffi::c_int,
5929        n: ::core::ffi::c_int,
5930        lwork: *mut ::core::ffi::c_int,
5931    ) -> cusolverStatus_t;
5932}
5933unsafe extern "C" {
5934    pub fn cusolverDnZgesvd_bufferSize(
5935        handle: cusolverDnHandle_t,
5936        m: ::core::ffi::c_int,
5937        n: ::core::ffi::c_int,
5938        lwork: *mut ::core::ffi::c_int,
5939    ) -> cusolverStatus_t;
5940}
5941unsafe extern "C" {
5942    /// The helper functions below can calculate the sizes needed for pre-allocated buffer.
5943    ///
5944    /// The S and D data types are real valued single and double precision, respectively.
5945    ///
5946    /// The C and Z data types are complex valued single and double precision, respectively.
5947    ///
5948    /// 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:
5949    /// $$
5950    /// A = U\\*\Sigma\\*V^{H}
5951    /// $$
5952    ///
5953    /// 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`.
5954    ///
5955    /// 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(&lt;type>) * lwork`.
5956    ///
5957    /// 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.
5958    ///
5959    /// 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.
5960    ///
5961    /// Please visit [cuSOLVER Library Samples - gesvd](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/gesvd) for a code example.
5962    ///
5963    /// Remark 1: `gesvd` only supports `m>=n`.
5964    ///
5965    /// Remark 2: the routine returns $V^{H}$, not `V`.
5966    pub fn cusolverDnSgesvd(
5967        handle: cusolverDnHandle_t,
5968        jobu: ::core::ffi::c_schar,
5969        jobvt: ::core::ffi::c_schar,
5970        m: ::core::ffi::c_int,
5971        n: ::core::ffi::c_int,
5972        A: *mut f32,
5973        lda: ::core::ffi::c_int,
5974        S: *mut f32,
5975        U: *mut f32,
5976        ldu: ::core::ffi::c_int,
5977        VT: *mut f32,
5978        ldvt: ::core::ffi::c_int,
5979        work: *mut f32,
5980        lwork: ::core::ffi::c_int,
5981        rwork: *mut f32,
5982        info: *mut ::core::ffi::c_int,
5983    ) -> cusolverStatus_t;
5984}
5985unsafe extern "C" {
5986    /// The helper functions below can calculate the sizes needed for pre-allocated buffer.
5987    ///
5988    /// The S and D data types are real valued single and double precision, respectively.
5989    ///
5990    /// The C and Z data types are complex valued single and double precision, respectively.
5991    ///
5992    /// 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:
5993    /// $$
5994    /// A = U\\*\Sigma\\*V^{H}
5995    /// $$
5996    ///
5997    /// 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`.
5998    ///
5999    /// 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(&lt;type>) * lwork`.
6000    ///
6001    /// 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.
6002    ///
6003    /// 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.
6004    ///
6005    /// Please visit [cuSOLVER Library Samples - gesvd](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/gesvd) for a code example.
6006    ///
6007    /// Remark 1: `gesvd` only supports `m>=n`.
6008    ///
6009    /// Remark 2: the routine returns $V^{H}$, not `V`.
6010    pub fn cusolverDnDgesvd(
6011        handle: cusolverDnHandle_t,
6012        jobu: ::core::ffi::c_schar,
6013        jobvt: ::core::ffi::c_schar,
6014        m: ::core::ffi::c_int,
6015        n: ::core::ffi::c_int,
6016        A: *mut f64,
6017        lda: ::core::ffi::c_int,
6018        S: *mut f64,
6019        U: *mut f64,
6020        ldu: ::core::ffi::c_int,
6021        VT: *mut f64,
6022        ldvt: ::core::ffi::c_int,
6023        work: *mut f64,
6024        lwork: ::core::ffi::c_int,
6025        rwork: *mut f64,
6026        info: *mut ::core::ffi::c_int,
6027    ) -> cusolverStatus_t;
6028}
6029unsafe extern "C" {
6030    /// The helper functions below can calculate the sizes needed for pre-allocated buffer.
6031    ///
6032    /// The S and D data types are real valued single and double precision, respectively.
6033    ///
6034    /// The C and Z data types are complex valued single and double precision, respectively.
6035    ///
6036    /// 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:
6037    /// $$
6038    /// A = U\\*\Sigma\\*V^{H}
6039    /// $$
6040    ///
6041    /// 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`.
6042    ///
6043    /// 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(&lt;type>) * lwork`.
6044    ///
6045    /// 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.
6046    ///
6047    /// 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.
6048    ///
6049    /// Please visit [cuSOLVER Library Samples - gesvd](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/gesvd) for a code example.
6050    ///
6051    /// Remark 1: `gesvd` only supports `m>=n`.
6052    ///
6053    /// Remark 2: the routine returns $V^{H}$, not `V`.
6054    pub fn cusolverDnCgesvd(
6055        handle: cusolverDnHandle_t,
6056        jobu: ::core::ffi::c_schar,
6057        jobvt: ::core::ffi::c_schar,
6058        m: ::core::ffi::c_int,
6059        n: ::core::ffi::c_int,
6060        A: *mut cuComplex,
6061        lda: ::core::ffi::c_int,
6062        S: *mut f32,
6063        U: *mut cuComplex,
6064        ldu: ::core::ffi::c_int,
6065        VT: *mut cuComplex,
6066        ldvt: ::core::ffi::c_int,
6067        work: *mut cuComplex,
6068        lwork: ::core::ffi::c_int,
6069        rwork: *mut f32,
6070        info: *mut ::core::ffi::c_int,
6071    ) -> cusolverStatus_t;
6072}
6073unsafe extern "C" {
6074    /// The helper functions below can calculate the sizes needed for pre-allocated buffer.
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 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:
6081    /// $$
6082    /// A = U\\*\Sigma\\*V^{H}
6083    /// $$
6084    ///
6085    /// 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`.
6086    ///
6087    /// 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(&lt;type>) * lwork`.
6088    ///
6089    /// 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.
6090    ///
6091    /// 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.
6092    ///
6093    /// Please visit [cuSOLVER Library Samples - gesvd](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/gesvd) for a code example.
6094    ///
6095    /// Remark 1: `gesvd` only supports `m>=n`.
6096    ///
6097    /// Remark 2: the routine returns $V^{H}$, not `V`.
6098    pub fn cusolverDnZgesvd(
6099        handle: cusolverDnHandle_t,
6100        jobu: ::core::ffi::c_schar,
6101        jobvt: ::core::ffi::c_schar,
6102        m: ::core::ffi::c_int,
6103        n: ::core::ffi::c_int,
6104        A: *mut cuDoubleComplex,
6105        lda: ::core::ffi::c_int,
6106        S: *mut f64,
6107        U: *mut cuDoubleComplex,
6108        ldu: ::core::ffi::c_int,
6109        VT: *mut cuDoubleComplex,
6110        ldvt: ::core::ffi::c_int,
6111        work: *mut cuDoubleComplex,
6112        lwork: ::core::ffi::c_int,
6113        rwork: *mut f64,
6114        info: *mut ::core::ffi::c_int,
6115    ) -> cusolverStatus_t;
6116}
6117unsafe extern "C" {
6118    pub fn cusolverDnSsyevd_bufferSize(
6119        handle: cusolverDnHandle_t,
6120        jobz: cusolverEigMode_t,
6121        uplo: cublasFillMode_t,
6122        n: ::core::ffi::c_int,
6123        A: *const f32,
6124        lda: ::core::ffi::c_int,
6125        W: *const f32,
6126        lwork: *mut ::core::ffi::c_int,
6127    ) -> cusolverStatus_t;
6128}
6129unsafe extern "C" {
6130    pub fn cusolverDnDsyevd_bufferSize(
6131        handle: cusolverDnHandle_t,
6132        jobz: cusolverEigMode_t,
6133        uplo: cublasFillMode_t,
6134        n: ::core::ffi::c_int,
6135        A: *const f64,
6136        lda: ::core::ffi::c_int,
6137        W: *const f64,
6138        lwork: *mut ::core::ffi::c_int,
6139    ) -> cusolverStatus_t;
6140}
6141unsafe extern "C" {
6142    pub fn cusolverDnCheevd_bufferSize(
6143        handle: cusolverDnHandle_t,
6144        jobz: cusolverEigMode_t,
6145        uplo: cublasFillMode_t,
6146        n: ::core::ffi::c_int,
6147        A: *const cuComplex,
6148        lda: ::core::ffi::c_int,
6149        W: *const f32,
6150        lwork: *mut ::core::ffi::c_int,
6151    ) -> cusolverStatus_t;
6152}
6153unsafe extern "C" {
6154    pub fn cusolverDnZheevd_bufferSize(
6155        handle: cusolverDnHandle_t,
6156        jobz: cusolverEigMode_t,
6157        uplo: cublasFillMode_t,
6158        n: ::core::ffi::c_int,
6159        A: *const cuDoubleComplex,
6160        lda: ::core::ffi::c_int,
6161        W: *const f64,
6162        lwork: *mut ::core::ffi::c_int,
6163    ) -> cusolverStatus_t;
6164}
6165unsafe extern "C" {
6166    /// The helper functions below can calculate the sizes needed for pre-allocated buffer.
6167    ///
6168    /// The S and D data types are real valued single and double precision, respectively.
6169    ///
6170    /// The C and Z data types are complex valued single and double precision, respectively.
6171    ///
6172    /// This function computes eigenvalues and eigenvectors of a symmetric (Hermitian) $n \times n$ matrix `A`. The standard symmetric eigenvalue problem is:
6173    /// $$
6174    /// A\\*V = V\\*\Lambda
6175    /// $$
6176    ///
6177    /// 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.
6178    ///
6179    /// 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(&lt;type>) * lwork`.
6180    ///
6181    /// 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.
6182    ///
6183    /// 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.
6184    ///
6185    /// Please visit [cuSOLVER Library Samples - syevd](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/syevd) for a code example.
6186    pub fn cusolverDnSsyevd(
6187        handle: cusolverDnHandle_t,
6188        jobz: cusolverEigMode_t,
6189        uplo: cublasFillMode_t,
6190        n: ::core::ffi::c_int,
6191        A: *mut f32,
6192        lda: ::core::ffi::c_int,
6193        W: *mut f32,
6194        work: *mut f32,
6195        lwork: ::core::ffi::c_int,
6196        info: *mut ::core::ffi::c_int,
6197    ) -> cusolverStatus_t;
6198}
6199unsafe extern "C" {
6200    /// The helper functions below can calculate the sizes needed for pre-allocated buffer.
6201    ///
6202    /// The S and D data types are real valued single and double precision, respectively.
6203    ///
6204    /// The C and Z data types are complex valued single and double precision, respectively.
6205    ///
6206    /// This function computes eigenvalues and eigenvectors of a symmetric (Hermitian) $n \times n$ matrix `A`. The standard symmetric eigenvalue problem is:
6207    /// $$
6208    /// A\\*V = V\\*\Lambda
6209    /// $$
6210    ///
6211    /// 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.
6212    ///
6213    /// 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(&lt;type>) * lwork`.
6214    ///
6215    /// 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.
6216    ///
6217    /// 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.
6218    ///
6219    /// Please visit [cuSOLVER Library Samples - syevd](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/syevd) for a code example.
6220    pub fn cusolverDnDsyevd(
6221        handle: cusolverDnHandle_t,
6222        jobz: cusolverEigMode_t,
6223        uplo: cublasFillMode_t,
6224        n: ::core::ffi::c_int,
6225        A: *mut f64,
6226        lda: ::core::ffi::c_int,
6227        W: *mut f64,
6228        work: *mut f64,
6229        lwork: ::core::ffi::c_int,
6230        info: *mut ::core::ffi::c_int,
6231    ) -> cusolverStatus_t;
6232}
6233unsafe extern "C" {
6234    pub fn cusolverDnCheevd(
6235        handle: cusolverDnHandle_t,
6236        jobz: cusolverEigMode_t,
6237        uplo: cublasFillMode_t,
6238        n: ::core::ffi::c_int,
6239        A: *mut cuComplex,
6240        lda: ::core::ffi::c_int,
6241        W: *mut f32,
6242        work: *mut cuComplex,
6243        lwork: ::core::ffi::c_int,
6244        info: *mut ::core::ffi::c_int,
6245    ) -> cusolverStatus_t;
6246}
6247unsafe extern "C" {
6248    pub fn cusolverDnZheevd(
6249        handle: cusolverDnHandle_t,
6250        jobz: cusolverEigMode_t,
6251        uplo: cublasFillMode_t,
6252        n: ::core::ffi::c_int,
6253        A: *mut cuDoubleComplex,
6254        lda: ::core::ffi::c_int,
6255        W: *mut f64,
6256        work: *mut cuDoubleComplex,
6257        lwork: ::core::ffi::c_int,
6258        info: *mut ::core::ffi::c_int,
6259    ) -> cusolverStatus_t;
6260}
6261unsafe extern "C" {
6262    pub fn cusolverDnSsyevdx_bufferSize(
6263        handle: cusolverDnHandle_t,
6264        jobz: cusolverEigMode_t,
6265        range: cusolverEigRange_t,
6266        uplo: cublasFillMode_t,
6267        n: ::core::ffi::c_int,
6268        A: *const f32,
6269        lda: ::core::ffi::c_int,
6270        vl: f32,
6271        vu: f32,
6272        il: ::core::ffi::c_int,
6273        iu: ::core::ffi::c_int,
6274        meig: *mut ::core::ffi::c_int,
6275        W: *const f32,
6276        lwork: *mut ::core::ffi::c_int,
6277    ) -> cusolverStatus_t;
6278}
6279unsafe extern "C" {
6280    pub fn cusolverDnDsyevdx_bufferSize(
6281        handle: cusolverDnHandle_t,
6282        jobz: cusolverEigMode_t,
6283        range: cusolverEigRange_t,
6284        uplo: cublasFillMode_t,
6285        n: ::core::ffi::c_int,
6286        A: *const f64,
6287        lda: ::core::ffi::c_int,
6288        vl: f64,
6289        vu: f64,
6290        il: ::core::ffi::c_int,
6291        iu: ::core::ffi::c_int,
6292        meig: *mut ::core::ffi::c_int,
6293        W: *const f64,
6294        lwork: *mut ::core::ffi::c_int,
6295    ) -> cusolverStatus_t;
6296}
6297unsafe extern "C" {
6298    pub fn cusolverDnCheevdx_bufferSize(
6299        handle: cusolverDnHandle_t,
6300        jobz: cusolverEigMode_t,
6301        range: cusolverEigRange_t,
6302        uplo: cublasFillMode_t,
6303        n: ::core::ffi::c_int,
6304        A: *const cuComplex,
6305        lda: ::core::ffi::c_int,
6306        vl: f32,
6307        vu: f32,
6308        il: ::core::ffi::c_int,
6309        iu: ::core::ffi::c_int,
6310        meig: *mut ::core::ffi::c_int,
6311        W: *const f32,
6312        lwork: *mut ::core::ffi::c_int,
6313    ) -> cusolverStatus_t;
6314}
6315unsafe extern "C" {
6316    pub fn cusolverDnZheevdx_bufferSize(
6317        handle: cusolverDnHandle_t,
6318        jobz: cusolverEigMode_t,
6319        range: cusolverEigRange_t,
6320        uplo: cublasFillMode_t,
6321        n: ::core::ffi::c_int,
6322        A: *const cuDoubleComplex,
6323        lda: ::core::ffi::c_int,
6324        vl: f64,
6325        vu: f64,
6326        il: ::core::ffi::c_int,
6327        iu: ::core::ffi::c_int,
6328        meig: *mut ::core::ffi::c_int,
6329        W: *const f64,
6330        lwork: *mut ::core::ffi::c_int,
6331    ) -> cusolverStatus_t;
6332}
6333unsafe extern "C" {
6334    /// The helper functions below can calculate the sizes needed for pre-allocated buffer.
6335    ///
6336    /// The S and D data types are real valued single and double precision, respectively.
6337    ///
6338    /// The C and Z data types are complex valued single and double precision, respectively.
6339    ///
6340    /// 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:
6341    /// $$
6342    /// A\\*V = V\\*\Lambda
6343    /// $$
6344    ///
6345    /// 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.
6346    ///
6347    /// 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(&lt;type>) * lwork`.
6348    ///
6349    /// 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.
6350    ///
6351    /// 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.
6352    ///
6353    /// Please visit [cuSOLVER Library Samples - syevdx](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/syevdx) for a code example.
6354    pub fn cusolverDnSsyevdx(
6355        handle: cusolverDnHandle_t,
6356        jobz: cusolverEigMode_t,
6357        range: cusolverEigRange_t,
6358        uplo: cublasFillMode_t,
6359        n: ::core::ffi::c_int,
6360        A: *mut f32,
6361        lda: ::core::ffi::c_int,
6362        vl: f32,
6363        vu: f32,
6364        il: ::core::ffi::c_int,
6365        iu: ::core::ffi::c_int,
6366        meig: *mut ::core::ffi::c_int,
6367        W: *mut f32,
6368        work: *mut f32,
6369        lwork: ::core::ffi::c_int,
6370        info: *mut ::core::ffi::c_int,
6371    ) -> cusolverStatus_t;
6372}
6373unsafe extern "C" {
6374    /// The helper functions below can calculate the sizes needed for pre-allocated buffer.
6375    ///
6376    /// The S and D data types are real valued single and double precision, respectively.
6377    ///
6378    /// The C and Z data types are complex valued single and double precision, respectively.
6379    ///
6380    /// 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:
6381    /// $$
6382    /// A\\*V = V\\*\Lambda
6383    /// $$
6384    ///
6385    /// 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.
6386    ///
6387    /// 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(&lt;type>) * lwork`.
6388    ///
6389    /// 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.
6390    ///
6391    /// 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.
6392    ///
6393    /// Please visit [cuSOLVER Library Samples - syevdx](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/syevdx) for a code example.
6394    pub fn cusolverDnDsyevdx(
6395        handle: cusolverDnHandle_t,
6396        jobz: cusolverEigMode_t,
6397        range: cusolverEigRange_t,
6398        uplo: cublasFillMode_t,
6399        n: ::core::ffi::c_int,
6400        A: *mut f64,
6401        lda: ::core::ffi::c_int,
6402        vl: f64,
6403        vu: f64,
6404        il: ::core::ffi::c_int,
6405        iu: ::core::ffi::c_int,
6406        meig: *mut ::core::ffi::c_int,
6407        W: *mut f64,
6408        work: *mut f64,
6409        lwork: ::core::ffi::c_int,
6410        info: *mut ::core::ffi::c_int,
6411    ) -> cusolverStatus_t;
6412}
6413unsafe extern "C" {
6414    pub fn cusolverDnCheevdx(
6415        handle: cusolverDnHandle_t,
6416        jobz: cusolverEigMode_t,
6417        range: cusolverEigRange_t,
6418        uplo: cublasFillMode_t,
6419        n: ::core::ffi::c_int,
6420        A: *mut cuComplex,
6421        lda: ::core::ffi::c_int,
6422        vl: f32,
6423        vu: f32,
6424        il: ::core::ffi::c_int,
6425        iu: ::core::ffi::c_int,
6426        meig: *mut ::core::ffi::c_int,
6427        W: *mut f32,
6428        work: *mut cuComplex,
6429        lwork: ::core::ffi::c_int,
6430        info: *mut ::core::ffi::c_int,
6431    ) -> cusolverStatus_t;
6432}
6433unsafe extern "C" {
6434    pub fn cusolverDnZheevdx(
6435        handle: cusolverDnHandle_t,
6436        jobz: cusolverEigMode_t,
6437        range: cusolverEigRange_t,
6438        uplo: cublasFillMode_t,
6439        n: ::core::ffi::c_int,
6440        A: *mut cuDoubleComplex,
6441        lda: ::core::ffi::c_int,
6442        vl: f64,
6443        vu: f64,
6444        il: ::core::ffi::c_int,
6445        iu: ::core::ffi::c_int,
6446        meig: *mut ::core::ffi::c_int,
6447        W: *mut f64,
6448        work: *mut cuDoubleComplex,
6449        lwork: ::core::ffi::c_int,
6450        info: *mut ::core::ffi::c_int,
6451    ) -> cusolverStatus_t;
6452}
6453unsafe extern "C" {
6454    pub fn cusolverDnSsygvdx_bufferSize(
6455        handle: cusolverDnHandle_t,
6456        itype: cusolverEigType_t,
6457        jobz: cusolverEigMode_t,
6458        range: cusolverEigRange_t,
6459        uplo: cublasFillMode_t,
6460        n: ::core::ffi::c_int,
6461        A: *const f32,
6462        lda: ::core::ffi::c_int,
6463        B: *const f32,
6464        ldb: ::core::ffi::c_int,
6465        vl: f32,
6466        vu: f32,
6467        il: ::core::ffi::c_int,
6468        iu: ::core::ffi::c_int,
6469        meig: *mut ::core::ffi::c_int,
6470        W: *const f32,
6471        lwork: *mut ::core::ffi::c_int,
6472    ) -> cusolverStatus_t;
6473}
6474unsafe extern "C" {
6475    pub fn cusolverDnDsygvdx_bufferSize(
6476        handle: cusolverDnHandle_t,
6477        itype: cusolverEigType_t,
6478        jobz: cusolverEigMode_t,
6479        range: cusolverEigRange_t,
6480        uplo: cublasFillMode_t,
6481        n: ::core::ffi::c_int,
6482        A: *const f64,
6483        lda: ::core::ffi::c_int,
6484        B: *const f64,
6485        ldb: ::core::ffi::c_int,
6486        vl: f64,
6487        vu: f64,
6488        il: ::core::ffi::c_int,
6489        iu: ::core::ffi::c_int,
6490        meig: *mut ::core::ffi::c_int,
6491        W: *const f64,
6492        lwork: *mut ::core::ffi::c_int,
6493    ) -> cusolverStatus_t;
6494}
6495unsafe extern "C" {
6496    pub fn cusolverDnChegvdx_bufferSize(
6497        handle: cusolverDnHandle_t,
6498        itype: cusolverEigType_t,
6499        jobz: cusolverEigMode_t,
6500        range: cusolverEigRange_t,
6501        uplo: cublasFillMode_t,
6502        n: ::core::ffi::c_int,
6503        A: *const cuComplex,
6504        lda: ::core::ffi::c_int,
6505        B: *const cuComplex,
6506        ldb: ::core::ffi::c_int,
6507        vl: f32,
6508        vu: f32,
6509        il: ::core::ffi::c_int,
6510        iu: ::core::ffi::c_int,
6511        meig: *mut ::core::ffi::c_int,
6512        W: *const f32,
6513        lwork: *mut ::core::ffi::c_int,
6514    ) -> cusolverStatus_t;
6515}
6516unsafe extern "C" {
6517    pub fn cusolverDnZhegvdx_bufferSize(
6518        handle: cusolverDnHandle_t,
6519        itype: cusolverEigType_t,
6520        jobz: cusolverEigMode_t,
6521        range: cusolverEigRange_t,
6522        uplo: cublasFillMode_t,
6523        n: ::core::ffi::c_int,
6524        A: *const cuDoubleComplex,
6525        lda: ::core::ffi::c_int,
6526        B: *const cuDoubleComplex,
6527        ldb: ::core::ffi::c_int,
6528        vl: f64,
6529        vu: f64,
6530        il: ::core::ffi::c_int,
6531        iu: ::core::ffi::c_int,
6532        meig: *mut ::core::ffi::c_int,
6533        W: *const f64,
6534        lwork: *mut ::core::ffi::c_int,
6535    ) -> cusolverStatus_t;
6536}
6537unsafe extern "C" {
6538    /// The helper functions below can calculate the sizes needed for pre-allocated buffer.
6539    ///
6540    /// The S and D data types are real valued single and double precision, respectively.
6541    ///
6542    /// The C and Z data types are complex valued single and double precision, respectively.
6543    ///
6544    /// 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:
6545    /// $$
6546    /// \operatorname{eig}(A,B) =
6547    /// \begin{cases}
6548    /// A * V = B * V * \Lambda & \text{if } itype = \text{CUSOLVER_EIG_TYPE_1} \\
6549    /// A * B * V = V * \Lambda & \text{if } itype = \text{CUSOLVER_EIG_TYPE_2} \\
6550    /// B * A * V = V * \Lambda & \text{if } itype = \text{CUSOLVER_EIG_TYPE_3}
6551    /// \end{cases}
6552    /// $$
6553    ///
6554    /// 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:
6555    /// $$
6556    /// \begin{cases}
6557    /// V^H * B * V = I & \text{if } itype = \text{CUSOLVER_EIG_TYPE_1 or CUSOLVER_EIG_TYPE_2} \\
6558    /// V^H * \operatorname{inv}(B) * V = I & \text{if } itype = \text{CUSOLVER_EIG_TYPE_3}
6559    /// \end{cases}
6560    /// $$
6561    ///
6562    /// 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(&lt;type>) * lwork`.
6563    ///
6564    /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle). If `devInfo = i` (i > 0 and i&lt;=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.
6565    ///
6566    /// 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.
6567    ///
6568    /// Please visit [cuSOLVER Library Samples - sygvdx](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/sygvdx) for a code example.
6569    pub fn cusolverDnSsygvdx(
6570        handle: cusolverDnHandle_t,
6571        itype: cusolverEigType_t,
6572        jobz: cusolverEigMode_t,
6573        range: cusolverEigRange_t,
6574        uplo: cublasFillMode_t,
6575        n: ::core::ffi::c_int,
6576        A: *mut f32,
6577        lda: ::core::ffi::c_int,
6578        B: *mut f32,
6579        ldb: ::core::ffi::c_int,
6580        vl: f32,
6581        vu: f32,
6582        il: ::core::ffi::c_int,
6583        iu: ::core::ffi::c_int,
6584        meig: *mut ::core::ffi::c_int,
6585        W: *mut f32,
6586        work: *mut f32,
6587        lwork: ::core::ffi::c_int,
6588        info: *mut ::core::ffi::c_int,
6589    ) -> cusolverStatus_t;
6590}
6591unsafe extern "C" {
6592    /// The helper functions below can calculate the sizes needed for pre-allocated buffer.
6593    ///
6594    /// The S and D data types are real valued single and double precision, respectively.
6595    ///
6596    /// The C and Z data types are complex valued single and double precision, respectively.
6597    ///
6598    /// 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:
6599    /// $$
6600    /// \operatorname{eig}(A,B) =
6601    /// \begin{cases}
6602    /// A * V = B * V * \Lambda & \text{if } itype = \text{CUSOLVER_EIG_TYPE_1} \\
6603    /// A * B * V = V * \Lambda & \text{if } itype = \text{CUSOLVER_EIG_TYPE_2} \\
6604    /// B * A * V = V * \Lambda & \text{if } itype = \text{CUSOLVER_EIG_TYPE_3}
6605    /// \end{cases}
6606    /// $$
6607    ///
6608    /// 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:
6609    /// $$
6610    /// \begin{cases}
6611    /// V^H * B * V = I & \text{if } itype = \text{CUSOLVER_EIG_TYPE_1 or CUSOLVER_EIG_TYPE_2} \\
6612    /// V^H * \operatorname{inv}(B) * V = I & \text{if } itype = \text{CUSOLVER_EIG_TYPE_3}
6613    /// \end{cases}
6614    /// $$
6615    ///
6616    /// 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(&lt;type>) * lwork`.
6617    ///
6618    /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle). If `devInfo = i` (i > 0 and i&lt;=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.
6619    ///
6620    /// 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.
6621    ///
6622    /// Please visit [cuSOLVER Library Samples - sygvdx](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/sygvdx) for a code example.
6623    pub fn cusolverDnDsygvdx(
6624        handle: cusolverDnHandle_t,
6625        itype: cusolverEigType_t,
6626        jobz: cusolverEigMode_t,
6627        range: cusolverEigRange_t,
6628        uplo: cublasFillMode_t,
6629        n: ::core::ffi::c_int,
6630        A: *mut f64,
6631        lda: ::core::ffi::c_int,
6632        B: *mut f64,
6633        ldb: ::core::ffi::c_int,
6634        vl: f64,
6635        vu: f64,
6636        il: ::core::ffi::c_int,
6637        iu: ::core::ffi::c_int,
6638        meig: *mut ::core::ffi::c_int,
6639        W: *mut f64,
6640        work: *mut f64,
6641        lwork: ::core::ffi::c_int,
6642        info: *mut ::core::ffi::c_int,
6643    ) -> cusolverStatus_t;
6644}
6645unsafe extern "C" {
6646    pub fn cusolverDnChegvdx(
6647        handle: cusolverDnHandle_t,
6648        itype: cusolverEigType_t,
6649        jobz: cusolverEigMode_t,
6650        range: cusolverEigRange_t,
6651        uplo: cublasFillMode_t,
6652        n: ::core::ffi::c_int,
6653        A: *mut cuComplex,
6654        lda: ::core::ffi::c_int,
6655        B: *mut cuComplex,
6656        ldb: ::core::ffi::c_int,
6657        vl: f32,
6658        vu: f32,
6659        il: ::core::ffi::c_int,
6660        iu: ::core::ffi::c_int,
6661        meig: *mut ::core::ffi::c_int,
6662        W: *mut f32,
6663        work: *mut cuComplex,
6664        lwork: ::core::ffi::c_int,
6665        info: *mut ::core::ffi::c_int,
6666    ) -> cusolverStatus_t;
6667}
6668unsafe extern "C" {
6669    pub fn cusolverDnZhegvdx(
6670        handle: cusolverDnHandle_t,
6671        itype: cusolverEigType_t,
6672        jobz: cusolverEigMode_t,
6673        range: cusolverEigRange_t,
6674        uplo: cublasFillMode_t,
6675        n: ::core::ffi::c_int,
6676        A: *mut cuDoubleComplex,
6677        lda: ::core::ffi::c_int,
6678        B: *mut cuDoubleComplex,
6679        ldb: ::core::ffi::c_int,
6680        vl: f64,
6681        vu: f64,
6682        il: ::core::ffi::c_int,
6683        iu: ::core::ffi::c_int,
6684        meig: *mut ::core::ffi::c_int,
6685        W: *mut f64,
6686        work: *mut cuDoubleComplex,
6687        lwork: ::core::ffi::c_int,
6688        info: *mut ::core::ffi::c_int,
6689    ) -> cusolverStatus_t;
6690}
6691unsafe extern "C" {
6692    pub fn cusolverDnSsygvd_bufferSize(
6693        handle: cusolverDnHandle_t,
6694        itype: cusolverEigType_t,
6695        jobz: cusolverEigMode_t,
6696        uplo: cublasFillMode_t,
6697        n: ::core::ffi::c_int,
6698        A: *const f32,
6699        lda: ::core::ffi::c_int,
6700        B: *const f32,
6701        ldb: ::core::ffi::c_int,
6702        W: *const f32,
6703        lwork: *mut ::core::ffi::c_int,
6704    ) -> cusolverStatus_t;
6705}
6706unsafe extern "C" {
6707    pub fn cusolverDnDsygvd_bufferSize(
6708        handle: cusolverDnHandle_t,
6709        itype: cusolverEigType_t,
6710        jobz: cusolverEigMode_t,
6711        uplo: cublasFillMode_t,
6712        n: ::core::ffi::c_int,
6713        A: *const f64,
6714        lda: ::core::ffi::c_int,
6715        B: *const f64,
6716        ldb: ::core::ffi::c_int,
6717        W: *const f64,
6718        lwork: *mut ::core::ffi::c_int,
6719    ) -> cusolverStatus_t;
6720}
6721unsafe extern "C" {
6722    pub fn cusolverDnChegvd_bufferSize(
6723        handle: cusolverDnHandle_t,
6724        itype: cusolverEigType_t,
6725        jobz: cusolverEigMode_t,
6726        uplo: cublasFillMode_t,
6727        n: ::core::ffi::c_int,
6728        A: *const cuComplex,
6729        lda: ::core::ffi::c_int,
6730        B: *const cuComplex,
6731        ldb: ::core::ffi::c_int,
6732        W: *const f32,
6733        lwork: *mut ::core::ffi::c_int,
6734    ) -> cusolverStatus_t;
6735}
6736unsafe extern "C" {
6737    pub fn cusolverDnZhegvd_bufferSize(
6738        handle: cusolverDnHandle_t,
6739        itype: cusolverEigType_t,
6740        jobz: cusolverEigMode_t,
6741        uplo: cublasFillMode_t,
6742        n: ::core::ffi::c_int,
6743        A: *const cuDoubleComplex,
6744        lda: ::core::ffi::c_int,
6745        B: *const cuDoubleComplex,
6746        ldb: ::core::ffi::c_int,
6747        W: *const f64,
6748        lwork: *mut ::core::ffi::c_int,
6749    ) -> cusolverStatus_t;
6750}
6751unsafe extern "C" {
6752    /// The helper functions below can calculate the sizes needed for pre-allocated buffer.
6753    ///
6754    /// The S and D data types are real valued single and double precision, respectively.
6755    ///
6756    /// The C and Z data types are complex valued single and double precision, respectively.
6757    ///
6758    /// This function computes eigenvalues and eigenvectors of a symmetric (Hermitian) $n \times n$ matrix-pair (`A`,`B`). The generalized symmetric-definite eigenvalue problem is:
6759    /// $$
6760    /// \operatorname{eig}(A,B) =
6761    /// \begin{cases}
6762    /// A * V = B * V * \Lambda & \text{if } itype = \text{CUSOLVER_EIG_TYPE_1} \\
6763    /// A * B * V = V * \Lambda & \text{if } itype = \text{CUSOLVER_EIG_TYPE_2} \\
6764    /// B * A * V = V * \Lambda & \text{if } itype = \text{CUSOLVER_EIG_TYPE_3}
6765    /// \end{cases}
6766    /// $$
6767    ///
6768    /// 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:
6769    /// $$
6770    /// \begin{cases}
6771    /// V^H * B * V = I & \text{if } itype = \text{CUSOLVER_EIG_TYPE_1 or CUSOLVER_EIG_TYPE_2} \\
6772    /// V^H * \operatorname{inv}(B) * V = I & \text{if } itype = \text{CUSOLVER_EIG_TYPE_3}
6773    /// \end{cases}
6774    /// $$
6775    ///
6776    /// 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(&lt;type>) * lwork`.
6777    ///
6778    /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle). If `devInfo = i` (i > 0 and i&lt;=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.
6779    ///
6780    /// 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.
6781    ///
6782    /// Please visit [cuSOLVER Library Samples - sygvd](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/sygvd) for a code example.
6783    pub fn cusolverDnSsygvd(
6784        handle: cusolverDnHandle_t,
6785        itype: cusolverEigType_t,
6786        jobz: cusolverEigMode_t,
6787        uplo: cublasFillMode_t,
6788        n: ::core::ffi::c_int,
6789        A: *mut f32,
6790        lda: ::core::ffi::c_int,
6791        B: *mut f32,
6792        ldb: ::core::ffi::c_int,
6793        W: *mut f32,
6794        work: *mut f32,
6795        lwork: ::core::ffi::c_int,
6796        info: *mut ::core::ffi::c_int,
6797    ) -> cusolverStatus_t;
6798}
6799unsafe extern "C" {
6800    /// The helper functions below can calculate the sizes needed for pre-allocated buffer.
6801    ///
6802    /// The S and D data types are real valued single and double precision, respectively.
6803    ///
6804    /// The C and Z data types are complex valued single and double precision, respectively.
6805    ///
6806    /// This function computes eigenvalues and eigenvectors of a symmetric (Hermitian) $n \times n$ matrix-pair (`A`,`B`). The generalized symmetric-definite eigenvalue problem is:
6807    /// $$
6808    /// \operatorname{eig}(A,B) =
6809    /// \begin{cases}
6810    /// A * V = B * V * \Lambda & \text{if } itype = \text{CUSOLVER_EIG_TYPE_1} \\
6811    /// A * B * V = V * \Lambda & \text{if } itype = \text{CUSOLVER_EIG_TYPE_2} \\
6812    /// B * A * V = V * \Lambda & \text{if } itype = \text{CUSOLVER_EIG_TYPE_3}
6813    /// \end{cases}
6814    /// $$
6815    ///
6816    /// 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:
6817    /// $$
6818    /// \begin{cases}
6819    /// V^H * B * V = I & \text{if } itype = \text{CUSOLVER_EIG_TYPE_1 or CUSOLVER_EIG_TYPE_2} \\
6820    /// V^H * \operatorname{inv}(B) * V = I & \text{if } itype = \text{CUSOLVER_EIG_TYPE_3}
6821    /// \end{cases}
6822    /// $$
6823    ///
6824    /// 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(&lt;type>) * lwork`.
6825    ///
6826    /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle). If `devInfo = i` (i > 0 and i&lt;=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.
6827    ///
6828    /// 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.
6829    ///
6830    /// Please visit [cuSOLVER Library Samples - sygvd](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/sygvd) for a code example.
6831    pub fn cusolverDnDsygvd(
6832        handle: cusolverDnHandle_t,
6833        itype: cusolverEigType_t,
6834        jobz: cusolverEigMode_t,
6835        uplo: cublasFillMode_t,
6836        n: ::core::ffi::c_int,
6837        A: *mut f64,
6838        lda: ::core::ffi::c_int,
6839        B: *mut f64,
6840        ldb: ::core::ffi::c_int,
6841        W: *mut f64,
6842        work: *mut f64,
6843        lwork: ::core::ffi::c_int,
6844        info: *mut ::core::ffi::c_int,
6845    ) -> cusolverStatus_t;
6846}
6847unsafe extern "C" {
6848    pub fn cusolverDnChegvd(
6849        handle: cusolverDnHandle_t,
6850        itype: cusolverEigType_t,
6851        jobz: cusolverEigMode_t,
6852        uplo: cublasFillMode_t,
6853        n: ::core::ffi::c_int,
6854        A: *mut cuComplex,
6855        lda: ::core::ffi::c_int,
6856        B: *mut cuComplex,
6857        ldb: ::core::ffi::c_int,
6858        W: *mut f32,
6859        work: *mut cuComplex,
6860        lwork: ::core::ffi::c_int,
6861        info: *mut ::core::ffi::c_int,
6862    ) -> cusolverStatus_t;
6863}
6864unsafe extern "C" {
6865    pub fn cusolverDnZhegvd(
6866        handle: cusolverDnHandle_t,
6867        itype: cusolverEigType_t,
6868        jobz: cusolverEigMode_t,
6869        uplo: cublasFillMode_t,
6870        n: ::core::ffi::c_int,
6871        A: *mut cuDoubleComplex,
6872        lda: ::core::ffi::c_int,
6873        B: *mut cuDoubleComplex,
6874        ldb: ::core::ffi::c_int,
6875        W: *mut f64,
6876        work: *mut cuDoubleComplex,
6877        lwork: ::core::ffi::c_int,
6878        info: *mut ::core::ffi::c_int,
6879    ) -> cusolverStatus_t;
6880}
6881unsafe extern "C" {
6882    pub fn cusolverDnXsygvd_bufferSize(
6883        handle: cusolverDnHandle_t,
6884        params: cusolverDnParams_t,
6885        itype: cusolverEigType_t,
6886        jobz: cusolverEigMode_t,
6887        uplo: cublasFillMode_t,
6888        n: i64,
6889        dataTypeA: cudaDataType,
6890        d_A: *const ::core::ffi::c_void,
6891        lda: i64,
6892        dataTypeB: cudaDataType,
6893        d_B: *const ::core::ffi::c_void,
6894        ldb: i64,
6895        dataTypeW: cudaDataType,
6896        d_W: *const ::core::ffi::c_void,
6897        computeType: cudaDataType,
6898        workspaceInBytesOnDevice: *mut size_t,
6899        workspaceInBytesOnHost: *mut size_t,
6900    ) -> cusolverStatus_t;
6901}
6902unsafe extern "C" {
6903    /// The helper functions below can calculate the sizes needed for pre-allocated buffer.
6904    ///
6905    /// The following routine computes all the eigenvalues, and optionally, the eigenvectors of a generalized symmetric (Hermitian) definite eigenproblem.
6906    ///
6907    /// The generalized symmetric (Hermitian) definite eigenvalue problem is:
6908    /// $$
6909    /// \operatorname{eig}(A,B) =
6910    /// \begin{cases}
6911    /// A * V = B * V * \Lambda & \text{if } itype = \text{CUSOLVER_EIG_TYPE_1} \\
6912    /// A * B * V = V * \Lambda & \text{if } itype = \text{CUSOLVER_EIG_TYPE_2} \\
6913    /// B * A * V = V * \Lambda & \text{if } itype = \text{CUSOLVER_EIG_TYPE_3}
6914    /// \end{cases}
6915    /// $$
6916    ///
6917    /// where the matrix `A` and `B` are $n \times n$; A is symmetric/Hermitian and B is symmetric/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:
6918    /// $$
6919    /// \begin{cases}
6920    /// V^H * B * V = I & \text{if } itype = \text{CUSOLVER_EIG_TYPE_1 or CUSOLVER_EIG_TYPE_2} \\
6921    /// V^H * \operatorname{inv}(B) * V = I & \text{if } itype = \text{CUSOLVER_EIG_TYPE_3}
6922    /// \end{cases}
6923    /// $$
6924    ///
6925    /// 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`].
6926    ///
6927    /// If output parameter `info = -i` (less than zero), the `i-th` parameter is wrong (not counting handle). If `info = i` (i > 0 and i&lt;=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.
6928    ///
6929    /// 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.
6930    ///
6931    /// Currently, [`cusolverDnXsygvd`] supports only the default algorithm.
6932    ///
6933    /// **Algorithms supported by cusolverDnXsygvd**
6934    ///
6935    /// |  |  |
6936    /// | --- | --- |
6937    /// | [`cusolverAlgMode_t::CUSOLVER_ALG_0`] or `NULL` | Default algorithm. |
6938    ///
6939    /// List of input arguments for [`cusolverDnXsygvd_bufferSize`] and [`cusolverDnXsygvd`]:
6940    ///
6941    /// 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.
6942    ///
6943    /// **Valid combination of data type and compute type**
6944    ///
6945    /// | **DataTypeA** | **DataTypeB** | **DataTypeW** | **ComputeType** | **Meaning** |
6946    /// | --- | --- | --- | --- | --- |
6947    /// | `CUDA_R_32F` | `CUDA_R_32F` | `CUDA_R_32F` | `CUDA_R_32F` | `SSYGVD` |
6948    /// | `CUDA_R_64F` | `CUDA_R_64F` | `CUDA_R_64F` | `CUDA_R_64F` | `DSYGVD` |
6949    /// | `CUDA_C_32F` | `CUDA_C_32F` | `CUDA_R_32F` | `CUDA_C_32F` | `CHEGVD` |
6950    /// | `CUDA_C_64F` | `CUDA_C_64F` | `CUDA_R_64F` | `CUDA_C_64F` | `ZHEGVD` |
6951    ///
6952    /// # Parameters
6953    ///
6954    /// - `handle`: Handle to the cuSolverDN library context.
6955    /// - `params`: Structure with information collected by [`cusolverDnSetAdvOptions`].
6956    /// - `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.
6957    /// - `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.
6958    /// - `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.
6959    /// - `n`: Number of rows (or columns) of matrix `A`.
6960    /// - `dataTypeA`: Data type of array `A`.
6961    /// - `lda`: Leading dimension of two-dimensional array used to store matrix `A`.
6962    /// - `dataTypeB`: Data type of array `B`.
6963    /// - `ldb`: Leading dimension of two-dimensional array used to store matrix `B`.
6964    /// - `dataTypeW`: Data type of array `W`.
6965    /// - `computeType`: Data type of computation.
6966    /// - `bufferOnDevice`: Device workspace. Array of type `void` of size `workspaceInBytesOnDevice` bytes.
6967    /// - `workspaceInBytesOnDevice`: Size in bytes of `bufferOnDevice`, returned by [`cusolverDnXsygvd_bufferSize`].
6968    /// - `bufferOnHost`: Host workspace. Array of type `void` of size `workspaceInBytesOnHost` bytes.
6969    /// - `workspaceInBytesOnHost`: Size in bytes of `bufferOnHost`, returned by [`cusolverDnXsygvd_bufferSize`].
6970    ///
6971    /// # Return value
6972    ///
6973    /// - [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]: An internal operation failed.
6974    /// - [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]: Invalid parameters were passed (`n&lt;0`, or `lda&lt;max(1,n)`, or `ldb&lt;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.
6975    /// - [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]: The library was not initialized.
6976    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The operation completed successfully.
6977    pub fn cusolverDnXsygvd(
6978        handle: cusolverDnHandle_t,
6979        params: cusolverDnParams_t,
6980        itype: cusolverEigType_t,
6981        jobz: cusolverEigMode_t,
6982        uplo: cublasFillMode_t,
6983        n: i64,
6984        dataTypeA: cudaDataType,
6985        d_A: *mut ::core::ffi::c_void,
6986        lda: i64,
6987        dataTypeB: cudaDataType,
6988        d_B: *mut ::core::ffi::c_void,
6989        ldb: i64,
6990        dataTypeW: cudaDataType,
6991        d_W: *mut ::core::ffi::c_void,
6992        computeType: cudaDataType,
6993        bufferOnDevice: *mut ::core::ffi::c_void,
6994        workspaceInBytesOnDevice: size_t,
6995        bufferOnHost: *mut ::core::ffi::c_void,
6996        workspaceInBytesOnHost: size_t,
6997        d_info: *mut ::core::ffi::c_int,
6998    ) -> cusolverStatus_t;
6999}
7000unsafe extern "C" {
7001    pub fn cusolverDnXsygvdx_bufferSize(
7002        handle: cusolverDnHandle_t,
7003        params: cusolverDnParams_t,
7004        itype: cusolverEigType_t,
7005        jobz: cusolverEigMode_t,
7006        uplo: cublasFillMode_t,
7007        n: i64,
7008        dataTypeA: cudaDataType,
7009        d_A: *const ::core::ffi::c_void,
7010        lda: i64,
7011        dataTypeB: cudaDataType,
7012        d_B: *const ::core::ffi::c_void,
7013        ldb: i64,
7014        vl: *mut ::core::ffi::c_void,
7015        vu: *mut ::core::ffi::c_void,
7016        il: i64,
7017        iu: i64,
7018        meig: *mut i64,
7019        dataTypeW: cudaDataType,
7020        d_W: *const ::core::ffi::c_void,
7021        computeType: cudaDataType,
7022        workspaceInBytesOnDevice: *mut size_t,
7023        workspaceInBytesOnHost: *mut size_t,
7024    ) -> cusolverStatus_t;
7025}
7026unsafe extern "C" {
7027    /// The helper function below can calculate the sizes needed for pre-allocated buffer.
7028    ///
7029    /// The following routine computes all or selection of the eigenvalues, and optionally, the eigenvectors of a generalized symmetric (Hermitian) definite eigenproblem.
7030    ///
7031    /// The generalized symmetric-definite eigenvalue problem is:
7032    /// $$
7033    /// \operatorname{eig}(A,B) =
7034    /// \begin{cases}
7035    /// A * V = B * V * \Lambda & \text{if } itype = \text{CUSOLVER_EIG_TYPE_1} \\
7036    /// A * B * V = V * \Lambda & \text{if } itype = \text{CUSOLVER_EIG_TYPE_2} \\
7037    /// B * A * V = V * \Lambda & \text{if } itype = \text{CUSOLVER_EIG_TYPE_3}
7038    /// \end{cases}
7039    /// $$
7040    ///
7041    /// where the matrix `A` and `B` are $n \times n$; A is symmetric/Hermitian and B is symmetric/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:
7042    /// $$
7043    /// \begin{cases}
7044    /// V^H * B * V = I & \text{if } itype = \text{CUSOLVER_EIG_TYPE_1 or CUSOLVER_EIG_TYPE_2} \\
7045    /// V^H * \operatorname{inv}(B) * V = I & \text{if } itype = \text{CUSOLVER_EIG_TYPE_3}
7046    /// \end{cases}
7047    /// $$
7048    ///
7049    /// 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`].
7050    ///
7051    /// If output parameter `info = -i` (less than zero), the `i-th` parameter is wrong (not counting handle). If `info = i` (i > 0 and i&lt;=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.
7052    ///
7053    /// 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.
7054    ///
7055    /// **Algorithms supported by cusolverDnXsygvdx**
7056    ///
7057    /// |  |  |
7058    /// | --- | --- |
7059    /// | [`cusolverAlgMode_t::CUSOLVER_ALG_0`] or `NULL` | Default algorithm. |
7060    ///
7061    /// List of input arguments for [`cusolverDnXsygvdx_bufferSize`] and [`cusolverDnXsygvdx`]:
7062    ///
7063    /// 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:
7064    ///
7065    /// **Valid combination of data type and compute type**
7066    ///
7067    /// | **DataTypeA** | **DataTypeB** | **DataTypeW** | **ComputeType** | **Meaning** |
7068    /// | --- | --- | --- | --- | --- |
7069    /// | `CUDA_R_32F` | `CUDA_R_32F` | `CUDA_R_32F` | `CUDA_R_32F` | `SSYGVDX` |
7070    /// | `CUDA_R_64F` | `CUDA_R_64F` | `CUDA_R_64F` | `CUDA_R_64F` | `DSYGVDX` |
7071    /// | `CUDA_C_32F` | `CUDA_C_32F` | `CUDA_R_32F` | `CUDA_C_32F` | `CHEGVDX` |
7072    /// | `CUDA_C_64F` | `CUDA_C_64F` | `CUDA_R_64F` | `CUDA_C_64F` | `ZHEGVDX` |
7073    ///
7074    /// # Parameters
7075    ///
7076    /// - `handle`: Handle to the cuSolverDN library context.
7077    /// - `params`: Structure with information collected by [`cusolverDnSetAdvOptions`].
7078    /// - `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.
7079    /// - `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.
7080    /// - `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;.
7081    /// - `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.
7082    /// - `n`: Number of rows (or columns) of matrix `A`.
7083    /// - `dataTypeA`: Data type of array `A`.
7084    /// - `lda`: Leading dimension of two-dimensional array used to store matrix `A`.`lda` is not less than `max(1,n)`.
7085    /// - `dataTypeB`: Data type of array `B`.
7086    /// - `ldb`: Leading dimension of two-dimensional array used to store matrix `B`.
7087    /// - `dataTypeW`: Data type of array `W`.
7088    /// - `computeType`: Data type of computation.
7089    /// - `bufferOnDevice`: Device workspace. Array of type `void` of size `workspaceInBytesOnDevice` bytes.
7090    /// - `workspaceInBytesOnDevice`: Size in bytes of `bufferOnDevice`, returned by [`cusolverDnXsygvdx_bufferSize`].
7091    /// - `bufferOnHost`: Host workspace. Array of type `void` of size `workspaceInBytesOnHost` bytes.
7092    /// - `workspaceInBytesOnHost`: Size in bytes of `bufferOnHost`, returned by [`cusolverDnXsygvdx_bufferSize`].
7093    ///
7094    /// # Return value
7095    ///
7096    /// - [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]: An internal operation failed.
7097    /// - [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]: Invalid parameters were passed (`n&lt;0`, or `lda&lt;max(1,n)`, or `ldb&lt;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.
7098    /// - [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]: The library was not initialized.
7099    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The operation completed successfully.
7100    pub fn cusolverDnXsygvdx(
7101        handle: cusolverDnHandle_t,
7102        params: cusolverDnParams_t,
7103        itype: cusolverEigType_t,
7104        jobz: cusolverEigMode_t,
7105        range: cusolverEigRange_t,
7106        uplo: cublasFillMode_t,
7107        n: i64,
7108        dataTypeA: cudaDataType,
7109        d_A: *mut ::core::ffi::c_void,
7110        lda: i64,
7111        dataTypeB: cudaDataType,
7112        d_B: *mut ::core::ffi::c_void,
7113        ldb: i64,
7114        vl: *mut ::core::ffi::c_void,
7115        vu: *mut ::core::ffi::c_void,
7116        il: i64,
7117        iu: i64,
7118        meig: *mut i64,
7119        dataTypeW: cudaDataType,
7120        d_W: *mut ::core::ffi::c_void,
7121        computeType: cudaDataType,
7122        bufferOnDevice: *mut ::core::ffi::c_void,
7123        workspaceInBytesOnDevice: size_t,
7124        bufferOnHost: *mut ::core::ffi::c_void,
7125        workspaceInBytesOnHost: size_t,
7126        d_info: *mut ::core::ffi::c_int,
7127    ) -> cusolverStatus_t;
7128}
7129unsafe extern "C" {
7130    /// This function creates and initializes the structure of `syevj`, `syevjBatched` and `sygvj` to default values.
7131    ///
7132    /// # Parameters
7133    ///
7134    /// - `info`: The pointer to the structure of `syevj`.
7135    ///
7136    /// # Return value
7137    ///
7138    /// - [`cusolverStatus_t::CUSOLVER_STATUS_ALLOC_FAILED`]: The resources could not be allocated.
7139    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The structure was initialized successfully.
7140    pub fn cusolverDnCreateSyevjInfo(info: *mut syevjInfo_t) -> cusolverStatus_t;
7141}
7142unsafe extern "C" {
7143    /// This function destroys and releases any memory required by the structure.
7144    ///
7145    /// # Parameters
7146    ///
7147    /// - `info`: The structure of `syevj`.
7148    ///
7149    /// # Return value
7150    ///
7151    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The resources were released successfully.
7152    pub fn cusolverDnDestroySyevjInfo(info: syevjInfo_t) -> cusolverStatus_t;
7153}
7154unsafe extern "C" {
7155    /// This function configures tolerance of `syevj`.
7156    ///
7157    /// # Parameters
7158    ///
7159    /// - `info`: The pointer to the structure of `syevj`.
7160    /// - `tolerance`: Accuracy of numerical eigenvalues.
7161    ///
7162    /// # Return value
7163    ///
7164    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The operation completed successfully.
7165    pub fn cusolverDnXsyevjSetTolerance(
7166        info: syevjInfo_t,
7167        tolerance: f64,
7168    ) -> cusolverStatus_t;
7169}
7170unsafe extern "C" {
7171    /// This function configures maximum number of sweeps in `syevj`. The default value is 100.
7172    ///
7173    /// # Parameters
7174    ///
7175    /// - `info`: The pointer to the structure of `syevj`.
7176    /// - `max_sweeps`: Maximum number of sweeps.
7177    ///
7178    /// # Return value
7179    ///
7180    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The operation completed successfully.
7181    pub fn cusolverDnXsyevjSetMaxSweeps(
7182        info: syevjInfo_t,
7183        max_sweeps: ::core::ffi::c_int,
7184    ) -> cusolverStatus_t;
7185}
7186unsafe extern "C" {
7187    /// 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.
7188    ///
7189    /// # Parameters
7190    ///
7191    /// - `info`: The pointer to the structure of syevj.
7192    /// - `sort_eig`: If `sort_eig` is zero, the eigenvalues are not sorted.
7193    ///
7194    /// # Return value
7195    ///
7196    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The operation completed successfully.
7197    pub fn cusolverDnXsyevjSetSortEig(
7198        info: syevjInfo_t,
7199        sort_eig: ::core::ffi::c_int,
7200    ) -> cusolverStatus_t;
7201}
7202unsafe extern "C" {
7203    /// 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.
7204    ///
7205    /// # Parameters
7206    ///
7207    /// - `handle`: Handle to the cuSolverDN library context.
7208    /// - `info`: The pointer to the structure of `syevj`.
7209    /// - `residual`: Residual of `syevj`.
7210    ///
7211    /// # Return value
7212    ///
7213    /// - [`cusolverStatus_t::CUSOLVER_STATUS_NOT_SUPPORTED`]: Does not support batched version.
7214    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The operation completed successfully.
7215    pub fn cusolverDnXsyevjGetResidual(
7216        handle: cusolverDnHandle_t,
7217        info: syevjInfo_t,
7218        residual: *mut f64,
7219    ) -> cusolverStatus_t;
7220}
7221unsafe extern "C" {
7222    /// 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.
7223    ///
7224    /// # Parameters
7225    ///
7226    /// - `handle`: Handle to the cuSolverDN library context.
7227    /// - `info`: The pointer to the structure of `syevj`.
7228    /// - `executed_sweeps`: Number of executed sweeps.
7229    ///
7230    /// # Return value
7231    ///
7232    /// - [`cusolverStatus_t::CUSOLVER_STATUS_NOT_SUPPORTED`]: Does not support batched version.
7233    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The operation completed successfully.
7234    pub fn cusolverDnXsyevjGetSweeps(
7235        handle: cusolverDnHandle_t,
7236        info: syevjInfo_t,
7237        executed_sweeps: *mut ::core::ffi::c_int,
7238    ) -> cusolverStatus_t;
7239}
7240unsafe extern "C" {
7241    pub fn cusolverDnSsyevjBatched_bufferSize(
7242        handle: cusolverDnHandle_t,
7243        jobz: cusolverEigMode_t,
7244        uplo: cublasFillMode_t,
7245        n: ::core::ffi::c_int,
7246        A: *const f32,
7247        lda: ::core::ffi::c_int,
7248        W: *const f32,
7249        lwork: *mut ::core::ffi::c_int,
7250        params: syevjInfo_t,
7251        batchSize: ::core::ffi::c_int,
7252    ) -> cusolverStatus_t;
7253}
7254unsafe extern "C" {
7255    pub fn cusolverDnDsyevjBatched_bufferSize(
7256        handle: cusolverDnHandle_t,
7257        jobz: cusolverEigMode_t,
7258        uplo: cublasFillMode_t,
7259        n: ::core::ffi::c_int,
7260        A: *const f64,
7261        lda: ::core::ffi::c_int,
7262        W: *const f64,
7263        lwork: *mut ::core::ffi::c_int,
7264        params: syevjInfo_t,
7265        batchSize: ::core::ffi::c_int,
7266    ) -> cusolverStatus_t;
7267}
7268unsafe extern "C" {
7269    pub fn cusolverDnCheevjBatched_bufferSize(
7270        handle: cusolverDnHandle_t,
7271        jobz: cusolverEigMode_t,
7272        uplo: cublasFillMode_t,
7273        n: ::core::ffi::c_int,
7274        A: *const cuComplex,
7275        lda: ::core::ffi::c_int,
7276        W: *const f32,
7277        lwork: *mut ::core::ffi::c_int,
7278        params: syevjInfo_t,
7279        batchSize: ::core::ffi::c_int,
7280    ) -> cusolverStatus_t;
7281}
7282unsafe extern "C" {
7283    pub fn cusolverDnZheevjBatched_bufferSize(
7284        handle: cusolverDnHandle_t,
7285        jobz: cusolverEigMode_t,
7286        uplo: cublasFillMode_t,
7287        n: ::core::ffi::c_int,
7288        A: *const cuDoubleComplex,
7289        lda: ::core::ffi::c_int,
7290        W: *const f64,
7291        lwork: *mut ::core::ffi::c_int,
7292        params: syevjInfo_t,
7293        batchSize: ::core::ffi::c_int,
7294    ) -> cusolverStatus_t;
7295}
7296unsafe extern "C" {
7297    /// The helper functions below can calculate the sizes needed for pre-allocated buffer.
7298    ///
7299    /// The S and D data types are real valued single and double precision, respectively.
7300    ///
7301    /// The C and Z data types are complex valued single and double precision, respectively.
7302    ///
7303    /// This function computes eigenvalues and eigenvectors of a sequence of symmetric (Hermitian) $n \times n$ matrices:
7304    /// $$
7305    /// A_{j}\\*Q_{j} = Q_{j}\\*\Lambda_{j}
7306    /// $$
7307    ///
7308    /// 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.
7309    ///
7310    /// `syevjBatched` performs `syevj` on each matrix. It requires that all matrices are of the same size `n` and are packed in contiguous way,
7311    /// $$
7312    /// \begin{split}A = \begin{pmatrix}
7313    /// {A0} & {A1} & \cdots \\\\
7314    /// \end{pmatrix}\end{split}
7315    /// $$
7316    ///
7317    /// 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}$.
7318    ///
7319    /// The parameter `W` also contains eigenvalues of each matrix in contiguous way,
7320    /// $$
7321    /// \begin{split}W = \begin{pmatrix}
7322    /// {W0} & {W1} & \cdots \\\\
7323    /// \end{pmatrix}\end{split}
7324    /// $$
7325    ///
7326    /// The formula for random access of `W` is $W_{k}\operatorname{(j)} = {W\lbrack\ j\ +\ n\\*k\rbrack}$.
7327    ///
7328    /// 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.
7329    ///
7330    /// `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.
7331    ///
7332    /// 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(&lt;type>) * lwork`.
7333    ///
7334    /// 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.
7335    ///
7336    /// If `jobz` = [`cusolverEigMode_t::CUSOLVER_EIG_MODE_VECTOR`], $A_j$ contains the orthonormal eigenvectors $V_j$.
7337    ///
7338    /// Please visit [cuSOLVER Library Samples - syevjBatched](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/syevjBatched) for a code example.
7339    pub fn cusolverDnSsyevjBatched(
7340        handle: cusolverDnHandle_t,
7341        jobz: cusolverEigMode_t,
7342        uplo: cublasFillMode_t,
7343        n: ::core::ffi::c_int,
7344        A: *mut f32,
7345        lda: ::core::ffi::c_int,
7346        W: *mut f32,
7347        work: *mut f32,
7348        lwork: ::core::ffi::c_int,
7349        info: *mut ::core::ffi::c_int,
7350        params: syevjInfo_t,
7351        batchSize: ::core::ffi::c_int,
7352    ) -> cusolverStatus_t;
7353}
7354unsafe extern "C" {
7355    /// The helper functions below can calculate the sizes needed for pre-allocated buffer.
7356    ///
7357    /// The S and D data types are real valued single and double precision, respectively.
7358    ///
7359    /// The C and Z data types are complex valued single and double precision, respectively.
7360    ///
7361    /// This function computes eigenvalues and eigenvectors of a sequence of symmetric (Hermitian) $n \times n$ matrices:
7362    /// $$
7363    /// A_{j}\\*Q_{j} = Q_{j}\\*\Lambda_{j}
7364    /// $$
7365    ///
7366    /// 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.
7367    ///
7368    /// `syevjBatched` performs `syevj` on each matrix. It requires that all matrices are of the same size `n` and are packed in contiguous way,
7369    /// $$
7370    /// \begin{split}A = \begin{pmatrix}
7371    /// {A0} & {A1} & \cdots \\\\
7372    /// \end{pmatrix}\end{split}
7373    /// $$
7374    ///
7375    /// 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}$.
7376    ///
7377    /// The parameter `W` also contains eigenvalues of each matrix in contiguous way,
7378    /// $$
7379    /// \begin{split}W = \begin{pmatrix}
7380    /// {W0} & {W1} & \cdots \\\\
7381    /// \end{pmatrix}\end{split}
7382    /// $$
7383    ///
7384    /// The formula for random access of `W` is $W_{k}\operatorname{(j)} = {W\lbrack\ j\ +\ n\\*k\rbrack}$.
7385    ///
7386    /// 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.
7387    ///
7388    /// `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.
7389    ///
7390    /// 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(&lt;type>) * lwork`.
7391    ///
7392    /// 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.
7393    ///
7394    /// If `jobz` = [`cusolverEigMode_t::CUSOLVER_EIG_MODE_VECTOR`], $A_j$ contains the orthonormal eigenvectors $V_j$.
7395    ///
7396    /// Please visit [cuSOLVER Library Samples - syevjBatched](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/syevjBatched) for a code example.
7397    pub fn cusolverDnDsyevjBatched(
7398        handle: cusolverDnHandle_t,
7399        jobz: cusolverEigMode_t,
7400        uplo: cublasFillMode_t,
7401        n: ::core::ffi::c_int,
7402        A: *mut f64,
7403        lda: ::core::ffi::c_int,
7404        W: *mut f64,
7405        work: *mut f64,
7406        lwork: ::core::ffi::c_int,
7407        info: *mut ::core::ffi::c_int,
7408        params: syevjInfo_t,
7409        batchSize: ::core::ffi::c_int,
7410    ) -> cusolverStatus_t;
7411}
7412unsafe extern "C" {
7413    pub fn cusolverDnCheevjBatched(
7414        handle: cusolverDnHandle_t,
7415        jobz: cusolverEigMode_t,
7416        uplo: cublasFillMode_t,
7417        n: ::core::ffi::c_int,
7418        A: *mut cuComplex,
7419        lda: ::core::ffi::c_int,
7420        W: *mut f32,
7421        work: *mut cuComplex,
7422        lwork: ::core::ffi::c_int,
7423        info: *mut ::core::ffi::c_int,
7424        params: syevjInfo_t,
7425        batchSize: ::core::ffi::c_int,
7426    ) -> cusolverStatus_t;
7427}
7428unsafe extern "C" {
7429    pub fn cusolverDnZheevjBatched(
7430        handle: cusolverDnHandle_t,
7431        jobz: cusolverEigMode_t,
7432        uplo: cublasFillMode_t,
7433        n: ::core::ffi::c_int,
7434        A: *mut cuDoubleComplex,
7435        lda: ::core::ffi::c_int,
7436        W: *mut f64,
7437        work: *mut cuDoubleComplex,
7438        lwork: ::core::ffi::c_int,
7439        info: *mut ::core::ffi::c_int,
7440        params: syevjInfo_t,
7441        batchSize: ::core::ffi::c_int,
7442    ) -> cusolverStatus_t;
7443}
7444unsafe extern "C" {
7445    pub fn cusolverDnSsyevj_bufferSize(
7446        handle: cusolverDnHandle_t,
7447        jobz: cusolverEigMode_t,
7448        uplo: cublasFillMode_t,
7449        n: ::core::ffi::c_int,
7450        A: *const f32,
7451        lda: ::core::ffi::c_int,
7452        W: *const f32,
7453        lwork: *mut ::core::ffi::c_int,
7454        params: syevjInfo_t,
7455    ) -> cusolverStatus_t;
7456}
7457unsafe extern "C" {
7458    pub fn cusolverDnDsyevj_bufferSize(
7459        handle: cusolverDnHandle_t,
7460        jobz: cusolverEigMode_t,
7461        uplo: cublasFillMode_t,
7462        n: ::core::ffi::c_int,
7463        A: *const f64,
7464        lda: ::core::ffi::c_int,
7465        W: *const f64,
7466        lwork: *mut ::core::ffi::c_int,
7467        params: syevjInfo_t,
7468    ) -> cusolverStatus_t;
7469}
7470unsafe extern "C" {
7471    pub fn cusolverDnCheevj_bufferSize(
7472        handle: cusolverDnHandle_t,
7473        jobz: cusolverEigMode_t,
7474        uplo: cublasFillMode_t,
7475        n: ::core::ffi::c_int,
7476        A: *const cuComplex,
7477        lda: ::core::ffi::c_int,
7478        W: *const f32,
7479        lwork: *mut ::core::ffi::c_int,
7480        params: syevjInfo_t,
7481    ) -> cusolverStatus_t;
7482}
7483unsafe extern "C" {
7484    pub fn cusolverDnZheevj_bufferSize(
7485        handle: cusolverDnHandle_t,
7486        jobz: cusolverEigMode_t,
7487        uplo: cublasFillMode_t,
7488        n: ::core::ffi::c_int,
7489        A: *const cuDoubleComplex,
7490        lda: ::core::ffi::c_int,
7491        W: *const f64,
7492        lwork: *mut ::core::ffi::c_int,
7493        params: syevjInfo_t,
7494    ) -> cusolverStatus_t;
7495}
7496unsafe extern "C" {
7497    /// The helper functions below can calculate the sizes needed for pre-allocated buffer.
7498    ///
7499    /// The S and D data types are real valued single and double precision, respectively.
7500    ///
7501    /// The C and Z data types are complex valued single and double precision, respectively.
7502    ///
7503    /// This function computes eigenvalues and eigenvectors of a symmetric (Hermitian) $n \times n$ matrix `A`. The standard symmetric eigenvalue problem is:
7504    /// $$
7505    /// A\\*Q = Q\\*\Lambda
7506    /// $$
7507    ///
7508    /// 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.
7509    ///
7510    /// `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.
7511    ///
7512    /// How does it work?
7513    ///
7514    /// `syevj` iteratively generates a sequence of unitary matrices to transform matrix `A` to the following form:
7515    /// $$
7516    /// V^{H}\\*A\\*V = W + E
7517    /// $$
7518    ///
7519    /// where `W` is diagonal and `E` is symmetric without diagonal.
7520    ///
7521    /// 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:
7522    /// $$
7523    /// {\\|E\\|}_{F}\leq\operatorname{eps}\\*{\\|A\\|}_{F}
7524    /// $$
7525    ///
7526    /// where `eps` is the given tolerance.
7527    ///
7528    /// `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.
7529    ///
7530    /// 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.
7531    ///
7532    /// 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.
7533    /// $$
7534    /// {residual}={\\|E\\|}_{F} = {{\\|}\Lambda - W{\\|}}_{F}
7535    /// $$
7536    ///
7537    /// 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(&lt;type>) * lwork`.
7538    ///
7539    /// 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.
7540    ///
7541    /// If the user sets an improper tolerance, `syevj` may not converge. For example, tolerance should not be smaller than machine accuracy.
7542    ///
7543    /// If `jobz` = [`cusolverEigMode_t::CUSOLVER_EIG_MODE_VECTOR`], `A` contains the orthonormal eigenvectors `V`.
7544    ///
7545    /// Please visit [cuSOLVER Library Samples - syevj](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/syevj) for a code example.
7546    pub fn cusolverDnSsyevj(
7547        handle: cusolverDnHandle_t,
7548        jobz: cusolverEigMode_t,
7549        uplo: cublasFillMode_t,
7550        n: ::core::ffi::c_int,
7551        A: *mut f32,
7552        lda: ::core::ffi::c_int,
7553        W: *mut f32,
7554        work: *mut f32,
7555        lwork: ::core::ffi::c_int,
7556        info: *mut ::core::ffi::c_int,
7557        params: syevjInfo_t,
7558    ) -> cusolverStatus_t;
7559}
7560unsafe extern "C" {
7561    /// The helper functions below can calculate the sizes needed for pre-allocated buffer.
7562    ///
7563    /// The S and D data types are real valued single and double precision, respectively.
7564    ///
7565    /// The C and Z data types are complex valued single and double precision, respectively.
7566    ///
7567    /// This function computes eigenvalues and eigenvectors of a symmetric (Hermitian) $n \times n$ matrix `A`. The standard symmetric eigenvalue problem is:
7568    /// $$
7569    /// A\\*Q = Q\\*\Lambda
7570    /// $$
7571    ///
7572    /// 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.
7573    ///
7574    /// `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.
7575    ///
7576    /// How does it work?
7577    ///
7578    /// `syevj` iteratively generates a sequence of unitary matrices to transform matrix `A` to the following form:
7579    /// $$
7580    /// V^{H}\\*A\\*V = W + E
7581    /// $$
7582    ///
7583    /// where `W` is diagonal and `E` is symmetric without diagonal.
7584    ///
7585    /// 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:
7586    /// $$
7587    /// {\\|E\\|}_{F}\leq\operatorname{eps}\\*{\\|A\\|}_{F}
7588    /// $$
7589    ///
7590    /// where `eps` is the given tolerance.
7591    ///
7592    /// `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.
7593    ///
7594    /// 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.
7595    ///
7596    /// 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.
7597    /// $$
7598    /// {residual}={\\|E\\|}_{F} = {{\\|}\Lambda - W{\\|}}_{F}
7599    /// $$
7600    ///
7601    /// 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(&lt;type>) * lwork`.
7602    ///
7603    /// 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.
7604    ///
7605    /// If the user sets an improper tolerance, `syevj` may not converge. For example, tolerance should not be smaller than machine accuracy.
7606    ///
7607    /// If `jobz` = [`cusolverEigMode_t::CUSOLVER_EIG_MODE_VECTOR`], `A` contains the orthonormal eigenvectors `V`.
7608    ///
7609    /// Please visit [cuSOLVER Library Samples - syevj](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/syevj) for a code example.
7610    pub fn cusolverDnDsyevj(
7611        handle: cusolverDnHandle_t,
7612        jobz: cusolverEigMode_t,
7613        uplo: cublasFillMode_t,
7614        n: ::core::ffi::c_int,
7615        A: *mut f64,
7616        lda: ::core::ffi::c_int,
7617        W: *mut f64,
7618        work: *mut f64,
7619        lwork: ::core::ffi::c_int,
7620        info: *mut ::core::ffi::c_int,
7621        params: syevjInfo_t,
7622    ) -> cusolverStatus_t;
7623}
7624unsafe extern "C" {
7625    pub fn cusolverDnCheevj(
7626        handle: cusolverDnHandle_t,
7627        jobz: cusolverEigMode_t,
7628        uplo: cublasFillMode_t,
7629        n: ::core::ffi::c_int,
7630        A: *mut cuComplex,
7631        lda: ::core::ffi::c_int,
7632        W: *mut f32,
7633        work: *mut cuComplex,
7634        lwork: ::core::ffi::c_int,
7635        info: *mut ::core::ffi::c_int,
7636        params: syevjInfo_t,
7637    ) -> cusolverStatus_t;
7638}
7639unsafe extern "C" {
7640    pub fn cusolverDnZheevj(
7641        handle: cusolverDnHandle_t,
7642        jobz: cusolverEigMode_t,
7643        uplo: cublasFillMode_t,
7644        n: ::core::ffi::c_int,
7645        A: *mut cuDoubleComplex,
7646        lda: ::core::ffi::c_int,
7647        W: *mut f64,
7648        work: *mut cuDoubleComplex,
7649        lwork: ::core::ffi::c_int,
7650        info: *mut ::core::ffi::c_int,
7651        params: syevjInfo_t,
7652    ) -> cusolverStatus_t;
7653}
7654unsafe extern "C" {
7655    pub fn cusolverDnSsygvj_bufferSize(
7656        handle: cusolverDnHandle_t,
7657        itype: cusolverEigType_t,
7658        jobz: cusolverEigMode_t,
7659        uplo: cublasFillMode_t,
7660        n: ::core::ffi::c_int,
7661        A: *const f32,
7662        lda: ::core::ffi::c_int,
7663        B: *const f32,
7664        ldb: ::core::ffi::c_int,
7665        W: *const f32,
7666        lwork: *mut ::core::ffi::c_int,
7667        params: syevjInfo_t,
7668    ) -> cusolverStatus_t;
7669}
7670unsafe extern "C" {
7671    pub fn cusolverDnDsygvj_bufferSize(
7672        handle: cusolverDnHandle_t,
7673        itype: cusolverEigType_t,
7674        jobz: cusolverEigMode_t,
7675        uplo: cublasFillMode_t,
7676        n: ::core::ffi::c_int,
7677        A: *const f64,
7678        lda: ::core::ffi::c_int,
7679        B: *const f64,
7680        ldb: ::core::ffi::c_int,
7681        W: *const f64,
7682        lwork: *mut ::core::ffi::c_int,
7683        params: syevjInfo_t,
7684    ) -> cusolverStatus_t;
7685}
7686unsafe extern "C" {
7687    pub fn cusolverDnChegvj_bufferSize(
7688        handle: cusolverDnHandle_t,
7689        itype: cusolverEigType_t,
7690        jobz: cusolverEigMode_t,
7691        uplo: cublasFillMode_t,
7692        n: ::core::ffi::c_int,
7693        A: *const cuComplex,
7694        lda: ::core::ffi::c_int,
7695        B: *const cuComplex,
7696        ldb: ::core::ffi::c_int,
7697        W: *const f32,
7698        lwork: *mut ::core::ffi::c_int,
7699        params: syevjInfo_t,
7700    ) -> cusolverStatus_t;
7701}
7702unsafe extern "C" {
7703    pub fn cusolverDnZhegvj_bufferSize(
7704        handle: cusolverDnHandle_t,
7705        itype: cusolverEigType_t,
7706        jobz: cusolverEigMode_t,
7707        uplo: cublasFillMode_t,
7708        n: ::core::ffi::c_int,
7709        A: *const cuDoubleComplex,
7710        lda: ::core::ffi::c_int,
7711        B: *const cuDoubleComplex,
7712        ldb: ::core::ffi::c_int,
7713        W: *const f64,
7714        lwork: *mut ::core::ffi::c_int,
7715        params: syevjInfo_t,
7716    ) -> cusolverStatus_t;
7717}
7718unsafe extern "C" {
7719    /// The helper functions below can calculate the sizes needed for pre-allocated buffer.
7720    ///
7721    /// The S and D data types are real valued single and double precision, respectively.
7722    ///
7723    /// The C and Z data types are complex valued single and double precision, respectively.
7724    ///
7725    /// This function computes eigenvalues and eigenvectors of a symmetric (Hermitian) $n \times n$ matrix-pair (`A`,`B`). The generalized symmetric-definite eigenvalue problem is:
7726    /// $$
7727    /// \operatorname{eig}(A,B) =
7728    /// \begin{cases}
7729    /// A * V = B * V * \Lambda & \text{if } itype = \text{CUSOLVER_EIG_TYPE_1} \\
7730    /// A * B * V = V * \Lambda & \text{if } itype = \text{CUSOLVER_EIG_TYPE_2} \\
7731    /// B * A * V = V * \Lambda & \text{if } itype = \text{CUSOLVER_EIG_TYPE_3}
7732    /// \end{cases}
7733    /// $$
7734    ///
7735    /// 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:
7736    /// $$
7737    /// \begin{cases}
7738    /// V^H * B * V = I & \text{if } itype = \text{CUSOLVER_EIG_TYPE_1 or CUSOLVER_EIG_TYPE_2} \\
7739    /// V^H * \operatorname{inv}(B) * V = I & \text{if } itype = \text{CUSOLVER_EIG_TYPE_3}
7740    /// \end{cases}
7741    /// $$
7742    ///
7743    /// 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.
7744    ///
7745    /// However the meaning of residual is different from `syevj`. `sygvj` first computes Cholesky factorization of matrix `B`,
7746    /// $$
7747    /// B = L\\*L^{H}
7748    /// $$
7749    ///
7750    /// transform the problem to standard eigenvalue problem, then calls `syevj`.
7751    ///
7752    /// For example, the standard eigenvalue problem of type I is:
7753    /// $$
7754    /// M\\*Q = Q\\*\Lambda
7755    /// $$
7756    ///
7757    /// where matrix `M` is symmetric:
7758    /// $$
7759    /// M = L^{-1}\\*A\\*L^{-H}
7760    /// $$
7761    ///
7762    /// The residual is the result of `syevj` on matrix `M`, not `A`.
7763    ///
7764    /// 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(&lt;type>) * lwork`.
7765    ///
7766    /// If output parameter `info = -i` (less than zero), the `i-th` parameter is wrong (not counting handle). If `info = i` (i > 0 and i&lt;=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.
7767    ///
7768    /// if `jobz` = [`cusolverEigMode_t::CUSOLVER_EIG_MODE_VECTOR`], `A` contains the orthogonal eigenvectors `V`.
7769    ///
7770    /// Please visit [cuSOLVER Library Samples - sygvj](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/sygvj) for a code example.
7771    pub fn cusolverDnSsygvj(
7772        handle: cusolverDnHandle_t,
7773        itype: cusolverEigType_t,
7774        jobz: cusolverEigMode_t,
7775        uplo: cublasFillMode_t,
7776        n: ::core::ffi::c_int,
7777        A: *mut f32,
7778        lda: ::core::ffi::c_int,
7779        B: *mut f32,
7780        ldb: ::core::ffi::c_int,
7781        W: *mut f32,
7782        work: *mut f32,
7783        lwork: ::core::ffi::c_int,
7784        info: *mut ::core::ffi::c_int,
7785        params: syevjInfo_t,
7786    ) -> cusolverStatus_t;
7787}
7788unsafe extern "C" {
7789    /// The helper functions below can calculate the sizes needed for pre-allocated buffer.
7790    ///
7791    /// The S and D data types are real valued single and double precision, respectively.
7792    ///
7793    /// The C and Z data types are complex valued single and double precision, respectively.
7794    ///
7795    /// This function computes eigenvalues and eigenvectors of a symmetric (Hermitian) $n \times n$ matrix-pair (`A`,`B`). The generalized symmetric-definite eigenvalue problem is:
7796    /// $$
7797    /// \operatorname{eig}(A,B) =
7798    /// \begin{cases}
7799    /// A * V = B * V * \Lambda & \text{if } itype = \text{CUSOLVER_EIG_TYPE_1} \\
7800    /// A * B * V = V * \Lambda & \text{if } itype = \text{CUSOLVER_EIG_TYPE_2} \\
7801    /// B * A * V = V * \Lambda & \text{if } itype = \text{CUSOLVER_EIG_TYPE_3}
7802    /// \end{cases}
7803    /// $$
7804    ///
7805    /// 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:
7806    /// $$
7807    /// \begin{cases}
7808    /// V^H * B * V = I & \text{if } itype = \text{CUSOLVER_EIG_TYPE_1 or CUSOLVER_EIG_TYPE_2} \\
7809    /// V^H * \operatorname{inv}(B) * V = I & \text{if } itype = \text{CUSOLVER_EIG_TYPE_3}
7810    /// \end{cases}
7811    /// $$
7812    ///
7813    /// 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.
7814    ///
7815    /// However the meaning of residual is different from `syevj`. `sygvj` first computes Cholesky factorization of matrix `B`,
7816    /// $$
7817    /// B = L\\*L^{H}
7818    /// $$
7819    ///
7820    /// transform the problem to standard eigenvalue problem, then calls `syevj`.
7821    ///
7822    /// For example, the standard eigenvalue problem of type I is:
7823    /// $$
7824    /// M\\*Q = Q\\*\Lambda
7825    /// $$
7826    ///
7827    /// where matrix `M` is symmetric:
7828    /// $$
7829    /// M = L^{-1}\\*A\\*L^{-H}
7830    /// $$
7831    ///
7832    /// The residual is the result of `syevj` on matrix `M`, not `A`.
7833    ///
7834    /// 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(&lt;type>) * lwork`.
7835    ///
7836    /// If output parameter `info = -i` (less than zero), the `i-th` parameter is wrong (not counting handle). If `info = i` (i > 0 and i&lt;=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.
7837    ///
7838    /// if `jobz` = [`cusolverEigMode_t::CUSOLVER_EIG_MODE_VECTOR`], `A` contains the orthogonal eigenvectors `V`.
7839    ///
7840    /// Please visit [cuSOLVER Library Samples - sygvj](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/sygvj) for a code example.
7841    pub fn cusolverDnDsygvj(
7842        handle: cusolverDnHandle_t,
7843        itype: cusolverEigType_t,
7844        jobz: cusolverEigMode_t,
7845        uplo: cublasFillMode_t,
7846        n: ::core::ffi::c_int,
7847        A: *mut f64,
7848        lda: ::core::ffi::c_int,
7849        B: *mut f64,
7850        ldb: ::core::ffi::c_int,
7851        W: *mut f64,
7852        work: *mut f64,
7853        lwork: ::core::ffi::c_int,
7854        info: *mut ::core::ffi::c_int,
7855        params: syevjInfo_t,
7856    ) -> cusolverStatus_t;
7857}
7858unsafe extern "C" {
7859    pub fn cusolverDnChegvj(
7860        handle: cusolverDnHandle_t,
7861        itype: cusolverEigType_t,
7862        jobz: cusolverEigMode_t,
7863        uplo: cublasFillMode_t,
7864        n: ::core::ffi::c_int,
7865        A: *mut cuComplex,
7866        lda: ::core::ffi::c_int,
7867        B: *mut cuComplex,
7868        ldb: ::core::ffi::c_int,
7869        W: *mut f32,
7870        work: *mut cuComplex,
7871        lwork: ::core::ffi::c_int,
7872        info: *mut ::core::ffi::c_int,
7873        params: syevjInfo_t,
7874    ) -> cusolverStatus_t;
7875}
7876unsafe extern "C" {
7877    pub fn cusolverDnZhegvj(
7878        handle: cusolverDnHandle_t,
7879        itype: cusolverEigType_t,
7880        jobz: cusolverEigMode_t,
7881        uplo: cublasFillMode_t,
7882        n: ::core::ffi::c_int,
7883        A: *mut cuDoubleComplex,
7884        lda: ::core::ffi::c_int,
7885        B: *mut cuDoubleComplex,
7886        ldb: ::core::ffi::c_int,
7887        W: *mut f64,
7888        work: *mut cuDoubleComplex,
7889        lwork: ::core::ffi::c_int,
7890        info: *mut ::core::ffi::c_int,
7891        params: syevjInfo_t,
7892    ) -> cusolverStatus_t;
7893}
7894unsafe extern "C" {
7895    /// This function creates and initializes the structure of `gesvdj` and `gesvdjBatched` to default values.
7896    ///
7897    /// # Parameters
7898    ///
7899    /// - `info`: The pointer to the structure of `gesvdj`.
7900    ///
7901    /// # Return value
7902    ///
7903    /// - [`cusolverStatus_t::CUSOLVER_STATUS_ALLOC_FAILED`]: The resources could not be allocated.
7904    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The structure was initialized successfully.
7905    pub fn cusolverDnCreateGesvdjInfo(info: *mut gesvdjInfo_t) -> cusolverStatus_t;
7906}
7907unsafe extern "C" {
7908    /// This function destroys and releases any memory required by the structure.
7909    ///
7910    /// # Parameters
7911    ///
7912    /// - `info`: The structure of `gesvdj`.
7913    ///
7914    /// # Return value
7915    ///
7916    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The resources were released successfully.
7917    pub fn cusolverDnDestroyGesvdjInfo(info: gesvdjInfo_t) -> cusolverStatus_t;
7918}
7919unsafe extern "C" {
7920    /// This function configures tolerance of `gesvdj`.
7921    ///
7922    /// # Parameters
7923    ///
7924    /// - `info`: The pointer to the structure of `gesvdj`.
7925    /// - `tolerance`: Accuracy of numerical singular values.
7926    ///
7927    /// # Return value
7928    ///
7929    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The operation completed successfully.
7930    pub fn cusolverDnXgesvdjSetTolerance(
7931        info: gesvdjInfo_t,
7932        tolerance: f64,
7933    ) -> cusolverStatus_t;
7934}
7935unsafe extern "C" {
7936    /// This function configures the maximum number of sweeps in `gesvdj`. The default value is 100.
7937    ///
7938    /// # Parameters
7939    ///
7940    /// - `info`: The pointer to the structure of `gesvdj`.
7941    /// - `max_sweeps`: Maximum number of sweeps.
7942    ///
7943    /// # Return value
7944    ///
7945    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The operation completed successfully.
7946    pub fn cusolverDnXgesvdjSetMaxSweeps(
7947        info: gesvdjInfo_t,
7948        max_sweeps: ::core::ffi::c_int,
7949    ) -> cusolverStatus_t;
7950}
7951unsafe extern "C" {
7952    /// 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.
7953    ///
7954    /// # Parameters
7955    ///
7956    /// - `info`: The pointer to the structure of `gesvdj`.
7957    /// - `sort_svd`: If `sort_svd` is zero, the singular values are not sorted.
7958    ///
7959    /// # Return value
7960    ///
7961    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The operation completed successfully.
7962    pub fn cusolverDnXgesvdjSetSortEig(
7963        info: gesvdjInfo_t,
7964        sort_svd: ::core::ffi::c_int,
7965    ) -> cusolverStatus_t;
7966}
7967unsafe extern "C" {
7968    /// 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:
7969    /// $$
7970    /// {\\|{S} - {U}^{H}\\*{A}\\*{V}\\|}_{F}
7971    /// $$
7972    ///
7973    /// This function does not support `gesvdjBatched`. If the user calls this function after `gesvdjBatched`, the error [`cusolverStatus_t::CUSOLVER_STATUS_NOT_SUPPORTED`] is returned.
7974    ///
7975    /// # Parameters
7976    ///
7977    /// - `handle`: Handle to the cuSolverDN library context.
7978    /// - `info`: The pointer to the structure of `gesvdj`.
7979    /// - `residual`: Residual of `gesvdj`.
7980    ///
7981    /// # Return value
7982    ///
7983    /// - [`cusolverStatus_t::CUSOLVER_STATUS_NOT_SUPPORTED`]: Does not support batched version.
7984    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The operation completed successfully.
7985    pub fn cusolverDnXgesvdjGetResidual(
7986        handle: cusolverDnHandle_t,
7987        info: gesvdjInfo_t,
7988        residual: *mut f64,
7989    ) -> cusolverStatus_t;
7990}
7991unsafe extern "C" {
7992    /// 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.
7993    ///
7994    /// # Parameters
7995    ///
7996    /// - `handle`: Handle to the cuSolverDN library context.
7997    /// - `info`: The pointer to the structure of `gesvdj`.
7998    /// - `executed_sweeps`: Number of executed sweeps.
7999    ///
8000    /// # Return value
8001    ///
8002    /// - [`cusolverStatus_t::CUSOLVER_STATUS_NOT_SUPPORTED`]: Does not support batched version.
8003    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The operation completed successfully.
8004    pub fn cusolverDnXgesvdjGetSweeps(
8005        handle: cusolverDnHandle_t,
8006        info: gesvdjInfo_t,
8007        executed_sweeps: *mut ::core::ffi::c_int,
8008    ) -> cusolverStatus_t;
8009}
8010unsafe extern "C" {
8011    pub fn cusolverDnSgesvdjBatched_bufferSize(
8012        handle: cusolverDnHandle_t,
8013        jobz: cusolverEigMode_t,
8014        m: ::core::ffi::c_int,
8015        n: ::core::ffi::c_int,
8016        A: *const f32,
8017        lda: ::core::ffi::c_int,
8018        S: *const f32,
8019        U: *const f32,
8020        ldu: ::core::ffi::c_int,
8021        V: *const f32,
8022        ldv: ::core::ffi::c_int,
8023        lwork: *mut ::core::ffi::c_int,
8024        params: gesvdjInfo_t,
8025        batchSize: ::core::ffi::c_int,
8026    ) -> cusolverStatus_t;
8027}
8028unsafe extern "C" {
8029    pub fn cusolverDnDgesvdjBatched_bufferSize(
8030        handle: cusolverDnHandle_t,
8031        jobz: cusolverEigMode_t,
8032        m: ::core::ffi::c_int,
8033        n: ::core::ffi::c_int,
8034        A: *const f64,
8035        lda: ::core::ffi::c_int,
8036        S: *const f64,
8037        U: *const f64,
8038        ldu: ::core::ffi::c_int,
8039        V: *const f64,
8040        ldv: ::core::ffi::c_int,
8041        lwork: *mut ::core::ffi::c_int,
8042        params: gesvdjInfo_t,
8043        batchSize: ::core::ffi::c_int,
8044    ) -> cusolverStatus_t;
8045}
8046unsafe extern "C" {
8047    pub fn cusolverDnCgesvdjBatched_bufferSize(
8048        handle: cusolverDnHandle_t,
8049        jobz: cusolverEigMode_t,
8050        m: ::core::ffi::c_int,
8051        n: ::core::ffi::c_int,
8052        A: *const cuComplex,
8053        lda: ::core::ffi::c_int,
8054        S: *const f32,
8055        U: *const cuComplex,
8056        ldu: ::core::ffi::c_int,
8057        V: *const cuComplex,
8058        ldv: ::core::ffi::c_int,
8059        lwork: *mut ::core::ffi::c_int,
8060        params: gesvdjInfo_t,
8061        batchSize: ::core::ffi::c_int,
8062    ) -> cusolverStatus_t;
8063}
8064unsafe extern "C" {
8065    pub fn cusolverDnZgesvdjBatched_bufferSize(
8066        handle: cusolverDnHandle_t,
8067        jobz: cusolverEigMode_t,
8068        m: ::core::ffi::c_int,
8069        n: ::core::ffi::c_int,
8070        A: *const cuDoubleComplex,
8071        lda: ::core::ffi::c_int,
8072        S: *const f64,
8073        U: *const cuDoubleComplex,
8074        ldu: ::core::ffi::c_int,
8075        V: *const cuDoubleComplex,
8076        ldv: ::core::ffi::c_int,
8077        lwork: *mut ::core::ffi::c_int,
8078        params: gesvdjInfo_t,
8079        batchSize: ::core::ffi::c_int,
8080    ) -> cusolverStatus_t;
8081}
8082unsafe extern "C" {
8083    /// The helper functions below can calculate the sizes needed for pre-allocated buffer.
8084    ///
8085    /// The S and D data types are real valued single and double precision, respectively.
8086    ///
8087    /// The C and Z data types are complex valued single and double precision, respectively.
8088    ///
8089    /// This function computes singular values and singular vectors of a sequence of general $m \times n$ matrices:
8090    /// $$
8091    /// A_{j} = U_{j}\\*\Sigma_{j}\\*V_{j}^{H}
8092    /// $$
8093    ///
8094    /// 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.
8095    ///
8096    /// `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,
8097    /// $$
8098    /// \begin{split}A = \begin{pmatrix}
8099    /// {A0} & {A1} & \cdots \\\\
8100    /// \end{pmatrix}\end{split}
8101    /// $$
8102    ///
8103    /// 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}$.
8104    ///
8105    /// The parameter `S` also contains singular values of each matrix in contiguous way,
8106    /// $$
8107    /// \begin{split}S = \begin{pmatrix}
8108    /// {S0} & {S1} & \cdots \\\\
8109    /// \end{pmatrix}\end{split}
8110    /// $$
8111    ///
8112    /// The formula for random access of `S` is $S_{k}\operatorname{(j)} = {S\lbrack\ j\ +\ min(m,n)\\*k\rbrack}$.
8113    ///
8114    /// 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.
8115    ///
8116    /// `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.
8117    ///
8118    /// 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(&lt;type>) * lwork`.
8119    ///
8120    /// 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.
8121    ///
8122    /// Please visit [cuSOLVER Library Samples - gesvdjBatched](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/gesvdjBatched) for a code example.
8123    pub fn cusolverDnSgesvdjBatched(
8124        handle: cusolverDnHandle_t,
8125        jobz: cusolverEigMode_t,
8126        m: ::core::ffi::c_int,
8127        n: ::core::ffi::c_int,
8128        A: *mut f32,
8129        lda: ::core::ffi::c_int,
8130        S: *mut f32,
8131        U: *mut f32,
8132        ldu: ::core::ffi::c_int,
8133        V: *mut f32,
8134        ldv: ::core::ffi::c_int,
8135        work: *mut f32,
8136        lwork: ::core::ffi::c_int,
8137        info: *mut ::core::ffi::c_int,
8138        params: gesvdjInfo_t,
8139        batchSize: ::core::ffi::c_int,
8140    ) -> cusolverStatus_t;
8141}
8142unsafe extern "C" {
8143    /// The helper functions below can calculate the sizes needed for pre-allocated buffer.
8144    ///
8145    /// The S and D data types are real valued single and double precision, respectively.
8146    ///
8147    /// The C and Z data types are complex valued single and double precision, respectively.
8148    ///
8149    /// This function computes singular values and singular vectors of a sequence of general $m \times n$ matrices:
8150    /// $$
8151    /// A_{j} = U_{j}\\*\Sigma_{j}\\*V_{j}^{H}
8152    /// $$
8153    ///
8154    /// 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.
8155    ///
8156    /// `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,
8157    /// $$
8158    /// \begin{split}A = \begin{pmatrix}
8159    /// {A0} & {A1} & \cdots \\\\
8160    /// \end{pmatrix}\end{split}
8161    /// $$
8162    ///
8163    /// 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}$.
8164    ///
8165    /// The parameter `S` also contains singular values of each matrix in contiguous way,
8166    /// $$
8167    /// \begin{split}S = \begin{pmatrix}
8168    /// {S0} & {S1} & \cdots \\\\
8169    /// \end{pmatrix}\end{split}
8170    /// $$
8171    ///
8172    /// The formula for random access of `S` is $S_{k}\operatorname{(j)} = {S\lbrack\ j\ +\ min(m,n)\\*k\rbrack}$.
8173    ///
8174    /// 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.
8175    ///
8176    /// `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.
8177    ///
8178    /// 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(&lt;type>) * lwork`.
8179    ///
8180    /// 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.
8181    ///
8182    /// Please visit [cuSOLVER Library Samples - gesvdjBatched](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/gesvdjBatched) for a code example.
8183    pub fn cusolverDnDgesvdjBatched(
8184        handle: cusolverDnHandle_t,
8185        jobz: cusolverEigMode_t,
8186        m: ::core::ffi::c_int,
8187        n: ::core::ffi::c_int,
8188        A: *mut f64,
8189        lda: ::core::ffi::c_int,
8190        S: *mut f64,
8191        U: *mut f64,
8192        ldu: ::core::ffi::c_int,
8193        V: *mut f64,
8194        ldv: ::core::ffi::c_int,
8195        work: *mut f64,
8196        lwork: ::core::ffi::c_int,
8197        info: *mut ::core::ffi::c_int,
8198        params: gesvdjInfo_t,
8199        batchSize: ::core::ffi::c_int,
8200    ) -> cusolverStatus_t;
8201}
8202unsafe extern "C" {
8203    /// The helper functions below can calculate the sizes needed for pre-allocated buffer.
8204    ///
8205    /// The S and D data types are real valued single and double precision, respectively.
8206    ///
8207    /// The C and Z data types are complex valued single and double precision, respectively.
8208    ///
8209    /// This function computes singular values and singular vectors of a sequence of general $m \times n$ matrices:
8210    /// $$
8211    /// A_{j} = U_{j}\\*\Sigma_{j}\\*V_{j}^{H}
8212    /// $$
8213    ///
8214    /// 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.
8215    ///
8216    /// `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,
8217    /// $$
8218    /// \begin{split}A = \begin{pmatrix}
8219    /// {A0} & {A1} & \cdots \\\\
8220    /// \end{pmatrix}\end{split}
8221    /// $$
8222    ///
8223    /// 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}$.
8224    ///
8225    /// The parameter `S` also contains singular values of each matrix in contiguous way,
8226    /// $$
8227    /// \begin{split}S = \begin{pmatrix}
8228    /// {S0} & {S1} & \cdots \\\\
8229    /// \end{pmatrix}\end{split}
8230    /// $$
8231    ///
8232    /// The formula for random access of `S` is $S_{k}\operatorname{(j)} = {S\lbrack\ j\ +\ min(m,n)\\*k\rbrack}$.
8233    ///
8234    /// 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.
8235    ///
8236    /// `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.
8237    ///
8238    /// 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(&lt;type>) * lwork`.
8239    ///
8240    /// 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.
8241    ///
8242    /// Please visit [cuSOLVER Library Samples - gesvdjBatched](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/gesvdjBatched) for a code example.
8243    pub fn cusolverDnCgesvdjBatched(
8244        handle: cusolverDnHandle_t,
8245        jobz: cusolverEigMode_t,
8246        m: ::core::ffi::c_int,
8247        n: ::core::ffi::c_int,
8248        A: *mut cuComplex,
8249        lda: ::core::ffi::c_int,
8250        S: *mut f32,
8251        U: *mut cuComplex,
8252        ldu: ::core::ffi::c_int,
8253        V: *mut cuComplex,
8254        ldv: ::core::ffi::c_int,
8255        work: *mut cuComplex,
8256        lwork: ::core::ffi::c_int,
8257        info: *mut ::core::ffi::c_int,
8258        params: gesvdjInfo_t,
8259        batchSize: ::core::ffi::c_int,
8260    ) -> cusolverStatus_t;
8261}
8262unsafe extern "C" {
8263    /// The helper functions below can calculate the sizes needed for pre-allocated buffer.
8264    ///
8265    /// The S and D data types are real valued single and double precision, respectively.
8266    ///
8267    /// The C and Z data types are complex valued single and double precision, respectively.
8268    ///
8269    /// This function computes singular values and singular vectors of a sequence of general $m \times n$ matrices:
8270    /// $$
8271    /// A_{j} = U_{j}\\*\Sigma_{j}\\*V_{j}^{H}
8272    /// $$
8273    ///
8274    /// 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.
8275    ///
8276    /// `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,
8277    /// $$
8278    /// \begin{split}A = \begin{pmatrix}
8279    /// {A0} & {A1} & \cdots \\\\
8280    /// \end{pmatrix}\end{split}
8281    /// $$
8282    ///
8283    /// 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}$.
8284    ///
8285    /// The parameter `S` also contains singular values of each matrix in contiguous way,
8286    /// $$
8287    /// \begin{split}S = \begin{pmatrix}
8288    /// {S0} & {S1} & \cdots \\\\
8289    /// \end{pmatrix}\end{split}
8290    /// $$
8291    ///
8292    /// The formula for random access of `S` is $S_{k}\operatorname{(j)} = {S\lbrack\ j\ +\ min(m,n)\\*k\rbrack}$.
8293    ///
8294    /// 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.
8295    ///
8296    /// `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.
8297    ///
8298    /// 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(&lt;type>) * lwork`.
8299    ///
8300    /// 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.
8301    ///
8302    /// Please visit [cuSOLVER Library Samples - gesvdjBatched](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/gesvdjBatched) for a code example.
8303    pub fn cusolverDnZgesvdjBatched(
8304        handle: cusolverDnHandle_t,
8305        jobz: cusolverEigMode_t,
8306        m: ::core::ffi::c_int,
8307        n: ::core::ffi::c_int,
8308        A: *mut cuDoubleComplex,
8309        lda: ::core::ffi::c_int,
8310        S: *mut f64,
8311        U: *mut cuDoubleComplex,
8312        ldu: ::core::ffi::c_int,
8313        V: *mut cuDoubleComplex,
8314        ldv: ::core::ffi::c_int,
8315        work: *mut cuDoubleComplex,
8316        lwork: ::core::ffi::c_int,
8317        info: *mut ::core::ffi::c_int,
8318        params: gesvdjInfo_t,
8319        batchSize: ::core::ffi::c_int,
8320    ) -> cusolverStatus_t;
8321}
8322unsafe extern "C" {
8323    pub fn cusolverDnSgesvdj_bufferSize(
8324        handle: cusolverDnHandle_t,
8325        jobz: cusolverEigMode_t,
8326        econ: ::core::ffi::c_int,
8327        m: ::core::ffi::c_int,
8328        n: ::core::ffi::c_int,
8329        A: *const f32,
8330        lda: ::core::ffi::c_int,
8331        S: *const f32,
8332        U: *const f32,
8333        ldu: ::core::ffi::c_int,
8334        V: *const f32,
8335        ldv: ::core::ffi::c_int,
8336        lwork: *mut ::core::ffi::c_int,
8337        params: gesvdjInfo_t,
8338    ) -> cusolverStatus_t;
8339}
8340unsafe extern "C" {
8341    pub fn cusolverDnDgesvdj_bufferSize(
8342        handle: cusolverDnHandle_t,
8343        jobz: cusolverEigMode_t,
8344        econ: ::core::ffi::c_int,
8345        m: ::core::ffi::c_int,
8346        n: ::core::ffi::c_int,
8347        A: *const f64,
8348        lda: ::core::ffi::c_int,
8349        S: *const f64,
8350        U: *const f64,
8351        ldu: ::core::ffi::c_int,
8352        V: *const f64,
8353        ldv: ::core::ffi::c_int,
8354        lwork: *mut ::core::ffi::c_int,
8355        params: gesvdjInfo_t,
8356    ) -> cusolverStatus_t;
8357}
8358unsafe extern "C" {
8359    pub fn cusolverDnCgesvdj_bufferSize(
8360        handle: cusolverDnHandle_t,
8361        jobz: cusolverEigMode_t,
8362        econ: ::core::ffi::c_int,
8363        m: ::core::ffi::c_int,
8364        n: ::core::ffi::c_int,
8365        A: *const cuComplex,
8366        lda: ::core::ffi::c_int,
8367        S: *const f32,
8368        U: *const cuComplex,
8369        ldu: ::core::ffi::c_int,
8370        V: *const cuComplex,
8371        ldv: ::core::ffi::c_int,
8372        lwork: *mut ::core::ffi::c_int,
8373        params: gesvdjInfo_t,
8374    ) -> cusolverStatus_t;
8375}
8376unsafe extern "C" {
8377    pub fn cusolverDnZgesvdj_bufferSize(
8378        handle: cusolverDnHandle_t,
8379        jobz: cusolverEigMode_t,
8380        econ: ::core::ffi::c_int,
8381        m: ::core::ffi::c_int,
8382        n: ::core::ffi::c_int,
8383        A: *const cuDoubleComplex,
8384        lda: ::core::ffi::c_int,
8385        S: *const f64,
8386        U: *const cuDoubleComplex,
8387        ldu: ::core::ffi::c_int,
8388        V: *const cuDoubleComplex,
8389        ldv: ::core::ffi::c_int,
8390        lwork: *mut ::core::ffi::c_int,
8391        params: gesvdjInfo_t,
8392    ) -> cusolverStatus_t;
8393}
8394unsafe extern "C" {
8395    /// The helper functions below can calculate the sizes needed for pre-allocated buffer.
8396    ///
8397    /// The S and D data types are real valued single and double precision, respectively.
8398    ///
8399    /// The C and Z data types are complex valued single and double precision, respectively.
8400    ///
8401    /// 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:
8402    /// $$
8403    /// A = U\\*\Sigma\\*V^{H}
8404    /// $$
8405    ///
8406    /// 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`.
8407    ///
8408    /// `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.
8409    ///
8410    /// `gesvdj` iteratively generates a sequence of unitary matrices to transform matrix `A` to the following form:
8411    /// $$
8412    /// U^{H}\\*A\\*V = S + E
8413    /// $$
8414    ///
8415    /// where `S` is diagonal and diagonal of `E` is zero.
8416    ///
8417    /// 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:
8418    /// $$
8419    /// {\\|E\\|}_{F}\leq\operatorname{eps}\\*{\\|A\\|}_{F}
8420    /// $$
8421    ///
8422    /// where `eps` is given tolerance. Note that if the real residual norm:
8423    /// $$
8424    /// {\\|{S} - {U}^{H}\\*{A}\\*{V}\\|}_{F}
8425    /// $$
8426    ///
8427    /// 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:
8428    /// $$
8429    /// \frac{\\|S - U^{H} \\* A \\* V\\|_F}{O(N) \\* \\|A\\|_F} \leq \frac{\\|E\\|_F}{\\|A\\|_F} \leq \operatorname{eps}
8430    /// $$
8431    ///
8432    /// $O(N)$ is typically $N$, but the constant depends on the number of sweeps, which gives an upper roundoff error bound of $sweeps \\* N$.
8433    ///
8434    /// `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.
8435    ///
8436    /// 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.
8437    ///
8438    /// 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(&lt;type>) * lwork`.
8439    ///
8440    /// 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.
8441    ///
8442    /// If the user sets an improper tolerance, `gesvdj` may not converge. For example, tolerance should not be smaller than machine accuracy.
8443    ///
8444    /// Please visit [cuSOLVER Library Samples - gesvdj](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/gesvdj) for a code example.
8445    ///
8446    /// Remark 1: `gesvdj` supports any combination of `m` and `n`.
8447    ///
8448    /// Remark 2: the routine returns `V`, not $V^{H}$. This is different from `gesvd`.
8449    pub fn cusolverDnSgesvdj(
8450        handle: cusolverDnHandle_t,
8451        jobz: cusolverEigMode_t,
8452        econ: ::core::ffi::c_int,
8453        m: ::core::ffi::c_int,
8454        n: ::core::ffi::c_int,
8455        A: *mut f32,
8456        lda: ::core::ffi::c_int,
8457        S: *mut f32,
8458        U: *mut f32,
8459        ldu: ::core::ffi::c_int,
8460        V: *mut f32,
8461        ldv: ::core::ffi::c_int,
8462        work: *mut f32,
8463        lwork: ::core::ffi::c_int,
8464        info: *mut ::core::ffi::c_int,
8465        params: gesvdjInfo_t,
8466    ) -> cusolverStatus_t;
8467}
8468unsafe extern "C" {
8469    /// The helper functions below can calculate the sizes needed for pre-allocated buffer.
8470    ///
8471    /// The S and D data types are real valued single and double precision, respectively.
8472    ///
8473    /// The C and Z data types are complex valued single and double precision, respectively.
8474    ///
8475    /// 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:
8476    /// $$
8477    /// A = U\\*\Sigma\\*V^{H}
8478    /// $$
8479    ///
8480    /// 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`.
8481    ///
8482    /// `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.
8483    ///
8484    /// `gesvdj` iteratively generates a sequence of unitary matrices to transform matrix `A` to the following form:
8485    /// $$
8486    /// U^{H}\\*A\\*V = S + E
8487    /// $$
8488    ///
8489    /// where `S` is diagonal and diagonal of `E` is zero.
8490    ///
8491    /// 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:
8492    /// $$
8493    /// {\\|E\\|}_{F}\leq\operatorname{eps}\\*{\\|A\\|}_{F}
8494    /// $$
8495    ///
8496    /// where `eps` is given tolerance. Note that if the real residual norm:
8497    /// $$
8498    /// {\\|{S} - {U}^{H}\\*{A}\\*{V}\\|}_{F}
8499    /// $$
8500    ///
8501    /// 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:
8502    /// $$
8503    /// \frac{\\|S - U^{H} \\* A \\* V\\|_F}{O(N) \\* \\|A\\|_F} \leq \frac{\\|E\\|_F}{\\|A\\|_F} \leq \operatorname{eps}
8504    /// $$
8505    ///
8506    /// $O(N)$ is typically $N$, but the constant depends on the number of sweeps, which gives an upper roundoff error bound of $sweeps \\* N$.
8507    ///
8508    /// `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.
8509    ///
8510    /// 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.
8511    ///
8512    /// 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(&lt;type>) * lwork`.
8513    ///
8514    /// 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.
8515    ///
8516    /// If the user sets an improper tolerance, `gesvdj` may not converge. For example, tolerance should not be smaller than machine accuracy.
8517    ///
8518    /// Please visit [cuSOLVER Library Samples - gesvdj](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/gesvdj) for a code example.
8519    ///
8520    /// Remark 1: `gesvdj` supports any combination of `m` and `n`.
8521    ///
8522    /// Remark 2: the routine returns `V`, not $V^{H}$. This is different from `gesvd`.
8523    pub fn cusolverDnDgesvdj(
8524        handle: cusolverDnHandle_t,
8525        jobz: cusolverEigMode_t,
8526        econ: ::core::ffi::c_int,
8527        m: ::core::ffi::c_int,
8528        n: ::core::ffi::c_int,
8529        A: *mut f64,
8530        lda: ::core::ffi::c_int,
8531        S: *mut f64,
8532        U: *mut f64,
8533        ldu: ::core::ffi::c_int,
8534        V: *mut f64,
8535        ldv: ::core::ffi::c_int,
8536        work: *mut f64,
8537        lwork: ::core::ffi::c_int,
8538        info: *mut ::core::ffi::c_int,
8539        params: gesvdjInfo_t,
8540    ) -> cusolverStatus_t;
8541}
8542unsafe extern "C" {
8543    /// The helper functions below can calculate the sizes needed for pre-allocated buffer.
8544    ///
8545    /// The S and D data types are real valued single and double precision, respectively.
8546    ///
8547    /// The C and Z data types are complex valued single and double precision, respectively.
8548    ///
8549    /// 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:
8550    /// $$
8551    /// A = U\\*\Sigma\\*V^{H}
8552    /// $$
8553    ///
8554    /// 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`.
8555    ///
8556    /// `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.
8557    ///
8558    /// `gesvdj` iteratively generates a sequence of unitary matrices to transform matrix `A` to the following form:
8559    /// $$
8560    /// U^{H}\\*A\\*V = S + E
8561    /// $$
8562    ///
8563    /// where `S` is diagonal and diagonal of `E` is zero.
8564    ///
8565    /// 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:
8566    /// $$
8567    /// {\\|E\\|}_{F}\leq\operatorname{eps}\\*{\\|A\\|}_{F}
8568    /// $$
8569    ///
8570    /// where `eps` is given tolerance. Note that if the real residual norm:
8571    /// $$
8572    /// {\\|{S} - {U}^{H}\\*{A}\\*{V}\\|}_{F}
8573    /// $$
8574    ///
8575    /// 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:
8576    /// $$
8577    /// \frac{\\|S - U^{H} \\* A \\* V\\|_F}{O(N) \\* \\|A\\|_F} \leq \frac{\\|E\\|_F}{\\|A\\|_F} \leq \operatorname{eps}
8578    /// $$
8579    ///
8580    /// $O(N)$ is typically $N$, but the constant depends on the number of sweeps, which gives an upper roundoff error bound of $sweeps \\* N$.
8581    ///
8582    /// `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.
8583    ///
8584    /// 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.
8585    ///
8586    /// 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(&lt;type>) * lwork`.
8587    ///
8588    /// 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.
8589    ///
8590    /// If the user sets an improper tolerance, `gesvdj` may not converge. For example, tolerance should not be smaller than machine accuracy.
8591    ///
8592    /// Please visit [cuSOLVER Library Samples - gesvdj](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/gesvdj) for a code example.
8593    ///
8594    /// Remark 1: `gesvdj` supports any combination of `m` and `n`.
8595    ///
8596    /// Remark 2: the routine returns `V`, not $V^{H}$. This is different from `gesvd`.
8597    pub fn cusolverDnCgesvdj(
8598        handle: cusolverDnHandle_t,
8599        jobz: cusolverEigMode_t,
8600        econ: ::core::ffi::c_int,
8601        m: ::core::ffi::c_int,
8602        n: ::core::ffi::c_int,
8603        A: *mut cuComplex,
8604        lda: ::core::ffi::c_int,
8605        S: *mut f32,
8606        U: *mut cuComplex,
8607        ldu: ::core::ffi::c_int,
8608        V: *mut cuComplex,
8609        ldv: ::core::ffi::c_int,
8610        work: *mut cuComplex,
8611        lwork: ::core::ffi::c_int,
8612        info: *mut ::core::ffi::c_int,
8613        params: gesvdjInfo_t,
8614    ) -> cusolverStatus_t;
8615}
8616unsafe extern "C" {
8617    /// The helper functions below can calculate the sizes needed for pre-allocated buffer.
8618    ///
8619    /// The S and D data types are real valued single and double precision, respectively.
8620    ///
8621    /// The C and Z data types are complex valued single and double precision, respectively.
8622    ///
8623    /// 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:
8624    /// $$
8625    /// A = U\\*\Sigma\\*V^{H}
8626    /// $$
8627    ///
8628    /// 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`.
8629    ///
8630    /// `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.
8631    ///
8632    /// `gesvdj` iteratively generates a sequence of unitary matrices to transform matrix `A` to the following form:
8633    /// $$
8634    /// U^{H}\\*A\\*V = S + E
8635    /// $$
8636    ///
8637    /// where `S` is diagonal and diagonal of `E` is zero.
8638    ///
8639    /// 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:
8640    /// $$
8641    /// {\\|E\\|}_{F}\leq\operatorname{eps}\\*{\\|A\\|}_{F}
8642    /// $$
8643    ///
8644    /// where `eps` is given tolerance. Note that if the real residual norm:
8645    /// $$
8646    /// {\\|{S} - {U}^{H}\\*{A}\\*{V}\\|}_{F}
8647    /// $$
8648    ///
8649    /// 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:
8650    /// $$
8651    /// \frac{\\|S - U^{H} \\* A \\* V\\|_F}{O(N) \\* \\|A\\|_F} \leq \frac{\\|E\\|_F}{\\|A\\|_F} \leq \operatorname{eps}
8652    /// $$
8653    ///
8654    /// $O(N)$ is typically $N$, but the constant depends on the number of sweeps, which gives an upper roundoff error bound of $sweeps \\* N$.
8655    ///
8656    /// `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.
8657    ///
8658    /// 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.
8659    ///
8660    /// 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(&lt;type>) * lwork`.
8661    ///
8662    /// 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.
8663    ///
8664    /// If the user sets an improper tolerance, `gesvdj` may not converge. For example, tolerance should not be smaller than machine accuracy.
8665    ///
8666    /// Please visit [cuSOLVER Library Samples - gesvdj](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/gesvdj) for a code example.
8667    ///
8668    /// Remark 1: `gesvdj` supports any combination of `m` and `n`.
8669    ///
8670    /// Remark 2: the routine returns `V`, not $V^{H}$. This is different from `gesvd`.
8671    pub fn cusolverDnZgesvdj(
8672        handle: cusolverDnHandle_t,
8673        jobz: cusolverEigMode_t,
8674        econ: ::core::ffi::c_int,
8675        m: ::core::ffi::c_int,
8676        n: ::core::ffi::c_int,
8677        A: *mut cuDoubleComplex,
8678        lda: ::core::ffi::c_int,
8679        S: *mut f64,
8680        U: *mut cuDoubleComplex,
8681        ldu: ::core::ffi::c_int,
8682        V: *mut cuDoubleComplex,
8683        ldv: ::core::ffi::c_int,
8684        work: *mut cuDoubleComplex,
8685        lwork: ::core::ffi::c_int,
8686        info: *mut ::core::ffi::c_int,
8687        params: gesvdjInfo_t,
8688    ) -> cusolverStatus_t;
8689}
8690unsafe extern "C" {
8691    pub fn cusolverDnSgesvdaStridedBatched_bufferSize(
8692        handle: cusolverDnHandle_t,
8693        jobz: cusolverEigMode_t,
8694        rank: ::core::ffi::c_int,
8695        m: ::core::ffi::c_int,
8696        n: ::core::ffi::c_int,
8697        d_A: *const f32,
8698        lda: ::core::ffi::c_int,
8699        strideA: ::core::ffi::c_longlong,
8700        d_S: *const f32,
8701        strideS: ::core::ffi::c_longlong,
8702        d_U: *const f32,
8703        ldu: ::core::ffi::c_int,
8704        strideU: ::core::ffi::c_longlong,
8705        d_V: *const f32,
8706        ldv: ::core::ffi::c_int,
8707        strideV: ::core::ffi::c_longlong,
8708        lwork: *mut ::core::ffi::c_int,
8709        batchSize: ::core::ffi::c_int,
8710    ) -> cusolverStatus_t;
8711}
8712unsafe extern "C" {
8713    pub fn cusolverDnDgesvdaStridedBatched_bufferSize(
8714        handle: cusolverDnHandle_t,
8715        jobz: cusolverEigMode_t,
8716        rank: ::core::ffi::c_int,
8717        m: ::core::ffi::c_int,
8718        n: ::core::ffi::c_int,
8719        d_A: *const f64,
8720        lda: ::core::ffi::c_int,
8721        strideA: ::core::ffi::c_longlong,
8722        d_S: *const f64,
8723        strideS: ::core::ffi::c_longlong,
8724        d_U: *const f64,
8725        ldu: ::core::ffi::c_int,
8726        strideU: ::core::ffi::c_longlong,
8727        d_V: *const f64,
8728        ldv: ::core::ffi::c_int,
8729        strideV: ::core::ffi::c_longlong,
8730        lwork: *mut ::core::ffi::c_int,
8731        batchSize: ::core::ffi::c_int,
8732    ) -> cusolverStatus_t;
8733}
8734unsafe extern "C" {
8735    pub fn cusolverDnCgesvdaStridedBatched_bufferSize(
8736        handle: cusolverDnHandle_t,
8737        jobz: cusolverEigMode_t,
8738        rank: ::core::ffi::c_int,
8739        m: ::core::ffi::c_int,
8740        n: ::core::ffi::c_int,
8741        d_A: *const cuComplex,
8742        lda: ::core::ffi::c_int,
8743        strideA: ::core::ffi::c_longlong,
8744        d_S: *const f32,
8745        strideS: ::core::ffi::c_longlong,
8746        d_U: *const cuComplex,
8747        ldu: ::core::ffi::c_int,
8748        strideU: ::core::ffi::c_longlong,
8749        d_V: *const cuComplex,
8750        ldv: ::core::ffi::c_int,
8751        strideV: ::core::ffi::c_longlong,
8752        lwork: *mut ::core::ffi::c_int,
8753        batchSize: ::core::ffi::c_int,
8754    ) -> cusolverStatus_t;
8755}
8756unsafe extern "C" {
8757    pub fn cusolverDnZgesvdaStridedBatched_bufferSize(
8758        handle: cusolverDnHandle_t,
8759        jobz: cusolverEigMode_t,
8760        rank: ::core::ffi::c_int,
8761        m: ::core::ffi::c_int,
8762        n: ::core::ffi::c_int,
8763        d_A: *const cuDoubleComplex,
8764        lda: ::core::ffi::c_int,
8765        strideA: ::core::ffi::c_longlong,
8766        d_S: *const f64,
8767        strideS: ::core::ffi::c_longlong,
8768        d_U: *const cuDoubleComplex,
8769        ldu: ::core::ffi::c_int,
8770        strideU: ::core::ffi::c_longlong,
8771        d_V: *const cuDoubleComplex,
8772        ldv: ::core::ffi::c_int,
8773        strideV: ::core::ffi::c_longlong,
8774        lwork: *mut ::core::ffi::c_int,
8775        batchSize: ::core::ffi::c_int,
8776    ) -> cusolverStatus_t;
8777}
8778unsafe extern "C" {
8779    /// The helper functions below can calculate the sizes needed for pre-allocated buffer.
8780    ///
8781    /// The S and D data types are real valued single and double precision, respectively.
8782    ///
8783    /// The C and Z data types are complex valued single and double precision, respectively.
8784    ///
8785    /// 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:
8786    /// $$
8787    /// A = U\\*\Sigma\\*V^{H}
8788    /// $$
8789    ///
8790    /// 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`.
8791    ///
8792    /// `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:
8793    /// $$
8794    /// U^{H}\\*A\\*V = S + E
8795    /// $$
8796    ///
8797    /// 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.
8798    ///
8799    /// The input parameter `rank` decides the number of singular values and singular vectors are computed in parameter `S`, `U` and `V`.
8800    ///
8801    /// The output parameter `h_RnrmF` computes Frobenius norm of residual. To compute `h_RnrmF`, `info != NULL` is required.
8802    /// $$
8803    /// A - U\\*S\\*V^{H}
8804    /// $$
8805    ///
8806    /// if the parameter `rank` is equal `n`. Otherwise, `h_RnrmF` reports:
8807    /// $$
8808    /// {\\|}U\\*S\\*V^{H}{\\|} - {\\|S\\|}
8809    /// $$
8810    ///
8811    /// in Frobenius norm sense, that is, how far `U` is from unitary.
8812    ///
8813    /// `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,
8814    /// $$
8815    /// \begin{split}A = \begin{pmatrix}
8816    /// {A0} & {A1} & \cdots \\\\
8817    /// \end{pmatrix}\end{split}
8818    /// $$
8819    ///
8820    /// 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}$.
8821    ///
8822    /// 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(&lt;type>) * lwork`.
8823    ///
8824    /// 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 &lt; info\[i\] &lt; min(m,n)+1`, `gesvdaStridedBatched` could not compute an SVD of the `i-th` matrix fully; the leading singular values `Si\[k\]`, `0 &lt;= k &lt;= 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`.
8825    ///
8826    /// Note that the problem size is limited by the condition `batchSize*stride{A/S/U/V}&lt;=INT32_MAX` primarily due to the current implementation constraints.
8827    ///
8828    /// Please visit [cuSOLVER Library Samples - gesvdaStridedBatched](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/gesvdaStridedBatched) for a code example.
8829    ///
8830    /// Remark 1: The routine returns `V`, not $V^{H}$. This is different from `gesvd`.
8831    ///
8832    /// Remark 2: The routine only supports `m >=n`.
8833    ///
8834    /// Remark 3: It is recommended to use an FP64 data type, that is `DgesvdaStridedBatched` or `ZgesvdaStridedBatched`.
8835    ///
8836    /// 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.
8837    pub fn cusolverDnSgesvdaStridedBatched(
8838        handle: cusolverDnHandle_t,
8839        jobz: cusolverEigMode_t,
8840        rank: ::core::ffi::c_int,
8841        m: ::core::ffi::c_int,
8842        n: ::core::ffi::c_int,
8843        d_A: *const f32,
8844        lda: ::core::ffi::c_int,
8845        strideA: ::core::ffi::c_longlong,
8846        d_S: *mut f32,
8847        strideS: ::core::ffi::c_longlong,
8848        d_U: *mut f32,
8849        ldu: ::core::ffi::c_int,
8850        strideU: ::core::ffi::c_longlong,
8851        d_V: *mut f32,
8852        ldv: ::core::ffi::c_int,
8853        strideV: ::core::ffi::c_longlong,
8854        d_work: *mut f32,
8855        lwork: ::core::ffi::c_int,
8856        d_info: *mut ::core::ffi::c_int,
8857        h_R_nrmF: *mut f64,
8858        batchSize: ::core::ffi::c_int,
8859    ) -> cusolverStatus_t;
8860}
8861unsafe extern "C" {
8862    /// The helper functions below can calculate the sizes needed for pre-allocated buffer.
8863    ///
8864    /// The S and D data types are real valued single and double precision, respectively.
8865    ///
8866    /// The C and Z data types are complex valued single and double precision, respectively.
8867    ///
8868    /// 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:
8869    /// $$
8870    /// A = U\\*\Sigma\\*V^{H}
8871    /// $$
8872    ///
8873    /// 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`.
8874    ///
8875    /// `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:
8876    /// $$
8877    /// U^{H}\\*A\\*V = S + E
8878    /// $$
8879    ///
8880    /// 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.
8881    ///
8882    /// The input parameter `rank` decides the number of singular values and singular vectors are computed in parameter `S`, `U` and `V`.
8883    ///
8884    /// The output parameter `h_RnrmF` computes Frobenius norm of residual. To compute `h_RnrmF`, `info != NULL` is required.
8885    /// $$
8886    /// A - U\\*S\\*V^{H}
8887    /// $$
8888    ///
8889    /// if the parameter `rank` is equal `n`. Otherwise, `h_RnrmF` reports:
8890    /// $$
8891    /// {\\|}U\\*S\\*V^{H}{\\|} - {\\|S\\|}
8892    /// $$
8893    ///
8894    /// in Frobenius norm sense, that is, how far `U` is from unitary.
8895    ///
8896    /// `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,
8897    /// $$
8898    /// \begin{split}A = \begin{pmatrix}
8899    /// {A0} & {A1} & \cdots \\\\
8900    /// \end{pmatrix}\end{split}
8901    /// $$
8902    ///
8903    /// 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}$.
8904    ///
8905    /// 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(&lt;type>) * lwork`.
8906    ///
8907    /// 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 &lt; info\[i\] &lt; min(m,n)+1`, `gesvdaStridedBatched` could not compute an SVD of the `i-th` matrix fully; the leading singular values `Si\[k\]`, `0 &lt;= k &lt;= 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`.
8908    ///
8909    /// Note that the problem size is limited by the condition `batchSize*stride{A/S/U/V}&lt;=INT32_MAX` primarily due to the current implementation constraints.
8910    ///
8911    /// Please visit [cuSOLVER Library Samples - gesvdaStridedBatched](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/gesvdaStridedBatched) for a code example.
8912    ///
8913    /// Remark 1: The routine returns `V`, not $V^{H}$. This is different from `gesvd`.
8914    ///
8915    /// Remark 2: The routine only supports `m >=n`.
8916    ///
8917    /// Remark 3: It is recommended to use an FP64 data type, that is `DgesvdaStridedBatched` or `ZgesvdaStridedBatched`.
8918    ///
8919    /// 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.
8920    pub fn cusolverDnDgesvdaStridedBatched(
8921        handle: cusolverDnHandle_t,
8922        jobz: cusolverEigMode_t,
8923        rank: ::core::ffi::c_int,
8924        m: ::core::ffi::c_int,
8925        n: ::core::ffi::c_int,
8926        d_A: *const f64,
8927        lda: ::core::ffi::c_int,
8928        strideA: ::core::ffi::c_longlong,
8929        d_S: *mut f64,
8930        strideS: ::core::ffi::c_longlong,
8931        d_U: *mut f64,
8932        ldu: ::core::ffi::c_int,
8933        strideU: ::core::ffi::c_longlong,
8934        d_V: *mut f64,
8935        ldv: ::core::ffi::c_int,
8936        strideV: ::core::ffi::c_longlong,
8937        d_work: *mut f64,
8938        lwork: ::core::ffi::c_int,
8939        d_info: *mut ::core::ffi::c_int,
8940        h_R_nrmF: *mut f64,
8941        batchSize: ::core::ffi::c_int,
8942    ) -> cusolverStatus_t;
8943}
8944unsafe extern "C" {
8945    /// The helper functions below can calculate the sizes needed for pre-allocated buffer.
8946    ///
8947    /// The S and D data types are real valued single and double precision, respectively.
8948    ///
8949    /// The C and Z data types are complex valued single and double precision, respectively.
8950    ///
8951    /// 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:
8952    /// $$
8953    /// A = U\\*\Sigma\\*V^{H}
8954    /// $$
8955    ///
8956    /// 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`.
8957    ///
8958    /// `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:
8959    /// $$
8960    /// U^{H}\\*A\\*V = S + E
8961    /// $$
8962    ///
8963    /// 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.
8964    ///
8965    /// The input parameter `rank` decides the number of singular values and singular vectors are computed in parameter `S`, `U` and `V`.
8966    ///
8967    /// The output parameter `h_RnrmF` computes Frobenius norm of residual. To compute `h_RnrmF`, `info != NULL` is required.
8968    /// $$
8969    /// A - U\\*S\\*V^{H}
8970    /// $$
8971    ///
8972    /// if the parameter `rank` is equal `n`. Otherwise, `h_RnrmF` reports:
8973    /// $$
8974    /// {\\|}U\\*S\\*V^{H}{\\|} - {\\|S\\|}
8975    /// $$
8976    ///
8977    /// in Frobenius norm sense, that is, how far `U` is from unitary.
8978    ///
8979    /// `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,
8980    /// $$
8981    /// \begin{split}A = \begin{pmatrix}
8982    /// {A0} & {A1} & \cdots \\\\
8983    /// \end{pmatrix}\end{split}
8984    /// $$
8985    ///
8986    /// 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}$.
8987    ///
8988    /// 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(&lt;type>) * lwork`.
8989    ///
8990    /// 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 &lt; info\[i\] &lt; min(m,n)+1`, `gesvdaStridedBatched` could not compute an SVD of the `i-th` matrix fully; the leading singular values `Si\[k\]`, `0 &lt;= k &lt;= 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`.
8991    ///
8992    /// Note that the problem size is limited by the condition `batchSize*stride{A/S/U/V}&lt;=INT32_MAX` primarily due to the current implementation constraints.
8993    ///
8994    /// Please visit [cuSOLVER Library Samples - gesvdaStridedBatched](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/gesvdaStridedBatched) for a code example.
8995    ///
8996    /// Remark 1: The routine returns `V`, not $V^{H}$. This is different from `gesvd`.
8997    ///
8998    /// Remark 2: The routine only supports `m >=n`.
8999    ///
9000    /// Remark 3: It is recommended to use an FP64 data type, that is `DgesvdaStridedBatched` or `ZgesvdaStridedBatched`.
9001    ///
9002    /// 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.
9003    pub fn cusolverDnCgesvdaStridedBatched(
9004        handle: cusolverDnHandle_t,
9005        jobz: cusolverEigMode_t,
9006        rank: ::core::ffi::c_int,
9007        m: ::core::ffi::c_int,
9008        n: ::core::ffi::c_int,
9009        d_A: *const cuComplex,
9010        lda: ::core::ffi::c_int,
9011        strideA: ::core::ffi::c_longlong,
9012        d_S: *mut f32,
9013        strideS: ::core::ffi::c_longlong,
9014        d_U: *mut cuComplex,
9015        ldu: ::core::ffi::c_int,
9016        strideU: ::core::ffi::c_longlong,
9017        d_V: *mut cuComplex,
9018        ldv: ::core::ffi::c_int,
9019        strideV: ::core::ffi::c_longlong,
9020        d_work: *mut cuComplex,
9021        lwork: ::core::ffi::c_int,
9022        d_info: *mut ::core::ffi::c_int,
9023        h_R_nrmF: *mut f64,
9024        batchSize: ::core::ffi::c_int,
9025    ) -> cusolverStatus_t;
9026}
9027unsafe extern "C" {
9028    /// The helper functions below can calculate the sizes needed for pre-allocated buffer.
9029    ///
9030    /// The S and D data types are real valued single and double precision, respectively.
9031    ///
9032    /// The C and Z data types are complex valued single and double precision, respectively.
9033    ///
9034    /// 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:
9035    /// $$
9036    /// A = U\\*\Sigma\\*V^{H}
9037    /// $$
9038    ///
9039    /// 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`.
9040    ///
9041    /// `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:
9042    /// $$
9043    /// U^{H}\\*A\\*V = S + E
9044    /// $$
9045    ///
9046    /// 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.
9047    ///
9048    /// The input parameter `rank` decides the number of singular values and singular vectors are computed in parameter `S`, `U` and `V`.
9049    ///
9050    /// The output parameter `h_RnrmF` computes Frobenius norm of residual. To compute `h_RnrmF`, `info != NULL` is required.
9051    /// $$
9052    /// A - U\\*S\\*V^{H}
9053    /// $$
9054    ///
9055    /// if the parameter `rank` is equal `n`. Otherwise, `h_RnrmF` reports:
9056    /// $$
9057    /// {\\|}U\\*S\\*V^{H}{\\|} - {\\|S\\|}
9058    /// $$
9059    ///
9060    /// in Frobenius norm sense, that is, how far `U` is from unitary.
9061    ///
9062    /// `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,
9063    /// $$
9064    /// \begin{split}A = \begin{pmatrix}
9065    /// {A0} & {A1} & \cdots \\\\
9066    /// \end{pmatrix}\end{split}
9067    /// $$
9068    ///
9069    /// 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}$.
9070    ///
9071    /// 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(&lt;type>) * lwork`.
9072    ///
9073    /// 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 &lt; info\[i\] &lt; min(m,n)+1`, `gesvdaStridedBatched` could not compute an SVD of the `i-th` matrix fully; the leading singular values `Si\[k\]`, `0 &lt;= k &lt;= 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`.
9074    ///
9075    /// Note that the problem size is limited by the condition `batchSize*stride{A/S/U/V}&lt;=INT32_MAX` primarily due to the current implementation constraints.
9076    ///
9077    /// Please visit [cuSOLVER Library Samples - gesvdaStridedBatched](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/gesvdaStridedBatched) for a code example.
9078    ///
9079    /// Remark 1: The routine returns `V`, not $V^{H}$. This is different from `gesvd`.
9080    ///
9081    /// Remark 2: The routine only supports `m >=n`.
9082    ///
9083    /// Remark 3: It is recommended to use an FP64 data type, that is `DgesvdaStridedBatched` or `ZgesvdaStridedBatched`.
9084    ///
9085    /// 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.
9086    pub fn cusolverDnZgesvdaStridedBatched(
9087        handle: cusolverDnHandle_t,
9088        jobz: cusolverEigMode_t,
9089        rank: ::core::ffi::c_int,
9090        m: ::core::ffi::c_int,
9091        n: ::core::ffi::c_int,
9092        d_A: *const cuDoubleComplex,
9093        lda: ::core::ffi::c_int,
9094        strideA: ::core::ffi::c_longlong,
9095        d_S: *mut f64,
9096        strideS: ::core::ffi::c_longlong,
9097        d_U: *mut cuDoubleComplex,
9098        ldu: ::core::ffi::c_int,
9099        strideU: ::core::ffi::c_longlong,
9100        d_V: *mut cuDoubleComplex,
9101        ldv: ::core::ffi::c_int,
9102        strideV: ::core::ffi::c_longlong,
9103        d_work: *mut cuDoubleComplex,
9104        lwork: ::core::ffi::c_int,
9105        d_info: *mut ::core::ffi::c_int,
9106        h_R_nrmF: *mut f64,
9107        batchSize: ::core::ffi::c_int,
9108    ) -> cusolverStatus_t;
9109}
9110unsafe extern "C" {
9111    /// This function creates and initializes the structure of `64-bit API` to default values.
9112    ///
9113    /// # Parameters
9114    ///
9115    /// - `params`: The pointer to the structure of `64-bit API`.
9116    ///
9117    /// # Return value
9118    ///
9119    /// - [`cusolverStatus_t::CUSOLVER_STATUS_ALLOC_FAILED`]: The resources could not be allocated.
9120    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The structure was initialized successfully.
9121    pub fn cusolverDnCreateParams(params: *mut cusolverDnParams_t) -> cusolverStatus_t;
9122}
9123unsafe extern "C" {
9124    /// This function destroys and releases any memory required by the structure.
9125    ///
9126    /// # Parameters
9127    ///
9128    /// - `params`: The structure of `64-bit API`.
9129    ///
9130    /// # Return value
9131    ///
9132    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The resources were released successfully.
9133    pub fn cusolverDnDestroyParams(params: cusolverDnParams_t) -> cusolverStatus_t;
9134}
9135unsafe extern "C" {
9136    /// This function configures algorithm `algo` of `function`, a `64-bit API` routine.
9137    ///
9138    /// # Parameters
9139    ///
9140    /// - `params`: The pointer to the structure of `64-bit API`.
9141    /// - `function`: The routine to be configured.
9142    /// - `algo`: The algorithm to be configured.
9143    ///
9144    /// # Return value
9145    ///
9146    /// - [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]: Wrong combination of `function` and `algo`.
9147    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The operation completed successfully.
9148    pub fn cusolverDnSetAdvOptions(
9149        params: cusolverDnParams_t,
9150        function: cusolverDnFunction_t,
9151        algo: cusolverAlgMode_t,
9152    ) -> cusolverStatus_t;
9153}
9154unsafe extern "C" {
9155    pub fn cusolverDnXpotrf_bufferSize(
9156        handle: cusolverDnHandle_t,
9157        params: cusolverDnParams_t,
9158        uplo: cublasFillMode_t,
9159        n: i64,
9160        dataTypeA: cudaDataType,
9161        A: *const ::core::ffi::c_void,
9162        lda: i64,
9163        computeType: cudaDataType,
9164        workspaceInBytesOnDevice: *mut size_t,
9165        workspaceInBytesOnHost: *mut size_t,
9166    ) -> cusolverStatus_t;
9167}
9168unsafe extern "C" {
9169    /// The helper functions below can calculate the sizes needed for pre-allocated buffer.
9170    ///
9171    /// The following routine:
9172    ///
9173    /// computes the Cholesky factorization of a Hermitian positive-definite matrix using the generic API interface.
9174    ///
9175    /// `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.
9176    ///
9177    /// 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`.
9178    /// $$
9179    /// A = L\\*L^{H}
9180    /// $$
9181    ///
9182    /// 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`.
9183    /// $$
9184    /// A = U^{H}\\*U
9185    /// $$
9186    ///
9187    /// 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`].
9188    ///
9189    /// 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.
9190    ///
9191    /// If output parameter `info = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
9192    ///
9193    /// Currently, [`cusolverDnXpotrf`] supports only the default algorithm.
9194    ///
9195    /// Please visit [cuSOLVER Library Samples - Xpotrf](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/Xpotrf) for a code example.
9196    ///
9197    /// **Algorithms supported by cusolverDnXpotrf**
9198    ///
9199    /// |  |  |
9200    /// | --- | --- |
9201    /// | [`cusolverAlgMode_t::CUSOLVER_ALG_0`] or `NULL` | Default algorithm. |
9202    ///
9203    /// List of input arguments for [`cusolverDnXpotrf_bufferSize`] and [`cusolverDnXpotrf`]:
9204    ///
9205    /// 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.
9206    ///
9207    /// **Valid combination of data type and compute type**
9208    ///
9209    /// | **DataTypeA** | **ComputeType** | **Meaning** |
9210    /// | --- | --- | --- |
9211    /// | `CUDA_R_32F` | `CUDA_R_32F` | `SPOTRF` |
9212    /// | `CUDA_R_64F` | `CUDA_R_64F` | `DPOTRF` |
9213    /// | `CUDA_C_32F` | `CUDA_C_32F` | `CPOTRF` |
9214    /// | `CUDA_C_64F` | `CUDA_C_64F` | `ZPOTRF` |
9215    ///
9216    /// # Parameters
9217    ///
9218    /// - `handle`: Handle to the cuSolverDN library context.
9219    /// - `params`: Structure with information collected by [`cusolverDnSetAdvOptions`].
9220    /// - `uplo`: Indicates if matrix `A` lower or upper part is stored, the other part is not referenced.
9221    /// - `n`: Number of rows and columns of matrix `A`.
9222    /// - `dataTypeA`: Data type of array `A`.
9223    /// - `A`: Array of dimension `lda * n` with `lda` is not less than `max(1,n)`.
9224    /// - `lda`: Leading dimension of two-dimensional array used to store matrix `A`.
9225    /// - `computeType`: Data type of computation.
9226    /// - `bufferOnDevice`: Device workspace. Array of type `void` of size `workspaceInBytesOnDevice` bytes.
9227    /// - `workspaceInBytesOnDevice`: Size in bytes of `bufferOnDevice`, returned by [`cusolverDnXpotrf_bufferSize`].
9228    /// - `bufferOnHost`: Host workspace. Array of type `void` of size `workspaceInBytesOnHost` bytes.
9229    /// - `workspaceInBytesOnHost`: Size in bytes of `bufferOnHost`, returned by [`cusolverDnXpotrf_bufferSize`].
9230    /// - `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.
9231    ///
9232    /// # Return value
9233    ///
9234    /// - [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]: An internal operation failed.
9235    /// - [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]: Invalid parameters were passed (`n&lt;0` or `lda&lt;max(1,n)`).
9236    /// - [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]: The library was not initialized.
9237    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The operation completed successfully.
9238    pub fn cusolverDnXpotrf(
9239        handle: cusolverDnHandle_t,
9240        params: cusolverDnParams_t,
9241        uplo: cublasFillMode_t,
9242        n: i64,
9243        dataTypeA: cudaDataType,
9244        A: *mut ::core::ffi::c_void,
9245        lda: i64,
9246        computeType: cudaDataType,
9247        bufferOnDevice: *mut ::core::ffi::c_void,
9248        workspaceInBytesOnDevice: size_t,
9249        bufferOnHost: *mut ::core::ffi::c_void,
9250        workspaceInBytesOnHost: size_t,
9251        info: *mut ::core::ffi::c_int,
9252    ) -> cusolverStatus_t;
9253}
9254unsafe extern "C" {
9255    /// This function solves a system of linear equations:
9256    /// $$
9257    /// A\\*X = B
9258    /// $$
9259    ///
9260    /// 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.
9261    ///
9262    /// 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$.
9263    ///
9264    /// The operation is in-place, i.e. matrix `X` overwrites matrix `B` with the same leading dimension `ldb`.
9265    ///
9266    /// If output parameter `info = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
9267    ///
9268    /// Currently, [`cusolverDnXpotrs`] supports only the default algorithm.
9269    ///
9270    /// Please visit [cuSOLVER Library Samples - Xpotrf](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/Xpotrf) for a code example.
9271    ///
9272    /// **Algorithms supported by cusolverDnXpotrs**
9273    ///
9274    /// |  |  |
9275    /// | --- | --- |
9276    /// | [`cusolverAlgMode_t::CUSOLVER_ALG_0`] or `NULL` | Default algorithm. |
9277    ///
9278    /// List of input arguments for [`cusolverDnXpotrs`]:
9279    ///
9280    /// 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.
9281    ///
9282    /// **Valid combination of data type and compute type**
9283    ///
9284    /// | **dataTypeA** | **dataTypeB** | **Meaning** |
9285    /// | --- | --- | --- |
9286    /// | `CUDA_R_32F` | `CUDA_R_32F` | `SPOTRS` |
9287    /// | `CUDA_R_64F` | `CUDA_R_64F` | `DPOTRS` |
9288    /// | `CUDA_C_32F` | `CUDA_C_32F` | `CPOTRS` |
9289    /// | `CUDA_C_64F` | `CUDA_C_64F` | `ZPOTRS` |
9290    ///
9291    /// # Parameters
9292    ///
9293    /// - `handle`: Handle to the cuSolverDN library context.
9294    /// - `params`: Structure with information collected by [`cusolverDnSetAdvOptions`].
9295    /// - `uplo`: Indicates if matrix `A` lower or upper part is stored, the other part is not referenced.
9296    /// - `n`: Number of rows and columns of matrix `A`.
9297    /// - `nrhs`: Number of columns of matrix `X` and `B`.
9298    /// - `dataTypeA`: Data type of array `A`.
9299    /// - `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`.
9300    /// - `lda`: Leading dimension of two-dimensional array used to store matrix `A`.
9301    /// - `dataTypeB`: Data type of array `B`.
9302    /// - `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.
9303    /// - `info`: If `info = 0`, the Cholesky factorization is successful. if `info = -i`, the `i-th` parameter is wrong (not counting handle).
9304    ///
9305    /// # Return value
9306    ///
9307    /// - [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]: An internal operation failed.
9308    /// - [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]: Invalid parameters were passed (`n&lt;0`, `nrhs&lt;0`, `lda&lt;max(1,n)` or `ldb&lt;max(1,n)`).
9309    /// - [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]: The library was not initialized.
9310    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The operation completed successfully.
9311    pub fn cusolverDnXpotrs(
9312        handle: cusolverDnHandle_t,
9313        params: cusolverDnParams_t,
9314        uplo: cublasFillMode_t,
9315        n: i64,
9316        nrhs: i64,
9317        dataTypeA: cudaDataType,
9318        A: *const ::core::ffi::c_void,
9319        lda: i64,
9320        dataTypeB: cudaDataType,
9321        B: *mut ::core::ffi::c_void,
9322        ldb: i64,
9323        info: *mut ::core::ffi::c_int,
9324    ) -> cusolverStatus_t;
9325}
9326unsafe extern "C" {
9327    pub fn cusolverDnXgeqrf_bufferSize(
9328        handle: cusolverDnHandle_t,
9329        params: cusolverDnParams_t,
9330        m: i64,
9331        n: i64,
9332        dataTypeA: cudaDataType,
9333        A: *const ::core::ffi::c_void,
9334        lda: i64,
9335        dataTypeTau: cudaDataType,
9336        tau: *const ::core::ffi::c_void,
9337        computeType: cudaDataType,
9338        workspaceInBytesOnDevice: *mut size_t,
9339        workspaceInBytesOnHost: *mut size_t,
9340    ) -> cusolverStatus_t;
9341}
9342unsafe extern "C" {
9343    /// The helper functions below can calculate the sizes needed for pre-allocated buffer.
9344    ///
9345    /// The following routine:
9346    ///
9347    /// computes the QR factorization of a $m \times n$ matrix:
9348    /// $$
9349    /// A = Q\\*R
9350    /// $$
9351    ///
9352    /// 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.
9353    ///
9354    /// 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`].
9355    ///
9356    /// The matrix `R` is overwritten in upper triangular part of `A`, including diagonal elements.
9357    ///
9358    /// 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:
9359    /// $$
9360    /// I - 2\\*v\\*v^{H} = I - \tau\\*q\\*q^{H}
9361    /// $$
9362    ///
9363    /// If output parameter `info = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
9364    ///
9365    /// Currently, [`cusolverDnXgeqrf`] supports only the default algorithm.
9366    ///
9367    /// Please visit [cuSOLVER Library Samples - Xgeqrf](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/Xgeqrf) for a code example.
9368    ///
9369    /// **Algorithms supported by cusolverDnXgeqrf**
9370    ///
9371    /// |  |  |
9372    /// | --- | --- |
9373    /// | [`cusolverAlgMode_t::CUSOLVER_ALG_0`] or `NULL` | Default algorithm. |
9374    ///
9375    /// List of input arguments for [`cusolverDnXgeqrf_bufferSize`] and [`cusolverDnXgeqrf`]:
9376    ///
9377    /// 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.
9378    ///
9379    /// **Valid combination of data type and compute type**
9380    ///
9381    /// | **DataTypeA** | **ComputeType** | **Meaning** |
9382    /// | --- | --- | --- |
9383    /// | `CUDA_R_32F` | `CUDA_R_32F` | `SGEQRF` |
9384    /// | `CUDA_R_64F` | `CUDA_R_64F` | `DGEQRF` |
9385    /// | `CUDA_C_32F` | `CUDA_C_32F` | `CGEQRF` |
9386    /// | `CUDA_C_64F` | `CUDA_C_64F` | `ZGEQRF` |
9387    ///
9388    /// # Parameters
9389    ///
9390    /// - `handle`: Handle to the cuSolverDN library context.
9391    /// - `params`: Structure with information collected by [`cusolverDnSetAdvOptions`].
9392    /// - `m`: Number of rows of matrix `A`.
9393    /// - `n`: Number of columns of matrix `A`.
9394    /// - `dataTypeA`: Data type of array `A`.
9395    /// - `A`: Array of dimension `lda * n` with `lda` is not less than `max(1,m)`.
9396    /// - `lda`: Leading dimension of two-dimensional array used to store matrix `A`.
9397    /// - `dataTypeTau`: Data type of array `tau`.
9398    /// - `tau`: Array of dimension at least `min(m,n)`.
9399    /// - `computeType`: Data type of computation.
9400    /// - `bufferOnDevice`: Device workspace. Array of type `void` of size `workspaceInBytesOnDevice` bytes.
9401    /// - `workspaceInBytesOnDevice`: Size in bytes of `bufferOnDevice`, returned by [`cusolverDnXgeqrf_bufferSize`].
9402    /// - `bufferOnHost`: Host workspace. Array of type `void` of size `workspaceInBytesOnHost` bytes.
9403    /// - `workspaceInBytesOnHost`: Size in bytes of `bufferOnHost`, returned by [`cusolverDnXgeqrf_bufferSize`].
9404    /// - `info`: If `info = 0`, the QR factorization is successful. If `info = -i`, the `i-th` parameter is wrong (not counting handle).
9405    ///
9406    /// # Return value
9407    ///
9408    /// - [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]: An internal operation failed.
9409    /// - [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]: Invalid parameters were passed (`m,n&lt;0` or `lda&lt;max(1,m)`).
9410    /// - [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]: The library was not initialized.
9411    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The operation completed successfully.
9412    pub fn cusolverDnXgeqrf(
9413        handle: cusolverDnHandle_t,
9414        params: cusolverDnParams_t,
9415        m: i64,
9416        n: i64,
9417        dataTypeA: cudaDataType,
9418        A: *mut ::core::ffi::c_void,
9419        lda: i64,
9420        dataTypeTau: cudaDataType,
9421        tau: *mut ::core::ffi::c_void,
9422        computeType: cudaDataType,
9423        bufferOnDevice: *mut ::core::ffi::c_void,
9424        workspaceInBytesOnDevice: size_t,
9425        bufferOnHost: *mut ::core::ffi::c_void,
9426        workspaceInBytesOnHost: size_t,
9427        info: *mut ::core::ffi::c_int,
9428    ) -> cusolverStatus_t;
9429}
9430unsafe extern "C" {
9431    pub fn cusolverDnXgetrf_bufferSize(
9432        handle: cusolverDnHandle_t,
9433        params: cusolverDnParams_t,
9434        m: i64,
9435        n: i64,
9436        dataTypeA: cudaDataType,
9437        A: *const ::core::ffi::c_void,
9438        lda: i64,
9439        computeType: cudaDataType,
9440        workspaceInBytesOnDevice: *mut size_t,
9441        workspaceInBytesOnHost: *mut size_t,
9442    ) -> cusolverStatus_t;
9443}
9444unsafe extern "C" {
9445    /// The helper function below can calculate the sizes needed for pre-allocated buffer.
9446    ///
9447    /// The function below
9448    ///
9449    /// computes the LU factorization of a $m \times n$ matrix:
9450    /// $$
9451    /// P\\*A = L\\*U
9452    /// $$
9453    ///
9454    /// 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.
9455    ///
9456    /// If LU factorization failed, i.e. matrix `A` (`U`) is singular, The output parameter `info=i` indicates `U(i,i) = 0`.
9457    ///
9458    /// If output parameter `info = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
9459    ///
9460    /// If `ipiv` is null, no pivoting is performed. The factorization is `A=L*U`, which is not numerically stable.
9461    ///
9462    /// No matter LU factorization failed or not, the output parameter `ipiv` contains pivoting sequence, row `i` is interchanged with row `ipiv(i)`.
9463    ///
9464    /// 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`].
9465    ///
9466    /// The user can combine [`cusolverDnXgetrf`] and `cusolverDnGetrs` to complete a linear solver.
9467    ///
9468    /// Currently, [`cusolverDnXgetrf`] supports two algorithms. To select legacy implementation, the user has to call [`cusolverDnSetAdvOptions`].
9469    ///
9470    /// Please visit [cuSOLVER Library Samples - Xgetrf](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/Xgetrf) for a code example.
9471    ///
9472    /// **Algorithms supported by cusolverDnXgetrf**
9473    ///
9474    /// |  |  |
9475    /// | --- | --- |
9476    /// | [`cusolverAlgMode_t::CUSOLVER_ALG_0`] or `NULL` | Default algorithm. The fastest, requires a large workspace of `m*n` elements. |
9477    /// | [`cusolverAlgMode_t::CUSOLVER_ALG_1`] | Legacy implementation |
9478    ///
9479    /// List of input arguments for [`cusolverDnXgetrf_bufferSize`] and [`cusolverDnXgetrf`]:
9480    ///
9481    /// 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.
9482    ///
9483    /// **Valid combination of data type and compute type**
9484    ///
9485    /// | **DataTypeA** | **ComputeType** | **Meaning** |
9486    /// | --- | --- | --- |
9487    /// | `CUDA_R_32F` | `CUDA_R_32F` | `SGETRF` |
9488    /// | `CUDA_R_64F` | `CUDA_R_64F` | `DGETRF` |
9489    /// | `CUDA_C_32F` | `CUDA_C_32F` | `CGETRF` |
9490    /// | `CUDA_C_64F` | `CUDA_C_64F` | `ZGETRF` |
9491    ///
9492    /// # Parameters
9493    ///
9494    /// - `handle`: Handle to the cuSolverDN library context.
9495    /// - `params`: Structure with information collected by [`cusolverDnSetAdvOptions`].
9496    /// - `m`: Number of rows of matrix `A`.
9497    /// - `n`: Number of columns of matrix `A`.
9498    /// - `dataTypeA`: Data type of array `A`.
9499    /// - `A`: &lt;type> array of dimension `lda * n` with `lda` is not less than `max(1,m)`.
9500    /// - `lda`: Leading dimension of two-dimensional array used to store matrix `A`.
9501    /// - `ipiv`: Array of size at least `min(m,n)`, containing pivot indices.
9502    /// - `computeType`: Data type of computation.
9503    /// - `bufferOnDevice`: Device workspace. Array of type `void` of size `workspaceInBytesOnDevice` bytes.
9504    /// - `workspaceInBytesOnDevice`: Size in bytes of `bufferOnDevice`, returned by [`cusolverDnXgetrf_bufferSize`].
9505    /// - `bufferOnHost`: Host workspace. Array of type `void` of size `workspaceInBytesOnHost` bytes.
9506    /// - `workspaceInBytesOnHost`: Size in bytes of `bufferOnHost`, returned by [`cusolverDnXgetrf_bufferSize`].
9507    /// - `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`.
9508    ///
9509    /// # Return value
9510    ///
9511    /// - [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]: An internal operation failed.
9512    /// - [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]: Invalid parameters were passed (`m,n&lt;0` or `lda&lt;max(1,m)`).
9513    /// - [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]: The library was not initialized.
9514    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The operation completed successfully.
9515    pub fn cusolverDnXgetrf(
9516        handle: cusolverDnHandle_t,
9517        params: cusolverDnParams_t,
9518        m: i64,
9519        n: i64,
9520        dataTypeA: cudaDataType,
9521        A: *mut ::core::ffi::c_void,
9522        lda: i64,
9523        ipiv: *mut i64,
9524        computeType: cudaDataType,
9525        bufferOnDevice: *mut ::core::ffi::c_void,
9526        workspaceInBytesOnDevice: size_t,
9527        bufferOnHost: *mut ::core::ffi::c_void,
9528        workspaceInBytesOnHost: size_t,
9529        info: *mut ::core::ffi::c_int,
9530    ) -> cusolverStatus_t;
9531}
9532unsafe extern "C" {
9533    /// This function solves a linear system of multiple right-hand sides:
9534    /// $$
9535    /// op(A)\\*X = B
9536    /// $$
9537    ///
9538    /// 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.
9539    ///
9540    /// The input parameter `trans` is defined by:
9541    /// $$
9542    /// \operatorname{op}(A) =
9543    /// \begin{cases}
9544    /// A & \text{if } trans = \text{CUBLAS_OP_N} \\
9545    /// A^T & \text{if } trans = \text{CUBLAS_OP_T} \\
9546    /// A^H & \text{if } trans = \text{CUBLAS_OP_C}
9547    /// \end{cases}
9548    /// $$
9549    ///
9550    /// The input parameter `ipiv` is an output of [`cusolverDnXgetrf`]. It contains pivot indices, which are used to permutate right-hand sides.
9551    ///
9552    /// If output parameter `info = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
9553    ///
9554    /// The user can combine [`cusolverDnXgetrf`] and [`cusolverDnXgetrs`] to complete a linear solver.
9555    ///
9556    /// Currently, [`cusolverDnXgetrs`] supports only the default algorithm.
9557    ///
9558    /// Please visit [cuSOLVER Library Samples - Xgetrf](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/Xgetrf) for a code example.
9559    ///
9560    /// **Algorithms supported by cusolverDnXgetrs**
9561    ///
9562    /// |  |  |
9563    /// | --- | --- |
9564    /// | [`cusolverAlgMode_t::CUSOLVER_ALG_0`] or `NULL` | Default algorithm. |
9565    ///
9566    /// List of input arguments for [`cusolverDnXgetrs`]:
9567    ///
9568    /// 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:
9569    ///
9570    /// **Valid combination of data type and compute type**
9571    ///
9572    /// | **DataTypeA** | **dataTypeB** | **Meaning** |
9573    /// | --- | --- | --- |
9574    /// | `CUDA_R_32F` | `CUDA_R_32F` | `SGETRS` |
9575    /// | `CUDA_R_64F` | `CUDA_R_64F` | `DGETRS` |
9576    /// | `CUDA_C_32F` | `CUDA_C_32F` | `CGETRS` |
9577    /// | `CUDA_C_64F` | `CUDA_C_64F` | `ZGETRS` |
9578    ///
9579    /// # Parameters
9580    ///
9581    /// - `handle`: Handle to the cuSolverDN library context.
9582    /// - `params`: Structure with information collected by [`cusolverDnSetAdvOptions`].
9583    /// - `trans`: Operation `op(A)` that is non- or (conj.) transpose.
9584    /// - `n`: Number of rows and columns of matrix `A`.
9585    /// - `nrhs`: Number of right-hand sides.
9586    /// - `dataTypeA`: Data type of array `A`.
9587    /// - `A`: Array of dimension `lda * n` with `lda` is not less than `max(1,n)`.
9588    /// - `lda`: Leading dimension of two-dimensional array used to store matrix `A`.
9589    /// - `ipiv`: Array of size at least `n`, containing pivot indices.
9590    /// - `dataTypeB`: Data type of array `B`.
9591    /// - `B`: &lt;type> array of dimension `ldb * nrhs` with `ldb` is not less than `max(1,n)`.
9592    /// - `ldb`: Leading dimension of two-dimensional array used to store matrix `B`.
9593    /// - `info`: If `info = 0`, the operation is successful. If `info = -i`, the `i-th` parameter is wrong (not counting handle).
9594    ///
9595    /// # Return value
9596    ///
9597    /// - [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]: An internal operation failed.
9598    /// - [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]: Invalid parameters were passed (`n&lt;0` or `lda&lt;max(1,n)` or `ldb&lt;max(1,n)`).
9599    /// - [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]: The library was not initialized.
9600    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The operation completed successfully.
9601    pub fn cusolverDnXgetrs(
9602        handle: cusolverDnHandle_t,
9603        params: cusolverDnParams_t,
9604        trans: cublasOperation_t,
9605        n: i64,
9606        nrhs: i64,
9607        dataTypeA: cudaDataType,
9608        A: *const ::core::ffi::c_void,
9609        lda: i64,
9610        ipiv: *const i64,
9611        dataTypeB: cudaDataType,
9612        B: *mut ::core::ffi::c_void,
9613        ldb: i64,
9614        info: *mut ::core::ffi::c_int,
9615    ) -> cusolverStatus_t;
9616}
9617unsafe extern "C" {
9618    pub fn cusolverDnXsyevd_bufferSize(
9619        handle: cusolverDnHandle_t,
9620        params: cusolverDnParams_t,
9621        jobz: cusolverEigMode_t,
9622        uplo: cublasFillMode_t,
9623        n: i64,
9624        dataTypeA: cudaDataType,
9625        A: *const ::core::ffi::c_void,
9626        lda: i64,
9627        dataTypeW: cudaDataType,
9628        W: *const ::core::ffi::c_void,
9629        computeType: cudaDataType,
9630        workspaceInBytesOnDevice: *mut size_t,
9631        workspaceInBytesOnHost: *mut size_t,
9632    ) -> cusolverStatus_t;
9633}
9634unsafe extern "C" {
9635    /// The helper functions below can calculate the sizes needed for pre-allocated buffer.
9636    ///
9637    /// The following routine:
9638    ///
9639    /// computes eigenvalues and eigenvectors of a symmetric (Hermitian) $n \times n$ matrix `A` using the generic API interface. The standard symmetric eigenvalue problem is:
9640    /// $$
9641    /// A\\*V = V\\*\Lambda
9642    /// $$
9643    ///
9644    /// 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.
9645    ///
9646    /// 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`].
9647    ///
9648    /// 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.
9649    ///
9650    /// 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.
9651    ///
9652    /// Please visit [cuSOLVER Library Samples - Xsyevd](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/Xsyevd) for a code example.
9653    ///
9654    /// Currently, [`cusolverDnXsyevd`] supports only the default algorithm.
9655    ///
9656    /// **Algorithms supported by cusolverDnXsyevd**
9657    ///
9658    /// |  |  |
9659    /// | --- | --- |
9660    /// | [`cusolverAlgMode_t::CUSOLVER_ALG_0`] or `NULL` | Default algorithm. |
9661    ///
9662    /// List of input arguments for [`cusolverDnXsyevd_bufferSize`] and [`cusolverDnXsyevd`]:
9663    ///
9664    /// 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.
9665    ///
9666    /// **Valid combination of data type and compute type**
9667    ///
9668    /// | **DataTypeA** | **DataTypeW** | **ComputeType** | **Meaning** |
9669    /// | --- | --- | --- | --- |
9670    /// | `CUDA_R_32F` | `CUDA_R_32F` | `CUDA_R_32F` | `SSYEVD` |
9671    /// | `CUDA_R_64F` | `CUDA_R_64F` | `CUDA_R_64F` | `DSYEVD` |
9672    /// | `CUDA_C_32F` | `CUDA_R_32F` | `CUDA_C_32F` | `CHEEVD` |
9673    /// | `CUDA_C_64F` | `CUDA_R_64F` | `CUDA_C_64F` | `ZHEEVD` |
9674    ///
9675    /// # Parameters
9676    ///
9677    /// - `handle`: Handle to the cuSolverDN library context.
9678    /// - `params`: Structure with information collected by [`cusolverDnSetAdvOptions`].
9679    /// - `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.
9680    /// - `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.
9681    /// - `n`: Number of rows (or columns) of matrix `A`.
9682    /// - `dataTypeA`: Data type of array `A`.
9683    /// - `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.
9684    /// - `lda`: Leading dimension of two-dimensional array used to store matrix `A`.
9685    /// - `dataTypeW`: Data type of array `W`.
9686    /// - `W`: A real array of dimension `n`. The eigenvalue values of `A`, in ascending order, i.e., sorted so that `W(i) &lt;= W(i+1)`.
9687    /// - `computeType`: Data type of computation.
9688    /// - `bufferOnDevice`: Device workspace. Array of type `void` of size `workspaceInBytesOnDevice` bytes.
9689    /// - `workspaceInBytesOnDevice`: Size in bytes of `bufferOnDevice`, returned by [`cusolverDnXsyevd_bufferSize`].
9690    /// - `bufferOnHost`: Host workspace. Array of type `void` of size `workspaceInBytesOnHost` bytes.
9691    /// - `workspaceInBytesOnHost`: Size in bytes of `bufferOnHost`, returned by [`cusolverDnXsyevd_bufferSize`].
9692    /// - `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.
9693    ///
9694    /// # Return value
9695    ///
9696    /// - [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]: An internal operation failed.
9697    /// - [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]: Invalid parameters were passed (`n&lt;0`, or `lda&lt;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`]).
9698    /// - [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]: The library was not initialized.
9699    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The operation completed successfully.
9700    pub fn cusolverDnXsyevd(
9701        handle: cusolverDnHandle_t,
9702        params: cusolverDnParams_t,
9703        jobz: cusolverEigMode_t,
9704        uplo: cublasFillMode_t,
9705        n: i64,
9706        dataTypeA: cudaDataType,
9707        A: *mut ::core::ffi::c_void,
9708        lda: i64,
9709        dataTypeW: cudaDataType,
9710        W: *mut ::core::ffi::c_void,
9711        computeType: cudaDataType,
9712        bufferOnDevice: *mut ::core::ffi::c_void,
9713        workspaceInBytesOnDevice: size_t,
9714        bufferOnHost: *mut ::core::ffi::c_void,
9715        workspaceInBytesOnHost: size_t,
9716        info: *mut ::core::ffi::c_int,
9717    ) -> cusolverStatus_t;
9718}
9719unsafe extern "C" {
9720    pub fn cusolverDnXsyevBatched_bufferSize(
9721        handle: cusolverDnHandle_t,
9722        params: cusolverDnParams_t,
9723        jobz: cusolverEigMode_t,
9724        uplo: cublasFillMode_t,
9725        n: i64,
9726        dataTypeA: cudaDataType,
9727        A: *const ::core::ffi::c_void,
9728        lda: i64,
9729        dataTypeW: cudaDataType,
9730        W: *const ::core::ffi::c_void,
9731        computeType: cudaDataType,
9732        workspaceInBytesOnDevice: *mut size_t,
9733        workspaceInBytesOnHost: *mut size_t,
9734        batchSize: i64,
9735    ) -> cusolverStatus_t;
9736}
9737unsafe extern "C" {
9738    /// The helper functions below can calculate the sizes needed for pre-allocated buffer.
9739    ///
9740    /// The following routine:
9741    ///
9742    /// computes eigenvalues and eigenvectors of a sequence of symmetric (Hermitian) $n \times n$ matrices:
9743    /// $$
9744    /// A_j\\*V_j = V_j\\*\Lambda_j
9745    /// $$
9746    ///
9747    /// 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.
9748    ///
9749    /// `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,
9750    /// $$
9751    /// \begin{split}A = \begin{pmatrix}
9752    /// {A0} & {A1} & \cdots \\\\
9753    /// \end{pmatrix}\end{split}
9754    /// $$
9755    ///
9756    /// 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}$.
9757    ///
9758    /// The parameter `W` also contains the eigenvalues of each matrix in a contiguous way,
9759    /// $$
9760    /// \begin{split}W = \begin{pmatrix}
9761    /// {W0} & {W1} & \cdots \\\\
9762    /// \end{pmatrix}\end{split}
9763    /// $$
9764    ///
9765    /// The formula for random access of `W` is $W_{k}\operatorname{(j)} = {W\lbrack\ j\ +\ n\\*k\rbrack}$.
9766    ///
9767    /// 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`].
9768    ///
9769    /// 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.
9770    ///
9771    /// If `jobz` = [`cusolverEigMode_t::CUSOLVER_EIG_MODE_VECTOR`], $A_{j}$ contains the orthonormal eigenvectors of the matrix $A_{j}$.
9772    ///
9773    /// Note that the problem size is limited by the condition `n`lda`batchSize&lt;=INT32_MAX` primarily due to the current implementation constraints.
9774    ///
9775    /// **Algorithms supported by cusolverDnXsyevBatched**
9776    ///
9777    /// |  |  |
9778    /// | --- | --- |
9779    /// | [`cusolverAlgMode_t::CUSOLVER_ALG_0`] or `NULL` | Default. May switch between algorithms for best performance. |
9780    /// | [`cusolverAlgMode_t::CUSOLVER_ALG_1`] | Uses a single algorithm for consistent accuracy over all n. |
9781    ///
9782    /// List of input arguments for [`cusolverDnXsyevBatched_bufferSize`] and [`cusolverDnXsyevBatched`]:
9783    ///
9784    /// 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:
9785    ///
9786    /// **Valid combination of data type and compute type**
9787    ///
9788    /// | **DataTypeA** | **DataTypeW** | **ComputeType** | **Meaning** |
9789    /// | --- | --- | --- | --- |
9790    /// | `CUDA_R_32F` | `CUDA_R_32F` | `CUDA_R_32F` | `SSYEVBATCHED` |
9791    /// | `CUDA_R_64F` | `CUDA_R_64F` | `CUDA_R_64F` | `DSYEVBATCHED` |
9792    /// | `CUDA_C_32F` | `CUDA_R_32F` | `CUDA_C_32F` | `CSYEVBATCHED` |
9793    /// | `CUDA_C_64F` | `CUDA_R_64F` | `CUDA_C_64F` | `ZSYEVBATCHED` |
9794    ///
9795    /// # Parameters
9796    ///
9797    /// - `handle`: Handle to the cuSolverDN library context.
9798    /// - `params`: Structure with information collected by [`cusolverDnSetAdvOptions`].
9799    /// - `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.
9800    /// - `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.
9801    /// - `n`: Number of rows (or columns) of matrix `A`.
9802    /// - `dataTypeA`: Data type of array `A`.
9803    /// - `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.
9804    /// - `lda`: Leading dimension of two-dimensional array used to store matrix `Aj`.`lda` is not less than `max(1,n)`.
9805    /// - `dataTypeW`: Data type of array `W`.
9806    /// - `W`: A real array of dimension `n * batchSize`. The eigenvalue values of `Aj`, in ascending order, i.e., sorted so that `Wj(i) &lt;= Wj(i+1)`.
9807    /// - `computeType`: Data type of computation.
9808    /// - `bufferOnDevice`: Device workspace. Array of type `void` of size `workspaceInBytesOnDevice` bytes.
9809    /// - `workspaceInBytesOnDevice`: Size in bytes of `bufferOnDevice`, returned by [`cusolverDnXsyevBatched_bufferSize`].
9810    /// - `bufferOnHost`: Host workspace. Array of type `void` of size `workspaceInBytesOnHost` bytes.
9811    /// - `workspaceInBytesOnHost`: Size in bytes of `bufferOnHost`, returned by [`cusolverDnXsyevBatched_bufferSize`].
9812    /// - `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.
9813    /// - `batchSize`: Number of matrices. `batchSize` is not less than 1.
9814    ///
9815    /// # Return value
9816    ///
9817    /// - [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]: An internal operation failed.
9818    /// - [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]: Invalid parameters were passed (`n&lt;0`, or `n`lda`batchSize>INT32_MAX`, or `lda&lt;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&lt;0`).
9819    /// - [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]: The library was not initialized.
9820    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The operation completed successfully.
9821    pub fn cusolverDnXsyevBatched(
9822        handle: cusolverDnHandle_t,
9823        params: cusolverDnParams_t,
9824        jobz: cusolverEigMode_t,
9825        uplo: cublasFillMode_t,
9826        n: i64,
9827        dataTypeA: cudaDataType,
9828        A: *mut ::core::ffi::c_void,
9829        lda: i64,
9830        dataTypeW: cudaDataType,
9831        W: *mut ::core::ffi::c_void,
9832        computeType: cudaDataType,
9833        bufferOnDevice: *mut ::core::ffi::c_void,
9834        workspaceInBytesOnDevice: size_t,
9835        bufferOnHost: *mut ::core::ffi::c_void,
9836        workspaceInBytesOnHost: size_t,
9837        info: *mut ::core::ffi::c_int,
9838        batchSize: i64,
9839    ) -> cusolverStatus_t;
9840}
9841unsafe extern "C" {
9842    pub fn cusolverDnXsyevdx_bufferSize(
9843        handle: cusolverDnHandle_t,
9844        params: cusolverDnParams_t,
9845        jobz: cusolverEigMode_t,
9846        range: cusolverEigRange_t,
9847        uplo: cublasFillMode_t,
9848        n: i64,
9849        dataTypeA: cudaDataType,
9850        A: *const ::core::ffi::c_void,
9851        lda: i64,
9852        vl: *mut ::core::ffi::c_void,
9853        vu: *mut ::core::ffi::c_void,
9854        il: i64,
9855        iu: i64,
9856        h_meig: *mut i64,
9857        dataTypeW: cudaDataType,
9858        W: *const ::core::ffi::c_void,
9859        computeType: cudaDataType,
9860        workspaceInBytesOnDevice: *mut size_t,
9861        workspaceInBytesOnHost: *mut size_t,
9862    ) -> cusolverStatus_t;
9863}
9864unsafe extern "C" {
9865    /// The helper functions below can calculate the sizes needed for pre-allocated buffer.
9866    ///
9867    /// The following routine:
9868    ///
9869    /// 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:
9870    /// $$
9871    /// A\\*V = V\\*\Lambda
9872    /// $$
9873    ///
9874    /// 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.
9875    ///
9876    /// 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`].
9877    ///
9878    /// 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.
9879    ///
9880    /// 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.
9881    ///
9882    /// Currently, [`cusolverDnXsyevdx`] supports only the default algorithm.
9883    ///
9884    /// Please visit [cuSOLVER Library Samples - Xsyevdx](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/Xsyevdx) for a code example.
9885    ///
9886    /// **Algorithms supported by cusolverDnXsyevdx**
9887    ///
9888    /// |  |  |
9889    /// | --- | --- |
9890    /// | [`cusolverAlgMode_t::CUSOLVER_ALG_0`] or `NULL` | Default algorithm. |
9891    ///
9892    /// List of input arguments for [`cusolverDnXsyevdx_bufferSize`] and [`cusolverDnXsyevdx`]:
9893    ///
9894    /// 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:
9895    ///
9896    /// **Valid combination of data type and compute type**
9897    ///
9898    /// | **DataTypeA** | **DataTypeW** | **ComputeType** | **Meaning** |
9899    /// | --- | --- | --- | --- |
9900    /// | `CUDA_R_32F` | `CUDA_R_32F` | `CUDA_R_32F` | `SSYEVDX` |
9901    /// | `CUDA_R_64F` | `CUDA_R_64F` | `CUDA_R_64F` | `DSYEVDX` |
9902    /// | `CUDA_C_32F` | `CUDA_R_32F` | `CUDA_C_32F` | `CHEEVDX` |
9903    /// | `CUDA_C_64F` | `CUDA_R_64F` | `CUDA_C_64F` | `ZHEEVDX` |
9904    ///
9905    /// # Parameters
9906    ///
9907    /// - `handle`: Handle to the cuSolverDN library context.
9908    /// - `params`: Structure with information collected by [`cusolverDnSetAdvOptions`].
9909    /// - `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.
9910    /// - `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;.
9911    /// - `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.
9912    /// - `n`: Number of rows (or columns) of matrix `A`.
9913    /// - `dataTypeA`: Data type of array `A`.
9914    /// - `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.
9915    /// - `lda`: Leading dimension of two-dimensional array used to store matrix `A`.`lda` is not less than `max(1,n)`.
9916    /// - `dataTypeW`: Data type of array `W`.
9917    /// - `W`: A real array of dimension `n`. The eigenvalue values of `A`, in ascending order, i.e., sorted so that `W(i) &lt;= W(i+1)`.
9918    /// - `computeType`: Data type of computation.
9919    /// - `bufferOnDevice`: Device workspace. Array of type `void` of size `workspaceInBytesOnDevice` bytes.
9920    /// - `workspaceInBytesOnDevice`: Size in bytes of `bufferOnDevice`, returned by [`cusolverDnXsyevdx_bufferSize`].
9921    /// - `bufferOnHost`: Host workspace. Array of type `void` of size `workspaceInBytesOnHost` bytes.
9922    /// - `workspaceInBytesOnHost`: Size in bytes of `bufferOnHost`, returned by [`cusolverDnXsyevdx_bufferSize`].
9923    /// - `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.
9924    ///
9925    /// # Return value
9926    ///
9927    /// - [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]: An internal operation failed.
9928    /// - [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]: Invalid parameters were passed (`n&lt;0`, or `lda&lt;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`]).
9929    /// - [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]: The library was not initialized.
9930    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The operation completed successfully.
9931    pub fn cusolverDnXsyevdx(
9932        handle: cusolverDnHandle_t,
9933        params: cusolverDnParams_t,
9934        jobz: cusolverEigMode_t,
9935        range: cusolverEigRange_t,
9936        uplo: cublasFillMode_t,
9937        n: i64,
9938        dataTypeA: cudaDataType,
9939        A: *mut ::core::ffi::c_void,
9940        lda: i64,
9941        vl: *mut ::core::ffi::c_void,
9942        vu: *mut ::core::ffi::c_void,
9943        il: i64,
9944        iu: i64,
9945        meig64: *mut i64,
9946        dataTypeW: cudaDataType,
9947        W: *mut ::core::ffi::c_void,
9948        computeType: cudaDataType,
9949        bufferOnDevice: *mut ::core::ffi::c_void,
9950        workspaceInBytesOnDevice: size_t,
9951        bufferOnHost: *mut ::core::ffi::c_void,
9952        workspaceInBytesOnHost: size_t,
9953        info: *mut ::core::ffi::c_int,
9954    ) -> cusolverStatus_t;
9955}
9956unsafe extern "C" {
9957    pub fn cusolverDnXgeev_bufferSize(
9958        handle: cusolverDnHandle_t,
9959        params: cusolverDnParams_t,
9960        jobvl: cusolverEigMode_t,
9961        jobvr: cusolverEigMode_t,
9962        n: i64,
9963        dataTypeA: cudaDataType,
9964        A: *const ::core::ffi::c_void,
9965        lda: i64,
9966        dataTypeW: cudaDataType,
9967        W: *const ::core::ffi::c_void,
9968        dataTypeVL: cudaDataType,
9969        VL: *const ::core::ffi::c_void,
9970        ldvl: i64,
9971        dataTypeVR: cudaDataType,
9972        VR: *const ::core::ffi::c_void,
9973        ldvr: i64,
9974        computeType: cudaDataType,
9975        workspaceInBytesOnDevice: *mut size_t,
9976        workspaceInBytesOnHost: *mut size_t,
9977    ) -> cusolverStatus_t;
9978}
9979unsafe extern "C" {
9980    /// The helper functions below can calculate the sizes needed for pre-allocated buffer.
9981    ///
9982    /// The following routine:
9983    ///
9984    /// 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:
9985    /// $$
9986    /// A\\*v(j) = w(j)\\*v(j)
9987    /// $$
9988    ///
9989    /// where `w(j)` is its eigenvalue. The left eigenvalue `u(j)` of `A` satisfies:
9990    /// $$
9991    /// u(j)^{H}\\*A = w(j)\\*v(j)^{H}
9992    /// $$
9993    ///
9994    /// where $u(j)^{H}$ denotes the conjugate-transpose of `u(j)`.
9995    ///
9996    /// The computed eigenvectors are normalized to have Euclidean norm equal to 1 and largest component real.
9997    ///
9998    /// 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.
9999    ///
10000    /// 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`].
10001    ///
10002    /// 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.
10003    ///
10004    /// Remark 1: `geev` only supports the computation of right eigenvectors. So, `jobvl` = [`cusolverEigMode_t::CUSOLVER_EIG_MODE_NOVECTOR`] must be set.
10005    ///
10006    /// Remark 2: `geev` uses balancing to improve the conditioning of the eigenvalues and eigenvectors.
10007    ///
10008    /// Remark 3: `geev` is a hybrid CPU-GPU algorithm. Best performance is attained with pinned host memory.
10009    ///
10010    /// Currently, [`cusolverDnXgeev`] supports only the default algorithm.
10011    ///
10012    /// Please visit [cuSOLVER Library Samples - Xgeev](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/Xgeev) for a code example.
10013    ///
10014    /// **Table of algorithms supported by cusolverDnXgeev**
10015    ///
10016    /// |  |  |
10017    /// | --- | --- |
10018    /// | [`cusolverAlgMode_t::CUSOLVER_ALG_0`] or `NULL` | Default algorithm. |
10019    ///
10020    /// List of input arguments for [`cusolverDnXgeev_bufferSize`] and [`cusolverDnXgeev`]:
10021    ///
10022    /// 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:
10023    ///
10024    /// **Valid combination of data type and compute type**
10025    ///
10026    /// | **DataTypeA** | **DataTypeW** | **DataTypeVL** | **DataTypeVR** | **ComputeType** | **Meaning** |
10027    /// | --- | --- | --- | --- | --- | --- |
10028    /// | `CUDA_R_32F` | `CUDA_R_32F` | `CUDA_R_32F` | `CUDA_R_32F` | `CUDA_R_32F` | `SGEEV` |
10029    /// | `CUDA_R_32F` | `CUDA_C_32F` | `CUDA_R_32F` | `CUDA_R_32F` | `CUDA_R_32F` | 32F mixed real-complex |
10030    /// | `CUDA_R_64F` | `CUDA_R_64F` | `CUDA_R_64F` | `CUDA_R_64F` | `CUDA_R_64F` | `DGEEV` |
10031    /// | `CUDA_R_64F` | `CUDA_C_64F` | `CUDA_R_64F` | `CUDA_R_64F` | `CUDA_R_64F` | 64F mixed real-complex |
10032    /// | `CUDA_C_32F` | `CUDA_C_32F` | `CUDA_C_32F` | `CUDA_C_32F` | `CUDA_C_32F` | `CGEEV` |
10033    /// | `CUDA_C_64F` | `CUDA_C_64F` | `CUDA_C_64F` | `CUDA_C_64F` | `CUDA_C_64F` | `ZGEEV` |
10034    ///
10035    /// # Parameters
10036    ///
10037    /// - `handle`: Handle to the cuSolverDN library context.
10038    /// - `params`: Structure with information collected by [`cusolverDnSetAdvOptions`].
10039    /// - `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.
10040    /// - `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.
10041    /// - `n`: Number of rows (or columns) of matrix `A`.
10042    /// - `dataTypeA`: Data type of array `A`.
10043    /// - `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.
10044    /// - `lda`: Leading dimension of two-dimensional array used to store matrix `A`.
10045    /// - `dataTypeW`: Data type of array `W`.
10046    /// - `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.
10047    /// - `dataTypeVL`: Data type of array `VL`.
10048    /// - `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.
10049    /// - `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`.
10050    /// - `dataTypeVR`: Data type of array `VR`.
10051    /// - `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.
10052    /// - `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`.
10053    /// - `computeType`: Data type of computation.
10054    /// - `bufferOnDevice`: Device workspace. Array of type `void` of size `workspaceInBytesOnDevice` bytes.
10055    /// - `workspaceInBytesOnDevice`: Size in bytes of `bufferOnDevice`, returned by [`cusolverDnXgeev_bufferSize`].
10056    /// - `bufferOnHost`: Host workspace. Array of type `void` of size `workspaceInBytesOnHost` bytes.
10057    /// - `workspaceInBytesOnHost`: Size in bytes of `bufferOnHost`, returned by [`cusolverDnXgeev_bufferSize`].
10058    /// - `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.
10059    ///
10060    /// # Return value
10061    ///
10062    /// - [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]: An internal operation failed.
10063    /// - [`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&lt;0`, or `lda &lt; max(1,n)`, or `ldvl &lt; n` if `jobvl` is [`cusolverEigMode_t::CUSOLVER_EIG_MODE_VECTOR`], or `ldvr &lt; n` if `jobvr` is [`cusolverEigMode_t::CUSOLVER_EIG_MODE_VECTOR`]).
10064    /// - [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]: The library was not initialized.
10065    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The operation completed successfully.
10066    pub fn cusolverDnXgeev(
10067        handle: cusolverDnHandle_t,
10068        params: cusolverDnParams_t,
10069        jobvl: cusolverEigMode_t,
10070        jobvr: cusolverEigMode_t,
10071        n: i64,
10072        dataTypeA: cudaDataType,
10073        A: *mut ::core::ffi::c_void,
10074        lda: i64,
10075        dataTypeW: cudaDataType,
10076        W: *mut ::core::ffi::c_void,
10077        dataTypeVL: cudaDataType,
10078        VL: *mut ::core::ffi::c_void,
10079        ldvl: i64,
10080        dataTypeVR: cudaDataType,
10081        VR: *mut ::core::ffi::c_void,
10082        ldvr: i64,
10083        computeType: cudaDataType,
10084        bufferOnDevice: *mut ::core::ffi::c_void,
10085        workspaceInBytesOnDevice: size_t,
10086        bufferOnHost: *mut ::core::ffi::c_void,
10087        workspaceInBytesOnHost: size_t,
10088        info: *mut ::core::ffi::c_int,
10089    ) -> cusolverStatus_t;
10090}
10091unsafe extern "C" {
10092    pub fn cusolverDnXgesvd_bufferSize(
10093        handle: cusolverDnHandle_t,
10094        params: cusolverDnParams_t,
10095        jobu: ::core::ffi::c_schar,
10096        jobvt: ::core::ffi::c_schar,
10097        m: i64,
10098        n: i64,
10099        dataTypeA: cudaDataType,
10100        A: *const ::core::ffi::c_void,
10101        lda: i64,
10102        dataTypeS: cudaDataType,
10103        S: *const ::core::ffi::c_void,
10104        dataTypeU: cudaDataType,
10105        U: *const ::core::ffi::c_void,
10106        ldu: i64,
10107        dataTypeVT: cudaDataType,
10108        VT: *const ::core::ffi::c_void,
10109        ldvt: i64,
10110        computeType: cudaDataType,
10111        workspaceInBytesOnDevice: *mut size_t,
10112        workspaceInBytesOnHost: *mut size_t,
10113    ) -> cusolverStatus_t;
10114}
10115unsafe extern "C" {
10116    /// The helper functions below can calculate the sizes needed for pre-allocated buffer.
10117    ///
10118    /// The following routine:
10119    ///
10120    /// 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:
10121    /// $$
10122    /// A = U\\*\Sigma\\*V^{H}
10123    /// $$
10124    ///
10125    /// 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`.
10126    ///
10127    /// 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`].
10128    ///
10129    /// 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.
10130    ///
10131    /// Currently, [`cusolverDnXgesvd`] supports only the default algorithm.
10132    ///
10133    /// **Algorithms supported by cusolverDnXgesvd**
10134    ///
10135    /// |  |  |
10136    /// | --- | --- |
10137    /// | [`cusolverAlgMode_t::CUSOLVER_ALG_0`] or `NULL` | Default algorithm. |
10138    ///
10139    /// Please visit [cuSOLVER Library Samples - Xgesvd](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/Xgesvd) for a code example.
10140    ///
10141    /// Remark 1: `gesvd` only supports `m>=n`.
10142    ///
10143    /// Remark 2: the routine returns $V^H$, not `V`.
10144    ///
10145    /// List of input arguments for [`cusolverDnXgesvd_bufferSize`] and [`cusolverDnXgesvd`]:
10146    ///
10147    /// 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.
10148    ///
10149    /// **Valid combination of data type and compute type**
10150    ///
10151    /// | **DataTypeA** | **DataTypeS** | **DataTypeU** | **DataTypeVT** | **ComputeType** | **Meaning** |
10152    /// | --- | --- | --- | --- | --- | --- |
10153    /// | `CUDA_R_32F` | `CUDA_R_32F` | `CUDA_R_32F` | `CUDA_R_32F` | `CUDA_R_32F` | `SGESVD` |
10154    /// | `CUDA_R_64F` | `CUDA_R_64F` | `CUDA_R_64F` | `CUDA_R_64F` | `CUDA_R_64F` | `DGESVD` |
10155    /// | `CUDA_C_32F` | `CUDA_R_32F` | `CUDA_C_32F` | `CUDA_C_32F` | `CUDA_C_32F` | `CGESVD` |
10156    /// | `CUDA_C_64F` | `CUDA_R_64F` | `CUDA_C_64F` | `CUDA_C_64F` | `CUDA_C_64F` | `ZGESVD` |
10157    ///
10158    /// # Parameters
10159    ///
10160    /// - `handle`: Handle to the cuSolverDN library context.
10161    /// - `params`: Structure with information collected by [`cusolverDnSetAdvOptions`].
10162    /// - `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.
10163    /// - `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.
10164    /// - `m`: Number of rows of matrix `A`.
10165    /// - `n`: Number of columns of matrix `A`.
10166    /// - `dataTypeA`: Data type of array `A`.
10167    /// - `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.
10168    /// - `lda`: Leading dimension of two-dimensional array used to store matrix `A`.
10169    /// - `dataTypeS`: Data type of array `S`.
10170    /// - `S`: Real array of dimension `min(m,n)`. The singular values of A, sorted so that `S(i) >= S(i+1)`.
10171    /// - `dataTypeU`: Data type of array `U`.
10172    /// - `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.
10173    /// - `ldu`: Leading dimension of two-dimensional array used to store matrix `U`. If `jobu` = ‘A’ or ‘S’, `ldu >= max(1,m)`. Otherwise, `ldu >= 1`.
10174    /// - `dataTypeVT`: Data type of array `VT`.
10175    /// - `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.
10176    /// - `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`.
10177    /// - `computeType`: Data type of computation.
10178    /// - `bufferOnDevice`: Device workspace. Array of type `void` of size `workspaceInBytesOnDevice` bytes.
10179    /// - `workspaceInBytesOnDevice`: Size in bytes of `bufferOnDevice`, returned by [`cusolverDnXgesvd_bufferSize`].
10180    /// - `bufferOnHost`: Host workspace. Array of type `void` of size `workspaceInBytesOnHost` bytes.
10181    /// - `workspaceInBytesOnHost`: Size in bytes of `bufferOnHost`, returned by [`cusolverDnXgesvd_bufferSize`].
10182    /// - `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.
10183    ///
10184    /// # Return value
10185    ///
10186    /// - [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]: An internal operation failed.
10187    /// - [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]: Invalid parameters were passed (`m,n&lt;0`, or `lda&lt;max(1,m)`, or `ldu&lt;1`, or if `jobu` = 'S' or 'A', `ldu` &lt; m, or `ldvt&lt;1`, or if `jobvt` = ‘A’ `ldvt&lt;n`, or if `jobvt` = ‘S’ `ldvt&lt;min(m,n)`, or `jobu`, `jobvt` are none of ‘N’, ‘O’, ‘S’, ‘A’, or `jobu` = `jobvt` = ‘O’ ).
10188    /// - [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]: The library was not initialized.
10189    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The operation completed successfully.
10190    pub fn cusolverDnXgesvd(
10191        handle: cusolverDnHandle_t,
10192        params: cusolverDnParams_t,
10193        jobu: ::core::ffi::c_schar,
10194        jobvt: ::core::ffi::c_schar,
10195        m: i64,
10196        n: i64,
10197        dataTypeA: cudaDataType,
10198        A: *mut ::core::ffi::c_void,
10199        lda: i64,
10200        dataTypeS: cudaDataType,
10201        S: *mut ::core::ffi::c_void,
10202        dataTypeU: cudaDataType,
10203        U: *mut ::core::ffi::c_void,
10204        ldu: i64,
10205        dataTypeVT: cudaDataType,
10206        VT: *mut ::core::ffi::c_void,
10207        ldvt: i64,
10208        computeType: cudaDataType,
10209        bufferOnDevice: *mut ::core::ffi::c_void,
10210        workspaceInBytesOnDevice: size_t,
10211        bufferOnHost: *mut ::core::ffi::c_void,
10212        workspaceInBytesOnHost: size_t,
10213        info: *mut ::core::ffi::c_int,
10214    ) -> cusolverStatus_t;
10215}
10216unsafe extern "C" {
10217    pub fn cusolverDnXgesvdp_bufferSize(
10218        handle: cusolverDnHandle_t,
10219        params: cusolverDnParams_t,
10220        jobz: cusolverEigMode_t,
10221        econ: ::core::ffi::c_int,
10222        m: i64,
10223        n: i64,
10224        dataTypeA: cudaDataType,
10225        A: *const ::core::ffi::c_void,
10226        lda: i64,
10227        dataTypeS: cudaDataType,
10228        S: *const ::core::ffi::c_void,
10229        dataTypeU: cudaDataType,
10230        U: *const ::core::ffi::c_void,
10231        ldu: i64,
10232        dataTypeV: cudaDataType,
10233        V: *const ::core::ffi::c_void,
10234        ldv: i64,
10235        computeType: cudaDataType,
10236        workspaceInBytesOnDevice: *mut size_t,
10237        workspaceInBytesOnHost: *mut size_t,
10238    ) -> cusolverStatus_t;
10239}
10240unsafe extern "C" {
10241    /// The helper functions below can calculate the sizes needed for pre-allocated buffer.
10242    ///
10243    /// The routine below:
10244    ///
10245    /// 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:
10246    /// $$
10247    /// A = U\\*\Sigma\\*V^H
10248    /// $$
10249    ///
10250    /// 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`.
10251    ///
10252    /// [`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.
10253    ///
10254    /// 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`].
10255    ///
10256    /// If output parameter `info = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
10257    ///
10258    /// Currently, [`cusolverDnXgesvdp`] supports only the default algorithm.
10259    ///
10260    /// **Algorithms supported by cusolverDnXgesvdp**
10261    ///
10262    /// |  |  |
10263    /// | --- | --- |
10264    /// | [`cusolverAlgMode_t::CUSOLVER_ALG_0`] or `NULL` | Default algorithm. |
10265    ///
10266    /// Please visit [cuSOLVER Library Samples - Xgesvdp](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/Xgesvdp) for a code example.
10267    ///
10268    /// Remark 1: `gesvdp` supports `n>=m` as well.
10269    ///
10270    /// Remark 2: the routine returns `V`, not $V^{H}$
10271    ///
10272    /// List of input arguments for [`cusolverDnXgesvdp_bufferSize`] and [`cusolverDnXgesvdp`]:
10273    ///
10274    /// 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:
10275    ///
10276    /// **Valid combination of data type and compute type**
10277    ///
10278    /// | **DataTypeA** | **DataTypeS** | **DataTypeU** | **DataTypeV** | **ComputeType** | **Meaning** |
10279    /// | --- | --- | --- | --- | --- | --- |
10280    /// | `CUDA_R_32F` | `CUDA_R_32F` | `CUDA_R_32F` | `CUDA_R_32F` | `CUDA_R_32F` | `SGESVDP` |
10281    /// | `CUDA_R_64F` | `CUDA_R_64F` | `CUDA_R_64F` | `CUDA_R_64F` | `CUDA_R_64F` | `DGESVDP` |
10282    /// | `CUDA_C_32F` | `CUDA_R_32F` | `CUDA_C_32F` | `CUDA_C_32F` | `CUDA_C_32F` | `CGESVDP` |
10283    /// | `CUDA_C_64F` | `CUDA_R_64F` | `CUDA_C_64F` | `CUDA_C_64F` | `CUDA_C_64F` | `ZGESVDP` |
10284    ///
10285    /// # Parameters
10286    ///
10287    /// - `handle`: Handle to the cuSolverDN library context.
10288    /// - `params`: Structure with information collected by [`cusolverDnSetAdvOptions`].
10289    /// - `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.
10290    /// - `econ`: `econ = 1` for economy size for `U` and `V`.
10291    /// - `m`: Number of rows of matrix `A`.
10292    /// - `n`: Number of columns of matrix `A`.
10293    /// - `dataTypeA`: Data type of array `A`.
10294    /// - `A`: Array of dimension `lda * n` with `lda` is not less than `max(1,m)`. On exit, the contents of `A` are destroyed.
10295    /// - `lda`: Leading dimension of two-dimensional array used to store matrix `A`.
10296    /// - `dataTypeS`: Data type of array `S`.
10297    /// - `S`: Real array of dimension `min(m,n)`. The singular values of A, sorted so that `S(i) >= S(i+1)`.
10298    /// - `dataTypeU`: Data type of array `U`.
10299    /// - `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`.
10300    /// - `ldu`: Leading dimension of two-dimensional array used to store matrix `U`.
10301    /// - `dataTypeV`: Data type of array `V`.
10302    /// - `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`.
10303    /// - `ldv`: Leading dimension of two-dimensional array used to store matrix `V`.
10304    /// - `computeType`: Data type of computation.
10305    /// - `bufferOnDevice`: Device workspace. Array of type `void` of size `workspaceInBytesOnDevice` bytes.
10306    /// - `workspaceInBytesOnDevice`: Size in bytes of `bufferOnDevice`, returned by [`cusolverDnXgesvdp_bufferSize`].
10307    /// - `bufferOnHost`: Host workspace. Array of type `void` of size `workspaceInBytesOnHost` bytes.
10308    /// - `workspaceInBytesOnHost`: Size in bytes of `bufferOnHost`, returned by [`cusolverDnXgesvdp_bufferSize`].
10309    /// - `h_err_sigma`: Magnitude of the perturbation, showing the accuracy of SVD.
10310    ///
10311    /// # Return value
10312    ///
10313    /// - [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]: An internal operation failed.
10314    /// - [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]: Invalid parameters were passed (`m,n&lt;0` or `lda&lt;max(1,m)` or `ldu&lt;max(1,m)` or `ldv&lt;max(1,n)`).
10315    /// - [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]: The library was not initialized.
10316    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The operation completed successfully.
10317    pub fn cusolverDnXgesvdp(
10318        handle: cusolverDnHandle_t,
10319        params: cusolverDnParams_t,
10320        jobz: cusolverEigMode_t,
10321        econ: ::core::ffi::c_int,
10322        m: i64,
10323        n: i64,
10324        dataTypeA: cudaDataType,
10325        A: *mut ::core::ffi::c_void,
10326        lda: i64,
10327        dataTypeS: cudaDataType,
10328        S: *mut ::core::ffi::c_void,
10329        dataTypeU: cudaDataType,
10330        U: *mut ::core::ffi::c_void,
10331        ldu: i64,
10332        dataTypeV: cudaDataType,
10333        V: *mut ::core::ffi::c_void,
10334        ldv: i64,
10335        computeType: cudaDataType,
10336        bufferOnDevice: *mut ::core::ffi::c_void,
10337        workspaceInBytesOnDevice: size_t,
10338        bufferOnHost: *mut ::core::ffi::c_void,
10339        workspaceInBytesOnHost: size_t,
10340        d_info: *mut ::core::ffi::c_int,
10341        h_err_sigma: *mut f64,
10342    ) -> cusolverStatus_t;
10343}
10344unsafe extern "C" {
10345    pub fn cusolverDnXgesvdr_bufferSize(
10346        handle: cusolverDnHandle_t,
10347        params: cusolverDnParams_t,
10348        jobu: ::core::ffi::c_schar,
10349        jobv: ::core::ffi::c_schar,
10350        m: i64,
10351        n: i64,
10352        k: i64,
10353        p: i64,
10354        niters: i64,
10355        dataTypeA: cudaDataType,
10356        A: *const ::core::ffi::c_void,
10357        lda: i64,
10358        dataTypeSrand: cudaDataType,
10359        Srand: *const ::core::ffi::c_void,
10360        dataTypeUrand: cudaDataType,
10361        Urand: *const ::core::ffi::c_void,
10362        ldUrand: i64,
10363        dataTypeVrand: cudaDataType,
10364        Vrand: *const ::core::ffi::c_void,
10365        ldVrand: i64,
10366        computeType: cudaDataType,
10367        workspaceInBytesOnDevice: *mut size_t,
10368        workspaceInBytesOnHost: *mut size_t,
10369    ) -> cusolverStatus_t;
10370}
10371unsafe extern "C" {
10372    /// The helper functions below can calculate the sizes needed for pre-allocated buffer.
10373    ///
10374    /// The routine below
10375    ///
10376    /// 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:
10377    /// $$
10378    /// A_{k}\approx U\\*\Sigma\\*V^{H}
10379    /// $$
10380    ///
10381    /// 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`.
10382    ///
10383    /// [`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.
10384    ///
10385    /// 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`].
10386    ///
10387    /// 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.
10388    ///
10389    /// 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`].
10390    ///
10391    /// If output parameter `info = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
10392    ///
10393    /// Currently, [`cusolverDnXgesvdr`] supports only the default algorithm.
10394    ///
10395    /// **Algorithms supported by cusolverDnXgesvdr**
10396    ///
10397    /// |  |  |
10398    /// | --- | --- |
10399    /// | [`cusolverAlgMode_t::CUSOLVER_ALG_0`] or `NULL` | Default algorithm. |
10400    ///
10401    /// Please visit [cuSOLVER Library Samples - Xgesvdr](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/Xgesvdr) for a code example.
10402    ///
10403    /// Remark 1: `gesvdr` supports `n>=m` as well.
10404    ///
10405    /// Remark 2: the routine returns `V`, not $V^{H}$
10406    ///
10407    /// List of input arguments for [`cusolverDnXgesvdr_bufferSize`] and [`cusolverDnXgesvdr`]:
10408    ///
10409    /// 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.
10410    ///
10411    /// **Valid combination of data type and compute type**
10412    ///
10413    /// | **DataTypeA** | **DataTypeS** | **DataTypeU** | **DataTypeV** | **ComputeType** | **Meaning** |
10414    /// | --- | --- | --- | --- | --- | --- |
10415    /// | `CUDA_R_32F` | `CUDA_R_32F` | `CUDA_R_32F` | `CUDA_R_32F` | `CUDA_R_32F` | `SGESVDR` |
10416    /// | `CUDA_R_64F` | `CUDA_R_64F` | `CUDA_R_64F` | `CUDA_R_64F` | `CUDA_R_64F` | `DGESVDR` |
10417    /// | `CUDA_C_32F` | `CUDA_R_32F` | `CUDA_C_32F` | `CUDA_C_32F` | `CUDA_C_32F` | `CGESVDR` |
10418    /// | `CUDA_C_64F` | `CUDA_R_64F` | `CUDA_C_64F` | `CUDA_C_64F` | `CUDA_C_64F` | `ZGESVDR` |
10419    ///
10420    /// # Parameters
10421    ///
10422    /// - `handle`: Handle to the cuSolverDN library context.
10423    /// - `params`: Structure with information collected by [`cusolverDnSetAdvOptions`].
10424    /// - `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.
10425    /// - `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.
10426    /// - `m`: Number of rows of matrix `A`.
10427    /// - `n`: Number of columns of matrix `A`.
10428    /// - `k`: Rank of the k-SVD decomposition of matrix `A`. `rank` is less than `min(m,n)`.
10429    /// - `p`: Oversampling. The size of the subspace will be `(k + p)`. `(k+p)` is less than `min(m,n)`.
10430    /// - `niters`: Number of iteration of power method.
10431    /// - `dataTypeA`: Data type of array `A`.
10432    /// - `A`: Array of dimension `lda * n` with `lda` is not less than `max(1,m)`. On exit, the contents of `A` are destroyed.
10433    /// - `lda`: Leading dimension of two-dimensional array used to store matrix `A`.
10434    /// - `computeType`: Data type of computation.
10435    /// - `bufferOnDevice`: Device workspace. Array of type `void` of size `workspaceInBytesOnDevice` bytes.
10436    /// - `workspaceInBytesOnDevice`: Size in bytes of `bufferOnDevice`, returned by [`cusolverDnXgesvdr_bufferSize`].
10437    /// - `bufferOnHost`: Host workspace. Array of type `void` of size `workspaceInBytesOnHost` bytes.
10438    /// - `workspaceInBytesOnHost`: Size in bytes of `bufferOnHost`, returned by [`cusolverDnXgesvdr_bufferSize`].
10439    /// - `d_info`: If `info = 0`, the operation is successful. If `info = -i`, the `i-th` parameter is wrong (not counting handle).
10440    ///
10441    /// # Return value
10442    ///
10443    /// - [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]: An internal operation failed.
10444    /// - [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]: Invalid parameters were passed (`m,n&lt;0` or `lda&lt;max(1,m)` or `ldu&lt;max(1,m)` or `ldv&lt;max(1,n)` ).
10445    /// - [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]: The library was not initialized.
10446    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The operation completed successfully.
10447    pub fn cusolverDnXgesvdr(
10448        handle: cusolverDnHandle_t,
10449        params: cusolverDnParams_t,
10450        jobu: ::core::ffi::c_schar,
10451        jobv: ::core::ffi::c_schar,
10452        m: i64,
10453        n: i64,
10454        k: i64,
10455        p: i64,
10456        niters: i64,
10457        dataTypeA: cudaDataType,
10458        A: *mut ::core::ffi::c_void,
10459        lda: i64,
10460        dataTypeSrand: cudaDataType,
10461        Srand: *mut ::core::ffi::c_void,
10462        dataTypeUrand: cudaDataType,
10463        Urand: *mut ::core::ffi::c_void,
10464        ldUrand: i64,
10465        dataTypeVrand: cudaDataType,
10466        Vrand: *mut ::core::ffi::c_void,
10467        ldVrand: i64,
10468        computeType: cudaDataType,
10469        bufferOnDevice: *mut ::core::ffi::c_void,
10470        workspaceInBytesOnDevice: size_t,
10471        bufferOnHost: *mut ::core::ffi::c_void,
10472        workspaceInBytesOnHost: size_t,
10473        d_info: *mut ::core::ffi::c_int,
10474    ) -> cusolverStatus_t;
10475}
10476unsafe extern "C" {
10477    pub fn cusolverDnXlarft_bufferSize(
10478        handle: cusolverDnHandle_t,
10479        params: cusolverDnParams_t,
10480        direct: cusolverDirectMode_t,
10481        storev: cusolverStorevMode_t,
10482        n: i64,
10483        k: i64,
10484        dataTypeV: cudaDataType,
10485        V: *const ::core::ffi::c_void,
10486        ldv: i64,
10487        dataTypeTau: cudaDataType,
10488        tau: *const ::core::ffi::c_void,
10489        dataTypeT: cudaDataType,
10490        T: *mut ::core::ffi::c_void,
10491        ldt: i64,
10492        computeType: cudaDataType,
10493        workspaceInBytesOnDevice: *mut size_t,
10494        workspaceInBytesOnHost: *mut size_t,
10495    ) -> cusolverStatus_t;
10496}
10497unsafe extern "C" {
10498    /// The helper functions below can calculate the sizes needed for pre-allocated buffer.
10499    ///
10500    /// The following routine:
10501    ///
10502    /// forms the triangular factor `T` of a real block reflector `H` of order `n`, which is defined as a product of `k` elementary reflectors.
10503    /// If:
10504    ///
10505    /// 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).
10506    ///
10507    /// 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`].
10508    ///
10509    /// Currently, only `n >= k` scenario is supported.
10510    ///
10511    /// The generic API has four different types:
10512    ///
10513    /// [`cusolverDnXlarft`] only supports the following four combinations.
10514    ///
10515    /// **Valid combinations of data types and compute types**
10516    ///
10517    /// | **DataTypeV** | **DataTypeTau** | **DataTypeT** | **ComputeType** | **Meaning** |
10518    /// | --- | --- | --- | --- | --- |
10519    /// | `CUDA_R_32F` | `CUDA_R_32F` | `CUDA_R_32F` | `CUDA_R_32F` | `SLARFT` |
10520    /// | `CUDA_R_64F` | `CUDA_R_64F` | `CUDA_R_64F` | `CUDA_R_64F` | `DLARFT` |
10521    /// | `CUDA_C_32F` | `CUDA_C_32F` | `CUDA_C_32F` | `CUDA_C_32F` | `CLARFT` |
10522    /// | `CUDA_C_64F` | `CUDA_C_64F` | `CUDA_C_64F` | `CUDA_C_64F` | `ZLARFT` |
10523    ///
10524    /// # Parameters
10525    ///
10526    /// - `handle`: Handle to the cuSolverDN library context.
10527    /// - `params`: Structure with information collected by [`cusolverDnSetAdvOptions`].
10528    /// - `direct`: Specifies the order in which the elementary reflectors are multiplied to form the block reflector.
10529    /// - `storev`: Specifies how the vectors which define the elementary reflectors are stored.
10530    /// - `n`: The order of the block reflector `H`. `n >= 0`.
10531    /// - `k`: The order of the triangular factor `T` (= the number of elementary reflectors). `k >= 1`.
10532    /// - `dataTypeV`: Data type of array `V`.
10533    /// - `V`: The matrix `V` of dimension `lda * k`.
10534    /// - `ldv`: Leading dimension of the array `V`. `ldv >= max(1,n)`.
10535    /// - `dataTypeTau`: Data type of array `tau`.
10536    /// - `tau`: Dimension `k`. `tau(i)` must contain the scalar factor of the elementary reflector `H(i)`.
10537    /// - `dataTypeT`: Data type of array `T`.
10538    /// - `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.
10539    /// - `ldt`: The leading dimension of the array `T`. `ldt >= k`.
10540    /// - `computeType`: Data type of computation.
10541    /// - `bufferOnDevice`: Device workspace. Array of type `void` of size `workspaceInBytesOnDevice` bytes.
10542    /// - `workspaceInBytesOnDevice`: Size in bytes of `bufferOnDevice`, returned by [`cusolverDnXlarft_bufferSize`].
10543    /// - `bufferOnHost`: Host workspace. Array of type `void` of size `workspaceInBytesOnHost` bytes.
10544    /// - `workspaceInBytesOnHost`: Size in bytes of `bufferOnHost`, returned by [`cusolverDnXlarft_bufferSize`].
10545    ///
10546    /// # Return value
10547    ///
10548    /// - [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]: An internal operation failed.
10549    /// - [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]: Invalid parameters were passed (`n == 0`, `k > n`, or `storev == CUBLAS_STOREV_ROWWISE`).
10550    /// - [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]: The library was not initialized.
10551    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The operation completed successfully.
10552    pub fn cusolverDnXlarft(
10553        handle: cusolverDnHandle_t,
10554        params: cusolverDnParams_t,
10555        direct: cusolverDirectMode_t,
10556        storev: cusolverStorevMode_t,
10557        n: i64,
10558        k: i64,
10559        dataTypeV: cudaDataType,
10560        V: *const ::core::ffi::c_void,
10561        ldv: i64,
10562        dataTypeTau: cudaDataType,
10563        tau: *const ::core::ffi::c_void,
10564        dataTypeT: cudaDataType,
10565        T: *mut ::core::ffi::c_void,
10566        ldt: i64,
10567        computeType: cudaDataType,
10568        bufferOnDevice: *mut ::core::ffi::c_void,
10569        workspaceInBytesOnDevice: size_t,
10570        bufferOnHost: *mut ::core::ffi::c_void,
10571        workspaceInBytesOnHost: size_t,
10572    ) -> cusolverStatus_t;
10573}
10574/// cusolverDnLoggerCallback_t is a callback function pointer type.
10575///
10576/// Use the below function to set the callback function: [`cusolverDnLoggerSetCallback`].
10577pub type cusolverDnLoggerCallback_t = ::core::option::Option<
10578    unsafe extern "C" fn(
10579        logLevel: ::core::ffi::c_int,
10580        functionName: *const ::core::ffi::c_char,
10581        message: *const ::core::ffi::c_char,
10582    ),
10583>;
10584unsafe extern "C" {
10585    /// This function sets the logging callback function.
10586    ///
10587    /// See [`cusolverStatus_t`] for a complete list of valid return codes.
10588    ///
10589    /// # Parameters
10590    ///
10591    /// - `callback`: Pointer to a callback function. See [`cusolverDnLoggerCallback_t`].
10592    ///
10593    /// # Return value
10594    ///
10595    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: If the callback function was successfully set.
10596    pub fn cusolverDnLoggerSetCallback(
10597        callback: cusolverDnLoggerCallback_t,
10598    ) -> cusolverStatus_t;
10599}
10600unsafe extern "C" {
10601    /// 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.
10602    ///
10603    /// See [`cusolverStatus_t`] for a complete list of valid return codes.
10604    ///
10605    /// # Parameters
10606    ///
10607    /// - `file`: Pointer to an open file. File should have write permission.
10608    ///
10609    /// # Return value
10610    ///
10611    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: If logging file was successfully set.
10612    pub fn cusolverDnLoggerSetFile(file: *mut FILE) -> cusolverStatus_t;
10613}
10614unsafe extern "C" {
10615    /// This function opens a logging output file in the given path.
10616    ///
10617    /// See [`cusolverStatus_t`] for a complete list of valid return codes.
10618    ///
10619    /// # Parameters
10620    ///
10621    /// - `logFile`: Path of the logging output file.
10622    ///
10623    /// # Return value
10624    ///
10625    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: If the logging file was successfully opened.
10626    pub fn cusolverDnLoggerOpenFile(
10627        logFile: *const ::core::ffi::c_char,
10628    ) -> cusolverStatus_t;
10629}
10630unsafe extern "C" {
10631    /// This function sets the value of the logging level.
10632    ///
10633    /// See [`cusolverStatus_t`] for a complete list of valid return codes.
10634    ///
10635    /// # Parameters
10636    ///
10637    /// - `level`: Value of the logging level. See cuSOLVERDn Logging.
10638    ///
10639    /// # Return value
10640    ///
10641    /// - [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]: If the value was not a valid logging level. See cuSOLVERDn Logging.
10642    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: If the logging level was successfully set.
10643    pub fn cusolverDnLoggerSetLevel(level: ::core::ffi::c_int) -> cusolverStatus_t;
10644}
10645unsafe extern "C" {
10646    /// This function sets the value of the logging mask.
10647    ///
10648    /// See [`cusolverStatus_t`] for a complete list of valid return codes.
10649    ///
10650    /// # Parameters
10651    ///
10652    /// - `mask`: Value of the logging mask. See cuSOLVERDn Logging.
10653    ///
10654    /// # Return value
10655    ///
10656    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: If the logging mask was successfully set.
10657    pub fn cusolverDnLoggerSetMask(mask: ::core::ffi::c_int) -> cusolverStatus_t;
10658}
10659unsafe extern "C" {
10660    /// This function disables logging for the entire run.
10661    ///
10662    /// See [`cusolverStatus_t`] for a complete list of valid return codes.
10663    ///
10664    /// # Return value
10665    ///
10666    /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: If logging was successfully disabled.
10667    pub fn cusolverDnLoggerForceDisable() -> cusolverStatus_t;
10668}