pub struct CustomOpDescriptor {
pub fn_id: FnId,
pub name: String,
pub eval_fn: EvalFn,
pub vectorizable: bool,
pub simplify_rules: Vec<SimplifyRule>,
pub egraph_rules: Vec<EGraphRule>,
pub cost: f64,
}Expand description
Complete descriptor for a user-defined operator.
A descriptor bundles every pipeline-facing property of a custom operator
into a single value. Register it with CustomOpRegistry::register.
Fields§
§fn_id: FnIdNumeric identifier — unique within a registry.
name: StringHuman-readable name resolved by the expression parser.
eval_fn: EvalFnNative evaluation function called by the JIT via call.
vectorizable: boolWhen true, the operator is pure (no side effects) and may be
duplicated by the batch f64×2 ILP vectorisation path.
simplify_rules: Vec<SimplifyRule>Heuristic simplification rules (fed to the HeuristicEngine).
egraph_rules: Vec<EGraphRule>E-graph rewrite rules (fed to equality saturation).
cost: f64Extraction cost hint for the e-graph extractor (default: 2.0;
built-in binary ops are 1.0, variables 0.5).
Implementations§
Source§impl CustomOpDescriptor
impl CustomOpDescriptor
Sourcepub fn builder(
fn_id: impl Into<FnId>,
name: impl Into<String>,
eval_fn: EvalFn,
) -> CustomOpDescriptorBuilder
pub fn builder( fn_id: impl Into<FnId>, name: impl Into<String>, eval_fn: EvalFn, ) -> CustomOpDescriptorBuilder
Start building a descriptor with fluent API.
use rssn_advanced::custom::descriptor::{CustomOpDescriptor, EvalFn};
use rssn_advanced::dag::builder::DagBuilder;
extern "C" fn sin_approx(x: f64) -> f64 { x.sin() }
let mut builder = DagBuilder::new();
let fn_id = builder.intern_function("sin");
let _desc = CustomOpDescriptor::builder(fn_id, "sin", EvalFn::Arity1(sin_approx))
.vectorizable()
.build();Trait Implementations§
Auto Trait Implementations§
impl Freeze for CustomOpDescriptor
impl !RefUnwindSafe for CustomOpDescriptor
impl Send for CustomOpDescriptor
impl Sync for CustomOpDescriptor
impl Unpin for CustomOpDescriptor
impl UnsafeUnpin for CustomOpDescriptor
impl !UnwindSafe for CustomOpDescriptor
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more