onnxruntime/onnxruntime/test/framework/dummy_allocator.h
Scott McKay 175983c082
Move memory info into IAllocator (#2850)
- Update IAllocator setup to move the OrtMemoryInfo to the base class instead of requiring derived classes to have that as a member and override a virtual method to return it.
  - Cleanup CreateAllocator setup to take an argument as to whether to wrap the device allocator in an arena allocator. The choice to do that isn't a property of the underlying device allocator.
  - Minor cleanups in the various EPs to adjust to the change to IAllocator and CreateAllocator, and to use the create_arena flag consistently when available.
2020-06-22 11:18:52 +10:00

22 lines
554 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;
private:
ORT_DISALLOW_COPY_ASSIGNMENT_AND_MOVE(DummyAllocator);
};
} // namespace test
} // namespace onnxruntime