Enum anira_phase#

enum anira_phase#

The phase a callback of either descriptor runs in: the phases and slots of a processor, the engine call between two of them and the slots of an engine (abi/processor.h, abi/engine.h). The two lifecycles share it, so like their shared records (anira/abi/lifecycle.h) it names no side. The value travels in one field, anira_processor_ctx.phase

, since a processor’s accessors depend on it; an engine receives none, each of its slots being a callback of its own. Every message anira writes about a slot names the phase by the lower-case name of its value (pre_process, post_process, before_inference, inference, after_inference, prepare, release, reset, unprepare, init, load, unload, query): a processor phase that fails or that an accessor refuses, a refused init, load or prepare of a processor or an engine (“the

engine ‘x’ refused load: it returned N”), a failed engine call. Pinned now. The three inference-thread phases are numbered in the order they run; the phases of the shared lifecycle (

anira/abi/lifecycle.h) are appended behind the lifecycle pair: reset and unprepare, then init, then the engine’s two model-level phases, load and unload, then the engine’s query.

Values:

enumerator ANIRA_PHASE_PRE_PROCESS#

Before the model inputs are formed.

enumerator ANIRA_PHASE_POST_PROCESS#

After the model outputs arrive.

enumerator ANIRA_PHASE_BEFORE_INFERENCE#

On the inference thread, before the engine call.

enumerator ANIRA_PHASE_INFERENCE#

On the inference thread, the engine call itself: the built-in engine of the running plan, or a registered custom engine’s process. No processor callback runs in this phase; a failed engine call is logged under its word (“inference failed in session N: the engine

of plan P returned S”).

enumerator ANIRA_PHASE_AFTER_INFERENCE#

On the inference thread, after the engine call.

enumerator ANIRA_PHASE_PREPARE#

At anira_handler_prepare.

enumerator ANIRA_PHASE_RELEASE#

When the last carrier dies.

enumerator ANIRA_PHASE_RESET#

The first chunk of a new stream (after prepare, after anira_handler_reset), before its pre_process, on the thread that runs pre_process: the processor’s reset slot (anira_processor_reset_fn), with that chunk’s context, where the accessors answer the role only.

enumerator ANIRA_PHASE_UNPREPARE#

At the next anira_handler_prepare and at anira_handler_destroy, after the last phase call of the handler: the processor’s unprepare slot (anira_processor_unprepare_fn), and the engine’s (anira_engine_unprepare_fn) for that handler.

enumerator ANIRA_PHASE_INIT#

At the first anira_handler_prepare that reaches a processor’s or an engine’s carrier, once per carrier: the init slot (anira_processor_init_fn, anira_engine_init_fn) with an anira_init_info.

enumerator ANIRA_PHASE_LOAD#

At anira_handler_prepare, under the core’s lifecycle lock, once per loaded model anira pools: an engine’s load slot (anira_engine_load_fn) with an anira_engine_load_info.

enumerator ANIRA_PHASE_UNLOAD#

When the last handler holding a loaded model is re-prepared or destroyed, after every unprepare of it: an engine’s unload slot (anira_engine_unload_fn).

enumerator ANIRA_PHASE_QUERY#

An engine’s query slot (anira_engine_query_fn): which of its declared providers are usable here, now; at anira_handler_create and at anira_pipeline_capabilities_backends / _edge, before the engine’s init and any number of times.

enumerator ANIRA_PHASE_FORCE32#