Memory management with cl.hpp
I've been running a leak checker on my project and I get a lot of stuff originating out of OpenCL. That doesn't mean it's OpenCL's fault because I'm ultimately the one making these allocations. My question comes down to how I should handle the deallocation of these things. I have a few questions as I go but I wanted to start with one in particular.
In cl.hpp as posted here:
I see the Context object has a constructor that uses clCreateContext under the hood to create a handle to an OpenCL context. I don't see an OpenCL destructor. As far as leaks go, in the normal application I could probably just suck it up since I shouldn't be making these contexts left and right, but I sure throw them around like confetti in my unit tests. My leak checker goes nuts over it. I have some problems with platforms too that I think are related to the contexts, so I wanted to figure that out first. I'm asking first before I invite myself to tweak with my cl.hpp file and see what I get away with.
The Context class is derived from Wrapper<cl_context> which has a destructor that handles the release of the underlying OpenCL object.