pub trait SimdOperation: Send + Sync {
// Required methods
fn name(&self) -> &str;
fn version(&self) -> &str;
fn description(&self) -> &str;
fn execute_f32(
&self,
input: &[f32],
output: &mut [f32],
) -> Result<(), PluginError>;
fn execute_f64(
&self,
input: &[f64],
output: &mut [f64],
) -> Result<(), PluginError>;
// Provided methods
fn required_input_size(&self, output_size: usize) -> usize { ... }
fn supports_inplace(&self) -> bool { ... }
fn simd_requirements(&self) -> SimdRequirements { ... }
}Expand description
Trait for custom SIMD operations
Required Methods§
Sourcefn description(&self) -> &str
fn description(&self) -> &str
Description of what the operation does
Sourcefn execute_f32(
&self,
input: &[f32],
output: &mut [f32],
) -> Result<(), PluginError>
fn execute_f32( &self, input: &[f32], output: &mut [f32], ) -> Result<(), PluginError>
Execute the operation on f32 data
Sourcefn execute_f64(
&self,
input: &[f64],
output: &mut [f64],
) -> Result<(), PluginError>
fn execute_f64( &self, input: &[f64], output: &mut [f64], ) -> Result<(), PluginError>
Execute the operation on f64 data
Provided Methods§
Sourcefn required_input_size(&self, output_size: usize) -> usize
fn required_input_size(&self, output_size: usize) -> usize
Get the required input size for a given output size
Sourcefn supports_inplace(&self) -> bool
fn supports_inplace(&self) -> bool
Check if the operation supports in-place execution
Sourcefn simd_requirements(&self) -> SimdRequirements
fn simd_requirements(&self) -> SimdRequirements
Get the SIMD width requirements
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".