AnsweredAssumed Answered

Reuse of Kernel in aparapi / memoryleak ?

Question asked by kulan on Dec 14, 2014



have I missed something how I can tell aparapi / openCL that I will use a given Kernel more than once, with other data?


The thing is, I have written a Java Prog which uses aparapi to calculate matrix products. And for benchmarking I plan to use something like 8000 x 8000 or even 10.000 x 10.000

input is byte [N][N] and output is int [N][N].


I have also written an Iterator so that I can make a loop like :


for (WorkUnit wu : workUnitBuilder) {





Problem is, when I do it like this, I got a fatal error : Exception_access_violation

To avoid this, I started to create a new kernel in every iteration. Which seams to work for instances like 4000 x 4000, but when I come to 8000 x 8000 I see that after the ~67. kernel I got the warning from aparapi, that it has failed to compile the kernel to OpenCL (which is irritating due it has worked 65+ times before), so I started to monitor the RAM usage of the GPU (AMD HD 5650 Mobile) and the results was, every time a new calculation starts (new kernel + new data) the memory usage increases about the amount of the array chunks, the kernel uses, but it always increases... And when it fails to compile future kernels, the memory usage of the GPU constant as long as I kill the java-process, than it drops to almost 0.


Is there any way to free up not used kernel-space ? Maybe with kernel.setExplicit(true) and than copy the arrays by hand ?


thanks in advice