cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

Fuxianjun
Journeyman III

How to release Physical Memory again ?

Excute kernel in a loop Physical Memory usage getting more and more.

My project is about back propagation neuronetwork. It need  a large number of iterations to finish the training, then I test a kernel about array addtion in a loop, the code is like following.

My problem is if the parameters of this kernel is local variable, the Physical Memory usage will decrease after a short-term increase,  to the contrary, if the parameters is global variable, the Physical Memory usage will get more and more, never decrease.

Doese any one tell me what the different between this two case? Neuronetwork need many global various to excute the training, how can I resolve the problem of Physical Memory increase?

for(int i=0;i<10000000;i++) { cl_int errs = clEnqueueNDRangeKernel(queue, kernel, 1, 0, &work_size, 0, 0, 0, 0); }

0 Likes
1 Reply
nou
Exemplar

try cal clFinish() each 1000 iterations for example. if it not solve your proble then it is bug in SDK.

0 Likes