freeing resources with the cpp bindings

how do I free resources with the cpp bindings?

I tried oclHandles.program.release() but this function call is private.

the regular openCL C language has clReleaseKernel(). In the cl.hpp this function is present in the release() reference handler thus private

how do i solve this?

I changed protected to public in the cl.hpp.

It’s the only way i figured to make my profiler work. It doesn’t feel right. Anyone has a better idee?

I changed protected to public in the cl.hpp.

It’s the only way i figured to make my profiler work. It doesn’t feel right. Anyone has a better idee?

I have the same problem and i have idea, but now i’m unable to test my solution.

The idea is to use delete on created object.

For example:

cl::Buffer result = cl::Buffer(bla bla);

delete &result;

I’m not sure is it correct, as I said I’m unable to test this right now.

But if it’s ok, please reply.

I have the same problem and i have idea, but now i’m unable to test my solution.

The idea is to use delete on created object.

For example:

cl::Buffer result = cl::Buffer(bla bla);

delete &result;

I’m not sure is it correct, as I said I’m unable to test this right now.

But if it’s ok, please reply.

Using the CPP bindings, resources are released when they go out of scope. It makes use of OpenCL’s reference counting mechanism, using the retain and release functions, to keep the resource alive until all references are gone.