I am working on a library of kernels. My main program runs each kernel a number of times so that it can measure their performance. I would like to use Constant Memory in some of them, but since Constant Memory has the lifetime of the application, I believe there will be interference between the different kernels.
One option would be to just create an array that uses all of the Constant Memory, and then over-write as much of it as I need with the desired data before each kernel that uses the Constant Memory. It’s messy (I’ll have to change the names of variables in the kernels to whatever I call the array - not good for readability, etc.), but it’s the only thing I can think of.
Any other ideas? Will having Constant Memory allocated, even though I’m not using it, affect the performance of the kernels that don’t use Constant Memory?