Eliminating Compiler Warning Warning: Cannot tell what pointer points to, assuming global

Hi
I am in the process of eliminating causes for compiler warnings (such as missing new lines, non used variables and so on).
One thing I could’nt get rid of is the following:

“Warning: Cannot tell what pointer points to, assuming global memory space”

The cause for this is a line like this in a device (kernel) function:

int* jlist = _firstneigh[i];

where _firstneigh is a device constant int** and the memory it points to was allocated with cudaMalloc.

I tried something like

device int* jlist;

but that is not allowed within a function.

Is there anything I can do to get rid of that compiler message (I get tons of those)?.

Best regards
Ceearem

I am having the same problem, though in a slightly different context. Inside a global function I declare an automatic pointer to a structure (MyStruct *sptr). This pointer will have a different value in each thread. One of the members of this structure is a pointer to an array. Every time I reference this array (sptr->vec[i]) the compiler warns me that it does not know which memory vec resides in. It assumes global, which is correct, but I still hate the warnings. I’ve tried everything I can think of to get rid of this warning. Anyone know how?

Tim

I don’t have an answer either… but last year I did spend over an hour trying different options and tricks when Toolkit 2.3 came out.
I agree, when I build my source, I get a clean compile except for a PAGE of the warnings, and I always worry I missed some new (significant) warning stuck in the middle of the output.

Luckily harmless.
Maybe it’s time for a new “CUDA 3.2 toolkit wishlist” thread.

Looks like this won’t be an issue for Fermi cards.

Here’s what the Fermi whitepaper says about this:

N.