Optimize this loop in OpenCL

Hi,

I have a loop of this type:

Code :

for (i=0; i<1000;i++){

for (k=0; i<=2;i++){

a[i][0][k]=Node[Triangle[i][0]][k];

a[i][1][k]=Node[Triangle[i][1]][k];

a[i][2][k]=Node[Triangle[i][2]][k];

}

}

with

Triangle[i][0], the index(int) of the first node of the triangle i

Triangle[i][1], the index(int) of the second node of the triangle i

Node[Triangle[i][0]][0] :The first coordinate of the first node of the triangle i

Node[Triangle[i][0]][1] :The second coordinate of the first node of the triangle i

....

I woult like to do this loop in openCL.

So i modified Node[][] in Node2[] where the 3 first values are the coordinates of the first node and the 3 after are the coordinates of the second one ...

Triangle[][] becomeTriangle2[] with the 3 first values that are the index of the 3 nodes of the first triangle ...

Now i have troubles to write .cl

I don t know so much how i can do this loop like that in OpenCL with

int id = get_global_id(0);

Could you help me ?

Thx a lot