onnxruntime/onnxruntime/test/framework/dummy_allocator.h
Pranav Sharma f8c3442880
Part 2 of renaming AllocatorInfo to MemoryInfo. (#1804)
* Mention OrtCreateSessionFromArray in C API doc

* Part 2 of renaming AllocatorInfo to MemoryInfo.

* pr comments

* fix comment
2019-09-12 08:19:29 -07:00

25 lines
655 B
C++

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#include "core/common/common.h"
#include "core/framework/allocator.h"
namespace onnxruntime {
namespace test {
struct DummyAllocator : IAllocator {
static constexpr const char* kDummyAllocator = "DummyAllocator";
DummyAllocator();
~DummyAllocator() = default;
void* Alloc(size_t size) override;
void Free(void* p) override;
const OrtMemoryInfo& Info() const override { return memory_info_; }
private:
ORT_DISALLOW_COPY_ASSIGNMENT_AND_MOVE(DummyAllocator);
OrtMemoryInfo memory_info_;
};
} // namespace test
} // namespace onnxruntime