double constants on the GTX280 It looks like they are being zeroed out.

Has anyone else tried to have

device constant double variables in their code?

I’ve looked at the PTX code generated and it appears to set the values to zero.

Here’s an example line in my .cu file

__device__ __constant__ double deli=30.0;

And here’s the corresponding line in the .ptx file

.const .f64 deli = 0d0000000000000000 /* 0 */;

I’m using a GTX280 and I am compiling with architecture “-arch sm_13”

Any thoughts?

I have exactly the same issue. However, it isn’t mentioned in the programming guide that you cannot assign a device constant variable explicitly as you describe. A work around is to use:

[codebox]cudaMemcpyToSymbol(gpu_var, &host_var, var_size);[/codebox]

which explicitly copies the variable to device. However it would be much better if the initialisation worked as one would expect…