I met a problem 'Out of memory' in Sparse gpuArray accumulation in my for-loop.
The following code is in a function. I need to accumulate the result 'KernelCurrent' of every loop into the grobal gpuArray Sparse 'Kernel'. In this function, 'KernelCurrent' is also a gpuArray Sparse and has the same size as 'Kernel'; (Size: 262144×262144)
I have tested all the other line of code in this function, which showed that the 'Out of memory' problem is caused by the operation of addition(accumulation). The storage memories requested for both 'Kernel' and 'KernelCurrent' is exactly less than the 'AvailableMemory' of the gpuDevice.
Kernel = gpuArray(sparse(num_row, num_col))
KernelCurrent = Result_oneLoop;
Kernel = Kernel + KernelCurrent;
The gpuDevice that I can access:
Are there alternative method of coding for solving this problem ? Thanks in advance!