prepared_tensor_cache.h#
-
namespace onnx_light
Alias that makes onnx-light headers compatible with code that references
ONNX_LIGHT_NAMESPACE(the macro used in the standard onnx package).Set to
ONNX_LIGHT_NAMESPACEso both names resolve to the same namespace.Symbol-visibility attribute for the public onnx-light C++ API.
Maps the upstream compatibility macro to onnx-light’s explicit proto ABI annotation. This keeps declarations from vendored ONNX headers visible when
lib_onnx_protouses hidden visibility by default.Namespace alias so that ONNX C++ code (and consumers such as onnxruntime) that refers to the literal
onnxnamespace — rather than theONNX_NAMESPACEmacro — resolves to the onnx-light namespace. The standard onnx package lives innamespace onnx; onnx-light usesonnx_light(via ONNX_LIGHT_NAMESPACE), so this alias keeps onnx-light a true drop-in. It is only introduced when the onnx-light namespace differs fromonnx.-
namespace core
-
namespace runtime
Typedefs
Enums
-
class PreparedTensorCache#
- #include <prepared_tensor_cache.h>
Loads compatible prepared tensors before their portable source and persists misses.
Public Functions
-
PreparedTensorCache() = default#
-
~PreparedTensorCache()#
-
PreparedTensorCache(const PreparedTensorCache&) = delete#
-
PreparedTensorCache &operator=(const PreparedTensorCache&) = delete#
-
PreparedTensorLoadResult LoadOrPrepare(const std::filesystem::path &cache_path, const PreparedTensorMetadata &required_metadata, const PreparedSourceLoader &load_source, const PreparedTensorPrepacker &prepack, const PreparedTensorPublisher &publish)#
Publishes a compatible cached payload or prepares the portable source on a miss.
Cache persistence starts only after the complete prepared value is published.
-
void WaitForBackgroundWrites()#
Waits for all pending atomic cache writes.
Private Functions
-
void PersistInBackground(std::filesystem::path cache_path, PreparedTensorMetadata metadata, std::vector<uint8_t> payload)#
-
void WriterLoop()#
Private Members
-
std::deque<PersistenceRequest> pending_#
-
size_t pending_writes_ = 0#
-
bool stop_writer_ = false#
-
struct PersistenceRequest#
-
PreparedTensorCache() = default#
-
struct PreparedTensorLoadResult#
- #include <prepared_tensor_cache.h>
Public Members
-
bool cache_hit = false#
-
PreparedCacheMissReason miss_reason = PreparedCacheMissReason::kNone#
-
bool cache_hit = false#
-
struct PreparedTensorMetadata#
- #include <prepared_tensor_cache.h>
-
class PreparedTensorCache#
-
namespace runtime
-
namespace core