Trait Clamp

Source
pub trait Clamp: CubePrimitive + Sized {
    // Provided methods
    fn clamp(input: Self, min_value: Self, max_value: Self) -> Self { ... }
    fn __expand_clamp(
        context: &mut CubeContext,
        input: Self::ExpandType,
        min_value: Self::ExpandType,
        max_value: Self::ExpandType,
    ) -> Self::ExpandType { ... }
}

Provided Methods§

Source

fn clamp(input: Self, min_value: Self, max_value: Self) -> Self

Clamp the input value between the max and min values provided.

Source

fn __expand_clamp( context: &mut CubeContext, input: Self::ExpandType, min_value: Self::ExpandType, max_value: Self::ExpandType, ) -> Self::ExpandType

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl Clamp for f32

Source§

impl Clamp for f64

Source§

impl Clamp for i8

Source§

impl Clamp for i16

Source§

impl Clamp for i32

Source§

impl Clamp for i64

Source§

impl Clamp for u8

Source§

impl Clamp for u16

Source§

impl Clamp for u32

Source§

impl Clamp for u64

Source§

impl Clamp for bf16

Source§

impl Clamp for f16

Implementors§

Source§

impl Clamp for flex32

Source§

impl Clamp for tf32

Source§

impl<P: CubePrimitive + Clamp> Clamp for Line<P>

Source§

impl<const POS: u8> Clamp for FloatExpand<POS>