basically you can free BUS_ADDRESSABLE a buffer by calling clReleaseMemObject but I would not recommend doing this. After releasing the buffer you would need to create a new one and call clEnqueueMakeBuffersResidentAMD again.
I think it would be easier to allocate 2 buffers and while the FPGA is writing into buffer 2, you can copy the content of buffer 1 into a "regular" CL-Buffer which was not allocated in the PCIE aperture. The further processing on the GPU then can use this buffer and the FPGA can write the next frame into buffer 1.
Basically this is the same approach as you suggested but instead of deallocating the BUS_ADDRESSABLE memory buffers you copy them into "regular" buffers and reuse BUS_ADDRESSABLE buffers to receive the next frame from the FPGA.
thanks for the clarification. It is thus not possible.
This idea of double buffering on the GPU is indeed our actual solution regarding the size problem (which we need to improve regarding the dma engine), and we were asking ourselves on the consequences of GPU copy operations, to classic clBuffers while doing the directGMA transfer, on the transfer speed (as we may reduce the bandwith) (our current state does not let us judge this correclty).
Could you so just tell us theoretically what's happening if let's say the memory bandwith is almost full due to intensive compute operations, and in the mean time, we want to initiate a transfer to GPU with DirectGMA?
thanks for the answer and your work Chris,