How to release Physical Memory again ?

Discussion created by Fuxianjun on Jul 26, 2010
Latest reply on Jul 26, 2010 by nou
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); }