Crate unmtx_gpu

Source
Expand description

Micro neural matrix library for GPU is small library that operates on matrices.

This library uses GPU by the following computing platforms:

  • OpenCL
  • CUDA

If this library uses CUDA, this library can use the cuBLAS library to multiplication of matrices.

A frontend-backend architecture is used by this library. The frontend of this library can use one of two backends (OpenCL or CUDA). These backends allow to use GPU by the computing platforms. The frontend and the backend can have many instances. This library provides a high-level interfece to operations of matrices by the frontend and methods of a Matrix structure.

§Examples

let a = matrix![
    [1.0, 2.0],
    [3.0, 4.0]
];
let x = matrix![
    [5.0],
    [6.0]
];
let b = matrix![
    [7.0],
    [8.0]
];
let c = a * x + b;
assert_eq!(vec![1.0 * 5.0 + 2.0 * 6.0 + 7.0, 3.0 * 5.0 + 4.0 * 6.0 + 8.0], c.elems());

Modules§

cuda
A module that contains a CUDA backend.
opencl
A module that contains an OpenCL backend.

Macros§

matrix
Creates a matrix from the arguments.

Structs§

Frontend
A frontend structure.
Matrix
A matrix structure.

Enums§

BackendArray
An enumeration of backend array.
Error
An error enumeration.

Traits§

Backend
A backend trait.

Functions§

finalize_default_backend
Finalizes a default backend.
get_default_backend
Returns a default backend.
initialize_default_backend_for_uninitialized
Initializes a default backend if the backend is uninitialized and returns the default backend.
set_default_backend
Sets a default backend.
set_default_backend_for_uninitialized
Sets a default backend if the default backend is uninitialized and returns the default backend.
unset_default_backend
Unsets a default backend.

Type Aliases§

Result
A result type.