pub struct SimdQuantizationOps { /* private fields */ }Expand description
SIMD-accelerated quantization operations
This struct provides vectorized implementations of quantization operations that can take advantage of CPU SIMD instructions for improved performance.
Implementations§
Source§impl SimdQuantizationOps
impl SimdQuantizationOps
Sourcepub fn quantize_f32_to_u8_simd(
&self,
input: &[f32],
scale: f32,
zero_point: f32,
) -> BackendResult<Vec<u8>>
pub fn quantize_f32_to_u8_simd( &self, input: &[f32], scale: f32, zero_point: f32, ) -> BackendResult<Vec<u8>>
SIMD-accelerated f32 to u8 quantization
Uses vectorized operations to quantize multiple floating-point values to 8-bit unsigned integers simultaneously.
Sourcepub fn dequantize_u8_to_f32_simd(
&self,
input: &[u8],
scale: f32,
zero_point: f32,
) -> BackendResult<Vec<f32>>
pub fn dequantize_u8_to_f32_simd( &self, input: &[u8], scale: f32, zero_point: f32, ) -> BackendResult<Vec<f32>>
SIMD-accelerated u8 to f32 dequantization
Sourcepub fn add_int8_simd(&self, a: &[i8], b: &[i8]) -> BackendResult<Vec<i8>>
pub fn add_int8_simd(&self, a: &[i8], b: &[i8]) -> BackendResult<Vec<i8>>
SIMD-accelerated INT8 vector addition
Sourcepub fn is_available(&self) -> bool
pub fn is_available(&self) -> bool
Check if SIMD operations are available
Sourcepub fn vector_width(&self) -> usize
pub fn vector_width(&self) -> usize
Get the optimal vector width for this hardware
Trait Implementations§
Source§impl Clone for SimdQuantizationOps
impl Clone for SimdQuantizationOps
Source§fn clone(&self) -> SimdQuantizationOps
fn clone(&self) -> SimdQuantizationOps
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for SimdQuantizationOps
impl RefUnwindSafe for SimdQuantizationOps
impl Send for SimdQuantizationOps
impl Sync for SimdQuantizationOps
impl Unpin for SimdQuantizationOps
impl UnsafeUnpin for SimdQuantizationOps
impl UnwindSafe for SimdQuantizationOps
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more