Enum anira_edge_class#

enum anira_edge_class#

Where an edge takes a tensor’s bytes (section 7). ANIRA_EDGE_ZERO_COPY to ANIRA_EDGE_DEDICATED_TRANSFER are the cost scale, ordered by cost, so the worst edge of a chain is the largest value and an edge of several moves has the class of its worst. ANIRA_EDGE_UNKNOWN stands outside the scale and above it (the values between are room for classes to come), so a chain or a plan with an unknown edge is unknown and the worst-of-chain maximum still holds. The class covers the bytes from the slot’s memory until the engine computes on them, and back for outputs; layout transforms inside a runtime’s graph are not edges. Who executes the moves is the row’s anira_mover_flags bits, whether the edge exists its available flag (anira_edge_info).

Values:

enumerator ANIRA_EDGE_ZERO_COPY#

Nothing moves: the engine computes on the slot’s own memory, a device on unified memory included where its runtime wraps the slot’s buffer.

enumerator ANIRA_EDGE_COPY#

A copy or pass within one domain, the CPU’s or one device’s, with no hand-over between processors: a memcpy in host memory, a relayout or copy inside a device’s memory.

enumerator ANIRA_EDGE_UNIFIED_TRANSFER#

The bytes cross between the CPU’s domain and a device’s within one unified physical memory (an Apple silicon GPU, an integrated GPU, a CPU device: ANIRA_MEMORY_UNIFIED): a copy plus a hand-over between the processors (a submission, a fence, possibly cache maintenance or a relayout), and no bus.

enumerator ANIRA_EDGE_DEDICATED_TRANSFER#

The bytes cross a bus to or from dedicated memory: a DMA to or from a device’s own memory (a discrete GPU’s VRAM, ANIRA_MEMORY_DEDICATED), a discrete device reading mapped host memory, a copy between two devices.

enumerator ANIRA_EDGE_UNKNOWN#

A crossing whose memory kind no probe could establish (ANIRA_MEMORY_UNKNOWN: the device’s API is missing or failed, the provider maps to no API anira can ask, the adapters a self-choosing runtime picks among disagree), the reason saying “memory kind not probed” and why. Outside the cost scale: every limit of the contract’s edge cost refuses it, and as the limit itself (anira_contract_set_edge_cost) it means no limit, even unknown edges allowed.

enumerator ANIRA_EDGE_CLASS_FORCE32#