pub struct SimdGradientComputer { /* private fields */ }Expand description
SIMD gradient computer
Implementations§
Source§impl SimdGradientComputer
impl SimdGradientComputer
Sourcepub fn with_config(config: SimdConfig) -> Self
pub fn with_config(config: SimdConfig) -> Self
Create with custom configuration
Sourcepub fn config(&self) -> &SimdConfig
pub fn config(&self) -> &SimdConfig
Get current configuration
Sourcepub fn capability(&self) -> SimdCapability
pub fn capability(&self) -> SimdCapability
Get detected SIMD capability
Sourcepub fn detect_capability(&self) -> SimdCapability
pub fn detect_capability(&self) -> SimdCapability
Detect SIMD capability
Sourcepub fn reset_stats(&mut self)
pub fn reset_stats(&mut self)
Reset statistics
Sourcepub fn should_use_simd(&self, tensor_size: usize) -> bool
pub fn should_use_simd(&self, tensor_size: usize) -> bool
Check if SIMD should be used for a given tensor size
Sourcepub fn is_aligned<T>(&self, data: &[T]) -> bool
pub fn is_aligned<T>(&self, data: &[T]) -> bool
Check if data is aligned for SIMD operations
Sourcepub fn compute_simd<T>(&mut self, data: &[T]) -> AutogradResult<Vec<T>>
pub fn compute_simd<T>(&mut self, data: &[T]) -> AutogradResult<Vec<T>>
Compute gradients with SIMD acceleration
This uses SciRS2-Core’s SIMD operations with memory alignment for optimal performance.
Sourcepub fn simd_element_wise<T, F>(
&mut self,
data: &[T],
scalar_op: F,
) -> AutogradResult<Vec<T>>
pub fn simd_element_wise<T, F>( &mut self, data: &[T], scalar_op: F, ) -> AutogradResult<Vec<T>>
Apply element-wise SIMD operation
This demonstrates memory-aligned SIMD operations for element-wise gradient computations.
Sourcepub fn report_performance(&self) -> String
pub fn report_performance(&self) -> String
Report current performance statistics
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SimdGradientComputer
impl RefUnwindSafe for SimdGradientComputer
impl Send for SimdGradientComputer
impl Sync for SimdGradientComputer
impl Unpin for SimdGradientComputer
impl UnsafeUnpin for SimdGradientComputer
impl UnwindSafe for SimdGradientComputer
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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