Skip to main content

CpuLinalgKernels

Trait CpuLinalgKernels 

Source
pub trait CpuLinalgKernels:
    Debug
    + Send
    + Sync
    + 'static {
Show 14 methods // Provided methods fn cholesky( &self, context: &CpuExecutionContext<'_>, input: TensorView<'_>, ) -> Result<CpuLinalgOutcome<Tensor>> { ... } fn triangular_solve( &self, context: &CpuExecutionContext<'_>, a: TensorView<'_>, b: TensorView<'_>, options: TriangularSolveOptions, ) -> Result<CpuLinalgOutcome<Tensor>> { ... } fn lu( &self, context: &CpuExecutionContext<'_>, input: TensorView<'_>, ) -> Result<CpuLinalgOutcome<Vec<Tensor>>> { ... } fn full_piv_lu( &self, context: &CpuExecutionContext<'_>, input: TensorView<'_>, ) -> Result<CpuLinalgOutcome<Vec<Tensor>>> { ... } fn solve( &self, context: &CpuExecutionContext<'_>, a: TensorView<'_>, b: TensorView<'_>, ) -> Result<CpuLinalgOutcome<Tensor>> { ... } fn svd( &self, context: &CpuExecutionContext<'_>, input: TensorView<'_>, ) -> Result<CpuLinalgOutcome<Vec<Tensor>>> { ... } fn svd_full( &self, context: &CpuExecutionContext<'_>, input: TensorView<'_>, ) -> Result<CpuLinalgOutcome<Vec<Tensor>>> { ... } fn svd_values( &self, context: &CpuExecutionContext<'_>, input: TensorView<'_>, ) -> Result<CpuLinalgOutcome<Tensor>> { ... } fn qr( &self, context: &CpuExecutionContext<'_>, input: TensorView<'_>, ) -> Result<CpuLinalgOutcome<Vec<Tensor>>> { ... } fn rank_revealing_qr( &self, context: &CpuExecutionContext<'_>, input: TensorView<'_>, options: RankRevealingQrOptions, ) -> Result<CpuLinalgOutcome<Vec<Tensor>>> { ... } fn eigh( &self, context: &CpuExecutionContext<'_>, input: TensorView<'_>, ) -> Result<CpuLinalgOutcome<Vec<Tensor>>> { ... } fn eigh_values( &self, context: &CpuExecutionContext<'_>, input: TensorView<'_>, ) -> Result<CpuLinalgOutcome<Tensor>> { ... } fn eig( &self, context: &CpuExecutionContext<'_>, input: TensorView<'_>, ) -> Result<CpuLinalgOutcome<Vec<Tensor>>> { ... } fn eig_values( &self, context: &CpuExecutionContext<'_>, input: TensorView<'_>, ) -> Result<CpuLinalgOutcome<Tensor>> { ... }
}
Expand description

Replacement CPU linear-algebra kernels. Every method defaults to CpuLinalgOutcome::Unsupported; implement the ones the provider handles. See the module documentation for the contract.

§Errors

Methods return errors only for failures after committing to the operation (a runtime or storage failure); declining is CpuLinalgOutcome::Unsupported.

§Examples

use tenferro_linalg::cpu_kernels::CpuLinalgKernels;
#[derive(Debug)]
struct Nothing;
impl CpuLinalgKernels for Nothing {}
let _: &dyn CpuLinalgKernels = &Nothing;

Provided Methods§

Source

fn cholesky( &self, context: &CpuExecutionContext<'_>, input: TensorView<'_>, ) -> Result<CpuLinalgOutcome<Tensor>>

Cholesky factor, as the built-in cholesky.

§Errors

Returns tenferro_tensor::Error::BackendFailure or tenferro_tensor::Error::BackendSource when the kernel’s runtime or a host buffer fails after it committed to the operation.

Source

