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§
Sourcefn execute_parallel(
&self,
input: &[T],
chunk_size: usize,
) -> Result<Self::Output, Self::Error>
fn execute_parallel( &self, input: &[T], chunk_size: usize, ) -> Result<Self::Output, Self::Error>
Execute the operation in parallel across multiple chunks
Sourcefn optimal_chunk_size(&self, input_size: usize) -> usize
fn optimal_chunk_size(&self, input_size: usize) -> usize
Get the optimal chunk size for parallel execution
Sourcefn should_parallelize(&self, input_size: usize) -> bool
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".