metal_matrix/
lib.rs

1/*!
2 * # Metal Matrix
3 *
4 * A high-performance linear algebra library with Metal GPU acceleration.
5 *
6 * This library provides GPU-accelerated matrix operations using Apple's Metal framework.
7 * It's designed for efficient computation of common linear algebra operations like
8 * matrix multiplication, addition, subtraction, transposition, and scalar multiplication.
9 *
10 * ## Features
11 *
12 * - GPU-accelerated matrix operations
13 * - Clean, ergonomic API
14 * - Support for vectors as 1D matrices
15 * - CPU fallback implementations
16 * - Comprehensive error handling
17 *
18 * ## Example
19 *
20 * ```rust
21 * use metal_matrix::{MetalContext, Matrix, matrix_multiply};
22 * use anyhow::Result;
23 *
24 * fn main() -> Result<()> {
25 *     // Initialize Metal context
26 *     let context = MetalContext::new()?;
27 *     
28 *     // Create matrices
29 *     let mut a = Matrix::new(3, 2);
30 *     let mut b = Matrix::new(2, 4);
31 *     
32 *     // Fill matrices with data
33 *     // ...
34 *     
35 *     // Multiply matrices
36 *     let result = matrix_multiply(&context, &a, &b)?;
37 *     
38 *     Ok(())
39 * }
40 * ```
41 */
42
43/// Metal kernel definitions and paths
44pub mod kernels;
45
46/// Metal context and device management
47pub mod metal_context;
48
49/// Matrix operations implementation
50pub mod operations;
51
52/// Matrix data structure and methods
53pub mod matrix;
54
55pub use matrix::Matrix;
56pub use metal_context::MetalContext;
57pub use operations::*;