Skip to main content

BindingEntry

Struct BindingEntry 

Source
pub struct BindingEntry {
    pub kernel: KernelRef,
    pub caps: KernelCaps,
    pub precision: PrecisionGuarantee,
    pub cost: CostFn,
    pub kernel_source: &'static str,
    pub is_generic: bool,
    pub kernel_revision_hash: u64,
    pub cost_expr: Option<&'static CompiledCostExpr>,
}
Expand description

One concrete kernel registered against a (OpKind, dtypes, backend) decision-point key. Phase 7.6 step 9a: a single key now carries SmallVec<[BindingEntry; 2]> — multiple alternatives compete at the same decision point (e.g. cuBLAS bf16 matmul + CUTLASS bf16 matmul at (MatMul, [BF16, BF16, BF16], Cuda)). The route picker (step 9b) selects among them at plan time; today’s single-impl callers (lookup, lookup_with_caps, lookup_precision, lookup_cost) return the first entry, preserving the pre-9a behavior for sites that haven’t migrated.

Fields§

§kernel: KernelRef§caps: KernelCaps§precision: PrecisionGuarantee§cost: CostFn§kernel_source: &'static str

Diagnostic tag identifying the kernel’s implementation source when multiple alternatives register at the same (op, dtypes, backend) key. Used to distinguish e.g. AOCL’s matmul from MKL’s matmul from the portable scalar matmul — all three live at (MatMul, [F32×3], Cpu) as siblings.

"" is the default for kernels that don’t need to distinguish. Conventional values: "portable-cpu" for fuel-cpu-backend scalar/gemm kernels, "aocl" for AOCL-BLAS, "mkl" for oneMKL, "cublas" / "cutlass" for CUDA variants. The string is diagnostic-only — never used for dispatch routing (the kernel function pointer is the dispatch identifier).

§is_generic: bool

Whether this kernel’s FKC accept-contract is the GENERIC (fully-permissive strided) one — admissible anywhere because it imposes no structure tightness (FKC §4.12). This is the structural-miss fallback bit: when the winning contract at a dispatch cell is generic, a structure-specialized kernel would have fit but none is registered, and the Baracuda miss telemetry records the demand.

Computed once at registration by the FKC importer from the kernel’s retained ResolvedLayout set (crate::fkc::is_generic_contract) and stamped here, so the live dispatch pick site reads a precomputed bool rather than re-deriving genericity from the lossy single-bool KernelCaps.

Hand-written registrations default false. Every non-FKC register* path routes through KernelBindingTable::register_full_with_source, which sets this false: genericity is a claim about being the FKC generic-fallback contract in Baracuda’s structure-key specialization space, and a hand-written kernel makes no such claim. This holds even for a hand-written strided kernel (register_with_caps(strided_input=true)): strided-capability is not the same as being the generic fallback, and conflating them would fabricate a miss demand signal for cells that are not part of Baracuda’s matrix. Only the FKC importer, which computed genericity from the declared contract, ever sets this true.

§kernel_revision_hash: u64

Stable per-implementation-version hash — the fifth axis of the FKC kernel-identity basis tuple (FKC §4.11), pinning the exact kernel build so a persisted plan / telemetry record re-resolves to it. 0 (crate::fused::KernelRevisionHash::UNTRACKED) for hand-written registrations (which carry no revision); the FKC importer threads the contract-computed revision from ResolvedPrimitive.revision here. Read by the Baracuda dispatch-telemetry ImplId at the plan pick site so the chosen/candidates ids carry a real revision instead of a stamped 0.

§cost_expr: Option<&'static CompiledCostExpr>

The contract’s parsed cost-expression AST (FKC §4.4 / adoption plan §2.3), when the kernel came from an FKC-imported contract that declares one. &'static so the entry stays Copy (CompiledCostExpr derives Debug, which is all &'static T needs to stay Copy / Clone / Debug itself). None for every hand-written registration (register/register_full*) — those carry no declared cost AST, only a CostFn fn-pointer. Only the FKC importer, once it lowers a contract’s cost block to a live CostFn (a later Group-2 task), stamps Some(&CompiledCostExpr) here.

Trait Implementations§

Source§

impl Clone for BindingEntry

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for BindingEntry

Source§

impl Debug for BindingEntry

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more