What's wrong with idy?

HI,

I have this piece of code for threads to run:

static __global__ void setId(int Nx, int Ny, float *Ux, float *Uy)

{

    unsigned int idx = __umul24(blockIdx.x,blockDim.x)+threadIdx.x;

    unsigned int idy = __umul24(blockIdx.y,blockDim.y)+threadIdx.y;

   if (idx<Nx && idy <Ny)

    {

       unsigned int index = idx + __umul24(idy, Nx);

       Ux[idex] =  idx;

       Uy[idex] =  idy;

    }

}

I don’t know why Ux gets written successfully but not Uy.

Thanks for any hint!

the code where you call the kernel is also necessary. Also doing a (float) idx and (float) idy is always smart to do.