Does gather() clear memory
Show older comments
I am running in to memory limits on my GPUs. I know I can reset(gpuDevice) to clear all memory on the device, however, I would like to move arrays one at a time from GPU memory to memory and then clear the orginal GPU version. Does gather() also clear the GPU memory after copying/moving to memory?
If not, what would be the best way to achieve this?
Accepted Answer
More Answers (1)
Matt J
on 18 Jan 2025
0 votes
It seems to for me:
>> A=gpuArray.rand(300,300,300);
>> gpuDevice().AvailableMemory
ans =
3.1956e+09
>> A=gather(A);
>> gpuDevice().AvailableMemory
ans =
3.4116e+09
Categories
Find more on Parallel and Cloud in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!