| Crates.io | unmtx-gpu |
| lib.rs | unmtx-gpu |
| version | 0.1.3 |
| created_at | 2025-04-29 09:05:13.909362+00 |
| updated_at | 2025-08-07 06:19:29.235626+00 |
| description | Micro matrix library for neural networks that uses GPU. |
| homepage | |
| repository | https://github.com/luckboy/unmtx-gpu |
| max_upload_size | |
| id | 1653344 |
| size | 445,485 |
Micro neural matrix library for GPU is small library that operates on matrices. This library provides an interfece to operations of matrices on GPU for neural networks.
This library uses GPU by the following computing platforms:
If this library uses CUDA, this library can use the cuBLAS library to multiplication of matrices.
You can use this library by add the following lines in the Cargo.toml file:
[dependencies]
unmtx-gpu = "0.1.3"
The following features of this library can be used by you:
opencl - use OpenCL (default)cuda - use CUDAcuda-* - choose CUDA version (for example cuda-11050)default_cublas - use the cuBLAS library to multiplication of matrices as default for CUDAdefault_mma - use the mma instruction to multiplication of matrices as default for CUDAtest_only_backend - test only backendThe following example presents multiplication of matrices:
use unmtx_gpu::matrix;
fn main()
{
let a = matrix![
[1.0, 2.0, 3.0],
[4.0, 5.0, 6.0],
[7.0, 8.0, 9.0]
];
let b = matrix![
[1.0, 4.0, 7.0],
[2.0, 5.0, 8.0],
[3.0, 6.0, 9.0]
];
let c = a * b;
let elems = c.elems();
for i in 0..c.row_count() {
for j in 0..c.col_count() {
print!("\t{}", elems[i * c.col_count() + j]);
}
println!("");
}
}
If you want to find more examples, you can find them in the examples directory.
This library is licensed under the Mozilla Public License v2.0. See the LICENSE file for the full licensing terms.