Skip to main content

SimdOperation

Trait SimdOperation 

Source
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§

Source

fn name(&self) -> &str

The name of the operation

Source

fn version(&self) -> &str

The version of the operation

Source

fn description(&self) -> &str

Description of what the operation does

Source

fn execute_f32( &self, input: &[f32], output: &mut [f32], ) -> Result<(), PluginError>

Execute the operation on f32 data

Source

fn execute_f64( &self, input: &[f64], output: &mut [f64], ) -> Result<(), PluginError>

Execute the operation on f64 data

Provided Methods§

Source

fn required_input_size(&self, output_size: usize) -> usize

Get the required input size for a given output size

Source

fn supports_inplace(&self) -> bool

Check if the operation supports in-place execution

Source

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".

Implementors§