Newbie request

Can someone help me to write similiar program in Cuda ?

////////Data/////////////////////////////////////////////////////////////////////

struct sVertexf
{
float x, y, z, m;
};

sVertexf InpMatrix[100][100][100];

/////////////////////////////////////////////////////////////////////////////

for (int z=1; z<100; z=z++ )
{
for (int y=1; y<100; y=y++ )
{
for (int x=1; x<100; x=x++ )
{

								                                        if InpMatrix[x][y][z].m <> 0
		                	{
                                                                               ... code

			                 }
		}
	}
}

For starters, have a thread for each output element you want. You can start optimizing (if needed) from there. Read the Programming Guide for details how to use each thread’s ID for array indexing.

Paulius