コード例 #1
0
 /// <summary>
 /// A helper method to construct a SessionOptions object for Nuphar execution.
 /// Use only if you have the onnxruntime package specific to this Execution Provider.
 /// </summary>
 /// <param name="settings">settings string, comprises of comma separated key:value pairs. default is empty</param>
 /// <returns>A SessionsOptions() object configured for execution with Nuphar</returns>
 public static SessionOptions MakeSessionOptionWithNupharProvider(String settings = "")
 {
     SessionOptions options = new SessionOptions();
     NativeApiStatus.VerifySuccess(NativeMethods.OrtSessionOptionsAppendExecutionProvider_Nuphar(options.Handle, 1, settings));
     return options;
 }
コード例 #2
0
 public void AppendExecutionProvider_CPU(int useArena)
 {
     NativeApiStatus.VerifySuccess(NativeMethods.OrtSessionOptionsAppendExecutionProvider_CPU(handle, useArena));
 }
コード例 #3
0
 /// <summary>
 /// Constructs an empty SessionOptions
 /// </summary>
 public SessionOptions()
     : base(IntPtr.Zero, true)
 {
     NativeApiStatus.VerifySuccess(NativeMethods.OrtCreateSessionOptions(out handle));
 }
コード例 #4
0
 protected override bool ReleaseHandle()
 {
     NativeMethods.OrtReleaseSessionOptions(handle);
     handle = IntPtr.Zero;
     return true;
 }
コード例 #5
0
 /// <summary>
 /// Use only if you have the onnxruntime package specific to this Execution Provider.
 /// </summary>
 public void AppendExecutionProvider_Nuphar(string settings = "")
 {
     NativeApiStatus.VerifySuccess(NativeMethods.OrtSessionOptionsAppendExecutionProvider_Nuphar(handle, 1, settings));
 }
コード例 #6
0
 /// <summary>
 /// Use only if you have the onnxruntime package specific to this Execution Provider.
 /// </summary>
 public void AppendExecutionProvider_Nnapi(ulong nnapi_flags)
 {
     NativeApiStatus.VerifySuccess(NativeMethods.OrtSessionOptionsAppendExecutionProvider_Nnapi(handle, nnapi_flags));
 }
コード例 #7
0
 /// <summary>
 /// Use only if you have the onnxruntime package specific to this Execution Provider.
 /// </summary>
 public void AppendExecutionProvider_MIGraphX(int deviceId)
 {
     NativeApiStatus.VerifySuccess(NativeMethods.OrtSessionOptionsAppendExecutionProvider_MIGraphX(handle, deviceId));
 }
コード例 #8
0
 /// <summary>
 /// Use only if you have the onnxruntime package specific to this Execution Provider.
 /// </summary>
 public void AppendExecutionProvider_OpenVINO(string deviceId = "")
 {
     NativeApiStatus.VerifySuccess(NativeMethods.OrtSessionOptionsAppendExecutionProvider_OpenVINO(handle, deviceId));
 }
コード例 #9
0
 /// <summary>
 /// Use only if you have the onnxruntime package specific to this Execution Provider.
 /// </summary>
 public void AppendExecutionProvider_NGraph(string nGraphBackendType)
 {
     NativeApiStatus.VerifySuccess(NativeMethods.OrtSessionOptionsAppendExecutionProvider_NGraph(handle, nGraphBackendType));
 }