how to convert this C-code on CUDA

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.


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.

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.

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