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.)
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.
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.
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 : )