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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
//! Safe, idiomatic Rust wrapper over Intel oneAPI Math Kernel Library
//! (oneMKL).
//!
//! For the raw FFI surface, see [`onemkl-sys`](onemkl_sys).
//!
//! # Quick orientation by use case
//!
//! - **Dense linear algebra** — see [`blas`] (Level 1/2/3, batched,
//! pack/compute, JIT, mixed-precision, compact) and [`lapack`]
//! (solvers, factorizations, eigenvalue / SVD, auxiliary routines).
//! - **Sparse linear algebra** — see [`sparse`] (CSR/COO/CSC/BSR
//! matrices, mv/mm/trsv, format conversion, sparse arithmetic),
//! [`pardiso`] / [`dss`] (direct solvers), [`iss`] (CG / FGMRES),
//! [`preconditioners`] (ILU0 / ILUT).
//! - **FFT and signal processing** — see [`fft`] (1D/2D/3D/N-D
//! complex and real-input transforms with configurable scaling),
//! [`pde`] (DCT / DST trigonometric transforms),
//! [`rng::convolution`] (1D conv / corr).
//! - **Statistics and random numbers** — see [`rng`] (RNG streams,
//! distributions) and [`rng::summary_stats`]
//! (mean / variance / min / max / sum).
//! - **Mixed-precision ML kernels** — see
//! [`blas::mixed_precision`] for bf16 /
//! fp16 / FP8 / int8 GEMMs and [`blas::jit`] for
//! runtime-specialized small kernels.
//! - **Eigensolvers** — see [`lapack`] for general drivers and
//! [`feast`] for contour-integration solvers (find all eigenvalues
//! in an interval).
//! - **Optimization** — see [`optim`] for trust-region nonlinear
//! least squares.
//! - **Spline / data fitting** — see [`data_fitting`] for cubic
//! splines (natural / Bessel / Akima / Hermite).
//! - **MKL service / runtime** — see [`service`] (threading,
//! verbose mode, version).
//!
//! Anything not yet wrapped is reachable through the raw bindings
//! re-exported as [`sys`].
//!
//! # A minimal example
//!
//! ```no_run
//! use onemkl::prelude::*;
//! use onemkl::blas::level3::gemm;
//!
//! // Compute C = A * B + 0 * C for two 2×2 matrices.
//! let a_data = vec![1.0_f64, 2.0, 3.0, 4.0];
//! let b_data = vec![5.0_f64, 6.0, 7.0, 8.0];
//! let mut c_data = vec![0.0_f64; 4];
//! let a = MatrixRef::new(&a_data, 2, 2, Layout::RowMajor).unwrap();
//! let b = MatrixRef::new(&b_data, 2, 2, Layout::RowMajor).unwrap();
//! let mut c = MatrixMut::new(&mut c_data, 2, 2, Layout::RowMajor).unwrap();
//! gemm(
//! Transpose::NoTrans, Transpose::NoTrans,
//! 1.0, &a, &b, 0.0, &mut c,
//! ).unwrap();
//! // c_data ≈ [19, 22, 43, 50].
//! ```
//!
//! # Per-domain features
//!
//! Each major oneMKL domain is gated by a Cargo feature so users can opt
//! out of unused parts. All domain features are enabled by default.
//! Foundation modules ([`error`], [`enums`], [`matrix`], [`scalar`], and
//! [`service`]) are always built.
//!
//! | Feature | Module | What's inside |
//! | ------------------- | ----------------------- | ---- |
//! | `blas` | [`blas`] | Level 1/2/3, batched (strided + pointer-array), pack/compute, JIT, mixed precision (bf16/f16/FP8/int8), compact |
//! | `data-fitting` | [`data_fitting`] | Cubic splines (natural / Bessel / Akima / Hermite) |
//! | `dss` | [`dss`] | Direct sparse solver with statistics readout |
//! | `feast` | [`feast`] | Contour-integration eigensolver (dense, CSR, banded, generalized) |
//! | `fft` | [`fft`] | DFTI 1D / 2D / 3D / N-D, complex and real-input, configurable scaling |
//! | `iss` | [`iss`] | CG / FGMRES with closure or step-by-step session API |
//! | `lapack` | [`lapack`] | Solvers, factorizations, eigenvalue / SVD, auxiliary (lacpy / lange / gecon / laswp / larfg) |
//! | `optim` | [`optim`] | Trust-region nonlinear least squares |
//! | `pardiso` | [`pardiso`] | Stateful direct sparse solver, pardiso_64, pivot callback |
//! | `pde` | [`pde`] | Trigonometric transforms (DCT / DST) for spectral PDE solvers |
//! | `preconditioners` | [`preconditioners`] | ILU0 / ILUT and `apply_ilu` |
//! | `rng` | [`rng`] | VSL streams, distributions, 1-D conv/corr, summary statistics |
//! | `sparse` | [`sparse`] | Inspector-Executor sparse: CSR/COO/CSC/BSR, mv/mm/trsv, copy/convert, add/spmm/spmmd |
//! | `vm` | [`vm`] | Element-wise vector math |
//!
//! For a minimal build:
//!
//! ```toml
//! onemkl = { version = "...", default-features = false, features = [
//! "lp64", "threading-sequential", "link-dynamic", # required
//! "blas", "lapack", # whatever you need
//! ] }
//! ```
//!
//! Until a domain has a safe wrapper, the raw bindings are accessible via
//! [`sys`].
//!
//! # Building against MKL
//!
//! The build script in `onemkl-sys` searches in this order:
//!
//! 1. `MKLROOT` environment variable.
//! 2. `ONEMKL_SYS_INCLUDE_DIR` / `ONEMKL_SYS_LIB_DIR` overrides.
//! 3. `ONEAPI_ROOT/mkl/latest`.
//! 4. Platform-standard install paths (`C:\Program Files (x86)\Intel\oneAPI`
//! on Windows, `/opt/intel/oneapi` on Linux/macOS).
//!
//! At runtime MKL's `bin/` (or `lib/`) directory must be on the loader
//! search path so that the dynamic libraries can be found.
pub use onemkl_sys as sys;
// Foundation modules — always built.
// Per-domain modules — gated.
pub use ;
pub use ;
pub use ;
pub use ;
/// Convenience prelude exporting the items most numerical Rust code
/// will reach for: foundation enums (`Layout`, `Transpose`, `UpLo`,
/// `Side`, `Diag`), the `Error` / `Result` types, matrix views, and
/// the per-domain scalar traits when their feature is enabled.
///
/// ```
/// use onemkl::prelude::*;
/// ```