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: BackendSession + ?Sized>(&OpType, &[TensorRead<'_>], &mut ExtensionExecutionContext<'_, B>). The generated owner entry opens the backend session and the context borrows it (Bisdyn BackendSession), 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 BackendSession, &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 legacy execute argument is accepted but unused and may be omitted.