Well, I bumped into the same problem again, and now it’s b/w global and shared memory. Really painful… Maybe someone from NVIDIA can comment:
Here’s the code snippet :
shared int* ptr;
shared int sh_data[2];
global int g_data[2];
if (condition){
ptr=sh_data;
else{
ptr=g_data;
}
int x=ptr[0];
This kernel fails to launch ( unspecified launch failure), while when I comment one of the “if” branches out - it works fine.
Any hope for this to be solved some day?
My own guess is that accesses to different memory types require two different HW ops to be issued, and thus must be resolved at compile time. So unless there’ll be HW support for runtime pointer resolution - no hope for this to work…