I have this exact issue posed on Stack Overflow http://stackoverflow.com/questions/11564081/why-i-cant-use-global-float-constants-in-device-code but this was never answered. I figured it would be more appropriate to ask here.
Essentially I have a header with global float constants I want to share between host and device code. Seems pretty straight forward thing to want to do. However, on Windows (VC11) only, I get ‘identifier “X” is undefined in device code’.
There is a similar question posed here https://devtalk.nvidia.com/default/topic/413405 which I sort of understand that says the issue is that I’m declaring memory in the host and the gpu which isn’t allowed.
So does this just happen to work on gcc (linux) and clang (OS X) because somehow the host compiler is doing things differently there?