mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-07-29 20:14:01 +00:00
remove AllocatorMgr class (#16509)
### Description Remove AllocatorManager class ### Motivation and Context After the refactor PR #15833 is in, AllocatorManager class is not referenced anymore.
This commit is contained in:
parent
ff0894e540
commit
0c5f492493
47 changed files with 13 additions and 129 deletions
|
|
@ -22,8 +22,8 @@ set(onnxruntime_common_src_patterns
|
|||
"${ONNXRUNTIME_ROOT}/core/platform/telemetry.cc"
|
||||
"${ONNXRUNTIME_ROOT}/core/platform/logging/make_platform_default_log_sink.h"
|
||||
"${ONNXRUNTIME_ROOT}/core/platform/logging/make_platform_default_log_sink.cc"
|
||||
"$(ONNXRUNTIME_ROOT}/core/quantization/*.h"
|
||||
"$(ONNXRUNTIME_ROOT}/core/quantization/*.cc"
|
||||
"${ONNXRUNTIME_ROOT}/core/quantization/*.h"
|
||||
"${ONNXRUNTIME_ROOT}/core/quantization/*.cc"
|
||||
)
|
||||
|
||||
if(WIN32)
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ class Node;
|
|||
|
||||
#include "core/common/basic_types.h"
|
||||
#include "core/common/profiler_common.h"
|
||||
#include "core/framework/allocatormgr.h"
|
||||
#include "core/framework/allocator_utils.h"
|
||||
#include "core/framework/func_api.h"
|
||||
#include "core/framework/provider_options.h"
|
||||
#include "core/framework/framework_provider_common.h"
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@
|
|||
|
||||
#include "core/common/safeint.h"
|
||||
#include "core/framework/allocator.h"
|
||||
#include "core/framework/allocatormgr.h"
|
||||
#include "core/mlas/inc/mlas.h"
|
||||
#include "core/framework/utils.h"
|
||||
#include "core/session/ort_apis.h"
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
#include "core/framework/allocatormgr.h"
|
||||
#include "core/framework/allocator_utils.h"
|
||||
|
||||
#include <limits>
|
||||
#include <mutex>
|
||||
|
|
@ -15,19 +15,6 @@
|
|||
namespace onnxruntime {
|
||||
using namespace common;
|
||||
|
||||
namespace {
|
||||
int32_t MakeKey(OrtMemType mem_type, OrtDevice device) {
|
||||
// shorten device id so we can fit everything
|
||||
uint8_t short_device = narrow<uint8_t>(device.Id());
|
||||
// and convert mem_type. OrtMemType weirdly uses -2 as the first value so we offset by that before narrowing
|
||||
uint8_t ort_mem_type = narrow<uint8_t>(mem_type + 2);
|
||||
|
||||
// NOTE: OrtMemType is the type of memory for a kernel's input/output
|
||||
// OrtDevice.MemType is the device memory type.
|
||||
return int32_t(device.Type()) << 24 | int32_t(device.MemType()) << 16 | short_device << 8 | ort_mem_type;
|
||||
}
|
||||
} // namespace
|
||||
|
||||
AllocatorPtr CreateAllocator(const AllocatorCreationInfo& info) {
|
||||
auto device_allocator = info.device_alloc_factory(info.device_id);
|
||||
|
||||
|
|
@ -88,30 +75,4 @@ AllocatorPtr CreateAllocator(const AllocatorCreationInfo& info) {
|
|||
}
|
||||
}
|
||||
|
||||
// Update allocator in the provider if already present; ignore if not.
|
||||
void AllocatorManager::ReplaceAllocator(AllocatorPtr allocator) {
|
||||
const auto& info = allocator->Info();
|
||||
auto iter = allocators_.find(MakeKey(info.mem_type, info.device));
|
||||
if (iter != allocators_.end()) {
|
||||
iter->second = allocator;
|
||||
}
|
||||
}
|
||||
|
||||
void AllocatorManager::InsertAllocator(AllocatorPtr allocator) {
|
||||
const OrtMemoryInfo& info = allocator->Info();
|
||||
int32_t key = MakeKey(info.mem_type, info.device);
|
||||
auto iter = allocators_.find(key);
|
||||
if (iter != allocators_.end()) {
|
||||
ORT_THROW("Duplicate allocator for OrtMemType:", info.mem_type, " device:", info.device.ToString(),
|
||||
" Existing allocator: ", iter->second->Info().name,
|
||||
" New allocator: ", allocator->Info().name);
|
||||
}
|
||||
|
||||
allocators_[key] = allocator;
|
||||
}
|
||||
|
||||
AllocatorPtr AllocatorManager::GetAllocator(OrtMemType mem_type, OrtDevice device) const {
|
||||
auto iter = allocators_.find(MakeKey(mem_type, device));
|
||||
return iter != allocators_.end() ? iter->second : nullptr;
|
||||
}
|
||||
} // namespace onnxruntime
|
||||
|
|
@ -42,23 +42,4 @@ struct AllocatorCreationInfo {
|
|||
// Valid values can be found in onnxruntime_c_api.h.
|
||||
AllocatorPtr CreateAllocator(const AllocatorCreationInfo& info);
|
||||
|
||||
// Used for sharing allocators across EPs. e.g. CUDA with TensorRT, CPU with XNNPACK
|
||||
// NOTE: This isn't managing the lifetime of the allocators (they're all in shared_ptr instances anyway).
|
||||
// It really just provides a way to collect and pass around allocators between the calls to
|
||||
// IExecutionProvider::RegisterAllocator for each registered EP. Once those calls complete it is no longer needed.
|
||||
class AllocatorManager {
|
||||
//
|
||||
public:
|
||||
AllocatorManager() = default;
|
||||
void InsertAllocator(AllocatorPtr allocator);
|
||||
void ReplaceAllocator(AllocatorPtr allocator);
|
||||
// Get an allocator for the device. Return nullptr if it doesn't exist
|
||||
AllocatorPtr GetAllocator(OrtMemType mem_type, OrtDevice device) const;
|
||||
|
||||
private:
|
||||
// key from OrtMemType+OrtDevice mapped to AllocatorPtr
|
||||
using AllocatorMap = std::unordered_map<int32_t, AllocatorPtr>;
|
||||
AllocatorMap allocators_;
|
||||
};
|
||||
|
||||
} // namespace onnxruntime
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
// Licensed under the MIT License.
|
||||
|
||||
#include "core/framework/prepacked_weights_container.h"
|
||||
#include "core/framework/allocatormgr.h"
|
||||
#include "core/framework/allocator_utils.h"
|
||||
|
||||
namespace onnxruntime {
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@
|
|||
|
||||
#include <utility>
|
||||
#include "core/common/safeint.h"
|
||||
#include "core/framework/allocatormgr.h"
|
||||
#include "core/framework/data_types.h"
|
||||
#include "core/framework/ort_value.h"
|
||||
#include "core/framework/utils.h"
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include "core/framework/allocatormgr.h"
|
||||
#include "core/framework/execution_provider.h"
|
||||
#include "core/graph/constants.h"
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include "core/framework/allocatormgr.h"
|
||||
#include "core/framework/execution_provider.h"
|
||||
#include "core/graph/constants.h"
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@
|
|||
#include "core/providers/shared_library/provider_api.h"
|
||||
#include "core/providers/cann/cann_call.h"
|
||||
#include "core/providers/cann/cann_allocator.h"
|
||||
#include "core/framework/allocatormgr.h"
|
||||
#include "core/providers/cann/npu_data_transfer.h"
|
||||
|
||||
namespace onnxruntime {
|
||||
|
|
|
|||
|
|
@ -10,7 +10,6 @@
|
|||
#include <unordered_map>
|
||||
|
||||
#include "core/providers/shared_library/provider_api.h"
|
||||
#include "core/framework/allocatormgr.h"
|
||||
#include "core/framework/arena_extend_strategy.h"
|
||||
#include "core/framework/execution_provider.h"
|
||||
#include "core/platform/ort_mutex.h"
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@
|
|||
|
||||
#include "core/providers/coreml/coreml_execution_provider.h"
|
||||
|
||||
#include "core/framework/allocatormgr.h"
|
||||
#include "core/framework/compute_capability.h"
|
||||
#include "core/graph/graph_viewer.h"
|
||||
#include "core/providers/partitioning_utils.h"
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include "core/framework/allocatormgr.h"
|
||||
#include "core/framework/execution_provider.h"
|
||||
#include "core/graph/constants.h"
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@
|
|||
|
||||
#include "cuda_allocator.h"
|
||||
#include "cuda_common.h"
|
||||
#include "core/framework/allocatormgr.h"
|
||||
#include "gpu_data_transfer.h"
|
||||
|
||||
namespace onnxruntime {
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@
|
|||
#include <set>
|
||||
#include <vector>
|
||||
|
||||
#include "core/framework/allocatormgr.h"
|
||||
#include "core/framework/arena_extend_strategy.h"
|
||||
#include "core/framework/execution_provider.h"
|
||||
#include "core/platform/ort_mutex.h"
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@
|
|||
#pragma once
|
||||
// Lotus framework headers for onnxruntime::IExecutionProvider (not part of the operator ABI).
|
||||
#include "core/common/logging/logging.h"
|
||||
#include "core/framework/allocatormgr.h"
|
||||
#include "core/framework/execution_provider.h"
|
||||
#include "core/framework/op_kernel.h"
|
||||
#include "core/optimizer/graph_transformer.h"
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include "core/framework/allocatormgr.h"
|
||||
#include "core/framework/execution_provider.h"
|
||||
#include "core/graph/constants.h"
|
||||
#include "core/providers/providers.h"
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@
|
|||
#include "core/common/status.h"
|
||||
#include "core/framework/float16.h"
|
||||
#include "core/common/status.h"
|
||||
#include "core/framework/allocatormgr.h"
|
||||
#include "gpu_data_transfer.h"
|
||||
|
||||
namespace onnxruntime {
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include "core/framework/allocatormgr.h"
|
||||
#include "core/framework/arena_extend_strategy.h"
|
||||
#include "core/framework/execution_provider.h"
|
||||
#include "core/platform/ort_mutex.h"
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@
|
|||
|
||||
#pragma once
|
||||
#include "core/session/onnxruntime_cxx_api.h"
|
||||
#include "core/framework/allocatormgr.h"
|
||||
#include "core/framework/execution_provider.h"
|
||||
|
||||
namespace onnxruntime {
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@
|
|||
#include "core/common/common.h"
|
||||
#include "core/common/logging/logging.h"
|
||||
#include "core/common/string_utils.h"
|
||||
#include "core/framework/allocatormgr.h"
|
||||
#include "core/framework/compute_capability.h"
|
||||
#include "core/graph/graph_viewer.h"
|
||||
#include "core/platform/env.h"
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@
|
|||
#include <functional>
|
||||
#include "rknpu_execution_provider.h"
|
||||
#include "core/common/logging/logging.h"
|
||||
#include "core/framework/allocatormgr.h"
|
||||
#include "core/framework/compute_capability.h"
|
||||
#include "core/session/onnxruntime_cxx_api.h"
|
||||
#include "core/session/inference_session.h"
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@
|
|||
|
||||
#include "rocm_allocator.h"
|
||||
#include "rocm_common.h"
|
||||
#include "core/framework/allocatormgr.h"
|
||||
#include "gpu_data_transfer.h"
|
||||
|
||||
namespace onnxruntime {
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@
|
|||
#include <set>
|
||||
#include <vector>
|
||||
|
||||
#include "core/framework/allocatormgr.h"
|
||||
#include "core/framework/arena_extend_strategy.h"
|
||||
#include "core/framework/execution_provider.h"
|
||||
#include "core/platform/ort_mutex.h"
|
||||
|
|
|
|||
|
|
@ -22,7 +22,6 @@
|
|||
#include "core/common/type_list.h"
|
||||
#include "core/common/logging/severity.h"
|
||||
#include "core/framework/allocator.h"
|
||||
#include "core/framework/allocatormgr.h"
|
||||
#include "core/framework/float8.h"
|
||||
#include "core/framework/float16.h"
|
||||
#include "core/framework/tensor_shape.h"
|
||||
|
|
|
|||
|
|
@ -116,14 +116,6 @@ AllocatorPtr CreateAllocator(const AllocatorCreationInfo& info) {
|
|||
return g_host->CreateAllocator(info);
|
||||
}
|
||||
|
||||
void AllocatorManager::InsertAllocator(AllocatorPtr allocator) {
|
||||
return g_host->AllocatorManager__InsertAllocator(this, allocator);
|
||||
}
|
||||
|
||||
AllocatorPtr AllocatorManager::GetAllocator(OrtMemType mem_type, OrtDevice device) const {
|
||||
return g_host->AllocatorManager__GetAllocator(this, mem_type, device);
|
||||
}
|
||||
|
||||
template <>
|
||||
MLDataType DataTypeImpl::GetType<Tensor>() { return Provider_GetHost()->DataTypeImpl__GetType_Tensor(); }
|
||||
#if !defined(DISABLE_SPARSE_TENSORS)
|
||||
|
|
|
|||
|
|
@ -914,11 +914,6 @@ struct ProviderHost {
|
|||
virtual void TensorSeq__Add(TensorSeq* p, Tensor&& tensor) = 0;
|
||||
virtual void TensorSeq__Reserve(TensorSeq* p, size_t capacity) = 0;
|
||||
|
||||
// AllocatorManager
|
||||
virtual void AllocatorManager__InsertAllocator(AllocatorManager* p, AllocatorPtr allocator) = 0;
|
||||
virtual AllocatorPtr AllocatorManager__GetAllocator(const AllocatorManager* p,
|
||||
OrtMemType mem_type, OrtDevice device) = 0;
|
||||
|
||||
#if defined(ENABLE_TRAINING) && defined(ORT_USE_NCCL)
|
||||
virtual training::DistributedRunContext& GetDistributedRunContextInstance() = 0;
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@
|
|||
#include <tvm/runtime/device_api.h>
|
||||
|
||||
#include "tvm_allocator.h"
|
||||
#include "core/framework/allocatormgr.h"
|
||||
#include "core/framework/session_state.h"
|
||||
#include "xpu_data_transfer.h"
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@
|
|||
|
||||
#include "webnn_execution_provider.h"
|
||||
|
||||
#include "core/framework/allocatormgr.h"
|
||||
#include "core/framework/compute_capability.h"
|
||||
#include "core/framework/memcpy.h"
|
||||
#include "core/framework/kernel_registry.h"
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include "core/framework/allocatormgr.h"
|
||||
#include "core/framework/execution_provider.h"
|
||||
#include "core/graph/constants.h"
|
||||
#include "core/providers/providers.h"
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
|
||||
#include "xnnpack_init.h"
|
||||
|
||||
#include "core/framework/allocatormgr.h"
|
||||
#include "core/graph/constants.h"
|
||||
|
||||
#include "xnnpack.h"
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
#include "core/session/environment.h"
|
||||
#include "core/session/allocator_adapters.h"
|
||||
#include "core/framework/allocatormgr.h"
|
||||
#include "core/framework/allocator_utils.h"
|
||||
#include "core/graph/constants.h"
|
||||
#include "core/graph/op.h"
|
||||
|
||||
|
|
|
|||
|
|
@ -17,7 +17,6 @@
|
|||
#include "core/common/path_string.h"
|
||||
#include "core/flatbuffers/flatbuffers_utils.h"
|
||||
#include "core/flatbuffers/ort_format_version.h"
|
||||
#include "core/framework/allocatormgr.h"
|
||||
#include "core/framework/bfc_arena.h"
|
||||
#include "core/framework/error_code_helper.h"
|
||||
#include "core/framework/execution_frame.h"
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
// It implements onnxruntime::ProviderHost
|
||||
|
||||
#include "core/common/inlined_containers.h"
|
||||
#include "core/framework/allocatormgr.h"
|
||||
#include "core/framework/allocator_utils.h"
|
||||
#include "core/framework/compute_capability.h"
|
||||
#include "core/framework/data_types.h"
|
||||
#include "core/framework/data_transfer_manager.h"
|
||||
|
|
@ -1057,12 +1057,6 @@ struct ProviderHostImpl : ProviderHost {
|
|||
void TensorSeq__Add(TensorSeq* p, Tensor&& tensor) override { p->Add(std::move(tensor)); }
|
||||
void TensorSeq__Reserve(TensorSeq* p, size_t capacity) override { p->Reserve(capacity); }
|
||||
|
||||
// AllocatorManager (direct)
|
||||
void AllocatorManager__InsertAllocator(AllocatorManager* p, AllocatorPtr allocator) override { p->AllocatorManager::InsertAllocator(allocator); }
|
||||
AllocatorPtr AllocatorManager__GetAllocator(const AllocatorManager* p, OrtMemType mem_type, OrtDevice device) override {
|
||||
return p->AllocatorManager::GetAllocator(mem_type, device);
|
||||
};
|
||||
|
||||
#if defined(ENABLE_TRAINING) && defined(ORT_USE_NCCL)
|
||||
training::DistributedRunContext& GetDistributedRunContextInstance() override { return training::DistributedRunContext::GetInstance(); }
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -12,7 +12,6 @@
|
|||
#include "core/common/logging/logging.h"
|
||||
#include "core/common/logging/sinks/clog_sink.h"
|
||||
#include "core/common/logging/sinks/cerr_sink.h"
|
||||
#include "core/framework/allocatormgr.h"
|
||||
#include "core/session/environment.h"
|
||||
#include "core/framework/ort_value.h"
|
||||
#include "core/session/inference_session.h"
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
// Licensed under the MIT License.
|
||||
|
||||
#include "test/framework/TestAllocatorManager.h"
|
||||
#include "core/framework/allocatormgr.h"
|
||||
|
||||
namespace onnxruntime {
|
||||
namespace test {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
#include "core/framework/allocatormgr.h"
|
||||
#include "core/framework/allocator.h"
|
||||
|
||||
#include "test_utils.h"
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
// Licensed under the MIT License.
|
||||
|
||||
#include "core/framework/bfc_arena.h"
|
||||
#include "core/framework/allocatormgr.h"
|
||||
#include "core/framework/allocator_utils.h"
|
||||
#include "gtest/gtest.h"
|
||||
#include "gmock/gmock.h"
|
||||
#include <cstdlib>
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
#include "core/framework/allocatormgr.h"
|
||||
#include "core/framework/allocator.h"
|
||||
#include "core/optimizer/insert_cast_transformer.h"
|
||||
#include "core/graph/model.h"
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
// Licensed under the MIT License.
|
||||
|
||||
#include "core/framework/tensor.h"
|
||||
#include "core/framework/allocatormgr.h"
|
||||
#include "test_utils.h"
|
||||
|
||||
#include "gmock/gmock.h"
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@
|
|||
#include <map>
|
||||
#include <string>
|
||||
|
||||
#include "core/framework/allocatormgr.h"
|
||||
#include "core/framework/execution_provider.h"
|
||||
#include "core/providers/cpu/cpu_execution_provider.h"
|
||||
#include "core/framework/ort_value.h"
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
#include "core/framework/allocatormgr.h"
|
||||
#include "core/framework/allocator_utils.h"
|
||||
#include "gtest/gtest.h"
|
||||
#include "cuda_runtime.h"
|
||||
#include "core/framework/allocator.h"
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
#include "internal_testing_execution_provider.h"
|
||||
|
||||
#include "core/framework/allocatormgr.h"
|
||||
#include "core/framework/allocator_utils.h"
|
||||
#include "core/framework/compute_capability.h"
|
||||
#include "core/framework/feeds_fetches_manager.h"
|
||||
#include "core/framework/op_kernel_context_internal.h"
|
||||
|
|
|
|||
|
|
@ -108,7 +108,6 @@ void RunWithOneSessionSingleThreadInference(std::string model_name, std::string
|
|||
RunOptions run_options;
|
||||
run_options.run_tag = so.session_logid;
|
||||
InferenceSession session_object{so, GetEnvironment()};
|
||||
onnxruntime::AllocatorManager allocator_manager;
|
||||
auto cuda_provider = DefaultCudaExecutionProvider();
|
||||
auto cpu_allocator = cuda_provider->CreatePreferredAllocators()[1];
|
||||
std::vector<int64_t> dims_mul_x = {1, 3, 2};
|
||||
|
|
@ -191,7 +190,6 @@ void RunWithOneSessionMultiThreadsInference(std::string model_name, std::string
|
|||
RunOptions run_options;
|
||||
run_options.run_tag = so.session_logid;
|
||||
InferenceSession session_object{so, GetEnvironment()};
|
||||
onnxruntime::AllocatorManager allocator_manager;
|
||||
auto cuda_provider = DefaultCudaExecutionProvider();
|
||||
auto cpu_allocator = cuda_provider->CreatePreferredAllocators()[1];
|
||||
std::vector<int64_t> dims_mul_x = {1, 3, 2};
|
||||
|
|
@ -348,7 +346,6 @@ TEST(TensorrtExecutionProviderTest, TRTPluginsCustomOpTest) {
|
|||
RunOptions run_options;
|
||||
run_options.run_tag = so.session_logid;
|
||||
InferenceSession session_object{so, GetEnvironment()};
|
||||
onnxruntime::AllocatorManager allocator_manager;
|
||||
auto cuda_provider = DefaultCudaExecutionProvider();
|
||||
auto cpu_allocator = cuda_provider->CreatePreferredAllocators()[1];
|
||||
std::vector<int64_t> dims_op_x = {12, 256, 256};
|
||||
|
|
@ -439,7 +436,6 @@ TEST_P(TensorrtExecutionProviderCacheTest, Run) {
|
|||
RunOptions run_options;
|
||||
run_options.run_tag = so.session_logid;
|
||||
InferenceSession session_object{so, GetEnvironment()};
|
||||
onnxruntime::AllocatorManager allocator_manager;
|
||||
auto cuda_provider = DefaultCudaExecutionProvider();
|
||||
auto cpu_allocator = cuda_provider->CreatePreferredAllocators()[1];
|
||||
std::vector<int64_t> dims_mul_x = {1, 3, 2};
|
||||
|
|
@ -782,7 +778,6 @@ TEST(TensorrtExecutionProviderTest, FunctionTest) {
|
|||
run_options.run_tag = so.session_logid;
|
||||
InferenceSession session_object{so, GetEnvironment()};
|
||||
|
||||
onnxruntime::AllocatorManager allocator_manager;
|
||||
auto cuda_provider = DefaultCudaExecutionProvider();
|
||||
auto cpu_allocator = cuda_provider->CreatePreferredAllocators()[1];
|
||||
|
||||
|
|
@ -885,7 +880,6 @@ TEST(TensorrtExecutionProviderTest, DISABLED_NodeIndexMappingTest) { // [W:onn
|
|||
run_options.run_tag = so.session_logid;
|
||||
InferenceSession session_object{so, GetEnvironment()};
|
||||
|
||||
onnxruntime::AllocatorManager allocator_manager;
|
||||
auto cuda_provider = DefaultCudaExecutionProvider();
|
||||
auto cpu_allocator = cuda_provider->CreatePreferredAllocators()[1];
|
||||
|
||||
|
|
@ -1005,7 +999,6 @@ TEST(TensorrtExecutionProviderTest, RemoveCycleTest) {
|
|||
run_options.run_tag = so.session_logid;
|
||||
InferenceSession session_object{so, GetEnvironment()};
|
||||
|
||||
onnxruntime::AllocatorManager allocator_manager;
|
||||
auto cuda_provider = DefaultCudaExecutionProvider();
|
||||
auto cpu_allocator = cuda_provider->CreatePreferredAllocators()[1];
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@
|
|||
#include "gtest/gtest.h"
|
||||
|
||||
#include "core/framework/tensor.h"
|
||||
#include "core/framework/allocatormgr.h"
|
||||
#include "core/quantization/quantization.h"
|
||||
#include "test/framework/test_utils.h"
|
||||
|
||||
|
|
|
|||
|
|
@ -27,8 +27,8 @@
|
|||
#endif USE_DML
|
||||
|
||||
#include "core/framework/customregistry.h"
|
||||
#include "core/framework/allocatormgr.h"
|
||||
#include "core/framework/allocator_utils.h"
|
||||
#include "core/session/environment.h"
|
||||
#include "core/session/IOBinding.h"
|
||||
#include "core/common/logging/logging.h"
|
||||
#include "core/common/logging/sinks/clog_sink.h"
|
||||
#include "core/common/logging/sinks/clog_sink.h"
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
#endif
|
||||
|
||||
// LotusRT
|
||||
#include "core/framework/allocatormgr.h"
|
||||
#include "core/framework/allocator_utils.h"
|
||||
#include "core/common/logging/logging.h"
|
||||
#include "core/common/logging/sinks/clog_sink.h"
|
||||
#include "protobufHelpers.h"
|
||||
|
|
|
|||
Loading…
Reference in a new issue