Question

}

2-

3. Consider the three kernels below. Assume that you have 4 blocks each has 4 threads

In each case, write the value of the array a

global void kernel(int 'a)

int idx-blockidx.x"blockDim.x+ threadidx.x;

a[idx]-7;

global_ void kernel (int *a)

int idx=blockldx.x"blockDim.x + threadldx.x;

a[idx]-blockldx.x;

global_ void kernel(int *a)

{

int idx=blockldx.x"blockDim.x + threadldx.x;

a[idx] = threadldx.x;

}

plution:

1-

Fig: 1