singe_cusolver_sys/sys_12202.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 = 2;
151pub const CUSOLVER_VER_PATCH: u32 = 2;
152pub const CUSOLVER_VER_BUILD: u32 = 18;
153pub const CUSOLVER_VERSION: u32 = 12202;
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 CUSOLVERDN_GEQRF = 3,
213}
214pub type size_t = ::core::ffi::c_ulong;
215pub type __uint64_t = ::core::ffi::c_ulong;
216pub type __off_t = ::core::ffi::c_long;
217pub type __off64_t = ::core::ffi::c_long;
218pub type FILE = _IO_FILE;
219#[repr(C)]
220#[derive(Debug, Copy, Clone)]
221pub struct _IO_marker {
222 _unused: [u8; 0],
223}
224#[repr(C)]
225#[derive(Debug, Copy, Clone)]
226pub struct _IO_codecvt {
227 _unused: [u8; 0],
228}
229#[repr(C)]
230#[derive(Debug, Copy, Clone)]
231pub struct _IO_wide_data {
232 _unused: [u8; 0],
233}
234pub type _IO_lock_t = ::core::ffi::c_void;
235#[repr(C)]
236#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
237pub struct _IO_FILE {
238 pub _flags: ::core::ffi::c_int,
239 pub _IO_read_ptr: *mut ::core::ffi::c_char,
240 pub _IO_read_end: *mut ::core::ffi::c_char,
241 pub _IO_read_base: *mut ::core::ffi::c_char,
242 pub _IO_write_base: *mut ::core::ffi::c_char,
243 pub _IO_write_ptr: *mut ::core::ffi::c_char,
244 pub _IO_write_end: *mut ::core::ffi::c_char,
245 pub _IO_buf_base: *mut ::core::ffi::c_char,
246 pub _IO_buf_end: *mut ::core::ffi::c_char,
247 pub _IO_save_base: *mut ::core::ffi::c_char,
248 pub _IO_backup_base: *mut ::core::ffi::c_char,
249 pub _IO_save_end: *mut ::core::ffi::c_char,
250 pub _markers: *mut _IO_marker,
251 pub _chain: *mut _IO_FILE,
252 pub _fileno: ::core::ffi::c_int,
253 pub _bitfield_align_1: [u32; 0],
254 pub _bitfield_1: __BindgenBitfieldUnit<[u8; 3usize]>,
255 pub _short_backupbuf: [::core::ffi::c_char; 1usize],
256 pub _old_offset: __off_t,
257 pub _cur_column: ::core::ffi::c_ushort,
258 pub _vtable_offset: ::core::ffi::c_schar,
259 pub _shortbuf: [::core::ffi::c_char; 1usize],
260 pub _lock: *mut _IO_lock_t,
261 pub _offset: __off64_t,
262 pub _codecvt: *mut _IO_codecvt,
263 pub _wide_data: *mut _IO_wide_data,
264 pub _freeres_list: *mut _IO_FILE,
265 pub _freeres_buf: *mut ::core::ffi::c_void,
266 pub _prevchain: *mut *mut _IO_FILE,
267 pub _mode: ::core::ffi::c_int,
268 pub _unused3: ::core::ffi::c_int,
269 pub _total_written: __uint64_t,
270 pub _unused2: [::core::ffi::c_char; 8usize],
271}
272impl Default for _IO_FILE {
273 fn default() -> Self {
274 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
275 unsafe {
276 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
277 s.assume_init()
278 }
279 }
280}
281impl _IO_FILE {
282 #[inline]
283 pub fn _flags2(&self) -> ::core::ffi::c_int {
284 unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 24u8) as u32) }
285 }
286 #[inline]
287 pub fn set__flags2(&mut self, val: ::core::ffi::c_int) {
288 unsafe {
289 let val: u32 = ::core::mem::transmute(val);
290 self._bitfield_1.set(0usize, 24u8, val as u64)
291 }
292 }
293 #[inline]
294 pub unsafe fn _flags2_raw(this: *const Self) -> ::core::ffi::c_int {
295 unsafe {
296 ::core::mem::transmute(
297 <__BindgenBitfieldUnit<
298 [u8; 3usize],
299 >>::raw_get(::core::ptr::addr_of!((* this)._bitfield_1), 0usize, 24u8)
300 as u32,
301 )
302 }
303 }
304 #[inline]
305 pub unsafe fn set__flags2_raw(this: *mut Self, val: ::core::ffi::c_int) {
306 unsafe {
307 let val: u32 = ::core::mem::transmute(val);
308 <__BindgenBitfieldUnit<
309 [u8; 3usize],
310 >>::raw_set(
311 ::core::ptr::addr_of_mut!((* this)._bitfield_1),
312 0usize,
313 24u8,
314 val as u64,
315 )
316 }
317 }
318 #[inline]
319 pub fn new_bitfield_1(
320 _flags2: ::core::ffi::c_int,
321 ) -> __BindgenBitfieldUnit<[u8; 3usize]> {
322 let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 3usize]> = Default::default();
323 __bindgen_bitfield_unit
324 .set(
325 0usize,
326 24u8,
327 {
328 let _flags2: u32 = unsafe { ::core::mem::transmute(_flags2) };
329 _flags2 as u64
330 },
331 );
332 __bindgen_bitfield_unit
333 }
334}
335#[repr(C)]
336#[repr(align(8))]
337#[derive(Debug, Default, Copy, Clone, PartialOrd, PartialEq)]
338pub struct float2 {
339 pub x: f32,
340 pub y: f32,
341}
342#[repr(C)]
343#[repr(align(16))]
344#[derive(Debug, Default, Copy, Clone, PartialOrd, PartialEq)]
345pub struct double2 {
346 pub x: f64,
347 pub y: f64,
348}
349pub type cuFloatComplex = float2;
350pub type cuDoubleComplex = double2;
351pub type cuComplex = cuFloatComplex;
352#[repr(C)]
353#[derive(Debug, Copy, Clone)]
354pub struct CUstream_st {
355 _unused: [u8; 0],
356}
357/// The type indicates which part (lower or upper) of the dense matrix was filled and consequently should be used by the function.
358///
359/// 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.
360#[repr(u32)]
361#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
362pub enum cublasFillMode_t {
363 /// The lower part of the matrix is filled.
364 CUBLAS_FILL_MODE_LOWER = 0,
365 /// The upper part of the matrix is filled.
366 CUBLAS_FILL_MODE_UPPER = 1,
367 /// The full matrix is filled.
368 CUBLAS_FILL_MODE_FULL = 2,
369}
370#[repr(u32)]
371#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
372pub enum cublasDiagType_t {
373 CUBLAS_DIAG_NON_UNIT = 0,
374 CUBLAS_DIAG_UNIT = 1,
375}
376#[repr(u32)]
377#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
378pub enum cublasSideMode_t {
379 CUBLAS_SIDE_LEFT = 0,
380 CUBLAS_SIDE_RIGHT = 1,
381}
382impl cublasOperation_t {
383 pub const CUBLAS_OP_HERMITAN: cublasOperation_t = cublasOperation_t::CUBLAS_OP_C;
384}
385/// The [`cublasOperation_t`] type indicates which operation needs to be performed with the dense matrix.
386///
387/// 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.
388#[repr(u32)]
389#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
390pub enum cublasOperation_t {
391 /// The non-transpose operation is selected.
392 CUBLAS_OP_N = 0,
393 /// The transpose operation is selected.
394 CUBLAS_OP_T = 1,
395 /// The conjugate transpose operation is selected.
396 CUBLAS_OP_C = 2,
397 CUBLAS_OP_CONJG = 3,
398}
399pub type cusolver_int_t = ::core::ffi::c_int;
400/// This is a status type returned by the library functions and it can have the following values.
401#[repr(u32)]
402#[derive(
403 Debug,
404 Copy,
405 Clone,
406 Hash,
407 PartialOrd,
408 Ord,
409 PartialEq,
410 Eq,
411 TryFromPrimitive,
412 IntoPrimitive,
413)]
414pub enum cusolverStatus_t {
415 /// The operation completed successfully.
416 CUSOLVER_STATUS_SUCCESS = 0,
417 /// 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.
418 ///
419 /// **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.
420 CUSOLVER_STATUS_NOT_INITIALIZED = 1,
421 /// Resource allocation failed inside the cuSolver library. This is usually caused by a `cudaMalloc()` failure.
422 ///
423 /// **To correct:** prior to the function call, deallocate previously allocated memory as much as possible.
424 CUSOLVER_STATUS_ALLOC_FAILED = 2,
425 /// An unsupported value or parameter was passed to the function (a negative vector size, for example).
426 ///
427 /// **To correct:** ensure that all the parameters being passed have valid values.
428 CUSOLVER_STATUS_INVALID_VALUE = 3,
429 /// The function requires a feature absent from the device architecture; usually caused by the lack of support for atomic operations or double precision.
430 ///
431 /// **To correct:** compile and run the application on a device with compute capability 5.0 or above.
432 CUSOLVER_STATUS_ARCH_MISMATCH = 4,
433 CUSOLVER_STATUS_MAPPING_ERROR = 5,
434 /// 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.
435 ///
436 /// **To correct:** check that the hardware, an appropriate version of the driver, and the cuSolver library are correctly installed.
437 CUSOLVER_STATUS_EXECUTION_FAILED = 6,
438 /// An internal cuSolver operation failed. This error is usually caused by a `cudaMemcpyAsync()` failure.
439 ///
440 /// **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.
441 CUSOLVER_STATUS_INTERNAL_ERROR = 7,
442 /// The matrix type is not supported by this function. This is usually caused by passing an invalid matrix descriptor to the function.
443 ///
444 /// **To correct:** check that the fields in `descrA` were set correctly.
445 CUSOLVER_STATUS_MATRIX_TYPE_NOT_SUPPORTED = 8,
446 /// The parameter combination is not supported, for example batched version is not supported or `M < N` is not supported.
447 ///
448 /// **To correct:** consult the documentation, and use a supported configuration.
449 CUSOLVER_STATUS_NOT_SUPPORTED = 9,
450 CUSOLVER_STATUS_ZERO_PIVOT = 10,
451 CUSOLVER_STATUS_INVALID_LICENSE = 11,
452 CUSOLVER_STATUS_IRS_PARAMS_NOT_INITIALIZED = 12,
453 CUSOLVER_STATUS_IRS_PARAMS_INVALID = 13,
454 CUSOLVER_STATUS_IRS_PARAMS_INVALID_PREC = 14,
455 CUSOLVER_STATUS_IRS_PARAMS_INVALID_REFINE = 15,
456 CUSOLVER_STATUS_IRS_PARAMS_INVALID_MAXITER = 16,
457 CUSOLVER_STATUS_IRS_INTERNAL_ERROR = 20,
458 CUSOLVER_STATUS_IRS_NOT_SUPPORTED = 21,
459 CUSOLVER_STATUS_IRS_OUT_OF_RANGE = 22,
460 CUSOLVER_STATUS_IRS_NRHS_NOT_SUPPORTED_FOR_REFINE_GMRES = 23,
461 CUSOLVER_STATUS_IRS_INFOS_NOT_INITIALIZED = 25,
462 CUSOLVER_STATUS_IRS_INFOS_NOT_DESTROYED = 26,
463 CUSOLVER_STATUS_IRS_MATRIX_SINGULAR = 30,
464 CUSOLVER_STATUS_INVALID_WORKSPACE = 31,
465}
466/// The [`cusolverEigType_t`] type indicates which type of eigenvalue the solver is.
467///
468/// 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.
469#[repr(u32)]
470#[derive(
471 Debug,
472 Copy,
473 Clone,
474 Hash,
475 PartialOrd,
476 Ord,
477 PartialEq,
478 Eq,
479 TryFromPrimitive,
480 IntoPrimitive,
481)]
482pub enum cusolverEigType_t {
483 /// A\*x = lambda\*B\*x.
484 CUSOLVER_EIG_TYPE_1 = 1,
485 /// A\*B\*x = lambda\*x.
486 CUSOLVER_EIG_TYPE_2 = 2,
487 /// B\*A\*x = lambda\*x.
488 CUSOLVER_EIG_TYPE_3 = 3,
489}
490/// The [`cusolverEigMode_t`] type indicates whether or not eigenvectors are computed.
491///
492/// 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.
493#[repr(u32)]
494#[derive(
495 Debug,
496 Copy,
497 Clone,
498 Hash,
499 PartialOrd,
500 Ord,
501 PartialEq,
502 Eq,
503 TryFromPrimitive,
504 IntoPrimitive,
505)]
506pub enum cusolverEigMode_t {
507 /// Only eigenvalues are computed.
508 CUSOLVER_EIG_MODE_NOVECTOR = 0,
509 /// Both eigenvalues and eigenvectors are computed.
510 CUSOLVER_EIG_MODE_VECTOR = 1,
511}
512#[repr(u32)]
513#[derive(
514 Debug,
515 Copy,
516 Clone,
517 Hash,
518 PartialOrd,
519 Ord,
520 PartialEq,
521 Eq,
522 TryFromPrimitive,
523 IntoPrimitive,
524)]
525pub enum cusolverEigRange_t {
526 CUSOLVER_EIG_RANGE_ALL = 1001,
527 CUSOLVER_EIG_RANGE_I = 1002,
528 CUSOLVER_EIG_RANGE_V = 1003,
529}
530/// The [`cusolverEigComp_t`] type indicates the computational mode for eigen routines that compute eigenvalues and optionally eigenvectors, analogous to the `compz` argument in LAPACK.
531///
532/// The values of [`cusolverEigComp_t`] correspond directly to the LAPACK `compz` argument. In LAPACK, `compz` is specified as a single character: `'N'` means no eigenvectors are computed (eigenvalues only); `'I'` means the eigenvector matrix is initialized to the identity and then updated by the routine; `'V'` means the routine uses the matrix provided on entry and overwrites it with the product of that matrix and the orthogonal (or unitary) transformations accumulated during the computation. The cuSolver enumerants [`cusolverEigComp_t::CUSOLVER_EIG_COMP_N`], [`cusolverEigComp_t::CUSOLVER_EIG_COMP_I`], and [`cusolverEigComp_t::CUSOLVER_EIG_COMP_V`] map to LAPACK `'N'`, `'I'`, and `'V'` respectively.
533#[repr(u32)]
534#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
535pub enum cusolverEigComp_t {
536 /// Only eigenvalues are computed.
537 CUSOLVER_EIG_COMP_N = 10,
538 /// The unitary matrix is initialized to the identity matrix.
539 CUSOLVER_EIG_COMP_I = 11,
540 /// The product of the matrix given on entry with the orthogonal transformations accumulated during the computational routine is returned.
541 CUSOLVER_EIG_COMP_V = 12,
542}
543#[repr(u32)]
544#[derive(
545 Debug,
546 Copy,
547 Clone,
548 Hash,
549 PartialOrd,
550 Ord,
551 PartialEq,
552 Eq,
553 TryFromPrimitive,
554 IntoPrimitive,
555)]
556pub enum cusolverNorm_t {
557 CUSOLVER_INF_NORM = 104,
558 CUSOLVER_MAX_NORM = 105,
559 CUSOLVER_ONE_NORM = 106,
560 CUSOLVER_FRO_NORM = 107,
561}
562/// 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.
563///
564/// *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.*.
565#[repr(u32)]
566#[derive(
567 Debug,
568 Copy,
569 Clone,
570 Hash,
571 PartialOrd,
572 Ord,
573 PartialEq,
574 Eq,
575 TryFromPrimitive,
576 IntoPrimitive,
577)]
578pub enum cusolverIRSRefinement_t {
579 /// Solver is not set; this value is what is set when creating the `params` structure. IRS solver will return an error.
580 CUSOLVER_IRS_REFINE_NOT_SET = 1100,
581 /// 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()`.
582 CUSOLVER_IRS_REFINE_NONE = 1101,
583 /// Classical iterative refinement solver. Similar to the one used in LAPACK routines.
584 CUSOLVER_IRS_REFINE_CLASSICAL = 1102,
585 /// 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`].
586 CUSOLVER_IRS_REFINE_CLASSICAL_GMRES = 1103,
587 /// 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.
588 CUSOLVER_IRS_REFINE_GMRES = 1104,
589 /// 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.
590 CUSOLVER_IRS_REFINE_GMRES_GMRES = 1105,
591 CUSOLVER_IRS_REFINE_GMRES_NOPCOND = 1106,
592 CUSOLVER_PREC_DD = 1150,
593 CUSOLVER_PREC_SS = 1151,
594 CUSOLVER_PREC_SHT = 1152,
595}
596#[repr(u32)]
597#[derive(
598 Debug,
599 Copy,
600 Clone,
601 Hash,
602 PartialOrd,
603 Ord,
604 PartialEq,
605 Eq,
606 TryFromPrimitive,
607 IntoPrimitive,
608)]
609pub enum cusolverPrecType_t {
610 CUSOLVER_R_8I = 1201,
611 CUSOLVER_R_8U = 1202,
612 CUSOLVER_R_64F = 1203,
613 CUSOLVER_R_32F = 1204,
614 CUSOLVER_R_16F = 1205,
615 CUSOLVER_R_16BF = 1206,
616 CUSOLVER_R_TF32 = 1207,
617 CUSOLVER_R_AP = 1208,
618 CUSOLVER_C_8I = 1211,
619 CUSOLVER_C_8U = 1212,
620 CUSOLVER_C_64F = 1213,
621 CUSOLVER_C_32F = 1214,
622 CUSOLVER_C_16F = 1215,
623 CUSOLVER_C_16BF = 1216,
624 CUSOLVER_C_TF32 = 1217,
625 CUSOLVER_C_AP = 1218,
626}
627/// 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.
628///
629/// The default algorithm is [`cusolverAlgMode_t::CUSOLVER_ALG_0`]. The user can also provide `NULL` to use the default algorithm.
630#[repr(u32)]
631#[derive(
632 Debug,
633 Copy,
634 Clone,
635 Hash,
636 PartialOrd,
637 Ord,
638 PartialEq,
639 Eq,
640 TryFromPrimitive,
641 IntoPrimitive,
642)]
643pub enum cusolverAlgMode_t {
644 CUSOLVER_ALG_0 = 0,
645 CUSOLVER_ALG_1 = 1,
646 CUSOLVER_ALG_2 = 2,
647}
648/// Specifies how the vectors which define the elementary reflectors are stored.
649#[repr(u32)]
650#[derive(
651 Debug,
652 Copy,
653 Clone,
654 Hash,
655 PartialOrd,
656 Ord,
657 PartialEq,
658 Eq,
659 TryFromPrimitive,
660 IntoPrimitive,
661)]
662pub enum cusolverStorevMode_t {
663 /// Columnwise.
664 CUBLAS_STOREV_COLUMNWISE = 0,
665 /// Rowwise.
666 CUBLAS_STOREV_ROWWISE = 1,
667}
668/// Specifies the order in which the elementary reflectors are multiplied to form the block reflector.
669#[repr(u32)]
670#[derive(
671 Debug,
672 Copy,
673 Clone,
674 Hash,
675 PartialOrd,
676 Ord,
677 PartialEq,
678 Eq,
679 TryFromPrimitive,
680 IntoPrimitive,
681)]
682pub enum cusolverDirectMode_t {
683 /// Forward.
684 CUBLAS_DIRECT_FORWARD = 0,
685 /// Backward.
686 CUBLAS_DIRECT_BACKWARD = 1,
687}
688/// 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.
689#[repr(u32)]
690#[derive(
691 Debug,
692 Copy,
693 Clone,
694 Hash,
695 PartialOrd,
696 Ord,
697 PartialEq,
698 Eq,
699 TryFromPrimitive,
700 IntoPrimitive,
701)]
702pub enum cusolverDeterministicMode_t {
703 /// Compute deterministic results.
704 CUSOLVER_DETERMINISTIC_RESULTS = 1,
705 /// Allow non-deterministic results.
706 CUSOLVER_ALLOW_NON_DETERMINISTIC_RESULTS = 2,
707}
708/// The [`cusolverMathMode_t`] type is used in [`cusolverDnSetMathMode`] to choose compute precision modes as defined in the following table:
709///
710/// The following combinations of [`cusolverMathMode_t`] using the bitwise OR operator are allowed:
711///
712/// * [`cusolverMathMode_t::CUSOLVER_FP32_FP64_EMULATED_MATH`] = [`cusolverMathMode_t::CUSOLVER_FP32_EMULATED_BF16X9_MATH`] | [`cusolverMathMode_t::CUSOLVER_FP64_EMULATED_FIXEDPOINT_MATH`].
713#[repr(u32)]
714#[derive(
715 Debug,
716 Copy,
717 Clone,
718 Hash,
719 PartialOrd,
720 Ord,
721 PartialEq,
722 Eq,
723 TryFromPrimitive,
724 IntoPrimitive,
725)]
726pub enum cusolverMathMode_t {
727 /// This is the default math mode. Tensor Cores will be used whenever possible.
728 CUSOLVER_DEFAULT_MATH = 1,
729 /// Use FP32 emulation according to the configured emulation strategy (see [`cusolverDnSetEmulationStrategy`]).
730 CUSOLVER_FP32_EMULATED_BF16X9_MATH = 2,
731 /// Use FP64 emulation according to the configured emulation strategy (see [`cusolverDnSetEmulationStrategy`]).
732 CUSOLVER_FP64_EMULATED_FIXEDPOINT_MATH = 4,
733 /// Combination of [`cusolverMathMode_t::CUSOLVER_FP32_EMULATED_BF16X9_MATH`] and [`cusolverMathMode_t::CUSOLVER_FP64_EMULATED_FIXEDPOINT_MATH`].
734 CUSOLVER_FP32_FP64_EMULATED_MATH = 6,
735}
736unsafe extern "C" {
737 pub fn cusolverGetProperty(
738 type_: libraryPropertyType,
739 value: *mut ::core::ffi::c_int,
740 ) -> cusolverStatus_t;
741}
742unsafe extern "C" {
743 pub fn cusolverGetVersion(version: *mut ::core::ffi::c_int) -> cusolverStatus_t;
744}
745unsafe extern "C" {
746 /// 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.
747 /// 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.
748 /// For the default stream and in all the other cases, cuBLAS will manage its own workspace.
749 ///
750 /// # Parameters
751 ///
752 /// - `handle`: The pointer to the handle to the cuSolverDN context.
753 ///
754 /// # Return value
755 ///
756 /// - [`cusolverStatus_t::CUSOLVER_STATUS_ALLOC_FAILED`]: The resources could not be allocated.
757 /// - [`cusolverStatus_t::CUSOLVER_STATUS_ARCH_MISMATCH`]: The device only supports compute capability 5.0 and above.
758 /// - [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]: The CUDA Runtime initialization failed.
759 /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The initialization succeeded.
760 pub fn cusolverDnCreate(handle: *mut cusolverDnHandle_t) -> cusolverStatus_t;
761}
762unsafe extern "C" {
763 /// This function releases CPU-side resources used by the cuSolverDN library.
764 ///
765 /// # Parameters
766 ///
767 /// - `handle`: Handle to the cuSolverDN library context.
768 ///
769 /// # Return value
770 ///
771 /// - [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]: The library was not initialized.
772 /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The shutdown succeeded.
773 pub fn cusolverDnDestroy(handle: cusolverDnHandle_t) -> cusolverStatus_t;
774}
775unsafe extern "C" {
776 /// This function sets the stream to be used by the cuSolverDN library to execute its routines.
777 ///
778 /// # Parameters
779 ///
780 /// - `handle`: Handle to the cuSolverDN library context.
781 /// - `streamId`: The stream to be used by the library.
782 ///
783 /// # Return value
784 ///
785 /// - [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]: The library was not initialized.
786 /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The stream was set successfully.
787 pub fn cusolverDnSetStream(
788 handle: cusolverDnHandle_t,
789 streamId: cudaStream_t,
790 ) -> cusolverStatus_t;
791}
792unsafe extern "C" {
793 /// This function queries the stream to be used by the cuSolverDN library to execute its routines.
794 ///
795 /// # Parameters
796 ///
797 /// - `handle`: Handle to the cuSolverDN library context.
798 /// - `streamId`: The stream which is used by `handle`.
799 ///
800 /// # Return value
801 ///
802 /// - [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]: The library was not initialized.
803 /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The stream was set successfully.
804 pub fn cusolverDnGetStream(
805 handle: cusolverDnHandle_t,
806 streamId: *mut cudaStream_t,
807 ) -> cusolverStatus_t;
808}
809unsafe extern "C" {
810 /// This function sets the deterministic mode of all cuSolverDN functions for `handle`. For improved performance,
811 /// non-deterministic results can be allowed. Affected functions are `cusolverDn<t>geqrf()`, `cusolverDn<t>syevd()`, `cusolverDn<t>syevdx()`, `cusolverDn<t>gesvd()` (if `m > n`), `cusolverDn<t>gesvdj()`, [`cusolverDnXgeqrf`], [`cusolverDnXsyevd`], [`cusolverDnXsyevdx`], [`cusolverDnXgesvd`] (if `m > n`), [`cusolverDnXgesvdr`] and [`cusolverDnXgesvdp`].
812 ///
813 /// # Parameters
814 ///
815 /// - `handle`: Handle to the cuSolverDN library context.
816 /// - `mode`: The deterministic mode to be used with `handle`.
817 ///
818 /// # Return value
819 ///
820 /// - [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]: An internal error occurred.
821 /// - [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]: The library was not initialized.
822 /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The modes were set successfully.
823 pub fn cusolverDnSetDeterministicMode(
824 handle: cusolverDnHandle_t,
825 mode: cusolverDeterministicMode_t,
826 ) -> cusolverStatus_t;
827}
828unsafe extern "C" {
829 /// This function queries the deterministic mode which is set for `handle`.
830 ///
831 /// # Parameters
832 ///
833 /// - `handle`: Handle to the cuSolverDN library context.
834 /// - `mode`: The deterministic mode of `handle`.
835 ///
836 /// # Return value
837 ///
838 /// - [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]: `mode` is a `NULL` pointer.
839 /// - [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]: The library was not initialized.
840 /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The modes were queried successfully.
841 pub fn cusolverDnGetDeterministicMode(
842 handle: cusolverDnHandle_t,
843 mode: *mut cusolverDeterministicMode_t,
844 ) -> cusolverStatus_t;
845}
846unsafe extern "C" {
847 /// 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.
848 ///
849 /// # Parameters
850 ///
851 /// - `handle`: Handle to the cuSolverDN library context.
852 ///
853 /// # Return value
854 ///
855 /// - [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]: An internal error occurred.
856 /// - [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]: An invalid mode was given.
857 /// - [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]: The library was not initialized.
858 /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The mode was set successfully.
859 pub fn cusolverDnSetMathMode(
860 handle: cusolverDnHandle_t,
861 mode: cusolverMathMode_t,
862 ) -> cusolverStatus_t;
863}
864unsafe extern "C" {
865 /// 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.
866 ///
867 /// # Parameters
868 ///
869 /// - `handle`: Handle to the cuSolverDN library context.
870 ///
871 /// # Return value
872 ///
873 /// - [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]: `modes` is a `NULL` pointer.
874 /// - [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]: The library was not initialized.
875 /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The mode was set successfully.
876 pub fn cusolverDnGetMathMode(
877 handle: cusolverDnHandle_t,
878 mode: *mut cusolverMathMode_t,
879 ) -> cusolverStatus_t;
880}
881unsafe extern "C" {
882 /// 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).
883 ///
884 /// The emulation strategy set by this API only has an effect, **once** one of the following math modes is enabled (see also [`cusolverMathMode_t`]):
885 ///
886 /// * [`cusolverMathMode_t::CUSOLVER_FP32_EMULATED_BF16X9_MATH`]
887 /// * [`cusolverMathMode_t::CUSOLVER_FP64_EMULATED_FIXEDPOINT_MATH`]
888 /// * [`cusolverMathMode_t::CUSOLVER_FP32_FP64_EMULATED_MATH`].
889 ///
890 /// # Parameters
891 ///
892 /// - `handle`: Handle to the cuSolverDN library context.
893 /// - `strategy`: The emulation strategy to be used with `handle`.
894 ///
895 /// # Return value
896 ///
897 /// - [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]: An internal error occurred.
898 /// - [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]: strategy was not a supported emulation strategy.
899 /// - [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]: The library was not initialized.
900 /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The strategy was set successfully.
901 pub fn cusolverDnSetEmulationStrategy(
902 handle: cusolverDnHandle_t,
903 strategy: cudaEmulationStrategy_t,
904 ) -> cusolverStatus_t;
905}
906unsafe extern "C" {
907 /// This function queries the emulation strategy which is set for `handle`.
908 ///
909 /// The emulation strategy returned by this API only has an effect, **once** one of the following math modes is enabled (see also [`cusolverMathMode_t`]):
910 ///
911 /// * [`cusolverMathMode_t::CUSOLVER_FP32_EMULATED_BF16X9_MATH`]
912 /// * [`cusolverMathMode_t::CUSOLVER_FP64_EMULATED_FIXEDPOINT_MATH`]
913 /// * [`cusolverMathMode_t::CUSOLVER_FP32_FP64_EMULATED_MATH`].
914 ///
915 /// # Parameters
916 ///
917 /// - `handle`: Handle to the cuSolverDN library context.
918 /// - `strategy`: The emulation strategy of `handle`.
919 ///
920 /// # Return value
921 ///
922 /// - [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]: `emulationStrategy` is a `NULL` pointer.
923 /// - [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]: The library was not initialized.
924 /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The strategy was queried successfully.
925 pub fn cusolverDnGetEmulationStrategy(
926 handle: cusolverDnHandle_t,
927 strategy: *mut cudaEmulationStrategy_t,
928 ) -> cusolverStatus_t;
929}
930unsafe extern "C" {
931 /// 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`].
932 ///
933 /// The mantissa control set by this API only has an effect, **once** one of the following math modes is enabled (see also [`cusolverMathMode_t`]):
934 ///
935 /// * [`cusolverMathMode_t::CUSOLVER_FP64_EMULATED_FIXEDPOINT_MATH`]
936 /// * [`cusolverMathMode_t::CUSOLVER_FP32_FP64_EMULATED_MATH`].
937 ///
938 /// # Parameters
939 ///
940 /// - `handle`: Handle to the cuSolverDN library context.
941 /// - `control`: The mantissa control mode to be used with `handle`.
942 ///
943 /// # Return value
944 ///
945 /// - [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]: An internal error occurred.
946 /// - [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]: `control` is not a valid [`cudaEmulationMantissaControl_t`] value.
947 /// - [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]: The library was not initialized.
948 /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The mantissa control was set successfully.
949 pub fn cusolverDnSetFixedPointEmulationMantissaControl(
950 handle: cusolverDnHandle_t,
951 control: cudaEmulationMantissaControl_t,
952 ) -> cusolverStatus_t;
953}
954unsafe extern "C" {
955 /// This function queries how the number of mantissa bits is determined for fixed point FP64 emulation.
956 ///
957 /// The mantissa control returned by this API only has an effect, **once** one of the following math modes is enabled (see also [`cusolverMathMode_t`]):
958 ///
959 /// * [`cusolverMathMode_t::CUSOLVER_FP64_EMULATED_FIXEDPOINT_MATH`]
960 /// * [`cusolverMathMode_t::CUSOLVER_FP32_FP64_EMULATED_MATH`].
961 ///
962 /// # Parameters
963 ///
964 /// - `handle`: Handle to the cuSolverDN library context.
965 /// - `control`: The mantissa control mode of `handle`.
966 ///
967 /// # Return value
968 ///
969 /// - [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]: `control` is a `NULL` pointer.
970 /// - [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]: The library was not initialized.
971 /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The mantissa control was queried successfully.
972 pub fn cusolverDnGetFixedPointEmulationMantissaControl(
973 handle: cusolverDnHandle_t,
974 control: *mut cudaEmulationMantissaControl_t,
975 ) -> cusolverStatus_t;
976}
977unsafe extern "C" {
978 /// This function sets the maximum number of mantissa bits for fixed point FP64 emulation.
979 ///
980 /// 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`]):
981 ///
982 /// * [`cusolverMathMode_t::CUSOLVER_FP64_EMULATED_FIXEDPOINT_MATH`]
983 /// * [`cusolverMathMode_t::CUSOLVER_FP32_FP64_EMULATED_MATH`].
984 ///
985 /// # Parameters
986 ///
987 /// - `handle`: Handle to the cuSolverDN library context.
988 /// - `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).
989 ///
990 /// # Return value
991 ///
992 /// - [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]: An internal error occurred.
993 /// - [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]: `mantissaBitCount` is less than `0`.
994 /// - [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]: The library was not initialized.
995 /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The mantissa bit count was set successfully.
996 pub fn cusolverDnSetFixedPointEmulationMaxMantissaBitCount(
997 handle: cusolverDnHandle_t,
998 mantissaBitCount: ::core::ffi::c_int,
999 ) -> cusolverStatus_t;
1000}
1001unsafe extern "C" {
1002 /// This function queries the maximum number of mantissa bits used for fixed point FP64 emulation.
1003 ///
1004 /// 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`]):
1005 ///
1006 /// * [`cusolverMathMode_t::CUSOLVER_FP64_EMULATED_FIXEDPOINT_MATH`]
1007 /// * [`cusolverMathMode_t::CUSOLVER_FP32_FP64_EMULATED_MATH`].
1008 ///
1009 /// # Parameters
1010 ///
1011 /// - `handle`: Handle to the cuSolverDN library context.
1012 /// - `mantissaBitCount`: The maximum number of mantissa bits used.
1013 ///
1014 /// # Return value
1015 ///
1016 /// - [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]: `mantissaBitCount` is a `NULL` pointer.
1017 /// - [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]: The library was not initialized.
1018 /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The mantissa bit count was queried successfully.
1019 pub fn cusolverDnGetFixedPointEmulationMaxMantissaBitCount(
1020 handle: cusolverDnHandle_t,
1021 mantissaBitCount: *mut ::core::ffi::c_int,
1022 ) -> cusolverStatus_t;
1023}
1024unsafe extern "C" {
1025 /// This function sets the mantissa bit offset for fixed point FP64 emulation in case of dynamic mantissa control mode.
1026 ///
1027 /// 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`]):
1028 ///
1029 /// * [`cusolverMathMode_t::CUSOLVER_FP64_EMULATED_FIXEDPOINT_MATH`]
1030 /// * [`cusolverMathMode_t::CUSOLVER_FP32_FP64_EMULATED_MATH`]
1031 ///
1032 /// **And** the following mantissa control is enabled (see also [`cusolverDnSetFixedPointEmulationMantissaControl`]):
1033 ///
1034 /// * `CUDA_EMULATION_MANTISSA_CONTROL_DYNAMIC`
1035 ///
1036 /// 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.
1037 ///
1038 /// 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.
1039 ///
1040 /// # Parameters
1041 ///
1042 /// - `handle`: Handle to the cuSolverDN library context.
1043 /// - `mantissaBitOffset`: The mantissa bit offset (default = `0`) to be used when the mantissa control is `CUDA_EMULATION_MANTISSA_CONTROL_DYNAMIC`.
1044 ///
1045 /// # Return value
1046 ///
1047 /// - [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]: An internal error occurred.
1048 /// - [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]: The library was not initialized.
1049 /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The mantissa bit offset was set successfully.
1050 pub fn cusolverDnSetFixedPointEmulationMantissaBitOffset(
1051 handle: cusolverDnHandle_t,
1052 mantissaBitOffset: ::core::ffi::c_int,
1053 ) -> cusolverStatus_t;
1054}
1055unsafe extern "C" {
1056 /// This function queries the mantissa bit offset for fixed point FP64 emulation in case of dynamic mantissa control mode.
1057 ///
1058 /// 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`]):
1059 ///
1060 /// * [`cusolverMathMode_t::CUSOLVER_FP64_EMULATED_FIXEDPOINT_MATH`]
1061 /// * [`cusolverMathMode_t::CUSOLVER_FP32_FP64_EMULATED_MATH`]
1062 ///
1063 /// **And** the following mantissa control is enabled (see also [`cusolverDnSetFixedPointEmulationMantissaControl`]):
1064 ///
1065 /// * `CUDA_EMULATION_MANTISSA_CONTROL_DYNAMIC`
1066 ///
1067 /// 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.
1068 ///
1069 /// # Parameters
1070 ///
1071 /// - `handle`: Handle to the cuSolverDN library context.
1072 /// - `mantissaBitOffset`: The mantissa bit offset used when `CUDA_EMULATION_MANTISSA_CONTROL_DYNAMIC` is in use.
1073 ///
1074 /// # Return value
1075 ///
1076 /// - [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]: `mantissaBitOffset` is a `NULL` pointer.
1077 /// - [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]: The library was not initialized.
1078 /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The mantissa bit offset was queried successfully.
1079 pub fn cusolverDnGetFixedPointEmulationMantissaBitOffset(
1080 handle: cusolverDnHandle_t,
1081 mantissaBitOffset: *mut ::core::ffi::c_int,
1082 ) -> cusolverStatus_t;
1083}
1084unsafe extern "C" {
1085 /// This function sets the handling of special floating point values for `handle`, which is used **once** floating point emulation is allowed.
1086 ///
1087 /// 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`]):
1088 ///
1089 /// * [`cusolverMathMode_t::CUSOLVER_FP32_EMULATED_BF16X9_MATH`]
1090 /// * [`cusolverMathMode_t::CUSOLVER_FP64_EMULATED_FIXEDPOINT_MATH`]
1091 /// * [`cusolverMathMode_t::CUSOLVER_FP32_FP64_EMULATED_MATH`].
1092 ///
1093 /// # Parameters
1094 ///
1095 /// - `handle`: Handle to the cuSolverDN library context.
1096 /// - `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.
1097 ///
1098 /// # Return value
1099 ///
1100 /// - [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]: An internal error occurred.
1101 /// - [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]: The library was not initialized.
1102 /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The special value support was set successfully.
1103 pub fn cusolverDnSetEmulationSpecialValuesSupport(
1104 handle: cusolverDnHandle_t,
1105 mask: cudaEmulationSpecialValuesSupport_t,
1106 ) -> cusolverStatus_t;
1107}
1108unsafe extern "C" {
1109 /// This function queries the special floating point value support which is set for `handle` if floating point emulation is allowed.
1110 ///
1111 /// 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`]):
1112 ///
1113 /// * [`cusolverMathMode_t::CUSOLVER_FP32_EMULATED_BF16X9_MATH`]
1114 /// * [`cusolverMathMode_t::CUSOLVER_FP64_EMULATED_FIXEDPOINT_MATH`]
1115 /// * [`cusolverMathMode_t::CUSOLVER_FP32_FP64_EMULATED_MATH`]
1116 ///
1117 /// Otherwise, special floating point values are handled as expected.
1118 ///
1119 /// # Parameters
1120 ///
1121 /// - `handle`: Handle to the cuSolverDN library context.
1122 /// - `mask`: The special value support of `handle`. Please see [`cudaEmulationSpecialValuesSupport_t`] for more information about the allowed values of `mask`.
1123 ///
1124 /// # Return value
1125 ///
1126 /// - [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]: `mask` is a `NULL` pointer.
1127 /// - [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]: The library was not initialized.
1128 /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The special value handling was queried successfully.
1129 pub fn cusolverDnGetEmulationSpecialValuesSupport(
1130 handle: cusolverDnHandle_t,
1131 mask: *mut cudaEmulationSpecialValuesSupport_t,
1132 ) -> cusolverStatus_t;
1133}
1134unsafe extern "C" {
1135 /// 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.
1136 ///
1137 /// # Return value
1138 ///
1139 /// - [`cusolverStatus_t::CUSOLVER_STATUS_ALLOC_FAILED`]: The resources could not be allocated.
1140 /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The structure was created and initialized successfully.
1141 pub fn cusolverDnIRSParamsCreate(
1142 params_ptr: *mut cusolverDnIRSParams_t,
1143 ) -> cusolverStatus_t;
1144}
1145unsafe extern "C" {
1146 /// This function destroys and releases any memory required by the Params structure.
1147 ///
1148 /// # Parameters
1149 ///
1150 /// - `params`: The `cusolverDnIRSParams_t Params` structure.
1151 ///
1152 /// # Return value
1153 ///
1154 /// - [`cusolverStatus_t::CUSOLVER_STATUS_IRS_INFOS_NOT_DESTROYED`]: Not all the `Infos` structure associated with this `Params` structure have been destroyed yet.
1155 /// - [`cusolverStatus_t::CUSOLVER_STATUS_IRS_PARAMS_NOT_INITIALIZED`]: The `Params` structure was not created.
1156 /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The resources were released successfully.
1157 pub fn cusolverDnIRSParamsDestroy(params: cusolverDnIRSParams_t) -> cusolverStatus_t;
1158}
1159unsafe extern "C" {
1160 /// 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.
1161 ///
1162 /// [`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.
1163 ///
1164 /// [`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()`.
1165 ///
1166 /// [`cusolverIRSRefinement_t::CUSOLVER_IRS_REFINE_CLASSICAL`]: Classical iterative refinement solver. Similar to the one used in LAPACK routines.
1167 ///
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 ///
1170 /// [`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`].
1171 ///
1172 /// [`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.
1173 ///
1174 /// # Parameters
1175 ///
1176 /// - `params`: The [`cusolverDnIRSParams_t`]`Params` structure.
1177 ///
1178 /// # Return value
1179 ///
1180 /// - [`cusolverIRSRefinement_t::CUSOLVER_IRS_REFINE_CLASSICAL`]: Classical iterative refinement solver. Similar to the one used in LAPACK routines.
1181 /// - [`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`].
1182 /// - [`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.
1183 /// - [`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.
1184 /// - [`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()`.
1185 /// - [`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.
1186 /// - [`cusolverStatus_t::CUSOLVER_STATUS_IRS_PARAMS_NOT_INITIALIZED`]: The `Params` structure was not created.
1187 /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The operation completed successfully.
1188 pub fn cusolverDnIRSParamsSetRefinementSolver(
1189 params: cusolverDnIRSParams_t,
1190 refinement_solver: cusolverIRSRefinement_t,
1191 ) -> cusolverStatus_t;
1192}
1193unsafe extern "C" {
1194 /// 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.
1195 ///
1196 /// # Parameters
1197 ///
1198 /// - `params`: The `cusolverDnIRSParams_t Params` structure.
1199 /// - `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.
1200 ///
1201 /// # Return value
1202 ///
1203 /// - [`cusolverStatus_t::CUSOLVER_STATUS_IRS_PARAMS_NOT_INITIALIZED`]: The `Params` structure was not created.
1204 /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The operation completed successfully.
1205 pub fn cusolverDnIRSParamsSetSolverMainPrecision(
1206 params: cusolverDnIRSParams_t,
1207 solver_main_precision: cusolverPrecType_t,
1208 ) -> cusolverStatus_t;
1209}
1210unsafe extern "C" {
1211 /// 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.
1212 ///
1213 /// # Parameters
1214 ///
1215 /// - `params`: The `cusolverDnIRSParams_t Params` structure.
1216 ///
1217 /// # Return value
1218 ///
1219 /// - [`cusolverStatus_t::CUSOLVER_STATUS_IRS_PARAMS_NOT_INITIALIZED`]: The Params structure was not created.
1220 /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The operation completed successfully.
1221 pub fn cusolverDnIRSParamsSetSolverLowestPrecision(
1222 params: cusolverDnIRSParams_t,
1223 solver_lowest_precision: cusolverPrecType_t,
1224 ) -> cusolverStatus_t;
1225}
1226unsafe extern "C" {
1227 /// 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.
1228 ///
1229 /// **Supported Inputs/Outputs data type and lower precision for the IRS solver**
1230 ///
1231 /// | **Inputs/Outputs Data Type (e.g., main precision)** | **Supported values for the lowest precision** |
1232 /// | --- | --- |
1233 /// | [`cusolverPrecType_t::CUSOLVER_C_64F`] | `CUSOLVER_C_64F, CUSOLVER_C_32F, CUSOLVER_C_16F, CUSOLVER_C_16BF, CUSOLVER_C_TF32` |
1234 /// | [`cusolverPrecType_t::CUSOLVER_C_32F`] | `CUSOLVER_C_32F, CUSOLVER_C_16F, CUSOLVER_C_16BF, CUSOLVER_C_TF32` |
1235 /// | [`cusolverPrecType_t::CUSOLVER_R_64F`] | `CUSOLVER_R_64F, CUSOLVER_R_32F, CUSOLVER_R_16F, CUSOLVER_R_16BF, CUSOLVER_R_TF32` |
1236 /// | [`cusolverPrecType_t::CUSOLVER_R_32F`] | `CUSOLVER_R_32F, CUSOLVER_R_16F, CUSOLVER_R_16BF, CUSOLVER_R_TF32` |
1237 ///
1238 /// # Parameters
1239 ///
1240 /// - `params`: The `cusolverDnIRSParams_t Params` structure.
1241 /// - `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.
1242 /// - `solver_lowest_precision`: Allowed lowest compute type (for example CUSOLVER_R_16F for half precision computation). See the table below for the supported precisions.
1243 ///
1244 /// # Return value
1245 ///
1246 /// - [`cusolverStatus_t::CUSOLVER_STATUS_IRS_PARAMS_NOT_INITIALIZED`]: The `Params` structure was not created.
1247 /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The operation completed successfully.
1248 pub fn cusolverDnIRSParamsSetSolverPrecisions(
1249 params: cusolverDnIRSParams_t,
1250 solver_main_precision: cusolverPrecType_t,
1251 solver_lowest_precision: cusolverPrecType_t,
1252 ) -> cusolverStatus_t;
1253}
1254unsafe extern "C" {
1255 /// This function sets the tolerance for the refinement solver. By default it is such that all the RHS satisfy:
1256 ///
1257 /// `RNRM < SQRT(N)`XNRM`ANRM`EPS`BWDMAX` where
1258 ///
1259 /// * RNRM is the infinity-norm of the residual
1260 /// * XNRM is the infinity-norm of the solution
1261 /// * ANRM is the infinity-operator-norm of the matrix A
1262 /// * EPS is the machine epsilon for the Inputs/Outputs datatype that matches LAPACK <X>LAMCH(‘Epsilon’)
1263 /// * BWDMAX, the value BWDMAX is fixed to 1.0
1264 ///
1265 /// 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.
1266 ///
1267 /// # Parameters
1268 ///
1269 /// - `params`: The `cusolverDnIRSParams_t Params` structure.
1270 /// - `val`: Double precision real value to which the refinement tolerance will be set.
1271 ///
1272 /// # Return value
1273 ///
1274 /// - [`cusolverStatus_t::CUSOLVER_STATUS_IRS_PARAMS_NOT_INITIALIZED`]: The `Params` structure was not created.
1275 /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The operation completed successfully.
1276 pub fn cusolverDnIRSParamsSetTol(
1277 params: cusolverDnIRSParams_t,
1278 val: f64,
1279 ) -> cusolverStatus_t;
1280}
1281unsafe extern "C" {
1282 /// 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.
1283 ///
1284 /// # Parameters
1285 ///
1286 /// - `params`: The `cusolverDnIRSParams_t Params` structure.
1287 /// - `val`: Double precision real value to which the tolerance of the inner refinement solver will be set.
1288 ///
1289 /// # Return value
1290 ///
1291 /// - [`cusolverStatus_t::CUSOLVER_STATUS_IRS_PARAMS_NOT_INITIALIZED`]: The `Params` structure was not created.
1292 /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The operation completed successfully.
1293 pub fn cusolverDnIRSParamsSetTolInner(
1294 params: cusolverDnIRSParams_t,
1295 val: f64,
1296 ) -> cusolverStatus_t;
1297}
1298unsafe extern "C" {
1299 /// 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.
1300 ///
1301 /// # Parameters
1302 ///
1303 /// - `params`: The `cusolverDnIRSParams_t Params` structure.
1304 ///
1305 /// # Return value
1306 ///
1307 /// - [`cusolverStatus_t::CUSOLVER_STATUS_IRS_PARAMS_NOT_INITIALIZED`]: The `Params` structure was not created.
1308 /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The operation completed successfully.
1309 pub fn cusolverDnIRSParamsSetMaxIters(
1310 params: cusolverDnIRSParams_t,
1311 maxiters: cusolver_int_t,
1312 ) -> cusolverStatus_t;
1313}
1314unsafe extern "C" {
1315 /// 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)`.
1316 ///
1317 /// # Parameters
1318 ///
1319 /// - `params`: The `cusolverDnIRSParams_t Params` structure.
1320 /// - `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`.
1321 ///
1322 /// # Return value
1323 ///
1324 /// - [`cusolverStatus_t::CUSOLVER_STATUS_IRS_PARAMS_INVALID`]: If the value was larger than `MaxIters`.
1325 /// - [`cusolverStatus_t::CUSOLVER_STATUS_IRS_PARAMS_NOT_INITIALIZED`]: The `Params` structure was not created.
1326 /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The operation completed successfully.
1327 pub fn cusolverDnIRSParamsSetMaxItersInner(
1328 params: cusolverDnIRSParams_t,
1329 maxiters_inner: cusolver_int_t,
1330 ) -> cusolverStatus_t;
1331}
1332unsafe extern "C" {
1333 /// 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.
1334 ///
1335 /// # Parameters
1336 ///
1337 /// - `params`: The `cusolverDnIRSParams_t Params` structure.
1338 /// - `maxiters`: The maximal number of iterations that is currently set.
1339 ///
1340 /// # Return value
1341 ///
1342 /// - [`cusolverStatus_t::CUSOLVER_STATUS_IRS_PARAMS_NOT_INITIALIZED`]: The `Params` structure was not created.
1343 /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The operation completed successfully.
1344 pub fn cusolverDnIRSParamsGetMaxIters(
1345 params: cusolverDnIRSParams_t,
1346 maxiters: *mut cusolver_int_t,
1347 ) -> cusolverStatus_t;
1348}
1349unsafe extern "C" {
1350 /// This function enable the fallback to the main precision in case the Iterative Refinement Solver (IRS) failed to converge. In other term, if the IRS solver failed to converge, the solver will return a no convergence code (e.g., `niter` < 0), but can either return the non-convergent solution as it is (e.g., disable fallback) or can fallback (e.g., enable fallback) to the main precision (which is the precision of the Inputs/Outputs data) and solve the problem from scratch returning the good solution. This is the behavior by default, and it will guarantee that the IRS solver always provide the good solution. This function is provided because we provided [`cusolverDnIRSParamsDisableFallback`] which allows the user to disable the fallback and thus this function allow the user to re-enable it.
1351 ///
1352 /// # Parameters
1353 ///
1354 /// - `params`: The `cusolverDnIRSParams_t Params` structure.
1355 ///
1356 /// # Return value
1357 ///
1358 /// - [`cusolverStatus_t::CUSOLVER_STATUS_IRS_PARAMS_NOT_INITIALIZED`]: The `Params` structure was not created.
1359 /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The operation completed successfully.
1360 pub fn cusolverDnIRSParamsEnableFallback(
1361 params: cusolverDnIRSParams_t,
1362 ) -> cusolverStatus_t;
1363}
1364unsafe extern "C" {
1365 /// This function disables the fallback to the main precision in case the Iterative Refinement Solver (IRS) failed to converge. In other term, if the IRS solver failed to converge, the solver will return a no convergence code (e.g., `niter` < 0), but can either return the non-convergent solution as it is (e.g., disable fallback) or can fallback (e.g., enable fallback) to the main precision (which is the precision of the Inputs/Outputs data) and solve the problem from scratch returning the good solution. This function disables the fallback and the returned solution is whatever the refinement solver was able to reach before it returns. Disabling fallback does not guarantee that the solution is the good one. However, if users want to keep getting the solution of the lower precision in case the IRS did not converge after certain number of iterations, they need to disable the fallback. The user can re-enable it by calling [`cusolverDnIRSParamsEnableFallback`].
1366 ///
1367 /// # Parameters
1368 ///
1369 /// - `params`: The `cusolverDnIRSParams_t Params` structure.
1370 ///
1371 /// # Return value
1372 ///
1373 /// - [`cusolverStatus_t::CUSOLVER_STATUS_IRS_PARAMS_NOT_INITIALIZED`]: The `Params` structure was not created.
1374 /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The operation completed successfully.
1375 pub fn cusolverDnIRSParamsDisableFallback(
1376 params: cusolverDnIRSParams_t,
1377 ) -> cusolverStatus_t;
1378}
1379unsafe extern "C" {
1380 /// 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.
1381 ///
1382 /// # Return value
1383 ///
1384 /// - [`cusolverStatus_t::CUSOLVER_STATUS_IRS_INFOS_NOT_INITIALIZED`]: The `Infos` structure was not created.
1385 /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The resources were released successfully.
1386 pub fn cusolverDnIRSInfosDestroy(infos: cusolverDnIRSInfos_t) -> cusolverStatus_t;
1387}
1388unsafe extern "C" {
1389 /// 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.
1390 ///
1391 /// # Return value
1392 ///
1393 /// - [`cusolverStatus_t::CUSOLVER_STATUS_ALLOC_FAILED`]: The resources could not be allocated.
1394 /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The structure was initialized successfully.
1395 pub fn cusolverDnIRSInfosCreate(
1396 infos_ptr: *mut cusolverDnIRSInfos_t,
1397 ) -> cusolverStatus_t;
1398}
1399unsafe extern "C" {
1400 /// 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()`.
1401 ///
1402 /// # Parameters
1403 ///
1404 /// - `infos`: The `cusolverDnIRSInfos_t Infos` structure.
1405 /// - `niters`: The total number of iterations performed by the IRS solver.
1406 ///
1407 /// # Return value
1408 ///
1409 /// - [`cusolverStatus_t::CUSOLVER_STATUS_IRS_INFOS_NOT_INITIALIZED`]: The `Infos` structure was not created.
1410 /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The operation completed successfully.
1411 pub fn cusolverDnIRSInfosGetNiters(
1412 infos: cusolverDnIRSInfos_t,
1413 niters: *mut cusolver_int_t,
1414 ) -> cusolverStatus_t;
1415}
1416unsafe extern "C" {
1417 /// 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.
1418 ///
1419 /// # Parameters
1420 ///
1421 /// - `infos`: The `cusolverDnIRSInfos_t Infos` structure.
1422 /// - `outer_niters`: The number of iterations of the outer refinement loop of the IRS solver.
1423 ///
1424 /// # Return value
1425 ///
1426 /// - [`cusolverStatus_t::CUSOLVER_STATUS_IRS_INFOS_NOT_INITIALIZED`]: The `Infos` structure was not created.
1427 /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The operation completed successfully.
1428 pub fn cusolverDnIRSInfosGetOuterNiters(
1429 infos: cusolverDnIRSInfos_t,
1430 outer_niters: *mut cusolver_int_t,
1431 ) -> cusolverStatus_t;
1432}
1433unsafe extern "C" {
1434 /// 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.
1435 ///
1436 /// # Parameters
1437 ///
1438 /// - `infos`: The `cusolverDnIRSInfos_t Infos` structure.
1439 ///
1440 /// # Return value
1441 ///
1442 /// - [`cusolverStatus_t::CUSOLVER_STATUS_IRS_INFOS_NOT_INITIALIZED`]: The `Infos` structure was not created.
1443 /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The operation completed successfully.
1444 pub fn cusolverDnIRSInfosRequestResidual(
1445 infos: cusolverDnIRSInfos_t,
1446 ) -> cusolverStatus_t;
1447}
1448unsafe extern "C" {
1449 /// 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`.
1450 ///
1451 /// 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.
1452 ///
1453 /// 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.
1454 ///
1455 /// If the refinement solver was [`cusolverIRSRefinement_t::CUSOLVER_IRS_REFINE_CLASSICAL_GMRES`] or [`cusolverIRSRefinement_t::CUSOLVER_IRS_REFINE_GMRES_GMRES`], then OuterNiters <= Niters corresponds to the outer iterations performed by the outer refinement loop. Thus, there is OuterNiters+1 residual norms where row *“i”* correspond to the outer iteration *“i”* and the first column specify the total number of iterations (outer and inner) that were performed till this step the second columns correspond to the residual norm at this step.
1456 ///
1457 /// 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.
1458 ///
1459 /// 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.
1460 ///
1461 /// # Parameters
1462 ///
1463 /// - `infos`: The `cusolverDnIRSInfos_t Infos` structure.
1464 /// - `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.
1465 ///
1466 /// # Return value
1467 ///
1468 /// - [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]: This function was called without calling [`cusolverDnIRSInfosRequestResidual`] in advance.
1469 /// - [`cusolverStatus_t::CUSOLVER_STATUS_IRS_INFOS_NOT_INITIALIZED`]: The `Infos` structure was not created.
1470 /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The operation completed successfully.
1471 pub fn cusolverDnIRSInfosGetResidualHistory(
1472 infos: cusolverDnIRSInfos_t,
1473 residual_history: *mut *mut ::core::ffi::c_void,
1474 ) -> cusolverStatus_t;
1475}
1476unsafe extern "C" {
1477 /// 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.
1478 ///
1479 /// # Parameters
1480 ///
1481 /// - `infos`: The `cusolverDnIRSInfos_t Infos` structure.
1482 /// - `maxiters`: The maximal number of iterations that is currently set.
1483 ///
1484 /// # Return value
1485 ///
1486 /// - [`cusolverStatus_t::CUSOLVER_STATUS_IRS_INFOS_NOT_INITIALIZED`]: The `Infos` structure was not created.
1487 /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The operation completed successfully.
1488 pub fn cusolverDnIRSInfosGetMaxIters(
1489 infos: cusolverDnIRSInfos_t,
1490 maxiters: *mut cusolver_int_t,
1491 ) -> cusolverStatus_t;
1492}
1493unsafe extern "C" {
1494 pub fn cusolverDnZZgesv(
1495 handle: cusolverDnHandle_t,
1496 n: cusolver_int_t,
1497 nrhs: cusolver_int_t,
1498 dA: *mut cuDoubleComplex,
1499 ldda: cusolver_int_t,
1500 dipiv: *mut cusolver_int_t,
1501 dB: *mut cuDoubleComplex,
1502 lddb: cusolver_int_t,
1503 dX: *mut cuDoubleComplex,
1504 lddx: cusolver_int_t,
1505 dWorkspace: *mut ::core::ffi::c_void,
1506 lwork_bytes: size_t,
1507 iter: *mut cusolver_int_t,
1508 d_info: *mut cusolver_int_t,
1509 ) -> cusolverStatus_t;
1510}
1511unsafe extern "C" {
1512 pub fn cusolverDnZCgesv(
1513 handle: cusolverDnHandle_t,
1514 n: cusolver_int_t,
1515 nrhs: cusolver_int_t,
1516 dA: *mut cuDoubleComplex,
1517 ldda: cusolver_int_t,
1518 dipiv: *mut cusolver_int_t,
1519 dB: *mut cuDoubleComplex,
1520 lddb: cusolver_int_t,
1521 dX: *mut cuDoubleComplex,
1522 lddx: cusolver_int_t,
1523 dWorkspace: *mut ::core::ffi::c_void,
1524 lwork_bytes: size_t,
1525 iter: *mut cusolver_int_t,
1526 d_info: *mut cusolver_int_t,
1527 ) -> cusolverStatus_t;
1528}
1529unsafe extern "C" {
1530 pub fn cusolverDnZKgesv(
1531 handle: cusolverDnHandle_t,
1532 n: cusolver_int_t,
1533 nrhs: cusolver_int_t,
1534 dA: *mut cuDoubleComplex,
1535 ldda: cusolver_int_t,
1536 dipiv: *mut cusolver_int_t,
1537 dB: *mut cuDoubleComplex,
1538 lddb: cusolver_int_t,
1539 dX: *mut cuDoubleComplex,
1540 lddx: cusolver_int_t,
1541 dWorkspace: *mut ::core::ffi::c_void,
1542 lwork_bytes: size_t,
1543 iter: *mut cusolver_int_t,
1544 d_info: *mut cusolver_int_t,
1545 ) -> cusolverStatus_t;
1546}
1547unsafe extern "C" {
1548 pub fn cusolverDnZEgesv(
1549 handle: cusolverDnHandle_t,
1550 n: cusolver_int_t,
1551 nrhs: cusolver_int_t,
1552 dA: *mut cuDoubleComplex,
1553 ldda: cusolver_int_t,
1554 dipiv: *mut cusolver_int_t,
1555 dB: *mut cuDoubleComplex,
1556 lddb: cusolver_int_t,
1557 dX: *mut cuDoubleComplex,
1558 lddx: cusolver_int_t,
1559 dWorkspace: *mut ::core::ffi::c_void,
1560 lwork_bytes: size_t,
1561 iter: *mut cusolver_int_t,
1562 d_info: *mut cusolver_int_t,
1563 ) -> cusolverStatus_t;
1564}
1565unsafe extern "C" {
1566 pub fn cusolverDnZYgesv(
1567 handle: cusolverDnHandle_t,
1568 n: cusolver_int_t,
1569 nrhs: cusolver_int_t,
1570 dA: *mut cuDoubleComplex,
1571 ldda: cusolver_int_t,
1572 dipiv: *mut cusolver_int_t,
1573 dB: *mut cuDoubleComplex,
1574 lddb: cusolver_int_t,
1575 dX: *mut cuDoubleComplex,
1576 lddx: cusolver_int_t,
1577 dWorkspace: *mut ::core::ffi::c_void,
1578 lwork_bytes: size_t,
1579 iter: *mut cusolver_int_t,
1580 d_info: *mut cusolver_int_t,
1581 ) -> cusolverStatus_t;
1582}
1583unsafe extern "C" {
1584 pub fn cusolverDnCCgesv(
1585 handle: cusolverDnHandle_t,
1586 n: cusolver_int_t,
1587 nrhs: cusolver_int_t,
1588 dA: *mut cuComplex,
1589 ldda: cusolver_int_t,
1590 dipiv: *mut cusolver_int_t,
1591 dB: *mut cuComplex,
1592 lddb: cusolver_int_t,
1593 dX: *mut cuComplex,
1594 lddx: cusolver_int_t,
1595 dWorkspace: *mut ::core::ffi::c_void,
1596 lwork_bytes: size_t,
1597 iter: *mut cusolver_int_t,
1598 d_info: *mut cusolver_int_t,
1599 ) -> cusolverStatus_t;
1600}
1601unsafe extern "C" {
1602 pub fn cusolverDnCEgesv(
1603 handle: cusolverDnHandle_t,
1604 n: cusolver_int_t,
1605 nrhs: cusolver_int_t,
1606 dA: *mut cuComplex,
1607 ldda: cusolver_int_t,
1608 dipiv: *mut cusolver_int_t,
1609 dB: *mut cuComplex,
1610 lddb: cusolver_int_t,
1611 dX: *mut cuComplex,
1612 lddx: cusolver_int_t,
1613 dWorkspace: *mut ::core::ffi::c_void,
1614 lwork_bytes: size_t,
1615 iter: *mut cusolver_int_t,
1616 d_info: *mut cusolver_int_t,
1617 ) -> cusolverStatus_t;
1618}
1619unsafe extern "C" {
1620 pub fn cusolverDnCKgesv(
1621 handle: cusolverDnHandle_t,
1622 n: cusolver_int_t,
1623 nrhs: cusolver_int_t,
1624 dA: *mut cuComplex,
1625 ldda: cusolver_int_t,
1626 dipiv: *mut cusolver_int_t,
1627 dB: *mut cuComplex,
1628 lddb: cusolver_int_t,
1629 dX: *mut cuComplex,
1630 lddx: cusolver_int_t,
1631 dWorkspace: *mut ::core::ffi::c_void,
1632 lwork_bytes: size_t,
1633 iter: *mut cusolver_int_t,
1634 d_info: *mut cusolver_int_t,
1635 ) -> cusolverStatus_t;
1636}
1637unsafe extern "C" {
1638 pub fn cusolverDnCYgesv(
1639 handle: cusolverDnHandle_t,
1640 n: cusolver_int_t,
1641 nrhs: cusolver_int_t,
1642 dA: *mut cuComplex,
1643 ldda: cusolver_int_t,
1644 dipiv: *mut cusolver_int_t,
1645 dB: *mut cuComplex,
1646 lddb: cusolver_int_t,
1647 dX: *mut cuComplex,
1648 lddx: cusolver_int_t,
1649 dWorkspace: *mut ::core::ffi::c_void,
1650 lwork_bytes: size_t,
1651 iter: *mut cusolver_int_t,
1652 d_info: *mut cusolver_int_t,
1653 ) -> cusolverStatus_t;
1654}
1655unsafe extern "C" {
1656 pub fn cusolverDnDDgesv(
1657 handle: cusolverDnHandle_t,
1658 n: cusolver_int_t,
1659 nrhs: cusolver_int_t,
1660 dA: *mut f64,
1661 ldda: cusolver_int_t,
1662 dipiv: *mut cusolver_int_t,
1663 dB: *mut f64,
1664 lddb: cusolver_int_t,
1665 dX: *mut f64,
1666 lddx: cusolver_int_t,
1667 dWorkspace: *mut ::core::ffi::c_void,
1668 lwork_bytes: size_t,
1669 iter: *mut cusolver_int_t,
1670 d_info: *mut cusolver_int_t,
1671 ) -> cusolverStatus_t;
1672}
1673unsafe extern "C" {
1674 pub fn cusolverDnDSgesv(
1675 handle: cusolverDnHandle_t,
1676 n: cusolver_int_t,
1677 nrhs: cusolver_int_t,
1678 dA: *mut f64,
1679 ldda: cusolver_int_t,
1680 dipiv: *mut cusolver_int_t,
1681 dB: *mut f64,
1682 lddb: cusolver_int_t,
1683 dX: *mut f64,
1684 lddx: cusolver_int_t,
1685 dWorkspace: *mut ::core::ffi::c_void,
1686 lwork_bytes: size_t,
1687 iter: *mut cusolver_int_t,
1688 d_info: *mut cusolver_int_t,
1689 ) -> cusolverStatus_t;
1690}
1691unsafe extern "C" {
1692 pub fn cusolverDnDHgesv(
1693 handle: cusolverDnHandle_t,
1694 n: cusolver_int_t,
1695 nrhs: cusolver_int_t,
1696 dA: *mut f64,
1697 ldda: cusolver_int_t,
1698 dipiv: *mut cusolver_int_t,
1699 dB: *mut f64,
1700 lddb: cusolver_int_t,
1701 dX: *mut f64,
1702 lddx: cusolver_int_t,
1703 dWorkspace: *mut ::core::ffi::c_void,
1704 lwork_bytes: size_t,
1705 iter: *mut cusolver_int_t,
1706 d_info: *mut cusolver_int_t,
1707 ) -> cusolverStatus_t;
1708}
1709unsafe extern "C" {
1710 pub fn cusolverDnDBgesv(
1711 handle: cusolverDnHandle_t,
1712 n: cusolver_int_t,
1713 nrhs: cusolver_int_t,
1714 dA: *mut f64,
1715 ldda: cusolver_int_t,
1716 dipiv: *mut cusolver_int_t,
1717 dB: *mut f64,
1718 lddb: cusolver_int_t,
1719 dX: *mut f64,
1720 lddx: cusolver_int_t,
1721 dWorkspace: *mut ::core::ffi::c_void,
1722 lwork_bytes: size_t,
1723 iter: *mut cusolver_int_t,
1724 d_info: *mut cusolver_int_t,
1725 ) -> cusolverStatus_t;
1726}
1727unsafe extern "C" {
1728 pub fn cusolverDnDXgesv(
1729 handle: cusolverDnHandle_t,
1730 n: cusolver_int_t,
1731 nrhs: cusolver_int_t,
1732 dA: *mut f64,
1733 ldda: cusolver_int_t,
1734 dipiv: *mut cusolver_int_t,
1735 dB: *mut f64,
1736 lddb: cusolver_int_t,
1737 dX: *mut f64,
1738 lddx: cusolver_int_t,
1739 dWorkspace: *mut ::core::ffi::c_void,
1740 lwork_bytes: size_t,
1741 iter: *mut cusolver_int_t,
1742 d_info: *mut cusolver_int_t,
1743 ) -> cusolverStatus_t;
1744}
1745unsafe extern "C" {
1746 pub fn cusolverDnSSgesv(
1747 handle: cusolverDnHandle_t,
1748 n: cusolver_int_t,
1749 nrhs: cusolver_int_t,
1750 dA: *mut f32,
1751 ldda: cusolver_int_t,
1752 dipiv: *mut cusolver_int_t,
1753 dB: *mut f32,
1754 lddb: cusolver_int_t,
1755 dX: *mut f32,
1756 lddx: cusolver_int_t,
1757 dWorkspace: *mut ::core::ffi::c_void,
1758 lwork_bytes: size_t,
1759 iter: *mut cusolver_int_t,
1760 d_info: *mut cusolver_int_t,
1761 ) -> cusolverStatus_t;
1762}
1763unsafe extern "C" {
1764 pub fn cusolverDnSHgesv(
1765 handle: cusolverDnHandle_t,
1766 n: cusolver_int_t,
1767 nrhs: cusolver_int_t,
1768 dA: *mut f32,
1769 ldda: cusolver_int_t,
1770 dipiv: *mut cusolver_int_t,
1771 dB: *mut f32,
1772 lddb: cusolver_int_t,
1773 dX: *mut f32,
1774 lddx: cusolver_int_t,
1775 dWorkspace: *mut ::core::ffi::c_void,
1776 lwork_bytes: size_t,
1777 iter: *mut cusolver_int_t,
1778 d_info: *mut cusolver_int_t,
1779 ) -> cusolverStatus_t;
1780}
1781unsafe extern "C" {
1782 pub fn cusolverDnSBgesv(
1783 handle: cusolverDnHandle_t,
1784 n: cusolver_int_t,
1785 nrhs: cusolver_int_t,
1786 dA: *mut f32,
1787 ldda: cusolver_int_t,
1788 dipiv: *mut cusolver_int_t,
1789 dB: *mut f32,
1790 lddb: cusolver_int_t,
1791 dX: *mut f32,
1792 lddx: cusolver_int_t,
1793 dWorkspace: *mut ::core::ffi::c_void,
1794 lwork_bytes: size_t,
1795 iter: *mut cusolver_int_t,
1796 d_info: *mut cusolver_int_t,
1797 ) -> cusolverStatus_t;
1798}
1799unsafe extern "C" {
1800 pub fn cusolverDnSXgesv(
1801 handle: cusolverDnHandle_t,
1802 n: cusolver_int_t,
1803 nrhs: cusolver_int_t,
1804 dA: *mut f32,
1805 ldda: cusolver_int_t,
1806 dipiv: *mut cusolver_int_t,
1807 dB: *mut f32,
1808 lddb: cusolver_int_t,
1809 dX: *mut f32,
1810 lddx: cusolver_int_t,
1811 dWorkspace: *mut ::core::ffi::c_void,
1812 lwork_bytes: size_t,
1813 iter: *mut cusolver_int_t,
1814 d_info: *mut cusolver_int_t,
1815 ) -> cusolverStatus_t;
1816}
1817unsafe extern "C" {
1818 pub fn cusolverDnZZgesv_bufferSize(
1819 handle: cusolverDnHandle_t,
1820 n: cusolver_int_t,
1821 nrhs: cusolver_int_t,
1822 dA: *mut cuDoubleComplex,
1823 ldda: cusolver_int_t,
1824 dipiv: *mut cusolver_int_t,
1825 dB: *mut cuDoubleComplex,
1826 lddb: cusolver_int_t,
1827 dX: *mut cuDoubleComplex,
1828 lddx: cusolver_int_t,
1829 dWorkspace: *mut ::core::ffi::c_void,
1830 lwork_bytes: *mut size_t,
1831 ) -> cusolverStatus_t;
1832}
1833unsafe extern "C" {
1834 pub fn cusolverDnZCgesv_bufferSize(
1835 handle: cusolverDnHandle_t,
1836 n: cusolver_int_t,
1837 nrhs: cusolver_int_t,
1838 dA: *mut cuDoubleComplex,
1839 ldda: cusolver_int_t,
1840 dipiv: *mut cusolver_int_t,
1841 dB: *mut cuDoubleComplex,
1842 lddb: cusolver_int_t,
1843 dX: *mut cuDoubleComplex,
1844 lddx: cusolver_int_t,
1845 dWorkspace: *mut ::core::ffi::c_void,
1846 lwork_bytes: *mut size_t,
1847 ) -> cusolverStatus_t;
1848}
1849unsafe extern "C" {
1850 pub fn cusolverDnZKgesv_bufferSize(
1851 handle: cusolverDnHandle_t,
1852 n: cusolver_int_t,
1853 nrhs: cusolver_int_t,
1854 dA: *mut cuDoubleComplex,
1855 ldda: cusolver_int_t,
1856 dipiv: *mut cusolver_int_t,
1857 dB: *mut cuDoubleComplex,
1858 lddb: cusolver_int_t,
1859 dX: *mut cuDoubleComplex,
1860 lddx: cusolver_int_t,
1861 dWorkspace: *mut ::core::ffi::c_void,
1862 lwork_bytes: *mut size_t,
1863 ) -> cusolverStatus_t;
1864}
1865unsafe extern "C" {
1866 pub fn cusolverDnZEgesv_bufferSize(
1867 handle: cusolverDnHandle_t,
1868 n: cusolver_int_t,
1869 nrhs: cusolver_int_t,
1870 dA: *mut cuDoubleComplex,
1871 ldda: cusolver_int_t,
1872 dipiv: *mut cusolver_int_t,
1873 dB: *mut cuDoubleComplex,
1874 lddb: cusolver_int_t,
1875 dX: *mut cuDoubleComplex,
1876 lddx: cusolver_int_t,
1877 dWorkspace: *mut ::core::ffi::c_void,
1878 lwork_bytes: *mut size_t,
1879 ) -> cusolverStatus_t;
1880}
1881unsafe extern "C" {
1882 pub fn cusolverDnZYgesv_bufferSize(
1883 handle: cusolverDnHandle_t,
1884 n: cusolver_int_t,
1885 nrhs: cusolver_int_t,
1886 dA: *mut cuDoubleComplex,
1887 ldda: cusolver_int_t,
1888 dipiv: *mut cusolver_int_t,
1889 dB: *mut cuDoubleComplex,
1890 lddb: cusolver_int_t,
1891 dX: *mut cuDoubleComplex,
1892 lddx: cusolver_int_t,
1893 dWorkspace: *mut ::core::ffi::c_void,
1894 lwork_bytes: *mut size_t,
1895 ) -> cusolverStatus_t;
1896}
1897unsafe extern "C" {
1898 pub fn cusolverDnCCgesv_bufferSize(
1899 handle: cusolverDnHandle_t,
1900 n: cusolver_int_t,
1901 nrhs: cusolver_int_t,
1902 dA: *mut cuComplex,
1903 ldda: cusolver_int_t,
1904 dipiv: *mut cusolver_int_t,
1905 dB: *mut cuComplex,
1906 lddb: cusolver_int_t,
1907 dX: *mut cuComplex,
1908 lddx: cusolver_int_t,
1909 dWorkspace: *mut ::core::ffi::c_void,
1910 lwork_bytes: *mut size_t,
1911 ) -> cusolverStatus_t;
1912}
1913unsafe extern "C" {
1914 pub fn cusolverDnCKgesv_bufferSize(
1915 handle: cusolverDnHandle_t,
1916 n: cusolver_int_t,
1917 nrhs: cusolver_int_t,
1918 dA: *mut cuComplex,
1919 ldda: cusolver_int_t,
1920 dipiv: *mut cusolver_int_t,
1921 dB: *mut cuComplex,
1922 lddb: cusolver_int_t,
1923 dX: *mut cuComplex,
1924 lddx: cusolver_int_t,
1925 dWorkspace: *mut ::core::ffi::c_void,
1926 lwork_bytes: *mut size_t,
1927 ) -> cusolverStatus_t;
1928}
1929unsafe extern "C" {
1930 pub fn cusolverDnCEgesv_bufferSize(
1931 handle: cusolverDnHandle_t,
1932 n: cusolver_int_t,
1933 nrhs: cusolver_int_t,
1934 dA: *mut cuComplex,
1935 ldda: cusolver_int_t,
1936 dipiv: *mut cusolver_int_t,
1937 dB: *mut cuComplex,
1938 lddb: cusolver_int_t,
1939 dX: *mut cuComplex,
1940 lddx: cusolver_int_t,
1941 dWorkspace: *mut ::core::ffi::c_void,
1942 lwork_bytes: *mut size_t,
1943 ) -> cusolverStatus_t;
1944}
1945unsafe extern "C" {
1946 pub fn cusolverDnCYgesv_bufferSize(
1947 handle: cusolverDnHandle_t,
1948 n: cusolver_int_t,
1949 nrhs: cusolver_int_t,
1950 dA: *mut cuComplex,
1951 ldda: cusolver_int_t,
1952 dipiv: *mut cusolver_int_t,
1953 dB: *mut cuComplex,
1954 lddb: cusolver_int_t,
1955 dX: *mut cuComplex,
1956 lddx: cusolver_int_t,
1957 dWorkspace: *mut ::core::ffi::c_void,
1958 lwork_bytes: *mut size_t,
1959 ) -> cusolverStatus_t;
1960}
1961unsafe extern "C" {
1962 pub fn cusolverDnDDgesv_bufferSize(
1963 handle: cusolverDnHandle_t,
1964 n: cusolver_int_t,
1965 nrhs: cusolver_int_t,
1966 dA: *mut f64,
1967 ldda: cusolver_int_t,
1968 dipiv: *mut cusolver_int_t,
1969 dB: *mut f64,
1970 lddb: cusolver_int_t,
1971 dX: *mut f64,
1972 lddx: cusolver_int_t,
1973 dWorkspace: *mut ::core::ffi::c_void,
1974 lwork_bytes: *mut size_t,
1975 ) -> cusolverStatus_t;
1976}
1977unsafe extern "C" {
1978 pub fn cusolverDnDSgesv_bufferSize(
1979 handle: cusolverDnHandle_t,
1980 n: cusolver_int_t,
1981 nrhs: cusolver_int_t,
1982 dA: *mut f64,
1983 ldda: cusolver_int_t,
1984 dipiv: *mut cusolver_int_t,
1985 dB: *mut f64,
1986 lddb: cusolver_int_t,
1987 dX: *mut f64,
1988 lddx: cusolver_int_t,
1989 dWorkspace: *mut ::core::ffi::c_void,
1990 lwork_bytes: *mut size_t,
1991 ) -> cusolverStatus_t;
1992}
1993unsafe extern "C" {
1994 pub fn cusolverDnDHgesv_bufferSize(
1995 handle: cusolverDnHandle_t,
1996 n: cusolver_int_t,
1997 nrhs: cusolver_int_t,
1998 dA: *mut f64,
1999 ldda: cusolver_int_t,
2000 dipiv: *mut cusolver_int_t,
2001 dB: *mut f64,
2002 lddb: cusolver_int_t,
2003 dX: *mut f64,
2004 lddx: cusolver_int_t,
2005 dWorkspace: *mut ::core::ffi::c_void,
2006 lwork_bytes: *mut size_t,
2007 ) -> cusolverStatus_t;
2008}
2009unsafe extern "C" {
2010 pub fn cusolverDnDBgesv_bufferSize(
2011 handle: cusolverDnHandle_t,
2012 n: cusolver_int_t,
2013 nrhs: cusolver_int_t,
2014 dA: *mut f64,
2015 ldda: cusolver_int_t,
2016 dipiv: *mut cusolver_int_t,
2017 dB: *mut f64,
2018 lddb: cusolver_int_t,
2019 dX: *mut f64,
2020 lddx: cusolver_int_t,
2021 dWorkspace: *mut ::core::ffi::c_void,
2022 lwork_bytes: *mut size_t,
2023 ) -> cusolverStatus_t;
2024}
2025unsafe extern "C" {
2026 pub fn cusolverDnDXgesv_bufferSize(
2027 handle: cusolverDnHandle_t,
2028 n: cusolver_int_t,
2029 nrhs: cusolver_int_t,
2030 dA: *mut f64,
2031 ldda: cusolver_int_t,
2032 dipiv: *mut cusolver_int_t,
2033 dB: *mut f64,
2034 lddb: cusolver_int_t,
2035 dX: *mut f64,
2036 lddx: cusolver_int_t,
2037 dWorkspace: *mut ::core::ffi::c_void,
2038 lwork_bytes: *mut size_t,
2039 ) -> cusolverStatus_t;
2040}
2041unsafe extern "C" {
2042 pub fn cusolverDnSSgesv_bufferSize(
2043 handle: cusolverDnHandle_t,
2044 n: cusolver_int_t,
2045 nrhs: cusolver_int_t,
2046 dA: *mut f32,
2047 ldda: cusolver_int_t,
2048 dipiv: *mut cusolver_int_t,
2049 dB: *mut f32,
2050 lddb: cusolver_int_t,
2051 dX: *mut f32,
2052 lddx: cusolver_int_t,
2053 dWorkspace: *mut ::core::ffi::c_void,
2054 lwork_bytes: *mut size_t,
2055 ) -> cusolverStatus_t;
2056}
2057unsafe extern "C" {
2058 pub fn cusolverDnSHgesv_bufferSize(
2059 handle: cusolverDnHandle_t,
2060 n: cusolver_int_t,
2061 nrhs: cusolver_int_t,
2062 dA: *mut f32,
2063 ldda: cusolver_int_t,
2064 dipiv: *mut cusolver_int_t,
2065 dB: *mut f32,
2066 lddb: cusolver_int_t,
2067 dX: *mut f32,
2068 lddx: cusolver_int_t,
2069 dWorkspace: *mut ::core::ffi::c_void,
2070 lwork_bytes: *mut size_t,
2071 ) -> cusolverStatus_t;
2072}
2073unsafe extern "C" {
2074 pub fn cusolverDnSBgesv_bufferSize(
2075 handle: cusolverDnHandle_t,
2076 n: cusolver_int_t,
2077 nrhs: cusolver_int_t,
2078 dA: *mut f32,
2079 ldda: cusolver_int_t,
2080 dipiv: *mut cusolver_int_t,
2081 dB: *mut f32,
2082 lddb: cusolver_int_t,
2083 dX: *mut f32,
2084 lddx: cusolver_int_t,
2085 dWorkspace: *mut ::core::ffi::c_void,
2086 lwork_bytes: *mut size_t,
2087 ) -> cusolverStatus_t;
2088}
2089unsafe extern "C" {
2090 pub fn cusolverDnSXgesv_bufferSize(
2091 handle: cusolverDnHandle_t,
2092 n: cusolver_int_t,
2093 nrhs: cusolver_int_t,
2094 dA: *mut f32,
2095 ldda: cusolver_int_t,
2096 dipiv: *mut cusolver_int_t,
2097 dB: *mut f32,
2098 lddb: cusolver_int_t,
2099 dX: *mut f32,
2100 lddx: cusolver_int_t,
2101 dWorkspace: *mut ::core::ffi::c_void,
2102 lwork_bytes: *mut size_t,
2103 ) -> cusolverStatus_t;
2104}
2105unsafe extern "C" {
2106 pub fn cusolverDnZZgels(
2107 handle: cusolverDnHandle_t,
2108 m: cusolver_int_t,
2109 n: cusolver_int_t,
2110 nrhs: cusolver_int_t,
2111 dA: *mut cuDoubleComplex,
2112 ldda: cusolver_int_t,
2113 dB: *mut cuDoubleComplex,
2114 lddb: cusolver_int_t,
2115 dX: *mut cuDoubleComplex,
2116 lddx: cusolver_int_t,
2117 dWorkspace: *mut ::core::ffi::c_void,
2118 lwork_bytes: size_t,
2119 iter: *mut cusolver_int_t,
2120 d_info: *mut cusolver_int_t,
2121 ) -> cusolverStatus_t;
2122}
2123unsafe extern "C" {
2124 pub fn cusolverDnZCgels(
2125 handle: cusolverDnHandle_t,
2126 m: cusolver_int_t,
2127 n: cusolver_int_t,
2128 nrhs: cusolver_int_t,
2129 dA: *mut cuDoubleComplex,
2130 ldda: cusolver_int_t,
2131 dB: *mut cuDoubleComplex,
2132 lddb: cusolver_int_t,
2133 dX: *mut cuDoubleComplex,
2134 lddx: cusolver_int_t,
2135 dWorkspace: *mut ::core::ffi::c_void,
2136 lwork_bytes: size_t,
2137 iter: *mut cusolver_int_t,
2138 d_info: *mut cusolver_int_t,
2139 ) -> cusolverStatus_t;
2140}
2141unsafe extern "C" {
2142 pub fn cusolverDnZKgels(
2143 handle: cusolverDnHandle_t,
2144 m: cusolver_int_t,
2145 n: cusolver_int_t,
2146 nrhs: cusolver_int_t,
2147 dA: *mut cuDoubleComplex,
2148 ldda: cusolver_int_t,
2149 dB: *mut cuDoubleComplex,
2150 lddb: cusolver_int_t,
2151 dX: *mut cuDoubleComplex,
2152 lddx: cusolver_int_t,
2153 dWorkspace: *mut ::core::ffi::c_void,
2154 lwork_bytes: size_t,
2155 iter: *mut cusolver_int_t,
2156 d_info: *mut cusolver_int_t,
2157 ) -> cusolverStatus_t;
2158}
2159unsafe extern "C" {
2160 pub fn cusolverDnZEgels(
2161 handle: cusolverDnHandle_t,
2162 m: cusolver_int_t,
2163 n: cusolver_int_t,
2164 nrhs: cusolver_int_t,
2165 dA: *mut cuDoubleComplex,
2166 ldda: cusolver_int_t,
2167 dB: *mut cuDoubleComplex,
2168 lddb: cusolver_int_t,
2169 dX: *mut cuDoubleComplex,
2170 lddx: cusolver_int_t,
2171 dWorkspace: *mut ::core::ffi::c_void,
2172 lwork_bytes: size_t,
2173 iter: *mut cusolver_int_t,
2174 d_info: *mut cusolver_int_t,
2175 ) -> cusolverStatus_t;
2176}
2177unsafe extern "C" {
2178 pub fn cusolverDnZYgels(
2179 handle: cusolverDnHandle_t,
2180 m: cusolver_int_t,
2181 n: cusolver_int_t,
2182 nrhs: cusolver_int_t,
2183 dA: *mut cuDoubleComplex,
2184 ldda: cusolver_int_t,
2185 dB: *mut cuDoubleComplex,
2186 lddb: cusolver_int_t,
2187 dX: *mut cuDoubleComplex,
2188 lddx: cusolver_int_t,
2189 dWorkspace: *mut ::core::ffi::c_void,
2190 lwork_bytes: size_t,
2191 iter: *mut cusolver_int_t,
2192 d_info: *mut cusolver_int_t,
2193 ) -> cusolverStatus_t;
2194}
2195unsafe extern "C" {
2196 pub fn cusolverDnCCgels(
2197 handle: cusolverDnHandle_t,
2198 m: cusolver_int_t,
2199 n: cusolver_int_t,
2200 nrhs: cusolver_int_t,
2201 dA: *mut cuComplex,
2202 ldda: cusolver_int_t,
2203 dB: *mut cuComplex,
2204 lddb: cusolver_int_t,
2205 dX: *mut cuComplex,
2206 lddx: cusolver_int_t,
2207 dWorkspace: *mut ::core::ffi::c_void,
2208 lwork_bytes: size_t,
2209 iter: *mut cusolver_int_t,
2210 d_info: *mut cusolver_int_t,
2211 ) -> cusolverStatus_t;
2212}
2213unsafe extern "C" {
2214 pub fn cusolverDnCKgels(
2215 handle: cusolverDnHandle_t,
2216 m: cusolver_int_t,
2217 n: cusolver_int_t,
2218 nrhs: cusolver_int_t,
2219 dA: *mut cuComplex,
2220 ldda: cusolver_int_t,
2221 dB: *mut cuComplex,
2222 lddb: cusolver_int_t,
2223 dX: *mut cuComplex,
2224 lddx: cusolver_int_t,
2225 dWorkspace: *mut ::core::ffi::c_void,
2226 lwork_bytes: size_t,
2227 iter: *mut cusolver_int_t,
2228 d_info: *mut cusolver_int_t,
2229 ) -> cusolverStatus_t;
2230}
2231unsafe extern "C" {
2232 pub fn cusolverDnCEgels(
2233 handle: cusolverDnHandle_t,
2234 m: cusolver_int_t,
2235 n: cusolver_int_t,
2236 nrhs: cusolver_int_t,
2237 dA: *mut cuComplex,
2238 ldda: cusolver_int_t,
2239 dB: *mut cuComplex,
2240 lddb: cusolver_int_t,
2241 dX: *mut cuComplex,
2242 lddx: cusolver_int_t,
2243 dWorkspace: *mut ::core::ffi::c_void,
2244 lwork_bytes: size_t,
2245 iter: *mut cusolver_int_t,
2246 d_info: *mut cusolver_int_t,
2247 ) -> cusolverStatus_t;
2248}
2249unsafe extern "C" {
2250 pub fn cusolverDnCYgels(
2251 handle: cusolverDnHandle_t,
2252 m: cusolver_int_t,
2253 n: cusolver_int_t,
2254 nrhs: cusolver_int_t,
2255 dA: *mut cuComplex,
2256 ldda: cusolver_int_t,
2257 dB: *mut cuComplex,
2258 lddb: cusolver_int_t,
2259 dX: *mut cuComplex,
2260 lddx: cusolver_int_t,
2261 dWorkspace: *mut ::core::ffi::c_void,
2262 lwork_bytes: size_t,
2263 iter: *mut cusolver_int_t,
2264 d_info: *mut cusolver_int_t,
2265 ) -> cusolverStatus_t;
2266}
2267unsafe extern "C" {
2268 pub fn cusolverDnDDgels(
2269 handle: cusolverDnHandle_t,
2270 m: cusolver_int_t,
2271 n: cusolver_int_t,
2272 nrhs: cusolver_int_t,
2273 dA: *mut f64,
2274 ldda: cusolver_int_t,
2275 dB: *mut f64,
2276 lddb: cusolver_int_t,
2277 dX: *mut f64,
2278 lddx: cusolver_int_t,
2279 dWorkspace: *mut ::core::ffi::c_void,
2280 lwork_bytes: size_t,
2281 iter: *mut cusolver_int_t,
2282 d_info: *mut cusolver_int_t,
2283 ) -> cusolverStatus_t;
2284}
2285unsafe extern "C" {
2286 pub fn cusolverDnDSgels(
2287 handle: cusolverDnHandle_t,
2288 m: cusolver_int_t,
2289 n: cusolver_int_t,
2290 nrhs: cusolver_int_t,
2291 dA: *mut f64,
2292 ldda: cusolver_int_t,
2293 dB: *mut f64,
2294 lddb: cusolver_int_t,
2295 dX: *mut f64,
2296 lddx: cusolver_int_t,
2297 dWorkspace: *mut ::core::ffi::c_void,
2298 lwork_bytes: size_t,
2299 iter: *mut cusolver_int_t,
2300 d_info: *mut cusolver_int_t,
2301 ) -> cusolverStatus_t;
2302}
2303unsafe extern "C" {
2304 pub fn cusolverDnDHgels(
2305 handle: cusolverDnHandle_t,
2306 m: cusolver_int_t,
2307 n: cusolver_int_t,
2308 nrhs: cusolver_int_t,
2309 dA: *mut f64,
2310 ldda: cusolver_int_t,
2311 dB: *mut f64,
2312 lddb: cusolver_int_t,
2313 dX: *mut f64,
2314 lddx: cusolver_int_t,
2315 dWorkspace: *mut ::core::ffi::c_void,
2316 lwork_bytes: size_t,
2317 iter: *mut cusolver_int_t,
2318 d_info: *mut cusolver_int_t,
2319 ) -> cusolverStatus_t;
2320}
2321unsafe extern "C" {
2322 pub fn cusolverDnDBgels(
2323 handle: cusolverDnHandle_t,
2324 m: cusolver_int_t,
2325 n: cusolver_int_t,
2326 nrhs: cusolver_int_t,
2327 dA: *mut f64,
2328 ldda: cusolver_int_t,
2329 dB: *mut f64,
2330 lddb: cusolver_int_t,
2331 dX: *mut f64,
2332 lddx: cusolver_int_t,
2333 dWorkspace: *mut ::core::ffi::c_void,
2334 lwork_bytes: size_t,
2335 iter: *mut cusolver_int_t,
2336 d_info: *mut cusolver_int_t,
2337 ) -> cusolverStatus_t;
2338}
2339unsafe extern "C" {
2340 pub fn cusolverDnDXgels(
2341 handle: cusolverDnHandle_t,
2342 m: cusolver_int_t,
2343 n: cusolver_int_t,
2344 nrhs: cusolver_int_t,
2345 dA: *mut f64,
2346 ldda: cusolver_int_t,
2347 dB: *mut f64,
2348 lddb: cusolver_int_t,
2349 dX: *mut f64,
2350 lddx: cusolver_int_t,
2351 dWorkspace: *mut ::core::ffi::c_void,
2352 lwork_bytes: size_t,
2353 iter: *mut cusolver_int_t,
2354 d_info: *mut cusolver_int_t,
2355 ) -> cusolverStatus_t;
2356}
2357unsafe extern "C" {
2358 pub fn cusolverDnSSgels(
2359 handle: cusolverDnHandle_t,
2360 m: cusolver_int_t,
2361 n: cusolver_int_t,
2362 nrhs: cusolver_int_t,
2363 dA: *mut f32,
2364 ldda: cusolver_int_t,
2365 dB: *mut f32,
2366 lddb: cusolver_int_t,
2367 dX: *mut f32,
2368 lddx: cusolver_int_t,
2369 dWorkspace: *mut ::core::ffi::c_void,
2370 lwork_bytes: size_t,
2371 iter: *mut cusolver_int_t,
2372 d_info: *mut cusolver_int_t,
2373 ) -> cusolverStatus_t;
2374}
2375unsafe extern "C" {
2376 pub fn cusolverDnSHgels(
2377 handle: cusolverDnHandle_t,
2378 m: cusolver_int_t,
2379 n: cusolver_int_t,
2380 nrhs: cusolver_int_t,
2381 dA: *mut f32,
2382 ldda: cusolver_int_t,
2383 dB: *mut f32,
2384 lddb: cusolver_int_t,
2385 dX: *mut f32,
2386 lddx: cusolver_int_t,
2387 dWorkspace: *mut ::core::ffi::c_void,
2388 lwork_bytes: size_t,
2389 iter: *mut cusolver_int_t,
2390 d_info: *mut cusolver_int_t,
2391 ) -> cusolverStatus_t;
2392}
2393unsafe extern "C" {
2394 pub fn cusolverDnSBgels(
2395 handle: cusolverDnHandle_t,
2396 m: cusolver_int_t,
2397 n: cusolver_int_t,
2398 nrhs: cusolver_int_t,
2399 dA: *mut f32,
2400 ldda: cusolver_int_t,
2401 dB: *mut f32,
2402 lddb: cusolver_int_t,
2403 dX: *mut f32,
2404 lddx: cusolver_int_t,
2405 dWorkspace: *mut ::core::ffi::c_void,
2406 lwork_bytes: size_t,
2407 iter: *mut cusolver_int_t,
2408 d_info: *mut cusolver_int_t,
2409 ) -> cusolverStatus_t;
2410}
2411unsafe extern "C" {
2412 pub fn cusolverDnSXgels(
2413 handle: cusolverDnHandle_t,
2414 m: cusolver_int_t,
2415 n: cusolver_int_t,
2416 nrhs: cusolver_int_t,
2417 dA: *mut f32,
2418 ldda: cusolver_int_t,
2419 dB: *mut f32,
2420 lddb: cusolver_int_t,
2421 dX: *mut f32,
2422 lddx: cusolver_int_t,
2423 dWorkspace: *mut ::core::ffi::c_void,
2424 lwork_bytes: size_t,
2425 iter: *mut cusolver_int_t,
2426 d_info: *mut cusolver_int_t,
2427 ) -> cusolverStatus_t;
2428}
2429unsafe extern "C" {
2430 pub fn cusolverDnZZgels_bufferSize(
2431 handle: cusolverDnHandle_t,
2432 m: cusolver_int_t,
2433 n: cusolver_int_t,
2434 nrhs: cusolver_int_t,
2435 dA: *mut cuDoubleComplex,
2436 ldda: cusolver_int_t,
2437 dB: *mut cuDoubleComplex,
2438 lddb: cusolver_int_t,
2439 dX: *mut cuDoubleComplex,
2440 lddx: cusolver_int_t,
2441 dWorkspace: *mut ::core::ffi::c_void,
2442 lwork_bytes: *mut size_t,
2443 ) -> cusolverStatus_t;
2444}
2445unsafe extern "C" {
2446 pub fn cusolverDnZCgels_bufferSize(
2447 handle: cusolverDnHandle_t,
2448 m: cusolver_int_t,
2449 n: cusolver_int_t,
2450 nrhs: cusolver_int_t,
2451 dA: *mut cuDoubleComplex,
2452 ldda: cusolver_int_t,
2453 dB: *mut cuDoubleComplex,
2454 lddb: cusolver_int_t,
2455 dX: *mut cuDoubleComplex,
2456 lddx: cusolver_int_t,
2457 dWorkspace: *mut ::core::ffi::c_void,
2458 lwork_bytes: *mut size_t,
2459 ) -> cusolverStatus_t;
2460}
2461unsafe extern "C" {
2462 pub fn cusolverDnZKgels_bufferSize(
2463 handle: cusolverDnHandle_t,
2464 m: cusolver_int_t,
2465 n: cusolver_int_t,
2466 nrhs: cusolver_int_t,
2467 dA: *mut cuDoubleComplex,
2468 ldda: cusolver_int_t,
2469 dB: *mut cuDoubleComplex,
2470 lddb: cusolver_int_t,
2471 dX: *mut cuDoubleComplex,
2472 lddx: cusolver_int_t,
2473 dWorkspace: *mut ::core::ffi::c_void,
2474 lwork_bytes: *mut size_t,
2475 ) -> cusolverStatus_t;
2476}
2477unsafe extern "C" {
2478 pub fn cusolverDnZEgels_bufferSize(
2479 handle: cusolverDnHandle_t,
2480 m: cusolver_int_t,
2481 n: cusolver_int_t,
2482 nrhs: cusolver_int_t,
2483 dA: *mut cuDoubleComplex,
2484 ldda: cusolver_int_t,
2485 dB: *mut cuDoubleComplex,
2486 lddb: cusolver_int_t,
2487 dX: *mut cuDoubleComplex,
2488 lddx: cusolver_int_t,
2489 dWorkspace: *mut ::core::ffi::c_void,
2490 lwork_bytes: *mut size_t,
2491 ) -> cusolverStatus_t;
2492}
2493unsafe extern "C" {
2494 pub fn cusolverDnZYgels_bufferSize(
2495 handle: cusolverDnHandle_t,
2496 m: cusolver_int_t,
2497 n: cusolver_int_t,
2498 nrhs: cusolver_int_t,
2499 dA: *mut cuDoubleComplex,
2500 ldda: cusolver_int_t,
2501 dB: *mut cuDoubleComplex,
2502 lddb: cusolver_int_t,
2503 dX: *mut cuDoubleComplex,
2504 lddx: cusolver_int_t,
2505 dWorkspace: *mut ::core::ffi::c_void,
2506 lwork_bytes: *mut size_t,
2507 ) -> cusolverStatus_t;
2508}
2509unsafe extern "C" {
2510 pub fn cusolverDnCCgels_bufferSize(
2511 handle: cusolverDnHandle_t,
2512 m: cusolver_int_t,
2513 n: cusolver_int_t,
2514 nrhs: cusolver_int_t,
2515 dA: *mut cuComplex,
2516 ldda: cusolver_int_t,
2517 dB: *mut cuComplex,
2518 lddb: cusolver_int_t,
2519 dX: *mut cuComplex,
2520 lddx: cusolver_int_t,
2521 dWorkspace: *mut ::core::ffi::c_void,
2522 lwork_bytes: *mut size_t,
2523 ) -> cusolverStatus_t;
2524}
2525unsafe extern "C" {
2526 pub fn cusolverDnCKgels_bufferSize(
2527 handle: cusolverDnHandle_t,
2528 m: cusolver_int_t,
2529 n: cusolver_int_t,
2530 nrhs: cusolver_int_t,
2531 dA: *mut cuComplex,
2532 ldda: cusolver_int_t,
2533 dB: *mut cuComplex,
2534 lddb: cusolver_int_t,
2535 dX: *mut cuComplex,
2536 lddx: cusolver_int_t,
2537 dWorkspace: *mut ::core::ffi::c_void,
2538 lwork_bytes: *mut size_t,
2539 ) -> cusolverStatus_t;
2540}
2541unsafe extern "C" {
2542 pub fn cusolverDnCEgels_bufferSize(
2543 handle: cusolverDnHandle_t,
2544 m: cusolver_int_t,
2545 n: cusolver_int_t,
2546 nrhs: cusolver_int_t,
2547 dA: *mut cuComplex,
2548 ldda: cusolver_int_t,
2549 dB: *mut cuComplex,
2550 lddb: cusolver_int_t,
2551 dX: *mut cuComplex,
2552 lddx: cusolver_int_t,
2553 dWorkspace: *mut ::core::ffi::c_void,
2554 lwork_bytes: *mut size_t,
2555 ) -> cusolverStatus_t;
2556}
2557unsafe extern "C" {
2558 pub fn cusolverDnCYgels_bufferSize(
2559 handle: cusolverDnHandle_t,
2560 m: cusolver_int_t,
2561 n: cusolver_int_t,
2562 nrhs: cusolver_int_t,
2563 dA: *mut cuComplex,
2564 ldda: cusolver_int_t,
2565 dB: *mut cuComplex,
2566 lddb: cusolver_int_t,
2567 dX: *mut cuComplex,
2568 lddx: cusolver_int_t,
2569 dWorkspace: *mut ::core::ffi::c_void,
2570 lwork_bytes: *mut size_t,
2571 ) -> cusolverStatus_t;
2572}
2573unsafe extern "C" {
2574 pub fn cusolverDnDDgels_bufferSize(
2575 handle: cusolverDnHandle_t,
2576 m: cusolver_int_t,
2577 n: cusolver_int_t,
2578 nrhs: cusolver_int_t,
2579 dA: *mut f64,
2580 ldda: cusolver_int_t,
2581 dB: *mut f64,
2582 lddb: cusolver_int_t,
2583 dX: *mut f64,
2584 lddx: cusolver_int_t,
2585 dWorkspace: *mut ::core::ffi::c_void,
2586 lwork_bytes: *mut size_t,
2587 ) -> cusolverStatus_t;
2588}
2589unsafe extern "C" {
2590 pub fn cusolverDnDSgels_bufferSize(
2591 handle: cusolverDnHandle_t,
2592 m: cusolver_int_t,
2593 n: cusolver_int_t,
2594 nrhs: cusolver_int_t,
2595 dA: *mut f64,
2596 ldda: cusolver_int_t,
2597 dB: *mut f64,
2598 lddb: cusolver_int_t,
2599 dX: *mut f64,
2600 lddx: cusolver_int_t,
2601 dWorkspace: *mut ::core::ffi::c_void,
2602 lwork_bytes: *mut size_t,
2603 ) -> cusolverStatus_t;
2604}
2605unsafe extern "C" {
2606 pub fn cusolverDnDHgels_bufferSize(
2607 handle: cusolverDnHandle_t,
2608 m: cusolver_int_t,
2609 n: cusolver_int_t,
2610 nrhs: cusolver_int_t,
2611 dA: *mut f64,
2612 ldda: cusolver_int_t,
2613 dB: *mut f64,
2614 lddb: cusolver_int_t,
2615 dX: *mut f64,
2616 lddx: cusolver_int_t,
2617 dWorkspace: *mut ::core::ffi::c_void,
2618 lwork_bytes: *mut size_t,
2619 ) -> cusolverStatus_t;
2620}
2621unsafe extern "C" {
2622 pub fn cusolverDnDBgels_bufferSize(
2623 handle: cusolverDnHandle_t,
2624 m: cusolver_int_t,
2625 n: cusolver_int_t,
2626 nrhs: cusolver_int_t,
2627 dA: *mut f64,
2628 ldda: cusolver_int_t,
2629 dB: *mut f64,
2630 lddb: cusolver_int_t,
2631 dX: *mut f64,
2632 lddx: cusolver_int_t,
2633 dWorkspace: *mut ::core::ffi::c_void,
2634 lwork_bytes: *mut size_t,
2635 ) -> cusolverStatus_t;
2636}
2637unsafe extern "C" {
2638 pub fn cusolverDnDXgels_bufferSize(
2639 handle: cusolverDnHandle_t,
2640 m: cusolver_int_t,
2641 n: cusolver_int_t,
2642 nrhs: cusolver_int_t,
2643 dA: *mut f64,
2644 ldda: cusolver_int_t,
2645 dB: *mut f64,
2646 lddb: cusolver_int_t,
2647 dX: *mut f64,
2648 lddx: cusolver_int_t,
2649 dWorkspace: *mut ::core::ffi::c_void,
2650 lwork_bytes: *mut size_t,
2651 ) -> cusolverStatus_t;
2652}
2653unsafe extern "C" {
2654 pub fn cusolverDnSSgels_bufferSize(
2655 handle: cusolverDnHandle_t,
2656 m: cusolver_int_t,
2657 n: cusolver_int_t,
2658 nrhs: cusolver_int_t,
2659 dA: *mut f32,
2660 ldda: cusolver_int_t,
2661 dB: *mut f32,
2662 lddb: cusolver_int_t,
2663 dX: *mut f32,
2664 lddx: cusolver_int_t,
2665 dWorkspace: *mut ::core::ffi::c_void,
2666 lwork_bytes: *mut size_t,
2667 ) -> cusolverStatus_t;
2668}
2669unsafe extern "C" {
2670 pub fn cusolverDnSHgels_bufferSize(
2671 handle: cusolverDnHandle_t,
2672 m: cusolver_int_t,
2673 n: cusolver_int_t,
2674 nrhs: cusolver_int_t,
2675 dA: *mut f32,
2676 ldda: cusolver_int_t,
2677 dB: *mut f32,
2678 lddb: cusolver_int_t,
2679 dX: *mut f32,
2680 lddx: cusolver_int_t,
2681 dWorkspace: *mut ::core::ffi::c_void,
2682 lwork_bytes: *mut size_t,
2683 ) -> cusolverStatus_t;
2684}
2685unsafe extern "C" {
2686 pub fn cusolverDnSBgels_bufferSize(
2687 handle: cusolverDnHandle_t,
2688 m: cusolver_int_t,
2689 n: cusolver_int_t,
2690 nrhs: cusolver_int_t,
2691 dA: *mut f32,
2692 ldda: cusolver_int_t,
2693 dB: *mut f32,
2694 lddb: cusolver_int_t,
2695 dX: *mut f32,
2696 lddx: cusolver_int_t,
2697 dWorkspace: *mut ::core::ffi::c_void,
2698 lwork_bytes: *mut size_t,
2699 ) -> cusolverStatus_t;
2700}
2701unsafe extern "C" {
2702 pub fn cusolverDnSXgels_bufferSize(
2703 handle: cusolverDnHandle_t,
2704 m: cusolver_int_t,
2705 n: cusolver_int_t,
2706 nrhs: cusolver_int_t,
2707 dA: *mut f32,
2708 ldda: cusolver_int_t,
2709 dB: *mut f32,
2710 lddb: cusolver_int_t,
2711 dX: *mut f32,
2712 lddx: cusolver_int_t,
2713 dWorkspace: *mut ::core::ffi::c_void,
2714 lwork_bytes: *mut size_t,
2715 ) -> cusolverStatus_t;
2716}
2717unsafe extern "C" {
2718 /// This function is designed to perform same functionality as `cusolverDn<T1><T2>gesv()` functions, but wrapped in a more generic and expert interface that gives user more control to parametrize the function as well as it provides more information on output. [`cusolverDnIRSXgesv`] allows additional control of the solver parameters such as setting:
2719 ///
2720 /// * the main precision (Inputs/Outputs precision) of the solver
2721 /// * the lowest precision to be used internally by the solver
2722 /// * the refinement solver type
2723 /// * the maximum allowed number of iterations in the refinement phase
2724 /// * the tolerance of the refinement solver
2725 /// * the fallback to main precision
2726 /// * and more
2727 ///
2728 /// 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()`
2729 ///
2730 /// 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.
2731 ///
2732 /// 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.
2733 ///
2734 /// 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.
2735 ///
2736 /// **Supported Inputs/Outputs data type and lower precision for the IRS solver**
2737 ///
2738 /// | **Inputs/Outputs Data Type (e.g., main precision)** | **Supported values for the lowest precision** |
2739 /// | --- | --- |
2740 /// | [`cusolverPrecType_t::CUSOLVER_C_64F`] | `CUSOLVER_C_64F, CUSOLVER_C_32F, CUSOLVER_C_16F, CUSOLVER_C_16BF, CUSOLVER_C_TF32` |
2741 /// | [`cusolverPrecType_t::CUSOLVER_C_32F`] | `CUSOLVER_C_32F, CUSOLVER_C_16F, CUSOLVER_C_16BF, CUSOLVER_C_TF32` |
2742 /// | [`cusolverPrecType_t::CUSOLVER_R_64F`] | `CUSOLVER_R_64F, CUSOLVER_R_32F, CUSOLVER_R_16F, CUSOLVER_R_16BF, CUSOLVER_R_TF32` |
2743 /// | [`cusolverPrecType_t::CUSOLVER_R_32F`] | `CUSOLVER_R_32F, CUSOLVER_R_16F, CUSOLVER_R_16BF, CUSOLVER_R_TF32` |
2744 ///
2745 /// The [`cusolverDnIRSXgesv_bufferSize`] function returns the required workspace buffer size in bytes for the corresponding `cusolverDnXgesv()` call with the given `gesv_irs_params` configuration.
2746 ///
2747 /// * `n<0`
2748 /// * `lda<max(1,n)`
2749 /// * `ldb<max(1,n)`
2750 /// * `ldx<max(1,n)`.
2751 ///
2752 /// # Parameters
2753 ///
2754 /// - `handle`: Handle to the cusolverDn library context.
2755 /// - `gesv_irs_params`: Configuration parameters structure, can serve one or more calls to any IRS solver.
2756 /// - `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.
2757 /// - `n`: Number of rows and columns of square matrix `A`. Should be non-negative.
2758 /// - `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`].
2759 /// - `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.
2760 /// - `ldda`: Leading dimension of two-dimensional array used to store matrix `A`. `lda >= n`.
2761 /// - `dB`: Set of right hand sides `B` of size `n-by-nrhs`. Can’t be `NULL`.
2762 /// - `lddb`: Leading dimension of two-dimensional array used to store matrix of right hand sides `B`. `ldb >= n`.
2763 /// - `dX`: Set of solution vectors `X` of size `n-by-nrhs`. Can’t be `NULL`.
2764 /// - `lddx`: Leading dimension of two-dimensional array used to store matrix of solution vectors `X`. `ldx >= n`.
2765 /// - `dWorkspace`: Pointer to an allocated workspace in device memory of size lwork_bytes.
2766 /// - `lwork_bytes`: Size of the allocated device workspace. Should be at least what was returned by [`cusolverDnIRSXgesv_bufferSize`] function.
2767 /// - `niters`: If iter is * <0 : iterative refinement has failed, main precision (Inputs/Outputs precision) factorization has been performed if fallback is enabled. * -1 : taking into account machine parameters, n, nrhs, it is a priori not worth working in lower precision * -2 : overflow of an entry when moving from main to lower precision * -3 : failure during the factorization * -5 : overflow occurred during computation * -maxiter: solver stopped the iterative refinement after reaching maximum allowed iterations. * >0 : iter is a number of iterations solver performed to reach convergence criteria.
2768 ///
2769 /// # Return value
2770 ///
2771 /// - [`cusolverStatus_t::CUSOLVER_STATUS_ALLOC_FAILED`]: CPU memory allocation failed, most likely during the allocation of the residual array that store the residual norms.
2772 /// - [`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.
2773 /// - [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]: An internal error occurred, check the `dinfo` and the `niters` arguments for more details.
2774 /// - [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]: Invalid parameters were passed, for example:
2775 ///
2776 /// * `n<0`
2777 /// * `lda<max(1,n)`
2778 /// * `ldb<max(1,n)`
2779 /// * `ldx<max(1,n)`.
2780 /// - [`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.
2781 /// - [`cusolverStatus_t::CUSOLVER_STATUS_IRS_INFOS_NOT_INITIALIZED`]: The information structure `gesv_irs_infos` was not created.
2782 /// - [`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`].
2783 /// - [`cusolverStatus_t::CUSOLVER_STATUS_IRS_OUT_OF_RANGE`]: Numerical error related to niters <0, see niters description for more details.
2784 /// - [`cusolverStatus_t::CUSOLVER_STATUS_IRS_PARAMS_INVALID`]: One of the configuration parameter in the `gesv_irs_params` structure is not valid.
2785 /// - [`cusolverStatus_t::CUSOLVER_STATUS_IRS_PARAMS_INVALID_MAXITER`]: The maxiter configuration parameter in the `gesv_irs_params` structure is not valid.
2786 /// - [`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.
2787 /// - [`cusolverStatus_t::CUSOLVER_STATUS_IRS_PARAMS_INVALID_REFINE`]: The refinement solver configuration parameter in the `gesv_irs_params` structure is not valid.
2788 /// - [`cusolverStatus_t::CUSOLVER_STATUS_IRS_PARAMS_NOT_INITIALIZED`]: The configuration parameter `gesv_irs_params` structure was not created.
2789 /// - [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]: The library was not initialized.
2790 /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The operation completed successfully.
2791 pub fn cusolverDnIRSXgesv(
2792 handle: cusolverDnHandle_t,
2793 gesv_irs_params: cusolverDnIRSParams_t,
2794 gesv_irs_infos: cusolverDnIRSInfos_t,
2795 n: cusolver_int_t,
2796 nrhs: cusolver_int_t,
2797 dA: *mut ::core::ffi::c_void,
2798 ldda: cusolver_int_t,
2799 dB: *mut ::core::ffi::c_void,
2800 lddb: cusolver_int_t,
2801 dX: *mut ::core::ffi::c_void,
2802 lddx: cusolver_int_t,
2803 dWorkspace: *mut ::core::ffi::c_void,
2804 lwork_bytes: size_t,
2805 niters: *mut cusolver_int_t,
2806 d_info: *mut cusolver_int_t,
2807 ) -> cusolverStatus_t;
2808}
2809unsafe extern "C" {
2810 pub fn cusolverDnIRSXgesv_bufferSize(
2811 handle: cusolverDnHandle_t,
2812 params: cusolverDnIRSParams_t,
2813 n: cusolver_int_t,
2814 nrhs: cusolver_int_t,
2815 lwork_bytes: *mut size_t,
2816 ) -> cusolverStatus_t;
2817}
2818unsafe extern "C" {
2819 /// This function is designed to perform same functionality as `cusolverDn<T1><T2>gels()` functions, but wrapped in a more generic and expert interface that gives user more control to parametrize the function as well as it provides more information on output. [`cusolverDnIRSXgels`] allows additional control of the solver parameters such as setting:
2820 ///
2821 /// * the main precision (Inputs/Outputs precision) of the solver,
2822 /// * the lowest precision to be used internally by the solver,
2823 /// * the refinement solver type
2824 /// * the maximum allowed number of iterations in the refinement phase
2825 /// * the tolerance of the refinement solver
2826 /// * the fallback to main precision
2827 /// * and others
2828 ///
2829 /// 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()`.
2830 ///
2831 /// 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.
2832 ///
2833 /// 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
2834 ///
2835 /// 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.
2836 ///
2837 /// **Supported Inputs/Outputs data type and lower precision for the IRS solver**
2838 ///
2839 /// | **Inputs/Outputs Data Type (e.g., main precision)** | **Supported values for the lowest precision** |
2840 /// | --- | --- |
2841 /// | [`cusolverPrecType_t::CUSOLVER_C_64F`] | `CUSOLVER_C_64F, CUSOLVER_C_32F, CUSOLVER_C_16F, CUSOLVER_C_16BF, CUSOLVER_C_TF32` |
2842 /// | [`cusolverPrecType_t::CUSOLVER_C_32F`] | `CUSOLVER_C_32F, CUSOLVER_C_16F, CUSOLVER_C_16BF, CUSOLVER_C_TF32` |
2843 /// | [`cusolverPrecType_t::CUSOLVER_R_64F`] | `CUSOLVER_R_64F, CUSOLVER_R_32F, CUSOLVER_R_16F, CUSOLVER_R_16BF, CUSOLVER_R_TF32` |
2844 /// | [`cusolverPrecType_t::CUSOLVER_R_32F`] | `CUSOLVER_R_32F, CUSOLVER_R_16F, CUSOLVER_R_16BF, CUSOLVER_R_TF32` |
2845 ///
2846 /// The [`cusolverDnIRSXgels_bufferSize`] function return the required workspace buffer size in bytes for the corresponding `cusolverDnXgels()` call with given `gels_irs_params` configuration.
2847 ///
2848 /// * `n<0`
2849 /// * `ldda<max(1,m)`
2850 /// * `lddb<max(1,m)`
2851 /// * `lddx<max(1,n)`.
2852 ///
2853 /// # Parameters
2854 ///
2855 /// - `handle`: Handle to the cusolverDn library context.
2856 /// - `gels_irs_params`: Configuration parameters structure, can serve one or more calls to any IRS solver.
2857 /// - `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.
2858 /// - `m`: Number of rows of the matrix `A`. Should be non-negative and n<=m.
2859 /// - `n`: Number of columns of the matrix `A`. Should be non-negative and n<=m.
2860 /// - `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`].
2861 /// - `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.
2862 /// - `ldda`: Leading dimension of two-dimensional array used to store matrix `A`. `ldda >= m`.
2863 /// - `dB`: Set of right hand sides `B` of size `m-by-nrhs`. Can’t be `NULL`.
2864 /// - `lddb`: Leading dimension of two-dimensional array used to store matrix of right hand sides `B`. `lddb >= max(1,m)`.
2865 /// - `dX`: Set of solution vectors `X` of size `n-by-nrhs`. Can’t be `NULL`.
2866 /// - `lddx`: Leading dimension of two-dimensional array used to store matrix of solution vectors `X`. `lddx >= max(1,n)`.
2867 /// - `dWorkspace`: Pointer to an allocated workspace in device memory of size lwork_bytes.
2868 /// - `lwork_bytes`: Size of the allocated device workspace. Should be at least what was returned by [`cusolverDnIRSXgels_bufferSize`] function.
2869 /// - `niters`: If `iter` is * <0 : iterative refinement has failed, main precision (Inputs/Outputs precision) factorization has been performed if fallback is enabled * -1 : taking into account machine parameters, n, nrhs, it is a priori not worth working in lower precision * -2 : overflow of an entry when moving from main to lower precision * -3 : failure during the factorization * -5 : overflow occurred during computation * `-maxiter`: solver stopped the iterative refinement after reaching maximum allowed iterations * >0 : iter is a number of iterations solver performed to reach convergence criteria.
2870 ///
2871 /// # Return value
2872 ///
2873 /// - [`cusolverStatus_t::CUSOLVER_STATUS_ALLOC_FAILED`]: CPU memory allocation failed, most likely during the allocation of the residual array that store the residual norms.
2874 /// - [`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.
2875 /// - [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]: An internal error occurred, check the `dinfo` and the `niters` arguments for more details.
2876 /// - [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]: Invalid parameters were passed, for example:
2877 ///
2878 /// * `n<0`
2879 /// * `ldda<max(1,m)`
2880 /// * `lddb<max(1,m)`
2881 /// * `lddx<max(1,n)`.
2882 /// - [`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.
2883 /// - [`cusolverStatus_t::CUSOLVER_STATUS_IRS_INFOS_NOT_INITIALIZED`]: The information structure `gels_irs_infos` was not created.
2884 /// - [`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`].
2885 /// - [`cusolverStatus_t::CUSOLVER_STATUS_IRS_OUT_OF_RANGE`]: Numerical error related to `niters` <0; see `niters` description for more details.
2886 /// - [`cusolverStatus_t::CUSOLVER_STATUS_IRS_PARAMS_INVALID`]: One of the configuration parameter in the `gels_irs_params` structure is not valid.
2887 /// - [`cusolverStatus_t::CUSOLVER_STATUS_IRS_PARAMS_INVALID_MAXITER`]: The maxiter configuration parameter in the `gels_irs_params` structure is not valid.
2888 /// - [`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.
2889 /// - [`cusolverStatus_t::CUSOLVER_STATUS_IRS_PARAMS_INVALID_REFINE`]: The refinement solver configuration parameter in the `gels_irs_params` structure is not valid.
2890 /// - [`cusolverStatus_t::CUSOLVER_STATUS_IRS_PARAMS_NOT_INITIALIZED`]: The configuration parameter `gels_irs_params` structure was not created.
2891 /// - [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]: The library was not initialized.
2892 /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The operation completed successfully.
2893 pub fn cusolverDnIRSXgels(
2894 handle: cusolverDnHandle_t,
2895 gels_irs_params: cusolverDnIRSParams_t,
2896 gels_irs_infos: cusolverDnIRSInfos_t,
2897 m: cusolver_int_t,
2898 n: cusolver_int_t,
2899 nrhs: cusolver_int_t,
2900 dA: *mut ::core::ffi::c_void,
2901 ldda: cusolver_int_t,
2902 dB: *mut ::core::ffi::c_void,
2903 lddb: cusolver_int_t,
2904 dX: *mut ::core::ffi::c_void,
2905 lddx: cusolver_int_t,
2906 dWorkspace: *mut ::core::ffi::c_void,
2907 lwork_bytes: size_t,
2908 niters: *mut cusolver_int_t,
2909 d_info: *mut cusolver_int_t,
2910 ) -> cusolverStatus_t;
2911}
2912unsafe extern "C" {
2913 pub fn cusolverDnIRSXgels_bufferSize(
2914 handle: cusolverDnHandle_t,
2915 params: cusolverDnIRSParams_t,
2916 m: cusolver_int_t,
2917 n: cusolver_int_t,
2918 nrhs: cusolver_int_t,
2919 lwork_bytes: *mut size_t,
2920 ) -> cusolverStatus_t;
2921}
2922unsafe extern "C" {
2923 pub fn cusolverDnSpotrf_bufferSize(
2924 handle: cusolverDnHandle_t,
2925 uplo: cublasFillMode_t,
2926 n: ::core::ffi::c_int,
2927 A: *mut f32,
2928 lda: ::core::ffi::c_int,
2929 Lwork: *mut ::core::ffi::c_int,
2930 ) -> cusolverStatus_t;
2931}
2932unsafe extern "C" {
2933 pub fn cusolverDnDpotrf_bufferSize(
2934 handle: cusolverDnHandle_t,
2935 uplo: cublasFillMode_t,
2936 n: ::core::ffi::c_int,
2937 A: *mut f64,
2938 lda: ::core::ffi::c_int,
2939 Lwork: *mut ::core::ffi::c_int,
2940 ) -> cusolverStatus_t;
2941}
2942unsafe extern "C" {
2943 pub fn cusolverDnCpotrf_bufferSize(
2944 handle: cusolverDnHandle_t,
2945 uplo: cublasFillMode_t,
2946 n: ::core::ffi::c_int,
2947 A: *mut cuComplex,
2948 lda: ::core::ffi::c_int,
2949 Lwork: *mut ::core::ffi::c_int,
2950 ) -> cusolverStatus_t;
2951}
2952unsafe extern "C" {
2953 pub fn cusolverDnZpotrf_bufferSize(
2954 handle: cusolverDnHandle_t,
2955 uplo: cublasFillMode_t,
2956 n: ::core::ffi::c_int,
2957 A: *mut cuDoubleComplex,
2958 lda: ::core::ffi::c_int,
2959 Lwork: *mut ::core::ffi::c_int,
2960 ) -> cusolverStatus_t;
2961}
2962unsafe extern "C" {
2963 /// These helper functions calculate the necessary size of work buffers.
2964 ///
2965 /// The S and D data types are real valued single and double precision, respectively.
2966 ///
2967 /// The C and Z data types are complex valued single and double precision, respectively.
2968 ///
2969 /// This function computes the Cholesky factorization of a Hermitian positive-definite matrix.
2970 ///
2971 /// `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.
2972 ///
2973 /// 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`.
2974 /// $$
2975 /// A = L\\*L^{H}
2976 /// $$
2977 ///
2978 /// 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`.
2979 /// $$
2980 /// A = U^{H}\\*U
2981 /// $$
2982 ///
2983 /// 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()`.
2984 ///
2985 /// 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.
2986 ///
2987 /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
2988 pub fn cusolverDnSpotrf(
2989 handle: cusolverDnHandle_t,
2990 uplo: cublasFillMode_t,
2991 n: ::core::ffi::c_int,
2992 A: *mut f32,
2993 lda: ::core::ffi::c_int,
2994 Workspace: *mut f32,
2995 Lwork: ::core::ffi::c_int,
2996 devInfo: *mut ::core::ffi::c_int,
2997 ) -> cusolverStatus_t;
2998}
2999unsafe extern "C" {
3000 /// These helper functions calculate the necessary size of work buffers.
3001 ///
3002 /// The S and D data types are real valued single and double precision, respectively.
3003 ///
3004 /// The C and Z data types are complex valued single and double precision, respectively.
3005 ///
3006 /// This function computes the Cholesky factorization of a Hermitian positive-definite matrix.
3007 ///
3008 /// `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.
3009 ///
3010 /// 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`.
3011 /// $$
3012 /// A = L\\*L^{H}
3013 /// $$
3014 ///
3015 /// 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`.
3016 /// $$
3017 /// A = U^{H}\\*U
3018 /// $$
3019 ///
3020 /// 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()`.
3021 ///
3022 /// 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.
3023 ///
3024 /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
3025 pub fn cusolverDnDpotrf(
3026 handle: cusolverDnHandle_t,
3027 uplo: cublasFillMode_t,
3028 n: ::core::ffi::c_int,
3029 A: *mut f64,
3030 lda: ::core::ffi::c_int,
3031 Workspace: *mut f64,
3032 Lwork: ::core::ffi::c_int,
3033 devInfo: *mut ::core::ffi::c_int,
3034 ) -> cusolverStatus_t;
3035}
3036unsafe extern "C" {
3037 /// These helper functions calculate the necessary size of work buffers.
3038 ///
3039 /// The S and D data types are real valued single and double precision, respectively.
3040 ///
3041 /// The C and Z data types are complex valued single and double precision, respectively.
3042 ///
3043 /// This function computes the Cholesky factorization of a Hermitian positive-definite matrix.
3044 ///
3045 /// `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.
3046 ///
3047 /// 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`.
3048 /// $$
3049 /// A = L\\*L^{H}
3050 /// $$
3051 ///
3052 /// 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`.
3053 /// $$
3054 /// A = U^{H}\\*U
3055 /// $$
3056 ///
3057 /// 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()`.
3058 ///
3059 /// 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.
3060 ///
3061 /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
3062 pub fn cusolverDnCpotrf(
3063 handle: cusolverDnHandle_t,
3064 uplo: cublasFillMode_t,
3065 n: ::core::ffi::c_int,
3066 A: *mut cuComplex,
3067 lda: ::core::ffi::c_int,
3068 Workspace: *mut cuComplex,
3069 Lwork: ::core::ffi::c_int,
3070 devInfo: *mut ::core::ffi::c_int,
3071 ) -> cusolverStatus_t;
3072}
3073unsafe extern "C" {
3074 /// These helper functions calculate the necessary size of work buffers.
3075 ///
3076 /// The S and D data types are real valued single and double precision, respectively.
3077 ///
3078 /// The C and Z data types are complex valued single and double precision, respectively.
3079 ///
3080 /// This function computes the Cholesky factorization of a Hermitian positive-definite matrix.
3081 ///
3082 /// `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.
3083 ///
3084 /// 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`.
3085 /// $$
3086 /// A = L\\*L^{H}
3087 /// $$
3088 ///
3089 /// 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`.
3090 /// $$
3091 /// A = U^{H}\\*U
3092 /// $$
3093 ///
3094 /// 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()`.
3095 ///
3096 /// 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.
3097 ///
3098 /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
3099 pub fn cusolverDnZpotrf(
3100 handle: cusolverDnHandle_t,
3101 uplo: cublasFillMode_t,
3102 n: ::core::ffi::c_int,
3103 A: *mut cuDoubleComplex,
3104 lda: ::core::ffi::c_int,
3105 Workspace: *mut cuDoubleComplex,
3106 Lwork: ::core::ffi::c_int,
3107 devInfo: *mut ::core::ffi::c_int,
3108 ) -> cusolverStatus_t;
3109}
3110unsafe extern "C" {
3111 /// This function solves a system of linear equations:
3112 /// $$
3113 /// A\\*X = B
3114 /// $$
3115 ///
3116 /// 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.
3117 ///
3118 /// 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$.
3119 ///
3120 /// The operation is in-place, i.e. matrix `X` overwrites matrix `B` with the same leading dimension `ldb`.
3121 ///
3122 /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
3123 pub fn cusolverDnSpotrs(
3124 handle: cusolverDnHandle_t,
3125 uplo: cublasFillMode_t,
3126 n: ::core::ffi::c_int,
3127 nrhs: ::core::ffi::c_int,
3128 A: *const f32,
3129 lda: ::core::ffi::c_int,
3130 B: *mut f32,
3131 ldb: ::core::ffi::c_int,
3132 devInfo: *mut ::core::ffi::c_int,
3133 ) -> cusolverStatus_t;
3134}
3135unsafe extern "C" {
3136 /// This function solves a system of linear equations:
3137 /// $$
3138 /// A\\*X = B
3139 /// $$
3140 ///
3141 /// 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.
3142 ///
3143 /// 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$.
3144 ///
3145 /// The operation is in-place, i.e. matrix `X` overwrites matrix `B` with the same leading dimension `ldb`.
3146 ///
3147 /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
3148 pub fn cusolverDnDpotrs(
3149 handle: cusolverDnHandle_t,
3150 uplo: cublasFillMode_t,
3151 n: ::core::ffi::c_int,
3152 nrhs: ::core::ffi::c_int,
3153 A: *const f64,
3154 lda: ::core::ffi::c_int,
3155 B: *mut f64,
3156 ldb: ::core::ffi::c_int,
3157 devInfo: *mut ::core::ffi::c_int,
3158 ) -> cusolverStatus_t;
3159}
3160unsafe extern "C" {
3161 /// This function solves a system of linear equations:
3162 /// $$
3163 /// A\\*X = B
3164 /// $$
3165 ///
3166 /// 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.
3167 ///
3168 /// 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$.
3169 ///
3170 /// The operation is in-place, i.e. matrix `X` overwrites matrix `B` with the same leading dimension `ldb`.
3171 ///
3172 /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
3173 pub fn cusolverDnCpotrs(
3174 handle: cusolverDnHandle_t,
3175 uplo: cublasFillMode_t,
3176 n: ::core::ffi::c_int,
3177 nrhs: ::core::ffi::c_int,
3178 A: *const cuComplex,
3179 lda: ::core::ffi::c_int,
3180 B: *mut cuComplex,
3181 ldb: ::core::ffi::c_int,
3182 devInfo: *mut ::core::ffi::c_int,
3183 ) -> cusolverStatus_t;
3184}
3185unsafe extern "C" {
3186 /// This function solves a system of linear equations:
3187 /// $$
3188 /// A\\*X = B
3189 /// $$
3190 ///
3191 /// 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.
3192 ///
3193 /// 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$.
3194 ///
3195 /// The operation is in-place, i.e. matrix `X` overwrites matrix `B` with the same leading dimension `ldb`.
3196 ///
3197 /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
3198 pub fn cusolverDnZpotrs(
3199 handle: cusolverDnHandle_t,
3200 uplo: cublasFillMode_t,
3201 n: ::core::ffi::c_int,
3202 nrhs: ::core::ffi::c_int,
3203 A: *const cuDoubleComplex,
3204 lda: ::core::ffi::c_int,
3205 B: *mut cuDoubleComplex,
3206 ldb: ::core::ffi::c_int,
3207 devInfo: *mut ::core::ffi::c_int,
3208 ) -> cusolverStatus_t;
3209}
3210unsafe extern "C" {
3211 /// 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.
3212 ///
3213 /// The C and Z data types are complex valued single and double precision, respectively.
3214 ///
3215 /// This function computes the Cholesky factorization of a sequence of Hermitian positive-definite matrices.
3216 ///
3217 /// 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.
3218 ///
3219 /// 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`.
3220 /// $$
3221 /// A = L\\*L^{H}
3222 /// $$
3223 ///
3224 /// 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`.
3225 /// $$
3226 /// A = U^{H}\\*U
3227 /// $$
3228 ///
3229 /// 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.
3230 ///
3231 /// `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`.
3232 ///
3233 /// 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`.
3234 pub fn cusolverDnSpotrfBatched(
3235 handle: cusolverDnHandle_t,
3236 uplo: cublasFillMode_t,
3237 n: ::core::ffi::c_int,
3238 Aarray: *mut *mut f32,
3239 lda: ::core::ffi::c_int,
3240 infoArray: *mut ::core::ffi::c_int,
3241 batchSize: ::core::ffi::c_int,
3242 ) -> cusolverStatus_t;
3243}
3244unsafe extern "C" {
3245 /// 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.
3246 ///
3247 /// The C and Z data types are complex valued single and double precision, respectively.
3248 ///
3249 /// This function computes the Cholesky factorization of a sequence of Hermitian positive-definite matrices.
3250 ///
3251 /// 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.
3252 ///
3253 /// 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`.
3254 /// $$
3255 /// A = L\\*L^{H}
3256 /// $$
3257 ///
3258 /// 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`.
3259 /// $$
3260 /// A = U^{H}\\*U
3261 /// $$
3262 ///
3263 /// 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.
3264 ///
3265 /// `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`.
3266 ///
3267 /// 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`.
3268 pub fn cusolverDnDpotrfBatched(
3269 handle: cusolverDnHandle_t,
3270 uplo: cublasFillMode_t,
3271 n: ::core::ffi::c_int,
3272 Aarray: *mut *mut f64,
3273 lda: ::core::ffi::c_int,
3274 infoArray: *mut ::core::ffi::c_int,
3275 batchSize: ::core::ffi::c_int,
3276 ) -> cusolverStatus_t;
3277}
3278unsafe extern "C" {
3279 /// 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.
3280 ///
3281 /// The C and Z data types are complex valued single and double precision, respectively.
3282 ///
3283 /// This function computes the Cholesky factorization of a sequence of Hermitian positive-definite matrices.
3284 ///
3285 /// 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.
3286 ///
3287 /// 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`.
3288 /// $$
3289 /// A = L\\*L^{H}
3290 /// $$
3291 ///
3292 /// 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`.
3293 /// $$
3294 /// A = U^{H}\\*U
3295 /// $$
3296 ///
3297 /// 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.
3298 ///
3299 /// `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`.
3300 ///
3301 /// 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`.
3302 pub fn cusolverDnCpotrfBatched(
3303 handle: cusolverDnHandle_t,
3304 uplo: cublasFillMode_t,
3305 n: ::core::ffi::c_int,
3306 Aarray: *mut *mut cuComplex,
3307 lda: ::core::ffi::c_int,
3308 infoArray: *mut ::core::ffi::c_int,
3309 batchSize: ::core::ffi::c_int,
3310 ) -> cusolverStatus_t;
3311}
3312unsafe extern "C" {
3313 /// 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.
3314 ///
3315 /// The C and Z data types are complex valued single and double precision, respectively.
3316 ///
3317 /// This function computes the Cholesky factorization of a sequence of Hermitian positive-definite matrices.
3318 ///
3319 /// 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.
3320 ///
3321 /// 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`.
3322 /// $$
3323 /// A = L\\*L^{H}
3324 /// $$
3325 ///
3326 /// 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`.
3327 /// $$
3328 /// A = U^{H}\\*U
3329 /// $$
3330 ///
3331 /// 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.
3332 ///
3333 /// `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`.
3334 ///
3335 /// 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`.
3336 pub fn cusolverDnZpotrfBatched(
3337 handle: cusolverDnHandle_t,
3338 uplo: cublasFillMode_t,
3339 n: ::core::ffi::c_int,
3340 Aarray: *mut *mut cuDoubleComplex,
3341 lda: ::core::ffi::c_int,
3342 infoArray: *mut ::core::ffi::c_int,
3343 batchSize: ::core::ffi::c_int,
3344 ) -> cusolverStatus_t;
3345}
3346unsafe extern "C" {
3347 /// This function solves a sequence of linear systems:
3348 /// $$
3349 /// {A\lbrack i\rbrack}\\*{X\lbrack i\rbrack} = {B\lbrack i\rbrack}
3350 /// $$
3351 ///
3352 /// 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.
3353 ///
3354 /// 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$.
3355 ///
3356 /// The operation is in-place, i.e. matrix `X` overwrites matrix `B` with the same leading dimension `ldb`.
3357 ///
3358 /// The output parameter `info` is a scalar. If `info = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
3359 ///
3360 /// Remark 1: only `nrhs=1` is supported.
3361 ///
3362 /// 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).
3363 ///
3364 /// 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`.
3365 ///
3366 /// Please visit [cuSOLVER Library Samples - potrfBatched](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/potrfBatched) for a code example.
3367 pub fn cusolverDnSpotrsBatched(
3368 handle: cusolverDnHandle_t,
3369 uplo: cublasFillMode_t,
3370 n: ::core::ffi::c_int,
3371 nrhs: ::core::ffi::c_int,
3372 A: *mut *mut f32,
3373 lda: ::core::ffi::c_int,
3374 B: *mut *mut f32,
3375 ldb: ::core::ffi::c_int,
3376 d_info: *mut ::core::ffi::c_int,
3377 batchSize: ::core::ffi::c_int,
3378 ) -> cusolverStatus_t;
3379}
3380unsafe extern "C" {
3381 /// This function solves a sequence of linear systems:
3382 /// $$
3383 /// {A\lbrack i\rbrack}\\*{X\lbrack i\rbrack} = {B\lbrack i\rbrack}
3384 /// $$
3385 ///
3386 /// 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.
3387 ///
3388 /// 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$.
3389 ///
3390 /// The operation is in-place, i.e. matrix `X` overwrites matrix `B` with the same leading dimension `ldb`.
3391 ///
3392 /// The output parameter `info` is a scalar. If `info = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
3393 ///
3394 /// Remark 1: only `nrhs=1` is supported.
3395 ///
3396 /// 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).
3397 ///
3398 /// 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`.
3399 ///
3400 /// Please visit [cuSOLVER Library Samples - potrfBatched](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/potrfBatched) for a code example.
3401 pub fn cusolverDnDpotrsBatched(
3402 handle: cusolverDnHandle_t,
3403 uplo: cublasFillMode_t,
3404 n: ::core::ffi::c_int,
3405 nrhs: ::core::ffi::c_int,
3406 A: *mut *mut f64,
3407 lda: ::core::ffi::c_int,
3408 B: *mut *mut f64,
3409 ldb: ::core::ffi::c_int,
3410 d_info: *mut ::core::ffi::c_int,
3411 batchSize: ::core::ffi::c_int,
3412 ) -> cusolverStatus_t;
3413}
3414unsafe extern "C" {
3415 /// This function solves a sequence of linear systems:
3416 /// $$
3417 /// {A\lbrack i\rbrack}\\*{X\lbrack i\rbrack} = {B\lbrack i\rbrack}
3418 /// $$
3419 ///
3420 /// 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.
3421 ///
3422 /// 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$.
3423 ///
3424 /// The operation is in-place, i.e. matrix `X` overwrites matrix `B` with the same leading dimension `ldb`.
3425 ///
3426 /// The output parameter `info` is a scalar. If `info = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
3427 ///
3428 /// Remark 1: only `nrhs=1` is supported.
3429 ///
3430 /// 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).
3431 ///
3432 /// 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`.
3433 ///
3434 /// Please visit [cuSOLVER Library Samples - potrfBatched](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/potrfBatched) for a code example.
3435 pub fn cusolverDnCpotrsBatched(
3436 handle: cusolverDnHandle_t,
3437 uplo: cublasFillMode_t,
3438 n: ::core::ffi::c_int,
3439 nrhs: ::core::ffi::c_int,
3440 A: *mut *mut cuComplex,
3441 lda: ::core::ffi::c_int,
3442 B: *mut *mut cuComplex,
3443 ldb: ::core::ffi::c_int,
3444 d_info: *mut ::core::ffi::c_int,
3445 batchSize: ::core::ffi::c_int,
3446 ) -> cusolverStatus_t;
3447}
3448unsafe extern "C" {
3449 /// This function solves a sequence of linear systems:
3450 /// $$
3451 /// {A\lbrack i\rbrack}\\*{X\lbrack i\rbrack} = {B\lbrack i\rbrack}
3452 /// $$
3453 ///
3454 /// 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.
3455 ///
3456 /// 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$.
3457 ///
3458 /// The operation is in-place, i.e. matrix `X` overwrites matrix `B` with the same leading dimension `ldb`.
3459 ///
3460 /// The output parameter `info` is a scalar. If `info = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
3461 ///
3462 /// Remark 1: only `nrhs=1` is supported.
3463 ///
3464 /// 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).
3465 ///
3466 /// 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`.
3467 ///
3468 /// Please visit [cuSOLVER Library Samples - potrfBatched](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/potrfBatched) for a code example.
3469 pub fn cusolverDnZpotrsBatched(
3470 handle: cusolverDnHandle_t,
3471 uplo: cublasFillMode_t,
3472 n: ::core::ffi::c_int,
3473 nrhs: ::core::ffi::c_int,
3474 A: *mut *mut cuDoubleComplex,
3475 lda: ::core::ffi::c_int,
3476 B: *mut *mut cuDoubleComplex,
3477 ldb: ::core::ffi::c_int,
3478 d_info: *mut ::core::ffi::c_int,
3479 batchSize: ::core::ffi::c_int,
3480 ) -> cusolverStatus_t;
3481}
3482unsafe extern "C" {
3483 pub fn cusolverDnSpotri_bufferSize(
3484 handle: cusolverDnHandle_t,
3485 uplo: cublasFillMode_t,
3486 n: ::core::ffi::c_int,
3487 A: *mut f32,
3488 lda: ::core::ffi::c_int,
3489 lwork: *mut ::core::ffi::c_int,
3490 ) -> cusolverStatus_t;
3491}
3492unsafe extern "C" {
3493 pub fn cusolverDnDpotri_bufferSize(
3494 handle: cusolverDnHandle_t,
3495 uplo: cublasFillMode_t,
3496 n: ::core::ffi::c_int,
3497 A: *mut f64,
3498 lda: ::core::ffi::c_int,
3499 lwork: *mut ::core::ffi::c_int,
3500 ) -> cusolverStatus_t;
3501}
3502unsafe extern "C" {
3503 pub fn cusolverDnCpotri_bufferSize(
3504 handle: cusolverDnHandle_t,
3505 uplo: cublasFillMode_t,
3506 n: ::core::ffi::c_int,
3507 A: *mut cuComplex,
3508 lda: ::core::ffi::c_int,
3509 lwork: *mut ::core::ffi::c_int,
3510 ) -> cusolverStatus_t;
3511}
3512unsafe extern "C" {
3513 pub fn cusolverDnZpotri_bufferSize(
3514 handle: cusolverDnHandle_t,
3515 uplo: cublasFillMode_t,
3516 n: ::core::ffi::c_int,
3517 A: *mut cuDoubleComplex,
3518 lda: ::core::ffi::c_int,
3519 lwork: *mut ::core::ffi::c_int,
3520 ) -> cusolverStatus_t;
3521}
3522unsafe extern "C" {
3523 /// These helper functions calculate the necessary size of work buffers.
3524 ///
3525 /// The S and D data types are real valued single and double precision, respectively.
3526 ///
3527 /// The C and Z data types are complex valued single and double precision, respectively.
3528 ///
3529 /// This function computes the inverse of a positive-definite matrix `A` using the Cholesky factorization:
3530 /// $$
3531 /// A = L\\*L^H = U^{H}\\*U
3532 /// $$
3533 ///
3534 /// computed by `potrf()`.
3535 ///
3536 /// `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.
3537 ///
3538 /// 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`.
3539 ///
3540 /// 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`.
3541 ///
3542 /// 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()`.
3543 ///
3544 /// 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.
3545 ///
3546 /// If the output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting the handle).
3547 pub fn cusolverDnSpotri(
3548 handle: cusolverDnHandle_t,
3549 uplo: cublasFillMode_t,
3550 n: ::core::ffi::c_int,
3551 A: *mut f32,
3552 lda: ::core::ffi::c_int,
3553 work: *mut f32,
3554 lwork: ::core::ffi::c_int,
3555 devInfo: *mut ::core::ffi::c_int,
3556 ) -> cusolverStatus_t;
3557}
3558unsafe extern "C" {
3559 /// These helper functions calculate the necessary size of work buffers.
3560 ///
3561 /// The S and D data types are real valued single and double precision, respectively.
3562 ///
3563 /// The C and Z data types are complex valued single and double precision, respectively.
3564 ///
3565 /// This function computes the inverse of a positive-definite matrix `A` using the Cholesky factorization:
3566 /// $$
3567 /// A = L\\*L^H = U^{H}\\*U
3568 /// $$
3569 ///
3570 /// computed by `potrf()`.
3571 ///
3572 /// `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.
3573 ///
3574 /// 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`.
3575 ///
3576 /// 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`.
3577 ///
3578 /// 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()`.
3579 ///
3580 /// 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.
3581 ///
3582 /// If the output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting the handle).
3583 pub fn cusolverDnDpotri(
3584 handle: cusolverDnHandle_t,
3585 uplo: cublasFillMode_t,
3586 n: ::core::ffi::c_int,
3587 A: *mut f64,
3588 lda: ::core::ffi::c_int,
3589 work: *mut f64,
3590 lwork: ::core::ffi::c_int,
3591 devInfo: *mut ::core::ffi::c_int,
3592 ) -> cusolverStatus_t;
3593}
3594unsafe extern "C" {
3595 /// These helper functions calculate the necessary size of work buffers.
3596 ///
3597 /// The S and D data types are real valued single and double precision, respectively.
3598 ///
3599 /// The C and Z data types are complex valued single and double precision, respectively.
3600 ///
3601 /// This function computes the inverse of a positive-definite matrix `A` using the Cholesky factorization:
3602 /// $$
3603 /// A = L\\*L^H = U^{H}\\*U
3604 /// $$
3605 ///
3606 /// computed by `potrf()`.
3607 ///
3608 /// `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.
3609 ///
3610 /// 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`.
3611 ///
3612 /// 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`.
3613 ///
3614 /// 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()`.
3615 ///
3616 /// 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.
3617 ///
3618 /// If the output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting the handle).
3619 pub fn cusolverDnCpotri(
3620 handle: cusolverDnHandle_t,
3621 uplo: cublasFillMode_t,
3622 n: ::core::ffi::c_int,
3623 A: *mut cuComplex,
3624 lda: ::core::ffi::c_int,
3625 work: *mut cuComplex,
3626 lwork: ::core::ffi::c_int,
3627 devInfo: *mut ::core::ffi::c_int,
3628 ) -> cusolverStatus_t;
3629}
3630unsafe extern "C" {
3631 /// These helper functions calculate the necessary size of work buffers.
3632 ///
3633 /// The S and D data types are real valued single and double precision, respectively.
3634 ///
3635 /// The C and Z data types are complex valued single and double precision, respectively.
3636 ///
3637 /// This function computes the inverse of a positive-definite matrix `A` using the Cholesky factorization:
3638 /// $$
3639 /// A = L\\*L^H = U^{H}\\*U
3640 /// $$
3641 ///
3642 /// computed by `potrf()`.
3643 ///
3644 /// `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.
3645 ///
3646 /// 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`.
3647 ///
3648 /// 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`.
3649 ///
3650 /// 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()`.
3651 ///
3652 /// 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.
3653 ///
3654 /// If the output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting the handle).
3655 pub fn cusolverDnZpotri(
3656 handle: cusolverDnHandle_t,
3657 uplo: cublasFillMode_t,
3658 n: ::core::ffi::c_int,
3659 A: *mut cuDoubleComplex,
3660 lda: ::core::ffi::c_int,
3661 work: *mut cuDoubleComplex,
3662 lwork: ::core::ffi::c_int,
3663 devInfo: *mut ::core::ffi::c_int,
3664 ) -> cusolverStatus_t;
3665}
3666unsafe extern "C" {
3667 pub fn cusolverDnXtrtri_bufferSize(
3668 handle: cusolverDnHandle_t,
3669 uplo: cublasFillMode_t,
3670 diag: cublasDiagType_t,
3671 n: i64,
3672 dataTypeA: cudaDataType,
3673 A: *mut ::core::ffi::c_void,
3674 lda: i64,
3675 workspaceInBytesOnDevice: *mut size_t,
3676 workspaceInBytesOnHost: *mut size_t,
3677 ) -> cusolverStatus_t;
3678}
3679unsafe extern "C" {
3680 /// The helper functions below can calculate the sizes needed for pre-allocated buffers.
3681 ///
3682 /// The following routine:
3683 ///
3684 /// computes the inverse of a triangular matrix using the generic API interface.
3685 ///
3686 /// `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.
3687 ///
3688 /// 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.
3689 ///
3690 /// 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.
3691 ///
3692 /// 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`].
3693 ///
3694 /// If matrix inversion fails, the output parameter `info = i` shows `A(i,i) = 0`.
3695 ///
3696 /// If output parameter `info = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
3697 ///
3698 /// Please visit [cuSOLVER Library Samples - Xtrtri](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/Xtrtri) for a code example.
3699 ///
3700 /// List of input arguments for [`cusolverDnXtrtri_bufferSize`] and [`cusolverDnXtrtri`]:
3701 ///
3702 /// **Valid data types**
3703 ///
3704 /// | | |
3705 /// | --- | --- |
3706 /// | `DataTypeA` | `Meaning` |
3707 /// | `CUDA_R_32F` | `STRTRI` |
3708 /// | `CUDA_R_64F` | `DTRTRI` |
3709 /// | `CUDA_C_32F` | `CTRTRI` |
3710 /// | `CUDA_C_64F` | `ZTRTRI` |
3711 ///
3712 /// # Parameters
3713 ///
3714 /// - `handle`: Handle to the cuSolverDN library context.
3715 /// - `uplo`: Indicates if matrix `A` lower or upper part is stored, the other part is not referenced.
3716 /// - `diag`: The enumerated unit diagonal type.
3717 /// - `n`: Number of rows and columns of matrix `A`.
3718 /// - `dataTypeA`: Data type of array `A`.
3719 /// - `A`: Array of dimension `lda * n` with `lda` is not less than `max(1,n)`.
3720 /// - `lda`: Leading dimension of two-dimensional array used to store matrix `A`.
3721 /// - `bufferOnDevice`: Device workspace. Array of type `void` of size `workspaceInBytesOnDevice` bytes.
3722 /// - `workspaceInBytesOnDevice`: Size in bytes of `bufferOnDevice`, returned by [`cusolverDnXtrtri_bufferSize`].
3723 /// - `bufferOnHost`: Host workspace. Array of type `void` of size `workspaceInBytesOnHost` bytes.
3724 /// - `workspaceInBytesOnHost`: Size in bytes of `bufferOnHost`, returned by [`cusolverDnXtrtri_bufferSize`].
3725 ///
3726 /// # Return value
3727 ///
3728 /// - [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]: An internal operation failed.
3729 /// - [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]: Invalid parameters were passed (`n<0` or `lda<max(1,n)`).
3730 /// - [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]: The library was not initialized.
3731 /// - [`cusolverStatus_t::CUSOLVER_STATUS_NOT_SUPPORTED`]: Data type is not supported.
3732 /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The operation completed successfully.
3733 pub fn cusolverDnXtrtri(
3734 handle: cusolverDnHandle_t,
3735 uplo: cublasFillMode_t,
3736 diag: cublasDiagType_t,
3737 n: i64,
3738 dataTypeA: cudaDataType,
3739 A: *mut ::core::ffi::c_void,
3740 lda: i64,
3741 bufferOnDevice: *mut ::core::ffi::c_void,
3742 workspaceInBytesOnDevice: size_t,
3743 bufferOnHost: *mut ::core::ffi::c_void,
3744 workspaceInBytesOnHost: size_t,
3745 devInfo: *mut ::core::ffi::c_int,
3746 ) -> cusolverStatus_t;
3747}
3748unsafe extern "C" {
3749 pub fn cusolverDnSlauum_bufferSize(
3750 handle: cusolverDnHandle_t,
3751 uplo: cublasFillMode_t,
3752 n: ::core::ffi::c_int,
3753 A: *mut f32,
3754 lda: ::core::ffi::c_int,
3755 lwork: *mut ::core::ffi::c_int,
3756 ) -> cusolverStatus_t;
3757}
3758unsafe extern "C" {
3759 pub fn cusolverDnDlauum_bufferSize(
3760 handle: cusolverDnHandle_t,
3761 uplo: cublasFillMode_t,
3762 n: ::core::ffi::c_int,
3763 A: *mut f64,
3764 lda: ::core::ffi::c_int,
3765 lwork: *mut ::core::ffi::c_int,
3766 ) -> cusolverStatus_t;
3767}
3768unsafe extern "C" {
3769 pub fn cusolverDnClauum_bufferSize(
3770 handle: cusolverDnHandle_t,
3771 uplo: cublasFillMode_t,
3772 n: ::core::ffi::c_int,
3773 A: *mut cuComplex,
3774 lda: ::core::ffi::c_int,
3775 lwork: *mut ::core::ffi::c_int,
3776 ) -> cusolverStatus_t;
3777}
3778unsafe extern "C" {
3779 pub fn cusolverDnZlauum_bufferSize(
3780 handle: cusolverDnHandle_t,
3781 uplo: cublasFillMode_t,
3782 n: ::core::ffi::c_int,
3783 A: *mut cuDoubleComplex,
3784 lda: ::core::ffi::c_int,
3785 lwork: *mut ::core::ffi::c_int,
3786 ) -> cusolverStatus_t;
3787}
3788unsafe extern "C" {
3789 pub fn cusolverDnSlauum(
3790 handle: cusolverDnHandle_t,
3791 uplo: cublasFillMode_t,
3792 n: ::core::ffi::c_int,
3793 A: *mut f32,
3794 lda: ::core::ffi::c_int,
3795 work: *mut f32,
3796 lwork: ::core::ffi::c_int,
3797 devInfo: *mut ::core::ffi::c_int,
3798 ) -> cusolverStatus_t;
3799}
3800unsafe extern "C" {
3801 pub fn cusolverDnDlauum(
3802 handle: cusolverDnHandle_t,
3803 uplo: cublasFillMode_t,
3804 n: ::core::ffi::c_int,
3805 A: *mut f64,
3806 lda: ::core::ffi::c_int,
3807 work: *mut f64,
3808 lwork: ::core::ffi::c_int,
3809 devInfo: *mut ::core::ffi::c_int,
3810 ) -> cusolverStatus_t;
3811}
3812unsafe extern "C" {
3813 pub fn cusolverDnClauum(
3814 handle: cusolverDnHandle_t,
3815 uplo: cublasFillMode_t,
3816 n: ::core::ffi::c_int,
3817 A: *mut cuComplex,
3818 lda: ::core::ffi::c_int,
3819 work: *mut cuComplex,
3820 lwork: ::core::ffi::c_int,
3821 devInfo: *mut ::core::ffi::c_int,
3822 ) -> cusolverStatus_t;
3823}
3824unsafe extern "C" {
3825 pub fn cusolverDnZlauum(
3826 handle: cusolverDnHandle_t,
3827 uplo: cublasFillMode_t,
3828 n: ::core::ffi::c_int,
3829 A: *mut cuDoubleComplex,
3830 lda: ::core::ffi::c_int,
3831 work: *mut cuDoubleComplex,
3832 lwork: ::core::ffi::c_int,
3833 devInfo: *mut ::core::ffi::c_int,
3834 ) -> cusolverStatus_t;
3835}
3836unsafe extern "C" {
3837 pub fn cusolverDnSgetrf_bufferSize(
3838 handle: cusolverDnHandle_t,
3839 m: ::core::ffi::c_int,
3840 n: ::core::ffi::c_int,
3841 A: *mut f32,
3842 lda: ::core::ffi::c_int,
3843 Lwork: *mut ::core::ffi::c_int,
3844 ) -> cusolverStatus_t;
3845}
3846unsafe extern "C" {
3847 pub fn cusolverDnDgetrf_bufferSize(
3848 handle: cusolverDnHandle_t,
3849 m: ::core::ffi::c_int,
3850 n: ::core::ffi::c_int,
3851 A: *mut f64,
3852 lda: ::core::ffi::c_int,
3853 Lwork: *mut ::core::ffi::c_int,
3854 ) -> cusolverStatus_t;
3855}
3856unsafe extern "C" {
3857 pub fn cusolverDnCgetrf_bufferSize(
3858 handle: cusolverDnHandle_t,
3859 m: ::core::ffi::c_int,
3860 n: ::core::ffi::c_int,
3861 A: *mut cuComplex,
3862 lda: ::core::ffi::c_int,
3863 Lwork: *mut ::core::ffi::c_int,
3864 ) -> cusolverStatus_t;
3865}
3866unsafe extern "C" {
3867 pub fn cusolverDnZgetrf_bufferSize(
3868 handle: cusolverDnHandle_t,
3869 m: ::core::ffi::c_int,
3870 n: ::core::ffi::c_int,
3871 A: *mut cuDoubleComplex,
3872 lda: ::core::ffi::c_int,
3873 Lwork: *mut ::core::ffi::c_int,
3874 ) -> cusolverStatus_t;
3875}
3876unsafe extern "C" {
3877 /// These helper functions calculate the size of work buffers needed.
3878 ///
3879 /// Please visit [cuSOLVER Library Samples - getrf](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/getrf) for a code example.
3880 ///
3881 /// The S and D data types are real single and double precision, respectively.
3882 ///
3883 /// The C and Z data types are complex valued single and double precision, respectively.
3884 ///
3885 /// This function computes the LU factorization of an $m \times n$ matrix:
3886 /// $$
3887 /// P\\*A = L\\*U
3888 /// $$
3889 ///
3890 /// 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.
3891 ///
3892 /// 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()`.
3893 ///
3894 /// If LU factorization failed, i.e. matrix `A` (`U`) is singular, The output parameter `devInfo=i` indicates `U(i,i) = 0`.
3895 ///
3896 /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
3897 ///
3898 /// If `devIpiv` is null, no pivoting is performed. The factorization is `A=L*U`, which is not numerically stable.
3899 ///
3900 /// No matter LU factorization failed or not, the output parameter `devIpiv` contains pivoting sequence, row `i` is interchanged with row `devIpiv(i)`.
3901 ///
3902 /// The user can combine `getrf` and `getrs` to complete a linear solver.
3903 ///
3904 /// 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)`.
3905 pub fn cusolverDnSgetrf(
3906 handle: cusolverDnHandle_t,
3907 m: ::core::ffi::c_int,
3908 n: ::core::ffi::c_int,
3909 A: *mut f32,
3910 lda: ::core::ffi::c_int,
3911 Workspace: *mut f32,
3912 devIpiv: *mut ::core::ffi::c_int,
3913 devInfo: *mut ::core::ffi::c_int,
3914 ) -> cusolverStatus_t;
3915}
3916unsafe extern "C" {
3917 /// These helper functions calculate the size of work buffers needed.
3918 ///
3919 /// Please visit [cuSOLVER Library Samples - getrf](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/getrf) for a code example.
3920 ///
3921 /// The S and D data types are real single and double precision, respectively.
3922 ///
3923 /// The C and Z data types are complex valued single and double precision, respectively.
3924 ///
3925 /// This function computes the LU factorization of an $m \times n$ matrix:
3926 /// $$
3927 /// P\\*A = L\\*U
3928 /// $$
3929 ///
3930 /// 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.
3931 ///
3932 /// 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()`.
3933 ///
3934 /// If LU factorization failed, i.e. matrix `A` (`U`) is singular, The output parameter `devInfo=i` indicates `U(i,i) = 0`.
3935 ///
3936 /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
3937 ///
3938 /// If `devIpiv` is null, no pivoting is performed. The factorization is `A=L*U`, which is not numerically stable.
3939 ///
3940 /// No matter LU factorization failed or not, the output parameter `devIpiv` contains pivoting sequence, row `i` is interchanged with row `devIpiv(i)`.
3941 ///
3942 /// The user can combine `getrf` and `getrs` to complete a linear solver.
3943 ///
3944 /// 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)`.
3945 pub fn cusolverDnDgetrf(
3946 handle: cusolverDnHandle_t,
3947 m: ::core::ffi::c_int,
3948 n: ::core::ffi::c_int,
3949 A: *mut f64,
3950 lda: ::core::ffi::c_int,
3951 Workspace: *mut f64,
3952 devIpiv: *mut ::core::ffi::c_int,
3953 devInfo: *mut ::core::ffi::c_int,
3954 ) -> cusolverStatus_t;
3955}
3956unsafe extern "C" {
3957 /// These helper functions calculate the size of work buffers needed.
3958 ///
3959 /// Please visit [cuSOLVER Library Samples - getrf](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/getrf) for a code example.
3960 ///
3961 /// The S and D data types are real single and double precision, respectively.
3962 ///
3963 /// The C and Z data types are complex valued single and double precision, respectively.
3964 ///
3965 /// This function computes the LU factorization of an $m \times n$ matrix:
3966 /// $$
3967 /// P\\*A = L\\*U
3968 /// $$
3969 ///
3970 /// 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.
3971 ///
3972 /// 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()`.
3973 ///
3974 /// If LU factorization failed, i.e. matrix `A` (`U`) is singular, The output parameter `devInfo=i` indicates `U(i,i) = 0`.
3975 ///
3976 /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
3977 ///
3978 /// If `devIpiv` is null, no pivoting is performed. The factorization is `A=L*U`, which is not numerically stable.
3979 ///
3980 /// No matter LU factorization failed or not, the output parameter `devIpiv` contains pivoting sequence, row `i` is interchanged with row `devIpiv(i)`.
3981 ///
3982 /// The user can combine `getrf` and `getrs` to complete a linear solver.
3983 ///
3984 /// 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)`.
3985 pub fn cusolverDnCgetrf(
3986 handle: cusolverDnHandle_t,
3987 m: ::core::ffi::c_int,
3988 n: ::core::ffi::c_int,
3989 A: *mut cuComplex,
3990 lda: ::core::ffi::c_int,
3991 Workspace: *mut cuComplex,
3992 devIpiv: *mut ::core::ffi::c_int,
3993 devInfo: *mut ::core::ffi::c_int,
3994 ) -> cusolverStatus_t;
3995}
3996unsafe extern "C" {
3997 /// These helper functions calculate the size of work buffers needed.
3998 ///
3999 /// Please visit [cuSOLVER Library Samples - getrf](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/getrf) for a code example.
4000 ///
4001 /// The S and D data types are real single and double precision, respectively.
4002 ///
4003 /// The C and Z data types are complex valued single and double precision, respectively.
4004 ///
4005 /// This function computes the LU factorization of an $m \times n$ matrix:
4006 /// $$
4007 /// P\\*A = L\\*U
4008 /// $$
4009 ///
4010 /// 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.
4011 ///
4012 /// 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()`.
4013 ///
4014 /// If LU factorization failed, i.e. matrix `A` (`U`) is singular, The output parameter `devInfo=i` indicates `U(i,i) = 0`.
4015 ///
4016 /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
4017 ///
4018 /// If `devIpiv` is null, no pivoting is performed. The factorization is `A=L*U`, which is not numerically stable.
4019 ///
4020 /// No matter LU factorization failed or not, the output parameter `devIpiv` contains pivoting sequence, row `i` is interchanged with row `devIpiv(i)`.
4021 ///
4022 /// The user can combine `getrf` and `getrs` to complete a linear solver.
4023 ///
4024 /// 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)`.
4025 pub fn cusolverDnZgetrf(
4026 handle: cusolverDnHandle_t,
4027 m: ::core::ffi::c_int,
4028 n: ::core::ffi::c_int,
4029 A: *mut cuDoubleComplex,
4030 lda: ::core::ffi::c_int,
4031 Workspace: *mut cuDoubleComplex,
4032 devIpiv: *mut ::core::ffi::c_int,
4033 devInfo: *mut ::core::ffi::c_int,
4034 ) -> cusolverStatus_t;
4035}
4036unsafe extern "C" {
4037 pub fn cusolverDnSlaswp(
4038 handle: cusolverDnHandle_t,
4039 n: ::core::ffi::c_int,
4040 A: *mut f32,
4041 lda: ::core::ffi::c_int,
4042 k1: ::core::ffi::c_int,
4043 k2: ::core::ffi::c_int,
4044 devIpiv: *const ::core::ffi::c_int,
4045 incx: ::core::ffi::c_int,
4046 ) -> cusolverStatus_t;
4047}
4048unsafe extern "C" {
4049 pub fn cusolverDnDlaswp(
4050 handle: cusolverDnHandle_t,
4051 n: ::core::ffi::c_int,
4052 A: *mut f64,
4053 lda: ::core::ffi::c_int,
4054 k1: ::core::ffi::c_int,
4055 k2: ::core::ffi::c_int,
4056 devIpiv: *const ::core::ffi::c_int,
4057 incx: ::core::ffi::c_int,
4058 ) -> cusolverStatus_t;
4059}
4060unsafe extern "C" {
4061 pub fn cusolverDnClaswp(
4062 handle: cusolverDnHandle_t,
4063 n: ::core::ffi::c_int,
4064 A: *mut cuComplex,
4065 lda: ::core::ffi::c_int,
4066 k1: ::core::ffi::c_int,
4067 k2: ::core::ffi::c_int,
4068 devIpiv: *const ::core::ffi::c_int,
4069 incx: ::core::ffi::c_int,
4070 ) -> cusolverStatus_t;
4071}
4072unsafe extern "C" {
4073 pub fn cusolverDnZlaswp(
4074 handle: cusolverDnHandle_t,
4075 n: ::core::ffi::c_int,
4076 A: *mut cuDoubleComplex,
4077 lda: ::core::ffi::c_int,
4078 k1: ::core::ffi::c_int,
4079 k2: ::core::ffi::c_int,
4080 devIpiv: *const ::core::ffi::c_int,
4081 incx: ::core::ffi::c_int,
4082 ) -> cusolverStatus_t;
4083}
4084unsafe extern "C" {
4085 /// Please visit [cuSOLVER Library Samples - getrf](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/getrf) for a code example.
4086 ///
4087 /// This function solves a linear system of multiple right-hand sides:
4088 /// $$
4089 /// op(A)\\*X = B
4090 /// $$
4091 ///
4092 /// 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.
4093 ///
4094 /// The input parameter `trans` is defined by:
4095 /// $$
4096 /// \operatorname{op}(A) =
4097 /// \begin{cases}
4098 /// A & \text{if } trans = \text{CUBLAS_OP_N} \\
4099 /// A^T & \text{if } trans = \text{CUBLAS_OP_T} \\
4100 /// A^H & \text{if } trans = \text{CUBLAS_OP_C}
4101 /// \end{cases}
4102 /// $$
4103 ///
4104 /// The input parameter `devIpiv` is an output of `getrf`. It contains pivot indices, which are used to permutate right-hand sides.
4105 ///
4106 /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
4107 ///
4108 /// The user can combine `getrf` and `getrs` to complete a linear solver.
4109 pub fn cusolverDnSgetrs(
4110 handle: cusolverDnHandle_t,
4111 trans: cublasOperation_t,
4112 n: ::core::ffi::c_int,
4113 nrhs: ::core::ffi::c_int,
4114 A: *const f32,
4115 lda: ::core::ffi::c_int,
4116 devIpiv: *const ::core::ffi::c_int,
4117 B: *mut f32,
4118 ldb: ::core::ffi::c_int,
4119 devInfo: *mut ::core::ffi::c_int,
4120 ) -> cusolverStatus_t;
4121}
4122unsafe extern "C" {
4123 /// Please visit [cuSOLVER Library Samples - getrf](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/getrf) for a code example.
4124 ///
4125 /// This function solves a linear system of multiple right-hand sides:
4126 /// $$
4127 /// op(A)\\*X = B
4128 /// $$
4129 ///
4130 /// 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.
4131 ///
4132 /// The input parameter `trans` is defined by:
4133 /// $$
4134 /// \operatorname{op}(A) =
4135 /// \begin{cases}
4136 /// A & \text{if } trans = \text{CUBLAS_OP_N} \\
4137 /// A^T & \text{if } trans = \text{CUBLAS_OP_T} \\
4138 /// A^H & \text{if } trans = \text{CUBLAS_OP_C}
4139 /// \end{cases}
4140 /// $$
4141 ///
4142 /// The input parameter `devIpiv` is an output of `getrf`. It contains pivot indices, which are used to permutate right-hand sides.
4143 ///
4144 /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
4145 ///
4146 /// The user can combine `getrf` and `getrs` to complete a linear solver.
4147 pub fn cusolverDnDgetrs(
4148 handle: cusolverDnHandle_t,
4149 trans: cublasOperation_t,
4150 n: ::core::ffi::c_int,
4151 nrhs: ::core::ffi::c_int,
4152 A: *const f64,
4153 lda: ::core::ffi::c_int,
4154 devIpiv: *const ::core::ffi::c_int,
4155 B: *mut f64,
4156 ldb: ::core::ffi::c_int,
4157 devInfo: *mut ::core::ffi::c_int,
4158 ) -> cusolverStatus_t;
4159}
4160unsafe extern "C" {
4161 /// Please visit [cuSOLVER Library Samples - getrf](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/getrf) for a code example.
4162 ///
4163 /// This function solves a linear system of multiple right-hand sides:
4164 /// $$
4165 /// op(A)\\*X = B
4166 /// $$
4167 ///
4168 /// 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.
4169 ///
4170 /// The input parameter `trans` is defined by:
4171 /// $$
4172 /// \operatorname{op}(A) =
4173 /// \begin{cases}
4174 /// A & \text{if } trans = \text{CUBLAS_OP_N} \\
4175 /// A^T & \text{if } trans = \text{CUBLAS_OP_T} \\
4176 /// A^H & \text{if } trans = \text{CUBLAS_OP_C}
4177 /// \end{cases}
4178 /// $$
4179 ///
4180 /// The input parameter `devIpiv` is an output of `getrf`. It contains pivot indices, which are used to permutate right-hand sides.
4181 ///
4182 /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
4183 ///
4184 /// The user can combine `getrf` and `getrs` to complete a linear solver.
4185 pub fn cusolverDnCgetrs(
4186 handle: cusolverDnHandle_t,
4187 trans: cublasOperation_t,
4188 n: ::core::ffi::c_int,
4189 nrhs: ::core::ffi::c_int,
4190 A: *const cuComplex,
4191 lda: ::core::ffi::c_int,
4192 devIpiv: *const ::core::ffi::c_int,
4193 B: *mut cuComplex,
4194 ldb: ::core::ffi::c_int,
4195 devInfo: *mut ::core::ffi::c_int,
4196 ) -> cusolverStatus_t;
4197}
4198unsafe extern "C" {
4199 /// Please visit [cuSOLVER Library Samples - getrf](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/getrf) for a code example.
4200 ///
4201 /// This function solves a linear system of multiple right-hand sides:
4202 /// $$
4203 /// op(A)\\*X = B
4204 /// $$
4205 ///
4206 /// 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.
4207 ///
4208 /// The input parameter `trans` is defined by:
4209 /// $$
4210 /// \operatorname{op}(A) =
4211 /// \begin{cases}
4212 /// A & \text{if } trans = \text{CUBLAS_OP_N} \\
4213 /// A^T & \text{if } trans = \text{CUBLAS_OP_T} \\
4214 /// A^H & \text{if } trans = \text{CUBLAS_OP_C}
4215 /// \end{cases}
4216 /// $$
4217 ///
4218 /// The input parameter `devIpiv` is an output of `getrf`. It contains pivot indices, which are used to permutate right-hand sides.
4219 ///
4220 /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
4221 ///
4222 /// The user can combine `getrf` and `getrs` to complete a linear solver.
4223 pub fn cusolverDnZgetrs(
4224 handle: cusolverDnHandle_t,
4225 trans: cublasOperation_t,
4226 n: ::core::ffi::c_int,
4227 nrhs: ::core::ffi::c_int,
4228 A: *const cuDoubleComplex,
4229 lda: ::core::ffi::c_int,
4230 devIpiv: *const ::core::ffi::c_int,
4231 B: *mut cuDoubleComplex,
4232 ldb: ::core::ffi::c_int,
4233 devInfo: *mut ::core::ffi::c_int,
4234 ) -> cusolverStatus_t;
4235}
4236unsafe extern "C" {
4237 pub fn cusolverDnSgeqrf_bufferSize(
4238 handle: cusolverDnHandle_t,
4239 m: ::core::ffi::c_int,
4240 n: ::core::ffi::c_int,
4241 A: *mut f32,
4242 lda: ::core::ffi::c_int,
4243 lwork: *mut ::core::ffi::c_int,
4244 ) -> cusolverStatus_t;
4245}
4246unsafe extern "C" {
4247 pub fn cusolverDnDgeqrf_bufferSize(
4248 handle: cusolverDnHandle_t,
4249 m: ::core::ffi::c_int,
4250 n: ::core::ffi::c_int,
4251 A: *mut f64,
4252 lda: ::core::ffi::c_int,
4253 lwork: *mut ::core::ffi::c_int,
4254 ) -> cusolverStatus_t;
4255}
4256unsafe extern "C" {
4257 pub fn cusolverDnCgeqrf_bufferSize(
4258 handle: cusolverDnHandle_t,
4259 m: ::core::ffi::c_int,
4260 n: ::core::ffi::c_int,
4261 A: *mut cuComplex,
4262 lda: ::core::ffi::c_int,
4263 lwork: *mut ::core::ffi::c_int,
4264 ) -> cusolverStatus_t;
4265}
4266unsafe extern "C" {
4267 pub fn cusolverDnZgeqrf_bufferSize(
4268 handle: cusolverDnHandle_t,
4269 m: ::core::ffi::c_int,
4270 n: ::core::ffi::c_int,
4271 A: *mut cuDoubleComplex,
4272 lda: ::core::ffi::c_int,
4273 lwork: *mut ::core::ffi::c_int,
4274 ) -> cusolverStatus_t;
4275}
4276unsafe extern "C" {
4277 /// These helper functions calculate the size of work buffers needed.
4278 ///
4279 /// The S and D data types are real valued single and double precision, respectively.
4280 ///
4281 /// The C and Z data types are complex valued single and double precision, respectively.
4282 ///
4283 /// This function computes the QR factorization of an $m \times n$ matrix:
4284 /// $$
4285 /// A = Q\\*R
4286 /// $$
4287 ///
4288 /// 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.
4289 ///
4290 /// 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()`.
4291 ///
4292 /// The matrix `R` is overwritten in upper triangular part of `A`, including diagonal elements.
4293 ///
4294 /// 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:
4295 /// $$
4296 /// I - 2\\*v\\*v^{H} = I - \tau\\*q\\*q^{H}
4297 /// $$
4298 ///
4299 /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
4300 pub fn cusolverDnSgeqrf(
4301 handle: cusolverDnHandle_t,
4302 m: ::core::ffi::c_int,
4303 n: ::core::ffi::c_int,
4304 A: *mut f32,
4305 lda: ::core::ffi::c_int,
4306 TAU: *mut f32,
4307 Workspace: *mut f32,
4308 Lwork: ::core::ffi::c_int,
4309 devInfo: *mut ::core::ffi::c_int,
4310 ) -> cusolverStatus_t;
4311}
4312unsafe extern "C" {
4313 /// These helper functions calculate the size of work buffers needed.
4314 ///
4315 /// The S and D data types are real valued single and double precision, respectively.
4316 ///
4317 /// The C and Z data types are complex valued single and double precision, respectively.
4318 ///
4319 /// This function computes the QR factorization of an $m \times n$ matrix:
4320 /// $$
4321 /// A = Q\\*R
4322 /// $$
4323 ///
4324 /// 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.
4325 ///
4326 /// 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()`.
4327 ///
4328 /// The matrix `R` is overwritten in upper triangular part of `A`, including diagonal elements.
4329 ///
4330 /// 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:
4331 /// $$
4332 /// I - 2\\*v\\*v^{H} = I - \tau\\*q\\*q^{H}
4333 /// $$
4334 ///
4335 /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
4336 pub fn cusolverDnDgeqrf(
4337 handle: cusolverDnHandle_t,
4338 m: ::core::ffi::c_int,
4339 n: ::core::ffi::c_int,
4340 A: *mut f64,
4341 lda: ::core::ffi::c_int,
4342 TAU: *mut f64,
4343 Workspace: *mut f64,
4344 Lwork: ::core::ffi::c_int,
4345 devInfo: *mut ::core::ffi::c_int,
4346 ) -> cusolverStatus_t;
4347}
4348unsafe extern "C" {
4349 /// These helper functions calculate the size of work buffers needed.
4350 ///
4351 /// The S and D data types are real valued single and double precision, respectively.
4352 ///
4353 /// The C and Z data types are complex valued single and double precision, respectively.
4354 ///
4355 /// This function computes the QR factorization of an $m \times n$ matrix:
4356 /// $$
4357 /// A = Q\\*R
4358 /// $$
4359 ///
4360 /// 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.
4361 ///
4362 /// 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()`.
4363 ///
4364 /// The matrix `R` is overwritten in upper triangular part of `A`, including diagonal elements.
4365 ///
4366 /// 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:
4367 /// $$
4368 /// I - 2\\*v\\*v^{H} = I - \tau\\*q\\*q^{H}
4369 /// $$
4370 ///
4371 /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
4372 pub fn cusolverDnCgeqrf(
4373 handle: cusolverDnHandle_t,
4374 m: ::core::ffi::c_int,
4375 n: ::core::ffi::c_int,
4376 A: *mut cuComplex,
4377 lda: ::core::ffi::c_int,
4378 TAU: *mut cuComplex,
4379 Workspace: *mut cuComplex,
4380 Lwork: ::core::ffi::c_int,
4381 devInfo: *mut ::core::ffi::c_int,
4382 ) -> cusolverStatus_t;
4383}
4384unsafe extern "C" {
4385 /// These helper functions calculate the size of work buffers needed.
4386 ///
4387 /// The S and D data types are real valued single and double precision, respectively.
4388 ///
4389 /// The C and Z data types are complex valued single and double precision, respectively.
4390 ///
4391 /// This function computes the QR factorization of an $m \times n$ matrix:
4392 /// $$
4393 /// A = Q\\*R
4394 /// $$
4395 ///
4396 /// 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.
4397 ///
4398 /// 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()`.
4399 ///
4400 /// The matrix `R` is overwritten in upper triangular part of `A`, including diagonal elements.
4401 ///
4402 /// 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:
4403 /// $$
4404 /// I - 2\\*v\\*v^{H} = I - \tau\\*q\\*q^{H}
4405 /// $$
4406 ///
4407 /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
4408 pub fn cusolverDnZgeqrf(
4409 handle: cusolverDnHandle_t,
4410 m: ::core::ffi::c_int,
4411 n: ::core::ffi::c_int,
4412 A: *mut cuDoubleComplex,
4413 lda: ::core::ffi::c_int,
4414 TAU: *mut cuDoubleComplex,
4415 Workspace: *mut cuDoubleComplex,
4416 Lwork: ::core::ffi::c_int,
4417 devInfo: *mut ::core::ffi::c_int,
4418 ) -> cusolverStatus_t;
4419}
4420unsafe extern "C" {
4421 pub fn cusolverDnSorgqr_bufferSize(
4422 handle: cusolverDnHandle_t,
4423 m: ::core::ffi::c_int,
4424 n: ::core::ffi::c_int,
4425 k: ::core::ffi::c_int,
4426 A: *const f32,
4427 lda: ::core::ffi::c_int,
4428 tau: *const f32,
4429 lwork: *mut ::core::ffi::c_int,
4430 ) -> cusolverStatus_t;
4431}
4432unsafe extern "C" {
4433 pub fn cusolverDnDorgqr_bufferSize(
4434 handle: cusolverDnHandle_t,
4435 m: ::core::ffi::c_int,
4436 n: ::core::ffi::c_int,
4437 k: ::core::ffi::c_int,
4438 A: *const f64,
4439 lda: ::core::ffi::c_int,
4440 tau: *const f64,
4441 lwork: *mut ::core::ffi::c_int,
4442 ) -> cusolverStatus_t;
4443}
4444unsafe extern "C" {
4445 pub fn cusolverDnCungqr_bufferSize(
4446 handle: cusolverDnHandle_t,
4447 m: ::core::ffi::c_int,
4448 n: ::core::ffi::c_int,
4449 k: ::core::ffi::c_int,
4450 A: *const cuComplex,
4451 lda: ::core::ffi::c_int,
4452 tau: *const cuComplex,
4453 lwork: *mut ::core::ffi::c_int,
4454 ) -> cusolverStatus_t;
4455}
4456unsafe extern "C" {
4457 pub fn cusolverDnZungqr_bufferSize(
4458 handle: cusolverDnHandle_t,
4459 m: ::core::ffi::c_int,
4460 n: ::core::ffi::c_int,
4461 k: ::core::ffi::c_int,
4462 A: *const cuDoubleComplex,
4463 lda: ::core::ffi::c_int,
4464 tau: *const cuDoubleComplex,
4465 lwork: *mut ::core::ffi::c_int,
4466 ) -> cusolverStatus_t;
4467}
4468unsafe extern "C" {
4469 /// 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.
4470 ///
4471 /// The S and D data types are real valued single and double precision, respectively.
4472 ///
4473 /// The C and Z data types are complex valued single and double precision, respectively.
4474 ///
4475 /// This function overwrites $m \times n$ matrix `A` by:
4476 /// $$
4477 /// Q = {H(1)}\\*{H(2)}\\*{...}\\*{H(k)}
4478 /// $$
4479 ///
4480 /// where `Q` is a unitary matrix formed by a sequence of elementary reflection vectors stored in `A`.
4481 ///
4482 /// The user has to provide working space which is pointed by input parameter `work`. The input parameter `lwork` is size of the working space, and it is returned by `orgqr_bufferSize()`. Please note that the size in bytes of the working space is equal to `sizeof(<type>) * lwork`.
4483 ///
4484 /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
4485 ///
4486 /// The user can combine `geqrf`, `orgqr` to complete orthogonalization.
4487 pub fn cusolverDnSorgqr(
4488 handle: cusolverDnHandle_t,
4489 m: ::core::ffi::c_int,
4490 n: ::core::ffi::c_int,
4491 k: ::core::ffi::c_int,
4492 A: *mut f32,
4493 lda: ::core::ffi::c_int,
4494 tau: *const f32,
4495 work: *mut f32,
4496 lwork: ::core::ffi::c_int,
4497 info: *mut ::core::ffi::c_int,
4498 ) -> cusolverStatus_t;
4499}
4500unsafe extern "C" {
4501 /// 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.
4502 ///
4503 /// The S and D data types are real valued single and double precision, respectively.
4504 ///
4505 /// The C and Z data types are complex valued single and double precision, respectively.
4506 ///
4507 /// This function overwrites $m \times n$ matrix `A` by:
4508 /// $$
4509 /// Q = {H(1)}\\*{H(2)}\\*{...}\\*{H(k)}
4510 /// $$
4511 ///
4512 /// where `Q` is a unitary matrix formed by a sequence of elementary reflection vectors stored in `A`.
4513 ///
4514 /// The user has to provide working space which is pointed by input parameter `work`. The input parameter `lwork` is size of the working space, and it is returned by `orgqr_bufferSize()`. Please note that the size in bytes of the working space is equal to `sizeof(<type>) * lwork`.
4515 ///
4516 /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
4517 ///
4518 /// The user can combine `geqrf`, `orgqr` to complete orthogonalization.
4519 pub fn cusolverDnDorgqr(
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 f64,
4525 lda: ::core::ffi::c_int,
4526 tau: *const f64,
4527 work: *mut f64,
4528 lwork: ::core::ffi::c_int,
4529 info: *mut ::core::ffi::c_int,
4530 ) -> cusolverStatus_t;
4531}
4532unsafe extern "C" {
4533 pub fn cusolverDnCungqr(
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 cuComplex,
4539 lda: ::core::ffi::c_int,
4540 tau: *const cuComplex,
4541 work: *mut cuComplex,
4542 lwork: ::core::ffi::c_int,
4543 info: *mut ::core::ffi::c_int,
4544 ) -> cusolverStatus_t;
4545}
4546unsafe extern "C" {
4547 pub fn cusolverDnZungqr(
4548 handle: cusolverDnHandle_t,
4549 m: ::core::ffi::c_int,
4550 n: ::core::ffi::c_int,
4551 k: ::core::ffi::c_int,
4552 A: *mut cuDoubleComplex,
4553 lda: ::core::ffi::c_int,
4554 tau: *const cuDoubleComplex,
4555 work: *mut cuDoubleComplex,
4556 lwork: ::core::ffi::c_int,
4557 info: *mut ::core::ffi::c_int,
4558 ) -> cusolverStatus_t;
4559}
4560unsafe extern "C" {
4561 pub fn cusolverDnSormqr_bufferSize(
4562 handle: cusolverDnHandle_t,
4563 side: cublasSideMode_t,
4564 trans: cublasOperation_t,
4565 m: ::core::ffi::c_int,
4566 n: ::core::ffi::c_int,
4567 k: ::core::ffi::c_int,
4568 A: *const f32,
4569 lda: ::core::ffi::c_int,
4570 tau: *const f32,
4571 C: *const f32,
4572 ldc: ::core::ffi::c_int,
4573 lwork: *mut ::core::ffi::c_int,
4574 ) -> cusolverStatus_t;
4575}
4576unsafe extern "C" {
4577 pub fn cusolverDnDormqr_bufferSize(
4578 handle: cusolverDnHandle_t,
4579 side: cublasSideMode_t,
4580 trans: cublasOperation_t,
4581 m: ::core::ffi::c_int,
4582 n: ::core::ffi::c_int,
4583 k: ::core::ffi::c_int,
4584 A: *const f64,
4585 lda: ::core::ffi::c_int,
4586 tau: *const f64,
4587 C: *const f64,
4588 ldc: ::core::ffi::c_int,
4589 lwork: *mut ::core::ffi::c_int,
4590 ) -> cusolverStatus_t;
4591}
4592unsafe extern "C" {
4593 pub fn cusolverDnCunmqr_bufferSize(
4594 handle: cusolverDnHandle_t,
4595 side: cublasSideMode_t,
4596 trans: cublasOperation_t,
4597 m: ::core::ffi::c_int,
4598 n: ::core::ffi::c_int,
4599 k: ::core::ffi::c_int,
4600 A: *const cuComplex,
4601 lda: ::core::ffi::c_int,
4602 tau: *const cuComplex,
4603 C: *const cuComplex,
4604 ldc: ::core::ffi::c_int,
4605 lwork: *mut ::core::ffi::c_int,
4606 ) -> cusolverStatus_t;
4607}
4608unsafe extern "C" {
4609 pub fn cusolverDnZunmqr_bufferSize(
4610 handle: cusolverDnHandle_t,
4611 side: cublasSideMode_t,
4612 trans: cublasOperation_t,
4613 m: ::core::ffi::c_int,
4614 n: ::core::ffi::c_int,
4615 k: ::core::ffi::c_int,
4616 A: *const cuDoubleComplex,
4617 lda: ::core::ffi::c_int,
4618 tau: *const cuDoubleComplex,
4619 C: *const cuDoubleComplex,
4620 ldc: ::core::ffi::c_int,
4621 lwork: *mut ::core::ffi::c_int,
4622 ) -> cusolverStatus_t;
4623}
4624unsafe extern "C" {
4625 /// 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.
4626 ///
4627 /// The S and D data types are real valued single and double precision, respectively.
4628 ///
4629 /// The C and Z data types are complex valued single and double precision, respectively.
4630 ///
4631 /// This function overwrites $m \times n$ matrix `C` by:
4632 /// $$
4633 /// C =
4634 /// \begin{cases}
4635 /// \operatorname{op}(Q) * C & \text{if } side = \text{CUBLAS_SIDE_LEFT} \\
4636 /// C * \operatorname{op}(Q) & \text{if } side = \text{CUBLAS_SIDE_RIGHT}
4637 /// \end{cases}
4638 /// $$
4639 ///
4640 /// The operation of `Q` is defined by:
4641 /// $$
4642 /// \operatorname{op}(Q) =
4643 /// \begin{cases}
4644 /// Q & \text{if } transa = \text{CUBLAS_OP_N} \\
4645 /// Q^T & \text{if } transa = \text{CUBLAS_OP_T} \\
4646 /// Q^H & \text{if } transa = \text{CUBLAS_OP_C}
4647 /// \end{cases}
4648 /// $$
4649 ///
4650 /// `Q` is a unitary matrix formed by a sequence of elementary reflection vectors from QR factorization (`geqrf`) of `A`.
4651 ///
4652 /// `Q`=`H(1) ``H(2)` … `H(k)`
4653 ///
4654 /// `Q` is of order `m` if `side` = [`cublasSideMode_t::CUBLAS_SIDE_LEFT`] and of order `n` if `side` = [`cublasSideMode_t::CUBLAS_SIDE_RIGHT`].
4655 ///
4656 /// The user has to provide working space which is pointed by input parameter `work`. The input parameter `lwork` is size of the working space, and it is returned by `geqrf_bufferSize()` or `ormqr_bufferSize()`. Please note that the size in bytes of the working space is equal to `sizeof(<type>) * lwork`.
4657 ///
4658 /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
4659 ///
4660 /// The user can combine `geqrf`, `ormqr` and `trsm` to complete a linear solver or a least-square solver.
4661 pub fn cusolverDnSormqr(
4662 handle: cusolverDnHandle_t,
4663 side: cublasSideMode_t,
4664 trans: cublasOperation_t,
4665 m: ::core::ffi::c_int,
4666 n: ::core::ffi::c_int,
4667 k: ::core::ffi::c_int,
4668 A: *const f32,
4669 lda: ::core::ffi::c_int,
4670 tau: *const f32,
4671 C: *mut f32,
4672 ldc: ::core::ffi::c_int,
4673 work: *mut f32,
4674 lwork: ::core::ffi::c_int,
4675 devInfo: *mut ::core::ffi::c_int,
4676 ) -> cusolverStatus_t;
4677}
4678unsafe extern "C" {
4679 /// 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.
4680 ///
4681 /// The S and D data types are real valued single and double precision, respectively.
4682 ///
4683 /// The C and Z data types are complex valued single and double precision, respectively.
4684 ///
4685 /// This function overwrites $m \times n$ matrix `C` by:
4686 /// $$
4687 /// C =
4688 /// \begin{cases}
4689 /// \operatorname{op}(Q) * C & \text{if } side = \text{CUBLAS_SIDE_LEFT} \\
4690 /// C * \operatorname{op}(Q) & \text{if } side = \text{CUBLAS_SIDE_RIGHT}
4691 /// \end{cases}
4692 /// $$
4693 ///
4694 /// The operation of `Q` is defined by:
4695 /// $$
4696 /// \operatorname{op}(Q) =
4697 /// \begin{cases}
4698 /// Q & \text{if } transa = \text{CUBLAS_OP_N} \\
4699 /// Q^T & \text{if } transa = \text{CUBLAS_OP_T} \\
4700 /// Q^H & \text{if } transa = \text{CUBLAS_OP_C}
4701 /// \end{cases}
4702 /// $$
4703 ///
4704 /// `Q` is a unitary matrix formed by a sequence of elementary reflection vectors from QR factorization (`geqrf`) of `A`.
4705 ///
4706 /// `Q`=`H(1) ``H(2)` … `H(k)`
4707 ///
4708 /// `Q` is of order `m` if `side` = [`cublasSideMode_t::CUBLAS_SIDE_LEFT`] and of order `n` if `side` = [`cublasSideMode_t::CUBLAS_SIDE_RIGHT`].
4709 ///
4710 /// The user has to provide working space which is pointed by input parameter `work`. The input parameter `lwork` is size of the working space, and it is returned by `geqrf_bufferSize()` or `ormqr_bufferSize()`. Please note that the size in bytes of the working space is equal to `sizeof(<type>) * lwork`.
4711 ///
4712 /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
4713 ///
4714 /// The user can combine `geqrf`, `ormqr` and `trsm` to complete a linear solver or a least-square solver.
4715 pub fn cusolverDnDormqr(
4716 handle: cusolverDnHandle_t,
4717 side: cublasSideMode_t,
4718 trans: cublasOperation_t,
4719 m: ::core::ffi::c_int,
4720 n: ::core::ffi::c_int,
4721 k: ::core::ffi::c_int,
4722 A: *const f64,
4723 lda: ::core::ffi::c_int,
4724 tau: *const f64,
4725 C: *mut f64,
4726 ldc: ::core::ffi::c_int,
4727 work: *mut f64,
4728 lwork: ::core::ffi::c_int,
4729 devInfo: *mut ::core::ffi::c_int,
4730 ) -> cusolverStatus_t;
4731}
4732unsafe extern "C" {
4733 pub fn cusolverDnCunmqr(
4734 handle: cusolverDnHandle_t,
4735 side: cublasSideMode_t,
4736 trans: cublasOperation_t,
4737 m: ::core::ffi::c_int,
4738 n: ::core::ffi::c_int,
4739 k: ::core::ffi::c_int,
4740 A: *const cuComplex,
4741 lda: ::core::ffi::c_int,
4742 tau: *const cuComplex,
4743 C: *mut cuComplex,
4744 ldc: ::core::ffi::c_int,
4745 work: *mut cuComplex,
4746 lwork: ::core::ffi::c_int,
4747 devInfo: *mut ::core::ffi::c_int,
4748 ) -> cusolverStatus_t;
4749}
4750unsafe extern "C" {
4751 pub fn cusolverDnZunmqr(
4752 handle: cusolverDnHandle_t,
4753 side: cublasSideMode_t,
4754 trans: cublasOperation_t,
4755 m: ::core::ffi::c_int,
4756 n: ::core::ffi::c_int,
4757 k: ::core::ffi::c_int,
4758 A: *const cuDoubleComplex,
4759 lda: ::core::ffi::c_int,
4760 tau: *const cuDoubleComplex,
4761 C: *mut cuDoubleComplex,
4762 ldc: ::core::ffi::c_int,
4763 work: *mut cuDoubleComplex,
4764 lwork: ::core::ffi::c_int,
4765 devInfo: *mut ::core::ffi::c_int,
4766 ) -> cusolverStatus_t;
4767}
4768unsafe extern "C" {
4769 pub fn cusolverDnSsytrf_bufferSize(
4770 handle: cusolverDnHandle_t,
4771 n: ::core::ffi::c_int,
4772 A: *mut f32,
4773 lda: ::core::ffi::c_int,
4774 lwork: *mut ::core::ffi::c_int,
4775 ) -> cusolverStatus_t;
4776}
4777unsafe extern "C" {
4778 pub fn cusolverDnDsytrf_bufferSize(
4779 handle: cusolverDnHandle_t,
4780 n: ::core::ffi::c_int,
4781 A: *mut f64,
4782 lda: ::core::ffi::c_int,
4783 lwork: *mut ::core::ffi::c_int,
4784 ) -> cusolverStatus_t;
4785}
4786unsafe extern "C" {
4787 pub fn cusolverDnCsytrf_bufferSize(
4788 handle: cusolverDnHandle_t,
4789 n: ::core::ffi::c_int,
4790 A: *mut cuComplex,
4791 lda: ::core::ffi::c_int,
4792 lwork: *mut ::core::ffi::c_int,
4793 ) -> cusolverStatus_t;
4794}
4795unsafe extern "C" {
4796 pub fn cusolverDnZsytrf_bufferSize(
4797 handle: cusolverDnHandle_t,
4798 n: ::core::ffi::c_int,
4799 A: *mut cuDoubleComplex,
4800 lda: ::core::ffi::c_int,
4801 lwork: *mut ::core::ffi::c_int,
4802 ) -> cusolverStatus_t;
4803}
4804unsafe extern "C" {
4805 /// These helper functions calculate the size of the needed buffers.
4806 ///
4807 /// The S and D data types are real valued single and double precision, respectively.
4808 ///
4809 /// The C and Z data types are complex valued single and double precision, respectively.
4810 ///
4811 /// This function computes the factorization of a symmetric indefinite matrix using the Bunch-Kaufman diagonal pivoting.
4812 ///
4813 /// `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.
4814 ///
4815 /// 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.
4816 /// $$
4817 /// P\\*A\\*P^{T} = L\\*D\\*L^{T}
4818 /// $$
4819 ///
4820 /// 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`.
4821 /// $$
4822 /// P\\*A\\*P^{T} = U\\*D\\*U^{T}
4823 /// $$
4824 ///
4825 /// The user has to provide working space which is pointed by input parameter `work`. The input parameter `lwork` is size of the working space, and it is returned by `sytrf_bufferSize()`. Please note that the size in bytes of the working space is equal to `sizeof(<type>) * lwork`. When no pivoting is performed, the other triangular part of the input matrix `A` is used as workspace.
4826 ///
4827 /// If Bunch-Kaufman factorization failed, i.e. `A` is singular. The output parameter `devInfo = i` would indicate `D(i,i)=0`.
4828 ///
4829 /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
4830 ///
4831 /// The output parameter `devIpiv` contains pivoting sequence. If `devIpiv(i) = k > 0`, `D(i,i)` is 1x1 block, and `i-th` row/column of `A` is interchanged with `k-th` row/column of `A`. If `uplo` is [`cublasFillMode_t::CUBLAS_FILL_MODE_UPPER`] and `devIpiv(i-1) = devIpiv(i) = -m < 0`, `D(i-1:i,i-1:i)` is a 2x2 block, and `(i-1)-th` row/column is interchanged with `m-th` row/column. If `uplo` is [`cublasFillMode_t::CUBLAS_FILL_MODE_LOWER`] and `devIpiv(i+1) = devIpiv(i) = -m < 0`, `D(i:i+1,i:i+1)` is a 2x2 block, and `(i+1)-th` row/column is interchanged with `m-th` row/column.
4832 pub fn cusolverDnSsytrf(
4833 handle: cusolverDnHandle_t,
4834 uplo: cublasFillMode_t,
4835 n: ::core::ffi::c_int,
4836 A: *mut f32,
4837 lda: ::core::ffi::c_int,
4838 ipiv: *mut ::core::ffi::c_int,
4839 work: *mut f32,
4840 lwork: ::core::ffi::c_int,
4841 info: *mut ::core::ffi::c_int,
4842 ) -> cusolverStatus_t;
4843}
4844unsafe extern "C" {
4845 /// These helper functions calculate the size of the needed buffers.
4846 ///
4847 /// The S and D data types are real valued single and double precision, respectively.
4848 ///
4849 /// The C and Z data types are complex valued single and double precision, respectively.
4850 ///
4851 /// This function computes the factorization of a symmetric indefinite matrix using the Bunch-Kaufman diagonal pivoting.
4852 ///
4853 /// `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.
4854 ///
4855 /// 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.
4856 /// $$
4857 /// P\\*A\\*P^{T} = L\\*D\\*L^{T}
4858 /// $$
4859 ///
4860 /// 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`.
4861 /// $$
4862 /// P\\*A\\*P^{T} = U\\*D\\*U^{T}
4863 /// $$
4864 ///
4865 /// The user has to provide working space which is pointed by input parameter `work`. The input parameter `lwork` is size of the working space, and it is returned by `sytrf_bufferSize()`. Please note that the size in bytes of the working space is equal to `sizeof(<type>) * lwork`. When no pivoting is performed, the other triangular part of the input matrix `A` is used as workspace.
4866 ///
4867 /// If Bunch-Kaufman factorization failed, i.e. `A` is singular. The output parameter `devInfo = i` would indicate `D(i,i)=0`.
4868 ///
4869 /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
4870 ///
4871 /// The output parameter `devIpiv` contains pivoting sequence. If `devIpiv(i) = k > 0`, `D(i,i)` is 1x1 block, and `i-th` row/column of `A` is interchanged with `k-th` row/column of `A`. If `uplo` is [`cublasFillMode_t::CUBLAS_FILL_MODE_UPPER`] and `devIpiv(i-1) = devIpiv(i) = -m < 0`, `D(i-1:i,i-1:i)` is a 2x2 block, and `(i-1)-th` row/column is interchanged with `m-th` row/column. If `uplo` is [`cublasFillMode_t::CUBLAS_FILL_MODE_LOWER`] and `devIpiv(i+1) = devIpiv(i) = -m < 0`, `D(i:i+1,i:i+1)` is a 2x2 block, and `(i+1)-th` row/column is interchanged with `m-th` row/column.
4872 pub fn cusolverDnDsytrf(
4873 handle: cusolverDnHandle_t,
4874 uplo: cublasFillMode_t,
4875 n: ::core::ffi::c_int,
4876 A: *mut f64,
4877 lda: ::core::ffi::c_int,
4878 ipiv: *mut ::core::ffi::c_int,
4879 work: *mut f64,
4880 lwork: ::core::ffi::c_int,
4881 info: *mut ::core::ffi::c_int,
4882 ) -> cusolverStatus_t;
4883}
4884unsafe extern "C" {
4885 /// These helper functions calculate the size of the needed buffers.
4886 ///
4887 /// The S and D data types are real valued single and double precision, respectively.
4888 ///
4889 /// The C and Z data types are complex valued single and double precision, respectively.
4890 ///
4891 /// This function computes the factorization of a symmetric indefinite matrix using the Bunch-Kaufman diagonal pivoting.
4892 ///
4893 /// `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.
4894 ///
4895 /// 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.
4896 /// $$
4897 /// P\\*A\\*P^{T} = L\\*D\\*L^{T}
4898 /// $$
4899 ///
4900 /// 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`.
4901 /// $$
4902 /// P\\*A\\*P^{T} = U\\*D\\*U^{T}
4903 /// $$
4904 ///
4905 /// The user has to provide working space which is pointed by input parameter `work`. The input parameter `lwork` is size of the working space, and it is returned by `sytrf_bufferSize()`. Please note that the size in bytes of the working space is equal to `sizeof(<type>) * lwork`. When no pivoting is performed, the other triangular part of the input matrix `A` is used as workspace.
4906 ///
4907 /// If Bunch-Kaufman factorization failed, i.e. `A` is singular. The output parameter `devInfo = i` would indicate `D(i,i)=0`.
4908 ///
4909 /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
4910 ///
4911 /// The output parameter `devIpiv` contains pivoting sequence. If `devIpiv(i) = k > 0`, `D(i,i)` is 1x1 block, and `i-th` row/column of `A` is interchanged with `k-th` row/column of `A`. If `uplo` is [`cublasFillMode_t::CUBLAS_FILL_MODE_UPPER`] and `devIpiv(i-1) = devIpiv(i) = -m < 0`, `D(i-1:i,i-1:i)` is a 2x2 block, and `(i-1)-th` row/column is interchanged with `m-th` row/column. If `uplo` is [`cublasFillMode_t::CUBLAS_FILL_MODE_LOWER`] and `devIpiv(i+1) = devIpiv(i) = -m < 0`, `D(i:i+1,i:i+1)` is a 2x2 block, and `(i+1)-th` row/column is interchanged with `m-th` row/column.
4912 pub fn cusolverDnCsytrf(
4913 handle: cusolverDnHandle_t,
4914 uplo: cublasFillMode_t,
4915 n: ::core::ffi::c_int,
4916 A: *mut cuComplex,
4917 lda: ::core::ffi::c_int,
4918 ipiv: *mut ::core::ffi::c_int,
4919 work: *mut cuComplex,
4920 lwork: ::core::ffi::c_int,
4921 info: *mut ::core::ffi::c_int,
4922 ) -> cusolverStatus_t;
4923}
4924unsafe extern "C" {
4925 /// These helper functions calculate the size of the needed buffers.
4926 ///
4927 /// The S and D data types are real valued single and double precision, respectively.
4928 ///
4929 /// The C and Z data types are complex valued single and double precision, respectively.
4930 ///
4931 /// This function computes the factorization of a symmetric indefinite matrix using the Bunch-Kaufman diagonal pivoting.
4932 ///
4933 /// `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.
4934 ///
4935 /// 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.
4936 /// $$
4937 /// P\\*A\\*P^{T} = L\\*D\\*L^{T}
4938 /// $$
4939 ///
4940 /// 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`.
4941 /// $$
4942 /// P\\*A\\*P^{T} = U\\*D\\*U^{T}
4943 /// $$
4944 ///
4945 /// The user has to provide working space which is pointed by input parameter `work`. The input parameter `lwork` is size of the working space, and it is returned by `sytrf_bufferSize()`. Please note that the size in bytes of the working space is equal to `sizeof(<type>) * lwork`. When no pivoting is performed, the other triangular part of the input matrix `A` is used as workspace.
4946 ///
4947 /// If Bunch-Kaufman factorization failed, i.e. `A` is singular. The output parameter `devInfo = i` would indicate `D(i,i)=0`.
4948 ///
4949 /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
4950 ///
4951 /// The output parameter `devIpiv` contains pivoting sequence. If `devIpiv(i) = k > 0`, `D(i,i)` is 1x1 block, and `i-th` row/column of `A` is interchanged with `k-th` row/column of `A`. If `uplo` is [`cublasFillMode_t::CUBLAS_FILL_MODE_UPPER`] and `devIpiv(i-1) = devIpiv(i) = -m < 0`, `D(i-1:i,i-1:i)` is a 2x2 block, and `(i-1)-th` row/column is interchanged with `m-th` row/column. If `uplo` is [`cublasFillMode_t::CUBLAS_FILL_MODE_LOWER`] and `devIpiv(i+1) = devIpiv(i) = -m < 0`, `D(i:i+1,i:i+1)` is a 2x2 block, and `(i+1)-th` row/column is interchanged with `m-th` row/column.
4952 pub fn cusolverDnZsytrf(
4953 handle: cusolverDnHandle_t,
4954 uplo: cublasFillMode_t,
4955 n: ::core::ffi::c_int,
4956 A: *mut cuDoubleComplex,
4957 lda: ::core::ffi::c_int,
4958 ipiv: *mut ::core::ffi::c_int,
4959 work: *mut cuDoubleComplex,
4960 lwork: ::core::ffi::c_int,
4961 info: *mut ::core::ffi::c_int,
4962 ) -> cusolverStatus_t;
4963}
4964unsafe extern "C" {
4965 pub fn cusolverDnXsytrs_bufferSize(
4966 handle: cusolverDnHandle_t,
4967 uplo: cublasFillMode_t,
4968 n: i64,
4969 nrhs: i64,
4970 dataTypeA: cudaDataType,
4971 A: *const ::core::ffi::c_void,
4972 lda: i64,
4973 ipiv: *const i64,
4974 dataTypeB: cudaDataType,
4975 B: *mut ::core::ffi::c_void,
4976 ldb: i64,
4977 workspaceInBytesOnDevice: *mut size_t,
4978 workspaceInBytesOnHost: *mut size_t,
4979 ) -> cusolverStatus_t;
4980}
4981unsafe extern "C" {
4982 /// The helper functions below can calculate the sizes needed for pre-allocated buffers.
4983 ///
4984 /// The following routine:
4985 ///
4986 /// solves a system of linear equations using the generic API interface.
4987 ///
4988 /// `A` contains the factorization from `cusolverDn<t>sytrf()`, only lower or upper part is meaningful, the other part is not touched.
4989 ///
4990 /// If input parameter `uplo` is [`cublasFillMode_t::CUBLAS_FILL_MODE_LOWER`], the details of the factorization are stores as:
4991 /// $$
4992 /// A = L\\*D\\*L^{T}
4993 /// $$
4994 ///
4995 /// If input parameter `uplo` is [`cublasFillMode_t::CUBLAS_FILL_MODE_UPPER`], the details of the factorization are stores as:
4996 /// $$
4997 /// A = U\\*D\\*U^{T}
4998 /// $$
4999 ///
5000 /// The user has to provide the pivot indices that can be obtained by `cusolverDn<t>sytrf()` as well as device and host work spaces which are pointed by input parameters `bufferOnDevice` and `bufferOnHost`. The input parameters `workspaceInBytesOnDevice` and `workspaceInBytesOnHost` are sizes in bytes of the device and host work spaces, and they are returned by [`cusolverDnXsytrs_bufferSize`].
5001 /// To factorize and solve the symmetric system without pivoting, the user should set `devIpiv = NULL` when calling `cusolverDn<t>sytrf` and [`cusolverDnXsytrs`].
5002 ///
5003 /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
5004 ///
5005 /// List of input arguments for [`cusolverDnXsytrs_bufferSize`] and [`cusolverDnXsytrs`]:
5006 ///
5007 /// 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:
5008 ///
5009 /// **Valid combination of data type and compute type**
5010 ///
5011 /// | **DataTypeA** | **DataTypeB** | **Meaning** |
5012 /// | --- | --- | --- |
5013 /// | `CUDA_R_32F` | `CUDA_R_32F` | `SSYTRS` |
5014 /// | `CUDA_R_64F` | `CUDA_R_64F` | `DSYTRS` |
5015 /// | `CUDA_C_32F` | `CUDA_C_32F` | `CSYTRS` |
5016 /// | `CUDA_C_64F` | `CUDA_C_64F` | `ZSYTRS` |
5017 ///
5018 /// # Parameters
5019 ///
5020 /// - `handle`: Handle to the cuSolverDN library context.
5021 /// - `uplo`: Indicates if matrix `A` lower or upper part is stored, the other part is not referenced.
5022 /// - `n`: Number of rows and columns of matrix `A`.
5023 /// - `nrhs`: Number of right-hand sides.
5024 /// - `dataTypeA`: Data type of array `A`.
5025 /// - `A`: Array of dimension `lda * n` with `lda` is not less than `max(1,n)`.
5026 /// - `lda`: Leading dimension of two-dimensional array used to store matrix `A`.
5027 /// - `dataTypeB`: Data type of array `B`.
5028 /// - `B`: Array of dimension `ldb * nrhs` with `ldb` is not less than `max(1,nrhs)`.
5029 /// - `ldb`: Leading dimension of two-dimensional array used to store matrix `B`.
5030 /// - `bufferOnDevice`: Device workspace. Array of type `void` of size `workspaceInBytesOnDevice` bytes.
5031 /// - `workspaceInBytesOnDevice`: Size in bytes of `bufferOnDevice`, returned by [`cusolverDnXsytrs_bufferSize`].
5032 /// - `bufferOnHost`: Host workspace. Array of type `void` of size `workspaceInBytesOnHost` bytes.
5033 /// - `workspaceInBytesOnHost`: Size in bytes of `bufferOnHost`, returned by [`cusolverDnXsytrs_bufferSize`].
5034 ///
5035 /// # Return value
5036 ///
5037 /// - [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]: An internal operation failed.
5038 /// - [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]: Invalid parameters were passed (`n<0` or `lda<max(1,n)`).
5039 /// - [`cusolverStatus_t::CUSOLVER_STATUS_MATRIX_TYPE_NOT_SUPPORTED`]: Data type is not supported.
5040 /// - [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]: The library was not initialized.
5041 /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The operation completed successfully.
5042 pub fn cusolverDnXsytrs(
5043 handle: cusolverDnHandle_t,
5044 uplo: cublasFillMode_t,
5045 n: i64,
5046 nrhs: i64,
5047 dataTypeA: cudaDataType,
5048 A: *const ::core::ffi::c_void,
5049 lda: i64,
5050 ipiv: *const i64,
5051 dataTypeB: cudaDataType,
5052 B: *mut ::core::ffi::c_void,
5053 ldb: i64,
5054 bufferOnDevice: *mut ::core::ffi::c_void,
5055 workspaceInBytesOnDevice: size_t,
5056 bufferOnHost: *mut ::core::ffi::c_void,
5057 workspaceInBytesOnHost: size_t,
5058 info: *mut ::core::ffi::c_int,
5059 ) -> cusolverStatus_t;
5060}
5061unsafe extern "C" {
5062 pub fn cusolverDnSsytri_bufferSize(
5063 handle: cusolverDnHandle_t,
5064 uplo: cublasFillMode_t,
5065 n: ::core::ffi::c_int,
5066 A: *mut f32,
5067 lda: ::core::ffi::c_int,
5068 ipiv: *const ::core::ffi::c_int,
5069 lwork: *mut ::core::ffi::c_int,
5070 ) -> cusolverStatus_t;
5071}
5072unsafe extern "C" {
5073 pub fn cusolverDnDsytri_bufferSize(
5074 handle: cusolverDnHandle_t,
5075 uplo: cublasFillMode_t,
5076 n: ::core::ffi::c_int,
5077 A: *mut f64,
5078 lda: ::core::ffi::c_int,
5079 ipiv: *const ::core::ffi::c_int,
5080 lwork: *mut ::core::ffi::c_int,
5081 ) -> cusolverStatus_t;
5082}
5083unsafe extern "C" {
5084 pub fn cusolverDnCsytri_bufferSize(
5085 handle: cusolverDnHandle_t,
5086 uplo: cublasFillMode_t,
5087 n: ::core::ffi::c_int,
5088 A: *mut cuComplex,
5089 lda: ::core::ffi::c_int,
5090 ipiv: *const ::core::ffi::c_int,
5091 lwork: *mut ::core::ffi::c_int,
5092 ) -> cusolverStatus_t;
5093}
5094unsafe extern "C" {
5095 pub fn cusolverDnZsytri_bufferSize(
5096 handle: cusolverDnHandle_t,
5097 uplo: cublasFillMode_t,
5098 n: ::core::ffi::c_int,
5099 A: *mut cuDoubleComplex,
5100 lda: ::core::ffi::c_int,
5101 ipiv: *const ::core::ffi::c_int,
5102 lwork: *mut ::core::ffi::c_int,
5103 ) -> cusolverStatus_t;
5104}
5105unsafe extern "C" {
5106 pub fn cusolverDnSsytri(
5107 handle: cusolverDnHandle_t,
5108 uplo: cublasFillMode_t,
5109 n: ::core::ffi::c_int,
5110 A: *mut f32,
5111 lda: ::core::ffi::c_int,
5112 ipiv: *const ::core::ffi::c_int,
5113 work: *mut f32,
5114 lwork: ::core::ffi::c_int,
5115 info: *mut ::core::ffi::c_int,
5116 ) -> cusolverStatus_t;
5117}
5118unsafe extern "C" {
5119 pub fn cusolverDnDsytri(
5120 handle: cusolverDnHandle_t,
5121 uplo: cublasFillMode_t,
5122 n: ::core::ffi::c_int,
5123 A: *mut f64,
5124 lda: ::core::ffi::c_int,
5125 ipiv: *const ::core::ffi::c_int,
5126 work: *mut f64,
5127 lwork: ::core::ffi::c_int,
5128 info: *mut ::core::ffi::c_int,
5129 ) -> cusolverStatus_t;
5130}
5131unsafe extern "C" {
5132 pub fn cusolverDnCsytri(
5133 handle: cusolverDnHandle_t,
5134 uplo: cublasFillMode_t,
5135 n: ::core::ffi::c_int,
5136 A: *mut cuComplex,
5137 lda: ::core::ffi::c_int,
5138 ipiv: *const ::core::ffi::c_int,
5139 work: *mut cuComplex,
5140 lwork: ::core::ffi::c_int,
5141 info: *mut ::core::ffi::c_int,
5142 ) -> cusolverStatus_t;
5143}
5144unsafe extern "C" {
5145 pub fn cusolverDnZsytri(
5146 handle: cusolverDnHandle_t,
5147 uplo: cublasFillMode_t,
5148 n: ::core::ffi::c_int,
5149 A: *mut cuDoubleComplex,
5150 lda: ::core::ffi::c_int,
5151 ipiv: *const ::core::ffi::c_int,
5152 work: *mut cuDoubleComplex,
5153 lwork: ::core::ffi::c_int,
5154 info: *mut ::core::ffi::c_int,
5155 ) -> cusolverStatus_t;
5156}
5157unsafe extern "C" {
5158 pub fn cusolverDnSgebrd_bufferSize(
5159 handle: cusolverDnHandle_t,
5160 m: ::core::ffi::c_int,
5161 n: ::core::ffi::c_int,
5162 Lwork: *mut ::core::ffi::c_int,
5163 ) -> cusolverStatus_t;
5164}
5165unsafe extern "C" {
5166 pub fn cusolverDnDgebrd_bufferSize(
5167 handle: cusolverDnHandle_t,
5168 m: ::core::ffi::c_int,
5169 n: ::core::ffi::c_int,
5170 Lwork: *mut ::core::ffi::c_int,
5171 ) -> cusolverStatus_t;
5172}
5173unsafe extern "C" {
5174 pub fn cusolverDnCgebrd_bufferSize(
5175 handle: cusolverDnHandle_t,
5176 m: ::core::ffi::c_int,
5177 n: ::core::ffi::c_int,
5178 Lwork: *mut ::core::ffi::c_int,
5179 ) -> cusolverStatus_t;
5180}
5181unsafe extern "C" {
5182 pub fn cusolverDnZgebrd_bufferSize(
5183 handle: cusolverDnHandle_t,
5184 m: ::core::ffi::c_int,
5185 n: ::core::ffi::c_int,
5186 Lwork: *mut ::core::ffi::c_int,
5187 ) -> cusolverStatus_t;
5188}
5189unsafe extern "C" {
5190 /// These helper functions calculate the size of work buffers needed.
5191 ///
5192 /// The S and D data types are real valued single and double precision, respectively.
5193 ///
5194 /// The C and Z data types are complex valued single and double precision, respectively.
5195 ///
5196 /// 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$
5197 ///
5198 /// If `m>=n`, `B` is upper bidiagonal; if `m<n`, `B` is lower bidiagonal.
5199 ///
5200 /// The matrix `Q` and `P` are overwritten into matrix `A` in the following sense:
5201 ///
5202 /// * 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.
5203 /// * if `m<n`, the diagonal and the first subdiagonal are overwritten with the lower bidiagonal matrix `B`; the elements below the first subdiagonal, with the array `TAUQ`, represent the orthogonal matrix `Q` as a product of elementary reflectors, and the elements above the diagonal, with the array `TAUP`, represent the orthogonal matrix `P` as a product of elementary reflectors.
5204 ///
5205 /// 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()`.
5206 ///
5207 /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
5208 ///
5209 /// Remark: `gebrd` only supports `m>=n`.
5210 pub fn cusolverDnSgebrd(
5211 handle: cusolverDnHandle_t,
5212 m: ::core::ffi::c_int,
5213 n: ::core::ffi::c_int,
5214 A: *mut f32,
5215 lda: ::core::ffi::c_int,
5216 D: *mut f32,
5217 E: *mut f32,
5218 TAUQ: *mut f32,
5219 TAUP: *mut f32,
5220 Work: *mut f32,
5221 Lwork: ::core::ffi::c_int,
5222 devInfo: *mut ::core::ffi::c_int,
5223 ) -> cusolverStatus_t;
5224}
5225unsafe extern "C" {
5226 /// These helper functions calculate the size of work buffers needed.
5227 ///
5228 /// The S and D data types are real valued single and double precision, respectively.
5229 ///
5230 /// The C and Z data types are complex valued single and double precision, respectively.
5231 ///
5232 /// 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$
5233 ///
5234 /// If `m>=n`, `B` is upper bidiagonal; if `m<n`, `B` is lower bidiagonal.
5235 ///
5236 /// The matrix `Q` and `P` are overwritten into matrix `A` in the following sense:
5237 ///
5238 /// * 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.
5239 /// * if `m<n`, the diagonal and the first subdiagonal are overwritten with the lower bidiagonal matrix `B`; the elements below the first subdiagonal, with the array `TAUQ`, represent the orthogonal matrix `Q` as a product of elementary reflectors, and the elements above the diagonal, with the array `TAUP`, represent the orthogonal matrix `P` as a product of elementary reflectors.
5240 ///
5241 /// 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()`.
5242 ///
5243 /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
5244 ///
5245 /// Remark: `gebrd` only supports `m>=n`.
5246 pub fn cusolverDnDgebrd(
5247 handle: cusolverDnHandle_t,
5248 m: ::core::ffi::c_int,
5249 n: ::core::ffi::c_int,
5250 A: *mut f64,
5251 lda: ::core::ffi::c_int,
5252 D: *mut f64,
5253 E: *mut f64,
5254 TAUQ: *mut f64,
5255 TAUP: *mut f64,
5256 Work: *mut f64,
5257 Lwork: ::core::ffi::c_int,
5258 devInfo: *mut ::core::ffi::c_int,
5259 ) -> cusolverStatus_t;
5260}
5261unsafe extern "C" {
5262 /// These helper functions calculate the size of work buffers needed.
5263 ///
5264 /// The S and D data types are real valued single and double precision, respectively.
5265 ///
5266 /// The C and Z data types are complex valued single and double precision, respectively.
5267 ///
5268 /// 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$
5269 ///
5270 /// If `m>=n`, `B` is upper bidiagonal; if `m<n`, `B` is lower bidiagonal.
5271 ///
5272 /// The matrix `Q` and `P` are overwritten into matrix `A` in the following sense:
5273 ///
5274 /// * 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.
5275 /// * if `m<n`, the diagonal and the first subdiagonal are overwritten with the lower bidiagonal matrix `B`; the elements below the first subdiagonal, with the array `TAUQ`, represent the orthogonal matrix `Q` as a product of elementary reflectors, and the elements above the diagonal, with the array `TAUP`, represent the orthogonal matrix `P` as a product of elementary reflectors.
5276 ///
5277 /// 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()`.
5278 ///
5279 /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
5280 ///
5281 /// Remark: `gebrd` only supports `m>=n`.
5282 pub fn cusolverDnCgebrd(
5283 handle: cusolverDnHandle_t,
5284 m: ::core::ffi::c_int,
5285 n: ::core::ffi::c_int,
5286 A: *mut cuComplex,
5287 lda: ::core::ffi::c_int,
5288 D: *mut f32,
5289 E: *mut f32,
5290 TAUQ: *mut cuComplex,
5291 TAUP: *mut cuComplex,
5292 Work: *mut cuComplex,
5293 Lwork: ::core::ffi::c_int,
5294 devInfo: *mut ::core::ffi::c_int,
5295 ) -> cusolverStatus_t;
5296}
5297unsafe extern "C" {
5298 /// These helper functions calculate the size of work buffers needed.
5299 ///
5300 /// The S and D data types are real valued single and double precision, respectively.
5301 ///
5302 /// The C and Z data types are complex valued single and double precision, respectively.
5303 ///
5304 /// 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$
5305 ///
5306 /// If `m>=n`, `B` is upper bidiagonal; if `m<n`, `B` is lower bidiagonal.
5307 ///
5308 /// The matrix `Q` and `P` are overwritten into matrix `A` in the following sense:
5309 ///
5310 /// * 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.
5311 /// * if `m<n`, the diagonal and the first subdiagonal are overwritten with the lower bidiagonal matrix `B`; the elements below the first subdiagonal, with the array `TAUQ`, represent the orthogonal matrix `Q` as a product of elementary reflectors, and the elements above the diagonal, with the array `TAUP`, represent the orthogonal matrix `P` as a product of elementary reflectors.
5312 ///
5313 /// 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()`.
5314 ///
5315 /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
5316 ///
5317 /// Remark: `gebrd` only supports `m>=n`.
5318 pub fn cusolverDnZgebrd(
5319 handle: cusolverDnHandle_t,
5320 m: ::core::ffi::c_int,
5321 n: ::core::ffi::c_int,
5322 A: *mut cuDoubleComplex,
5323 lda: ::core::ffi::c_int,
5324 D: *mut f64,
5325 E: *mut f64,
5326 TAUQ: *mut cuDoubleComplex,
5327 TAUP: *mut cuDoubleComplex,
5328 Work: *mut cuDoubleComplex,
5329 Lwork: ::core::ffi::c_int,
5330 devInfo: *mut ::core::ffi::c_int,
5331 ) -> cusolverStatus_t;
5332}
5333unsafe extern "C" {
5334 pub fn cusolverDnSorgbr_bufferSize(
5335 handle: cusolverDnHandle_t,
5336 side: cublasSideMode_t,
5337 m: ::core::ffi::c_int,
5338 n: ::core::ffi::c_int,
5339 k: ::core::ffi::c_int,
5340 A: *const f32,
5341 lda: ::core::ffi::c_int,
5342 tau: *const f32,
5343 lwork: *mut ::core::ffi::c_int,
5344 ) -> cusolverStatus_t;
5345}
5346unsafe extern "C" {
5347 pub fn cusolverDnDorgbr_bufferSize(
5348 handle: cusolverDnHandle_t,
5349 side: cublasSideMode_t,
5350 m: ::core::ffi::c_int,
5351 n: ::core::ffi::c_int,
5352 k: ::core::ffi::c_int,
5353 A: *const f64,
5354 lda: ::core::ffi::c_int,
5355 tau: *const f64,
5356 lwork: *mut ::core::ffi::c_int,
5357 ) -> cusolverStatus_t;
5358}
5359unsafe extern "C" {
5360 pub fn cusolverDnCungbr_bufferSize(
5361 handle: cusolverDnHandle_t,
5362 side: cublasSideMode_t,
5363 m: ::core::ffi::c_int,
5364 n: ::core::ffi::c_int,
5365 k: ::core::ffi::c_int,
5366 A: *const cuComplex,
5367 lda: ::core::ffi::c_int,
5368 tau: *const cuComplex,
5369 lwork: *mut ::core::ffi::c_int,
5370 ) -> cusolverStatus_t;
5371}
5372unsafe extern "C" {
5373 pub fn cusolverDnZungbr_bufferSize(
5374 handle: cusolverDnHandle_t,
5375 side: cublasSideMode_t,
5376 m: ::core::ffi::c_int,
5377 n: ::core::ffi::c_int,
5378 k: ::core::ffi::c_int,
5379 A: *const cuDoubleComplex,
5380 lda: ::core::ffi::c_int,
5381 tau: *const cuDoubleComplex,
5382 lwork: *mut ::core::ffi::c_int,
5383 ) -> cusolverStatus_t;
5384}
5385unsafe extern "C" {
5386 /// These helper functions calculate the size of work buffers needed.
5387 ///
5388 /// The S and D data types are real valued single and double precision, respectively.
5389 ///
5390 /// The C and Z data types are complex valued single and double precision, respectively.
5391 ///
5392 /// 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$
5393 ///
5394 /// `Q` and `P**H` are defined as products of elementary reflectors H(i) or G(i) respectively.
5395 ///
5396 /// The user has to provide working space which is pointed by input parameter `work`. The input parameter `lwork` is size of the working space, and it is returned by `orgbr_bufferSize()`. Please note that the size in bytes of the working space is equal to `sizeof(<type>) * lwork`.
5397 ///
5398 /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
5399 pub fn cusolverDnSorgbr(
5400 handle: cusolverDnHandle_t,
5401 side: cublasSideMode_t,
5402 m: ::core::ffi::c_int,
5403 n: ::core::ffi::c_int,
5404 k: ::core::ffi::c_int,
5405 A: *mut f32,
5406 lda: ::core::ffi::c_int,
5407 tau: *const f32,
5408 work: *mut f32,
5409 lwork: ::core::ffi::c_int,
5410 info: *mut ::core::ffi::c_int,
5411 ) -> cusolverStatus_t;
5412}
5413unsafe extern "C" {
5414 /// These helper functions calculate the size of work buffers needed.
5415 ///
5416 /// The S and D data types are real valued single and double precision, respectively.
5417 ///
5418 /// The C and Z data types are complex valued single and double precision, respectively.
5419 ///
5420 /// 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$
5421 ///
5422 /// `Q` and `P**H` are defined as products of elementary reflectors H(i) or G(i) respectively.
5423 ///
5424 /// The user has to provide working space which is pointed by input parameter `work`. The input parameter `lwork` is size of the working space, and it is returned by `orgbr_bufferSize()`. Please note that the size in bytes of the working space is equal to `sizeof(<type>) * lwork`.
5425 ///
5426 /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
5427 pub fn cusolverDnDorgbr(
5428 handle: cusolverDnHandle_t,
5429 side: cublasSideMode_t,
5430 m: ::core::ffi::c_int,
5431 n: ::core::ffi::c_int,
5432 k: ::core::ffi::c_int,
5433 A: *mut f64,
5434 lda: ::core::ffi::c_int,
5435 tau: *const f64,
5436 work: *mut f64,
5437 lwork: ::core::ffi::c_int,
5438 info: *mut ::core::ffi::c_int,
5439 ) -> cusolverStatus_t;
5440}
5441unsafe extern "C" {
5442 pub fn cusolverDnCungbr(
5443 handle: cusolverDnHandle_t,
5444 side: cublasSideMode_t,
5445 m: ::core::ffi::c_int,
5446 n: ::core::ffi::c_int,
5447 k: ::core::ffi::c_int,
5448 A: *mut cuComplex,
5449 lda: ::core::ffi::c_int,
5450 tau: *const cuComplex,
5451 work: *mut cuComplex,
5452 lwork: ::core::ffi::c_int,
5453 info: *mut ::core::ffi::c_int,
5454 ) -> cusolverStatus_t;
5455}
5456unsafe extern "C" {
5457 pub fn cusolverDnZungbr(
5458 handle: cusolverDnHandle_t,
5459 side: cublasSideMode_t,
5460 m: ::core::ffi::c_int,
5461 n: ::core::ffi::c_int,
5462 k: ::core::ffi::c_int,
5463 A: *mut cuDoubleComplex,
5464 lda: ::core::ffi::c_int,
5465 tau: *const cuDoubleComplex,
5466 work: *mut cuDoubleComplex,
5467 lwork: ::core::ffi::c_int,
5468 info: *mut ::core::ffi::c_int,
5469 ) -> cusolverStatus_t;
5470}
5471unsafe extern "C" {
5472 pub fn cusolverDnSsytrd_bufferSize(
5473 handle: cusolverDnHandle_t,
5474 uplo: cublasFillMode_t,
5475 n: ::core::ffi::c_int,
5476 A: *const f32,
5477 lda: ::core::ffi::c_int,
5478 d: *const f32,
5479 e: *const f32,
5480 tau: *const f32,
5481 lwork: *mut ::core::ffi::c_int,
5482 ) -> cusolverStatus_t;
5483}
5484unsafe extern "C" {
5485 pub fn cusolverDnDsytrd_bufferSize(
5486 handle: cusolverDnHandle_t,
5487 uplo: cublasFillMode_t,
5488 n: ::core::ffi::c_int,
5489 A: *const f64,
5490 lda: ::core::ffi::c_int,
5491 d: *const f64,
5492 e: *const f64,
5493 tau: *const f64,
5494 lwork: *mut ::core::ffi::c_int,
5495 ) -> cusolverStatus_t;
5496}
5497unsafe extern "C" {
5498 pub fn cusolverDnChetrd_bufferSize(
5499 handle: cusolverDnHandle_t,
5500 uplo: cublasFillMode_t,
5501 n: ::core::ffi::c_int,
5502 A: *const cuComplex,
5503 lda: ::core::ffi::c_int,
5504 d: *const f32,
5505 e: *const f32,
5506 tau: *const cuComplex,
5507 lwork: *mut ::core::ffi::c_int,
5508 ) -> cusolverStatus_t;
5509}
5510unsafe extern "C" {
5511 pub fn cusolverDnZhetrd_bufferSize(
5512 handle: cusolverDnHandle_t,
5513 uplo: cublasFillMode_t,
5514 n: ::core::ffi::c_int,
5515 A: *const cuDoubleComplex,
5516 lda: ::core::ffi::c_int,
5517 d: *const f64,
5518 e: *const f64,
5519 tau: *const cuDoubleComplex,
5520 lwork: *mut ::core::ffi::c_int,
5521 ) -> cusolverStatus_t;
5522}
5523unsafe extern "C" {
5524 /// These helper functions calculate the size of work buffers needed.
5525 ///
5526 /// The S and D data types are real valued single and double precision, respectively.
5527 ///
5528 /// The C and Z data types are complex valued single and double precision, respectively.
5529 ///
5530 /// 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$
5531 ///
5532 /// 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.
5533 ///
5534 /// The user has to provide working space which is pointed by input parameter `work`. The input parameter `lwork` is size of the working space, and it is returned by `sytrd_bufferSize()`. Please note that the size in bytes of the working space is equal to `sizeof(<type>) * lwork`.
5535 ///
5536 /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle). Note that the problem size `n` is limited by a condition `n*lda < INT32_MAX` primarily due to the current implementation constraints.
5537 pub fn cusolverDnSsytrd(
5538 handle: cusolverDnHandle_t,
5539 uplo: cublasFillMode_t,
5540 n: ::core::ffi::c_int,
5541 A: *mut f32,
5542 lda: ::core::ffi::c_int,
5543 d: *mut f32,
5544 e: *mut f32,
5545 tau: *mut f32,
5546 work: *mut f32,
5547 lwork: ::core::ffi::c_int,
5548 info: *mut ::core::ffi::c_int,
5549 ) -> cusolverStatus_t;
5550}
5551unsafe extern "C" {
5552 /// These helper functions calculate the size of work buffers needed.
5553 ///
5554 /// The S and D data types are real valued single and double precision, respectively.
5555 ///
5556 /// The C and Z data types are complex valued single and double precision, respectively.
5557 ///
5558 /// 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$
5559 ///
5560 /// 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.
5561 ///
5562 /// The user has to provide working space which is pointed by input parameter `work`. The input parameter `lwork` is size of the working space, and it is returned by `sytrd_bufferSize()`. Please note that the size in bytes of the working space is equal to `sizeof(<type>) * lwork`.
5563 ///
5564 /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle). Note that the problem size `n` is limited by a condition `n*lda < INT32_MAX` primarily due to the current implementation constraints.
5565 pub fn cusolverDnDsytrd(
5566 handle: cusolverDnHandle_t,
5567 uplo: cublasFillMode_t,
5568 n: ::core::ffi::c_int,
5569 A: *mut f64,
5570 lda: ::core::ffi::c_int,
5571 d: *mut f64,
5572 e: *mut f64,
5573 tau: *mut f64,
5574 work: *mut f64,
5575 lwork: ::core::ffi::c_int,
5576 info: *mut ::core::ffi::c_int,
5577 ) -> cusolverStatus_t;
5578}
5579unsafe extern "C" {
5580 pub fn cusolverDnChetrd(
5581 handle: cusolverDnHandle_t,
5582 uplo: cublasFillMode_t,
5583 n: ::core::ffi::c_int,
5584 A: *mut cuComplex,
5585 lda: ::core::ffi::c_int,
5586 d: *mut f32,
5587 e: *mut f32,
5588 tau: *mut cuComplex,
5589 work: *mut cuComplex,
5590 lwork: ::core::ffi::c_int,
5591 info: *mut ::core::ffi::c_int,
5592 ) -> cusolverStatus_t;
5593}
5594unsafe extern "C" {
5595 pub fn cusolverDnZhetrd(
5596 handle: cusolverDnHandle_t,
5597 uplo: cublasFillMode_t,
5598 n: ::core::ffi::c_int,
5599 A: *mut cuDoubleComplex,
5600 lda: ::core::ffi::c_int,
5601 d: *mut f64,
5602 e: *mut f64,
5603 tau: *mut cuDoubleComplex,
5604 work: *mut cuDoubleComplex,
5605 lwork: ::core::ffi::c_int,
5606 info: *mut ::core::ffi::c_int,
5607 ) -> cusolverStatus_t;
5608}
5609unsafe extern "C" {
5610 pub fn cusolverDnSorgtr_bufferSize(
5611 handle: cusolverDnHandle_t,
5612 uplo: cublasFillMode_t,
5613 n: ::core::ffi::c_int,
5614 A: *const f32,
5615 lda: ::core::ffi::c_int,
5616 tau: *const f32,
5617 lwork: *mut ::core::ffi::c_int,
5618 ) -> cusolverStatus_t;
5619}
5620unsafe extern "C" {
5621 pub fn cusolverDnDorgtr_bufferSize(
5622 handle: cusolverDnHandle_t,
5623 uplo: cublasFillMode_t,
5624 n: ::core::ffi::c_int,
5625 A: *const f64,
5626 lda: ::core::ffi::c_int,
5627 tau: *const f64,
5628 lwork: *mut ::core::ffi::c_int,
5629 ) -> cusolverStatus_t;
5630}
5631unsafe extern "C" {
5632 pub fn cusolverDnCungtr_bufferSize(
5633 handle: cusolverDnHandle_t,
5634 uplo: cublasFillMode_t,
5635 n: ::core::ffi::c_int,
5636 A: *const cuComplex,
5637 lda: ::core::ffi::c_int,
5638 tau: *const cuComplex,
5639 lwork: *mut ::core::ffi::c_int,
5640 ) -> cusolverStatus_t;
5641}
5642unsafe extern "C" {
5643 pub fn cusolverDnZungtr_bufferSize(
5644 handle: cusolverDnHandle_t,
5645 uplo: cublasFillMode_t,
5646 n: ::core::ffi::c_int,
5647 A: *const cuDoubleComplex,
5648 lda: ::core::ffi::c_int,
5649 tau: *const cuDoubleComplex,
5650 lwork: *mut ::core::ffi::c_int,
5651 ) -> cusolverStatus_t;
5652}
5653unsafe extern "C" {
5654 /// These helper functions calculate the size of work buffers needed.
5655 ///
5656 /// The S and D data types are real valued single and double precision, respectively.
5657 ///
5658 /// The C and Z data types are complex valued single and double precision, respectively.
5659 ///
5660 /// 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`:
5661 ///
5662 /// The user has to provide working space which is pointed by input parameter `work`. The input parameter `lwork` is size of the working space, and it is returned by `orgtr_bufferSize()`. Please note that the size in bytes of the working space is equal to `sizeof(<type>) * lwork`.
5663 ///
5664 /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
5665 pub fn cusolverDnSorgtr(
5666 handle: cusolverDnHandle_t,
5667 uplo: cublasFillMode_t,
5668 n: ::core::ffi::c_int,
5669 A: *mut f32,
5670 lda: ::core::ffi::c_int,
5671 tau: *const f32,
5672 work: *mut f32,
5673 lwork: ::core::ffi::c_int,
5674 info: *mut ::core::ffi::c_int,
5675 ) -> cusolverStatus_t;
5676}
5677unsafe extern "C" {
5678 /// These helper functions calculate the size of work buffers needed.
5679 ///
5680 /// The S and D data types are real valued single and double precision, respectively.
5681 ///
5682 /// The C and Z data types are complex valued single and double precision, respectively.
5683 ///
5684 /// 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`:
5685 ///
5686 /// The user has to provide working space which is pointed by input parameter `work`. The input parameter `lwork` is size of the working space, and it is returned by `orgtr_bufferSize()`. Please note that the size in bytes of the working space is equal to `sizeof(<type>) * lwork`.
5687 ///
5688 /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
5689 pub fn cusolverDnDorgtr(
5690 handle: cusolverDnHandle_t,
5691 uplo: cublasFillMode_t,
5692 n: ::core::ffi::c_int,
5693 A: *mut f64,
5694 lda: ::core::ffi::c_int,
5695 tau: *const f64,
5696 work: *mut f64,
5697 lwork: ::core::ffi::c_int,
5698 info: *mut ::core::ffi::c_int,
5699 ) -> cusolverStatus_t;
5700}
5701unsafe extern "C" {
5702 pub fn cusolverDnCungtr(
5703 handle: cusolverDnHandle_t,
5704 uplo: cublasFillMode_t,
5705 n: ::core::ffi::c_int,
5706 A: *mut cuComplex,
5707 lda: ::core::ffi::c_int,
5708 tau: *const cuComplex,
5709 work: *mut cuComplex,
5710 lwork: ::core::ffi::c_int,
5711 info: *mut ::core::ffi::c_int,
5712 ) -> cusolverStatus_t;
5713}
5714unsafe extern "C" {
5715 pub fn cusolverDnZungtr(
5716 handle: cusolverDnHandle_t,
5717 uplo: cublasFillMode_t,
5718 n: ::core::ffi::c_int,
5719 A: *mut cuDoubleComplex,
5720 lda: ::core::ffi::c_int,
5721 tau: *const cuDoubleComplex,
5722 work: *mut cuDoubleComplex,
5723 lwork: ::core::ffi::c_int,
5724 info: *mut ::core::ffi::c_int,
5725 ) -> cusolverStatus_t;
5726}
5727unsafe extern "C" {
5728 pub fn cusolverDnSormtr_bufferSize(
5729 handle: cusolverDnHandle_t,
5730 side: cublasSideMode_t,
5731 uplo: cublasFillMode_t,
5732 trans: cublasOperation_t,
5733 m: ::core::ffi::c_int,
5734 n: ::core::ffi::c_int,
5735 A: *const f32,
5736 lda: ::core::ffi::c_int,
5737 tau: *const f32,
5738 C: *const f32,
5739 ldc: ::core::ffi::c_int,
5740 lwork: *mut ::core::ffi::c_int,
5741 ) -> cusolverStatus_t;
5742}
5743unsafe extern "C" {
5744 pub fn cusolverDnDormtr_bufferSize(
5745 handle: cusolverDnHandle_t,
5746 side: cublasSideMode_t,
5747 uplo: cublasFillMode_t,
5748 trans: cublasOperation_t,
5749 m: ::core::ffi::c_int,
5750 n: ::core::ffi::c_int,
5751 A: *const f64,
5752 lda: ::core::ffi::c_int,
5753 tau: *const f64,
5754 C: *const f64,
5755 ldc: ::core::ffi::c_int,
5756 lwork: *mut ::core::ffi::c_int,
5757 ) -> cusolverStatus_t;
5758}
5759unsafe extern "C" {
5760 pub fn cusolverDnCunmtr_bufferSize(
5761 handle: cusolverDnHandle_t,
5762 side: cublasSideMode_t,
5763 uplo: cublasFillMode_t,
5764 trans: cublasOperation_t,
5765 m: ::core::ffi::c_int,
5766 n: ::core::ffi::c_int,
5767 A: *const cuComplex,
5768 lda: ::core::ffi::c_int,
5769 tau: *const cuComplex,
5770 C: *const cuComplex,
5771 ldc: ::core::ffi::c_int,
5772 lwork: *mut ::core::ffi::c_int,
5773 ) -> cusolverStatus_t;
5774}
5775unsafe extern "C" {
5776 pub fn cusolverDnZunmtr_bufferSize(
5777 handle: cusolverDnHandle_t,
5778 side: cublasSideMode_t,
5779 uplo: cublasFillMode_t,
5780 trans: cublasOperation_t,
5781 m: ::core::ffi::c_int,
5782 n: ::core::ffi::c_int,
5783 A: *const cuDoubleComplex,
5784 lda: ::core::ffi::c_int,
5785 tau: *const cuDoubleComplex,
5786 C: *const cuDoubleComplex,
5787 ldc: ::core::ffi::c_int,
5788 lwork: *mut ::core::ffi::c_int,
5789 ) -> cusolverStatus_t;
5790}
5791unsafe extern "C" {
5792 /// These helper functions calculate the size of work buffers needed.
5793 ///
5794 /// The S and D data types are real valued single and double precision, respectively.
5795 ///
5796 /// The C and Z data types are complex valued single and double precision, respectively.
5797 ///
5798 /// This function overwrites $m \times n$ matrix `C` by:
5799 /// $$
5800 /// C =
5801 /// \begin{cases}
5802 /// \operatorname{op}(Q) * C & \text{if } side = \text{CUBLAS_SIDE_LEFT} \\
5803 /// C * \operatorname{op}(Q) & \text{if } side = \text{CUBLAS_SIDE_RIGHT}
5804 /// \end{cases}
5805 /// $$
5806 ///
5807 /// where `Q` is a unitary matrix formed by a sequence of elementary reflection vectors from `sytrd`.
5808 ///
5809 /// The operation on `Q` is defined by:
5810 /// $$
5811 /// \operatorname{op}(Q) =
5812 /// \begin{cases}
5813 /// Q & \text{if } transa = \text{CUBLAS_OP_N} \\
5814 /// Q^T & \text{if } transa = \text{CUBLAS_OP_T} \\
5815 /// Q^H & \text{if } transa = \text{CUBLAS_OP_C}
5816 /// \end{cases}
5817 /// $$
5818 ///
5819 /// The user has to provide working space which is pointed by input parameter `work`. The input parameter `lwork` is size of the working space, and it is returned by `ormtr_bufferSize()`. Please note that the size in bytes of the working space is equal to `sizeof(<type>) * lwork`.
5820 ///
5821 /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
5822 pub fn cusolverDnSormtr(
5823 handle: cusolverDnHandle_t,
5824 side: cublasSideMode_t,
5825 uplo: cublasFillMode_t,
5826 trans: cublasOperation_t,
5827 m: ::core::ffi::c_int,
5828 n: ::core::ffi::c_int,
5829 A: *mut f32,
5830 lda: ::core::ffi::c_int,
5831 tau: *mut f32,
5832 C: *mut f32,
5833 ldc: ::core::ffi::c_int,
5834 work: *mut f32,
5835 lwork: ::core::ffi::c_int,
5836 info: *mut ::core::ffi::c_int,
5837 ) -> cusolverStatus_t;
5838}
5839unsafe extern "C" {
5840 /// These helper functions calculate the size of work buffers needed.
5841 ///
5842 /// The S and D data types are real valued single and double precision, respectively.
5843 ///
5844 /// The C and Z data types are complex valued single and double precision, respectively.
5845 ///
5846 /// This function overwrites $m \times n$ matrix `C` by:
5847 /// $$
5848 /// C =
5849 /// \begin{cases}
5850 /// \operatorname{op}(Q) * C & \text{if } side = \text{CUBLAS_SIDE_LEFT} \\
5851 /// C * \operatorname{op}(Q) & \text{if } side = \text{CUBLAS_SIDE_RIGHT}
5852 /// \end{cases}
5853 /// $$
5854 ///
5855 /// where `Q` is a unitary matrix formed by a sequence of elementary reflection vectors from `sytrd`.
5856 ///
5857 /// The operation on `Q` is defined by:
5858 /// $$
5859 /// \operatorname{op}(Q) =
5860 /// \begin{cases}
5861 /// Q & \text{if } transa = \text{CUBLAS_OP_N} \\
5862 /// Q^T & \text{if } transa = \text{CUBLAS_OP_T} \\
5863 /// Q^H & \text{if } transa = \text{CUBLAS_OP_C}
5864 /// \end{cases}
5865 /// $$
5866 ///
5867 /// The user has to provide working space which is pointed by input parameter `work`. The input parameter `lwork` is size of the working space, and it is returned by `ormtr_bufferSize()`. Please note that the size in bytes of the working space is equal to `sizeof(<type>) * lwork`.
5868 ///
5869 /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
5870 pub fn cusolverDnDormtr(
5871 handle: cusolverDnHandle_t,
5872 side: cublasSideMode_t,
5873 uplo: cublasFillMode_t,
5874 trans: cublasOperation_t,
5875 m: ::core::ffi::c_int,
5876 n: ::core::ffi::c_int,
5877 A: *mut f64,
5878 lda: ::core::ffi::c_int,
5879 tau: *mut f64,
5880 C: *mut f64,
5881 ldc: ::core::ffi::c_int,
5882 work: *mut f64,
5883 lwork: ::core::ffi::c_int,
5884 info: *mut ::core::ffi::c_int,
5885 ) -> cusolverStatus_t;
5886}
5887unsafe extern "C" {
5888 pub fn cusolverDnCunmtr(
5889 handle: cusolverDnHandle_t,
5890 side: cublasSideMode_t,
5891 uplo: cublasFillMode_t,
5892 trans: cublasOperation_t,
5893 m: ::core::ffi::c_int,
5894 n: ::core::ffi::c_int,
5895 A: *mut cuComplex,
5896 lda: ::core::ffi::c_int,
5897 tau: *mut cuComplex,
5898 C: *mut cuComplex,
5899 ldc: ::core::ffi::c_int,
5900 work: *mut cuComplex,
5901 lwork: ::core::ffi::c_int,
5902 info: *mut ::core::ffi::c_int,
5903 ) -> cusolverStatus_t;
5904}
5905unsafe extern "C" {
5906 pub fn cusolverDnZunmtr(
5907 handle: cusolverDnHandle_t,
5908 side: cublasSideMode_t,
5909 uplo: cublasFillMode_t,
5910 trans: cublasOperation_t,
5911 m: ::core::ffi::c_int,
5912 n: ::core::ffi::c_int,
5913 A: *mut cuDoubleComplex,
5914 lda: ::core::ffi::c_int,
5915 tau: *mut cuDoubleComplex,
5916 C: *mut cuDoubleComplex,
5917 ldc: ::core::ffi::c_int,
5918 work: *mut cuDoubleComplex,
5919 lwork: ::core::ffi::c_int,
5920 info: *mut ::core::ffi::c_int,
5921 ) -> cusolverStatus_t;
5922}
5923unsafe extern "C" {
5924 pub fn cusolverDnSgesvd_bufferSize(
5925 handle: cusolverDnHandle_t,
5926 m: ::core::ffi::c_int,
5927 n: ::core::ffi::c_int,
5928 lwork: *mut ::core::ffi::c_int,
5929 ) -> cusolverStatus_t;
5930}
5931unsafe extern "C" {
5932 pub fn cusolverDnDgesvd_bufferSize(
5933 handle: cusolverDnHandle_t,
5934 m: ::core::ffi::c_int,
5935 n: ::core::ffi::c_int,
5936 lwork: *mut ::core::ffi::c_int,
5937 ) -> cusolverStatus_t;
5938}
5939unsafe extern "C" {
5940 pub fn cusolverDnCgesvd_bufferSize(
5941 handle: cusolverDnHandle_t,
5942 m: ::core::ffi::c_int,
5943 n: ::core::ffi::c_int,
5944 lwork: *mut ::core::ffi::c_int,
5945 ) -> cusolverStatus_t;
5946}
5947unsafe extern "C" {
5948 pub fn cusolverDnZgesvd_bufferSize(
5949 handle: cusolverDnHandle_t,
5950 m: ::core::ffi::c_int,
5951 n: ::core::ffi::c_int,
5952 lwork: *mut ::core::ffi::c_int,
5953 ) -> cusolverStatus_t;
5954}
5955unsafe extern "C" {
5956 /// The helper functions below can calculate the sizes needed for pre-allocated buffer.
5957 ///
5958 /// The S and D data types are real valued single and double precision, respectively.
5959 ///
5960 /// The C and Z data types are complex valued single and double precision, respectively.
5961 ///
5962 /// 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:
5963 /// $$
5964 /// A = U\\*\Sigma\\*V^{H}
5965 /// $$
5966 ///
5967 /// 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`.
5968 ///
5969 /// The user has to provide working space which is pointed by input parameter `work`. The input parameter `lwork` is size of the working space, and it is returned by `gesvd_bufferSize()`. Please note that the size in bytes of the working space is equal to `sizeof(<type>) * lwork`.
5970 ///
5971 /// 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.
5972 ///
5973 /// 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.
5974 ///
5975 /// Please visit [cuSOLVER Library Samples - gesvd](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/gesvd) for a code example.
5976 ///
5977 /// Remark 1: `gesvd` only supports `m>=n`.
5978 ///
5979 /// Remark 2: the routine returns $V^{H}$, not `V`.
5980 pub fn cusolverDnSgesvd(
5981 handle: cusolverDnHandle_t,
5982 jobu: ::core::ffi::c_schar,
5983 jobvt: ::core::ffi::c_schar,
5984 m: ::core::ffi::c_int,
5985 n: ::core::ffi::c_int,
5986 A: *mut f32,
5987 lda: ::core::ffi::c_int,
5988 S: *mut f32,
5989 U: *mut f32,
5990 ldu: ::core::ffi::c_int,
5991 VT: *mut f32,
5992 ldvt: ::core::ffi::c_int,
5993 work: *mut f32,
5994 lwork: ::core::ffi::c_int,
5995 rwork: *mut f32,
5996 info: *mut ::core::ffi::c_int,
5997 ) -> cusolverStatus_t;
5998}
5999unsafe extern "C" {
6000 /// The helper functions below can calculate the sizes needed for pre-allocated buffer.
6001 ///
6002 /// The S and D data types are real valued single and double precision, respectively.
6003 ///
6004 /// The C and Z data types are complex valued single and double precision, respectively.
6005 ///
6006 /// 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:
6007 /// $$
6008 /// A = U\\*\Sigma\\*V^{H}
6009 /// $$
6010 ///
6011 /// 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`.
6012 ///
6013 /// The user has to provide working space which is pointed by input parameter `work`. The input parameter `lwork` is size of the working space, and it is returned by `gesvd_bufferSize()`. Please note that the size in bytes of the working space is equal to `sizeof(<type>) * lwork`.
6014 ///
6015 /// 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.
6016 ///
6017 /// 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.
6018 ///
6019 /// Please visit [cuSOLVER Library Samples - gesvd](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/gesvd) for a code example.
6020 ///
6021 /// Remark 1: `gesvd` only supports `m>=n`.
6022 ///
6023 /// Remark 2: the routine returns $V^{H}$, not `V`.
6024 pub fn cusolverDnDgesvd(
6025 handle: cusolverDnHandle_t,
6026 jobu: ::core::ffi::c_schar,
6027 jobvt: ::core::ffi::c_schar,
6028 m: ::core::ffi::c_int,
6029 n: ::core::ffi::c_int,
6030 A: *mut f64,
6031 lda: ::core::ffi::c_int,
6032 S: *mut f64,
6033 U: *mut f64,
6034 ldu: ::core::ffi::c_int,
6035 VT: *mut f64,
6036 ldvt: ::core::ffi::c_int,
6037 work: *mut f64,
6038 lwork: ::core::ffi::c_int,
6039 rwork: *mut f64,
6040 info: *mut ::core::ffi::c_int,
6041 ) -> cusolverStatus_t;
6042}
6043unsafe extern "C" {
6044 /// The helper functions below can calculate the sizes needed for pre-allocated buffer.
6045 ///
6046 /// The S and D data types are real valued single and double precision, respectively.
6047 ///
6048 /// The C and Z data types are complex valued single and double precision, respectively.
6049 ///
6050 /// 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:
6051 /// $$
6052 /// A = U\\*\Sigma\\*V^{H}
6053 /// $$
6054 ///
6055 /// 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`.
6056 ///
6057 /// The user has to provide working space which is pointed by input parameter `work`. The input parameter `lwork` is size of the working space, and it is returned by `gesvd_bufferSize()`. Please note that the size in bytes of the working space is equal to `sizeof(<type>) * lwork`.
6058 ///
6059 /// 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.
6060 ///
6061 /// 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.
6062 ///
6063 /// Please visit [cuSOLVER Library Samples - gesvd](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/gesvd) for a code example.
6064 ///
6065 /// Remark 1: `gesvd` only supports `m>=n`.
6066 ///
6067 /// Remark 2: the routine returns $V^{H}$, not `V`.
6068 pub fn cusolverDnCgesvd(
6069 handle: cusolverDnHandle_t,
6070 jobu: ::core::ffi::c_schar,
6071 jobvt: ::core::ffi::c_schar,
6072 m: ::core::ffi::c_int,
6073 n: ::core::ffi::c_int,
6074 A: *mut cuComplex,
6075 lda: ::core::ffi::c_int,
6076 S: *mut f32,
6077 U: *mut cuComplex,
6078 ldu: ::core::ffi::c_int,
6079 VT: *mut cuComplex,
6080 ldvt: ::core::ffi::c_int,
6081 work: *mut cuComplex,
6082 lwork: ::core::ffi::c_int,
6083 rwork: *mut f32,
6084 info: *mut ::core::ffi::c_int,
6085 ) -> cusolverStatus_t;
6086}
6087unsafe extern "C" {
6088 /// The helper functions below can calculate the sizes needed for pre-allocated buffer.
6089 ///
6090 /// The S and D data types are real valued single and double precision, respectively.
6091 ///
6092 /// The C and Z data types are complex valued single and double precision, respectively.
6093 ///
6094 /// 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:
6095 /// $$
6096 /// A = U\\*\Sigma\\*V^{H}
6097 /// $$
6098 ///
6099 /// 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`.
6100 ///
6101 /// The user has to provide working space which is pointed by input parameter `work`. The input parameter `lwork` is size of the working space, and it is returned by `gesvd_bufferSize()`. Please note that the size in bytes of the working space is equal to `sizeof(<type>) * lwork`.
6102 ///
6103 /// 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.
6104 ///
6105 /// 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.
6106 ///
6107 /// Please visit [cuSOLVER Library Samples - gesvd](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/gesvd) for a code example.
6108 ///
6109 /// Remark 1: `gesvd` only supports `m>=n`.
6110 ///
6111 /// Remark 2: the routine returns $V^{H}$, not `V`.
6112 pub fn cusolverDnZgesvd(
6113 handle: cusolverDnHandle_t,
6114 jobu: ::core::ffi::c_schar,
6115 jobvt: ::core::ffi::c_schar,
6116 m: ::core::ffi::c_int,
6117 n: ::core::ffi::c_int,
6118 A: *mut cuDoubleComplex,
6119 lda: ::core::ffi::c_int,
6120 S: *mut f64,
6121 U: *mut cuDoubleComplex,
6122 ldu: ::core::ffi::c_int,
6123 VT: *mut cuDoubleComplex,
6124 ldvt: ::core::ffi::c_int,
6125 work: *mut cuDoubleComplex,
6126 lwork: ::core::ffi::c_int,
6127 rwork: *mut f64,
6128 info: *mut ::core::ffi::c_int,
6129 ) -> cusolverStatus_t;
6130}
6131unsafe extern "C" {
6132 pub fn cusolverDnSsyevd_bufferSize(
6133 handle: cusolverDnHandle_t,
6134 jobz: cusolverEigMode_t,
6135 uplo: cublasFillMode_t,
6136 n: ::core::ffi::c_int,
6137 A: *const f32,
6138 lda: ::core::ffi::c_int,
6139 W: *const f32,
6140 lwork: *mut ::core::ffi::c_int,
6141 ) -> cusolverStatus_t;
6142}
6143unsafe extern "C" {
6144 pub fn cusolverDnDsyevd_bufferSize(
6145 handle: cusolverDnHandle_t,
6146 jobz: cusolverEigMode_t,
6147 uplo: cublasFillMode_t,
6148 n: ::core::ffi::c_int,
6149 A: *const f64,
6150 lda: ::core::ffi::c_int,
6151 W: *const f64,
6152 lwork: *mut ::core::ffi::c_int,
6153 ) -> cusolverStatus_t;
6154}
6155unsafe extern "C" {
6156 pub fn cusolverDnCheevd_bufferSize(
6157 handle: cusolverDnHandle_t,
6158 jobz: cusolverEigMode_t,
6159 uplo: cublasFillMode_t,
6160 n: ::core::ffi::c_int,
6161 A: *const cuComplex,
6162 lda: ::core::ffi::c_int,
6163 W: *const f32,
6164 lwork: *mut ::core::ffi::c_int,
6165 ) -> cusolverStatus_t;
6166}
6167unsafe extern "C" {
6168 pub fn cusolverDnZheevd_bufferSize(
6169 handle: cusolverDnHandle_t,
6170 jobz: cusolverEigMode_t,
6171 uplo: cublasFillMode_t,
6172 n: ::core::ffi::c_int,
6173 A: *const cuDoubleComplex,
6174 lda: ::core::ffi::c_int,
6175 W: *const f64,
6176 lwork: *mut ::core::ffi::c_int,
6177 ) -> cusolverStatus_t;
6178}
6179unsafe extern "C" {
6180 /// The helper functions below can calculate the sizes needed for pre-allocated buffer.
6181 ///
6182 /// The S and D data types are real valued single and double precision, respectively.
6183 ///
6184 /// The C and Z data types are complex valued single and double precision, respectively.
6185 ///
6186 /// This function computes eigenvalues and eigenvectors of a symmetric (Hermitian) $n \times n$ matrix `A`. The standard symmetric eigenvalue problem is:
6187 /// $$
6188 /// A\\*V = V\\*\Lambda
6189 /// $$
6190 ///
6191 /// 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.
6192 ///
6193 /// The user has to provide working space which is pointed by input parameter `work`. The input parameter `lwork` is size of the working space, and it is returned by `syevd_bufferSize()`. Please note that the size in bytes of the working space is equal to `sizeof(<type>) * lwork`.
6194 ///
6195 /// 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.
6196 ///
6197 /// 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.
6198 ///
6199 /// Please visit [cuSOLVER Library Samples - syevd](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/syevd) for a code example.
6200 pub fn cusolverDnSsyevd(
6201 handle: cusolverDnHandle_t,
6202 jobz: cusolverEigMode_t,
6203 uplo: cublasFillMode_t,
6204 n: ::core::ffi::c_int,
6205 A: *mut f32,
6206 lda: ::core::ffi::c_int,
6207 W: *mut f32,
6208 work: *mut f32,
6209 lwork: ::core::ffi::c_int,
6210 info: *mut ::core::ffi::c_int,
6211 ) -> cusolverStatus_t;
6212}
6213unsafe extern "C" {
6214 /// The helper functions below can calculate the sizes needed for pre-allocated buffer.
6215 ///
6216 /// The S and D data types are real valued single and double precision, respectively.
6217 ///
6218 /// The C and Z data types are complex valued single and double precision, respectively.
6219 ///
6220 /// This function computes eigenvalues and eigenvectors of a symmetric (Hermitian) $n \times n$ matrix `A`. The standard symmetric eigenvalue problem is:
6221 /// $$
6222 /// A\\*V = V\\*\Lambda
6223 /// $$
6224 ///
6225 /// 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.
6226 ///
6227 /// The user has to provide working space which is pointed by input parameter `work`. The input parameter `lwork` is size of the working space, and it is returned by `syevd_bufferSize()`. Please note that the size in bytes of the working space is equal to `sizeof(<type>) * lwork`.
6228 ///
6229 /// 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.
6230 ///
6231 /// 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.
6232 ///
6233 /// Please visit [cuSOLVER Library Samples - syevd](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/syevd) for a code example.
6234 pub fn cusolverDnDsyevd(
6235 handle: cusolverDnHandle_t,
6236 jobz: cusolverEigMode_t,
6237 uplo: cublasFillMode_t,
6238 n: ::core::ffi::c_int,
6239 A: *mut f64,
6240 lda: ::core::ffi::c_int,
6241 W: *mut f64,
6242 work: *mut f64,
6243 lwork: ::core::ffi::c_int,
6244 info: *mut ::core::ffi::c_int,
6245 ) -> cusolverStatus_t;
6246}
6247unsafe extern "C" {
6248 pub fn cusolverDnCheevd(
6249 handle: cusolverDnHandle_t,
6250 jobz: cusolverEigMode_t,
6251 uplo: cublasFillMode_t,
6252 n: ::core::ffi::c_int,
6253 A: *mut cuComplex,
6254 lda: ::core::ffi::c_int,
6255 W: *mut f32,
6256 work: *mut cuComplex,
6257 lwork: ::core::ffi::c_int,
6258 info: *mut ::core::ffi::c_int,
6259 ) -> cusolverStatus_t;
6260}
6261unsafe extern "C" {
6262 pub fn cusolverDnZheevd(
6263 handle: cusolverDnHandle_t,
6264 jobz: cusolverEigMode_t,
6265 uplo: cublasFillMode_t,
6266 n: ::core::ffi::c_int,
6267 A: *mut cuDoubleComplex,
6268 lda: ::core::ffi::c_int,
6269 W: *mut f64,
6270 work: *mut cuDoubleComplex,
6271 lwork: ::core::ffi::c_int,
6272 info: *mut ::core::ffi::c_int,
6273 ) -> cusolverStatus_t;
6274}
6275unsafe extern "C" {
6276 pub fn cusolverDnSsyevdx_bufferSize(
6277 handle: cusolverDnHandle_t,
6278 jobz: cusolverEigMode_t,
6279 range: cusolverEigRange_t,
6280 uplo: cublasFillMode_t,
6281 n: ::core::ffi::c_int,
6282 A: *const f32,
6283 lda: ::core::ffi::c_int,
6284 vl: f32,
6285 vu: f32,
6286 il: ::core::ffi::c_int,
6287 iu: ::core::ffi::c_int,
6288 meig: *mut ::core::ffi::c_int,
6289 W: *const f32,
6290 lwork: *mut ::core::ffi::c_int,
6291 ) -> cusolverStatus_t;
6292}
6293unsafe extern "C" {
6294 pub fn cusolverDnDsyevdx_bufferSize(
6295 handle: cusolverDnHandle_t,
6296 jobz: cusolverEigMode_t,
6297 range: cusolverEigRange_t,
6298 uplo: cublasFillMode_t,
6299 n: ::core::ffi::c_int,
6300 A: *const f64,
6301 lda: ::core::ffi::c_int,
6302 vl: f64,
6303 vu: f64,
6304 il: ::core::ffi::c_int,
6305 iu: ::core::ffi::c_int,
6306 meig: *mut ::core::ffi::c_int,
6307 W: *const f64,
6308 lwork: *mut ::core::ffi::c_int,
6309 ) -> cusolverStatus_t;
6310}
6311unsafe extern "C" {
6312 pub fn cusolverDnCheevdx_bufferSize(
6313 handle: cusolverDnHandle_t,
6314 jobz: cusolverEigMode_t,
6315 range: cusolverEigRange_t,
6316 uplo: cublasFillMode_t,
6317 n: ::core::ffi::c_int,
6318 A: *const cuComplex,
6319 lda: ::core::ffi::c_int,
6320 vl: f32,
6321 vu: f32,
6322 il: ::core::ffi::c_int,
6323 iu: ::core::ffi::c_int,
6324 meig: *mut ::core::ffi::c_int,
6325 W: *const f32,
6326 lwork: *mut ::core::ffi::c_int,
6327 ) -> cusolverStatus_t;
6328}
6329unsafe extern "C" {
6330 pub fn cusolverDnZheevdx_bufferSize(
6331 handle: cusolverDnHandle_t,
6332 jobz: cusolverEigMode_t,
6333 range: cusolverEigRange_t,
6334 uplo: cublasFillMode_t,
6335 n: ::core::ffi::c_int,
6336 A: *const cuDoubleComplex,
6337 lda: ::core::ffi::c_int,
6338 vl: f64,
6339 vu: f64,
6340 il: ::core::ffi::c_int,
6341 iu: ::core::ffi::c_int,
6342 meig: *mut ::core::ffi::c_int,
6343 W: *const f64,
6344 lwork: *mut ::core::ffi::c_int,
6345 ) -> cusolverStatus_t;
6346}
6347unsafe extern "C" {
6348 /// The helper functions below can calculate the sizes needed for pre-allocated buffer.
6349 ///
6350 /// The S and D data types are real valued single and double precision, respectively.
6351 ///
6352 /// The C and Z data types are complex valued single and double precision, respectively.
6353 ///
6354 /// 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:
6355 /// $$
6356 /// A\\*V = V\\*\Lambda
6357 /// $$
6358 ///
6359 /// 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.
6360 ///
6361 /// The user has to provide working space which is pointed by input parameter `work`. The input parameter `lwork` is size of the working space, and it is returned by `syevdx_bufferSize()`. Please note that the size in bytes of the working space is equal to `sizeof(<type>) * lwork`.
6362 ///
6363 /// 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.
6364 ///
6365 /// 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.
6366 ///
6367 /// Please visit [cuSOLVER Library Samples - syevdx](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/syevdx) for a code example.
6368 pub fn cusolverDnSsyevdx(
6369 handle: cusolverDnHandle_t,
6370 jobz: cusolverEigMode_t,
6371 range: cusolverEigRange_t,
6372 uplo: cublasFillMode_t,
6373 n: ::core::ffi::c_int,
6374 A: *mut f32,
6375 lda: ::core::ffi::c_int,
6376 vl: f32,
6377 vu: f32,
6378 il: ::core::ffi::c_int,
6379 iu: ::core::ffi::c_int,
6380 meig: *mut ::core::ffi::c_int,
6381 W: *mut f32,
6382 work: *mut f32,
6383 lwork: ::core::ffi::c_int,
6384 info: *mut ::core::ffi::c_int,
6385 ) -> cusolverStatus_t;
6386}
6387unsafe extern "C" {
6388 /// The helper functions below can calculate the sizes needed for pre-allocated buffer.
6389 ///
6390 /// The S and D data types are real valued single and double precision, respectively.
6391 ///
6392 /// The C and Z data types are complex valued single and double precision, respectively.
6393 ///
6394 /// 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:
6395 /// $$
6396 /// A\\*V = V\\*\Lambda
6397 /// $$
6398 ///
6399 /// 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.
6400 ///
6401 /// The user has to provide working space which is pointed by input parameter `work`. The input parameter `lwork` is size of the working space, and it is returned by `syevdx_bufferSize()`. Please note that the size in bytes of the working space is equal to `sizeof(<type>) * lwork`.
6402 ///
6403 /// 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.
6404 ///
6405 /// 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.
6406 ///
6407 /// Please visit [cuSOLVER Library Samples - syevdx](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/syevdx) for a code example.
6408 pub fn cusolverDnDsyevdx(
6409 handle: cusolverDnHandle_t,
6410 jobz: cusolverEigMode_t,
6411 range: cusolverEigRange_t,
6412 uplo: cublasFillMode_t,
6413 n: ::core::ffi::c_int,
6414 A: *mut f64,
6415 lda: ::core::ffi::c_int,
6416 vl: f64,
6417 vu: f64,
6418 il: ::core::ffi::c_int,
6419 iu: ::core::ffi::c_int,
6420 meig: *mut ::core::ffi::c_int,
6421 W: *mut f64,
6422 work: *mut f64,
6423 lwork: ::core::ffi::c_int,
6424 info: *mut ::core::ffi::c_int,
6425 ) -> cusolverStatus_t;
6426}
6427unsafe extern "C" {
6428 pub fn cusolverDnCheevdx(
6429 handle: cusolverDnHandle_t,
6430 jobz: cusolverEigMode_t,
6431 range: cusolverEigRange_t,
6432 uplo: cublasFillMode_t,
6433 n: ::core::ffi::c_int,
6434 A: *mut cuComplex,
6435 lda: ::core::ffi::c_int,
6436 vl: f32,
6437 vu: f32,
6438 il: ::core::ffi::c_int,
6439 iu: ::core::ffi::c_int,
6440 meig: *mut ::core::ffi::c_int,
6441 W: *mut f32,
6442 work: *mut cuComplex,
6443 lwork: ::core::ffi::c_int,
6444 info: *mut ::core::ffi::c_int,
6445 ) -> cusolverStatus_t;
6446}
6447unsafe extern "C" {
6448 pub fn cusolverDnZheevdx(
6449 handle: cusolverDnHandle_t,
6450 jobz: cusolverEigMode_t,
6451 range: cusolverEigRange_t,
6452 uplo: cublasFillMode_t,
6453 n: ::core::ffi::c_int,
6454 A: *mut cuDoubleComplex,
6455 lda: ::core::ffi::c_int,
6456 vl: f64,
6457 vu: f64,
6458 il: ::core::ffi::c_int,
6459 iu: ::core::ffi::c_int,
6460 meig: *mut ::core::ffi::c_int,
6461 W: *mut f64,
6462 work: *mut cuDoubleComplex,
6463 lwork: ::core::ffi::c_int,
6464 info: *mut ::core::ffi::c_int,
6465 ) -> cusolverStatus_t;
6466}
6467unsafe extern "C" {
6468 pub fn cusolverDnSsygvdx_bufferSize(
6469 handle: cusolverDnHandle_t,
6470 itype: cusolverEigType_t,
6471 jobz: cusolverEigMode_t,
6472 range: cusolverEigRange_t,
6473 uplo: cublasFillMode_t,
6474 n: ::core::ffi::c_int,
6475 A: *const f32,
6476 lda: ::core::ffi::c_int,
6477 B: *const f32,
6478 ldb: ::core::ffi::c_int,
6479 vl: f32,
6480 vu: f32,
6481 il: ::core::ffi::c_int,
6482 iu: ::core::ffi::c_int,
6483 meig: *mut ::core::ffi::c_int,
6484 W: *const f32,
6485 lwork: *mut ::core::ffi::c_int,
6486 ) -> cusolverStatus_t;
6487}
6488unsafe extern "C" {
6489 pub fn cusolverDnDsygvdx_bufferSize(
6490 handle: cusolverDnHandle_t,
6491 itype: cusolverEigType_t,
6492 jobz: cusolverEigMode_t,
6493 range: cusolverEigRange_t,
6494 uplo: cublasFillMode_t,
6495 n: ::core::ffi::c_int,
6496 A: *const f64,
6497 lda: ::core::ffi::c_int,
6498 B: *const f64,
6499 ldb: ::core::ffi::c_int,
6500 vl: f64,
6501 vu: f64,
6502 il: ::core::ffi::c_int,
6503 iu: ::core::ffi::c_int,
6504 meig: *mut ::core::ffi::c_int,
6505 W: *const f64,
6506 lwork: *mut ::core::ffi::c_int,
6507 ) -> cusolverStatus_t;
6508}
6509unsafe extern "C" {
6510 pub fn cusolverDnChegvdx_bufferSize(
6511 handle: cusolverDnHandle_t,
6512 itype: cusolverEigType_t,
6513 jobz: cusolverEigMode_t,
6514 range: cusolverEigRange_t,
6515 uplo: cublasFillMode_t,
6516 n: ::core::ffi::c_int,
6517 A: *const cuComplex,
6518 lda: ::core::ffi::c_int,
6519 B: *const cuComplex,
6520 ldb: ::core::ffi::c_int,
6521 vl: f32,
6522 vu: f32,
6523 il: ::core::ffi::c_int,
6524 iu: ::core::ffi::c_int,
6525 meig: *mut ::core::ffi::c_int,
6526 W: *const f32,
6527 lwork: *mut ::core::ffi::c_int,
6528 ) -> cusolverStatus_t;
6529}
6530unsafe extern "C" {
6531 pub fn cusolverDnZhegvdx_bufferSize(
6532 handle: cusolverDnHandle_t,
6533 itype: cusolverEigType_t,
6534 jobz: cusolverEigMode_t,
6535 range: cusolverEigRange_t,
6536 uplo: cublasFillMode_t,
6537 n: ::core::ffi::c_int,
6538 A: *const cuDoubleComplex,
6539 lda: ::core::ffi::c_int,
6540 B: *const cuDoubleComplex,
6541 ldb: ::core::ffi::c_int,
6542 vl: f64,
6543 vu: f64,
6544 il: ::core::ffi::c_int,
6545 iu: ::core::ffi::c_int,
6546 meig: *mut ::core::ffi::c_int,
6547 W: *const f64,
6548 lwork: *mut ::core::ffi::c_int,
6549 ) -> cusolverStatus_t;
6550}
6551unsafe extern "C" {
6552 /// The helper functions below can calculate the sizes needed for pre-allocated buffer.
6553 ///
6554 /// The S and D data types are real valued single and double precision, respectively.
6555 ///
6556 /// The C and Z data types are complex valued single and double precision, respectively.
6557 ///
6558 /// 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:
6559 /// $$
6560 /// \operatorname{eig}(A,B) =
6561 /// \begin{cases}
6562 /// A * V = B * V * \Lambda & \text{if } itype = \text{CUSOLVER_EIG_TYPE_1} \\
6563 /// A * B * V = V * \Lambda & \text{if } itype = \text{CUSOLVER_EIG_TYPE_2} \\
6564 /// B * A * V = V * \Lambda & \text{if } itype = \text{CUSOLVER_EIG_TYPE_3}
6565 /// \end{cases}
6566 /// $$
6567 ///
6568 /// 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:
6569 /// $$
6570 /// \begin{cases}
6571 /// V^H * B * V = I & \text{if } itype = \text{CUSOLVER_EIG_TYPE_1 or CUSOLVER_EIG_TYPE_2} \\
6572 /// V^H * \operatorname{inv}(B) * V = I & \text{if } itype = \text{CUSOLVER_EIG_TYPE_3}
6573 /// \end{cases}
6574 /// $$
6575 ///
6576 /// The user has to provide working space which is pointed by input parameter `work`. The input parameter `lwork` is size of the working space, and it is returned by `sygvdx_bufferSize()`. Please note that the size in bytes of the working space is equal to `sizeof(<type>) * lwork`.
6577 ///
6578 /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle). If `devInfo = i` (i > 0 and i<=n) and `jobz` = [`cusolverEigMode_t::CUSOLVER_EIG_MODE_NOVECTOR`], `i` off-diagonal elements of an intermediate tridiagonal form did not converge to zero. If `devInfo = n + i` (i > 0), then the leading minor of order `i` of `B` is not positive definite. The factorization of `B` could not be completed and no eigenvalues or eigenvectors were computed.
6579 ///
6580 /// 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.
6581 ///
6582 /// Please visit [cuSOLVER Library Samples - sygvdx](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/sygvdx) for a code example.
6583 pub fn cusolverDnSsygvdx(
6584 handle: cusolverDnHandle_t,
6585 itype: cusolverEigType_t,
6586 jobz: cusolverEigMode_t,
6587 range: cusolverEigRange_t,
6588 uplo: cublasFillMode_t,
6589 n: ::core::ffi::c_int,
6590 A: *mut f32,
6591 lda: ::core::ffi::c_int,
6592 B: *mut f32,
6593 ldb: ::core::ffi::c_int,
6594 vl: f32,
6595 vu: f32,
6596 il: ::core::ffi::c_int,
6597 iu: ::core::ffi::c_int,
6598 meig: *mut ::core::ffi::c_int,
6599 W: *mut f32,
6600 work: *mut f32,
6601 lwork: ::core::ffi::c_int,
6602 info: *mut ::core::ffi::c_int,
6603 ) -> cusolverStatus_t;
6604}
6605unsafe extern "C" {
6606 /// The helper functions below can calculate the sizes needed for pre-allocated buffer.
6607 ///
6608 /// The S and D data types are real valued single and double precision, respectively.
6609 ///
6610 /// The C and Z data types are complex valued single and double precision, respectively.
6611 ///
6612 /// 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:
6613 /// $$
6614 /// \operatorname{eig}(A,B) =
6615 /// \begin{cases}
6616 /// A * V = B * V * \Lambda & \text{if } itype = \text{CUSOLVER_EIG_TYPE_1} \\
6617 /// A * B * V = V * \Lambda & \text{if } itype = \text{CUSOLVER_EIG_TYPE_2} \\
6618 /// B * A * V = V * \Lambda & \text{if } itype = \text{CUSOLVER_EIG_TYPE_3}
6619 /// \end{cases}
6620 /// $$
6621 ///
6622 /// 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:
6623 /// $$
6624 /// \begin{cases}
6625 /// V^H * B * V = I & \text{if } itype = \text{CUSOLVER_EIG_TYPE_1 or CUSOLVER_EIG_TYPE_2} \\
6626 /// V^H * \operatorname{inv}(B) * V = I & \text{if } itype = \text{CUSOLVER_EIG_TYPE_3}
6627 /// \end{cases}
6628 /// $$
6629 ///
6630 /// The user has to provide working space which is pointed by input parameter `work`. The input parameter `lwork` is size of the working space, and it is returned by `sygvdx_bufferSize()`. Please note that the size in bytes of the working space is equal to `sizeof(<type>) * lwork`.
6631 ///
6632 /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle). If `devInfo = i` (i > 0 and i<=n) and `jobz` = [`cusolverEigMode_t::CUSOLVER_EIG_MODE_NOVECTOR`], `i` off-diagonal elements of an intermediate tridiagonal form did not converge to zero. If `devInfo = n + i` (i > 0), then the leading minor of order `i` of `B` is not positive definite. The factorization of `B` could not be completed and no eigenvalues or eigenvectors were computed.
6633 ///
6634 /// 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.
6635 ///
6636 /// Please visit [cuSOLVER Library Samples - sygvdx](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/sygvdx) for a code example.
6637 pub fn cusolverDnDsygvdx(
6638 handle: cusolverDnHandle_t,
6639 itype: cusolverEigType_t,
6640 jobz: cusolverEigMode_t,
6641 range: cusolverEigRange_t,
6642 uplo: cublasFillMode_t,
6643 n: ::core::ffi::c_int,
6644 A: *mut f64,
6645 lda: ::core::ffi::c_int,
6646 B: *mut f64,
6647 ldb: ::core::ffi::c_int,
6648 vl: f64,
6649 vu: f64,
6650 il: ::core::ffi::c_int,
6651 iu: ::core::ffi::c_int,
6652 meig: *mut ::core::ffi::c_int,
6653 W: *mut f64,
6654 work: *mut f64,
6655 lwork: ::core::ffi::c_int,
6656 info: *mut ::core::ffi::c_int,
6657 ) -> cusolverStatus_t;
6658}
6659unsafe extern "C" {
6660 pub fn cusolverDnChegvdx(
6661 handle: cusolverDnHandle_t,
6662 itype: cusolverEigType_t,
6663 jobz: cusolverEigMode_t,
6664 range: cusolverEigRange_t,
6665 uplo: cublasFillMode_t,
6666 n: ::core::ffi::c_int,
6667 A: *mut cuComplex,
6668 lda: ::core::ffi::c_int,
6669 B: *mut cuComplex,
6670 ldb: ::core::ffi::c_int,
6671 vl: f32,
6672 vu: f32,
6673 il: ::core::ffi::c_int,
6674 iu: ::core::ffi::c_int,
6675 meig: *mut ::core::ffi::c_int,
6676 W: *mut f32,
6677 work: *mut cuComplex,
6678 lwork: ::core::ffi::c_int,
6679 info: *mut ::core::ffi::c_int,
6680 ) -> cusolverStatus_t;
6681}
6682unsafe extern "C" {
6683 pub fn cusolverDnZhegvdx(
6684 handle: cusolverDnHandle_t,
6685 itype: cusolverEigType_t,
6686 jobz: cusolverEigMode_t,
6687 range: cusolverEigRange_t,
6688 uplo: cublasFillMode_t,
6689 n: ::core::ffi::c_int,
6690 A: *mut cuDoubleComplex,
6691 lda: ::core::ffi::c_int,
6692 B: *mut cuDoubleComplex,
6693 ldb: ::core::ffi::c_int,
6694 vl: f64,
6695 vu: f64,
6696 il: ::core::ffi::c_int,
6697 iu: ::core::ffi::c_int,
6698 meig: *mut ::core::ffi::c_int,
6699 W: *mut f64,
6700 work: *mut cuDoubleComplex,
6701 lwork: ::core::ffi::c_int,
6702 info: *mut ::core::ffi::c_int,
6703 ) -> cusolverStatus_t;
6704}
6705unsafe extern "C" {
6706 pub fn cusolverDnSsygvd_bufferSize(
6707 handle: cusolverDnHandle_t,
6708 itype: cusolverEigType_t,
6709 jobz: cusolverEigMode_t,
6710 uplo: cublasFillMode_t,
6711 n: ::core::ffi::c_int,
6712 A: *const f32,
6713 lda: ::core::ffi::c_int,
6714 B: *const f32,
6715 ldb: ::core::ffi::c_int,
6716 W: *const f32,
6717 lwork: *mut ::core::ffi::c_int,
6718 ) -> cusolverStatus_t;
6719}
6720unsafe extern "C" {
6721 pub fn cusolverDnDsygvd_bufferSize(
6722 handle: cusolverDnHandle_t,
6723 itype: cusolverEigType_t,
6724 jobz: cusolverEigMode_t,
6725 uplo: cublasFillMode_t,
6726 n: ::core::ffi::c_int,
6727 A: *const f64,
6728 lda: ::core::ffi::c_int,
6729 B: *const f64,
6730 ldb: ::core::ffi::c_int,
6731 W: *const f64,
6732 lwork: *mut ::core::ffi::c_int,
6733 ) -> cusolverStatus_t;
6734}
6735unsafe extern "C" {
6736 pub fn cusolverDnChegvd_bufferSize(
6737 handle: cusolverDnHandle_t,
6738 itype: cusolverEigType_t,
6739 jobz: cusolverEigMode_t,
6740 uplo: cublasFillMode_t,
6741 n: ::core::ffi::c_int,
6742 A: *const cuComplex,
6743 lda: ::core::ffi::c_int,
6744 B: *const cuComplex,
6745 ldb: ::core::ffi::c_int,
6746 W: *const f32,
6747 lwork: *mut ::core::ffi::c_int,
6748 ) -> cusolverStatus_t;
6749}
6750unsafe extern "C" {
6751 pub fn cusolverDnZhegvd_bufferSize(
6752 handle: cusolverDnHandle_t,
6753 itype: cusolverEigType_t,
6754 jobz: cusolverEigMode_t,
6755 uplo: cublasFillMode_t,
6756 n: ::core::ffi::c_int,
6757 A: *const cuDoubleComplex,
6758 lda: ::core::ffi::c_int,
6759 B: *const cuDoubleComplex,
6760 ldb: ::core::ffi::c_int,
6761 W: *const f64,
6762 lwork: *mut ::core::ffi::c_int,
6763 ) -> cusolverStatus_t;
6764}
6765unsafe extern "C" {
6766 /// The helper functions below can calculate the sizes needed for pre-allocated buffer.
6767 ///
6768 /// The S and D data types are real valued single and double precision, respectively.
6769 ///
6770 /// The C and Z data types are complex valued single and double precision, respectively.
6771 ///
6772 /// This function computes eigenvalues and eigenvectors of a symmetric (Hermitian) $n \times n$ matrix-pair (`A`,`B`). The generalized symmetric-definite eigenvalue problem is:
6773 /// $$
6774 /// \operatorname{eig}(A,B) =
6775 /// \begin{cases}
6776 /// A * V = B * V * \Lambda & \text{if } itype = \text{CUSOLVER_EIG_TYPE_1} \\
6777 /// A * B * V = V * \Lambda & \text{if } itype = \text{CUSOLVER_EIG_TYPE_2} \\
6778 /// B * A * V = V * \Lambda & \text{if } itype = \text{CUSOLVER_EIG_TYPE_3}
6779 /// \end{cases}
6780 /// $$
6781 ///
6782 /// 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:
6783 /// $$
6784 /// \begin{cases}
6785 /// V^H * B * V = I & \text{if } itype = \text{CUSOLVER_EIG_TYPE_1 or CUSOLVER_EIG_TYPE_2} \\
6786 /// V^H * \operatorname{inv}(B) * V = I & \text{if } itype = \text{CUSOLVER_EIG_TYPE_3}
6787 /// \end{cases}
6788 /// $$
6789 ///
6790 /// The user has to provide working space which is pointed by input parameter `work`. The input parameter `lwork` is size of the working space, and it is returned by `sygvd_bufferSize()`. Please note that the size in bytes of the working space is equal to `sizeof(<type>) * lwork`.
6791 ///
6792 /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle). If `devInfo = i` (i > 0 and i<=n) and `jobz` = [`cusolverEigMode_t::CUSOLVER_EIG_MODE_NOVECTOR`], `i` off-diagonal elements of an intermediate tridiagonal form did not converge to zero. If `devInfo = N + i` (i > 0), then the leading minor of order `i` of `B` is not positive definite. The factorization of `B` could not be completed and no eigenvalues or eigenvectors were computed.
6793 ///
6794 /// 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.
6795 ///
6796 /// Please visit [cuSOLVER Library Samples - sygvd](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/sygvd) for a code example.
6797 pub fn cusolverDnSsygvd(
6798 handle: cusolverDnHandle_t,
6799 itype: cusolverEigType_t,
6800 jobz: cusolverEigMode_t,
6801 uplo: cublasFillMode_t,
6802 n: ::core::ffi::c_int,
6803 A: *mut f32,
6804 lda: ::core::ffi::c_int,
6805 B: *mut f32,
6806 ldb: ::core::ffi::c_int,
6807 W: *mut f32,
6808 work: *mut f32,
6809 lwork: ::core::ffi::c_int,
6810 info: *mut ::core::ffi::c_int,
6811 ) -> cusolverStatus_t;
6812}
6813unsafe extern "C" {
6814 /// The helper functions below can calculate the sizes needed for pre-allocated buffer.
6815 ///
6816 /// The S and D data types are real valued single and double precision, respectively.
6817 ///
6818 /// The C and Z data types are complex valued single and double precision, respectively.
6819 ///
6820 /// This function computes eigenvalues and eigenvectors of a symmetric (Hermitian) $n \times n$ matrix-pair (`A`,`B`). The generalized symmetric-definite eigenvalue problem is:
6821 /// $$
6822 /// \operatorname{eig}(A,B) =
6823 /// \begin{cases}
6824 /// A * V = B * V * \Lambda & \text{if } itype = \text{CUSOLVER_EIG_TYPE_1} \\
6825 /// A * B * V = V * \Lambda & \text{if } itype = \text{CUSOLVER_EIG_TYPE_2} \\
6826 /// B * A * V = V * \Lambda & \text{if } itype = \text{CUSOLVER_EIG_TYPE_3}
6827 /// \end{cases}
6828 /// $$
6829 ///
6830 /// 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:
6831 /// $$
6832 /// \begin{cases}
6833 /// V^H * B * V = I & \text{if } itype = \text{CUSOLVER_EIG_TYPE_1 or CUSOLVER_EIG_TYPE_2} \\
6834 /// V^H * \operatorname{inv}(B) * V = I & \text{if } itype = \text{CUSOLVER_EIG_TYPE_3}
6835 /// \end{cases}
6836 /// $$
6837 ///
6838 /// The user has to provide working space which is pointed by input parameter `work`. The input parameter `lwork` is size of the working space, and it is returned by `sygvd_bufferSize()`. Please note that the size in bytes of the working space is equal to `sizeof(<type>) * lwork`.
6839 ///
6840 /// If output parameter `devInfo = -i` (less than zero), the `i-th` parameter is wrong (not counting handle). If `devInfo = i` (i > 0 and i<=n) and `jobz` = [`cusolverEigMode_t::CUSOLVER_EIG_MODE_NOVECTOR`], `i` off-diagonal elements of an intermediate tridiagonal form did not converge to zero. If `devInfo = N + i` (i > 0), then the leading minor of order `i` of `B` is not positive definite. The factorization of `B` could not be completed and no eigenvalues or eigenvectors were computed.
6841 ///
6842 /// 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.
6843 ///
6844 /// Please visit [cuSOLVER Library Samples - sygvd](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/sygvd) for a code example.
6845 pub fn cusolverDnDsygvd(
6846 handle: cusolverDnHandle_t,
6847 itype: cusolverEigType_t,
6848 jobz: cusolverEigMode_t,
6849 uplo: cublasFillMode_t,
6850 n: ::core::ffi::c_int,
6851 A: *mut f64,
6852 lda: ::core::ffi::c_int,
6853 B: *mut f64,
6854 ldb: ::core::ffi::c_int,
6855 W: *mut f64,
6856 work: *mut f64,
6857 lwork: ::core::ffi::c_int,
6858 info: *mut ::core::ffi::c_int,
6859 ) -> cusolverStatus_t;
6860}
6861unsafe extern "C" {
6862 pub fn cusolverDnChegvd(
6863 handle: cusolverDnHandle_t,
6864 itype: cusolverEigType_t,
6865 jobz: cusolverEigMode_t,
6866 uplo: cublasFillMode_t,
6867 n: ::core::ffi::c_int,
6868 A: *mut cuComplex,
6869 lda: ::core::ffi::c_int,
6870 B: *mut cuComplex,
6871 ldb: ::core::ffi::c_int,
6872 W: *mut f32,
6873 work: *mut cuComplex,
6874 lwork: ::core::ffi::c_int,
6875 info: *mut ::core::ffi::c_int,
6876 ) -> cusolverStatus_t;
6877}
6878unsafe extern "C" {
6879 pub fn cusolverDnZhegvd(
6880 handle: cusolverDnHandle_t,
6881 itype: cusolverEigType_t,
6882 jobz: cusolverEigMode_t,
6883 uplo: cublasFillMode_t,
6884 n: ::core::ffi::c_int,
6885 A: *mut cuDoubleComplex,
6886 lda: ::core::ffi::c_int,
6887 B: *mut cuDoubleComplex,
6888 ldb: ::core::ffi::c_int,
6889 W: *mut f64,
6890 work: *mut cuDoubleComplex,
6891 lwork: ::core::ffi::c_int,
6892 info: *mut ::core::ffi::c_int,
6893 ) -> cusolverStatus_t;
6894}
6895unsafe extern "C" {
6896 pub fn cusolverDnXsygvd_bufferSize(
6897 handle: cusolverDnHandle_t,
6898 params: cusolverDnParams_t,
6899 itype: cusolverEigType_t,
6900 jobz: cusolverEigMode_t,
6901 uplo: cublasFillMode_t,
6902 n: i64,
6903 dataTypeA: cudaDataType,
6904 d_A: *const ::core::ffi::c_void,
6905 lda: i64,
6906 dataTypeB: cudaDataType,
6907 d_B: *const ::core::ffi::c_void,
6908 ldb: i64,
6909 dataTypeW: cudaDataType,
6910 d_W: *const ::core::ffi::c_void,
6911 computeType: cudaDataType,
6912 workspaceInBytesOnDevice: *mut size_t,
6913 workspaceInBytesOnHost: *mut size_t,
6914 ) -> cusolverStatus_t;
6915}
6916unsafe extern "C" {
6917 /// The helper functions below can calculate the sizes needed for pre-allocated buffer.
6918 ///
6919 /// The following routine computes all the eigenvalues, and optionally, the eigenvectors of a generalized symmetric (Hermitian) definite eigenproblem.
6920 ///
6921 /// The generalized symmetric (Hermitian) definite eigenvalue problem is:
6922 /// $$
6923 /// \operatorname{eig}(A,B) =
6924 /// \begin{cases}
6925 /// A * V = B * V * \Lambda & \text{if } itype = \text{CUSOLVER_EIG_TYPE_1} \\
6926 /// A * B * V = V * \Lambda & \text{if } itype = \text{CUSOLVER_EIG_TYPE_2} \\
6927 /// B * A * V = V * \Lambda & \text{if } itype = \text{CUSOLVER_EIG_TYPE_3}
6928 /// \end{cases}
6929 /// $$
6930 ///
6931 /// 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:
6932 /// $$
6933 /// \begin{cases}
6934 /// V^H * B * V = I & \text{if } itype = \text{CUSOLVER_EIG_TYPE_1 or CUSOLVER_EIG_TYPE_2} \\
6935 /// V^H * \operatorname{inv}(B) * V = I & \text{if } itype = \text{CUSOLVER_EIG_TYPE_3}
6936 /// \end{cases}
6937 /// $$
6938 ///
6939 /// 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`].
6940 ///
6941 /// If output parameter `info = -i` (less than zero), the `i-th` parameter is wrong (not counting handle). If `info = i` (i > 0 and i<=n) and `jobz` = [`cusolverEigMode_t::CUSOLVER_EIG_MODE_NOVECTOR`], `i` off-diagonal elements of an intermediate tridiagonal form did not converge to zero. If `info = n + i` (i > 0), then the leading minor of order `i` of `B` is not positive definite. The factorization of `B` could not be completed and no eigenvalues or eigenvectors were computed.
6942 ///
6943 /// 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.
6944 ///
6945 /// Currently, [`cusolverDnXsygvd`] supports only the default algorithm.
6946 ///
6947 /// **Algorithms supported by cusolverDnXsygvd**
6948 ///
6949 /// | | |
6950 /// | --- | --- |
6951 /// | [`cusolverAlgMode_t::CUSOLVER_ALG_0`] or `NULL` | Default algorithm. |
6952 ///
6953 /// List of input arguments for [`cusolverDnXsygvd_bufferSize`] and [`cusolverDnXsygvd`]:
6954 ///
6955 /// 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.
6956 ///
6957 /// **Valid combination of data type and compute type**
6958 ///
6959 /// | **DataTypeA** | **DataTypeB** | **DataTypeW** | **ComputeType** | **Meaning** |
6960 /// | --- | --- | --- | --- | --- |
6961 /// | `CUDA_R_32F` | `CUDA_R_32F` | `CUDA_R_32F` | `CUDA_R_32F` | `SSYGVD` |
6962 /// | `CUDA_R_64F` | `CUDA_R_64F` | `CUDA_R_64F` | `CUDA_R_64F` | `DSYGVD` |
6963 /// | `CUDA_C_32F` | `CUDA_C_32F` | `CUDA_R_32F` | `CUDA_C_32F` | `CHEGVD` |
6964 /// | `CUDA_C_64F` | `CUDA_C_64F` | `CUDA_R_64F` | `CUDA_C_64F` | `ZHEGVD` |
6965 ///
6966 /// # Parameters
6967 ///
6968 /// - `handle`: Handle to the cuSolverDN library context.
6969 /// - `params`: Structure with information collected by [`cusolverDnSetAdvOptions`].
6970 /// - `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.
6971 /// - `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.
6972 /// - `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.
6973 /// - `n`: Number of rows (or columns) of matrix `A`.
6974 /// - `dataTypeA`: Data type of array `A`.
6975 /// - `lda`: Leading dimension of two-dimensional array used to store matrix `A`.
6976 /// - `dataTypeB`: Data type of array `B`.
6977 /// - `ldb`: Leading dimension of two-dimensional array used to store matrix `B`.
6978 /// - `dataTypeW`: Data type of array `W`.
6979 /// - `computeType`: Data type of computation.
6980 /// - `bufferOnDevice`: Device workspace. Array of type `void` of size `workspaceInBytesOnDevice` bytes.
6981 /// - `workspaceInBytesOnDevice`: Size in bytes of `bufferOnDevice`, returned by [`cusolverDnXsygvd_bufferSize`].
6982 /// - `bufferOnHost`: Host workspace. Array of type `void` of size `workspaceInBytesOnHost` bytes.
6983 /// - `workspaceInBytesOnHost`: Size in bytes of `bufferOnHost`, returned by [`cusolverDnXsygvd_bufferSize`].
6984 ///
6985 /// # Return value
6986 ///
6987 /// - [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]: An internal operation failed.
6988 /// - [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]: Invalid parameters were passed (`n<0`, or `lda<max(1,n)`, or `ldb<max(1,n)`, or `itype` is not 1, 2 or 3, or `jobz` is not [`cusolverEigMode_t::CUSOLVER_EIG_MODE_NOVECTOR`] or [`cusolverEigMode_t::CUSOLVER_EIG_MODE_VECTOR`], or `uplo` is not [`cublasFillMode_t::CUBLAS_FILL_MODE_LOWER`] or [`cublasFillMode_t::CUBLAS_FILL_MODE_UPPER`]), or the combination of `dataType{A,B,C}` and `computeType` are not supported.
6989 /// - [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]: The library was not initialized.
6990 /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The operation completed successfully.
6991 pub fn cusolverDnXsygvd(
6992 handle: cusolverDnHandle_t,
6993 params: cusolverDnParams_t,
6994 itype: cusolverEigType_t,
6995 jobz: cusolverEigMode_t,
6996 uplo: cublasFillMode_t,
6997 n: i64,
6998 dataTypeA: cudaDataType,
6999 d_A: *mut ::core::ffi::c_void,
7000 lda: i64,
7001 dataTypeB: cudaDataType,
7002 d_B: *mut ::core::ffi::c_void,
7003 ldb: i64,
7004 dataTypeW: cudaDataType,
7005 d_W: *mut ::core::ffi::c_void,
7006 computeType: cudaDataType,
7007 bufferOnDevice: *mut ::core::ffi::c_void,
7008 workspaceInBytesOnDevice: size_t,
7009 bufferOnHost: *mut ::core::ffi::c_void,
7010 workspaceInBytesOnHost: size_t,
7011 d_info: *mut ::core::ffi::c_int,
7012 ) -> cusolverStatus_t;
7013}
7014unsafe extern "C" {
7015 pub fn cusolverDnXsygvdx_bufferSize(
7016 handle: cusolverDnHandle_t,
7017 params: cusolverDnParams_t,
7018 itype: cusolverEigType_t,
7019 jobz: cusolverEigMode_t,
7020 uplo: cublasFillMode_t,
7021 n: i64,
7022 dataTypeA: cudaDataType,
7023 d_A: *const ::core::ffi::c_void,
7024 lda: i64,
7025 dataTypeB: cudaDataType,
7026 d_B: *const ::core::ffi::c_void,
7027 ldb: i64,
7028 vl: *mut ::core::ffi::c_void,
7029 vu: *mut ::core::ffi::c_void,
7030 il: i64,
7031 iu: i64,
7032 meig: *mut i64,
7033 dataTypeW: cudaDataType,
7034 d_W: *const ::core::ffi::c_void,
7035 computeType: cudaDataType,
7036 workspaceInBytesOnDevice: *mut size_t,
7037 workspaceInBytesOnHost: *mut size_t,
7038 ) -> cusolverStatus_t;
7039}
7040unsafe extern "C" {
7041 /// The helper function below can calculate the sizes needed for pre-allocated buffer.
7042 ///
7043 /// The following routine computes all or selection of the eigenvalues, and optionally, the eigenvectors of a generalized symmetric (Hermitian) definite eigenproblem.
7044 ///
7045 /// The generalized symmetric-definite eigenvalue problem is:
7046 /// $$
7047 /// \operatorname{eig}(A,B) =
7048 /// \begin{cases}
7049 /// A * V = B * V * \Lambda & \text{if } itype = \text{CUSOLVER_EIG_TYPE_1} \\
7050 /// A * B * V = V * \Lambda & \text{if } itype = \text{CUSOLVER_EIG_TYPE_2} \\
7051 /// B * A * V = V * \Lambda & \text{if } itype = \text{CUSOLVER_EIG_TYPE_3}
7052 /// \end{cases}
7053 /// $$
7054 ///
7055 /// 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:
7056 /// $$
7057 /// \begin{cases}
7058 /// V^H * B * V = I & \text{if } itype = \text{CUSOLVER_EIG_TYPE_1 or CUSOLVER_EIG_TYPE_2} \\
7059 /// V^H * \operatorname{inv}(B) * V = I & \text{if } itype = \text{CUSOLVER_EIG_TYPE_3}
7060 /// \end{cases}
7061 /// $$
7062 ///
7063 /// 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`].
7064 ///
7065 /// If output parameter `info = -i` (less than zero), the `i-th` parameter is wrong (not counting handle). If `info = i` (i > 0 and i<=n) and `jobz` = [`cusolverEigMode_t::CUSOLVER_EIG_MODE_NOVECTOR`], `i` off-diagonal elements of an intermediate tridiagonal form did not converge to zero. If `info = n + i` (i > 0), then the leading minor of order `i` of `B` is not positive definite. The factorization of `B` could not be completed and no eigenvalues or eigenvectors were computed.
7066 ///
7067 /// 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.
7068 ///
7069 /// **Algorithms supported by cusolverDnXsygvdx**
7070 ///
7071 /// | | |
7072 /// | --- | --- |
7073 /// | [`cusolverAlgMode_t::CUSOLVER_ALG_0`] or `NULL` | Default algorithm. |
7074 ///
7075 /// List of input arguments for [`cusolverDnXsygvdx_bufferSize`] and [`cusolverDnXsygvdx`]:
7076 ///
7077 /// 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:
7078 ///
7079 /// **Valid combination of data type and compute type**
7080 ///
7081 /// | **DataTypeA** | **DataTypeB** | **DataTypeW** | **ComputeType** | **Meaning** |
7082 /// | --- | --- | --- | --- | --- |
7083 /// | `CUDA_R_32F` | `CUDA_R_32F` | `CUDA_R_32F` | `CUDA_R_32F` | `SSYGVDX` |
7084 /// | `CUDA_R_64F` | `CUDA_R_64F` | `CUDA_R_64F` | `CUDA_R_64F` | `DSYGVDX` |
7085 /// | `CUDA_C_32F` | `CUDA_C_32F` | `CUDA_R_32F` | `CUDA_C_32F` | `CHEGVDX` |
7086 /// | `CUDA_C_64F` | `CUDA_C_64F` | `CUDA_R_64F` | `CUDA_C_64F` | `ZHEGVDX` |
7087 ///
7088 /// # Parameters
7089 ///
7090 /// - `handle`: Handle to the cuSolverDN library context.
7091 /// - `params`: Structure with information collected by [`cusolverDnSetAdvOptions`].
7092 /// - `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.
7093 /// - `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.
7094 /// - `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;.
7095 /// - `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.
7096 /// - `n`: Number of rows (or columns) of matrix `A`.
7097 /// - `dataTypeA`: Data type of array `A`.
7098 /// - `lda`: Leading dimension of two-dimensional array used to store matrix `A`.`lda` is not less than `max(1,n)`.
7099 /// - `dataTypeB`: Data type of array `B`.
7100 /// - `ldb`: Leading dimension of two-dimensional array used to store matrix `B`.
7101 /// - `dataTypeW`: Data type of array `W`.
7102 /// - `computeType`: Data type of computation.
7103 /// - `bufferOnDevice`: Device workspace. Array of type `void` of size `workspaceInBytesOnDevice` bytes.
7104 /// - `workspaceInBytesOnDevice`: Size in bytes of `bufferOnDevice`, returned by [`cusolverDnXsygvdx_bufferSize`].
7105 /// - `bufferOnHost`: Host workspace. Array of type `void` of size `workspaceInBytesOnHost` bytes.
7106 /// - `workspaceInBytesOnHost`: Size in bytes of `bufferOnHost`, returned by [`cusolverDnXsygvdx_bufferSize`].
7107 ///
7108 /// # Return value
7109 ///
7110 /// - [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]: An internal operation failed.
7111 /// - [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]: Invalid parameters were passed (`n<0`, or `lda<max(1,n)`, or `ldb<max(1,n)`, or `itype` is not 1, 2 or 3, or `jobz` is not [`cusolverEigMode_t::CUSOLVER_EIG_MODE_NOVECTOR`] or [`cusolverEigMode_t::CUSOLVER_EIG_MODE_VECTOR`], or `range` is not [`cusolverEigRange_t::CUSOLVER_EIG_RANGE_ALL`] or [`cusolverEigRange_t::CUSOLVER_EIG_RANGE_V`] or [`cusolverEigRange_t::CUSOLVER_EIG_RANGE_I`], or `uplo` is not [`cublasFillMode_t::CUBLAS_FILL_MODE_LOWER`] or [`cublasFillMode_t::CUBLAS_FILL_MODE_UPPER`]), or the combination of `dataType{A,B,C}` and `computeType` are not supported.
7112 /// - [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]: The library was not initialized.
7113 /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The operation completed successfully.
7114 pub fn cusolverDnXsygvdx(
7115 handle: cusolverDnHandle_t,
7116 params: cusolverDnParams_t,
7117 itype: cusolverEigType_t,
7118 jobz: cusolverEigMode_t,
7119 range: cusolverEigRange_t,
7120 uplo: cublasFillMode_t,
7121 n: i64,
7122 dataTypeA: cudaDataType,
7123 d_A: *mut ::core::ffi::c_void,
7124 lda: i64,
7125 dataTypeB: cudaDataType,
7126 d_B: *mut ::core::ffi::c_void,
7127 ldb: i64,
7128 vl: *mut ::core::ffi::c_void,
7129 vu: *mut ::core::ffi::c_void,
7130 il: i64,
7131 iu: i64,
7132 meig: *mut i64,
7133 dataTypeW: cudaDataType,
7134 d_W: *mut ::core::ffi::c_void,
7135 computeType: cudaDataType,
7136 bufferOnDevice: *mut ::core::ffi::c_void,
7137 workspaceInBytesOnDevice: size_t,
7138 bufferOnHost: *mut ::core::ffi::c_void,
7139 workspaceInBytesOnHost: size_t,
7140 d_info: *mut ::core::ffi::c_int,
7141 ) -> cusolverStatus_t;
7142}
7143unsafe extern "C" {
7144 /// This function creates and initializes the structure of `syevj`, `syevjBatched` and `sygvj` to default values.
7145 ///
7146 /// # Parameters
7147 ///
7148 /// - `info`: The pointer to the structure of `syevj`.
7149 ///
7150 /// # Return value
7151 ///
7152 /// - [`cusolverStatus_t::CUSOLVER_STATUS_ALLOC_FAILED`]: The resources could not be allocated.
7153 /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The structure was initialized successfully.
7154 pub fn cusolverDnCreateSyevjInfo(info: *mut syevjInfo_t) -> cusolverStatus_t;
7155}
7156unsafe extern "C" {
7157 /// This function destroys and releases any memory required by the structure.
7158 ///
7159 /// # Parameters
7160 ///
7161 /// - `info`: The structure of `syevj`.
7162 ///
7163 /// # Return value
7164 ///
7165 /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The resources were released successfully.
7166 pub fn cusolverDnDestroySyevjInfo(info: syevjInfo_t) -> cusolverStatus_t;
7167}
7168unsafe extern "C" {
7169 /// This function configures tolerance of `syevj`.
7170 ///
7171 /// # Parameters
7172 ///
7173 /// - `info`: The pointer to the structure of `syevj`.
7174 /// - `tolerance`: Accuracy of numerical eigenvalues.
7175 ///
7176 /// # Return value
7177 ///
7178 /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The operation completed successfully.
7179 pub fn cusolverDnXsyevjSetTolerance(
7180 info: syevjInfo_t,
7181 tolerance: f64,
7182 ) -> cusolverStatus_t;
7183}
7184unsafe extern "C" {
7185 /// This function configures maximum number of sweeps in `syevj`. The default value is 100.
7186 ///
7187 /// # Parameters
7188 ///
7189 /// - `info`: The pointer to the structure of `syevj`.
7190 /// - `max_sweeps`: Maximum number of sweeps.
7191 ///
7192 /// # Return value
7193 ///
7194 /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The operation completed successfully.
7195 pub fn cusolverDnXsyevjSetMaxSweeps(
7196 info: syevjInfo_t,
7197 max_sweeps: ::core::ffi::c_int,
7198 ) -> cusolverStatus_t;
7199}
7200unsafe extern "C" {
7201 /// 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.
7202 ///
7203 /// # Parameters
7204 ///
7205 /// - `info`: The pointer to the structure of syevj.
7206 /// - `sort_eig`: If `sort_eig` is zero, the eigenvalues are not sorted.
7207 ///
7208 /// # Return value
7209 ///
7210 /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The operation completed successfully.
7211 pub fn cusolverDnXsyevjSetSortEig(
7212 info: syevjInfo_t,
7213 sort_eig: ::core::ffi::c_int,
7214 ) -> cusolverStatus_t;
7215}
7216unsafe extern "C" {
7217 /// 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.
7218 ///
7219 /// # Parameters
7220 ///
7221 /// - `handle`: Handle to the cuSolverDN library context.
7222 /// - `info`: The pointer to the structure of `syevj`.
7223 /// - `residual`: Residual of `syevj`.
7224 ///
7225 /// # Return value
7226 ///
7227 /// - [`cusolverStatus_t::CUSOLVER_STATUS_NOT_SUPPORTED`]: Does not support batched version.
7228 /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The operation completed successfully.
7229 pub fn cusolverDnXsyevjGetResidual(
7230 handle: cusolverDnHandle_t,
7231 info: syevjInfo_t,
7232 residual: *mut f64,
7233 ) -> cusolverStatus_t;
7234}
7235unsafe extern "C" {
7236 /// 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.
7237 ///
7238 /// # Parameters
7239 ///
7240 /// - `handle`: Handle to the cuSolverDN library context.
7241 /// - `info`: The pointer to the structure of `syevj`.
7242 /// - `executed_sweeps`: Number of executed sweeps.
7243 ///
7244 /// # Return value
7245 ///
7246 /// - [`cusolverStatus_t::CUSOLVER_STATUS_NOT_SUPPORTED`]: Does not support batched version.
7247 /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The operation completed successfully.
7248 pub fn cusolverDnXsyevjGetSweeps(
7249 handle: cusolverDnHandle_t,
7250 info: syevjInfo_t,
7251 executed_sweeps: *mut ::core::ffi::c_int,
7252 ) -> cusolverStatus_t;
7253}
7254unsafe extern "C" {
7255 pub fn cusolverDnSsyevjBatched_bufferSize(
7256 handle: cusolverDnHandle_t,
7257 jobz: cusolverEigMode_t,
7258 uplo: cublasFillMode_t,
7259 n: ::core::ffi::c_int,
7260 A: *const f32,
7261 lda: ::core::ffi::c_int,
7262 W: *const f32,
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 cusolverDnDsyevjBatched_bufferSize(
7270 handle: cusolverDnHandle_t,
7271 jobz: cusolverEigMode_t,
7272 uplo: cublasFillMode_t,
7273 n: ::core::ffi::c_int,
7274 A: *const f64,
7275 lda: ::core::ffi::c_int,
7276 W: *const f64,
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 cusolverDnCheevjBatched_bufferSize(
7284 handle: cusolverDnHandle_t,
7285 jobz: cusolverEigMode_t,
7286 uplo: cublasFillMode_t,
7287 n: ::core::ffi::c_int,
7288 A: *const cuComplex,
7289 lda: ::core::ffi::c_int,
7290 W: *const f32,
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 pub fn cusolverDnZheevjBatched_bufferSize(
7298 handle: cusolverDnHandle_t,
7299 jobz: cusolverEigMode_t,
7300 uplo: cublasFillMode_t,
7301 n: ::core::ffi::c_int,
7302 A: *const cuDoubleComplex,
7303 lda: ::core::ffi::c_int,
7304 W: *const f64,
7305 lwork: *mut ::core::ffi::c_int,
7306 params: syevjInfo_t,
7307 batchSize: ::core::ffi::c_int,
7308 ) -> cusolverStatus_t;
7309}
7310unsafe extern "C" {
7311 /// The helper functions below can calculate the sizes needed for pre-allocated buffer.
7312 ///
7313 /// The S and D data types are real valued single and double precision, respectively.
7314 ///
7315 /// The C and Z data types are complex valued single and double precision, respectively.
7316 ///
7317 /// This function computes eigenvalues and eigenvectors of a sequence of symmetric (Hermitian) $n \times n$ matrices:
7318 /// $$
7319 /// A_{j}\\*Q_{j} = Q_{j}\\*\Lambda_{j}
7320 /// $$
7321 ///
7322 /// 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.
7323 ///
7324 /// `syevjBatched` performs `syevj` on each matrix. It requires that all matrices are of the same size `n` and are packed in contiguous way,
7325 /// $$
7326 /// \begin{split}A = \begin{pmatrix}
7327 /// {A0} & {A1} & \cdots \\\\
7328 /// \end{pmatrix}\end{split}
7329 /// $$
7330 ///
7331 /// 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}$.
7332 ///
7333 /// The parameter `W` also contains eigenvalues of each matrix in contiguous way,
7334 /// $$
7335 /// \begin{split}W = \begin{pmatrix}
7336 /// {W0} & {W1} & \cdots \\\\
7337 /// \end{pmatrix}\end{split}
7338 /// $$
7339 ///
7340 /// The formula for random access of `W` is $W_{k}\operatorname{(j)} = {W\lbrack\ j\ +\ n\\*k\rbrack}$.
7341 ///
7342 /// 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.
7343 ///
7344 /// `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.
7345 ///
7346 /// The user has to provide working space pointed by input parameter `work`. The input parameter `lwork` is the size of the working space, and it is returned by `syevjBatched_bufferSize()`. Please note that the size in bytes of the working space is equal to `sizeof(<type>) * lwork`.
7347 ///
7348 /// 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.
7349 ///
7350 /// If `jobz` = [`cusolverEigMode_t::CUSOLVER_EIG_MODE_VECTOR`], $A_j$ contains the orthonormal eigenvectors $V_j$.
7351 ///
7352 /// Please visit [cuSOLVER Library Samples - syevjBatched](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/syevjBatched) for a code example.
7353 pub fn cusolverDnSsyevjBatched(
7354 handle: cusolverDnHandle_t,
7355 jobz: cusolverEigMode_t,
7356 uplo: cublasFillMode_t,
7357 n: ::core::ffi::c_int,
7358 A: *mut f32,
7359 lda: ::core::ffi::c_int,
7360 W: *mut f32,
7361 work: *mut f32,
7362 lwork: ::core::ffi::c_int,
7363 info: *mut ::core::ffi::c_int,
7364 params: syevjInfo_t,
7365 batchSize: ::core::ffi::c_int,
7366 ) -> cusolverStatus_t;
7367}
7368unsafe extern "C" {
7369 /// The helper functions below can calculate the sizes needed for pre-allocated buffer.
7370 ///
7371 /// The S and D data types are real valued single and double precision, respectively.
7372 ///
7373 /// The C and Z data types are complex valued single and double precision, respectively.
7374 ///
7375 /// This function computes eigenvalues and eigenvectors of a sequence of symmetric (Hermitian) $n \times n$ matrices:
7376 /// $$
7377 /// A_{j}\\*Q_{j} = Q_{j}\\*\Lambda_{j}
7378 /// $$
7379 ///
7380 /// 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.
7381 ///
7382 /// `syevjBatched` performs `syevj` on each matrix. It requires that all matrices are of the same size `n` and are packed in contiguous way,
7383 /// $$
7384 /// \begin{split}A = \begin{pmatrix}
7385 /// {A0} & {A1} & \cdots \\\\
7386 /// \end{pmatrix}\end{split}
7387 /// $$
7388 ///
7389 /// 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}$.
7390 ///
7391 /// The parameter `W` also contains eigenvalues of each matrix in contiguous way,
7392 /// $$
7393 /// \begin{split}W = \begin{pmatrix}
7394 /// {W0} & {W1} & \cdots \\\\
7395 /// \end{pmatrix}\end{split}
7396 /// $$
7397 ///
7398 /// The formula for random access of `W` is $W_{k}\operatorname{(j)} = {W\lbrack\ j\ +\ n\\*k\rbrack}$.
7399 ///
7400 /// 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.
7401 ///
7402 /// `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.
7403 ///
7404 /// The user has to provide working space pointed by input parameter `work`. The input parameter `lwork` is the size of the working space, and it is returned by `syevjBatched_bufferSize()`. Please note that the size in bytes of the working space is equal to `sizeof(<type>) * lwork`.
7405 ///
7406 /// 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.
7407 ///
7408 /// If `jobz` = [`cusolverEigMode_t::CUSOLVER_EIG_MODE_VECTOR`], $A_j$ contains the orthonormal eigenvectors $V_j$.
7409 ///
7410 /// Please visit [cuSOLVER Library Samples - syevjBatched](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/syevjBatched) for a code example.
7411 pub fn cusolverDnDsyevjBatched(
7412 handle: cusolverDnHandle_t,
7413 jobz: cusolverEigMode_t,
7414 uplo: cublasFillMode_t,
7415 n: ::core::ffi::c_int,
7416 A: *mut f64,
7417 lda: ::core::ffi::c_int,
7418 W: *mut f64,
7419 work: *mut f64,
7420 lwork: ::core::ffi::c_int,
7421 info: *mut ::core::ffi::c_int,
7422 params: syevjInfo_t,
7423 batchSize: ::core::ffi::c_int,
7424 ) -> cusolverStatus_t;
7425}
7426unsafe extern "C" {
7427 pub fn cusolverDnCheevjBatched(
7428 handle: cusolverDnHandle_t,
7429 jobz: cusolverEigMode_t,
7430 uplo: cublasFillMode_t,
7431 n: ::core::ffi::c_int,
7432 A: *mut cuComplex,
7433 lda: ::core::ffi::c_int,
7434 W: *mut f32,
7435 work: *mut cuComplex,
7436 lwork: ::core::ffi::c_int,
7437 info: *mut ::core::ffi::c_int,
7438 params: syevjInfo_t,
7439 batchSize: ::core::ffi::c_int,
7440 ) -> cusolverStatus_t;
7441}
7442unsafe extern "C" {
7443 pub fn cusolverDnZheevjBatched(
7444 handle: cusolverDnHandle_t,
7445 jobz: cusolverEigMode_t,
7446 uplo: cublasFillMode_t,
7447 n: ::core::ffi::c_int,
7448 A: *mut cuDoubleComplex,
7449 lda: ::core::ffi::c_int,
7450 W: *mut f64,
7451 work: *mut cuDoubleComplex,
7452 lwork: ::core::ffi::c_int,
7453 info: *mut ::core::ffi::c_int,
7454 params: syevjInfo_t,
7455 batchSize: ::core::ffi::c_int,
7456 ) -> cusolverStatus_t;
7457}
7458unsafe extern "C" {
7459 pub fn cusolverDnSsyevj_bufferSize(
7460 handle: cusolverDnHandle_t,
7461 jobz: cusolverEigMode_t,
7462 uplo: cublasFillMode_t,
7463 n: ::core::ffi::c_int,
7464 A: *const f32,
7465 lda: ::core::ffi::c_int,
7466 W: *const f32,
7467 lwork: *mut ::core::ffi::c_int,
7468 params: syevjInfo_t,
7469 ) -> cusolverStatus_t;
7470}
7471unsafe extern "C" {
7472 pub fn cusolverDnDsyevj_bufferSize(
7473 handle: cusolverDnHandle_t,
7474 jobz: cusolverEigMode_t,
7475 uplo: cublasFillMode_t,
7476 n: ::core::ffi::c_int,
7477 A: *const f64,
7478 lda: ::core::ffi::c_int,
7479 W: *const f64,
7480 lwork: *mut ::core::ffi::c_int,
7481 params: syevjInfo_t,
7482 ) -> cusolverStatus_t;
7483}
7484unsafe extern "C" {
7485 pub fn cusolverDnCheevj_bufferSize(
7486 handle: cusolverDnHandle_t,
7487 jobz: cusolverEigMode_t,
7488 uplo: cublasFillMode_t,
7489 n: ::core::ffi::c_int,
7490 A: *const cuComplex,
7491 lda: ::core::ffi::c_int,
7492 W: *const f32,
7493 lwork: *mut ::core::ffi::c_int,
7494 params: syevjInfo_t,
7495 ) -> cusolverStatus_t;
7496}
7497unsafe extern "C" {
7498 pub fn cusolverDnZheevj_bufferSize(
7499 handle: cusolverDnHandle_t,
7500 jobz: cusolverEigMode_t,
7501 uplo: cublasFillMode_t,
7502 n: ::core::ffi::c_int,
7503 A: *const cuDoubleComplex,
7504 lda: ::core::ffi::c_int,
7505 W: *const f64,
7506 lwork: *mut ::core::ffi::c_int,
7507 params: syevjInfo_t,
7508 ) -> cusolverStatus_t;
7509}
7510unsafe extern "C" {
7511 /// The helper functions below can calculate the sizes needed for pre-allocated buffer.
7512 ///
7513 /// The S and D data types are real valued single and double precision, respectively.
7514 ///
7515 /// The C and Z data types are complex valued single and double precision, respectively.
7516 ///
7517 /// This function computes eigenvalues and eigenvectors of a symmetric (Hermitian) $n \times n$ matrix `A`. The standard symmetric eigenvalue problem is:
7518 /// $$
7519 /// A\\*Q = Q\\*\Lambda
7520 /// $$
7521 ///
7522 /// 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.
7523 ///
7524 /// `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.
7525 ///
7526 /// How does it work?
7527 ///
7528 /// `syevj` iteratively generates a sequence of unitary matrices to transform matrix `A` to the following form:
7529 /// $$
7530 /// V^{H}\\*A\\*V = W + E
7531 /// $$
7532 ///
7533 /// where `W` is diagonal and `E` is symmetric without diagonal.
7534 ///
7535 /// 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:
7536 /// $$
7537 /// {\\|E\\|}_{F}\leq\operatorname{eps}\\*{\\|A\\|}_{F}
7538 /// $$
7539 ///
7540 /// where `eps` is the given tolerance.
7541 ///
7542 /// `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.
7543 ///
7544 /// 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.
7545 ///
7546 /// 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.
7547 /// $$
7548 /// {residual}={\\|E\\|}_{F} = {{\\|}\Lambda - W{\\|}}_{F}
7549 /// $$
7550 ///
7551 /// The same as `syevd`, the user has to provide working space pointed by input parameter `work`. The input parameter `lwork` is the size of the working space, and it is returned by `syevj_bufferSize()`. Please note that the size in bytes of the working space is equal to `sizeof(<type>) * lwork`.
7552 ///
7553 /// 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.
7554 ///
7555 /// If the user sets an improper tolerance, `syevj` may not converge. For example, tolerance should not be smaller than machine accuracy.
7556 ///
7557 /// If `jobz` = [`cusolverEigMode_t::CUSOLVER_EIG_MODE_VECTOR`], `A` contains the orthonormal eigenvectors `V`.
7558 ///
7559 /// Please visit [cuSOLVER Library Samples - syevj](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/syevj) for a code example.
7560 pub fn cusolverDnSsyevj(
7561 handle: cusolverDnHandle_t,
7562 jobz: cusolverEigMode_t,
7563 uplo: cublasFillMode_t,
7564 n: ::core::ffi::c_int,
7565 A: *mut f32,
7566 lda: ::core::ffi::c_int,
7567 W: *mut f32,
7568 work: *mut f32,
7569 lwork: ::core::ffi::c_int,
7570 info: *mut ::core::ffi::c_int,
7571 params: syevjInfo_t,
7572 ) -> cusolverStatus_t;
7573}
7574unsafe extern "C" {
7575 /// The helper functions below can calculate the sizes needed for pre-allocated buffer.
7576 ///
7577 /// The S and D data types are real valued single and double precision, respectively.
7578 ///
7579 /// The C and Z data types are complex valued single and double precision, respectively.
7580 ///
7581 /// This function computes eigenvalues and eigenvectors of a symmetric (Hermitian) $n \times n$ matrix `A`. The standard symmetric eigenvalue problem is:
7582 /// $$
7583 /// A\\*Q = Q\\*\Lambda
7584 /// $$
7585 ///
7586 /// 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.
7587 ///
7588 /// `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.
7589 ///
7590 /// How does it work?
7591 ///
7592 /// `syevj` iteratively generates a sequence of unitary matrices to transform matrix `A` to the following form:
7593 /// $$
7594 /// V^{H}\\*A\\*V = W + E
7595 /// $$
7596 ///
7597 /// where `W` is diagonal and `E` is symmetric without diagonal.
7598 ///
7599 /// 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:
7600 /// $$
7601 /// {\\|E\\|}_{F}\leq\operatorname{eps}\\*{\\|A\\|}_{F}
7602 /// $$
7603 ///
7604 /// where `eps` is the given tolerance.
7605 ///
7606 /// `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.
7607 ///
7608 /// 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.
7609 ///
7610 /// 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.
7611 /// $$
7612 /// {residual}={\\|E\\|}_{F} = {{\\|}\Lambda - W{\\|}}_{F}
7613 /// $$
7614 ///
7615 /// The same as `syevd`, the user has to provide working space pointed by input parameter `work`. The input parameter `lwork` is the size of the working space, and it is returned by `syevj_bufferSize()`. Please note that the size in bytes of the working space is equal to `sizeof(<type>) * lwork`.
7616 ///
7617 /// 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.
7618 ///
7619 /// If the user sets an improper tolerance, `syevj` may not converge. For example, tolerance should not be smaller than machine accuracy.
7620 ///
7621 /// If `jobz` = [`cusolverEigMode_t::CUSOLVER_EIG_MODE_VECTOR`], `A` contains the orthonormal eigenvectors `V`.
7622 ///
7623 /// Please visit [cuSOLVER Library Samples - syevj](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/syevj) for a code example.
7624 pub fn cusolverDnDsyevj(
7625 handle: cusolverDnHandle_t,
7626 jobz: cusolverEigMode_t,
7627 uplo: cublasFillMode_t,
7628 n: ::core::ffi::c_int,
7629 A: *mut f64,
7630 lda: ::core::ffi::c_int,
7631 W: *mut f64,
7632 work: *mut f64,
7633 lwork: ::core::ffi::c_int,
7634 info: *mut ::core::ffi::c_int,
7635 params: syevjInfo_t,
7636 ) -> cusolverStatus_t;
7637}
7638unsafe extern "C" {
7639 pub fn cusolverDnCheevj(
7640 handle: cusolverDnHandle_t,
7641 jobz: cusolverEigMode_t,
7642 uplo: cublasFillMode_t,
7643 n: ::core::ffi::c_int,
7644 A: *mut cuComplex,
7645 lda: ::core::ffi::c_int,
7646 W: *mut f32,
7647 work: *mut cuComplex,
7648 lwork: ::core::ffi::c_int,
7649 info: *mut ::core::ffi::c_int,
7650 params: syevjInfo_t,
7651 ) -> cusolverStatus_t;
7652}
7653unsafe extern "C" {
7654 pub fn cusolverDnZheevj(
7655 handle: cusolverDnHandle_t,
7656 jobz: cusolverEigMode_t,
7657 uplo: cublasFillMode_t,
7658 n: ::core::ffi::c_int,
7659 A: *mut cuDoubleComplex,
7660 lda: ::core::ffi::c_int,
7661 W: *mut f64,
7662 work: *mut cuDoubleComplex,
7663 lwork: ::core::ffi::c_int,
7664 info: *mut ::core::ffi::c_int,
7665 params: syevjInfo_t,
7666 ) -> cusolverStatus_t;
7667}
7668unsafe extern "C" {
7669 pub fn cusolverDnSsygvj_bufferSize(
7670 handle: cusolverDnHandle_t,
7671 itype: cusolverEigType_t,
7672 jobz: cusolverEigMode_t,
7673 uplo: cublasFillMode_t,
7674 n: ::core::ffi::c_int,
7675 A: *const f32,
7676 lda: ::core::ffi::c_int,
7677 B: *const f32,
7678 ldb: ::core::ffi::c_int,
7679 W: *const f32,
7680 lwork: *mut ::core::ffi::c_int,
7681 params: syevjInfo_t,
7682 ) -> cusolverStatus_t;
7683}
7684unsafe extern "C" {
7685 pub fn cusolverDnDsygvj_bufferSize(
7686 handle: cusolverDnHandle_t,
7687 itype: cusolverEigType_t,
7688 jobz: cusolverEigMode_t,
7689 uplo: cublasFillMode_t,
7690 n: ::core::ffi::c_int,
7691 A: *const f64,
7692 lda: ::core::ffi::c_int,
7693 B: *const f64,
7694 ldb: ::core::ffi::c_int,
7695 W: *const f64,
7696 lwork: *mut ::core::ffi::c_int,
7697 params: syevjInfo_t,
7698 ) -> cusolverStatus_t;
7699}
7700unsafe extern "C" {
7701 pub fn cusolverDnChegvj_bufferSize(
7702 handle: cusolverDnHandle_t,
7703 itype: cusolverEigType_t,
7704 jobz: cusolverEigMode_t,
7705 uplo: cublasFillMode_t,
7706 n: ::core::ffi::c_int,
7707 A: *const cuComplex,
7708 lda: ::core::ffi::c_int,
7709 B: *const cuComplex,
7710 ldb: ::core::ffi::c_int,
7711 W: *const f32,
7712 lwork: *mut ::core::ffi::c_int,
7713 params: syevjInfo_t,
7714 ) -> cusolverStatus_t;
7715}
7716unsafe extern "C" {
7717 pub fn cusolverDnZhegvj_bufferSize(
7718 handle: cusolverDnHandle_t,
7719 itype: cusolverEigType_t,
7720 jobz: cusolverEigMode_t,
7721 uplo: cublasFillMode_t,
7722 n: ::core::ffi::c_int,
7723 A: *const cuDoubleComplex,
7724 lda: ::core::ffi::c_int,
7725 B: *const cuDoubleComplex,
7726 ldb: ::core::ffi::c_int,
7727 W: *const f64,
7728 lwork: *mut ::core::ffi::c_int,
7729 params: syevjInfo_t,
7730 ) -> cusolverStatus_t;
7731}
7732unsafe extern "C" {
7733 /// The helper functions below can calculate the sizes needed for pre-allocated buffer.
7734 ///
7735 /// The S and D data types are real valued single and double precision, respectively.
7736 ///
7737 /// The C and Z data types are complex valued single and double precision, respectively.
7738 ///
7739 /// This function computes eigenvalues and eigenvectors of a symmetric (Hermitian) $n \times n$ matrix-pair (`A`,`B`). The generalized symmetric-definite eigenvalue problem is:
7740 /// $$
7741 /// \operatorname{eig}(A,B) =
7742 /// \begin{cases}
7743 /// A * V = B * V * \Lambda & \text{if } itype = \text{CUSOLVER_EIG_TYPE_1} \\
7744 /// A * B * V = V * \Lambda & \text{if } itype = \text{CUSOLVER_EIG_TYPE_2} \\
7745 /// B * A * V = V * \Lambda & \text{if } itype = \text{CUSOLVER_EIG_TYPE_3}
7746 /// \end{cases}
7747 /// $$
7748 ///
7749 /// 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:
7750 /// $$
7751 /// \begin{cases}
7752 /// V^H * B * V = I & \text{if } itype = \text{CUSOLVER_EIG_TYPE_1 or CUSOLVER_EIG_TYPE_2} \\
7753 /// V^H * \operatorname{inv}(B) * V = I & \text{if } itype = \text{CUSOLVER_EIG_TYPE_3}
7754 /// \end{cases}
7755 /// $$
7756 ///
7757 /// 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.
7758 ///
7759 /// However the meaning of residual is different from `syevj`. `sygvj` first computes Cholesky factorization of matrix `B`,
7760 /// $$
7761 /// B = L\\*L^{H}
7762 /// $$
7763 ///
7764 /// transform the problem to standard eigenvalue problem, then calls `syevj`.
7765 ///
7766 /// For example, the standard eigenvalue problem of type I is:
7767 /// $$
7768 /// M\\*Q = Q\\*\Lambda
7769 /// $$
7770 ///
7771 /// where matrix `M` is symmetric:
7772 /// $$
7773 /// M = L^{-1}\\*A\\*L^{-H}
7774 /// $$
7775 ///
7776 /// The residual is the result of `syevj` on matrix `M`, not `A`.
7777 ///
7778 /// The user has to provide working space which is pointed by input parameter `work`. The input parameter `lwork` is the size of the working space, and it is returned by `sygvj_bufferSize()`. Please note that the size in bytes of the working space is equal to `sizeof(<type>) * lwork`.
7779 ///
7780 /// If output parameter `info = -i` (less than zero), the `i-th` parameter is wrong (not counting handle). If `info = i` (i > 0 and i<=n), `B` is not positive definite, the factorization of `B` could not be completed and no eigenvalues or eigenvectors were computed. If `info = n+1`, `syevj` does not converge under given tolerance and maximum sweeps. In this case, the eigenvalues and eigenvectors are still computed because non-convergence comes from improper tolerance of maximum sweeps.
7781 ///
7782 /// if `jobz` = [`cusolverEigMode_t::CUSOLVER_EIG_MODE_VECTOR`], `A` contains the orthogonal eigenvectors `V`.
7783 ///
7784 /// Please visit [cuSOLVER Library Samples - sygvj](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/sygvj) for a code example.
7785 pub fn cusolverDnSsygvj(
7786 handle: cusolverDnHandle_t,
7787 itype: cusolverEigType_t,
7788 jobz: cusolverEigMode_t,
7789 uplo: cublasFillMode_t,
7790 n: ::core::ffi::c_int,
7791 A: *mut f32,
7792 lda: ::core::ffi::c_int,
7793 B: *mut f32,
7794 ldb: ::core::ffi::c_int,
7795 W: *mut f32,
7796 work: *mut f32,
7797 lwork: ::core::ffi::c_int,
7798 info: *mut ::core::ffi::c_int,
7799 params: syevjInfo_t,
7800 ) -> cusolverStatus_t;
7801}
7802unsafe extern "C" {
7803 /// The helper functions below can calculate the sizes needed for pre-allocated buffer.
7804 ///
7805 /// The S and D data types are real valued single and double precision, respectively.
7806 ///
7807 /// The C and Z data types are complex valued single and double precision, respectively.
7808 ///
7809 /// This function computes eigenvalues and eigenvectors of a symmetric (Hermitian) $n \times n$ matrix-pair (`A`,`B`). The generalized symmetric-definite eigenvalue problem is:
7810 /// $$
7811 /// \operatorname{eig}(A,B) =
7812 /// \begin{cases}
7813 /// A * V = B * V * \Lambda & \text{if } itype = \text{CUSOLVER_EIG_TYPE_1} \\
7814 /// A * B * V = V * \Lambda & \text{if } itype = \text{CUSOLVER_EIG_TYPE_2} \\
7815 /// B * A * V = V * \Lambda & \text{if } itype = \text{CUSOLVER_EIG_TYPE_3}
7816 /// \end{cases}
7817 /// $$
7818 ///
7819 /// 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:
7820 /// $$
7821 /// \begin{cases}
7822 /// V^H * B * V = I & \text{if } itype = \text{CUSOLVER_EIG_TYPE_1 or CUSOLVER_EIG_TYPE_2} \\
7823 /// V^H * \operatorname{inv}(B) * V = I & \text{if } itype = \text{CUSOLVER_EIG_TYPE_3}
7824 /// \end{cases}
7825 /// $$
7826 ///
7827 /// 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.
7828 ///
7829 /// However the meaning of residual is different from `syevj`. `sygvj` first computes Cholesky factorization of matrix `B`,
7830 /// $$
7831 /// B = L\\*L^{H}
7832 /// $$
7833 ///
7834 /// transform the problem to standard eigenvalue problem, then calls `syevj`.
7835 ///
7836 /// For example, the standard eigenvalue problem of type I is:
7837 /// $$
7838 /// M\\*Q = Q\\*\Lambda
7839 /// $$
7840 ///
7841 /// where matrix `M` is symmetric:
7842 /// $$
7843 /// M = L^{-1}\\*A\\*L^{-H}
7844 /// $$
7845 ///
7846 /// The residual is the result of `syevj` on matrix `M`, not `A`.
7847 ///
7848 /// The user has to provide working space which is pointed by input parameter `work`. The input parameter `lwork` is the size of the working space, and it is returned by `sygvj_bufferSize()`. Please note that the size in bytes of the working space is equal to `sizeof(<type>) * lwork`.
7849 ///
7850 /// If output parameter `info = -i` (less than zero), the `i-th` parameter is wrong (not counting handle). If `info = i` (i > 0 and i<=n), `B` is not positive definite, the factorization of `B` could not be completed and no eigenvalues or eigenvectors were computed. If `info = n+1`, `syevj` does not converge under given tolerance and maximum sweeps. In this case, the eigenvalues and eigenvectors are still computed because non-convergence comes from improper tolerance of maximum sweeps.
7851 ///
7852 /// if `jobz` = [`cusolverEigMode_t::CUSOLVER_EIG_MODE_VECTOR`], `A` contains the orthogonal eigenvectors `V`.
7853 ///
7854 /// Please visit [cuSOLVER Library Samples - sygvj](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/sygvj) for a code example.
7855 pub fn cusolverDnDsygvj(
7856 handle: cusolverDnHandle_t,
7857 itype: cusolverEigType_t,
7858 jobz: cusolverEigMode_t,
7859 uplo: cublasFillMode_t,
7860 n: ::core::ffi::c_int,
7861 A: *mut f64,
7862 lda: ::core::ffi::c_int,
7863 B: *mut f64,
7864 ldb: ::core::ffi::c_int,
7865 W: *mut f64,
7866 work: *mut f64,
7867 lwork: ::core::ffi::c_int,
7868 info: *mut ::core::ffi::c_int,
7869 params: syevjInfo_t,
7870 ) -> cusolverStatus_t;
7871}
7872unsafe extern "C" {
7873 pub fn cusolverDnChegvj(
7874 handle: cusolverDnHandle_t,
7875 itype: cusolverEigType_t,
7876 jobz: cusolverEigMode_t,
7877 uplo: cublasFillMode_t,
7878 n: ::core::ffi::c_int,
7879 A: *mut cuComplex,
7880 lda: ::core::ffi::c_int,
7881 B: *mut cuComplex,
7882 ldb: ::core::ffi::c_int,
7883 W: *mut f32,
7884 work: *mut cuComplex,
7885 lwork: ::core::ffi::c_int,
7886 info: *mut ::core::ffi::c_int,
7887 params: syevjInfo_t,
7888 ) -> cusolverStatus_t;
7889}
7890unsafe extern "C" {
7891 pub fn cusolverDnZhegvj(
7892 handle: cusolverDnHandle_t,
7893 itype: cusolverEigType_t,
7894 jobz: cusolverEigMode_t,
7895 uplo: cublasFillMode_t,
7896 n: ::core::ffi::c_int,
7897 A: *mut cuDoubleComplex,
7898 lda: ::core::ffi::c_int,
7899 B: *mut cuDoubleComplex,
7900 ldb: ::core::ffi::c_int,
7901 W: *mut f64,
7902 work: *mut cuDoubleComplex,
7903 lwork: ::core::ffi::c_int,
7904 info: *mut ::core::ffi::c_int,
7905 params: syevjInfo_t,
7906 ) -> cusolverStatus_t;
7907}
7908unsafe extern "C" {
7909 /// This function creates and initializes the structure of `gesvdj` and `gesvdjBatched` to default values.
7910 ///
7911 /// # Parameters
7912 ///
7913 /// - `info`: The pointer to the structure of `gesvdj`.
7914 ///
7915 /// # Return value
7916 ///
7917 /// - [`cusolverStatus_t::CUSOLVER_STATUS_ALLOC_FAILED`]: The resources could not be allocated.
7918 /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The structure was initialized successfully.
7919 pub fn cusolverDnCreateGesvdjInfo(info: *mut gesvdjInfo_t) -> cusolverStatus_t;
7920}
7921unsafe extern "C" {
7922 /// This function destroys and releases any memory required by the structure.
7923 ///
7924 /// # Parameters
7925 ///
7926 /// - `info`: The structure of `gesvdj`.
7927 ///
7928 /// # Return value
7929 ///
7930 /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The resources were released successfully.
7931 pub fn cusolverDnDestroyGesvdjInfo(info: gesvdjInfo_t) -> cusolverStatus_t;
7932}
7933unsafe extern "C" {
7934 /// This function configures tolerance of `gesvdj`.
7935 ///
7936 /// # Parameters
7937 ///
7938 /// - `info`: The pointer to the structure of `gesvdj`.
7939 /// - `tolerance`: Accuracy of numerical singular values.
7940 ///
7941 /// # Return value
7942 ///
7943 /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The operation completed successfully.
7944 pub fn cusolverDnXgesvdjSetTolerance(
7945 info: gesvdjInfo_t,
7946 tolerance: f64,
7947 ) -> cusolverStatus_t;
7948}
7949unsafe extern "C" {
7950 /// This function configures the maximum number of sweeps in `gesvdj`. The default value is 100.
7951 ///
7952 /// # Parameters
7953 ///
7954 /// - `info`: The pointer to the structure of `gesvdj`.
7955 /// - `max_sweeps`: Maximum number of sweeps.
7956 ///
7957 /// # Return value
7958 ///
7959 /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The operation completed successfully.
7960 pub fn cusolverDnXgesvdjSetMaxSweeps(
7961 info: gesvdjInfo_t,
7962 max_sweeps: ::core::ffi::c_int,
7963 ) -> cusolverStatus_t;
7964}
7965unsafe extern "C" {
7966 /// 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.
7967 ///
7968 /// # Parameters
7969 ///
7970 /// - `info`: The pointer to the structure of `gesvdj`.
7971 /// - `sort_svd`: If `sort_svd` is zero, the singular values are not sorted.
7972 ///
7973 /// # Return value
7974 ///
7975 /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The operation completed successfully.
7976 pub fn cusolverDnXgesvdjSetSortEig(
7977 info: gesvdjInfo_t,
7978 sort_svd: ::core::ffi::c_int,
7979 ) -> cusolverStatus_t;
7980}
7981unsafe extern "C" {
7982 /// 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:
7983 /// $$
7984 /// {\\|{S} - {U}^{H}\\*{A}\\*{V}\\|}_{F}
7985 /// $$
7986 ///
7987 /// This function does not support `gesvdjBatched`. If the user calls this function after `gesvdjBatched`, the error [`cusolverStatus_t::CUSOLVER_STATUS_NOT_SUPPORTED`] is returned.
7988 ///
7989 /// # Parameters
7990 ///
7991 /// - `handle`: Handle to the cuSolverDN library context.
7992 /// - `info`: The pointer to the structure of `gesvdj`.
7993 /// - `residual`: Residual of `gesvdj`.
7994 ///
7995 /// # Return value
7996 ///
7997 /// - [`cusolverStatus_t::CUSOLVER_STATUS_NOT_SUPPORTED`]: Does not support batched version.
7998 /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The operation completed successfully.
7999 pub fn cusolverDnXgesvdjGetResidual(
8000 handle: cusolverDnHandle_t,
8001 info: gesvdjInfo_t,
8002 residual: *mut f64,
8003 ) -> cusolverStatus_t;
8004}
8005unsafe extern "C" {
8006 /// 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.
8007 ///
8008 /// # Parameters
8009 ///
8010 /// - `handle`: Handle to the cuSolverDN library context.
8011 /// - `info`: The pointer to the structure of `gesvdj`.
8012 /// - `executed_sweeps`: Number of executed sweeps.
8013 ///
8014 /// # Return value
8015 ///
8016 /// - [`cusolverStatus_t::CUSOLVER_STATUS_NOT_SUPPORTED`]: Does not support batched version.
8017 /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The operation completed successfully.
8018 pub fn cusolverDnXgesvdjGetSweeps(
8019 handle: cusolverDnHandle_t,
8020 info: gesvdjInfo_t,
8021 executed_sweeps: *mut ::core::ffi::c_int,
8022 ) -> cusolverStatus_t;
8023}
8024unsafe extern "C" {
8025 pub fn cusolverDnSgesvdjBatched_bufferSize(
8026 handle: cusolverDnHandle_t,
8027 jobz: cusolverEigMode_t,
8028 m: ::core::ffi::c_int,
8029 n: ::core::ffi::c_int,
8030 A: *const f32,
8031 lda: ::core::ffi::c_int,
8032 S: *const f32,
8033 U: *const f32,
8034 ldu: ::core::ffi::c_int,
8035 V: *const f32,
8036 ldv: ::core::ffi::c_int,
8037 lwork: *mut ::core::ffi::c_int,
8038 params: gesvdjInfo_t,
8039 batchSize: ::core::ffi::c_int,
8040 ) -> cusolverStatus_t;
8041}
8042unsafe extern "C" {
8043 pub fn cusolverDnDgesvdjBatched_bufferSize(
8044 handle: cusolverDnHandle_t,
8045 jobz: cusolverEigMode_t,
8046 m: ::core::ffi::c_int,
8047 n: ::core::ffi::c_int,
8048 A: *const f64,
8049 lda: ::core::ffi::c_int,
8050 S: *const f64,
8051 U: *const f64,
8052 ldu: ::core::ffi::c_int,
8053 V: *const f64,
8054 ldv: ::core::ffi::c_int,
8055 lwork: *mut ::core::ffi::c_int,
8056 params: gesvdjInfo_t,
8057 batchSize: ::core::ffi::c_int,
8058 ) -> cusolverStatus_t;
8059}
8060unsafe extern "C" {
8061 pub fn cusolverDnCgesvdjBatched_bufferSize(
8062 handle: cusolverDnHandle_t,
8063 jobz: cusolverEigMode_t,
8064 m: ::core::ffi::c_int,
8065 n: ::core::ffi::c_int,
8066 A: *const cuComplex,
8067 lda: ::core::ffi::c_int,
8068 S: *const f32,
8069 U: *const cuComplex,
8070 ldu: ::core::ffi::c_int,
8071 V: *const cuComplex,
8072 ldv: ::core::ffi::c_int,
8073 lwork: *mut ::core::ffi::c_int,
8074 params: gesvdjInfo_t,
8075 batchSize: ::core::ffi::c_int,
8076 ) -> cusolverStatus_t;
8077}
8078unsafe extern "C" {
8079 pub fn cusolverDnZgesvdjBatched_bufferSize(
8080 handle: cusolverDnHandle_t,
8081 jobz: cusolverEigMode_t,
8082 m: ::core::ffi::c_int,
8083 n: ::core::ffi::c_int,
8084 A: *const cuDoubleComplex,
8085 lda: ::core::ffi::c_int,
8086 S: *const f64,
8087 U: *const cuDoubleComplex,
8088 ldu: ::core::ffi::c_int,
8089 V: *const cuDoubleComplex,
8090 ldv: ::core::ffi::c_int,
8091 lwork: *mut ::core::ffi::c_int,
8092 params: gesvdjInfo_t,
8093 batchSize: ::core::ffi::c_int,
8094 ) -> cusolverStatus_t;
8095}
8096unsafe extern "C" {
8097 /// The helper functions below can calculate the sizes needed for pre-allocated buffer.
8098 ///
8099 /// The S and D data types are real valued single and double precision, respectively.
8100 ///
8101 /// The C and Z data types are complex valued single and double precision, respectively.
8102 ///
8103 /// This function computes singular values and singular vectors of a sequence of general $m \times n$ matrices:
8104 /// $$
8105 /// A_{j} = U_{j}\\*\Sigma_{j}\\*V_{j}^{H}
8106 /// $$
8107 ///
8108 /// 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.
8109 ///
8110 /// `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,
8111 /// $$
8112 /// \begin{split}A = \begin{pmatrix}
8113 /// {A0} & {A1} & \cdots \\\\
8114 /// \end{pmatrix}\end{split}
8115 /// $$
8116 ///
8117 /// 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}$.
8118 ///
8119 /// The parameter `S` also contains singular values of each matrix in contiguous way,
8120 /// $$
8121 /// \begin{split}S = \begin{pmatrix}
8122 /// {S0} & {S1} & \cdots \\\\
8123 /// \end{pmatrix}\end{split}
8124 /// $$
8125 ///
8126 /// The formula for random access of `S` is $S_{k}\operatorname{(j)} = {S\lbrack\ j\ +\ min(m,n)\\*k\rbrack}$.
8127 ///
8128 /// 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.
8129 ///
8130 /// `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.
8131 ///
8132 /// The user has to provide working space pointed by input parameter `work`. The input parameter `lwork` is the size of the working space, and it is returned by `gesvdjBatched_bufferSize()`. Please note that the size in bytes of the working space is equal to `sizeof(<type>) * lwork`.
8133 ///
8134 /// 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.
8135 ///
8136 /// Please visit [cuSOLVER Library Samples - gesvdjBatched](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/gesvdjBatched) for a code example.
8137 pub fn cusolverDnSgesvdjBatched(
8138 handle: cusolverDnHandle_t,
8139 jobz: cusolverEigMode_t,
8140 m: ::core::ffi::c_int,
8141 n: ::core::ffi::c_int,
8142 A: *mut f32,
8143 lda: ::core::ffi::c_int,
8144 S: *mut f32,
8145 U: *mut f32,
8146 ldu: ::core::ffi::c_int,
8147 V: *mut f32,
8148 ldv: ::core::ffi::c_int,
8149 work: *mut f32,
8150 lwork: ::core::ffi::c_int,
8151 info: *mut ::core::ffi::c_int,
8152 params: gesvdjInfo_t,
8153 batchSize: ::core::ffi::c_int,
8154 ) -> cusolverStatus_t;
8155}
8156unsafe extern "C" {
8157 /// The helper functions below can calculate the sizes needed for pre-allocated buffer.
8158 ///
8159 /// The S and D data types are real valued single and double precision, respectively.
8160 ///
8161 /// The C and Z data types are complex valued single and double precision, respectively.
8162 ///
8163 /// This function computes singular values and singular vectors of a sequence of general $m \times n$ matrices:
8164 /// $$
8165 /// A_{j} = U_{j}\\*\Sigma_{j}\\*V_{j}^{H}
8166 /// $$
8167 ///
8168 /// 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.
8169 ///
8170 /// `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,
8171 /// $$
8172 /// \begin{split}A = \begin{pmatrix}
8173 /// {A0} & {A1} & \cdots \\\\
8174 /// \end{pmatrix}\end{split}
8175 /// $$
8176 ///
8177 /// 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}$.
8178 ///
8179 /// The parameter `S` also contains singular values of each matrix in contiguous way,
8180 /// $$
8181 /// \begin{split}S = \begin{pmatrix}
8182 /// {S0} & {S1} & \cdots \\\\
8183 /// \end{pmatrix}\end{split}
8184 /// $$
8185 ///
8186 /// The formula for random access of `S` is $S_{k}\operatorname{(j)} = {S\lbrack\ j\ +\ min(m,n)\\*k\rbrack}$.
8187 ///
8188 /// 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.
8189 ///
8190 /// `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.
8191 ///
8192 /// The user has to provide working space pointed by input parameter `work`. The input parameter `lwork` is the size of the working space, and it is returned by `gesvdjBatched_bufferSize()`. Please note that the size in bytes of the working space is equal to `sizeof(<type>) * lwork`.
8193 ///
8194 /// 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.
8195 ///
8196 /// Please visit [cuSOLVER Library Samples - gesvdjBatched](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/gesvdjBatched) for a code example.
8197 pub fn cusolverDnDgesvdjBatched(
8198 handle: cusolverDnHandle_t,
8199 jobz: cusolverEigMode_t,
8200 m: ::core::ffi::c_int,
8201 n: ::core::ffi::c_int,
8202 A: *mut f64,
8203 lda: ::core::ffi::c_int,
8204 S: *mut f64,
8205 U: *mut f64,
8206 ldu: ::core::ffi::c_int,
8207 V: *mut f64,
8208 ldv: ::core::ffi::c_int,
8209 work: *mut f64,
8210 lwork: ::core::ffi::c_int,
8211 info: *mut ::core::ffi::c_int,
8212 params: gesvdjInfo_t,
8213 batchSize: ::core::ffi::c_int,
8214 ) -> cusolverStatus_t;
8215}
8216unsafe extern "C" {
8217 /// The helper functions below can calculate the sizes needed for pre-allocated buffer.
8218 ///
8219 /// The S and D data types are real valued single and double precision, respectively.
8220 ///
8221 /// The C and Z data types are complex valued single and double precision, respectively.
8222 ///
8223 /// This function computes singular values and singular vectors of a sequence of general $m \times n$ matrices:
8224 /// $$
8225 /// A_{j} = U_{j}\\*\Sigma_{j}\\*V_{j}^{H}
8226 /// $$
8227 ///
8228 /// 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.
8229 ///
8230 /// `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,
8231 /// $$
8232 /// \begin{split}A = \begin{pmatrix}
8233 /// {A0} & {A1} & \cdots \\\\
8234 /// \end{pmatrix}\end{split}
8235 /// $$
8236 ///
8237 /// 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}$.
8238 ///
8239 /// The parameter `S` also contains singular values of each matrix in contiguous way,
8240 /// $$
8241 /// \begin{split}S = \begin{pmatrix}
8242 /// {S0} & {S1} & \cdots \\\\
8243 /// \end{pmatrix}\end{split}
8244 /// $$
8245 ///
8246 /// The formula for random access of `S` is $S_{k}\operatorname{(j)} = {S\lbrack\ j\ +\ min(m,n)\\*k\rbrack}$.
8247 ///
8248 /// 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.
8249 ///
8250 /// `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.
8251 ///
8252 /// The user has to provide working space pointed by input parameter `work`. The input parameter `lwork` is the size of the working space, and it is returned by `gesvdjBatched_bufferSize()`. Please note that the size in bytes of the working space is equal to `sizeof(<type>) * lwork`.
8253 ///
8254 /// 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.
8255 ///
8256 /// Please visit [cuSOLVER Library Samples - gesvdjBatched](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/gesvdjBatched) for a code example.
8257 pub fn cusolverDnCgesvdjBatched(
8258 handle: cusolverDnHandle_t,
8259 jobz: cusolverEigMode_t,
8260 m: ::core::ffi::c_int,
8261 n: ::core::ffi::c_int,
8262 A: *mut cuComplex,
8263 lda: ::core::ffi::c_int,
8264 S: *mut f32,
8265 U: *mut cuComplex,
8266 ldu: ::core::ffi::c_int,
8267 V: *mut cuComplex,
8268 ldv: ::core::ffi::c_int,
8269 work: *mut cuComplex,
8270 lwork: ::core::ffi::c_int,
8271 info: *mut ::core::ffi::c_int,
8272 params: gesvdjInfo_t,
8273 batchSize: ::core::ffi::c_int,
8274 ) -> cusolverStatus_t;
8275}
8276unsafe extern "C" {
8277 /// The helper functions below can calculate the sizes needed for pre-allocated buffer.
8278 ///
8279 /// The S and D data types are real valued single and double precision, respectively.
8280 ///
8281 /// The C and Z data types are complex valued single and double precision, respectively.
8282 ///
8283 /// This function computes singular values and singular vectors of a sequence of general $m \times n$ matrices:
8284 /// $$
8285 /// A_{j} = U_{j}\\*\Sigma_{j}\\*V_{j}^{H}
8286 /// $$
8287 ///
8288 /// 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.
8289 ///
8290 /// `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,
8291 /// $$
8292 /// \begin{split}A = \begin{pmatrix}
8293 /// {A0} & {A1} & \cdots \\\\
8294 /// \end{pmatrix}\end{split}
8295 /// $$
8296 ///
8297 /// 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}$.
8298 ///
8299 /// The parameter `S` also contains singular values of each matrix in contiguous way,
8300 /// $$
8301 /// \begin{split}S = \begin{pmatrix}
8302 /// {S0} & {S1} & \cdots \\\\
8303 /// \end{pmatrix}\end{split}
8304 /// $$
8305 ///
8306 /// The formula for random access of `S` is $S_{k}\operatorname{(j)} = {S\lbrack\ j\ +\ min(m,n)\\*k\rbrack}$.
8307 ///
8308 /// 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.
8309 ///
8310 /// `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.
8311 ///
8312 /// The user has to provide working space pointed by input parameter `work`. The input parameter `lwork` is the size of the working space, and it is returned by `gesvdjBatched_bufferSize()`. Please note that the size in bytes of the working space is equal to `sizeof(<type>) * lwork`.
8313 ///
8314 /// 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.
8315 ///
8316 /// Please visit [cuSOLVER Library Samples - gesvdjBatched](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/gesvdjBatched) for a code example.
8317 pub fn cusolverDnZgesvdjBatched(
8318 handle: cusolverDnHandle_t,
8319 jobz: cusolverEigMode_t,
8320 m: ::core::ffi::c_int,
8321 n: ::core::ffi::c_int,
8322 A: *mut cuDoubleComplex,
8323 lda: ::core::ffi::c_int,
8324 S: *mut f64,
8325 U: *mut cuDoubleComplex,
8326 ldu: ::core::ffi::c_int,
8327 V: *mut cuDoubleComplex,
8328 ldv: ::core::ffi::c_int,
8329 work: *mut cuDoubleComplex,
8330 lwork: ::core::ffi::c_int,
8331 info: *mut ::core::ffi::c_int,
8332 params: gesvdjInfo_t,
8333 batchSize: ::core::ffi::c_int,
8334 ) -> cusolverStatus_t;
8335}
8336unsafe extern "C" {
8337 pub fn cusolverDnSgesvdj_bufferSize(
8338 handle: cusolverDnHandle_t,
8339 jobz: cusolverEigMode_t,
8340 econ: ::core::ffi::c_int,
8341 m: ::core::ffi::c_int,
8342 n: ::core::ffi::c_int,
8343 A: *const f32,
8344 lda: ::core::ffi::c_int,
8345 S: *const f32,
8346 U: *const f32,
8347 ldu: ::core::ffi::c_int,
8348 V: *const f32,
8349 ldv: ::core::ffi::c_int,
8350 lwork: *mut ::core::ffi::c_int,
8351 params: gesvdjInfo_t,
8352 ) -> cusolverStatus_t;
8353}
8354unsafe extern "C" {
8355 pub fn cusolverDnDgesvdj_bufferSize(
8356 handle: cusolverDnHandle_t,
8357 jobz: cusolverEigMode_t,
8358 econ: ::core::ffi::c_int,
8359 m: ::core::ffi::c_int,
8360 n: ::core::ffi::c_int,
8361 A: *const f64,
8362 lda: ::core::ffi::c_int,
8363 S: *const f64,
8364 U: *const f64,
8365 ldu: ::core::ffi::c_int,
8366 V: *const f64,
8367 ldv: ::core::ffi::c_int,
8368 lwork: *mut ::core::ffi::c_int,
8369 params: gesvdjInfo_t,
8370 ) -> cusolverStatus_t;
8371}
8372unsafe extern "C" {
8373 pub fn cusolverDnCgesvdj_bufferSize(
8374 handle: cusolverDnHandle_t,
8375 jobz: cusolverEigMode_t,
8376 econ: ::core::ffi::c_int,
8377 m: ::core::ffi::c_int,
8378 n: ::core::ffi::c_int,
8379 A: *const cuComplex,
8380 lda: ::core::ffi::c_int,
8381 S: *const f32,
8382 U: *const cuComplex,
8383 ldu: ::core::ffi::c_int,
8384 V: *const cuComplex,
8385 ldv: ::core::ffi::c_int,
8386 lwork: *mut ::core::ffi::c_int,
8387 params: gesvdjInfo_t,
8388 ) -> cusolverStatus_t;
8389}
8390unsafe extern "C" {
8391 pub fn cusolverDnZgesvdj_bufferSize(
8392 handle: cusolverDnHandle_t,
8393 jobz: cusolverEigMode_t,
8394 econ: ::core::ffi::c_int,
8395 m: ::core::ffi::c_int,
8396 n: ::core::ffi::c_int,
8397 A: *const cuDoubleComplex,
8398 lda: ::core::ffi::c_int,
8399 S: *const f64,
8400 U: *const cuDoubleComplex,
8401 ldu: ::core::ffi::c_int,
8402 V: *const cuDoubleComplex,
8403 ldv: ::core::ffi::c_int,
8404 lwork: *mut ::core::ffi::c_int,
8405 params: gesvdjInfo_t,
8406 ) -> cusolverStatus_t;
8407}
8408unsafe extern "C" {
8409 /// The helper functions below can calculate the sizes needed for pre-allocated buffer.
8410 ///
8411 /// The S and D data types are real valued single and double precision, respectively.
8412 ///
8413 /// The C and Z data types are complex valued single and double precision, respectively.
8414 ///
8415 /// 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:
8416 /// $$
8417 /// A = U\\*\Sigma\\*V^{H}
8418 /// $$
8419 ///
8420 /// 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`.
8421 ///
8422 /// `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.
8423 ///
8424 /// `gesvdj` iteratively generates a sequence of unitary matrices to transform matrix `A` to the following form:
8425 /// $$
8426 /// U^{H}\\*A\\*V = S + E
8427 /// $$
8428 ///
8429 /// where `S` is diagonal and diagonal of `E` is zero.
8430 ///
8431 /// 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:
8432 /// $$
8433 /// {\\|E\\|}_{F}\leq\operatorname{eps}\\*{\\|A\\|}_{F}
8434 /// $$
8435 ///
8436 /// where `eps` is given tolerance. Note that if the real residual norm:
8437 /// $$
8438 /// {\\|{S} - {U}^{H}\\*{A}\\*{V}\\|}_{F}
8439 /// $$
8440 ///
8441 /// 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:
8442 /// $$
8443 /// \frac{\\|S - U^{H} \\* A \\* V\\|_F}{O(N) \\* \\|A\\|_F} \leq \frac{\\|E\\|_F}{\\|A\\|_F} \leq \operatorname{eps}
8444 /// $$
8445 ///
8446 /// $O(N)$ is typically $N$, but the constant depends on the number of sweeps, which gives an upper roundoff error bound of $sweeps \\* N$.
8447 ///
8448 /// `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.
8449 ///
8450 /// 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.
8451 ///
8452 /// The user has to provide working space which is pointed by input parameter `work`. The input parameter `lwork` is the size of the working space, and it is returned by `gesvdj_bufferSize()`. Please note that the size in bytes of the working space is equal to `sizeof(<type>) * lwork`.
8453 ///
8454 /// 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.
8455 ///
8456 /// If the user sets an improper tolerance, `gesvdj` may not converge. For example, tolerance should not be smaller than machine accuracy.
8457 ///
8458 /// Please visit [cuSOLVER Library Samples - gesvdj](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/gesvdj) for a code example.
8459 ///
8460 /// Remark 1: `gesvdj` supports any combination of `m` and `n`.
8461 ///
8462 /// Remark 2: the routine returns `V`, not $V^{H}$. This is different from `gesvd`.
8463 pub fn cusolverDnSgesvdj(
8464 handle: cusolverDnHandle_t,
8465 jobz: cusolverEigMode_t,
8466 econ: ::core::ffi::c_int,
8467 m: ::core::ffi::c_int,
8468 n: ::core::ffi::c_int,
8469 A: *mut f32,
8470 lda: ::core::ffi::c_int,
8471 S: *mut f32,
8472 U: *mut f32,
8473 ldu: ::core::ffi::c_int,
8474 V: *mut f32,
8475 ldv: ::core::ffi::c_int,
8476 work: *mut f32,
8477 lwork: ::core::ffi::c_int,
8478 info: *mut ::core::ffi::c_int,
8479 params: gesvdjInfo_t,
8480 ) -> cusolverStatus_t;
8481}
8482unsafe extern "C" {
8483 /// The helper functions below can calculate the sizes needed for pre-allocated buffer.
8484 ///
8485 /// The S and D data types are real valued single and double precision, respectively.
8486 ///
8487 /// The C and Z data types are complex valued single and double precision, respectively.
8488 ///
8489 /// 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:
8490 /// $$
8491 /// A = U\\*\Sigma\\*V^{H}
8492 /// $$
8493 ///
8494 /// 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`.
8495 ///
8496 /// `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.
8497 ///
8498 /// `gesvdj` iteratively generates a sequence of unitary matrices to transform matrix `A` to the following form:
8499 /// $$
8500 /// U^{H}\\*A\\*V = S + E
8501 /// $$
8502 ///
8503 /// where `S` is diagonal and diagonal of `E` is zero.
8504 ///
8505 /// 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:
8506 /// $$
8507 /// {\\|E\\|}_{F}\leq\operatorname{eps}\\*{\\|A\\|}_{F}
8508 /// $$
8509 ///
8510 /// where `eps` is given tolerance. Note that if the real residual norm:
8511 /// $$
8512 /// {\\|{S} - {U}^{H}\\*{A}\\*{V}\\|}_{F}
8513 /// $$
8514 ///
8515 /// 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:
8516 /// $$
8517 /// \frac{\\|S - U^{H} \\* A \\* V\\|_F}{O(N) \\* \\|A\\|_F} \leq \frac{\\|E\\|_F}{\\|A\\|_F} \leq \operatorname{eps}
8518 /// $$
8519 ///
8520 /// $O(N)$ is typically $N$, but the constant depends on the number of sweeps, which gives an upper roundoff error bound of $sweeps \\* N$.
8521 ///
8522 /// `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.
8523 ///
8524 /// 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.
8525 ///
8526 /// The user has to provide working space which is pointed by input parameter `work`. The input parameter `lwork` is the size of the working space, and it is returned by `gesvdj_bufferSize()`. Please note that the size in bytes of the working space is equal to `sizeof(<type>) * lwork`.
8527 ///
8528 /// 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.
8529 ///
8530 /// If the user sets an improper tolerance, `gesvdj` may not converge. For example, tolerance should not be smaller than machine accuracy.
8531 ///
8532 /// Please visit [cuSOLVER Library Samples - gesvdj](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/gesvdj) for a code example.
8533 ///
8534 /// Remark 1: `gesvdj` supports any combination of `m` and `n`.
8535 ///
8536 /// Remark 2: the routine returns `V`, not $V^{H}$. This is different from `gesvd`.
8537 pub fn cusolverDnDgesvdj(
8538 handle: cusolverDnHandle_t,
8539 jobz: cusolverEigMode_t,
8540 econ: ::core::ffi::c_int,
8541 m: ::core::ffi::c_int,
8542 n: ::core::ffi::c_int,
8543 A: *mut f64,
8544 lda: ::core::ffi::c_int,
8545 S: *mut f64,
8546 U: *mut f64,
8547 ldu: ::core::ffi::c_int,
8548 V: *mut f64,
8549 ldv: ::core::ffi::c_int,
8550 work: *mut f64,
8551 lwork: ::core::ffi::c_int,
8552 info: *mut ::core::ffi::c_int,
8553 params: gesvdjInfo_t,
8554 ) -> cusolverStatus_t;
8555}
8556unsafe extern "C" {
8557 /// The helper functions below can calculate the sizes needed for pre-allocated buffer.
8558 ///
8559 /// The S and D data types are real valued single and double precision, respectively.
8560 ///
8561 /// The C and Z data types are complex valued single and double precision, respectively.
8562 ///
8563 /// 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:
8564 /// $$
8565 /// A = U\\*\Sigma\\*V^{H}
8566 /// $$
8567 ///
8568 /// 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`.
8569 ///
8570 /// `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.
8571 ///
8572 /// `gesvdj` iteratively generates a sequence of unitary matrices to transform matrix `A` to the following form:
8573 /// $$
8574 /// U^{H}\\*A\\*V = S + E
8575 /// $$
8576 ///
8577 /// where `S` is diagonal and diagonal of `E` is zero.
8578 ///
8579 /// 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:
8580 /// $$
8581 /// {\\|E\\|}_{F}\leq\operatorname{eps}\\*{\\|A\\|}_{F}
8582 /// $$
8583 ///
8584 /// where `eps` is given tolerance. Note that if the real residual norm:
8585 /// $$
8586 /// {\\|{S} - {U}^{H}\\*{A}\\*{V}\\|}_{F}
8587 /// $$
8588 ///
8589 /// 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:
8590 /// $$
8591 /// \frac{\\|S - U^{H} \\* A \\* V\\|_F}{O(N) \\* \\|A\\|_F} \leq \frac{\\|E\\|_F}{\\|A\\|_F} \leq \operatorname{eps}
8592 /// $$
8593 ///
8594 /// $O(N)$ is typically $N$, but the constant depends on the number of sweeps, which gives an upper roundoff error bound of $sweeps \\* N$.
8595 ///
8596 /// `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.
8597 ///
8598 /// 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.
8599 ///
8600 /// The user has to provide working space which is pointed by input parameter `work`. The input parameter `lwork` is the size of the working space, and it is returned by `gesvdj_bufferSize()`. Please note that the size in bytes of the working space is equal to `sizeof(<type>) * lwork`.
8601 ///
8602 /// 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.
8603 ///
8604 /// If the user sets an improper tolerance, `gesvdj` may not converge. For example, tolerance should not be smaller than machine accuracy.
8605 ///
8606 /// Please visit [cuSOLVER Library Samples - gesvdj](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/gesvdj) for a code example.
8607 ///
8608 /// Remark 1: `gesvdj` supports any combination of `m` and `n`.
8609 ///
8610 /// Remark 2: the routine returns `V`, not $V^{H}$. This is different from `gesvd`.
8611 pub fn cusolverDnCgesvdj(
8612 handle: cusolverDnHandle_t,
8613 jobz: cusolverEigMode_t,
8614 econ: ::core::ffi::c_int,
8615 m: ::core::ffi::c_int,
8616 n: ::core::ffi::c_int,
8617 A: *mut cuComplex,
8618 lda: ::core::ffi::c_int,
8619 S: *mut f32,
8620 U: *mut cuComplex,
8621 ldu: ::core::ffi::c_int,
8622 V: *mut cuComplex,
8623 ldv: ::core::ffi::c_int,
8624 work: *mut cuComplex,
8625 lwork: ::core::ffi::c_int,
8626 info: *mut ::core::ffi::c_int,
8627 params: gesvdjInfo_t,
8628 ) -> cusolverStatus_t;
8629}
8630unsafe extern "C" {
8631 /// The helper functions below can calculate the sizes needed for pre-allocated buffer.
8632 ///
8633 /// The S and D data types are real valued single and double precision, respectively.
8634 ///
8635 /// The C and Z data types are complex valued single and double precision, respectively.
8636 ///
8637 /// 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:
8638 /// $$
8639 /// A = U\\*\Sigma\\*V^{H}
8640 /// $$
8641 ///
8642 /// 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`.
8643 ///
8644 /// `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.
8645 ///
8646 /// `gesvdj` iteratively generates a sequence of unitary matrices to transform matrix `A` to the following form:
8647 /// $$
8648 /// U^{H}\\*A\\*V = S + E
8649 /// $$
8650 ///
8651 /// where `S` is diagonal and diagonal of `E` is zero.
8652 ///
8653 /// 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:
8654 /// $$
8655 /// {\\|E\\|}_{F}\leq\operatorname{eps}\\*{\\|A\\|}_{F}
8656 /// $$
8657 ///
8658 /// where `eps` is given tolerance. Note that if the real residual norm:
8659 /// $$
8660 /// {\\|{S} - {U}^{H}\\*{A}\\*{V}\\|}_{F}
8661 /// $$
8662 ///
8663 /// 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:
8664 /// $$
8665 /// \frac{\\|S - U^{H} \\* A \\* V\\|_F}{O(N) \\* \\|A\\|_F} \leq \frac{\\|E\\|_F}{\\|A\\|_F} \leq \operatorname{eps}
8666 /// $$
8667 ///
8668 /// $O(N)$ is typically $N$, but the constant depends on the number of sweeps, which gives an upper roundoff error bound of $sweeps \\* N$.
8669 ///
8670 /// `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.
8671 ///
8672 /// 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.
8673 ///
8674 /// The user has to provide working space which is pointed by input parameter `work`. The input parameter `lwork` is the size of the working space, and it is returned by `gesvdj_bufferSize()`. Please note that the size in bytes of the working space is equal to `sizeof(<type>) * lwork`.
8675 ///
8676 /// 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.
8677 ///
8678 /// If the user sets an improper tolerance, `gesvdj` may not converge. For example, tolerance should not be smaller than machine accuracy.
8679 ///
8680 /// Please visit [cuSOLVER Library Samples - gesvdj](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/gesvdj) for a code example.
8681 ///
8682 /// Remark 1: `gesvdj` supports any combination of `m` and `n`.
8683 ///
8684 /// Remark 2: the routine returns `V`, not $V^{H}$. This is different from `gesvd`.
8685 pub fn cusolverDnZgesvdj(
8686 handle: cusolverDnHandle_t,
8687 jobz: cusolverEigMode_t,
8688 econ: ::core::ffi::c_int,
8689 m: ::core::ffi::c_int,
8690 n: ::core::ffi::c_int,
8691 A: *mut cuDoubleComplex,
8692 lda: ::core::ffi::c_int,
8693 S: *mut f64,
8694 U: *mut cuDoubleComplex,
8695 ldu: ::core::ffi::c_int,
8696 V: *mut cuDoubleComplex,
8697 ldv: ::core::ffi::c_int,
8698 work: *mut cuDoubleComplex,
8699 lwork: ::core::ffi::c_int,
8700 info: *mut ::core::ffi::c_int,
8701 params: gesvdjInfo_t,
8702 ) -> cusolverStatus_t;
8703}
8704unsafe extern "C" {
8705 pub fn cusolverDnSgesvdaStridedBatched_bufferSize(
8706 handle: cusolverDnHandle_t,
8707 jobz: cusolverEigMode_t,
8708 rank: ::core::ffi::c_int,
8709 m: ::core::ffi::c_int,
8710 n: ::core::ffi::c_int,
8711 d_A: *const f32,
8712 lda: ::core::ffi::c_int,
8713 strideA: ::core::ffi::c_longlong,
8714 d_S: *const f32,
8715 strideS: ::core::ffi::c_longlong,
8716 d_U: *const f32,
8717 ldu: ::core::ffi::c_int,
8718 strideU: ::core::ffi::c_longlong,
8719 d_V: *const f32,
8720 ldv: ::core::ffi::c_int,
8721 strideV: ::core::ffi::c_longlong,
8722 lwork: *mut ::core::ffi::c_int,
8723 batchSize: ::core::ffi::c_int,
8724 ) -> cusolverStatus_t;
8725}
8726unsafe extern "C" {
8727 pub fn cusolverDnDgesvdaStridedBatched_bufferSize(
8728 handle: cusolverDnHandle_t,
8729 jobz: cusolverEigMode_t,
8730 rank: ::core::ffi::c_int,
8731 m: ::core::ffi::c_int,
8732 n: ::core::ffi::c_int,
8733 d_A: *const f64,
8734 lda: ::core::ffi::c_int,
8735 strideA: ::core::ffi::c_longlong,
8736 d_S: *const f64,
8737 strideS: ::core::ffi::c_longlong,
8738 d_U: *const f64,
8739 ldu: ::core::ffi::c_int,
8740 strideU: ::core::ffi::c_longlong,
8741 d_V: *const f64,
8742 ldv: ::core::ffi::c_int,
8743 strideV: ::core::ffi::c_longlong,
8744 lwork: *mut ::core::ffi::c_int,
8745 batchSize: ::core::ffi::c_int,
8746 ) -> cusolverStatus_t;
8747}
8748unsafe extern "C" {
8749 pub fn cusolverDnCgesvdaStridedBatched_bufferSize(
8750 handle: cusolverDnHandle_t,
8751 jobz: cusolverEigMode_t,
8752 rank: ::core::ffi::c_int,
8753 m: ::core::ffi::c_int,
8754 n: ::core::ffi::c_int,
8755 d_A: *const cuComplex,
8756 lda: ::core::ffi::c_int,
8757 strideA: ::core::ffi::c_longlong,
8758 d_S: *const f32,
8759 strideS: ::core::ffi::c_longlong,
8760 d_U: *const cuComplex,
8761 ldu: ::core::ffi::c_int,
8762 strideU: ::core::ffi::c_longlong,
8763 d_V: *const cuComplex,
8764 ldv: ::core::ffi::c_int,
8765 strideV: ::core::ffi::c_longlong,
8766 lwork: *mut ::core::ffi::c_int,
8767 batchSize: ::core::ffi::c_int,
8768 ) -> cusolverStatus_t;
8769}
8770unsafe extern "C" {
8771 pub fn cusolverDnZgesvdaStridedBatched_bufferSize(
8772 handle: cusolverDnHandle_t,
8773 jobz: cusolverEigMode_t,
8774 rank: ::core::ffi::c_int,
8775 m: ::core::ffi::c_int,
8776 n: ::core::ffi::c_int,
8777 d_A: *const cuDoubleComplex,
8778 lda: ::core::ffi::c_int,
8779 strideA: ::core::ffi::c_longlong,
8780 d_S: *const f64,
8781 strideS: ::core::ffi::c_longlong,
8782 d_U: *const cuDoubleComplex,
8783 ldu: ::core::ffi::c_int,
8784 strideU: ::core::ffi::c_longlong,
8785 d_V: *const cuDoubleComplex,
8786 ldv: ::core::ffi::c_int,
8787 strideV: ::core::ffi::c_longlong,
8788 lwork: *mut ::core::ffi::c_int,
8789 batchSize: ::core::ffi::c_int,
8790 ) -> cusolverStatus_t;
8791}
8792unsafe extern "C" {
8793 /// The helper functions below can calculate the sizes needed for pre-allocated buffer.
8794 ///
8795 /// The S and D data types are real valued single and double precision, respectively.
8796 ///
8797 /// The C and Z data types are complex valued single and double precision, respectively.
8798 ///
8799 /// 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:
8800 /// $$
8801 /// A = U\\*\Sigma\\*V^{H}
8802 /// $$
8803 ///
8804 /// 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`.
8805 ///
8806 /// `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:
8807 /// $$
8808 /// U^{H}\\*A\\*V = S + E
8809 /// $$
8810 ///
8811 /// 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.
8812 ///
8813 /// The input parameter `rank` decides the number of singular values and singular vectors are computed in parameter `S`, `U` and `V`.
8814 ///
8815 /// The output parameter `h_RnrmF` computes Frobenius norm of residual. To compute `h_RnrmF`, `info != NULL` is required.
8816 /// $$
8817 /// A - U\\*S\\*V^{H}
8818 /// $$
8819 ///
8820 /// if the parameter `rank` is equal `n`. Otherwise, `h_RnrmF` reports:
8821 /// $$
8822 /// {\\|}U\\*S\\*V^{H}{\\|} - {\\|S\\|}
8823 /// $$
8824 ///
8825 /// in Frobenius norm sense, that is, how far `U` is from unitary.
8826 ///
8827 /// `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,
8828 /// $$
8829 /// \begin{split}A = \begin{pmatrix}
8830 /// {A0} & {A1} & \cdots \\\\
8831 /// \end{pmatrix}\end{split}
8832 /// $$
8833 ///
8834 /// 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}$.
8835 ///
8836 /// The user has to provide working space which is pointed by input parameter `work`. The input parameter `lwork` is the size of the working space, and it is returned by `gesvdaStridedBatched_bufferSize()`. Please note that the size in bytes of the working space is equal to `sizeof(<type>) * lwork`.
8837 ///
8838 /// The output parameter `info` is an integer array of size `batchSize`. If the function returns [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`], the first element `info\[0\] = -i` (less than zero) indicates `i-th` parameter is wrong (not counting handle). Otherwise, if `info\[i\] = min(m,n)+1`, `gesvdaStridedBatched` did not converge on the `i-th` matrix. If `0 < info\[i\] < min(m,n)+1`, `gesvdaStridedBatched` could not compute an SVD of the `i-th` matrix fully; the leading singular values `Si\[k\]`, `0 <= k <= info\[i\]-1`, and corresponding singular vectors may still be useful. In this case, if `h_RnrmF` is requested, `h_RnrmF` reports the residual as if `rank` was set to `info\[i\]-1`.
8839 ///
8840 /// Note that the problem size is limited by the condition `batchSize*stride{A/S/U/V}<=INT32_MAX` primarily due to the current implementation constraints.
8841 ///
8842 /// Please visit [cuSOLVER Library Samples - gesvdaStridedBatched](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/gesvdaStridedBatched) for a code example.
8843 ///
8844 /// Remark 1: The routine returns `V`, not $V^{H}$. This is different from `gesvd`.
8845 ///
8846 /// Remark 2: The routine only supports `m >=n`.
8847 ///
8848 /// Remark 3: It is recommended to use an FP64 data type, that is `DgesvdaStridedBatched` or `ZgesvdaStridedBatched`.
8849 ///
8850 /// 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.
8851 pub fn cusolverDnSgesvdaStridedBatched(
8852 handle: cusolverDnHandle_t,
8853 jobz: cusolverEigMode_t,
8854 rank: ::core::ffi::c_int,
8855 m: ::core::ffi::c_int,
8856 n: ::core::ffi::c_int,
8857 d_A: *const f32,
8858 lda: ::core::ffi::c_int,
8859 strideA: ::core::ffi::c_longlong,
8860 d_S: *mut f32,
8861 strideS: ::core::ffi::c_longlong,
8862 d_U: *mut f32,
8863 ldu: ::core::ffi::c_int,
8864 strideU: ::core::ffi::c_longlong,
8865 d_V: *mut f32,
8866 ldv: ::core::ffi::c_int,
8867 strideV: ::core::ffi::c_longlong,
8868 d_work: *mut f32,
8869 lwork: ::core::ffi::c_int,
8870 d_info: *mut ::core::ffi::c_int,
8871 h_R_nrmF: *mut f64,
8872 batchSize: ::core::ffi::c_int,
8873 ) -> cusolverStatus_t;
8874}
8875unsafe extern "C" {
8876 /// The helper functions below can calculate the sizes needed for pre-allocated buffer.
8877 ///
8878 /// The S and D data types are real valued single and double precision, respectively.
8879 ///
8880 /// The C and Z data types are complex valued single and double precision, respectively.
8881 ///
8882 /// 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:
8883 /// $$
8884 /// A = U\\*\Sigma\\*V^{H}
8885 /// $$
8886 ///
8887 /// 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`.
8888 ///
8889 /// `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:
8890 /// $$
8891 /// U^{H}\\*A\\*V = S + E
8892 /// $$
8893 ///
8894 /// 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.
8895 ///
8896 /// The input parameter `rank` decides the number of singular values and singular vectors are computed in parameter `S`, `U` and `V`.
8897 ///
8898 /// The output parameter `h_RnrmF` computes Frobenius norm of residual. To compute `h_RnrmF`, `info != NULL` is required.
8899 /// $$
8900 /// A - U\\*S\\*V^{H}
8901 /// $$
8902 ///
8903 /// if the parameter `rank` is equal `n`. Otherwise, `h_RnrmF` reports:
8904 /// $$
8905 /// {\\|}U\\*S\\*V^{H}{\\|} - {\\|S\\|}
8906 /// $$
8907 ///
8908 /// in Frobenius norm sense, that is, how far `U` is from unitary.
8909 ///
8910 /// `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,
8911 /// $$
8912 /// \begin{split}A = \begin{pmatrix}
8913 /// {A0} & {A1} & \cdots \\\\
8914 /// \end{pmatrix}\end{split}
8915 /// $$
8916 ///
8917 /// 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}$.
8918 ///
8919 /// The user has to provide working space which is pointed by input parameter `work`. The input parameter `lwork` is the size of the working space, and it is returned by `gesvdaStridedBatched_bufferSize()`. Please note that the size in bytes of the working space is equal to `sizeof(<type>) * lwork`.
8920 ///
8921 /// The output parameter `info` is an integer array of size `batchSize`. If the function returns [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`], the first element `info\[0\] = -i` (less than zero) indicates `i-th` parameter is wrong (not counting handle). Otherwise, if `info\[i\] = min(m,n)+1`, `gesvdaStridedBatched` did not converge on the `i-th` matrix. If `0 < info\[i\] < min(m,n)+1`, `gesvdaStridedBatched` could not compute an SVD of the `i-th` matrix fully; the leading singular values `Si\[k\]`, `0 <= k <= info\[i\]-1`, and corresponding singular vectors may still be useful. In this case, if `h_RnrmF` is requested, `h_RnrmF` reports the residual as if `rank` was set to `info\[i\]-1`.
8922 ///
8923 /// Note that the problem size is limited by the condition `batchSize*stride{A/S/U/V}<=INT32_MAX` primarily due to the current implementation constraints.
8924 ///
8925 /// Please visit [cuSOLVER Library Samples - gesvdaStridedBatched](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/gesvdaStridedBatched) for a code example.
8926 ///
8927 /// Remark 1: The routine returns `V`, not $V^{H}$. This is different from `gesvd`.
8928 ///
8929 /// Remark 2: The routine only supports `m >=n`.
8930 ///
8931 /// Remark 3: It is recommended to use an FP64 data type, that is `DgesvdaStridedBatched` or `ZgesvdaStridedBatched`.
8932 ///
8933 /// 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.
8934 pub fn cusolverDnDgesvdaStridedBatched(
8935 handle: cusolverDnHandle_t,
8936 jobz: cusolverEigMode_t,
8937 rank: ::core::ffi::c_int,
8938 m: ::core::ffi::c_int,
8939 n: ::core::ffi::c_int,
8940 d_A: *const f64,
8941 lda: ::core::ffi::c_int,
8942 strideA: ::core::ffi::c_longlong,
8943 d_S: *mut f64,
8944 strideS: ::core::ffi::c_longlong,
8945 d_U: *mut f64,
8946 ldu: ::core::ffi::c_int,
8947 strideU: ::core::ffi::c_longlong,
8948 d_V: *mut f64,
8949 ldv: ::core::ffi::c_int,
8950 strideV: ::core::ffi::c_longlong,
8951 d_work: *mut f64,
8952 lwork: ::core::ffi::c_int,
8953 d_info: *mut ::core::ffi::c_int,
8954 h_R_nrmF: *mut f64,
8955 batchSize: ::core::ffi::c_int,
8956 ) -> cusolverStatus_t;
8957}
8958unsafe extern "C" {
8959 /// The helper functions below can calculate the sizes needed for pre-allocated buffer.
8960 ///
8961 /// The S and D data types are real valued single and double precision, respectively.
8962 ///
8963 /// The C and Z data types are complex valued single and double precision, respectively.
8964 ///
8965 /// 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:
8966 /// $$
8967 /// A = U\\*\Sigma\\*V^{H}
8968 /// $$
8969 ///
8970 /// 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`.
8971 ///
8972 /// `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:
8973 /// $$
8974 /// U^{H}\\*A\\*V = S + E
8975 /// $$
8976 ///
8977 /// 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.
8978 ///
8979 /// The input parameter `rank` decides the number of singular values and singular vectors are computed in parameter `S`, `U` and `V`.
8980 ///
8981 /// The output parameter `h_RnrmF` computes Frobenius norm of residual. To compute `h_RnrmF`, `info != NULL` is required.
8982 /// $$
8983 /// A - U\\*S\\*V^{H}
8984 /// $$
8985 ///
8986 /// if the parameter `rank` is equal `n`. Otherwise, `h_RnrmF` reports:
8987 /// $$
8988 /// {\\|}U\\*S\\*V^{H}{\\|} - {\\|S\\|}
8989 /// $$
8990 ///
8991 /// in Frobenius norm sense, that is, how far `U` is from unitary.
8992 ///
8993 /// `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,
8994 /// $$
8995 /// \begin{split}A = \begin{pmatrix}
8996 /// {A0} & {A1} & \cdots \\\\
8997 /// \end{pmatrix}\end{split}
8998 /// $$
8999 ///
9000 /// 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}$.
9001 ///
9002 /// The user has to provide working space which is pointed by input parameter `work`. The input parameter `lwork` is the size of the working space, and it is returned by `gesvdaStridedBatched_bufferSize()`. Please note that the size in bytes of the working space is equal to `sizeof(<type>) * lwork`.
9003 ///
9004 /// The output parameter `info` is an integer array of size `batchSize`. If the function returns [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`], the first element `info\[0\] = -i` (less than zero) indicates `i-th` parameter is wrong (not counting handle). Otherwise, if `info\[i\] = min(m,n)+1`, `gesvdaStridedBatched` did not converge on the `i-th` matrix. If `0 < info\[i\] < min(m,n)+1`, `gesvdaStridedBatched` could not compute an SVD of the `i-th` matrix fully; the leading singular values `Si\[k\]`, `0 <= k <= info\[i\]-1`, and corresponding singular vectors may still be useful. In this case, if `h_RnrmF` is requested, `h_RnrmF` reports the residual as if `rank` was set to `info\[i\]-1`.
9005 ///
9006 /// Note that the problem size is limited by the condition `batchSize*stride{A/S/U/V}<=INT32_MAX` primarily due to the current implementation constraints.
9007 ///
9008 /// Please visit [cuSOLVER Library Samples - gesvdaStridedBatched](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/gesvdaStridedBatched) for a code example.
9009 ///
9010 /// Remark 1: The routine returns `V`, not $V^{H}$. This is different from `gesvd`.
9011 ///
9012 /// Remark 2: The routine only supports `m >=n`.
9013 ///
9014 /// Remark 3: It is recommended to use an FP64 data type, that is `DgesvdaStridedBatched` or `ZgesvdaStridedBatched`.
9015 ///
9016 /// 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.
9017 pub fn cusolverDnCgesvdaStridedBatched(
9018 handle: cusolverDnHandle_t,
9019 jobz: cusolverEigMode_t,
9020 rank: ::core::ffi::c_int,
9021 m: ::core::ffi::c_int,
9022 n: ::core::ffi::c_int,
9023 d_A: *const cuComplex,
9024 lda: ::core::ffi::c_int,
9025 strideA: ::core::ffi::c_longlong,
9026 d_S: *mut f32,
9027 strideS: ::core::ffi::c_longlong,
9028 d_U: *mut cuComplex,
9029 ldu: ::core::ffi::c_int,
9030 strideU: ::core::ffi::c_longlong,
9031 d_V: *mut cuComplex,
9032 ldv: ::core::ffi::c_int,
9033 strideV: ::core::ffi::c_longlong,
9034 d_work: *mut cuComplex,
9035 lwork: ::core::ffi::c_int,
9036 d_info: *mut ::core::ffi::c_int,
9037 h_R_nrmF: *mut f64,
9038 batchSize: ::core::ffi::c_int,
9039 ) -> cusolverStatus_t;
9040}
9041unsafe extern "C" {
9042 /// The helper functions below can calculate the sizes needed for pre-allocated buffer.
9043 ///
9044 /// The S and D data types are real valued single and double precision, respectively.
9045 ///
9046 /// The C and Z data types are complex valued single and double precision, respectively.
9047 ///
9048 /// 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:
9049 /// $$
9050 /// A = U\\*\Sigma\\*V^{H}
9051 /// $$
9052 ///
9053 /// 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`.
9054 ///
9055 /// `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:
9056 /// $$
9057 /// U^{H}\\*A\\*V = S + E
9058 /// $$
9059 ///
9060 /// 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.
9061 ///
9062 /// The input parameter `rank` decides the number of singular values and singular vectors are computed in parameter `S`, `U` and `V`.
9063 ///
9064 /// The output parameter `h_RnrmF` computes Frobenius norm of residual. To compute `h_RnrmF`, `info != NULL` is required.
9065 /// $$
9066 /// A - U\\*S\\*V^{H}
9067 /// $$
9068 ///
9069 /// if the parameter `rank` is equal `n`. Otherwise, `h_RnrmF` reports:
9070 /// $$
9071 /// {\\|}U\\*S\\*V^{H}{\\|} - {\\|S\\|}
9072 /// $$
9073 ///
9074 /// in Frobenius norm sense, that is, how far `U` is from unitary.
9075 ///
9076 /// `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,
9077 /// $$
9078 /// \begin{split}A = \begin{pmatrix}
9079 /// {A0} & {A1} & \cdots \\\\
9080 /// \end{pmatrix}\end{split}
9081 /// $$
9082 ///
9083 /// 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}$.
9084 ///
9085 /// The user has to provide working space which is pointed by input parameter `work`. The input parameter `lwork` is the size of the working space, and it is returned by `gesvdaStridedBatched_bufferSize()`. Please note that the size in bytes of the working space is equal to `sizeof(<type>) * lwork`.
9086 ///
9087 /// The output parameter `info` is an integer array of size `batchSize`. If the function returns [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`], the first element `info\[0\] = -i` (less than zero) indicates `i-th` parameter is wrong (not counting handle). Otherwise, if `info\[i\] = min(m,n)+1`, `gesvdaStridedBatched` did not converge on the `i-th` matrix. If `0 < info\[i\] < min(m,n)+1`, `gesvdaStridedBatched` could not compute an SVD of the `i-th` matrix fully; the leading singular values `Si\[k\]`, `0 <= k <= info\[i\]-1`, and corresponding singular vectors may still be useful. In this case, if `h_RnrmF` is requested, `h_RnrmF` reports the residual as if `rank` was set to `info\[i\]-1`.
9088 ///
9089 /// Note that the problem size is limited by the condition `batchSize*stride{A/S/U/V}<=INT32_MAX` primarily due to the current implementation constraints.
9090 ///
9091 /// Please visit [cuSOLVER Library Samples - gesvdaStridedBatched](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/gesvdaStridedBatched) for a code example.
9092 ///
9093 /// Remark 1: The routine returns `V`, not $V^{H}$. This is different from `gesvd`.
9094 ///
9095 /// Remark 2: The routine only supports `m >=n`.
9096 ///
9097 /// Remark 3: It is recommended to use an FP64 data type, that is `DgesvdaStridedBatched` or `ZgesvdaStridedBatched`.
9098 ///
9099 /// 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.
9100 pub fn cusolverDnZgesvdaStridedBatched(
9101 handle: cusolverDnHandle_t,
9102 jobz: cusolverEigMode_t,
9103 rank: ::core::ffi::c_int,
9104 m: ::core::ffi::c_int,
9105 n: ::core::ffi::c_int,
9106 d_A: *const cuDoubleComplex,
9107 lda: ::core::ffi::c_int,
9108 strideA: ::core::ffi::c_longlong,
9109 d_S: *mut f64,
9110 strideS: ::core::ffi::c_longlong,
9111 d_U: *mut cuDoubleComplex,
9112 ldu: ::core::ffi::c_int,
9113 strideU: ::core::ffi::c_longlong,
9114 d_V: *mut cuDoubleComplex,
9115 ldv: ::core::ffi::c_int,
9116 strideV: ::core::ffi::c_longlong,
9117 d_work: *mut cuDoubleComplex,
9118 lwork: ::core::ffi::c_int,
9119 d_info: *mut ::core::ffi::c_int,
9120 h_R_nrmF: *mut f64,
9121 batchSize: ::core::ffi::c_int,
9122 ) -> cusolverStatus_t;
9123}
9124unsafe extern "C" {
9125 /// This function creates and initializes the structure of `64-bit API` to default values.
9126 ///
9127 /// # Parameters
9128 ///
9129 /// - `params`: The pointer to the structure of `64-bit API`.
9130 ///
9131 /// # Return value
9132 ///
9133 /// - [`cusolverStatus_t::CUSOLVER_STATUS_ALLOC_FAILED`]: The resources could not be allocated.
9134 /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The structure was initialized successfully.
9135 pub fn cusolverDnCreateParams(params: *mut cusolverDnParams_t) -> cusolverStatus_t;
9136}
9137unsafe extern "C" {
9138 /// This function destroys and releases any memory required by the structure.
9139 ///
9140 /// # Parameters
9141 ///
9142 /// - `params`: The structure of `64-bit API`.
9143 ///
9144 /// # Return value
9145 ///
9146 /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The resources were released successfully.
9147 pub fn cusolverDnDestroyParams(params: cusolverDnParams_t) -> cusolverStatus_t;
9148}
9149unsafe extern "C" {
9150 /// This function configures algorithm `algo` of `function`, a `64-bit API` routine.
9151 ///
9152 /// # Parameters
9153 ///
9154 /// - `params`: The pointer to the structure of `64-bit API`.
9155 /// - `function`: The routine to be configured.
9156 /// - `algo`: The algorithm to be configured.
9157 ///
9158 /// # Return value
9159 ///
9160 /// - [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]: Wrong combination of `function` and `algo`.
9161 /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The operation completed successfully.
9162 pub fn cusolverDnSetAdvOptions(
9163 params: cusolverDnParams_t,
9164 function: cusolverDnFunction_t,
9165 algo: cusolverAlgMode_t,
9166 ) -> cusolverStatus_t;
9167}
9168unsafe extern "C" {
9169 pub fn cusolverDnXpotrf_bufferSize(
9170 handle: cusolverDnHandle_t,
9171 params: cusolverDnParams_t,
9172 uplo: cublasFillMode_t,
9173 n: i64,
9174 dataTypeA: cudaDataType,
9175 A: *const ::core::ffi::c_void,
9176 lda: i64,
9177 computeType: cudaDataType,
9178 workspaceInBytesOnDevice: *mut size_t,
9179 workspaceInBytesOnHost: *mut size_t,
9180 ) -> cusolverStatus_t;
9181}
9182unsafe extern "C" {
9183 /// The helper functions below can calculate the sizes needed for pre-allocated buffer.
9184 ///
9185 /// The following routine:
9186 ///
9187 /// computes the Cholesky factorization of a Hermitian positive-definite matrix using the generic API interface.
9188 ///
9189 /// `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.
9190 ///
9191 /// 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`.
9192 /// $$
9193 /// A = L\\*L^{H}
9194 /// $$
9195 ///
9196 /// 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`.
9197 /// $$
9198 /// A = U^{H}\\*U
9199 /// $$
9200 ///
9201 /// 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`].
9202 ///
9203 /// 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.
9204 ///
9205 /// If output parameter `info = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
9206 ///
9207 /// Currently, [`cusolverDnXpotrf`] supports only the default algorithm.
9208 ///
9209 /// Please visit [cuSOLVER Library Samples - Xpotrf](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/Xpotrf) for a code example.
9210 ///
9211 /// **Algorithms supported by cusolverDnXpotrf**
9212 ///
9213 /// | | |
9214 /// | --- | --- |
9215 /// | [`cusolverAlgMode_t::CUSOLVER_ALG_0`] or `NULL` | Default algorithm. |
9216 ///
9217 /// List of input arguments for [`cusolverDnXpotrf_bufferSize`] and [`cusolverDnXpotrf`]:
9218 ///
9219 /// 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.
9220 ///
9221 /// **Valid combination of data type and compute type**
9222 ///
9223 /// | **DataTypeA** | **ComputeType** | **Meaning** |
9224 /// | --- | --- | --- |
9225 /// | `CUDA_R_32F` | `CUDA_R_32F` | `SPOTRF` |
9226 /// | `CUDA_R_64F` | `CUDA_R_64F` | `DPOTRF` |
9227 /// | `CUDA_C_32F` | `CUDA_C_32F` | `CPOTRF` |
9228 /// | `CUDA_C_64F` | `CUDA_C_64F` | `ZPOTRF` |
9229 ///
9230 /// # Parameters
9231 ///
9232 /// - `handle`: Handle to the cuSolverDN library context.
9233 /// - `params`: Structure with information collected by [`cusolverDnSetAdvOptions`].
9234 /// - `uplo`: Indicates if matrix `A` lower or upper part is stored, the other part is not referenced.
9235 /// - `n`: Number of rows and columns of matrix `A`.
9236 /// - `dataTypeA`: Data type of array `A`.
9237 /// - `A`: Array of dimension `lda * n` with `lda` is not less than `max(1,n)`.
9238 /// - `lda`: Leading dimension of two-dimensional array used to store matrix `A`.
9239 /// - `computeType`: Data type of computation.
9240 /// - `bufferOnDevice`: Device workspace. Array of type `void` of size `workspaceInBytesOnDevice` bytes.
9241 /// - `workspaceInBytesOnDevice`: Size in bytes of `bufferOnDevice`, returned by [`cusolverDnXpotrf_bufferSize`].
9242 /// - `bufferOnHost`: Host workspace. Array of type `void` of size `workspaceInBytesOnHost` bytes.
9243 /// - `workspaceInBytesOnHost`: Size in bytes of `bufferOnHost`, returned by [`cusolverDnXpotrf_bufferSize`].
9244 /// - `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.
9245 ///
9246 /// # Return value
9247 ///
9248 /// - [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]: An internal operation failed.
9249 /// - [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]: Invalid parameters were passed (`n<0` or `lda<max(1,n)`).
9250 /// - [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]: The library was not initialized.
9251 /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The operation completed successfully.
9252 pub fn cusolverDnXpotrf(
9253 handle: cusolverDnHandle_t,
9254 params: cusolverDnParams_t,
9255 uplo: cublasFillMode_t,
9256 n: i64,
9257 dataTypeA: cudaDataType,
9258 A: *mut ::core::ffi::c_void,
9259 lda: i64,
9260 computeType: cudaDataType,
9261 bufferOnDevice: *mut ::core::ffi::c_void,
9262 workspaceInBytesOnDevice: size_t,
9263 bufferOnHost: *mut ::core::ffi::c_void,
9264 workspaceInBytesOnHost: size_t,
9265 info: *mut ::core::ffi::c_int,
9266 ) -> cusolverStatus_t;
9267}
9268unsafe extern "C" {
9269 /// This function solves a system of linear equations:
9270 /// $$
9271 /// A\\*X = B
9272 /// $$
9273 ///
9274 /// 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.
9275 ///
9276 /// 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$.
9277 ///
9278 /// The operation is in-place, i.e. matrix `X` overwrites matrix `B` with the same leading dimension `ldb`.
9279 ///
9280 /// If output parameter `info = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
9281 ///
9282 /// Currently, [`cusolverDnXpotrs`] supports only the default algorithm.
9283 ///
9284 /// Please visit [cuSOLVER Library Samples - Xpotrf](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/Xpotrf) for a code example.
9285 ///
9286 /// **Algorithms supported by cusolverDnXpotrs**
9287 ///
9288 /// | | |
9289 /// | --- | --- |
9290 /// | [`cusolverAlgMode_t::CUSOLVER_ALG_0`] or `NULL` | Default algorithm. |
9291 ///
9292 /// List of input arguments for [`cusolverDnXpotrs`]:
9293 ///
9294 /// 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.
9295 ///
9296 /// **Valid combination of data type and compute type**
9297 ///
9298 /// | **dataTypeA** | **dataTypeB** | **Meaning** |
9299 /// | --- | --- | --- |
9300 /// | `CUDA_R_32F` | `CUDA_R_32F` | `SPOTRS` |
9301 /// | `CUDA_R_64F` | `CUDA_R_64F` | `DPOTRS` |
9302 /// | `CUDA_C_32F` | `CUDA_C_32F` | `CPOTRS` |
9303 /// | `CUDA_C_64F` | `CUDA_C_64F` | `ZPOTRS` |
9304 ///
9305 /// # Parameters
9306 ///
9307 /// - `handle`: Handle to the cuSolverDN library context.
9308 /// - `params`: Structure with information collected by [`cusolverDnSetAdvOptions`].
9309 /// - `uplo`: Indicates if matrix `A` lower or upper part is stored, the other part is not referenced.
9310 /// - `n`: Number of rows and columns of matrix `A`.
9311 /// - `nrhs`: Number of columns of matrix `X` and `B`.
9312 /// - `dataTypeA`: Data type of array `A`.
9313 /// - `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`.
9314 /// - `lda`: Leading dimension of two-dimensional array used to store matrix `A`.
9315 /// - `dataTypeB`: Data type of array `B`.
9316 /// - `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.
9317 /// - `info`: If `info = 0`, the Cholesky factorization is successful. if `info = -i`, the `i-th` parameter is wrong (not counting handle).
9318 ///
9319 /// # Return value
9320 ///
9321 /// - [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]: An internal operation failed.
9322 /// - [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]: Invalid parameters were passed (`n<0`, `nrhs<0`, `lda<max(1,n)` or `ldb<max(1,n)`).
9323 /// - [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]: The library was not initialized.
9324 /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The operation completed successfully.
9325 pub fn cusolverDnXpotrs(
9326 handle: cusolverDnHandle_t,
9327 params: cusolverDnParams_t,
9328 uplo: cublasFillMode_t,
9329 n: i64,
9330 nrhs: i64,
9331 dataTypeA: cudaDataType,
9332 A: *const ::core::ffi::c_void,
9333 lda: i64,
9334 dataTypeB: cudaDataType,
9335 B: *mut ::core::ffi::c_void,
9336 ldb: i64,
9337 info: *mut ::core::ffi::c_int,
9338 ) -> cusolverStatus_t;
9339}
9340unsafe extern "C" {
9341 pub fn cusolverDnXgeqrf_bufferSize(
9342 handle: cusolverDnHandle_t,
9343 params: cusolverDnParams_t,
9344 m: i64,
9345 n: i64,
9346 dataTypeA: cudaDataType,
9347 A: *const ::core::ffi::c_void,
9348 lda: i64,
9349 dataTypeTau: cudaDataType,
9350 tau: *const ::core::ffi::c_void,
9351 computeType: cudaDataType,
9352 workspaceInBytesOnDevice: *mut size_t,
9353 workspaceInBytesOnHost: *mut size_t,
9354 ) -> cusolverStatus_t;
9355}
9356unsafe extern "C" {
9357 /// The helper functions below can calculate the sizes needed for pre-allocated buffer.
9358 ///
9359 /// The following routine:
9360 ///
9361 /// computes the QR factorization of a $m \times n$ matrix:
9362 /// $$
9363 /// A = Q\\*R
9364 /// $$
9365 ///
9366 /// 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.
9367 ///
9368 /// 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`].
9369 ///
9370 /// The matrix `R` is overwritten in upper triangular part of `A`, including diagonal elements.
9371 ///
9372 /// 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:
9373 /// $$
9374 /// I - 2\\*v\\*v^{H} = I - \tau\\*q\\*q^{H}
9375 /// $$
9376 ///
9377 /// If output parameter `info = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
9378 ///
9379 /// Currently, [`cusolverDnXgeqrf`] supports only the default algorithm.
9380 ///
9381 /// Please visit [cuSOLVER Library Samples - Xgeqrf](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/Xgeqrf) for a code example.
9382 ///
9383 /// **Algorithms supported by cusolverDnXgeqrf**
9384 ///
9385 /// | | |
9386 /// | --- | --- |
9387 /// | [`cusolverAlgMode_t::CUSOLVER_ALG_0`] or `NULL` | Default algorithm. |
9388 ///
9389 /// List of input arguments for [`cusolverDnXgeqrf_bufferSize`] and [`cusolverDnXgeqrf`]:
9390 ///
9391 /// 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.
9392 ///
9393 /// **Valid combination of data type and compute type**
9394 ///
9395 /// | **DataTypeA** | **ComputeType** | **Meaning** |
9396 /// | --- | --- | --- |
9397 /// | `CUDA_R_32F` | `CUDA_R_32F` | `SGEQRF` |
9398 /// | `CUDA_R_64F` | `CUDA_R_64F` | `DGEQRF` |
9399 /// | `CUDA_C_32F` | `CUDA_C_32F` | `CGEQRF` |
9400 /// | `CUDA_C_64F` | `CUDA_C_64F` | `ZGEQRF` |
9401 ///
9402 /// # Parameters
9403 ///
9404 /// - `handle`: Handle to the cuSolverDN library context.
9405 /// - `params`: Structure with information collected by [`cusolverDnSetAdvOptions`].
9406 /// - `m`: Number of rows of matrix `A`.
9407 /// - `n`: Number of columns of matrix `A`.
9408 /// - `dataTypeA`: Data type of array `A`.
9409 /// - `A`: Array of dimension `lda * n` with `lda` is not less than `max(1,m)`.
9410 /// - `lda`: Leading dimension of two-dimensional array used to store matrix `A`.
9411 /// - `dataTypeTau`: Data type of array `tau`.
9412 /// - `tau`: Array of dimension at least `min(m,n)`.
9413 /// - `computeType`: Data type of computation.
9414 /// - `bufferOnDevice`: Device workspace. Array of type `void` of size `workspaceInBytesOnDevice` bytes.
9415 /// - `workspaceInBytesOnDevice`: Size in bytes of `bufferOnDevice`, returned by [`cusolverDnXgeqrf_bufferSize`].
9416 /// - `bufferOnHost`: Host workspace. Array of type `void` of size `workspaceInBytesOnHost` bytes.
9417 /// - `workspaceInBytesOnHost`: Size in bytes of `bufferOnHost`, returned by [`cusolverDnXgeqrf_bufferSize`].
9418 /// - `info`: If `info = 0`, the QR factorization is successful. If `info = -i`, the `i-th` parameter is wrong (not counting handle).
9419 ///
9420 /// # Return value
9421 ///
9422 /// - [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]: An internal operation failed.
9423 /// - [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]: Invalid parameters were passed (`m,n<0` or `lda<max(1,m)`).
9424 /// - [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]: The library was not initialized.
9425 /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The operation completed successfully.
9426 pub fn cusolverDnXgeqrf(
9427 handle: cusolverDnHandle_t,
9428 params: cusolverDnParams_t,
9429 m: i64,
9430 n: i64,
9431 dataTypeA: cudaDataType,
9432 A: *mut ::core::ffi::c_void,
9433 lda: i64,
9434 dataTypeTau: cudaDataType,
9435 tau: *mut ::core::ffi::c_void,
9436 computeType: cudaDataType,
9437 bufferOnDevice: *mut ::core::ffi::c_void,
9438 workspaceInBytesOnDevice: size_t,
9439 bufferOnHost: *mut ::core::ffi::c_void,
9440 workspaceInBytesOnHost: size_t,
9441 info: *mut ::core::ffi::c_int,
9442 ) -> cusolverStatus_t;
9443}
9444unsafe extern "C" {
9445 pub fn cusolverDnXgetrf_bufferSize(
9446 handle: cusolverDnHandle_t,
9447 params: cusolverDnParams_t,
9448 m: i64,
9449 n: i64,
9450 dataTypeA: cudaDataType,
9451 A: *const ::core::ffi::c_void,
9452 lda: i64,
9453 computeType: cudaDataType,
9454 workspaceInBytesOnDevice: *mut size_t,
9455 workspaceInBytesOnHost: *mut size_t,
9456 ) -> cusolverStatus_t;
9457}
9458unsafe extern "C" {
9459 /// The helper function below can calculate the sizes needed for pre-allocated buffer.
9460 ///
9461 /// The function below
9462 ///
9463 /// computes the LU factorization of a $m \times n$ matrix:
9464 /// $$
9465 /// P\\*A = L\\*U
9466 /// $$
9467 ///
9468 /// 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.
9469 ///
9470 /// If LU factorization failed, i.e. matrix `A` (`U`) is singular, The output parameter `info=i` indicates `U(i,i) = 0`.
9471 ///
9472 /// If output parameter `info = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
9473 ///
9474 /// If `ipiv` is null, no pivoting is performed. The factorization is `A=L*U`, which is not numerically stable.
9475 ///
9476 /// No matter LU factorization failed or not, the output parameter `ipiv` contains pivoting sequence, row `i` is interchanged with row `ipiv(i)`.
9477 ///
9478 /// 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`].
9479 ///
9480 /// The user can combine [`cusolverDnXgetrf`] and `cusolverDnGetrs` to complete a linear solver.
9481 ///
9482 /// Currently, [`cusolverDnXgetrf`] supports two algorithms. To select legacy implementation, the user has to call [`cusolverDnSetAdvOptions`].
9483 ///
9484 /// Please visit [cuSOLVER Library Samples - Xgetrf](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/Xgetrf) for a code example.
9485 ///
9486 /// **Algorithms supported by cusolverDnXgetrf**
9487 ///
9488 /// | | |
9489 /// | --- | --- |
9490 /// | [`cusolverAlgMode_t::CUSOLVER_ALG_0`] or `NULL` | Default algorithm. The fastest, requires a large workspace of `m*n` elements. |
9491 /// | [`cusolverAlgMode_t::CUSOLVER_ALG_1`] | Legacy implementation |
9492 ///
9493 /// List of input arguments for [`cusolverDnXgetrf_bufferSize`] and [`cusolverDnXgetrf`]:
9494 ///
9495 /// 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.
9496 ///
9497 /// **Valid combination of data type and compute type**
9498 ///
9499 /// | **DataTypeA** | **ComputeType** | **Meaning** |
9500 /// | --- | --- | --- |
9501 /// | `CUDA_R_32F` | `CUDA_R_32F` | `SGETRF` |
9502 /// | `CUDA_R_64F` | `CUDA_R_64F` | `DGETRF` |
9503 /// | `CUDA_C_32F` | `CUDA_C_32F` | `CGETRF` |
9504 /// | `CUDA_C_64F` | `CUDA_C_64F` | `ZGETRF` |
9505 ///
9506 /// # Parameters
9507 ///
9508 /// - `handle`: Handle to the cuSolverDN library context.
9509 /// - `params`: Structure with information collected by [`cusolverDnSetAdvOptions`].
9510 /// - `m`: Number of rows of matrix `A`.
9511 /// - `n`: Number of columns of matrix `A`.
9512 /// - `dataTypeA`: Data type of array `A`.
9513 /// - `A`: <type> array of dimension `lda * n` with `lda` is not less than `max(1,m)`.
9514 /// - `lda`: Leading dimension of two-dimensional array used to store matrix `A`.
9515 /// - `ipiv`: Array of size at least `min(m,n)`, containing pivot indices.
9516 /// - `computeType`: Data type of computation.
9517 /// - `bufferOnDevice`: Device workspace. Array of type `void` of size `workspaceInBytesOnDevice` bytes.
9518 /// - `workspaceInBytesOnDevice`: Size in bytes of `bufferOnDevice`, returned by [`cusolverDnXgetrf_bufferSize`].
9519 /// - `bufferOnHost`: Host workspace. Array of type `void` of size `workspaceInBytesOnHost` bytes.
9520 /// - `workspaceInBytesOnHost`: Size in bytes of `bufferOnHost`, returned by [`cusolverDnXgetrf_bufferSize`].
9521 /// - `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`.
9522 ///
9523 /// # Return value
9524 ///
9525 /// - [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]: An internal operation failed.
9526 /// - [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]: Invalid parameters were passed (`m,n<0` or `lda<max(1,m)`).
9527 /// - [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]: The library was not initialized.
9528 /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The operation completed successfully.
9529 pub fn cusolverDnXgetrf(
9530 handle: cusolverDnHandle_t,
9531 params: cusolverDnParams_t,
9532 m: i64,
9533 n: i64,
9534 dataTypeA: cudaDataType,
9535 A: *mut ::core::ffi::c_void,
9536 lda: i64,
9537 ipiv: *mut i64,
9538 computeType: cudaDataType,
9539 bufferOnDevice: *mut ::core::ffi::c_void,
9540 workspaceInBytesOnDevice: size_t,
9541 bufferOnHost: *mut ::core::ffi::c_void,
9542 workspaceInBytesOnHost: size_t,
9543 info: *mut ::core::ffi::c_int,
9544 ) -> cusolverStatus_t;
9545}
9546unsafe extern "C" {
9547 /// This function solves a linear system of multiple right-hand sides:
9548 /// $$
9549 /// op(A)\\*X = B
9550 /// $$
9551 ///
9552 /// 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.
9553 ///
9554 /// The input parameter `trans` is defined by:
9555 /// $$
9556 /// \operatorname{op}(A) =
9557 /// \begin{cases}
9558 /// A & \text{if } trans = \text{CUBLAS_OP_N} \\
9559 /// A^T & \text{if } trans = \text{CUBLAS_OP_T} \\
9560 /// A^H & \text{if } trans = \text{CUBLAS_OP_C}
9561 /// \end{cases}
9562 /// $$
9563 ///
9564 /// The input parameter `ipiv` is an output of [`cusolverDnXgetrf`]. It contains pivot indices, which are used to permutate right-hand sides.
9565 ///
9566 /// If output parameter `info = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
9567 ///
9568 /// The user can combine [`cusolverDnXgetrf`] and [`cusolverDnXgetrs`] to complete a linear solver.
9569 ///
9570 /// Currently, [`cusolverDnXgetrs`] supports only the default algorithm.
9571 ///
9572 /// Please visit [cuSOLVER Library Samples - Xgetrf](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/Xgetrf) for a code example.
9573 ///
9574 /// **Algorithms supported by cusolverDnXgetrs**
9575 ///
9576 /// | | |
9577 /// | --- | --- |
9578 /// | [`cusolverAlgMode_t::CUSOLVER_ALG_0`] or `NULL` | Default algorithm. |
9579 ///
9580 /// List of input arguments for [`cusolverDnXgetrs`]:
9581 ///
9582 /// 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:
9583 ///
9584 /// **Valid combination of data type and compute type**
9585 ///
9586 /// | **DataTypeA** | **dataTypeB** | **Meaning** |
9587 /// | --- | --- | --- |
9588 /// | `CUDA_R_32F` | `CUDA_R_32F` | `SGETRS` |
9589 /// | `CUDA_R_64F` | `CUDA_R_64F` | `DGETRS` |
9590 /// | `CUDA_C_32F` | `CUDA_C_32F` | `CGETRS` |
9591 /// | `CUDA_C_64F` | `CUDA_C_64F` | `ZGETRS` |
9592 ///
9593 /// # Parameters
9594 ///
9595 /// - `handle`: Handle to the cuSolverDN library context.
9596 /// - `params`: Structure with information collected by [`cusolverDnSetAdvOptions`].
9597 /// - `trans`: Operation `op(A)` that is non- or (conj.) transpose.
9598 /// - `n`: Number of rows and columns of matrix `A`.
9599 /// - `nrhs`: Number of right-hand sides.
9600 /// - `dataTypeA`: Data type of array `A`.
9601 /// - `A`: Array of dimension `lda * n` with `lda` is not less than `max(1,n)`.
9602 /// - `lda`: Leading dimension of two-dimensional array used to store matrix `A`.
9603 /// - `ipiv`: Array of size at least `n`, containing pivot indices.
9604 /// - `dataTypeB`: Data type of array `B`.
9605 /// - `B`: <type> array of dimension `ldb * nrhs` with `ldb` is not less than `max(1,n)`.
9606 /// - `ldb`: Leading dimension of two-dimensional array used to store matrix `B`.
9607 /// - `info`: If `info = 0`, the operation is successful. If `info = -i`, the `i-th` parameter is wrong (not counting handle).
9608 ///
9609 /// # Return value
9610 ///
9611 /// - [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]: An internal operation failed.
9612 /// - [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]: Invalid parameters were passed (`n<0` or `lda<max(1,n)` or `ldb<max(1,n)`).
9613 /// - [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]: The library was not initialized.
9614 /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The operation completed successfully.
9615 pub fn cusolverDnXgetrs(
9616 handle: cusolverDnHandle_t,
9617 params: cusolverDnParams_t,
9618 trans: cublasOperation_t,
9619 n: i64,
9620 nrhs: i64,
9621 dataTypeA: cudaDataType,
9622 A: *const ::core::ffi::c_void,
9623 lda: i64,
9624 ipiv: *const i64,
9625 dataTypeB: cudaDataType,
9626 B: *mut ::core::ffi::c_void,
9627 ldb: i64,
9628 info: *mut ::core::ffi::c_int,
9629 ) -> cusolverStatus_t;
9630}
9631unsafe extern "C" {
9632 pub fn cusolverDnXsyevd_bufferSize(
9633 handle: cusolverDnHandle_t,
9634 params: cusolverDnParams_t,
9635 jobz: cusolverEigMode_t,
9636 uplo: cublasFillMode_t,
9637 n: i64,
9638 dataTypeA: cudaDataType,
9639 A: *const ::core::ffi::c_void,
9640 lda: i64,
9641 dataTypeW: cudaDataType,
9642 W: *const ::core::ffi::c_void,
9643 computeType: cudaDataType,
9644 workspaceInBytesOnDevice: *mut size_t,
9645 workspaceInBytesOnHost: *mut size_t,
9646 ) -> cusolverStatus_t;
9647}
9648unsafe extern "C" {
9649 /// The helper functions below can calculate the sizes needed for pre-allocated buffer.
9650 ///
9651 /// The following routine:
9652 ///
9653 /// computes eigenvalues and eigenvectors of a symmetric (Hermitian) $n \times n$ matrix `A` using the generic API interface. The standard symmetric eigenvalue problem is:
9654 /// $$
9655 /// A\\*V = V\\*\Lambda
9656 /// $$
9657 ///
9658 /// 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.
9659 ///
9660 /// 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`].
9661 ///
9662 /// 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.
9663 ///
9664 /// 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.
9665 ///
9666 /// Please visit [cuSOLVER Library Samples - Xsyevd](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/Xsyevd) for a code example.
9667 ///
9668 /// Currently, [`cusolverDnXsyevd`] supports only the default algorithm.
9669 ///
9670 /// **Algorithms supported by cusolverDnXsyevd**
9671 ///
9672 /// | | |
9673 /// | --- | --- |
9674 /// | [`cusolverAlgMode_t::CUSOLVER_ALG_0`] or `NULL` | Default algorithm. |
9675 ///
9676 /// List of input arguments for [`cusolverDnXsyevd_bufferSize`] and [`cusolverDnXsyevd`]:
9677 ///
9678 /// 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.
9679 ///
9680 /// **Valid combination of data type and compute type**
9681 ///
9682 /// | **DataTypeA** | **DataTypeW** | **ComputeType** | **Meaning** |
9683 /// | --- | --- | --- | --- |
9684 /// | `CUDA_R_32F` | `CUDA_R_32F` | `CUDA_R_32F` | `SSYEVD` |
9685 /// | `CUDA_R_64F` | `CUDA_R_64F` | `CUDA_R_64F` | `DSYEVD` |
9686 /// | `CUDA_C_32F` | `CUDA_R_32F` | `CUDA_C_32F` | `CHEEVD` |
9687 /// | `CUDA_C_64F` | `CUDA_R_64F` | `CUDA_C_64F` | `ZHEEVD` |
9688 ///
9689 /// # Parameters
9690 ///
9691 /// - `handle`: Handle to the cuSolverDN library context.
9692 /// - `params`: Structure with information collected by [`cusolverDnSetAdvOptions`].
9693 /// - `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.
9694 /// - `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.
9695 /// - `n`: Number of rows (or columns) of matrix `A`.
9696 /// - `dataTypeA`: Data type of array `A`.
9697 /// - `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.
9698 /// - `lda`: Leading dimension of two-dimensional array used to store matrix `A`.
9699 /// - `dataTypeW`: Data type of array `W`.
9700 /// - `W`: A real array of dimension `n`. The eigenvalue values of `A`, in ascending order, i.e., sorted so that `W(i) <= W(i+1)`.
9701 /// - `computeType`: Data type of computation.
9702 /// - `bufferOnDevice`: Device workspace. Array of type `void` of size `workspaceInBytesOnDevice` bytes.
9703 /// - `workspaceInBytesOnDevice`: Size in bytes of `bufferOnDevice`, returned by [`cusolverDnXsyevd_bufferSize`].
9704 /// - `bufferOnHost`: Host workspace. Array of type `void` of size `workspaceInBytesOnHost` bytes.
9705 /// - `workspaceInBytesOnHost`: Size in bytes of `bufferOnHost`, returned by [`cusolverDnXsyevd_bufferSize`].
9706 /// - `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.
9707 ///
9708 /// # Return value
9709 ///
9710 /// - [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]: An internal operation failed.
9711 /// - [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]: Invalid parameters were passed (`n<0`, or `lda<max(1,n)`, or `jobz` is not [`cusolverEigMode_t::CUSOLVER_EIG_MODE_NOVECTOR`] or [`cusolverEigMode_t::CUSOLVER_EIG_MODE_VECTOR`], or `uplo` is not [`cublasFillMode_t::CUBLAS_FILL_MODE_LOWER`] or [`cublasFillMode_t::CUBLAS_FILL_MODE_UPPER`]).
9712 /// - [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]: The library was not initialized.
9713 /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The operation completed successfully.
9714 pub fn cusolverDnXsyevd(
9715 handle: cusolverDnHandle_t,
9716 params: cusolverDnParams_t,
9717 jobz: cusolverEigMode_t,
9718 uplo: cublasFillMode_t,
9719 n: i64,
9720 dataTypeA: cudaDataType,
9721 A: *mut ::core::ffi::c_void,
9722 lda: i64,
9723 dataTypeW: cudaDataType,
9724 W: *mut ::core::ffi::c_void,
9725 computeType: cudaDataType,
9726 bufferOnDevice: *mut ::core::ffi::c_void,
9727 workspaceInBytesOnDevice: size_t,
9728 bufferOnHost: *mut ::core::ffi::c_void,
9729 workspaceInBytesOnHost: size_t,
9730 info: *mut ::core::ffi::c_int,
9731 ) -> cusolverStatus_t;
9732}
9733unsafe extern "C" {
9734 pub fn cusolverDnXstedc_bufferSize(
9735 handle: cusolverDnHandle_t,
9736 params: cusolverDnParams_t,
9737 compz: cusolverEigComp_t,
9738 n: i64,
9739 dataTypeDE: cudaDataType,
9740 D: *const ::core::ffi::c_void,
9741 E: *const ::core::ffi::c_void,
9742 dataTypeZ: cudaDataType,
9743 Z: *const ::core::ffi::c_void,
9744 ldz: i64,
9745 computeType: cudaDataType,
9746 workspaceInBytesOnDevice: *mut size_t,
9747 workspaceInBytesOnHost: *mut size_t,
9748 ) -> cusolverStatus_t;
9749}
9750unsafe extern "C" {
9751 /// The helper function below can calculate the sizes needed for the pre-allocated buffers.
9752 ///
9753 /// The following routine
9754 ///
9755 /// computes all eigenvalues and (optionally) eigenvectors of a real symmetric tridiagonal matrix using the divide and conquer algorithm. This function corresponds to the LAPACK routine `STEDC`.
9756 ///
9757 /// The symmetric tridiagonal matrix is defined by the diagonal elements in vector `D` (length `n`) and the subdiagonal elements in vector `E` (length `n-1`). On successful completion, `D` contains the eigenvalues in ascending order.
9758 ///
9759 /// The user has to provide device and host working spaces which are pointed to by input parameters `bufferOnDevice` and `bufferOnHost`. The input parameter `workspaceInBytesOnDevice` (and `workspaceInBytesOnHost`) is the size in bytes of the device (and host) working space, and it is returned by [`cusolverDnXstedc_bufferSize`].
9760 ///
9761 /// If output parameter `info = -i` (less than zero), the `i-th` parameter is wrong (not counting handle). If `info = i` (greater than zero), the algorithm did not converge and failed to compute all eigenvalues.
9762 ///
9763 /// The parameter `compz` specifies the computational mode: [`cusolverEigComp_t::CUSOLVER_EIG_COMP_N`] compute only the eigenvalues; [`cusolverEigComp_t::CUSOLVER_EIG_COMP_I`] compute eigenvalues and eigenvectors of the tridiagonal matrix; [`cusolverEigComp_t::CUSOLVER_EIG_COMP_V`] compute eigenvalues and eigenvectors as the product of the input matrix `Z` and the unitary transformations applied during STEDC; typically `Z` is on entry the unitary matrix produced by `SYTRD`, and then on exit `Z` holds the eigenvectors of the original matrix.
9764 ///
9765 /// Currently, [`cusolverDnXstedc`] supports only the default algorithm.
9766 ///
9767 /// **Algorithms supported by cusolverDnXstedc**
9768 ///
9769 /// | | |
9770 /// | --- | --- |
9771 /// | [`cusolverAlgMode_t::CUSOLVER_ALG_0`] or `NULL` | Default algorithm. |
9772 ///
9773 /// List of input arguments for [`cusolverDnXstedc_bufferSize`] and [`cusolverDnXstedc`]:
9774 ///
9775 /// The generic API uses `dataTypeDE` for the data type of the vectors `D` and `E`, `dataTypeZ` for the matrix `Z`, and `computeType` for the compute type of the operation. [`cusolverDnXstedc`] only supports the following four combinations.
9776 ///
9777 /// **Valid combination of data type and compute type**
9778 ///
9779 /// | **DataTypeDE** | **DataTypeZ** | **ComputeType** | **Meaning** |
9780 /// | --- | --- | --- | --- |
9781 /// | `CUDA_R_32F` | `CUDA_R_32F` | `CUDA_R_32F` | `SSTEDC` |
9782 /// | `CUDA_R_64F` | `CUDA_R_64F` | `CUDA_R_64F` | `DSTEDC` |
9783 /// | `CUDA_R_32F` | `CUDA_C_32F` | `CUDA_C_32F` | `CSTEDC` |
9784 /// | `CUDA_R_64F` | `CUDA_C_64F` | `CUDA_C_64F` | `ZSTEDC` |
9785 ///
9786 /// # Parameters
9787 ///
9788 /// - `handle`: Handle to the cuSolverDN library context.
9789 /// - `params`: Structure with information collected by [`cusolverDnSetAdvOptions`].
9790 /// - `compz`: Computational mode: [`cusolverEigComp_t::CUSOLVER_EIG_COMP_N`] compute only eigenvalues; [`cusolverEigComp_t::CUSOLVER_EIG_COMP_I`] compute eigenvalues and eigenvectors of the tridiagonal matrix; [`cusolverEigComp_t::CUSOLVER_EIG_COMP_V`] compute eigenvalues and eigenvectors as Z\*Q; Z is typically from SYTRD.
9791 /// - `n`: Problem size. Vector `D` has length `n`, vector `E` has length `n-1`, and matrix `Z` is `n` by `n`.
9792 /// - `dataTypeDE`: Data type of vectors `D` and `E`.
9793 /// - `D`: Vector of length `n`. On input, the diagonal elements of the tridiagonal matrix. On output, if successful, the eigenvalues in ascending order.
9794 /// - `E`: Vector of length `n-1`. On input, the subdiagonal elements of the tridiagonal matrix. On output, the contents are destroyed.
9795 /// - `dataTypeZ`: Data type of array `Z`.
9796 /// - `Z`: Array of dimension `ldz * n`. If `compz` = [`cusolverEigComp_t::CUSOLVER_EIG_COMP_N`], `Z` is not referenced. If `compz` = [`cusolverEigComp_t::CUSOLVER_EIG_COMP_I`], `Z` holds the eigenvectors of the tridiagonal matrix. If `compz` = [`cusolverEigComp_t::CUSOLVER_EIG_COMP_V`], `Z` is overwritten with `Z*Q` (`Q` = unitary from STEDC; `Z` typically from SYTRD).
9797 /// - `ldz`: Leading dimension of two-dimensional array used to store matrix `Z`. If `compz` = [`cusolverEigComp_t::CUSOLVER_EIG_COMP_I`] or [`cusolverEigComp_t::CUSOLVER_EIG_COMP_V`] `ldz >= max(1,n)`. Otherwise, `ldz >= 1`.
9798 /// - `computeType`: Data type of computation.
9799 /// - `bufferOnDevice`: Device workspace. Array of type `void` of size `workspaceInBytesOnDevice` bytes.
9800 /// - `workspaceInBytesOnDevice`: Size in bytes of `bufferOnDevice`, returned by [`cusolverDnXstedc_bufferSize`].
9801 /// - `bufferOnHost`: Host workspace. Array of type `void` of size `workspaceInBytesOnHost` bytes.
9802 /// - `workspaceInBytesOnHost`: Size in bytes of `bufferOnHost`, returned by [`cusolverDnXstedc_bufferSize`].
9803 /// - `info`: If `info = 0`, the operation is successful. If `info = -i`, the `i-th` parameter is wrong (not counting handle). If `info = i` (`i > 0`), the algorithm failed to converge and did not compute all eigenvalues.
9804 ///
9805 /// # Return value
9806 ///
9807 /// - [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]: An internal operation failed.
9808 /// - [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]: Invalid parameters were passed (e.g. `n<0`, or `ldz<max(1,n)` when `compz` is [`cusolverEigComp_t::CUSOLVER_EIG_COMP_I`] or [`cusolverEigComp_t::CUSOLVER_EIG_COMP_V`], or `compz` is not [`cusolverEigComp_t::CUSOLVER_EIG_COMP_N`], [`cusolverEigComp_t::CUSOLVER_EIG_COMP_I`], or [`cusolverEigComp_t::CUSOLVER_EIG_COMP_V`]).
9809 /// - [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]: The library was not initialized.
9810 /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The operation completed successfully.
9811 pub fn cusolverDnXstedc(
9812 handle: cusolverDnHandle_t,
9813 params: cusolverDnParams_t,
9814 compz: cusolverEigComp_t,
9815 n: i64,
9816 dataTypeDE: cudaDataType,
9817 D: *mut ::core::ffi::c_void,
9818 E: *mut ::core::ffi::c_void,
9819 dataTypeZ: cudaDataType,
9820 Z: *mut ::core::ffi::c_void,
9821 ldz: i64,
9822 computeType: cudaDataType,
9823 bufferOnDevice: *mut ::core::ffi::c_void,
9824 workspaceInBytesOnDevice: size_t,
9825 bufferOnHost: *mut ::core::ffi::c_void,
9826 workspaceInBytesOnHost: size_t,
9827 info: *mut ::core::ffi::c_int,
9828 ) -> cusolverStatus_t;
9829}
9830unsafe extern "C" {
9831 pub fn cusolverDnXsyevBatched_bufferSize(
9832 handle: cusolverDnHandle_t,
9833 params: cusolverDnParams_t,
9834 jobz: cusolverEigMode_t,
9835 uplo: cublasFillMode_t,
9836 n: i64,
9837 dataTypeA: cudaDataType,
9838 A: *const ::core::ffi::c_void,
9839 lda: i64,
9840 dataTypeW: cudaDataType,
9841 W: *const ::core::ffi::c_void,
9842 computeType: cudaDataType,
9843 workspaceInBytesOnDevice: *mut size_t,
9844 workspaceInBytesOnHost: *mut size_t,
9845 batchSize: i64,
9846 ) -> cusolverStatus_t;
9847}
9848unsafe extern "C" {
9849 /// The helper functions below can calculate the sizes needed for pre-allocated buffer.
9850 ///
9851 /// The following routine:
9852 ///
9853 /// computes eigenvalues and eigenvectors of a sequence of symmetric (Hermitian) $n \times n$ matrices:
9854 /// $$
9855 /// A_j\\*V_j = V_j\\*\Lambda_j
9856 /// $$
9857 ///
9858 /// 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.
9859 ///
9860 /// `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,
9861 /// $$
9862 /// \begin{split}A = \begin{pmatrix}
9863 /// {A0} & {A1} & \cdots \\\\
9864 /// \end{pmatrix}\end{split}
9865 /// $$
9866 ///
9867 /// 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}$.
9868 ///
9869 /// The parameter `W` also contains the eigenvalues of each matrix in a contiguous way,
9870 /// $$
9871 /// \begin{split}W = \begin{pmatrix}
9872 /// {W0} & {W1} & \cdots \\\\
9873 /// \end{pmatrix}\end{split}
9874 /// $$
9875 ///
9876 /// The formula for random access of `W` is $W_{k}\operatorname{(j)} = {W\lbrack\ j\ +\ n\\*k\rbrack}$.
9877 ///
9878 /// 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`].
9879 ///
9880 /// 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.
9881 ///
9882 /// If `jobz` = [`cusolverEigMode_t::CUSOLVER_EIG_MODE_VECTOR`], $A_{j}$ contains the orthonormal eigenvectors of the matrix $A_{j}$.
9883 ///
9884 /// Note that the problem size is limited by the condition `n`lda`batchSize<=INT32_MAX` primarily due to the current implementation constraints.
9885 ///
9886 /// **Algorithms supported by cusolverDnXsyevBatched**
9887 ///
9888 /// | | |
9889 /// | --- | --- |
9890 /// | [`cusolverAlgMode_t::CUSOLVER_ALG_0`] or `NULL` | Default. May switch between algorithms for best performance. |
9891 /// | [`cusolverAlgMode_t::CUSOLVER_ALG_1`] | Uses a single algorithm for consistent accuracy over all n. |
9892 ///
9893 /// List of input arguments for [`cusolverDnXsyevBatched_bufferSize`] and [`cusolverDnXsyevBatched`]:
9894 ///
9895 /// 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:
9896 ///
9897 /// **Valid combination of data type and compute type**
9898 ///
9899 /// | **DataTypeA** | **DataTypeW** | **ComputeType** | **Meaning** |
9900 /// | --- | --- | --- | --- |
9901 /// | `CUDA_R_32F` | `CUDA_R_32F` | `CUDA_R_32F` | `SSYEVBATCHED` |
9902 /// | `CUDA_R_64F` | `CUDA_R_64F` | `CUDA_R_64F` | `DSYEVBATCHED` |
9903 /// | `CUDA_C_32F` | `CUDA_R_32F` | `CUDA_C_32F` | `CSYEVBATCHED` |
9904 /// | `CUDA_C_64F` | `CUDA_R_64F` | `CUDA_C_64F` | `ZSYEVBATCHED` |
9905 ///
9906 /// # Parameters
9907 ///
9908 /// - `handle`: Handle to the cuSolverDN library context.
9909 /// - `params`: Structure with information collected by [`cusolverDnSetAdvOptions`].
9910 /// - `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.
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 * 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.
9915 /// - `lda`: Leading dimension of two-dimensional array used to store matrix `Aj`.`lda` is not less than `max(1,n)`.
9916 /// - `dataTypeW`: Data type of array `W`.
9917 /// - `W`: A real array of dimension `n * batchSize`. The eigenvalue values of `Aj`, in ascending order, i.e., sorted so that `Wj(i) <= Wj(i+1)`.
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 [`cusolverDnXsyevBatched_bufferSize`].
9921 /// - `bufferOnHost`: Host workspace. Array of type `void` of size `workspaceInBytesOnHost` bytes.
9922 /// - `workspaceInBytesOnHost`: Size in bytes of `bufferOnHost`, returned by [`cusolverDnXsyevBatched_bufferSize`].
9923 /// - `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.
9924 /// - `batchSize`: Number of matrices. `batchSize` is not less than 1.
9925 ///
9926 /// # Return value
9927 ///
9928 /// - [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]: An internal operation failed.
9929 /// - [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]: Invalid parameters were passed (`n<0`, or `n`lda`batchSize>INT32_MAX`, or `lda<max(1,n)`, or `jobz` is not [`cusolverEigMode_t::CUSOLVER_EIG_MODE_NOVECTOR`] or `uplo` is not [`cublasFillMode_t::CUBLAS_FILL_MODE_LOWER`] or [`cublasFillMode_t::CUBLAS_FILL_MODE_UPPER`] or `batchSize<0`).
9930 /// - [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]: The library was not initialized.
9931 /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The operation completed successfully.
9932 pub fn cusolverDnXsyevBatched(
9933 handle: cusolverDnHandle_t,
9934 params: cusolverDnParams_t,
9935 jobz: cusolverEigMode_t,
9936 uplo: cublasFillMode_t,
9937 n: i64,
9938 dataTypeA: cudaDataType,
9939 A: *mut ::core::ffi::c_void,
9940 lda: i64,
9941 dataTypeW: cudaDataType,
9942 W: *mut ::core::ffi::c_void,
9943 computeType: cudaDataType,
9944 bufferOnDevice: *mut ::core::ffi::c_void,
9945 workspaceInBytesOnDevice: size_t,
9946 bufferOnHost: *mut ::core::ffi::c_void,
9947 workspaceInBytesOnHost: size_t,
9948 info: *mut ::core::ffi::c_int,
9949 batchSize: i64,
9950 ) -> cusolverStatus_t;
9951}
9952unsafe extern "C" {
9953 pub fn cusolverDnXsyevdx_bufferSize(
9954 handle: cusolverDnHandle_t,
9955 params: cusolverDnParams_t,
9956 jobz: cusolverEigMode_t,
9957 range: cusolverEigRange_t,
9958 uplo: cublasFillMode_t,
9959 n: i64,
9960 dataTypeA: cudaDataType,
9961 A: *const ::core::ffi::c_void,
9962 lda: i64,
9963 vl: *mut ::core::ffi::c_void,
9964 vu: *mut ::core::ffi::c_void,
9965 il: i64,
9966 iu: i64,
9967 h_meig: *mut i64,
9968 dataTypeW: cudaDataType,
9969 W: *const ::core::ffi::c_void,
9970 computeType: cudaDataType,
9971 workspaceInBytesOnDevice: *mut size_t,
9972 workspaceInBytesOnHost: *mut size_t,
9973 ) -> cusolverStatus_t;
9974}
9975unsafe extern "C" {
9976 /// The helper functions below can calculate the sizes needed for pre-allocated buffer.
9977 ///
9978 /// The following routine:
9979 ///
9980 /// 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:
9981 /// $$
9982 /// A\\*V = V\\*\Lambda
9983 /// $$
9984 ///
9985 /// 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.
9986 ///
9987 /// 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`].
9988 ///
9989 /// 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.
9990 ///
9991 /// 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.
9992 ///
9993 /// Currently, [`cusolverDnXsyevdx`] supports only the default algorithm.
9994 ///
9995 /// Please visit [cuSOLVER Library Samples - Xsyevdx](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/Xsyevdx) for a code example.
9996 ///
9997 /// **Algorithms supported by cusolverDnXsyevdx**
9998 ///
9999 /// | | |
10000 /// | --- | --- |
10001 /// | [`cusolverAlgMode_t::CUSOLVER_ALG_0`] or `NULL` | Default algorithm. |
10002 ///
10003 /// List of input arguments for [`cusolverDnXsyevdx_bufferSize`] and [`cusolverDnXsyevdx`]:
10004 ///
10005 /// 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:
10006 ///
10007 /// **Valid combination of data type and compute type**
10008 ///
10009 /// | **DataTypeA** | **DataTypeW** | **ComputeType** | **Meaning** |
10010 /// | --- | --- | --- | --- |
10011 /// | `CUDA_R_32F` | `CUDA_R_32F` | `CUDA_R_32F` | `SSYEVDX` |
10012 /// | `CUDA_R_64F` | `CUDA_R_64F` | `CUDA_R_64F` | `DSYEVDX` |
10013 /// | `CUDA_C_32F` | `CUDA_R_32F` | `CUDA_C_32F` | `CHEEVDX` |
10014 /// | `CUDA_C_64F` | `CUDA_R_64F` | `CUDA_C_64F` | `ZHEEVDX` |
10015 ///
10016 /// # Parameters
10017 ///
10018 /// - `handle`: Handle to the cuSolverDN library context.
10019 /// - `params`: Structure with information collected by [`cusolverDnSetAdvOptions`].
10020 /// - `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.
10021 /// - `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;.
10022 /// - `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.
10023 /// - `n`: Number of rows (or columns) of matrix `A`.
10024 /// - `dataTypeA`: Data type of array `A`.
10025 /// - `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.
10026 /// - `lda`: Leading dimension of two-dimensional array used to store matrix `A`.`lda` is not less than `max(1,n)`.
10027 /// - `dataTypeW`: Data type of array `W`.
10028 /// - `W`: A real array of dimension `n`. The eigenvalue values of `A`, in ascending order, i.e., sorted so that `W(i) <= W(i+1)`.
10029 /// - `computeType`: Data type of computation.
10030 /// - `bufferOnDevice`: Device workspace. Array of type `void` of size `workspaceInBytesOnDevice` bytes.
10031 /// - `workspaceInBytesOnDevice`: Size in bytes of `bufferOnDevice`, returned by [`cusolverDnXsyevdx_bufferSize`].
10032 /// - `bufferOnHost`: Host workspace. Array of type `void` of size `workspaceInBytesOnHost` bytes.
10033 /// - `workspaceInBytesOnHost`: Size in bytes of `bufferOnHost`, returned by [`cusolverDnXsyevdx_bufferSize`].
10034 /// - `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.
10035 ///
10036 /// # Return value
10037 ///
10038 /// - [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]: An internal operation failed.
10039 /// - [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]: Invalid parameters were passed (`n<0`, or `lda<max(1,n)`, or `jobz` is not [`cusolverEigMode_t::CUSOLVER_EIG_MODE_NOVECTOR`] or [`cusolverEigMode_t::CUSOLVER_EIG_MODE_VECTOR`], or `range` is not [`cusolverEigRange_t::CUSOLVER_EIG_RANGE_ALL`] or [`cusolverEigRange_t::CUSOLVER_EIG_RANGE_V`] or [`cusolverEigRange_t::CUSOLVER_EIG_RANGE_I`], or `uplo` is not [`cublasFillMode_t::CUBLAS_FILL_MODE_LOWER`] or [`cublasFillMode_t::CUBLAS_FILL_MODE_UPPER`]).
10040 /// - [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]: The library was not initialized.
10041 /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The operation completed successfully.
10042 pub fn cusolverDnXsyevdx(
10043 handle: cusolverDnHandle_t,
10044 params: cusolverDnParams_t,
10045 jobz: cusolverEigMode_t,
10046 range: cusolverEigRange_t,
10047 uplo: cublasFillMode_t,
10048 n: i64,
10049 dataTypeA: cudaDataType,
10050 A: *mut ::core::ffi::c_void,
10051 lda: i64,
10052 vl: *mut ::core::ffi::c_void,
10053 vu: *mut ::core::ffi::c_void,
10054 il: i64,
10055 iu: i64,
10056 meig64: *mut i64,
10057 dataTypeW: cudaDataType,
10058 W: *mut ::core::ffi::c_void,
10059 computeType: cudaDataType,
10060 bufferOnDevice: *mut ::core::ffi::c_void,
10061 workspaceInBytesOnDevice: size_t,
10062 bufferOnHost: *mut ::core::ffi::c_void,
10063 workspaceInBytesOnHost: size_t,
10064 info: *mut ::core::ffi::c_int,
10065 ) -> cusolverStatus_t;
10066}
10067unsafe extern "C" {
10068 pub fn cusolverDnXgeev_bufferSize(
10069 handle: cusolverDnHandle_t,
10070 params: cusolverDnParams_t,
10071 jobvl: cusolverEigMode_t,
10072 jobvr: cusolverEigMode_t,
10073 n: i64,
10074 dataTypeA: cudaDataType,
10075 A: *const ::core::ffi::c_void,
10076 lda: i64,
10077 dataTypeW: cudaDataType,
10078 W: *const ::core::ffi::c_void,
10079 dataTypeVL: cudaDataType,
10080 VL: *const ::core::ffi::c_void,
10081 ldvl: i64,
10082 dataTypeVR: cudaDataType,
10083 VR: *const ::core::ffi::c_void,
10084 ldvr: i64,
10085 computeType: cudaDataType,
10086 workspaceInBytesOnDevice: *mut size_t,
10087 workspaceInBytesOnHost: *mut size_t,
10088 ) -> cusolverStatus_t;
10089}
10090unsafe extern "C" {
10091 /// The helper functions below can calculate the sizes needed for pre-allocated buffer.
10092 ///
10093 /// The following routine:
10094 ///
10095 /// 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:
10096 /// $$
10097 /// A\\*v(j) = w(j)\\*v(j)
10098 /// $$
10099 ///
10100 /// where `w(j)` is its eigenvalue. The left eigenvalue `u(j)` of `A` satisfies:
10101 /// $$
10102 /// u(j)^{H}\\*A = w(j)\\*v(j)^{H}
10103 /// $$
10104 ///
10105 /// where $u(j)^{H}$ denotes the conjugate-transpose of `u(j)`.
10106 ///
10107 /// The computed eigenvectors are normalized to have Euclidean norm equal to 1 and largest component real.
10108 ///
10109 /// 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.
10110 ///
10111 /// 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`].
10112 ///
10113 /// 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.
10114 ///
10115 /// Remark 1: `geev` only supports the computation of right eigenvectors. So, `jobvl` = [`cusolverEigMode_t::CUSOLVER_EIG_MODE_NOVECTOR`] must be set.
10116 ///
10117 /// Remark 2: `geev` uses balancing to improve the conditioning of the eigenvalues and eigenvectors.
10118 ///
10119 /// Remark 3: `geev` is a hybrid CPU-GPU algorithm. Best performance is attained with pinned host memory.
10120 ///
10121 /// Currently, [`cusolverDnXgeev`] supports only the default algorithm.
10122 ///
10123 /// Please visit [cuSOLVER Library Samples - Xgeev](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/Xgeev) for a code example.
10124 ///
10125 /// **Table of algorithms supported by cusolverDnXgeev**
10126 ///
10127 /// | | |
10128 /// | --- | --- |
10129 /// | [`cusolverAlgMode_t::CUSOLVER_ALG_0`] or `NULL` | Default algorithm. |
10130 ///
10131 /// List of input arguments for [`cusolverDnXgeev_bufferSize`] and [`cusolverDnXgeev`]:
10132 ///
10133 /// 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:
10134 ///
10135 /// **Valid combination of data type and compute type**
10136 ///
10137 /// | **DataTypeA** | **DataTypeW** | **DataTypeVL** | **DataTypeVR** | **ComputeType** | **Meaning** |
10138 /// | --- | --- | --- | --- | --- | --- |
10139 /// | `CUDA_R_32F` | `CUDA_R_32F` | `CUDA_R_32F` | `CUDA_R_32F` | `CUDA_R_32F` | `SGEEV` |
10140 /// | `CUDA_R_32F` | `CUDA_C_32F` | `CUDA_R_32F` | `CUDA_R_32F` | `CUDA_R_32F` | 32F mixed real-complex |
10141 /// | `CUDA_R_64F` | `CUDA_R_64F` | `CUDA_R_64F` | `CUDA_R_64F` | `CUDA_R_64F` | `DGEEV` |
10142 /// | `CUDA_R_64F` | `CUDA_C_64F` | `CUDA_R_64F` | `CUDA_R_64F` | `CUDA_R_64F` | 64F mixed real-complex |
10143 /// | `CUDA_C_32F` | `CUDA_C_32F` | `CUDA_C_32F` | `CUDA_C_32F` | `CUDA_C_32F` | `CGEEV` |
10144 /// | `CUDA_C_64F` | `CUDA_C_64F` | `CUDA_C_64F` | `CUDA_C_64F` | `CUDA_C_64F` | `ZGEEV` |
10145 ///
10146 /// # Parameters
10147 ///
10148 /// - `handle`: Handle to the cuSolverDN library context.
10149 /// - `params`: Structure with information collected by [`cusolverDnSetAdvOptions`].
10150 /// - `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.
10151 /// - `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.
10152 /// - `n`: Number of rows (or columns) of matrix `A`.
10153 /// - `dataTypeA`: Data type of array `A`.
10154 /// - `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.
10155 /// - `lda`: Leading dimension of two-dimensional array used to store matrix `A`.
10156 /// - `dataTypeW`: Data type of array `W`.
10157 /// - `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.
10158 /// - `dataTypeVL`: Data type of array `VL`.
10159 /// - `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.
10160 /// - `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`.
10161 /// - `dataTypeVR`: Data type of array `VR`.
10162 /// - `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.
10163 /// - `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`.
10164 /// - `computeType`: Data type of computation.
10165 /// - `bufferOnDevice`: Device workspace. Array of type `void` of size `workspaceInBytesOnDevice` bytes.
10166 /// - `workspaceInBytesOnDevice`: Size in bytes of `bufferOnDevice`, returned by [`cusolverDnXgeev_bufferSize`].
10167 /// - `bufferOnHost`: Host workspace. Array of type `void` of size `workspaceInBytesOnHost` bytes.
10168 /// - `workspaceInBytesOnHost`: Size in bytes of `bufferOnHost`, returned by [`cusolverDnXgeev_bufferSize`].
10169 /// - `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.
10170 ///
10171 /// # Return value
10172 ///
10173 /// - [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]: An internal operation failed.
10174 /// - [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]: Invalid parameters were passed (`jobvl` is not [`cusolverEigMode_t::CUSOLVER_EIG_MODE_NOVECTOR`] or [`cusolverEigMode_t::CUSOLVER_EIG_MODE_VECTOR`], or `jobvr` is not [`cusolverEigMode_t::CUSOLVER_EIG_MODE_NOVECTOR`] or [`cusolverEigMode_t::CUSOLVER_EIG_MODE_VECTOR`], `n<0`, or `lda < max(1,n)`, or `ldvl < n` if `jobvl` is [`cusolverEigMode_t::CUSOLVER_EIG_MODE_VECTOR`], or `ldvr < n` if `jobvr` is [`cusolverEigMode_t::CUSOLVER_EIG_MODE_VECTOR`]).
10175 /// - [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]: The library was not initialized.
10176 /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The operation completed successfully.
10177 pub fn cusolverDnXgeev(
10178 handle: cusolverDnHandle_t,
10179 params: cusolverDnParams_t,
10180 jobvl: cusolverEigMode_t,
10181 jobvr: cusolverEigMode_t,
10182 n: i64,
10183 dataTypeA: cudaDataType,
10184 A: *mut ::core::ffi::c_void,
10185 lda: i64,
10186 dataTypeW: cudaDataType,
10187 W: *mut ::core::ffi::c_void,
10188 dataTypeVL: cudaDataType,
10189 VL: *mut ::core::ffi::c_void,
10190 ldvl: i64,
10191 dataTypeVR: cudaDataType,
10192 VR: *mut ::core::ffi::c_void,
10193 ldvr: i64,
10194 computeType: cudaDataType,
10195 bufferOnDevice: *mut ::core::ffi::c_void,
10196 workspaceInBytesOnDevice: size_t,
10197 bufferOnHost: *mut ::core::ffi::c_void,
10198 workspaceInBytesOnHost: size_t,
10199 info: *mut ::core::ffi::c_int,
10200 ) -> cusolverStatus_t;
10201}
10202unsafe extern "C" {
10203 pub fn cusolverDnXgesvd_bufferSize(
10204 handle: cusolverDnHandle_t,
10205 params: cusolverDnParams_t,
10206 jobu: ::core::ffi::c_schar,
10207 jobvt: ::core::ffi::c_schar,
10208 m: i64,
10209 n: i64,
10210 dataTypeA: cudaDataType,
10211 A: *const ::core::ffi::c_void,
10212 lda: i64,
10213 dataTypeS: cudaDataType,
10214 S: *const ::core::ffi::c_void,
10215 dataTypeU: cudaDataType,
10216 U: *const ::core::ffi::c_void,
10217 ldu: i64,
10218 dataTypeVT: cudaDataType,
10219 VT: *const ::core::ffi::c_void,
10220 ldvt: i64,
10221 computeType: cudaDataType,
10222 workspaceInBytesOnDevice: *mut size_t,
10223 workspaceInBytesOnHost: *mut size_t,
10224 ) -> cusolverStatus_t;
10225}
10226unsafe extern "C" {
10227 /// The helper functions below can calculate the sizes needed for pre-allocated buffer.
10228 ///
10229 /// The following routine:
10230 ///
10231 /// 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:
10232 /// $$
10233 /// A = U\\*\Sigma\\*V^{H}
10234 /// $$
10235 ///
10236 /// 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`.
10237 ///
10238 /// 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`].
10239 ///
10240 /// 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.
10241 ///
10242 /// Currently, [`cusolverDnXgesvd`] supports only the default algorithm.
10243 ///
10244 /// **Algorithms supported by cusolverDnXgesvd**
10245 ///
10246 /// | | |
10247 /// | --- | --- |
10248 /// | [`cusolverAlgMode_t::CUSOLVER_ALG_0`] or `NULL` | Default algorithm. |
10249 ///
10250 /// Please visit [cuSOLVER Library Samples - Xgesvd](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/Xgesvd) for a code example.
10251 ///
10252 /// Remark 1: `gesvd` only supports `m>=n`.
10253 ///
10254 /// Remark 2: the routine returns $V^H$, not `V`.
10255 ///
10256 /// List of input arguments for [`cusolverDnXgesvd_bufferSize`] and [`cusolverDnXgesvd`]:
10257 ///
10258 /// 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.
10259 ///
10260 /// **Valid combination of data type and compute type**
10261 ///
10262 /// | **DataTypeA** | **DataTypeS** | **DataTypeU** | **DataTypeVT** | **ComputeType** | **Meaning** |
10263 /// | --- | --- | --- | --- | --- | --- |
10264 /// | `CUDA_R_32F` | `CUDA_R_32F` | `CUDA_R_32F` | `CUDA_R_32F` | `CUDA_R_32F` | `SGESVD` |
10265 /// | `CUDA_R_64F` | `CUDA_R_64F` | `CUDA_R_64F` | `CUDA_R_64F` | `CUDA_R_64F` | `DGESVD` |
10266 /// | `CUDA_C_32F` | `CUDA_R_32F` | `CUDA_C_32F` | `CUDA_C_32F` | `CUDA_C_32F` | `CGESVD` |
10267 /// | `CUDA_C_64F` | `CUDA_R_64F` | `CUDA_C_64F` | `CUDA_C_64F` | `CUDA_C_64F` | `ZGESVD` |
10268 ///
10269 /// # Parameters
10270 ///
10271 /// - `handle`: Handle to the cuSolverDN library context.
10272 /// - `params`: Structure with information collected by [`cusolverDnSetAdvOptions`].
10273 /// - `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.
10274 /// - `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.
10275 /// - `m`: Number of rows of matrix `A`.
10276 /// - `n`: Number of columns of matrix `A`.
10277 /// - `dataTypeA`: Data type of array `A`.
10278 /// - `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.
10279 /// - `lda`: Leading dimension of two-dimensional array used to store matrix `A`.
10280 /// - `dataTypeS`: Data type of array `S`.
10281 /// - `S`: Real array of dimension `min(m,n)`. The singular values of A, sorted so that `S(i) >= S(i+1)`.
10282 /// - `dataTypeU`: Data type of array `U`.
10283 /// - `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.
10284 /// - `ldu`: Leading dimension of two-dimensional array used to store matrix `U`. If `jobu` = ‘A’ or ‘S’, `ldu >= max(1,m)`. Otherwise, `ldu >= 1`.
10285 /// - `dataTypeVT`: Data type of array `VT`.
10286 /// - `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.
10287 /// - `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`.
10288 /// - `computeType`: Data type of computation.
10289 /// - `bufferOnDevice`: Device workspace. Array of type `void` of size `workspaceInBytesOnDevice` bytes.
10290 /// - `workspaceInBytesOnDevice`: Size in bytes of `bufferOnDevice`, returned by [`cusolverDnXgesvd_bufferSize`].
10291 /// - `bufferOnHost`: Host workspace. Array of type `void` of size `workspaceInBytesOnHost` bytes.
10292 /// - `workspaceInBytesOnHost`: Size in bytes of `bufferOnHost`, returned by [`cusolverDnXgesvd_bufferSize`].
10293 /// - `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.
10294 ///
10295 /// # Return value
10296 ///
10297 /// - [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]: An internal operation failed.
10298 /// - [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]: Invalid parameters were passed (`m,n<0`, or `lda<max(1,m)`, or `ldu<1`, or if `jobu` = 'S' or 'A', `ldu` < m, or `ldvt<1`, or if `jobvt` = ‘A’ `ldvt<n`, or if `jobvt` = ‘S’ `ldvt<min(m,n)`, or `jobu`, `jobvt` are none of ‘N’, ‘O’, ‘S’, ‘A’, or `jobu` = `jobvt` = ‘O’ ).
10299 /// - [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]: The library was not initialized.
10300 /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The operation completed successfully.
10301 pub fn cusolverDnXgesvd(
10302 handle: cusolverDnHandle_t,
10303 params: cusolverDnParams_t,
10304 jobu: ::core::ffi::c_schar,
10305 jobvt: ::core::ffi::c_schar,
10306 m: i64,
10307 n: i64,
10308 dataTypeA: cudaDataType,
10309 A: *mut ::core::ffi::c_void,
10310 lda: i64,
10311 dataTypeS: cudaDataType,
10312 S: *mut ::core::ffi::c_void,
10313 dataTypeU: cudaDataType,
10314 U: *mut ::core::ffi::c_void,
10315 ldu: i64,
10316 dataTypeVT: cudaDataType,
10317 VT: *mut ::core::ffi::c_void,
10318 ldvt: i64,
10319 computeType: cudaDataType,
10320 bufferOnDevice: *mut ::core::ffi::c_void,
10321 workspaceInBytesOnDevice: size_t,
10322 bufferOnHost: *mut ::core::ffi::c_void,
10323 workspaceInBytesOnHost: size_t,
10324 info: *mut ::core::ffi::c_int,
10325 ) -> cusolverStatus_t;
10326}
10327unsafe extern "C" {
10328 pub fn cusolverDnXgesvdp_bufferSize(
10329 handle: cusolverDnHandle_t,
10330 params: cusolverDnParams_t,
10331 jobz: cusolverEigMode_t,
10332 econ: ::core::ffi::c_int,
10333 m: i64,
10334 n: i64,
10335 dataTypeA: cudaDataType,
10336 A: *const ::core::ffi::c_void,
10337 lda: i64,
10338 dataTypeS: cudaDataType,
10339 S: *const ::core::ffi::c_void,
10340 dataTypeU: cudaDataType,
10341 U: *const ::core::ffi::c_void,
10342 ldu: i64,
10343 dataTypeV: cudaDataType,
10344 V: *const ::core::ffi::c_void,
10345 ldv: i64,
10346 computeType: cudaDataType,
10347 workspaceInBytesOnDevice: *mut size_t,
10348 workspaceInBytesOnHost: *mut size_t,
10349 ) -> cusolverStatus_t;
10350}
10351unsafe extern "C" {
10352 /// The helper functions below can calculate the sizes needed for pre-allocated buffer.
10353 ///
10354 /// The routine below:
10355 ///
10356 /// 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:
10357 /// $$
10358 /// A = U\\*\Sigma\\*V^H
10359 /// $$
10360 ///
10361 /// 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`.
10362 ///
10363 /// [`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.
10364 ///
10365 /// 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`].
10366 ///
10367 /// If output parameter `info = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
10368 ///
10369 /// Currently, [`cusolverDnXgesvdp`] supports only the default algorithm.
10370 ///
10371 /// **Algorithms supported by cusolverDnXgesvdp**
10372 ///
10373 /// | | |
10374 /// | --- | --- |
10375 /// | [`cusolverAlgMode_t::CUSOLVER_ALG_0`] or `NULL` | Default algorithm. |
10376 ///
10377 /// Please visit [cuSOLVER Library Samples - Xgesvdp](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/Xgesvdp) for a code example.
10378 ///
10379 /// Remark 1: `gesvdp` supports `n>=m` as well.
10380 ///
10381 /// Remark 2: the routine returns `V`, not $V^{H}$
10382 ///
10383 /// List of input arguments for [`cusolverDnXgesvdp_bufferSize`] and [`cusolverDnXgesvdp`]:
10384 ///
10385 /// 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:
10386 ///
10387 /// **Valid combination of data type and compute type**
10388 ///
10389 /// | **DataTypeA** | **DataTypeS** | **DataTypeU** | **DataTypeV** | **ComputeType** | **Meaning** |
10390 /// | --- | --- | --- | --- | --- | --- |
10391 /// | `CUDA_R_32F` | `CUDA_R_32F` | `CUDA_R_32F` | `CUDA_R_32F` | `CUDA_R_32F` | `SGESVDP` |
10392 /// | `CUDA_R_64F` | `CUDA_R_64F` | `CUDA_R_64F` | `CUDA_R_64F` | `CUDA_R_64F` | `DGESVDP` |
10393 /// | `CUDA_C_32F` | `CUDA_R_32F` | `CUDA_C_32F` | `CUDA_C_32F` | `CUDA_C_32F` | `CGESVDP` |
10394 /// | `CUDA_C_64F` | `CUDA_R_64F` | `CUDA_C_64F` | `CUDA_C_64F` | `CUDA_C_64F` | `ZGESVDP` |
10395 ///
10396 /// # Parameters
10397 ///
10398 /// - `handle`: Handle to the cuSolverDN library context.
10399 /// - `params`: Structure with information collected by [`cusolverDnSetAdvOptions`].
10400 /// - `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.
10401 /// - `econ`: `econ = 1` for economy size for `U` and `V`.
10402 /// - `m`: Number of rows of matrix `A`.
10403 /// - `n`: Number of columns of matrix `A`.
10404 /// - `dataTypeA`: Data type of array `A`.
10405 /// - `A`: Array of dimension `lda * n` with `lda` is not less than `max(1,m)`. On exit, the contents of `A` are destroyed.
10406 /// - `lda`: Leading dimension of two-dimensional array used to store matrix `A`.
10407 /// - `dataTypeS`: Data type of array `S`.
10408 /// - `S`: Real array of dimension `min(m,n)`. The singular values of A, sorted so that `S(i) >= S(i+1)`.
10409 /// - `dataTypeU`: Data type of array `U`.
10410 /// - `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`.
10411 /// - `ldu`: Leading dimension of two-dimensional array used to store matrix `U`.
10412 /// - `dataTypeV`: Data type of array `V`.
10413 /// - `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`.
10414 /// - `ldv`: Leading dimension of two-dimensional array used to store matrix `V`.
10415 /// - `computeType`: Data type of computation.
10416 /// - `bufferOnDevice`: Device workspace. Array of type `void` of size `workspaceInBytesOnDevice` bytes.
10417 /// - `workspaceInBytesOnDevice`: Size in bytes of `bufferOnDevice`, returned by [`cusolverDnXgesvdp_bufferSize`].
10418 /// - `bufferOnHost`: Host workspace. Array of type `void` of size `workspaceInBytesOnHost` bytes.
10419 /// - `workspaceInBytesOnHost`: Size in bytes of `bufferOnHost`, returned by [`cusolverDnXgesvdp_bufferSize`].
10420 /// - `h_err_sigma`: Magnitude of the perturbation, showing the accuracy of SVD.
10421 ///
10422 /// # Return value
10423 ///
10424 /// - [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]: An internal operation failed.
10425 /// - [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]: Invalid parameters were passed (`m,n<0` or `lda<max(1,m)` or `ldu<max(1,m)` or `ldv<max(1,n)`).
10426 /// - [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]: The library was not initialized.
10427 /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The operation completed successfully.
10428 pub fn cusolverDnXgesvdp(
10429 handle: cusolverDnHandle_t,
10430 params: cusolverDnParams_t,
10431 jobz: cusolverEigMode_t,
10432 econ: ::core::ffi::c_int,
10433 m: i64,
10434 n: i64,
10435 dataTypeA: cudaDataType,
10436 A: *mut ::core::ffi::c_void,
10437 lda: i64,
10438 dataTypeS: cudaDataType,
10439 S: *mut ::core::ffi::c_void,
10440 dataTypeU: cudaDataType,
10441 U: *mut ::core::ffi::c_void,
10442 ldu: i64,
10443 dataTypeV: cudaDataType,
10444 V: *mut ::core::ffi::c_void,
10445 ldv: i64,
10446 computeType: cudaDataType,
10447 bufferOnDevice: *mut ::core::ffi::c_void,
10448 workspaceInBytesOnDevice: size_t,
10449 bufferOnHost: *mut ::core::ffi::c_void,
10450 workspaceInBytesOnHost: size_t,
10451 d_info: *mut ::core::ffi::c_int,
10452 h_err_sigma: *mut f64,
10453 ) -> cusolverStatus_t;
10454}
10455unsafe extern "C" {
10456 pub fn cusolverDnXgesvdr_bufferSize(
10457 handle: cusolverDnHandle_t,
10458 params: cusolverDnParams_t,
10459 jobu: ::core::ffi::c_schar,
10460 jobv: ::core::ffi::c_schar,
10461 m: i64,
10462 n: i64,
10463 k: i64,
10464 p: i64,
10465 niters: i64,
10466 dataTypeA: cudaDataType,
10467 A: *const ::core::ffi::c_void,
10468 lda: i64,
10469 dataTypeSrand: cudaDataType,
10470 Srand: *const ::core::ffi::c_void,
10471 dataTypeUrand: cudaDataType,
10472 Urand: *const ::core::ffi::c_void,
10473 ldUrand: i64,
10474 dataTypeVrand: cudaDataType,
10475 Vrand: *const ::core::ffi::c_void,
10476 ldVrand: i64,
10477 computeType: cudaDataType,
10478 workspaceInBytesOnDevice: *mut size_t,
10479 workspaceInBytesOnHost: *mut size_t,
10480 ) -> cusolverStatus_t;
10481}
10482unsafe extern "C" {
10483 /// The helper functions below can calculate the sizes needed for pre-allocated buffer.
10484 ///
10485 /// The routine below
10486 ///
10487 /// 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:
10488 /// $$
10489 /// A_{k}\approx U\\*\Sigma\\*V^{H}
10490 /// $$
10491 ///
10492 /// 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`.
10493 ///
10494 /// [`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.
10495 ///
10496 /// 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`].
10497 ///
10498 /// 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.
10499 ///
10500 /// 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`].
10501 ///
10502 /// If output parameter `info = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
10503 ///
10504 /// Currently, [`cusolverDnXgesvdr`] supports only the default algorithm.
10505 ///
10506 /// **Algorithms supported by cusolverDnXgesvdr**
10507 ///
10508 /// | | |
10509 /// | --- | --- |
10510 /// | [`cusolverAlgMode_t::CUSOLVER_ALG_0`] or `NULL` | Default algorithm. |
10511 ///
10512 /// Please visit [cuSOLVER Library Samples - Xgesvdr](https://github.com/NVIDIA/CUDALibrarySamples/tree/main/cuSOLVER/Xgesvdr) for a code example.
10513 ///
10514 /// Remark 1: `gesvdr` supports `n>=m` as well.
10515 ///
10516 /// Remark 2: the routine returns `V`, not $V^{H}$
10517 ///
10518 /// List of input arguments for [`cusolverDnXgesvdr_bufferSize`] and [`cusolverDnXgesvdr`]:
10519 ///
10520 /// 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.
10521 ///
10522 /// **Valid combination of data type and compute type**
10523 ///
10524 /// | **DataTypeA** | **DataTypeS** | **DataTypeU** | **DataTypeV** | **ComputeType** | **Meaning** |
10525 /// | --- | --- | --- | --- | --- | --- |
10526 /// | `CUDA_R_32F` | `CUDA_R_32F` | `CUDA_R_32F` | `CUDA_R_32F` | `CUDA_R_32F` | `SGESVDR` |
10527 /// | `CUDA_R_64F` | `CUDA_R_64F` | `CUDA_R_64F` | `CUDA_R_64F` | `CUDA_R_64F` | `DGESVDR` |
10528 /// | `CUDA_C_32F` | `CUDA_R_32F` | `CUDA_C_32F` | `CUDA_C_32F` | `CUDA_C_32F` | `CGESVDR` |
10529 /// | `CUDA_C_64F` | `CUDA_R_64F` | `CUDA_C_64F` | `CUDA_C_64F` | `CUDA_C_64F` | `ZGESVDR` |
10530 ///
10531 /// # Parameters
10532 ///
10533 /// - `handle`: Handle to the cuSolverDN library context.
10534 /// - `params`: Structure with information collected by [`cusolverDnSetAdvOptions`].
10535 /// - `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.
10536 /// - `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.
10537 /// - `m`: Number of rows of matrix `A`.
10538 /// - `n`: Number of columns of matrix `A`.
10539 /// - `k`: Rank of the k-SVD decomposition of matrix `A`. `rank` is less than `min(m,n)`.
10540 /// - `p`: Oversampling. The size of the subspace will be `(k + p)`. `(k+p)` is less than `min(m,n)`.
10541 /// - `niters`: Number of iteration of power method.
10542 /// - `dataTypeA`: Data type of array `A`.
10543 /// - `A`: Array of dimension `lda * n` with `lda` is not less than `max(1,m)`. On exit, the contents of `A` are destroyed.
10544 /// - `lda`: Leading dimension of two-dimensional array used to store matrix `A`.
10545 /// - `computeType`: Data type of computation.
10546 /// - `bufferOnDevice`: Device workspace. Array of type `void` of size `workspaceInBytesOnDevice` bytes.
10547 /// - `workspaceInBytesOnDevice`: Size in bytes of `bufferOnDevice`, returned by [`cusolverDnXgesvdr_bufferSize`].
10548 /// - `bufferOnHost`: Host workspace. Array of type `void` of size `workspaceInBytesOnHost` bytes.
10549 /// - `workspaceInBytesOnHost`: Size in bytes of `bufferOnHost`, returned by [`cusolverDnXgesvdr_bufferSize`].
10550 /// - `d_info`: If `info = 0`, the operation is successful. If `info = -i`, the `i-th` parameter is wrong (not counting handle).
10551 ///
10552 /// # Return value
10553 ///
10554 /// - [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]: An internal operation failed.
10555 /// - [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]: Invalid parameters were passed (`m,n<0` or `lda<max(1,m)` or `ldu<max(1,m)` or `ldv<max(1,n)` ).
10556 /// - [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]: The library was not initialized.
10557 /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The operation completed successfully.
10558 pub fn cusolverDnXgesvdr(
10559 handle: cusolverDnHandle_t,
10560 params: cusolverDnParams_t,
10561 jobu: ::core::ffi::c_schar,
10562 jobv: ::core::ffi::c_schar,
10563 m: i64,
10564 n: i64,
10565 k: i64,
10566 p: i64,
10567 niters: i64,
10568 dataTypeA: cudaDataType,
10569 A: *mut ::core::ffi::c_void,
10570 lda: i64,
10571 dataTypeSrand: cudaDataType,
10572 Srand: *mut ::core::ffi::c_void,
10573 dataTypeUrand: cudaDataType,
10574 Urand: *mut ::core::ffi::c_void,
10575 ldUrand: i64,
10576 dataTypeVrand: cudaDataType,
10577 Vrand: *mut ::core::ffi::c_void,
10578 ldVrand: i64,
10579 computeType: cudaDataType,
10580 bufferOnDevice: *mut ::core::ffi::c_void,
10581 workspaceInBytesOnDevice: size_t,
10582 bufferOnHost: *mut ::core::ffi::c_void,
10583 workspaceInBytesOnHost: size_t,
10584 d_info: *mut ::core::ffi::c_int,
10585 ) -> cusolverStatus_t;
10586}
10587unsafe extern "C" {
10588 pub fn cusolverDnXlarft_bufferSize(
10589 handle: cusolverDnHandle_t,
10590 params: cusolverDnParams_t,
10591 direct: cusolverDirectMode_t,
10592 storev: cusolverStorevMode_t,
10593 n: i64,
10594 k: i64,
10595 dataTypeV: cudaDataType,
10596 V: *const ::core::ffi::c_void,
10597 ldv: i64,
10598 dataTypeTau: cudaDataType,
10599 tau: *const ::core::ffi::c_void,
10600 dataTypeT: cudaDataType,
10601 T: *mut ::core::ffi::c_void,
10602 ldt: i64,
10603 computeType: cudaDataType,
10604 workspaceInBytesOnDevice: *mut size_t,
10605 workspaceInBytesOnHost: *mut size_t,
10606 ) -> cusolverStatus_t;
10607}
10608unsafe extern "C" {
10609 /// The helper functions below can calculate the sizes needed for pre-allocated buffer.
10610 ///
10611 /// The following routine:
10612 ///
10613 /// forms the triangular factor `T` of a real block reflector `H` of order `n`, which is defined as a product of `k` elementary reflectors.
10614 /// If:
10615 ///
10616 /// 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).
10617 ///
10618 /// 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`].
10619 ///
10620 /// Currently, only `n >= k` scenario is supported.
10621 ///
10622 /// The generic API has four different types:
10623 ///
10624 /// [`cusolverDnXlarft`] only supports the following four combinations.
10625 ///
10626 /// **Valid combinations of data types and compute types**
10627 ///
10628 /// | **DataTypeV** | **DataTypeTau** | **DataTypeT** | **ComputeType** | **Meaning** |
10629 /// | --- | --- | --- | --- | --- |
10630 /// | `CUDA_R_32F` | `CUDA_R_32F` | `CUDA_R_32F` | `CUDA_R_32F` | `SLARFT` |
10631 /// | `CUDA_R_64F` | `CUDA_R_64F` | `CUDA_R_64F` | `CUDA_R_64F` | `DLARFT` |
10632 /// | `CUDA_C_32F` | `CUDA_C_32F` | `CUDA_C_32F` | `CUDA_C_32F` | `CLARFT` |
10633 /// | `CUDA_C_64F` | `CUDA_C_64F` | `CUDA_C_64F` | `CUDA_C_64F` | `ZLARFT` |
10634 ///
10635 /// # Parameters
10636 ///
10637 /// - `handle`: Handle to the cuSolverDN library context.
10638 /// - `params`: Structure with information collected by [`cusolverDnSetAdvOptions`].
10639 /// - `direct`: Specifies the order in which the elementary reflectors are multiplied to form the block reflector.
10640 /// - `storev`: Specifies how the vectors which define the elementary reflectors are stored.
10641 /// - `n`: The order of the block reflector `H`. `n >= 0`.
10642 /// - `k`: The order of the triangular factor `T` (= the number of elementary reflectors). `k >= 1`.
10643 /// - `dataTypeV`: Data type of array `V`.
10644 /// - `V`: The matrix `V` of dimension `lda * k`.
10645 /// - `ldv`: Leading dimension of the array `V`. `ldv >= max(1,n)`.
10646 /// - `dataTypeTau`: Data type of array `tau`.
10647 /// - `tau`: Dimension `k`. `tau(i)` must contain the scalar factor of the elementary reflector `H(i)`.
10648 /// - `dataTypeT`: Data type of array `T`.
10649 /// - `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.
10650 /// - `ldt`: The leading dimension of the array `T`. `ldt >= k`.
10651 /// - `computeType`: Data type of computation.
10652 /// - `bufferOnDevice`: Device workspace. Array of type `void` of size `workspaceInBytesOnDevice` bytes.
10653 /// - `workspaceInBytesOnDevice`: Size in bytes of `bufferOnDevice`, returned by [`cusolverDnXlarft_bufferSize`].
10654 /// - `bufferOnHost`: Host workspace. Array of type `void` of size `workspaceInBytesOnHost` bytes.
10655 /// - `workspaceInBytesOnHost`: Size in bytes of `bufferOnHost`, returned by [`cusolverDnXlarft_bufferSize`].
10656 ///
10657 /// # Return value
10658 ///
10659 /// - [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]: An internal operation failed.
10660 /// - [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]: Invalid parameters were passed (`n == 0`, `k > n`, or `storev == CUBLAS_STOREV_ROWWISE`).
10661 /// - [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]: The library was not initialized.
10662 /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The operation completed successfully.
10663 pub fn cusolverDnXlarft(
10664 handle: cusolverDnHandle_t,
10665 params: cusolverDnParams_t,
10666 direct: cusolverDirectMode_t,
10667 storev: cusolverStorevMode_t,
10668 n: i64,
10669 k: i64,
10670 dataTypeV: cudaDataType,
10671 V: *const ::core::ffi::c_void,
10672 ldv: i64,
10673 dataTypeTau: cudaDataType,
10674 tau: *const ::core::ffi::c_void,
10675 dataTypeT: cudaDataType,
10676 T: *mut ::core::ffi::c_void,
10677 ldt: i64,
10678 computeType: cudaDataType,
10679 bufferOnDevice: *mut ::core::ffi::c_void,
10680 workspaceInBytesOnDevice: size_t,
10681 bufferOnHost: *mut ::core::ffi::c_void,
10682 workspaceInBytesOnHost: size_t,
10683 ) -> cusolverStatus_t;
10684}
10685/// cusolverDnLoggerCallback_t is a callback function pointer type.
10686///
10687/// Use the below function to set the callback function: [`cusolverDnLoggerSetCallback`].
10688pub type cusolverDnLoggerCallback_t = ::core::option::Option<
10689 unsafe extern "C" fn(
10690 logLevel: ::core::ffi::c_int,
10691 functionName: *const ::core::ffi::c_char,
10692 message: *const ::core::ffi::c_char,
10693 ),
10694>;
10695unsafe extern "C" {
10696 /// This function sets the logging callback function.
10697 ///
10698 /// See [`cusolverStatus_t`] for a complete list of valid return codes.
10699 ///
10700 /// # Parameters
10701 ///
10702 /// - `callback`: Pointer to a callback function. See [`cusolverDnLoggerCallback_t`].
10703 ///
10704 /// # Return value
10705 ///
10706 /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: If the callback function was successfully set.
10707 pub fn cusolverDnLoggerSetCallback(
10708 callback: cusolverDnLoggerCallback_t,
10709 ) -> cusolverStatus_t;
10710}
10711unsafe extern "C" {
10712 /// 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.
10713 ///
10714 /// See [`cusolverStatus_t`] for a complete list of valid return codes.
10715 ///
10716 /// # Parameters
10717 ///
10718 /// - `file`: Pointer to an open file. File should have write permission.
10719 ///
10720 /// # Return value
10721 ///
10722 /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: If logging file was successfully set.
10723 pub fn cusolverDnLoggerSetFile(file: *mut FILE) -> cusolverStatus_t;
10724}
10725unsafe extern "C" {
10726 /// This function opens a logging output file in the given path.
10727 ///
10728 /// See [`cusolverStatus_t`] for a complete list of valid return codes.
10729 ///
10730 /// # Parameters
10731 ///
10732 /// - `logFile`: Path of the logging output file.
10733 ///
10734 /// # Return value
10735 ///
10736 /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: If the logging file was successfully opened.
10737 pub fn cusolverDnLoggerOpenFile(
10738 logFile: *const ::core::ffi::c_char,
10739 ) -> cusolverStatus_t;
10740}
10741unsafe extern "C" {
10742 /// This function sets the value of the logging level.
10743 ///
10744 /// See [`cusolverStatus_t`] for a complete list of valid return codes.
10745 ///
10746 /// # Parameters
10747 ///
10748 /// - `level`: Value of the logging level. See cuSOLVERDn Logging.
10749 ///
10750 /// # Return value
10751 ///
10752 /// - [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]: If the value was not a valid logging level. See cuSOLVERDn Logging.
10753 /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: If the logging level was successfully set.
10754 pub fn cusolverDnLoggerSetLevel(level: ::core::ffi::c_int) -> cusolverStatus_t;
10755}
10756unsafe extern "C" {
10757 /// This function sets the value of the logging mask.
10758 ///
10759 /// See [`cusolverStatus_t`] for a complete list of valid return codes.
10760 ///
10761 /// # Parameters
10762 ///
10763 /// - `mask`: Value of the logging mask. See cuSOLVERDn Logging.
10764 ///
10765 /// # Return value
10766 ///
10767 /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: If the logging mask was successfully set.
10768 pub fn cusolverDnLoggerSetMask(mask: ::core::ffi::c_int) -> cusolverStatus_t;
10769}
10770unsafe extern "C" {
10771 /// This function disables logging for the entire run.
10772 ///
10773 /// See [`cusolverStatus_t`] for a complete list of valid return codes.
10774 ///
10775 /// # Return value
10776 ///
10777 /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: If logging was successfully disabled.
10778 pub fn cusolverDnLoggerForceDisable() -> cusolverStatus_t;
10779}
10780unsafe extern "C" {
10781 pub fn cusolverDnXpolar_bufferSize(
10782 handle: cusolverDnHandle_t,
10783 params: cusolverDnParams_t,
10784 uplo: cublasFillMode_t,
10785 M: i64,
10786 N: i64,
10787 dataTypeA: cudaDataType,
10788 A: *const ::core::ffi::c_void,
10789 lda: i64,
10790 dataTypeH: cudaDataType,
10791 H: *const ::core::ffi::c_void,
10792 ldh: i64,
10793 computeType: cudaDataType,
10794 workspaceInBytesOnDevice: *mut size_t,
10795 workspaceInBytesOnHost: *mut size_t,
10796 ) -> cusolverStatus_t;
10797}
10798unsafe extern "C" {
10799 /// The following helper function calculates the required workspace sizes for [`cusolverDnXpolar`].
10800 ///
10801 /// The following routine computes the polar decomposition.
10802 ///
10803 /// This function computes the polar decomposition of an $m \times n$ matrix `A` (where $m \geq n$). The polar decomposition is written:
10804 /// $$
10805 /// A = U_p \cdot H
10806 /// $$
10807 ///
10808 /// where $U_p$ is an $m \times n$ matrix with orthonormal columns and $H$ is an $n \times n$ Hermitian positive semidefinite matrix.
10809 ///
10810 /// [`cusolverDnXpolar`] uses the QDWH (QR-based Dynamically Weighted Halley) iteration \[14\]\[16\] to compute $U_p$. The QDWH iteration converges cubically and requires at most ~6 iterations. For ill-conditioned or rank-deficient matrices `A`, the routine adds a small perturbation $\xi$ to ensure the polar decomposition converges correctly. The output parameter `d_res_nrm` reports the magnitude of the residual $\\|A - U_p \cdot H\\|_2$.
10811 ///
10812 /// 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 [`cusolverDnXpolar_bufferSize`].
10813 ///
10814 /// If output parameter `info = -i` (less than zero), the `i-th` parameter is wrong (not counting handle).
10815 ///
10816 /// Currently, [`cusolverDnXpolar`] supports only the default algorithm.
10817 ///
10818 /// **Algorithms supported by cusolverDnXpolar**
10819 ///
10820 /// | | |
10821 /// | --- | --- |
10822 /// | [`cusolverAlgMode_t::CUSOLVER_ALG_0`] or `NULL` | Default algorithm. |
10823 ///
10824 /// Remark 1: If `H` is `NULL`, computation of `H` is skipped.
10825 ///
10826 /// Remark 2: `uplo = CUBLAS_FILL_MODE_UPPER` treats `A` as upper triangular, saving one QR decomposition. [`cublasFillMode_t::CUBLAS_FILL_MODE_LOWER`] is not supported.
10827 ///
10828 /// Remark 3: `d_res_nrm` serves dual purpose. On input, if `*d_res_nrm >= 0`, it overrides the perturbation $\xi$ (skipping automatic search). On output, it reports the residual norm $\\|A - U_p \cdot H\\|_2$.
10829 ///
10830 /// List of input arguments for [`cusolverDnXpolar_bufferSize`] and [`cusolverDnXpolar`]:
10831 ///
10832 /// The generic API has three different types, `dataTypeA` is data type of the matrix `A`, `dataTypeH` is data type of the matrix `H`, and `computeType` is compute type of the operation. [`cusolverDnXpolar`] only supports the following four combinations:
10833 ///
10834 /// **Valid combination of data type and compute type**
10835 ///
10836 /// | **DataTypeA** | **DataTypeH** | **ComputeType** | **Meaning** |
10837 /// | --- | --- | --- | --- |
10838 /// | `CUDA_R_32F` | `CUDA_R_32F` | `CUDA_R_32F` | `SPOLAR` |
10839 /// | `CUDA_R_64F` | `CUDA_R_64F` | `CUDA_R_64F` | `DPOLAR` |
10840 /// | `CUDA_C_32F` | `CUDA_C_32F` | `CUDA_C_32F` | `CPOLAR` |
10841 /// | `CUDA_C_64F` | `CUDA_C_64F` | `CUDA_C_64F` | `ZPOLAR` |
10842 ///
10843 /// # Parameters
10844 ///
10845 /// - `handle`: Handle to the cuSolverDN library context.
10846 /// - `params`: Structure with information collected by [`cusolverDnSetAdvOptions`].
10847 /// - `uplo`: Specifies the structure of matrix `A`. `uplo` = [`cublasFillMode_t::CUBLAS_FILL_MODE_UPPER`]: `A` is upper triangular, saving one QR decomposition. `uplo` = [`cublasFillMode_t::CUBLAS_FILL_MODE_FULL`]: `A` is a general matrix. [`cublasFillMode_t::CUBLAS_FILL_MODE_LOWER`] is not supported.
10848 /// - `dataTypeA`: Data type of array `A`.
10849 /// - `A`: Array of dimension `lda * n` with `lda` is not less than `max(1,m)`. On exit, `A` is overwritten with the unitary polar factor $U_p$ with orthonormal columns.
10850 /// - `lda`: Leading dimension of two-dimensional array used to store matrix `A`. `lda >= max(1,m)`.
10851 /// - `dataTypeH`: Data type of array `H`. Must equal `dataTypeA`.
10852 /// - `H`: Array of dimension `ldh * n` with `ldh` is not less than `max(1,n)`. $n \times n$ Hermitian positive semidefinite factor. If `H` is `NULL`, computation of `H` is skipped.
10853 /// - `ldh`: Leading dimension of two-dimensional array used to store matrix `H`. `ldh >= max(1,n)` when `H` is not `NULL`.
10854 /// - `computeType`: Data type of computation. Must equal `dataTypeA`.
10855 /// - `bufferOnDevice`: Device workspace. Array of type `void` of size `workspaceInBytesOnDevice` bytes.
10856 /// - `workspaceInBytesOnDevice`: Size in bytes of `bufferOnDevice`, returned by [`cusolverDnXpolar_bufferSize`].
10857 /// - `bufferOnHost`: Host workspace. Array of type `void` of size `workspaceInBytesOnHost` bytes.
10858 /// - `workspaceInBytesOnHost`: Size in bytes of `bufferOnHost`, returned by [`cusolverDnXpolar_bufferSize`].
10859 /// - `d_res_nrm`: On input, if `*d_res_nrm >= 0`, it overrides the perturbation $\xi$ (skipping automatic search). On output, reports $\Vert A - U_p \cdot H \Vert_2$.
10860 /// - `d_A_nrmF`: $\Vert A \Vert_F$ (Frobenius norm of `A`). If `NULL`, the computation is skipped.
10861 /// - `d_rcond`: Reciprocal condition number $1/\text{cond}(A, \text{fro})$. If `NULL`, the computation is skipped. Undefined if a user-supplied $\xi > 0$ was provided via `d_res_nrm`.
10862 /// - `d_info`: If `info = 0`, the operation is successful. If `info = -i`, the `i-th` parameter is wrong (not counting handle). If `info = 1`, the algorithm failed to find `rcond > 1.e-15` by adding perturbation. If `info = 10`, the algorithm failed to converge within 10 iterations.
10863 ///
10864 /// # Return value
10865 ///
10866 /// - [`cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR`]: An internal operation failed.
10867 /// - [`cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE`]: Invalid parameters were passed (`m<0`, or `n<0`, or `m<n`, or `lda < max(1,m)`, or `ldh < max(1,n)` when `H` is not `NULL`, or `uplo` is [`cublasFillMode_t::CUBLAS_FILL_MODE_LOWER`], or `dataTypeH != dataTypeA`, or `computeType != dataTypeA`).
10868 /// - [`cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED`]: The library was not initialized.
10869 /// - [`cusolverStatus_t::CUSOLVER_STATUS_SUCCESS`]: The operation completed successfully.
10870 pub fn cusolverDnXpolar(
10871 handle: cusolverDnHandle_t,
10872 params: cusolverDnParams_t,
10873 uplo: cublasFillMode_t,
10874 M: i64,
10875 N: i64,
10876 dataTypeA: cudaDataType,
10877 A: *mut ::core::ffi::c_void,
10878 lda: i64,
10879 dataTypeH: cudaDataType,
10880 H: *mut ::core::ffi::c_void,
10881 ldh: i64,
10882 computeType: cudaDataType,
10883 bufferOnDevice: *mut ::core::ffi::c_void,
10884 workspaceInBytesOnDevice: size_t,
10885 bufferOnHost: *mut ::core::ffi::c_void,
10886 workspaceInBytesOnHost: size_t,
10887 d_res_nrm: *mut f64,
10888 d_A_nrmF: *mut f64,
10889 d_rcond: *mut f64,
10890 d_info: *mut ::core::ffi::c_int,
10891 ) -> cusolverStatus_t;
10892}