pub trait ArrayOptimizer {
// Required methods
fn optimize(&self) -> VortexResult<ArrayRef>;
fn optimize_ctx(
&self,
kernels: &(impl AsOptimizerKernels + ?Sized),
) -> VortexResult<ArrayRef>;
fn optimize_recursive(
&self,
kernels: &(impl AsOptimizerKernels + ?Sized),
) -> VortexResult<ArrayRef>;
}Expand description
Extension trait for optimizing array trees using reduce/reduce_parent rules.
Required Methods§
Sourcefn optimize(&self) -> VortexResult<ArrayRef>
👎Deprecated: use optimize_ctx with the session, or an ExecutionCtx created from it, instead
fn optimize(&self) -> VortexResult<ArrayRef>
use optimize_ctx with the session, or an ExecutionCtx created from it, instead
Optimize the array with only the parent-reduce rules that vortex-array registers by
default.
Encodings outside vortex-array register their rules with a session, so this misses them.
The result is not marked as optimized, so optimizing it later with a session still tries
the session’s rules.
Sourcefn optimize_ctx(
&self,
kernels: &(impl AsOptimizerKernels + ?Sized),
) -> VortexResult<ArrayRef>
fn optimize_ctx( &self, kernels: &(impl AsOptimizerKernels + ?Sized), ) -> VortexResult<ArrayRef>
Optimize the root array node by running reduce and reduce_parent rules to fixpoint.
The root is optimized first, then the descendants that were never optimized, then the root
again if a child changed. Parent-reduce kernels are looked up for each
(parent_encoding_id, child_encoding_id) pair in the kernels::KernelSession of the
session, or of the session an execution context was created from.
Sourcefn optimize_recursive(
&self,
kernels: &(impl AsOptimizerKernels + ?Sized),
) -> VortexResult<ArrayRef>
fn optimize_recursive( &self, kernels: &(impl AsOptimizerKernels + ?Sized), ) -> VortexResult<ArrayRef>
Optimize the entire array tree recursively (root and all descendants).
This is the same as Self::optimize_ctx: optimizing a node also optimizes every
descendant that was never optimized.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".