How to expand data

Hello

i need known why this code does not working … whats wrong ???

__global__ void ExpandData(float* indata,int shift,int n,float2* expdata)

{	

	const unsigned int index=(shift*n)*blockIdx.x*blockDim.x+threadIdx.x;

	const unsigned int rindex=blockIdx.x*blockDim.x+threadIdx.x;

	expdata[rindex].x=indata[index];

	expdata[rindex].y=rindex;

}

i welcome any help

index can be much higer than rindex, my guess is that you are reading past the boundary of indata

ha i found it !!!

this line

const unsigned int index=(shift*n)*blockIdx.x*blockDim.x+threadIdx.x;

must be

const unsigned int index=(shift*n)+(blockIdx.x*blockDim.x+threadIdx.x);

thanx DenisR for pointing out …