But for some reason, the kernel always uses the values of d_A as zero (the initial values). Even in device emulation mode, d_A has always zeros inside the kernel. Something which is even weirder, if I read d_A from the host with cudaMemcpyFromSymbol, the value of d_A are correct (before and also after the execution of the kernel)!!
Is there any bug related to this with CUDA 1.0? I can’t use CUDA 1.1 for some reason in my computer. That’s why I use CUDA 1.0.
I am using cudaMemcpyToSymbol() just like you Kubrick except that I am not using device when declaring the constant memory. I am using CUDA 1.1 though.
I have been using this function without the quotations that AndreiB is suggesting, but again that may be a 1.0 vs 1.1 thing.
Quotations vs. no quotations is not a 1.0 or 1.1 thing, it’s just a matter of variable scoping, I suppose.
In my programs I don’t want device-side variables to be visible from host, so I prefer to use quotations. It worked just fine for me both in 1.0 and 1.1.