Trait candle_core::cpu::kernels::VecOps

source ·
pub trait VecOps: NumAssign + Copy {
    // Required methods
    fn min(self, rhs: Self) -> Self;
    fn max(self, rhs: Self) -> Self;

    // Provided methods
    unsafe fn vec_dot(
        lhs: *const Self,
        rhs: *const Self,
        res: *mut Self,
        len: usize
    ) { ... }
    unsafe fn vec_reduce_sum(xs: *const Self, res: *mut Self, len: usize) { ... }
    unsafe fn vec_reduce_max(xs: *const Self, res: *mut Self, len: usize) { ... }
    unsafe fn vec_reduce_min(xs: *const Self, res: *mut Self, len: usize) { ... }
}

Required Methods§

source

fn min(self, rhs: Self) -> Self

source

fn max(self, rhs: Self) -> Self

Provided Methods§

source

unsafe fn vec_dot( lhs: *const Self, rhs: *const Self, res: *mut Self, len: usize )

Dot-product of two vectors.

§Safety

The length of lhs and rhs have to be at least len. res has to point to a valid element.

source

unsafe fn vec_reduce_sum(xs: *const Self, res: *mut Self, len: usize)

Sum of all elements in a vector.

§Safety

The length of xs must be at least len. res has to point to a valid element.

source

unsafe fn vec_reduce_max(xs: *const Self, res: *mut Self, len: usize)

Maximum element in a non-empty vector.

§Safety

The length of xs must be at least len and positive. res has to point to a valid element.

source

unsafe fn vec_reduce_min(xs: *const Self, res: *mut Self, len: usize)

Minimum element in a non-empty vector.

§Safety

The length of xs must be at least len and positive. res has to point to a valid element.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl VecOps for f32

source§

fn min(self, other: Self) -> Self

source§

fn max(self, other: Self) -> Self

source§

unsafe fn vec_dot( lhs: *const Self, rhs: *const Self, res: *mut Self, len: usize )

source§

unsafe fn vec_reduce_sum(xs: *const Self, res: *mut Self, len: usize)

source§

impl VecOps for f64

source§

fn min(self, other: Self) -> Self

source§

fn max(self, other: Self) -> Self

source§

impl VecOps for i64

source§

fn min(self, other: Self) -> Self

source§

fn max(self, other: Self) -> Self

source§

impl VecOps for u8

source§

fn min(self, other: Self) -> Self

source§

fn max(self, other: Self) -> Self

source§

impl VecOps for u32

source§

fn min(self, other: Self) -> Self

source§

fn max(self, other: Self) -> Self

source§

impl VecOps for bf16

source§

fn min(self, other: Self) -> Self

source§

fn max(self, other: Self) -> Self

source§

impl VecOps for f16

source§

fn min(self, other: Self) -> Self

source§

fn max(self, other: Self) -> Self

source§

unsafe fn vec_dot( lhs: *const Self, rhs: *const Self, res: *mut Self, len: usize )

Implementors§