Skip to main content

OperationProvider

Trait OperationProvider 

Source
pub trait OperationProvider<R: DeviceRuntime>: OperationResourceEstimator {
    // Required methods
    fn reusable_execution_topology(
        &self,
        request: ReusableExecutionTopologyRequest<'_>,
    ) -> Result<ReusableExecutionTopology, VNextError>;
    fn encode_selected(
        &self,
        invocation: BatchedOperationInvocation<'_, R::Buffer>,
    ) -> Result<EncodedDeviceOperation<R::Command>, OperationFailure>;

    // Provided method
    fn encode_reusable_execution_bindings(
        &self,
        invocation: BatchedOperationInvocation<'_, R::Buffer>,
    ) -> Result<EncodedReusableExecutionBindings<R::Command>, OperationFailure> { ... }
}
Expand description

A compile-time provider contract for one concrete runtime buffer type. The kernel method consumes only a dispatch-created invocation.

Required Methods§

Source

fn reusable_execution_topology( &self, request: ReusableExecutionTopologyRequest<'_>, ) -> Result<ReusableExecutionTopology, VNextError>

Publishes the provider-private compute topology that must match a resident reusable program. Static topology and an eager boundary are intentionally distinct states: a provider may never silently turn a submission-scoped address into resident state, while one eager node must not disable safe resident segments elsewhere in the wave.

This declaration is intentionally required. A new provider cannot silently inherit a static topology after adding shape-dependent kernel selection. Providers must query the reusable address scope of every value binding and workspace their encoded command actually captures; an unqueried operand is not covered by this contract.

Source

fn encode_selected( &self, invocation: BatchedOperationInvocation<'_, R::Buffer>, ) -> Result<EncodedDeviceOperation<R::Command>, OperationFailure>

Provided Methods§

Source

fn encode_reusable_execution_bindings( &self, invocation: BatchedOperationInvocation<'_, R::Buffer>, ) -> Result<EncodedReusableExecutionBindings<R::Command>, OperationFailure>

Encodes only the request-varying boundaries around a compute segment that was already prepared as a reusable backend executable.

The default deliberately reuses the exact provider implementation and discards its compute command. Providers may override this cold-selected boundary to avoid rebuilding static launch metadata.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§