pub struct tf32(/* private fields */);
Expand description
Implementations§
Source§impl tf32
impl tf32
Sourcepub const fn from_f32(value: f32) -> tf32
pub const fn from_f32(value: f32) -> tf32
Constructs a tf32
value from a 32-bit floating point value.
This operation is lossy. If the 32-bit value is too large to fit, ±∞ will result. NaN values are preserved. Subnormal values that are too tiny to be represented will result in ±0. All other values are truncated and rounded to the nearest representable value.
Sourcepub const fn from_f64(value: f64) -> tf32
pub const fn from_f64(value: f64) -> tf32
Constructs a tf32
value from a 64-bit floating point value.
This operation is lossy. If the 64-bit value is to large to fit, ±∞ will result. NaN values are preserved. 64-bit subnormal values are too tiny to be represented and result in ±0. Exponents that underflow the minimum exponent will result in subnormals or ±0. All other values are truncated and rounded to the nearest representable value.
Trait Implementations§
Source§impl Abs for tf32
impl Abs for tf32
fn abs(x: Self) -> Self
fn __expand_abs( context: &mut CubeContext, x: Self::ExpandType, ) -> ExpandElementTyped<Self>
Source§impl AddAssign for tf32
impl AddAssign for tf32
Source§fn add_assign(&mut self, rhs: Self)
fn add_assign(&mut self, rhs: Self)
+=
operation. Read moreSource§impl Ceil for tf32
impl Ceil for tf32
fn ceil(x: Self) -> Self
fn __expand_ceil( context: &mut CubeContext, x: Self::ExpandType, ) -> ExpandElementTyped<Self>
Source§impl Clamp for tf32
impl Clamp for tf32
Source§fn clamp(input: Self, min_value: Self, max_value: Self) -> Self
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
Source§impl Cos for tf32
impl Cos for tf32
fn cos(x: Self) -> Self
fn __expand_cos( context: &mut CubeContext, x: Self::ExpandType, ) -> ExpandElementTyped<Self>
Source§impl<I: Index> CubeIndexMut<I> for tf32
impl<I: Index> CubeIndexMut<I> for tf32
fn cube_idx_mut(&mut self, _i: T) -> &mut Self::Output
Source§impl CubePrimitive for tf32
impl CubePrimitive for tf32
Source§fn as_elem_native() -> Option<Elem>
fn as_elem_native() -> Option<Elem>
Return the element type to use on GPU
Source§fn as_elem(_context: &CubeContext) -> Elem
fn as_elem(_context: &CubeContext) -> Elem
Source§fn as_elem_native_unchecked() -> Elem
fn as_elem_native_unchecked() -> Elem
fn from_expand_elem(elem: ExpandElement) -> Self::ExpandType
Source§impl CubeType for tf32
impl CubeType for tf32
type ExpandType = ExpandElementTyped<tf32>
Source§fn init(context: &mut CubeContext, expand: Self::ExpandType) -> Self::ExpandType
fn init(context: &mut CubeContext, expand: Self::ExpandType) -> Self::ExpandType
Source§impl DivAssign for tf32
impl DivAssign for tf32
Source§fn div_assign(&mut self, rhs: Self)
fn div_assign(&mut self, rhs: Self)
/=
operation. Read moreSource§impl Dot for tf32
impl Dot for tf32
fn dot(self, _rhs: Self) -> Self
fn __expand_dot( context: &mut CubeContext, lhs: ExpandElementTyped<Self>, rhs: ExpandElementTyped<Self>, ) -> ExpandElementTyped<Self>
Source§impl Erf for tf32
impl Erf for tf32
fn erf(x: Self) -> Self
fn __expand_erf( context: &mut CubeContext, x: Self::ExpandType, ) -> ExpandElementTyped<Self>
Source§impl Exp for tf32
impl Exp for tf32
fn exp(x: Self) -> Self
fn __expand_exp( context: &mut CubeContext, x: Self::ExpandType, ) -> ExpandElementTyped<Self>
Source§impl ExpandElementBaseInit for tf32
impl ExpandElementBaseInit for tf32
fn init_elem(context: &mut CubeContext, elem: ExpandElement) -> ExpandElement
Source§impl Float for tf32
impl Float for tf32
Source§const MAX_10_EXP: i32 = 38i32
const MAX_10_EXP: i32 = 38i32
Maximum possible tf32
power of 10 exponent
Source§const MIN_10_EXP: i32 = -37i32
const MIN_10_EXP: i32 = -37i32
Minimum possible normal tf32
power of 10 exponent
Source§const MIN_EXP: i32 = -125i32
const MIN_EXP: i32 = -125i32
One greater than the minimum possible normal [v
] power of 2 exponent
Source§const MIN_POSITIVE: Self
const MIN_POSITIVE: Self
MIN_POSITIVE
is defined by precision, so use f16
as reference
const DIGITS: u32 = 32u32
const EPSILON: Self
const INFINITY: Self
const MANTISSA_DIGITS: u32 = 10u32
const NAN: Self
const NEG_INFINITY: Self
const RADIX: u32 = 2u32
fn new(val: f32) -> Self
fn __expand_new( context: &mut CubeContext, val: f32, ) -> <Self as CubeType>::ExpandType
Source§impl Floor for tf32
impl Floor for tf32
fn floor(x: Self) -> Self
fn __expand_floor( context: &mut CubeContext, x: Self::ExpandType, ) -> ExpandElementTyped<Self>
Source§impl From<tf32> for ExpandElement
impl From<tf32> for ExpandElement
Source§impl IntoRuntime for tf32
impl IntoRuntime for tf32
fn __expand_runtime_method( self, context: &mut CubeContext, ) -> ExpandElementTyped<Self>
Source§fn runtime(self) -> Self
fn runtime(self) -> Self
Source§impl LaunchArgExpand for tf32
impl LaunchArgExpand for tf32
Source§type CompilationArg = ()
type CompilationArg = ()
Source§fn expand(
_: &Self::CompilationArg,
builder: &mut KernelBuilder,
) -> ExpandElementTyped<Self>
fn expand( _: &Self::CompilationArg, builder: &mut KernelBuilder, ) -> ExpandElementTyped<Self>
Source§fn expand_output(
arg: &Self::CompilationArg,
builder: &mut KernelBuilder,
) -> <Self as CubeType>::ExpandType
fn expand_output( arg: &Self::CompilationArg, builder: &mut KernelBuilder, ) -> <Self as CubeType>::ExpandType
Source§impl Log for tf32
impl Log for tf32
fn log(x: Self) -> Self
fn __expand_log( context: &mut CubeContext, x: Self::ExpandType, ) -> ExpandElementTyped<Self>
Source§impl Log1p for tf32
impl Log1p for tf32
fn log1p(x: Self) -> Self
fn __expand_log1p( context: &mut CubeContext, x: Self::ExpandType, ) -> ExpandElementTyped<Self>
Source§impl Magnitude for tf32
impl Magnitude for tf32
fn magnitude(x: Self) -> Self
fn __expand_magnitude( context: &mut CubeContext, x: Self::ExpandType, ) -> ExpandElementTyped<Self>
Source§impl Max for tf32
impl Max for tf32
fn max(self, _rhs: Self) -> Self
fn __expand_max( context: &mut CubeContext, lhs: ExpandElementTyped<Self>, rhs: ExpandElementTyped<Self>, ) -> ExpandElementTyped<Self>
Source§impl Min for tf32
impl Min for tf32
fn min(self, _rhs: Self) -> Self
fn __expand_min( context: &mut CubeContext, lhs: ExpandElementTyped<Self>, rhs: ExpandElementTyped<Self>, ) -> ExpandElementTyped<Self>
Source§impl MulAssign for tf32
impl MulAssign for tf32
Source§fn mul_assign(&mut self, rhs: Self)
fn mul_assign(&mut self, rhs: Self)
*=
operation. Read moreSource§impl Normalize for tf32
impl Normalize for tf32
fn normalize(x: Self) -> Self
fn __expand_normalize( context: &mut CubeContext, x: Self::ExpandType, ) -> ExpandElementTyped<Self>
Source§impl Numeric for tf32
impl Numeric for tf32
fn min_value() -> Self
fn max_value() -> Self
fn __expand_min_value( context: &mut CubeContext, ) -> <Self as CubeType>::ExpandType
fn __expand_max_value( context: &mut CubeContext, ) -> <Self as CubeType>::ExpandType
fn from_vec<const D: usize>(_vec: [u32; D]) -> Self
fn __expand_from_int( context: &mut CubeContext, val: ExpandElementTyped<i64>, ) -> <Self as CubeType>::ExpandType
fn __expand_from_vec<const D: usize>( context: &mut CubeContext, vec: [u32; D], ) -> <Self as CubeType>::ExpandType
Source§impl PartialOrd for tf32
impl PartialOrd for tf32
Source§impl Powf for tf32
impl Powf for tf32
fn powf(self, _rhs: Self) -> Self
fn __expand_powf( context: &mut CubeContext, lhs: ExpandElementTyped<Self>, rhs: ExpandElementTyped<Self>, ) -> ExpandElementTyped<Self>
Source§impl Recip for tf32
impl Recip for tf32
fn recip(x: Self) -> Self
fn __expand_recip( context: &mut CubeContext, x: Self::ExpandType, ) -> ExpandElementTyped<Self>
Source§impl Remainder for tf32
impl Remainder for tf32
fn rem(self, _rhs: Self) -> Self
fn __expand_rem( context: &mut CubeContext, lhs: ExpandElementTyped<Self>, rhs: ExpandElementTyped<Self>, ) -> ExpandElementTyped<Self>
Source§impl Round for tf32
impl Round for tf32
fn round(x: Self) -> Self
fn __expand_round( context: &mut CubeContext, x: Self::ExpandType, ) -> ExpandElementTyped<Self>
Source§impl ScalarArgSettings for tf32
impl ScalarArgSettings for tf32
Source§fn register<R: Runtime>(&self, settings: &mut KernelLauncher<R>)
fn register<R: Runtime>(&self, settings: &mut KernelLauncher<R>)
Source§impl Sin for tf32
impl Sin for tf32
fn sin(x: Self) -> Self
fn __expand_sin( context: &mut CubeContext, x: Self::ExpandType, ) -> ExpandElementTyped<Self>
Source§impl Sqrt for tf32
impl Sqrt for tf32
fn sqrt(x: Self) -> Self
fn __expand_sqrt( context: &mut CubeContext, x: Self::ExpandType, ) -> ExpandElementTyped<Self>
Source§impl SubAssign for tf32
impl SubAssign for tf32
Source§fn sub_assign(&mut self, rhs: Self)
fn sub_assign(&mut self, rhs: Self)
-=
operation. Read moreSource§impl Tanh for tf32
impl Tanh for tf32
fn tanh(x: Self) -> Self
fn __expand_tanh( context: &mut CubeContext, x: Self::ExpandType, ) -> ExpandElementTyped<Self>
Source§impl ToPrimitive for tf32
impl ToPrimitive for tf32
Source§fn to_i64(&self) -> Option<i64>
fn to_i64(&self) -> Option<i64>
self
to an i64
. If the value cannot be
represented by an i64
, then None
is returned.Source§fn to_u64(&self) -> Option<u64>
fn to_u64(&self) -> Option<u64>
self
to a u64
. If the value cannot be
represented by a u64
, then None
is returned.Source§fn to_f32(&self) -> Option<f32>
fn to_f32(&self) -> Option<f32>
self
to an f32
. Overflows may map to positive
or negative inifinity, otherwise None
is returned if the value cannot
be represented by an f32
.Source§fn to_f64(&self) -> Option<f64>
fn to_f64(&self) -> Option<f64>
self
to an f64
. Overflows may map to positive
or negative inifinity, otherwise None
is returned if the value cannot
be represented by an f64
. Read moreSource§fn to_isize(&self) -> Option<isize>
fn to_isize(&self) -> Option<isize>
self
to an isize
. If the value cannot be
represented by an isize
, then None
is returned.Source§fn to_i8(&self) -> Option<i8>
fn to_i8(&self) -> Option<i8>
self
to an i8
. If the value cannot be
represented by an i8
, then None
is returned.Source§fn to_i16(&self) -> Option<i16>
fn to_i16(&self) -> Option<i16>
self
to an i16
. If the value cannot be
represented by an i16
, then None
is returned.Source§fn to_i32(&self) -> Option<i32>
fn to_i32(&self) -> Option<i32>
self
to an i32
. If the value cannot be
represented by an i32
, then None
is returned.Source§fn to_i128(&self) -> Option<i128>
fn to_i128(&self) -> Option<i128>
self
to an i128
. If the value cannot be
represented by an i128
(i64
under the default implementation), then
None
is returned. Read moreSource§fn to_usize(&self) -> Option<usize>
fn to_usize(&self) -> Option<usize>
self
to a usize
. If the value cannot be
represented by a usize
, then None
is returned.Source§fn to_u8(&self) -> Option<u8>
fn to_u8(&self) -> Option<u8>
self
to a u8
. If the value cannot be
represented by a u8
, then None
is returned.Source§fn to_u16(&self) -> Option<u16>
fn to_u16(&self) -> Option<u16>
self
to a u16
. If the value cannot be
represented by a u16
, then None
is returned.impl Copy for tf32
impl Pod for tf32
impl StructuralPartialEq for tf32
Auto Trait Implementations§
impl Freeze for tf32
impl RefUnwindSafe for tf32
impl Send for tf32
impl Sync for tf32
impl Unpin for tf32
impl UnwindSafe for tf32
Blanket Implementations§
Source§impl<P> BitCast for Pwhere
P: CubePrimitive,
impl<P> BitCast for Pwhere
P: CubePrimitive,
Source§fn bitcast_from<From: CubePrimitive>(value: From) -> Self
fn bitcast_from<From: CubePrimitive>(value: From) -> Self
fn __expand_bitcast_from<From: CubePrimitive>( context: &mut CubeContext, value: ExpandElementTyped<From>, ) -> <Self as CubeType>::ExpandType
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
Source§impl<P> Cast for Pwhere
P: CubePrimitive,
impl<P> Cast for Pwhere
P: CubePrimitive,
fn cast_from<From>(_value: From) -> Pwhere
From: CubePrimitive,
fn __expand_cast_from<From: CubePrimitive>( context: &mut CubeContext, value: ExpandElementTyped<From>, ) -> <Self as CubeType>::ExpandType
Source§impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
Source§type Bits = T
type Bits = T
Self
must have the same layout as the specified Bits
except for
the possible invalid bit patterns being checked during
is_valid_bit_pattern
.Source§fn is_valid_bit_pattern(_bits: &T) -> bool
fn is_valid_bit_pattern(_bits: &T) -> bool
bits
as &Self
.