![]() |
ONNX Runtime
|
ABI-stable tagged union representing a resource cost or budget. More...
#include <onnxruntime_ep_c_api.h>
Public Member Functions | |
| OrtResourceCount () noexcept | |
| uint64_t | AsTotalBytes () const noexcept |
Static Public Member Functions | |
| static OrtResourceCount | None () noexcept |
| static OrtResourceCount | FromTotalBytes (uint64_t bytes) noexcept |
Public Attributes | ||
| uint32_t | kind | |
| uint32_t | reserved | |
| union { | ||
| uint64_t total_bytes | ||
| uint64_t reserved_words [6] | ||
| } | value | |
ABI-stable tagged union representing a resource cost or budget.
This struct is a C-safe variant that can be passed by value across the plugin DLL boundary. The kind field selects which member of the value union is active. The value.reserved_words storage reserves space for future resource types without changing the struct layout.
Adding new resource types requires only: (a) a new OrtResourceCountKind enum value, (b) a new union member. No new C API functions are needed.
|
inlinenoexcept |
Default-construct a None (unset) resource count.
|
inlinenoexcept |
Read the total_bytes value (caller must check kind first).
|
inlinestaticnoexcept |
Construct a resource count representing total bytes.
|
inlinestaticnoexcept |
Construct a zero/unset resource count.
| uint32_t OrtResourceCount::kind |
OrtResourceCountKind discriminator.
| uint32_t OrtResourceCount::reserved |
Must be zero. Ensures natural alignment for the value union.
| uint64_t OrtResourceCount::reserved_words[6] |
48 bytes fixed storage for future resource types.
| uint64_t OrtResourceCount::total_bytes |
Active when kind == OrtResourceCountKind_TotalBytes.
| union { ... } OrtResourceCount::value |