Skip to content

Only copy non-writeable image when CPU upscaling#2860

Merged
joeyballentine merged 3 commits intomainfrom
copy-only-when-cpu
May 18, 2024
Merged

Only copy non-writeable image when CPU upscaling#2860
joeyballentine merged 3 commits intomainfrom
copy-only-when-cpu

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
@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