diff --git a/csharp/src/Microsoft.ML.OnnxRuntime/Microsoft.ML.OnnxRuntime.props b/csharp/src/Microsoft.ML.OnnxRuntime/Microsoft.ML.OnnxRuntime.props index 8dfc422200..de3051971d 100644 --- a/csharp/src/Microsoft.ML.OnnxRuntime/Microsoft.ML.OnnxRuntime.props +++ b/csharp/src/Microsoft.ML.OnnxRuntime/Microsoft.ML.OnnxRuntime.props @@ -11,7 +11,8 @@ false + Condition="'$(PlatformTarget)' == 'x64' AND + Exists('$(MSBuildThisFileDirectory)..\..\runtimes\win-x64\native\mkldnn.dll')"> mkldnn.dll PreserveNewest false diff --git a/csharp/src/Microsoft.ML.OnnxRuntime/SessionOptions.cs b/csharp/src/Microsoft.ML.OnnxRuntime/SessionOptions.cs index c37980261b..df7d12ec5e 100644 --- a/csharp/src/Microsoft.ML.OnnxRuntime/SessionOptions.cs +++ b/csharp/src/Microsoft.ML.OnnxRuntime/SessionOptions.cs @@ -24,7 +24,7 @@ namespace Microsoft.ML.OnnxRuntime public class SessionOptions:IDisposable { public IntPtr _nativePtr; - protected static readonly Lazy _default = new Lazy(MakeSessionOptionWithMklDnnProvider); + protected static readonly Lazy _default = new Lazy(MakeSessionOptionWithCpuProvider); private static string[] cudaDelayLoadedLibs = { "cublas64_100.dll", "cudnn64_7.dll" }; /// @@ -46,10 +46,9 @@ namespace Microsoft.ML.OnnxRuntime } } - private static SessionOptions MakeSessionOptionWithMklDnnProvider() + private static SessionOptions MakeSessionOptionWithCpuProvider() { SessionOptions options = new SessionOptions(); - NativeMethods.OrtSessionOptionsAppendExecutionProvider_Mkldnn(options._nativePtr, 1); NativeMethods.OrtSessionOptionsAppendExecutionProvider_CPU(options._nativePtr, 1); return options; } @@ -73,7 +72,6 @@ namespace Microsoft.ML.OnnxRuntime CheckCudaExecutionProviderDLLs(); SessionOptions options = new SessionOptions(); NativeMethods.OrtSessionOptionsAppendExecutionProvider_CUDA(options._nativePtr, deviceId); - NativeMethods.OrtSessionOptionsAppendExecutionProvider_Mkldnn(options._nativePtr, 1); NativeMethods.OrtSessionOptionsAppendExecutionProvider_CPU(options._nativePtr, 1); return options; }