title: Role of Warps in NVIDIA GPU architecture with OpenCL
body: <p>I'm studying OpenCL concepts as well as the CUDA architecture for a small project, and there is one thing that is unclear to me: the necessity for Warps. </p>
  
  <p>I know a lot of questions have been asked on this subject, however after having read some articles i still don't get the "meaning" of warps.</p>
  
  <p>As far as I understand (speaking for my GPU card which is a Tesla, but i guess this easily translates to other boards):</p>
  
  <ul>
  <li><p>A work-item is linked to a CUDA thread, which several of them can be executed by a Streaming Processor (SP). BTW, does a SP treats those WI in parallel?</p></li>
  <li><p>Work-items are grouped into Work-groups. Work-groups operate on a Stream Multiprocessor and can not migrate. However, work-items in a work-group can collaborate via shared memory (a.k.a local memory). One or more work-groups may be executed by a Stream MultiProcessor. BTW, does a SM treats those WG in parallel? </p></li>
  <li><p>Work-item are executed in parallel inside a work-group. However, synchronization is NOT guaranteed, that's why you need concurrent programming primitives, such as barriers.</p></li>
  </ul>
  
  <p>As far as I understand, all of this is rather a logical view than a 'physical', hardware perspective. </p>
  
  <p>If all of the above is correct, can you help me on the following. Is that true to say that:</p>
  
  <p>1 - Warps execute 32 threads or work-items simultaneously. Thus, they will 'consume' parts of a work-group. And that's why in the end you need stuff like memory fences to synchronize work-items in work groups.</p>
  
  <p>2 - The Warp scheduler allocates the registers for the 32 threads of warp when it becomes active.</p>
  
  <p>3 - Also, are executed thread in a warp synchronized at all?</p>
  
  <p>Thanks for any input on Warps, and especially why they are necessary in the CUDA architecture.</p>