|
15 | 15 |
|
16 | 16 | using System; |
17 | 17 | using System.Runtime.InteropServices; |
| 18 | +using static Microsoft.ML.OnnxRuntime.NativeMethods; |
18 | 19 |
|
19 | 20 | namespace Microsoft.ML.OnnxRuntime |
20 | 21 | { |
@@ -337,6 +338,16 @@ public struct OrtApi |
337 | 338 | public IntPtr CreateLoraAdapterFromArray; |
338 | 339 | public IntPtr ReleaseLoraAdapter; |
339 | 340 | public IntPtr RunOptionsAddActiveLoraAdapter; |
| 341 | + public IntPtr SetEpDynamicOptions; |
| 342 | + public IntPtr ReleaseValueInfo; |
| 343 | + public IntPtr ReleaseNode; |
| 344 | + public IntPtr ReleaseGraph; |
| 345 | + public IntPtr ReleaseModel; |
| 346 | + public IntPtr GetValueInfoName; |
| 347 | + public IntPtr GetValueInfoTypeInfo; |
| 348 | + public IntPtr GetModelEditorApi; |
| 349 | + public IntPtr CreateTensorWithDataAndDeleterAsOrtValue; |
| 350 | + public IntPtr SessionOptionsSetLoadCancellationFlag; |
340 | 351 | } |
341 | 352 |
|
342 | 353 | internal static class NativeMethods |
@@ -416,6 +427,7 @@ static NativeMethods() |
416 | 427 | OrtReleaseSessionOptions = (DOrtReleaseSessionOptions)Marshal.GetDelegateForFunctionPointer(api_.ReleaseSessionOptions, typeof(DOrtReleaseSessionOptions)); |
417 | 428 | OrtCloneSessionOptions = (DOrtCloneSessionOptions)Marshal.GetDelegateForFunctionPointer(api_.CloneSessionOptions, typeof(DOrtCloneSessionOptions)); |
418 | 429 | OrtSetSessionExecutionMode = (DOrtSetSessionExecutionMode)Marshal.GetDelegateForFunctionPointer(api_.SetSessionExecutionMode, typeof(DOrtSetSessionExecutionMode)); |
| 430 | + OrtSessionOptionsSetLoadCancellationFlag = (DOrtSessionOptionsSetLoadCancellationFlag)Marshal.GetDelegateForFunctionPointer(api_.SessionOptionsSetLoadCancellationFlag, typeof(DOrtSessionOptionsSetLoadCancellationFlag)); |
419 | 431 | OrtSetOptimizedModelFilePath = (DOrtSetOptimizedModelFilePath)Marshal.GetDelegateForFunctionPointer(api_.SetOptimizedModelFilePath, typeof(DOrtSetOptimizedModelFilePath)); |
420 | 432 | OrtEnableProfiling = (DOrtEnableProfiling)Marshal.GetDelegateForFunctionPointer(api_.EnableProfiling, typeof(DOrtEnableProfiling)); |
421 | 433 | OrtDisableProfiling = (DOrtDisableProfiling)Marshal.GetDelegateForFunctionPointer(api_.DisableProfiling, typeof(DOrtDisableProfiling)); |
@@ -859,7 +871,7 @@ internal class NativeLib |
859 | 871 | /// Creates an instance of OrtSession with provided parameters |
860 | 872 | /// </summary> |
861 | 873 | /// <param name="environment">Native OrtEnv instance</param> |
862 | | - /// <param name="modelData">Byte array correspoonding to the model</param> |
| 874 | + /// <param name="modelData">Byte array corresponding to the model</param> |
863 | 875 | /// <param name="modelSize">Size of the model in bytes</param> |
864 | 876 | /// <param name="sessionOptions">Native SessionOptions instance</param> |
865 | 877 | /// <param name="prepackedWeightsContainer">Native OrtPrepackedWeightsContainer instance</param> |
@@ -1037,6 +1049,12 @@ IntPtr[] outputValues /* An array of output value pointers. Array must be alloca |
1037 | 1049 | ExecutionMode execution_mode); |
1038 | 1050 | public static DOrtSetSessionExecutionMode OrtSetSessionExecutionMode; |
1039 | 1051 |
|
| 1052 | + [UnmanagedFunctionPointer(CallingConvention.Winapi)] |
| 1053 | + public delegate IntPtr /*(OrtStatus*)*/ DOrtSessionOptionsSetLoadCancellationFlag(IntPtr /*(OrtSessionOptions*)*/ options, |
| 1054 | + bool value); |
| 1055 | + public static DOrtSessionOptionsSetLoadCancellationFlag OrtSessionOptionsSetLoadCancellationFlag; |
| 1056 | + |
| 1057 | + |
1040 | 1058 | [UnmanagedFunctionPointer(CallingConvention.Winapi)] |
1041 | 1059 | public delegate IntPtr /*(OrtStatus*)*/ DOrtSetOptimizedModelFilePath(IntPtr /* OrtSessionOptions* */ options, byte[] optimizedModelFilepath); |
1042 | 1060 | public static DOrtSetOptimizedModelFilePath OrtSetOptimizedModelFilePath; |
@@ -1270,7 +1288,7 @@ IntPtr[] outputValues /* An array of output value pointers. Array must be alloca |
1270 | 1288 | /// </summary> |
1271 | 1289 | /// <param name="options">Native SessionOptions instance</param> |
1272 | 1290 | /// <param name="name">Name of the initializer</param> |
1273 | | - /// <param name="ortValue">Native OrtValue instnce</param> |
| 1291 | + /// <param name="ortValue">Native OrtValue instance</param> |
1274 | 1292 | [UnmanagedFunctionPointer(CallingConvention.Winapi)] |
1275 | 1293 | public delegate IntPtr /*(OrtStatus*)*/ DOrtAddInitializer(IntPtr /*(OrtSessionOptions*)*/ options, |
1276 | 1294 | byte[] /*(const char*)*/ name, |
|
0 commit comments