I have this exact issue posed on Stack Overflow [url]Host float constant usage in a kernel in CUDA - Stack Overflow 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 [url]https://devtalk.nvidia.com/default/topic/413405[/url] 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?
- James