From c5de493a8a6a62d07f7ec32cebe784765826ede4 Mon Sep 17 00:00:00 2001 From: Scott McKay Date: Thu, 21 Apr 2022 07:01:46 +1000 Subject: [PATCH] Exclude EPs that aren't available on mobile to try and fix Xamarin build error on M1. (#11267) --- csharp/src/Microsoft.ML.OnnxRuntime/NativeMethods.shared.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/csharp/src/Microsoft.ML.OnnxRuntime/NativeMethods.shared.cs b/csharp/src/Microsoft.ML.OnnxRuntime/NativeMethods.shared.cs index 5747cf9114..0b7f425ba5 100644 --- a/csharp/src/Microsoft.ML.OnnxRuntime/NativeMethods.shared.cs +++ b/csharp/src/Microsoft.ML.OnnxRuntime/NativeMethods.shared.cs @@ -821,7 +821,9 @@ namespace Microsoft.ML.OnnxRuntime // CoreML is available on iOS and macOS so we can't exclude based on __MOBILE__ && __IOS__ [DllImport(NativeLib.DllName, CharSet = CharSet.Ansi)] public static extern IntPtr /*(OrtStatus*)*/ OrtSessionOptionsAppendExecutionProvider_CoreML(IntPtr /*(OrtSessionOptions*)*/ options, uint coreml_flags); +#endif +#if !__MOBILE__ // on non-mobile platforms any of these EPs are possible [DllImport(NativeLib.DllName, CharSet = CharSet.Ansi)] public static extern IntPtr /*(OrtStatus*)*/ OrtSessionOptionsAppendExecutionProvider_Dnnl(IntPtr /*(OrtSessionOptions*) */ options, int use_arena); @@ -1659,4 +1661,4 @@ namespace Microsoft.ML.OnnxRuntime return System.Text.Encoding.UTF8.GetBytes(str + Char.MinValue); } } //class NativeMethods -} //namespace \ No newline at end of file +} //namespace