pub struct CpuPure;Trait Implementations§
Source§impl Backend for CpuPure
impl Backend for CpuPure
Source§const SUPPORTS_2D_TRANSPOSED_MATMUL: bool = true
const SUPPORTS_2D_TRANSPOSED_MATMUL: bool = true
true if OpKind::MatMul
accepts a 2D input whose strides describe a transposed view
(row_stride == 1, col_stride > 1) - i.e. the underlying GEMM is
invoked with a trans-flag and no copy is required. The fast path is
deliberately scoped to rank 2; higher-rank tensors are always
contiguified by the op layer before reaching the kernel. Read moreSource§const SUPPORTS_NON_CONTIGUOUS_MATMUL: bool = true
const SUPPORTS_NON_CONTIGUOUS_MATMUL: bool = true
true if OpKind::MatMul
accepts any memory configuration as long the last 2 axis are contiguous. Read moreSource§fn compute<T>(
op: &OpKind<T>,
output_buffer: Vec<T>,
output_layout: &Layout,
inputs: &[TensorData<T>],
) -> TensorData<T>where
T: Dtype + ComputeFor<CpuPure>,
fn compute<T>(
op: &OpKind<T>,
output_buffer: Vec<T>,
output_layout: &Layout,
inputs: &[TensorData<T>],
) -> TensorData<T>where
T: Dtype + ComputeFor<CpuPure>,
Run
op over inputs into a fresh allocation. output_buffer is the
destination Vec<T>; the returned TensorData wraps it with
output_layout.Source§fn compute_inplace<T>(
op: &OpKind<T>,
output_layout: &Layout,
inputs: Vec<TensorData<T>>,
output_idx: usize,
) -> TensorData<T>where
T: Dtype + ComputeFor<Self>,
fn compute_inplace<T>(
op: &OpKind<T>,
output_layout: &Layout,
inputs: Vec<TensorData<T>>,
output_idx: usize,
) -> TensorData<T>where
T: Dtype + ComputeFor<Self>,
Run
op reusing inputs[output_idx]’s buffer as the destination. The
planner guarantees that buffer is no longer referenced by any live
node at this point, so the in-place write is sound.Source§impl ComputeFor<CpuPure> for f64
impl ComputeFor<CpuPure> for f64
Source§impl ComputeFor<CpuPure> for f32
impl ComputeFor<CpuPure> for f32
impl Copy for CpuPure
impl Eq for CpuPure
impl StructuralPartialEq for CpuPure
Auto Trait Implementations§
impl Freeze for CpuPure
impl RefUnwindSafe for CpuPure
impl Send for CpuPure
impl Sync for CpuPure
impl Unpin for CpuPure
impl UnsafeUnpin for CpuPure
impl UnwindSafe for CpuPure
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more