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

Only copy non-writeable image when CPU upscaling #2860

Merged
merged 3 commits into from
May 18, 2024

Conversation

joeyballentine
Copy link
Member

@joeyballentine joeyballentine commented May 17, 2024

Copying takes time and memory. Why waste this time and memory if we are just going to immediately copy the image to the GPU?

Now the copy will only happen if the user is upscaling with CPU. On anything else, the image is simply moved to a tensor (sharing the same memory) after being made writeable, then copied to the GPU. The image is then set back to readonly.

This made a significant cut to processing time.

@joeyballentine joeyballentine merged commit 91b80c7 into main May 18, 2024
14 checks passed
@joeyballentine joeyballentine deleted the copy-only-when-cpu branch May 18, 2024 00:48
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