Исходный код СУБД RuDB — свободной СУБД с открытым исходным кодом на базе PostgreSQL
rudb
2 days ago bd039d1e92813358c5c5a1e346b49074baf513f2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// 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