coaster_blas/
lib.rs

1//! Provides backend-agnostic BLAS operations for [Coaster][coaster].
2//!
3//! BLAS (Basic Linear Algebra Subprograms) is a specification that prescribes a set of low-level
4//! routines for performing common linear algebra operations such as vector addition, scalar
5//! multiplication, dot products, linear combinations, and matrix multiplication. They are the de
6//! facto standard low-level routines for linear algebra libraries; the routines have bindings for
7//! both C and Fortran. Although the BLAS specification is general, BLAS implementations are often
8//! optimized for speed on a particular machine, so using them can bring substantial performance
9//! benefits. BLAS implementations will take advantage of special floating point hardware such as
10//! vector registers or SIMD instructions.<br/>
11//! [Source][blas-source]
12//!
13//! ## Overview
14//!
15//! A Coaster Plugin describes the functionality through three types of traits.
16//!
17//! * __PluginTrait__ -> IBlas<br/>
18//! This trait provides 'provided methods', which already specify the exact, backend-agnostic
19//! behavior of an Operation. These come in two forms `operation()` and `operation_plain()`,
20//! where the first takes care of full memory management and the later one just provides the computation
21//! without any memory management. In some scenarios you would like to use the plain operation for faster
22//! exection.
23//!
24//! * __BinaryTrait__ -> IBlasBinary<br>
25//! The binary trait provides the actual and potentially initialized Functions, which are able to compute
26//! the Operations (as they implement the OperationTrait).
27//!
28//! * __OperationTrait__ -> e.g. IOperationDot<br/>
29//! The PluginTrait can provide 'provided methods', thanks to the OperationTrait. The OperationTrait,
30//! has one required method `compute` which every Framework Function will implement on it's own way.
31//!
32//! Beside these traits a Coaster Plugin might also use macros for faster
33//! implementation for various Coaster Frameworks such as CUDA, OpenCL or common host CPU.
34//!
35//! Beside these generic functionality through traits, a Plugin also extends the Coaster Backend
36//! with implementations of the generic functionality for the Coaster Frameworks.
37//!
38//! For more information, give the [Coaster docs][coaster-docs] a visit.
39//!
40//! [coaster]: https://github.com/spearow/coaster
41//! [coaster-docs]: https://spearow.github.io/coaster
42//! [blas-source]: https://en.wikipedia.org/wiki/Basic_Linear_Algebra_Subprograms
43#![allow(dead_code)]
44#![deny(
45    unused_crate_dependencies,
46    clippy::missing_docs,
47    clippy::missing_debug_implementations,
48    clippy::missing_copy_implementations,
49    clippy::trivial_casts,
50    clippy::trivial_numeric_casts,
51    clippy::unsafe_code,
52    clippy::unused_import_braces,
53    clippy::unused_qualifications,
54    clippy::complexity
55)]
56
57extern crate coaster;
58#[cfg(feature = "cuda")]
59extern crate rcublas as cublas;
60#[cfg(feature = "native")]
61extern crate rust_blas as rblas;
62
63pub mod binary;
64pub mod frameworks;
65pub mod operation;
66pub mod plugin;
67pub mod transpose;