Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow OgaShutdown to be called multiple times #1080

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

RyanUnderhill
Copy link
Member

It's nice to be able to call OgaShutdown() then call more Oga* APIs and call OgaShutdown() again, vs just one OgaShutdown() being the permanent end of Oga for a process.

This makes it easier to implement some tests and language bindings.

@skyline75489
Copy link
Contributor

skyline75489 commented Nov 21, 2024

Would a ref-count approach better suits our need? Like:

https://github.com/microsoft/onnxruntime/blob/ac9c135b9543ad0374fe335bc3dc5feb0f24f010/onnxruntime/core/session/ort_env.cc#L29C13-L29C24

OrtGlobals feels like our version of OrtEnv, which exists globally and pretty much everything relies on it.

Making it ref-counted is also one step closer to being able to automatically release it

@RyanUnderhill
Copy link
Member Author

Refcounting has a drawback that we'd now need an OgaStartup to correspond with the OgaShutdown.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants