how to convert this C-code on CUDA

hi.
i am trying to convert the following C-code on to the gpu, but i am not successful.
pls can any one help by giving me the code for GPU.

for(i=0;i<8;i++)
for(j=0;j<8;j++)
{
if(i==0)
T[i][j]=1.0/sqrt(8.0);
else
T[i][j]=sqrt(2.0/8.0)cos(((2.0j+1.0)i3.14)/(2.0*8.0));
}

pls help me.
thanx in advance.

When you say “not successful”, what do you mean? Can you post the CUDA kernel code you have written (I presume you really want to do many more that just the 64 calculations in that code you posted)? It might be easier to suggest how to fix or optimize the CUDA code you have, rather than start from the beginning.

@avidday
yeah i am trying to do more than 64 computations.
the code which i have written is fully wrong.
Its better if you give me the code or suggests me the step.
i am doing it for a 2D array and using pitch.
pls help me.
thanx

Suspicions that you have no code at all aside, you might have more success if you take a look at some of the SDK examples and read through the programming guide and the getting started guide.

What does “fully wrong” mean? Doesn’t compile? Doesn’t work properly? Doesn’t exist?

I will happily offer suggestions as to how to correct your “fully wrong” code if you care to post it.

Map the <i,j> tuple to a thread