Skip to main content

ParallelSimdOperation

Trait ParallelSimdOperation 

Source
pub trait ParallelSimdOperation<T>: SimdOperation<T> {
    // Required methods
    fn execute_parallel(
        &self,
        input: &[T],
        chunk_size: usize,
    ) -> Result<Self::Output, Self::Error>;
    fn optimal_chunk_size(&self, input_size: usize) -> usize;
    fn should_parallelize(&self, input_size: usize) -> bool;
}
Expand description

Trait for operations that can be parallelized

Required Methods§

Source

fn execute_parallel( &self, input: &[T], chunk_size: usize, ) -> Result<Self::Output, Self::Error>

Execute the operation in parallel across multiple chunks

Source

fn optimal_chunk_size(&self, input_size: usize) -> usize

Get the optimal chunk size for parallel execution

Source

fn should_parallelize(&self, input_size: usize) -> bool

Check if parallel execution is beneficial for the given input size

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§