The Khronos Group - a non-profit industry consortium to develop, publish and promote open standard, royalty-free media authoring and acceleration standards for desktop and handheld devices, combined with conformance qualification programs for platform and device interoperability.

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Dynamic memory allocation/deallocation and transfer?

Hello, GPGPU hackers

If one use OpenCl to write some packet/data - filtering programm, there will be nesessary
reduce the buffer size ( yes, the Cl-Buffer), cause some packets are "filtered", and there
is no reason to transfer old (full) amount of data with a lot of garbage to the host.
The size of the new buffer will be know only in or after the Kernel works.
There is a posibility to do that by running the kernel with reduce summ calculation,
then use the result to build the new buffer in host , but thats freaky.
How to dynamicly allocate/deallocate in global memory?

Adwanced task is to allocate many buffers in order to filter content into many different arrays. If possible they must be dinamicly growable . Again, this must be done from kernel. Is there any possibilities to do that?

Re: Dynamic memory allocation/deallocation and transfer?

You cannot dynamically allocate global memory inside a kernel. Rather allocate the largest buffer you could possibly need or the largest one supported by the OpenCL implementation, then call your kernel and do the reduction step.