Hello

I have this algorithm where it requires me to index 2-dimensional arrays in an out-of-order fashion, basically doing computation on specific elements not necessary in order, so for example the order of computation might be

result = A[1][3] + B[3][1]

result2 = A[2][4] + B[4][0]

…etc…

Is this possible on CUDA? So far most of the examples I have seen requires the entire array to go at the same time, in order, and with corresponding elements (A[0][1] + B[0][1], etc)

Currently I have this kernel code, its mostly still C++ code, but i am trying to do it in CUDA

```
//set index for L_h
int index_h=0;
double num;
double den;
for(i=0;i<SIZEY-1;i++) {
for(j=SIZEX-2;j>-1;j--) {
num = exp(L_r_d[i][j]+L_v_d[i][j]+L_r_d[i])+1;
den = exp(L_r_d[i][j]+L_v_d[i][j])+exp(L_r_d[i]);
L_h_d[i][index_h] = log10(num/den);
index_h++;
}
index_h = 0;
}
```

You can see that I cannot simply use

```
int i = threadIdx.x;
int j = threadIdx.y;
C[j*N + i] = A[j*N + i] + B[j*N + i];
```

to index the arrays because i need to do it out-of-order.

Can anyone offer any suggestion??

Please help!! Thanks!