“Advisory: Cannot tell what pointer points to, assuming global memory space”.
I’m trying to move over some C code to CUDA and when I compile, I get this warning in a number of places… I have pasted one line where it occurs. When I run the program, I get the “failed to launch” message.
if (code1[framepos][1] != *(ptr1[framepos]++))
{
//body
}
code1 and ptr1 are passed in parameters from another device function.
However, when I change the above line to:
if (code1[framepos][1] != (ptr1[framepos][charpos]))
{
//body
}
charpos++;
the code compiles without the warning and the program runs without giving out the “failed to launch error”. The code runs fine in both cases in device emulation mode. Why is there a difference between how the cuda compiler treats both cases? Thanks in advance.
I’m not sure about the advisory, but are you incrementing ptr1[framepos] by multiple threads? one might update it before the other reads. launch failures are often like segmentation faults. I’ve made similar changes and not gotten rid of the advisory.