shared double problem shared double doesn't work

hi, there

I was converting my single-floating programme to a double one, but everywhere that involves shared double doesn’t work.
enviroment: windows server2003, CUDA 2.0beta2, 177.35 driver, GTX280
a simple test code was:

shared double s_temp[32]; // it works well when it was shared float
if( tid < 16) s_temp[ tid] += s_temp[ tid + 16]; __syncthreads();
if( tid < 8) s_temp[ tid] += s_temp[ tid + 8]; __syncthreads();
if( tid < 4) s_temp[ tid] += s_temp[ tid + 4]; __syncthreads();
if( tid < 2) s_temp[ tid] += s_temp[ tid + 2]; __syncthreads();
if( tid < 1) s_temp[ tid] += s_temp[ tid + 1]; __syncthreads();

the programme returns a error
anyone have any idea? thanks

plus
s_temp[tid]=0.0; is OK
s_temp[tid] += s_temp[tid]; is OK
but
s_temp[tid] += s_temp[tid+1];went wrong

You seem to be relying on the shared memory being initialized to 0. That’s usually not a safe assumption to make.

I set stemp to 0 in test.

and I think the problen is caused by index

Just a first thought, the FAQ that bites everyone, myself included. Make sure to set the compiler flag to make sure you’re generating 1.3 device code.

yes, I have added --arch xxx13…