Figure out how to copy to constant memory (CUDA)

I found a function. The help gives:

CUDALinkInternalCUDAConstantMemoryCopy[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?

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