Class anira::EngineLoadInfo#
-
class EngineLoadInfo#
Collaboration diagram for anira::EngineLoadInfo:
![digraph {
graph [bgcolor="#00000000"]
node [shape=rectangle style=filled fillcolor="#FFFFFF" font=Helvetica padding=2]
edge [color="#1414CE"]
"1" [label="anira::EngineLoadInfo" tooltip="anira::EngineLoadInfo" fillcolor="#BFBFBF"]
"2" [label="anira_engine_load_info" tooltip="anira_engine_load_info"]
"4" [label="anira_memory_handle" tooltip="anira_memory_handle"]
"5" [label="anira_sync_token" tooltip="anira_sync_token"]
"3" [label="anira_tensor" tooltip="anira_tensor"]
"1" -> "2" [dir=forward tooltip="usage"]
"2" -> "3" [dir=forward tooltip="usage"]
"3" -> "4" [dir=forward tooltip="usage"]
"3" -> "5" [dir=forward tooltip="usage"]
}](../../_images/graphviz-4f4adaf6e0186f136ca3529a7f981bc1ac6f8f18.png)
The record an Engine’s load receives, anira_engine_load_info of anira/abi/engine.h as views. Valid for the duration of load: the spans and the model die with the call, so an engine copies what it keeps (the templates, the names, what it loads from the row’s path or bytes).
Public Functions
-
inline explicit EngineLoadInfo(const anira_engine_load_info *info) noexcept#
-
inline uint32_t row() const noexcept#
This engine’s entry in the variant’s model list: the row whose path or bytes the engine loads (model_path(row()), model_bytes(row())).
-
inline const anira_model_config *model() const noexcept#
The variant, anira’s own copy of the model configuration: read through the config getters of anira/abi/config.h during the call, never kept.
-
inline uint32_t model_count() const noexcept#
anira_model_config_model_count: the entries of the variant.
-
inline EngineRef model_engine(uint32_t index) const noexcept#
anira_model_config_model_engine: an entry’s engine as the pair, ANIRA_ENGINE_CUSTOM with the id for a custom entry (the row’s is the id this engine was registered under); {ANIRA_ENGINE_NONE, empty} for an index out of range. Valid for the duration of the call.
-
inline std::string_view model_path(uint32_t index) const noexcept#
anira_model_config_model_path: an entry’s file, which anira never opens for a registered engine’s row; empty for a bytes entry or an index out of range. Valid for the duration of the call.
-
inline std::span<const std::byte> model_bytes(uint32_t index) const noexcept#
anira_model_config_model_bytes: an entry’s bytes, valid for the duration of the call; empty for a path entry or an index out of range.
-
inline std::span<const Tensor> inputs() const noexcept#
One template per slot of the model’s input list, State tensors included: the ENGINE side of the slot, 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 EngineContext::inputs will carry, minus the data. A Tensor is an anira_tensor with names on it (one size, standard layout), so the C array reads as one of Tensor.
-
inline std::span<const char*const> input_names() const noexcept#
The name each input slot binds to, in slot order: the entry’s tensors record where it names the slot, else the canonical name. An engine whose side has names binds by these, and refuses load for a name its side does not have.
-
inline std::span<const char*const> output_names() const noexcept#
The output twin.
-
inline uint32_t instances() const noexcept#
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 (EngineContext::instance), the model’s max_instances for a stateless model; 0 for a model declared stateful or with a declared State pair, whose handlers are exclusive (PrepareInfo::exclusive at their prepare) and run on what their Prepared builds, never on a shared slot.
-
inline ProviderRef provider() const noexcept#
The provider this load is for, as the pair: a provider of the enum, or ANIRA_PROVIDER_CUSTOM with the custom provider’s name in the engine’s own vocabulary (an entry of providers()). A provider is part of the loaded model: two providers of one model are two loads, each its own Loaded. What a load cannot serve it refuses with ANIRA_ERROR_NOT_SUPPORTED (the handler checked the plan’s provider against providers() at create; a device missing at run time is the load’s to report). Valid for the duration of the call.
-
inline std::span<const char*const> option_keys() const noexcept#
The provider options of this backend: the set of the context config’s “provider_options” extension for the engine on this provider (ext::ProviderOptions), as two parallel spans of the keys and the values in the engine’s own vocabulary. Handed to an Engine whose consumed_kinds() lists “context:provider_options” and empty otherwise (a set for an Engine that does not list it is refused at anira_handler_create, naming the backend). The options are part of the loaded model: two contexts with different options for one backend load twice. Valid for the duration of the call.
-
inline std::span<const char*const> option_values() const noexcept#
The values, one per key.
-
inline const anira_engine_load_info *native() const noexcept#
-
inline explicit EngineLoadInfo(const anira_engine_load_info *info) noexcept#