pub trait ElementwiseRuntime:
Debug
+ Send
+ Sync
+ 'static {
// Required method
fn prepare(
&self,
request: ElementwisePrepareRequest<'_>,
) -> Result<PrepareCapability, PrepareError>;
// Provided method
fn max_fused_region_inputs(&self) -> Option<usize> { ... }
}Expand description
Direct runtime provider for elementwise core operations.
Required Methods§
Sourcefn prepare(
&self,
request: ElementwisePrepareRequest<'_>,
) -> Result<PrepareCapability, PrepareError>
fn prepare( &self, request: ElementwisePrepareRequest<'_>, ) -> Result<PrepareCapability, PrepareError>
Provided Methods§
Sourcefn max_fused_region_inputs(&self) -> Option<usize>
fn max_fused_region_inputs(&self) -> Option<usize>
Largest number of distinct external inputs one fused elementwise region
may read on this engine, or None when the engine has no such limit.
The prepared planner does not plan a region above this limit, so the
region runs instruction by instruction without a fusion attempt that the
backend would decline anyway. The default is None.
§Examples
use tenferro_cpu::CpuEngine;
// The CPU engine registration exposes its own fused-region limit.
let registration = tenferro_cpu::runtime_engine_registration(&CpuEngine::serial())?;
let elementwise = registration.capabilities().elementwise().unwrap();
assert_eq!(elementwise.max_fused_region_inputs(), Some(4));Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".