/// <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; }
public void AppendExecutionProvider_CPU(int useArena) { NativeApiStatus.VerifySuccess(NativeMethods.OrtSessionOptionsAppendExecutionProvider_CPU(handle, useArena)); }
/// <summary> /// Constructs an empty SessionOptions /// </summary> public SessionOptions() : base(IntPtr.Zero, true) { NativeApiStatus.VerifySuccess(NativeMethods.OrtCreateSessionOptions(out handle)); }
protected override bool ReleaseHandle() { NativeMethods.OrtReleaseSessionOptions(handle); handle = IntPtr.Zero; return true; }
/// <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)); }
/// <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)); }
/// <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)); }
/// <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)); }
/// <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)); }