title: GPU Shared Memory Bank Conflict
body: <p>I am trying to understand how bank conflicts take place.<br>
  if i have an array of size 256 in global memory and i have 256 threads in a single Block, and i want to copy the array to shared memory. therefore every thread copies one element.  </p>
  
  <pre><code>shared_a[threadIdx.x]=global_a[threadIdx.x]
  </code></pre>
  
  <p>does this simple action result in a bank conflict?  </p>
  
  <p>suppose now that the size of the array is larger than the number of threads, so i am now using this to copy the global memory to the shared memory:</p>
  
  <pre><code>tid = threadIdx.x;
  for(int i=0;tid+i&lt;N;i+=blockDim.x)
       shared_a[tid+i]=global_a[tid+i];
  </code></pre>
  
  <p>does the above code result in a bank conflict?  </p>