define_extension_runtime!() { /* proc-macro */ }Expand description
Generate a standard extension module, preparation engine, and prepared operation.
Exactly one execution route must be supplied.
execute_readsruns the operation inside the runtime-formed context and has this signature:fn<B: Engine + ?Sized>(&OpType, &[TensorRead<'_>], &mut ExtensionExecutionContext<'_, B>). The generated owner entry opens the backend session and the context borrows it (Bisdyn Engine), so the callback never runs on the owner. Prefer the session route below for new extensions.- the session route (
execute_in_session+session_supported) is the preferred one:session_supportedhas signaturefn<B: BackendBound + 'static>(&OpType) -> boolandexecute_in_sessionhas signaturefn(&OpType, &mut dyn Engine, &mut ExtensionCacheStore, &[TensorRead<'_>]). With it, the generated owner entry forms the session itself and hands the extension only a session, so no operation ever runs on the owner.
The removed legacy execute argument is rejected, not silently ignored.