Dear all,

I have a situation where I need to dynamically allocate buffers in an OpenCL program (not inside a kernel). I am using the C++ wrapper from the cl.hpp header file. I'd like to do the analog of what is possible on a CPU:

cl_uint *myarray;

cl_uint arraysize = computed_number;
myarray = (cl_uint*)malloc(arraysize * sizeof(cl_uint));

Is it possible to do some analogous with cl::Buffer?

Many thanks!