Keeping an array in gpu memory

Hi everyone,

I have a question about sending constant data to the gpu’s memory. I have 100 Mb array and I would like to keep it in the gpu’s memory because this array does not change. Is there something similar to heap memory for GPU where we can store arrays for the whole duration of the code?

Thank you for you help!


Hi Chris,

In the 10.4 release we added support for allocatable device arrays to CUDA Fortran module data. Device module data is global to all device routines in the module and persists for the lifetime of the module. This might be your best option. Constant memory would be faster to access then the device’s global memory, but 100Mb is too big for constant memory.

Hope this helps,