1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
//! Safe Rust wrappers for rocSOLVER - AMD's LAPACK implementation for ROCm.
//!
//! rocSOLVER provides GPU-accelerated implementations of LAPACK routines for
//! linear algebra operations. This module provides safe, ergonomic Rust wrappers
//! around the underlying C API.
//!
//! # Architecture
//!
//! This module reuses the [`Handle`] from [`crate::rocblas`] since rocSOLVER
//! internally uses rocBLAS handles. This enables seamless interoperability
//! between rocBLAS and rocSOLVER operations.
//!
//! # Module Organization
//!
//! - [`error`] - Error handling types
//! - [`types`] - Type-safe enums for rocSOLVER parameters
//! - [`ffi`] - Raw FFI bindings (for advanced use)
//! - [`lapack`] - LAPACK-style linear algebra operations
//!
//! # Supported Operations
//!
//! ## Matrix Factorizations ([`lapack::decompositions`])
//! - [`geqrf`] - QR factorization
//! - [`getrf`] - LU factorization with partial pivoting
//! - [`potrf`] - Cholesky factorization for symmetric positive definite matrices
//! - [`gebrd`] - Bidiagonal reduction
//!
//! ## Linear System Solvers ([`lapack::solvers`])
//! - [`gesv`] - Solve A*X=B using LU factorization
//! - [`getrs`] - Solve using pre-computed LU factors
//! - [`posv`] - Solve A*X=B for symmetric positive definite matrices
//! - [`gels`] - Least squares solver
//!
//! ## Singular Value Decomposition ([`lapack::svd`])
//! - [`gesvd`] - Compute singular value decomposition
//!
//! ## Eigenvalue Computations ([`lapack::eigenvalue`])
//! - [`syev`] - Eigenvalues of real symmetric matrices
//! - [`heev`] - Eigenvalues of complex Hermitian matrices
//!
//! ## Orthogonal/Unitary Operations ([`lapack::orthogonal`])
//! - [`orgqr`] / [`ungqr`] - Generate Q matrix from QR factorization
//! - [`ormqr`] / [`unmqr`] - Apply Q matrix from QR factorization
//!
//! # Type Support
//!
//! All operations support multiple precision types:
//! - `f32` - Single precision real
//! - `f64` - Double precision real
//! - [`Complex32`] - Single precision complex
//! - [`Complex64`] - Double precision complex
//!
//! # Batched Operations
//!
//! Most operations have three variants:
//! - Regular (single matrix)
//! - Batched (array of pointers to matrices)
//! - Strided batched (contiguous memory with stride)
//!
//! # Example
//!
//! ```rust,no_run
//! use rocm_rs::{hip::DeviceMemory, rocblas::Handle, rocsolver};
//!
//! // Create a handle (shared with rocBLAS)
//! let handle = Handle::new().unwrap();
//!
//! // Allocate device memory for a 4x3 matrix
//! let m = 4i32;
//! let n = 3i32;
//! let mut A = DeviceMemory::<f64>::new((m * n) as usize).unwrap();
//! let mut tau = DeviceMemory::<f64>::new(n as usize).unwrap();
//! let mut info = DeviceMemory::<i32>::new(1).unwrap();
//!
//! // Compute QR factorization
//! rocsolver::geqrf(&handle, m, n, &mut A, m, &mut tau).unwrap();
//! ```
// Raw FFI bindings generated by bindgen
// Safe wrapper modules
// Re-export Handle from rocBLAS for convenience
// rocSOLVER uses rocblas_handle internally
pub use crateHandle;
// Re-export error types
pub use ;
// Re-export type-safe enums
pub use ;
// Re-export all LAPACK functions at the module level for convenience
// Decompositions
pub use ;
// Trait re-exports for generic programming
pub use ;
// Solvers
pub use ;
pub use ;
// SVD (batched variants not yet implemented due to complex stride requirements)
pub use gesvd;
pub use GesvdType;
// Eigenvalue
pub use ;
pub use ;
// Orthogonal/Unitary (no batched variants available in rocSOLVER)
pub use ;
pub use ;