in one example from NVIDIA that i’m looking at has the following;

*global* void kernel ( Grid P, Grid R, …)

{

int i = blockIdx.x*blockDim.x + threadIdx.x;
int j = blockIdx.y*blockDim.y + threadIdx.y;

int k = blockIdx.z*blockDim.z + threadIdx.z;

int idx = i*R.istride + j*R.jstride + k;

}

I know threadIdx.x is built in variables like threadIdx.y and threadIdx.z…

Is R.stride also a built-in variable ?

or, its just saying i need some kind of looping for R that didnt show-up in the example to make it simple…

any comments are appreciated and thanks in advance.

the example is from “Optimizing Memory Performance : Gauss-Seidel Solver” from NVIDIA.