-
Notifications
You must be signed in to change notification settings - Fork 17
Description
The current copyToGPU method is responsible for both allocating memory on the GPU and copying data into that memory. To improve modularity, readability, and reusability, we propose splitting this function into two distinct methods:
allocateOnGPU() – responsible for memory allocation only
copyToGPU() – responsible for copying data to the already allocated GPU memory
This change will make GPU memory operations more flexible and easier to manage independently, especially for cases where allocation and copying need to be handled separately (e.g., zero-copy memory sharing, conditional data updates, or deferred initialization).
Tasks:
Extract allocation logic into allocateOnGPU()
Extract copy logic into copyToGPU()
Update existing usages of copyToGPU() to use the two new methods in sequence
Add comments and documentation for the two new methods
Add tests