Altera_Forum
Honored Contributor
11 years agoRelease resources
Hi,
I'd like to understand release and acquisition of resources by the Altera OpenCL platform more clearly. I'm trying to be very careful to release all acquired resources (command queues, kernels, programs, and contexts) whenever I don't need them anymore. Nonetheless I get CL_OUT_OF_RESOURCES and CL_OUT_OF_HOST_MEMORY when I use more than about five or six kernels in my program. These kernels are not used concurrently. The number of kernels in use at any moment in time is much smaller and they work in isolation from one another. So my question is whether the runtime releases resources as soon as their ref count reaches zero? Or is cleanup done lazily at a later time? Is there a way to force the runtime to cleanup all resources that have been released (i.e. they have a ref count of 0)? Or does the behavior I'm seeing indicate that I have missed to call clReleaseXXX on some resources? Thanks in advance for any comments on this. Cheers, Domini