Hi,
I’m using this in my .cu file: constant float ImageXValues[ IMAGE_VALUES_SIZE ]; constant float ImageYValues[ IMAGE_VALUES_SIZE ];
For a multi GPU environment - where I use a different thread per GPU, how should I define the constant memory per thread/GPU?
what I mean is if I had a pointer to the device memory, I’d need to keep one per thread/GPU, how do I do this for the constant memory?
I think this is per GPU. Device will be specified by CUDA context which will be used to copy data to your constant memory, so probably no additional steps required.
The conclusion in another thread which discussed this in more detail was “yes, each context sees a different copy of the constant variable”. You just have to be sure to load the constant variable from each host thread.
Its per GPU as AndreiB and seibert said. I simply created a .cuh file and included it from both .cu files. As seibert said you need to populate the constants/textures/whatever
per host thread against the appropriate GPU device.