Hard
Ranking three shared-memory access patterns across one warp
Shared memory has 32 banks, 4 bytes wide, bank = (byte_address / 4) mod 32. float sdata[64] is declared in shared memory. A single warp (threadIdx.x 0-31) performs each of the three accesses below in separate kernels. Rank them from fastest to slowest.
kernel.cu
__shared__ float sdata[64];
// Pattern 1
float a = sdata[threadIdx.x];
// Pattern 2
float b = sdata[0];
// Pattern 3
float c = sdata[threadIdx.x * 2];8 of 46 in GPU / CUDA