onnxruntime/onnxruntime/core/framework/mem_buffer.h
Pranav Sharma 52fe574fed
Rename OrtAllocatorInfo to OrtMemoryInfo to make it more obvious. (#1758)
* Mention OrtCreateSessionFromArray in C API doc

* Rename OrtAllocatorInfo to OrtMemoryInfo to avoid confusion
2019-09-05 14:20:37 -07:00

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