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

Implement __enter__ and __exit__ for CUDA context #324

Open
riaqn opened this issue Nov 27, 2021 · 1 comment
Open

Implement __enter__ and __exit__ for CUDA context #324

riaqn opened this issue Nov 27, 2021 · 1 comment

Comments

@riaqn
Copy link

riaqn commented Nov 27, 2021

People like me always forgot to pop context and cause errors. By implementing these two methods, the python will handle the context automatically. See https://book.pythontips.com/en/latest/context_managers.html
This also helps when there is an exception.

@inducer
Copy link
Owner

inducer commented Mar 29, 2022

That sounds reasonable. I'd be happy to take a PR.

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

No branches or pull requests

2 participants