Struct anira_engine_load_info#

struct anira_engine_load_info#

Collaboration diagram for anira_engine_load_info:

digraph {
    graph [bgcolor="#00000000"]
    node [shape=rectangle style=filled fillcolor="#FFFFFF" font=Helvetica padding=2]
    edge [color="#1414CE"]
    "1" [label="anira_engine_load_info" tooltip="anira_engine_load_info" 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 anira_engine_load_fn receives: the model to load and the tensors the engine will be handed. Tier 2, struct_size first, no implicit padding (LP64 96 bytes, ILP32 64); anira fills it, so it carries no struct_id. Valid for the duration of the call: the engine copies what it keeps and never keeps the pointers.

Public Members

uint32_t struct_size#

sizeof(anira_engine_load_info) of the library.

uint32_t row#

This engine’s entry in the variant’s models[] list: the row whose path or bytes the engine loads (anira_model_config_model_path, anira_model_config_model_bytes).

const anira_model_config *model#

The variant, anira’s own copy: read through the config getters during the call, never kept.

const anira_tensor *inputs#

num_inputs templates in slot order, State tensors included: the ENGINE side of every input, the spec’s dtype and the extents in the engine’s order (the entry’s layout applied) at the pinned window, all-zero strides, ANIRA_DOMAIN_HOST, no memory (never dereferenced). What process will be handed, minus the data.

const anira_tensor *outputs#

num_outputs templates, likewise.

const char *const *input_names#

num_inputs strings: the name each input slot binds to, the entry’s tensors record where it names the slot, else the canonical name.

const char *const *output_names#

num_outputs strings, likewise.

uint32_t num_inputs#

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

uint32_t num_outputs#

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

uint32_t instances#

The shared call slots of this loaded model: the process calls that may run at once on them, each on its own instance below this count (anira_engine_ctx.instance), the model’s max_instances for a stateless model (ANIRA_INSTANCES_AUTO resolved to the inference pool’s thread count, at least 1), at most the pool’s thread count; 0 for a model declared ANIRA_MODEL_STATEFUL or with a declared State pair, whose handlers are exclusive and run on what their prepare builds (ANIRA_PREPARE_EXCLUSIVE), never on a shared slot.

uint32_t provider#

anira_provider: the provider this load is for, ANIRA_PROVIDER_CUSTOM beside a provider_id. A provider is part of the loaded model: two providers of one model load twice; a load that cannot serve the one it is asked for returns ANIRA_ERROR_NOT_SUPPORTED.

const char *provider_id#

NULL for a provider the enum names; the name of a custom provider in the engine’s vocabulary (provider ANIRA_PROVIDER_CUSTOM; an entry of the descriptor’s providers list), valid until the callback returns.

const char *const *option_keys#

num_options option names: the provider options of this backend, the set of the context config’s “provider_options” extension for the engine on this provider, handed to an engine whose descriptor lists “context:provider_options” (a set for an engine that does not list it is refused at anira_handler_create); NULL with a count of 0 for none. A tail field: the options are part of the loaded model, two contexts with different options for one backend load twice.

const char *const *option_values#

num_options option values, one per key, NUL-terminated.

uint32_t num_options#

The number of key/value pairs.

uint32_t reserved#

0.