mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-06-01 23:30:35 +00:00
* Mention OrtCreateSessionFromArray in C API doc * Rename OrtAllocatorInfo to OrtMemoryInfo to avoid confusion
25 lines
669 B
C++
25 lines
669 B
C++
// Copyright (c) Microsoft Corporation. All rights reserved.
|
|
// Licensed under the MIT License.
|
|
|
|
#pragma once
|
|
#include "core/common/common.h"
|
|
|
|
namespace onnxruntime {
|
|
/**
|
|
* A simple POD for using with tensor deserialization
|
|
*/
|
|
class MemBuffer {
|
|
public:
|
|
MemBuffer(void* buffer, size_t len, const OrtMemoryInfo& alloc_info)
|
|
: buffer_(buffer), len_(len), alloc_info_(alloc_info) {}
|
|
void* GetBuffer() const { return buffer_; }
|
|
|
|
size_t GetLen() const { return len_; }
|
|
const OrtMemoryInfo& GetAllocInfo() const { return alloc_info_; }
|
|
|
|
private:
|
|
void* const buffer_;
|
|
const size_t len_;
|
|
const OrtMemoryInfo& alloc_info_;
|
|
};
|
|
}; // namespace onnxruntime
|