mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-06-09 00:30:53 +00:00
- 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.
22 lines
554 B
C++
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
|