is there a way to force OpenCL to keep data in a global memory buffer on chip (i.e. it never gets swapped out to system memory)? Basically I want to reserve a portion of the GPU's memory for my own needs, and I want the data that I put there to remain on the GPU regardless of whether other applications start saturating the GPU's memory.
preguntado el 10 de marzo de 12 a las 12:03
GPU's aren't linked to a CPUs memory management unit, they don't do page faults like a CPU. They are block device peripherals controlled by device drivers.
For OpenCL when you allocate memory on the GPU by creating a cl_mem object and enqueueing (writing) it to the GPU it will stick around until you explicitly release is with clReleaseMemobject. To reuse a buffer you need to not release it and keep track of its Cl_mem object.