Class anira::v2::PassthroughEngine#
-
class PassthroughEngine : public anira::Engine#
Inheritance diagram for anira::v2::PassthroughEngine:
![digraph {
graph [bgcolor="#00000000"]
node [shape=rectangle style=filled fillcolor="#FFFFFF" font=Helvetica padding=2]
edge [color="#1414CE"]
"2" [label="anira::Engine" tooltip="anira::Engine"]
"1" [label="anira::v2::PassthroughEngine" tooltip="anira::v2::PassthroughEngine" fillcolor="#BFBFBF"]
"1" -> "2" [dir=forward tooltip="public-inheritance"]
}](../../_images/graphviz-2313dc04c443ac570291a6a2927a9d90bcd26379.png)
Collaboration diagram for anira::v2::PassthroughEngine:
![digraph {
graph [bgcolor="#00000000"]
node [shape=rectangle style=filled fillcolor="#FFFFFF" font=Helvetica padding=2]
edge [color="#1414CE"]
"2" [label="anira::Engine" tooltip="anira::Engine"]
"1" [label="anira::v2::PassthroughEngine" tooltip="anira::v2::PassthroughEngine" fillcolor="#BFBFBF"]
"1" -> "2" [dir=forward tooltip="public-inheritance"]
}](../../_images/graphviz-2313dc04c443ac570291a6a2927a9d90bcd26379.png)
The 2.x BackendBase::process as an anira::Engine under k_custom_engine_id: output i a copy of input i when both have the same element count and dtype, zeros otherwise, every output beyond the input count zeros. What a CUSTOM row runs when no engine was passed, and what a host that passed a plain BackendBase passes now. No providers list, so it serves ANIRA_PROVIDER_CPU alone, and a neutral CUSTOM row under the default candidate set is one plan on the CPU path. flags(): ANIRA_ENGINE_FLAG_REALTIME_SAFE | ANIRA_ENGINE_FLAG_NEEDS_NO_MODEL. Three trivial levels: load keeps nothing (the row’s path is never opened), the Loaded hands every handler, exclusive or not, a Prepared that keeps nothing, so a shared and an exclusive call run the same body and a reset has nothing to clear. Its code is the host’s (the header is compiled into it): a handler must be destroyed before the module that holds the code unloads.
Public Functions
-
inline PassthroughEngine()#
-
inline virtual uint32_t flags() const noexcept override#
The engine’s promises, written into anira_engine_desc::flags at registration: an OR of ANIRA_ENGINE_FLAG_NEEDS_NO_MODEL, ANIRA_ENGINE_FLAG_REALTIME_SAFE, ANIRA_ENGINE_FLAG_DYNAMIC_TIME and ANIRA_ENGINE_FLAG_STATE_ALIAS; 0 (the default) promises nothing. A bit anira/abi/enums.h does not define is refused at registration with ANIRA_ERROR_INVALID_ARGUMENT. Read once, when the engine is registered.
-
inline virtual std::unique_ptr<anira::Engine::Loaded> load(const anira::EngineLoadInfo&) override#
Called by anira_handler_prepare on its caller’s thread, once per loaded model anira pools ([main-thread], under the core’s lifecycle lock, so it may allocate, read files and log, but must not call an entry that takes that lock: context create and destroy, handler create, destroy and prepare, anira_inference_thread_create, anira_shutdown, anira_release_core_if_idle): loads the row’s model out of the record, binds the slots by the record’s names and sizes the shared instances the record counts (none for a model whose handlers are exclusive), and returns the Loaded, which anira owns from then on. It may throw: an anira::Error fails the prepare with its status, std::bad_alloc with ANIRA_ERROR_OUT_OF_MEMORY, anything else with ANIRA_ERROR_INTERNAL, and what() goes to the log (group “anira.hpp”), since the C callback has no error record; a null return fails it with ANIRA_ERROR_INTERNAL, since nothing could run the inference. The handler’s prepare then fails with the status, its message naming the engine, and unload is not called.
-
inline PassthroughEngine()#