"Clear <gpuarray>" or reinitialization command take more time in Matlab2018 than Matlab2015

I have a gpuArray "ga" of size 729x28752. After the use I want reinit. the variable. But whenever I run it in Matlab2018a it takes almost 10 min to do so but when I run the same code in Matlab2015b it take just a few secs. Because of this issue, in Matlab2018 the excution of the program is much larger. I tried below things but it has same effect.
Clear ga; // taking 10mins in MATLAB2018
ga=[];// taking 10mins

1 Comment

How are you creating ga? One difference between 15b and 18a is that clear takes effect immediately. So if ga is created by some long-running GPU code, then in 18a clear or assignment to empty will trigger synchronization of the device, whereas, in 15b it might not.
You could satisfy yourself that this is the case by adding wait(gpuDevice) before calling clear.

Sign in to comment.

Answers (0)

Asked:

on 11 Jul 2018

Commented:

on 12 Jul 2018

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!