OpenCL Force Lock Buffer Remains on GPU

Is there a way to force OpenCL to store data in the global memory buffer on the chip (i.e. it never gets into system memory)? Basically, I want to reserve some of the GPU memory for my needs, and I want the data that I left there to remain on the GPU, regardless of whether other applications start to fill the GPU memory.

Thanks!

+4
source share
1 answer

GPUs are not connected to the CPU's memory management unit; they do not crash pages, such as the CPU. These are block device peripherals controlled by device drivers.

For OpenCL, when you allocate memory on the GPU by creating a cl_mem object and writing (writing) it to the GPU, it will stick until you explicitly get free, with clReleaseMemobject. To reuse a buffer, you do not need to release it and keep track of its Cl_mem object.

+4
source

Source: https://habr.com/ru/post/1400722/


All Articles