I was trying to make myself a C++ class containing (wrapping) a cl_mem buffer, a bit like what's in the khronos C++ wrapper (but it contains also other things that i need in my software).
So here my problem is: when i want to create the buffer, i need a context, and when i want to upload/download data, i need a queue.
And both should be the same as in the rest of my software, to make everything work..
So my question: is it enough to pass to my class, in the constructor, a context and a command queue, and then call clCreateBuffer, or clEnqueueRead/Writebuffer from within my class?
and , if so, should everything work fine if i write a Get() method, returning the cl_mem item, and using it from somewhere else in my code?
i tried to do so, but everything crashes (program has stopped working).
What is the right way to do?