title: How do CUDA blocks/warps/threads map onto CUDA cores?
body: <p>I have been using CUDA for a few weeks, but I have some doubts about the allocation of blocks/warps/thread.
  <strong>I am studying the architecture from a didactic point of view</strong> (university project), so reaching peak performance is not my concern.</p>
  
  <p>First of all, I would like to understand if I got these facts straight:</p>
  
  <ol>
  <li><p>The programmer writes a kernel, and organize its execution in a grid of thread blocks.</p></li>
  <li><p>Each block is assigned to a Streaming Multiprocessor (SM). Once assigned it cannot migrate to another SM.</p></li>
  <li><p>Each SM splits its own blocks into Warps (currently with a maximum size of 32 threads). All the threads in a warp executes concurrently on the resources of the SM.</p></li>
  <li><p>The actual execution of a thread is performed by the CUDA Cores contained in the SM. There is no specific mapping between threads and cores.</p></li>
  <li><p>If a warp contains 20 thread, but currently there are only 16 cores available, the warp will not run.</p></li>
  <li><p>On the other hand if a block contains 48 threads, it will be split into 2 warps and they will execute in parallel provided that enough memory is available.</p></li>
  <li><p>If a thread starts on a core, then it is stalled for memory access or for a long floating point operation, its execution could resume on a different core.</p></li>
  </ol>
  
  <p>Are they correct?</p>
  
  <p>Now, I have a GeForce 560 Ti so according to the specifications it is equipped with 8 SM, each containing 48 CUDA cores (384 cores in total).</p>
  
  <p>My goal is to make sure that every core of the architecture executes the SAME instructions. Assuming that my code will not require more register than the ones available in each SM, I imagined different approaches:</p>
  
  <ol>
  <li><p>I create 8 blocks of 48 threads each, so that each SM has 1 block to execute. In this case will the 48 threads execute in parallel in the SM (exploiting all the 48 cores available for them)?</p></li>
  <li><p>Is there any difference if I launch 64 blocks of 6 threads? (Assuming that they will be mapped evenly among the SMs)</p></li>
  <li><p>If I "submerge" the GPU in scheduled work (creating 1024 blocks of 1024 thread each, for example) is it reasonable to assume that all the cores will be used at a certain point, and will perform the same computations (assuming that the threads never stall)?</p></li>
  <li><p>Is there any way to check these situations using the profiler?</p></li>
  <li><p>Is there any reference for this stuff? I read the CUDA Programming guide and the chapters dedicated to hardware architecture in "Programming Massively Parallel Processors" and "CUDA Application design and development"; but I could not get a precise answer.</p></li>
  </ol>