OrtApi Globals in C#
#13307
-
Hi everyone, I am missing some of the C/java bindings in C#. Specifically SpinLock control and global threading options. Could it be considered adding them to the I suggest exposing the threading options same as for java: OrtEnvironment.ThreadingOptions threadOpts = new OrtEnvironment.ThreadingOptions();
threadOpts.setGlobalInterOpNumThreads(2);
threadOpts.setGlobalIntraOpNumThreads(2);
threadOpts.setGlobalDenormalAsZero();
threadOpts.setGlobalSpinControl(true); Or expanding the public void SetGlobalSpinControl(bool allowSpin)
{
NativeApiStatus.VerifySuccess(NativeMethods.OrtSetGlobalSpinControl(Handle, allowSpin));
} Using it as: OrtEnv.Instance().SetGlobalInterOpNumThreads(2);
OrtEnv.Instance().SetGlobalIntraOpNumThreads(2);
OrtEnv.Instance().SetGlobalSpinControl(true); Best regards, |
Beta Was this translation helpful? Give feedback.
Answered by
thoron
Dec 5, 2022
Replies: 2 comments
-
Cc: @RandySheriffH |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
thoron
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Discussion moved to issue #13743 and fixed in PR #13822