Type: Answers

Area: Tools



How should I use the OpenCL function clReleaseEvent to avoid memory leaks?

Description

Not releasing event created in the Altera® SDK for Open Computing Language (OpenCL™), using function such as cl_event, or en-queuing a task, can results in a system slow down resulting in excessive use of memory.

 

Workaround/Fix

clReleaseEvent, should be used as soon as the event is finished and it needs to be done explicitly by the programmer. Keeping event alive has memory impacts on the system, and this can not be avoided.