载入中...
搜索中...
未找到
OnnxStorage.h
浏览该文件的文档.
1#pragma once
2#include <cstdint>
3#include <memory>
4#include <vector>
5#include "common/Result.h"
6namespace eve::tensor {
10public:
12 virtual ~OnnxDeviceStorage() = default;
14 [[nodiscard]] virtual Result<std::vector<uint8_t>> readback() const = 0;
15};
19struct OnnxBuffer {
20 std::shared_ptr<const std::vector<uint8_t>> host;
21 std::shared_ptr<OnnxDeviceStorage> device;
22 size_t size = 0;
23 bool persistent = false; // Immutable model initializer, eligible for bounded cross-run caching.
24};
33} // namespace eve::tensor
Move-only, checked operation results for the common layer.
Move-only operation result carrying either a value or Status.
Definition Result.h:155
Run-scoped device storage. Readback completes pending work on the device thread.
Definition OnnxStorage.h:9
virtual Result< std::vector< uint8_t > > readback() const =0
Return an owning host copy, or an explicit device/lifecycle error.
virtual ~OnnxDeviceStorage()=default
Release owning storage on the device thread.
Immutable buffer shared by graph aliases; exactly one storage is authoritative.
Definition OnnxStorage.h:19
std::shared_ptr< OnnxDeviceStorage > device
Definition OnnxStorage.h:21
std::shared_ptr< const std::vector< uint8_t > > host
Definition OnnxStorage.h:20
Actual transfers and submissions made during one GPU run.
Definition OnnxStorage.h:26