fn triangular_solve( &self, context: &CpuExecutionContext<'_>, a: TensorView<'_>, b: TensorView<'_>, options: TriangularSolveOptions, ) -> Result<CpuLinalgOutcome<Tensor>>

Triangular solve, as the built-in triangular_solve.

§Errors

Returns tenferro_tensor::Error::BackendFailure or tenferro_tensor::Error::BackendSource when the kernel’s runtime or a host buffer fails after it committed to the operation.

Source

fn lu( &self, context: &CpuExecutionContext<'_>, input: TensorView<'_>, ) -> Result<CpuLinalgOutcome<Vec<Tensor>>>

Partial-pivot LU, as the built-in lu.

§Errors

Returns tenferro_tensor::Error::BackendFailure or tenferro_tensor::Error::BackendSource when the kernel’s runtime or a host buffer fails after it committed to the operation.

Source

fn full_piv_lu( &self, context: &CpuExecutionContext<'_>, input: TensorView<'_>, ) -> Result<CpuLinalgOutcome<Vec<Tensor>>>

Full-pivot LU, as the built-in full_piv_lu.

§Errors

Returns tenferro_tensor::Error::BackendFailure or tenferro_tensor::Error::BackendSource when the kernel’s runtime or a host buffer fails after it committed to the operation.

Source

fn solve( &self, context: &CpuExecutionContext<'_>, a: TensorView<'_>, b: TensorView<'_>, ) -> Result<CpuLinalgOutcome<Tensor>>

Linear solve A X = B, as the built-in solve.

§Errors

Returns tenferro_tensor::Error::BackendFailure or tenferro_tensor::Error::BackendSource when the kernel’s runtime or a host buffer fails after it committed to the operation.

Source

fn svd( &self, context: &CpuExecutionContext<'_>, input: TensorView<'_>, ) -> Result<CpuLinalgOutcome<Vec<Tensor>>>

Thin SVD, as the built-in svd.

§Errors

Returns tenferro_tensor::Error::BackendFailure or tenferro_tensor::Error::BackendSource when the kernel’s runtime or a host buffer fails after it committed to the operation.

Source

fn svd_full( &self, context: &CpuExecutionContext<'_>, input: TensorView<'_>, ) -> Result<CpuLinalgOutcome<Vec<Tensor>>>

Full SVD, as the built-in svd_full.

§Errors

Returns tenferro_tensor::Error::BackendFailure or tenferro_tensor::Error::BackendSource when the kernel’s runtime or a host buffer fails after it committed to the operation.

Source

fn svd_values( &self, context: &CpuExecutionContext<'_>, input: TensorView<'_>, ) -> Result<CpuLinalgOutcome<Tensor>>

Singular values, as the built-in svd_values.

§Errors

Returns tenferro_tensor::Error::BackendFailure or tenferro_tensor::Error::BackendSource when the kernel’s runtime or a host buffer fails after it committed to the operation.

Source

fn qr( &self, context: &CpuExecutionContext<'_>, input: TensorView<'_>, ) -> Result<CpuLinalgOutcome<Vec<Tensor>>>

Thin QR, as the built-in qr.

§Errors

Returns tenferro_tensor::Error::BackendFailure or tenferro_tensor::Error::BackendSource when the kernel’s runtime or a host buffer fails after it committed to the operation.

Source

fn rank_revealing_qr( &self, context: &CpuExecutionContext<'_>, input: TensorView<'_>, options: RankRevealingQrOptions, ) -> Result<CpuLinalgOutcome<Vec<Tensor>>>

Column-pivoted QR, as the built-in rank_revealing_qr.

§Errors

Returns tenferro_tensor::Error::BackendFailure or tenferro_tensor::Error::BackendSource when the kernel’s runtime or a host buffer fails after it committed to the operation.

Source

fn eigh( &self, context: &CpuExecutionContext<'_>, input: TensorView<'_>, ) -> Result<CpuLinalgOutcome<Vec<Tensor>>>

Hermitian eigendecomposition, as the built-in eigh.

§Errors

Returns tenferro_tensor::Error::BackendFailure or tenferro_tensor::Error::BackendSource when the kernel’s runtime or a host buffer fails after it committed to the operation.

Source

fn eigh_values( &self, context: &CpuExecutionContext<'_>, input: TensorView<'_>, ) -> Result<CpuLinalgOutcome<Tensor>>

Hermitian eigenvalues, as the built-in eigh_values.

§Errors

Returns tenferro_tensor::Error::BackendFailure or tenferro_tensor::Error::BackendSource when the kernel’s runtime or a host buffer fails after it committed to the operation.

Source

fn eig( &self, context: &CpuExecutionContext<'_>, input: TensorView<'_>, ) -> Result<CpuLinalgOutcome<Vec<Tensor>>>

General eigendecomposition, as the built-in eig.

§Errors

Returns tenferro_tensor::Error::BackendFailure or tenferro_tensor::Error::BackendSource when the kernel’s runtime or a host buffer fails after it committed to the operation.

Source

fn eig_values( &self, context: &CpuExecutionContext<'_>, input: TensorView<'_>, ) -> Result<CpuLinalgOutcome<Tensor>>

General eigenvalues, as the built-in eig_values.

§Errors

Returns tenferro_tensor::Error::BackendFailure or tenferro_tensor::Error::BackendSource when the kernel’s runtime or a host buffer fails after it committed to the operation.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§