Problem with __device__ __host__ function The function return is incorrect when called from the host

I have a device host function that is not behaving correctly. The poor behavior seems to be centered around one of the function arguments. This argument is a float on the host, and to allow use of the function on both the device and the host, it is also stored in constant memory using CudaMemcpyToSymbol.

When I call the function from the device (using the constant argument), store the returned value, copy it back to the host and print the value, I get the correct result. When I call the function from the host however, the result is incorrect. The returned value is the value that would be returned if the argument were zero, but I’ve checked and it isn’t.

Are there any subtleties that can arise when using device host functions? Has anyone encountered a similar problem? I know this sounds like a simple bug, but I’ve checked the code again and again, and this function is about as simple as they come…