Struct anira_engine_ctx#

struct anira_engine_ctx#

Collaboration diagram for anira_engine_ctx:

digraph {
    graph [bgcolor="#00000000"]
    node [shape=rectangle style=filled fillcolor="#FFFFFF" font=Helvetica padding=2]
    edge [color="#1414CE"]
    "1" [label="anira_engine_ctx" tooltip="anira_engine_ctx" fillcolor="#BFBFBF"]
    "3" [label="anira_memory_handle" tooltip="anira_memory_handle"]
    "4" [label="anira_sync_token" tooltip="anira_sync_token"]
    "2" [label="anira_tensor" tooltip="anira_tensor"]
    "1" -> "2" [dir=forward tooltip="usage"]
    "2" -> "3" [dir=forward tooltip="usage"]
    "2" -> "4" [dir=forward tooltip="usage"]
}

What a process or reset call of an engine sees. Tier 1: 64 bytes, frozen, identical on every target; no struct_size. anira fills one on its own stack per call, like anira_processor_ctx: the record and the arrays it names are valid until the callback returns. The tensors are in the record, one descriptor per slot of either side in slot order (the tensor’s position in the model config’s list of its side, State tensors included): the engine reads every extent and every memory handle from them on every call, the engine rule of the file comment. The loaded model the call runs on is in the record too (loaded, what load handed back); the handler’s prepared pointer travels beside the record, as the processor’s does. The per-call facts grow through the reserved slots, never through a second typedef.

Public Members

uint32_t instance#

The shared slot of the loaded model this call runs on, 0 .. anira_engine_load_info.instances - 1; never two calls at once on one instance. 0 under ANIRA_ENGINE_CALL_EXCLUSIVE, where no slot was claimed.

uint32_t entry#

The chunk’s position in the handler’s chunk pool (anira_processor_ctx.entry of the same chunk).

uint32_t num_inputs#

The length of inputs: the model’s input list, State tensors included.

uint32_t num_outputs#

The length of outputs: the model’s output list, State tensors included.

uint32_t ticket#

ANIRA_TICKET_INVALID under a Hard contract; the job’s anira_ticket under an Async one.

uint32_t flags#

Per-call flags: ANIRA_ENGINE_CALL_EXCLUSIVE for a call of an exclusive handler (it runs on what that handler’s prepare built, no shared slot was claimed, instance is 0); no other bit is defined in this pre-release (the warm-up pass’s calls at prepare are ordinary calls).

uint32_t reserved0#

0.

uint32_t reserved1#

0.

const anira_tensor *inputs#

num_inputs descriptors in slot order, State inputs included, over the memory the engine reads: the spec’s dtype and the engine-side extents of the load record’s templates, with the data.

anira_tensor *outputs#

num_outputs descriptors in slot order, over the memory the engine writes.

void *loaded#

What this loaded model’s load handed back (the out_loaded of anira_engine_load_fn); NULL for an engine without a load slot.

void *reserved_ptr1#

NULL.