diff --git a/onnxruntime/core/framework/provider_bridge_ort.cc b/onnxruntime/core/framework/provider_bridge_ort.cc index 412b0fb882..4e092225f5 100644 --- a/onnxruntime/core/framework/provider_bridge_ort.cc +++ b/onnxruntime/core/framework/provider_bridge_ort.cc @@ -102,12 +102,7 @@ using IndexedSubGraph_MetaDef = IndexedSubGraph::MetaDef; namespace onnxruntime { -namespace contrib { -void Link_embed_layer_norm_helper(); - -} // namespace contrib - -ProviderHost* g_host{}; +//ProviderHost* g_host{}; ProviderInfo_CUDA* GetProviderInfo_CUDA(); diff --git a/onnxruntime/core/providers/shared_library/provider_bridge_provider.cc b/onnxruntime/core/providers/shared_library/provider_bridge_provider.cc index 5daeb3a60a..33fe3243a3 100644 --- a/onnxruntime/core/providers/shared_library/provider_bridge_provider.cc +++ b/onnxruntime/core/providers/shared_library/provider_bridge_provider.cc @@ -8,13 +8,15 @@ #include #include "core/providers/shared/common.h" +#if 0 namespace onnxruntime { ProviderHost* g_host = Provider_GetHost(); } +#endif // Override default new/delete so that we match the host's allocator void* operator new(size_t n) { - onnxruntime::g_host = Provider_GetHost(); +// onnxruntime::g_host = Provider_GetHost(); return Provider_GetHost()->HeapAllocate(n); } void operator delete(void* p) { return Provider_GetHost()->HeapFree(p); } diff --git a/onnxruntime/core/providers/shared_library/provider_interfaces.h b/onnxruntime/core/providers/shared_library/provider_interfaces.h index 9900605dce..d901db8c91 100644 --- a/onnxruntime/core/providers/shared_library/provider_interfaces.h +++ b/onnxruntime/core/providers/shared_library/provider_interfaces.h @@ -4,6 +4,8 @@ // Public wrappers around internal ort interfaces (currently) // In the future the internal implementations could derive from these to remove the need for the wrapper implementations +#include "core/providers/shared/common.h" + #define PROVIDER_DISALLOW_ALL(TypeName) \ TypeName() = delete; \ TypeName(const TypeName&) = delete; \ @@ -761,7 +763,8 @@ struct ProviderHost { #endif }; -extern ProviderHost* g_host; +#define g_host Provider_GetHost() +//extern ProviderHost* g_host; #ifdef SHARED_PROVIDER diff --git a/onnxruntime/test/providers/cuda/gemm_options_test.cc b/onnxruntime/test/providers/cuda/gemm_options_test.cc index 426b1425e0..2ec64551de 100644 --- a/onnxruntime/test/providers/cuda/gemm_options_test.cc +++ b/onnxruntime/test/providers/cuda/gemm_options_test.cc @@ -1,7 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#ifdef USE_CUDA +#if 0 // TODO: Can't call these directly from external code as Cuda is now a shared library +//#ifdef USE_CUDA #include "gtest/gtest.h" #include "core/providers/cuda/cuda_common.h"