Why nvcc says Advisory ? Advisory: Cannot tell what pointer ...

Hi.

In my program, nvcc says
“Advisory: Cannot tell what pointer points to, assuming global memory space”.
It is fact that my program copies from global memory to local memory (or from local memory to global memory). But, nvcc doesn’t always say this advisory if program copies from global memory to local memory.

I can’t understand when this advisory is occurrd, and whether or not it is critical problem. (My program returns correct answer.)

Would you teach me ?

Thanks.

I’m getting this warning (as of CUDA 1.1) as well in a few of my kernels.

I have no idea either how to explicitly tell the compiler that a certain pointer is pointing to global memory, just to shut up the messages.

I got this problem from two causes:

  1. Pointer inside a structure: The compiler seems to get confused by pointers to structures. There’s an active bug on this, I believe. It may be resolved in the next release. Work-around is to remove your pointers from structures if possible. That could be tough for complex data structures.

  2. Flow control: I had a pointer set in one branch of a conditional and not in the other. Later, I accessed the pointer, subject to the same condition as the previous conditional. Compiler was understandably confused by this. Setting the pointer to NULL in the other condition helped tell the compiler that there was not an arbitrary value in the pointer in some cases.

Of course, if you actually set a pointer sometimes from one memory space and sometimes from another, that is a real problem.

Sorry. That should have read “pointers inside structures”, not “pointers to structures”.

hello!

ad 1)

i get the mentioned message on an explicit type conversion like

reinterpret_cast<T1*>(&t2)

where t2 is of type T2 and is a member of a structure in shared memory.

first of all, i know it’s not the best idea to ask questions and have explicit casts at the same time.

basically i have two types the sub-structure can be (and since the objects involved are used heavily in my (host and device) code they feature constructors which means they cannot be put into unions).

i will surely try to think about a cleaner solution but if anyone has some suggestions on how to tell nvcc that i know where my pointers point to i would be happy : )

thanks in advance

I just got the same warnings if the parameters are same as :
global void foo (int *ppN, float *ppU

here, it says there is an warning at line 37:

#line 37 “test.cu”
((ppU[i])[j]) = (fdividef(((1478.0F) - ts), (1478.0F)));

I also can’t understand it.