I have a question. I want to use constant memory but I cant figure out how to use it.
The situation is like this:
I have two .cu files, one named test.cu the other calculate_ijk_a_kernel.cu
the test.cu is where it needs to be. This is the file where i call the kernel, and where i want to make a constant type.
__constant__ float a_max = 1.0f;
First I had this inside my main function. And got the message that is has to be outside the function. When I then moved it outside and tried to use it in my kernel file I got a strange error stating that a_max is undefined. I tried everything i know. Can someone please give me a hint how I need to do this. I also looked in the examples of the CUDA SDK there was only one example that was making use of constant but what I don’t get is that:
__constant__ float4 atominfo[MAXATOMS];
atominfo never gets a value assigned to it?
this is the cuenergycompsum example.