I have a data that needs to be accessed by several kernels, i.e. as follows:
//send array for results to GPU
//send data to be accessed by all kernels to GPU
call kernel1<<...>>
call kernel2<<...>>
...
call kernelN<<...>>
//retrieve array of results from GPU
Is it possible to do or not? I.e. to have my data and results arrays to stay there in GPU’s global memory until I am done with all of my kernels. Or do I have to always send data and retrieve results before and after each kernel call? thanks!
Global memory has a lifetime of the application, so you don’t have to send data and retrieve results before and after each kernel call. It will stay there during the whole application, not just during kernel call.