I found a function. The help gives:

CUDALink`Internal`CUDAConstantMemoryCopy[mem1, mem2] copies constant memory to and from host memory.

As of now I have not figured out how to use it. mem1 should be host memory and mem2 should be shared or constant memory. It can also be the other way around for the other direction. The function is defined in CUDALink.m. There is a function constantMemoryQ (Line 878 in CUDALink.m) that checks "Sharing" -> constant in CUDAMemory. I tested some ideas using CUDAMemoryLoad with some setting of "Shared" -> Constant, Constant, "Sharing" -> Constant but nothing was working to set shared to constant. It can be checked with CUDAMemoryInformation[constMem]. There is a note about sharing.

Can someone from experience tell or figure out from the code what to put in for mem1 and mem2?

  • $\begingroup$ I have created a chat room on the subject. Its name is "CUDA constant memory". Here is the link $\endgroup$ – andre314 Apr 4 '16 at 17:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.