title: Does 'code=sm_X' embed only binary (cubin) code, or also PTX code, or both?
body: <p>I am little bit confused about the 'code=sm_X' option within the '-gencode' statement.</p>
  
  <p>An example: What does the NVCC compiler option</p>
  
  <pre><code>-gencode arch=compute_13,code=sm_13
  </code></pre>
  
  <p>embed in the library ?</p>
  
  <p>Only the machine code (cubin code) for GPUs with CC 1.3, or <strong>also</strong> the PTX code for GPUs with CC 1.3 ?</p>
  
  <p>In the 'Maxwell compatibility guide', it is stated "Only the back-end target versions(s) specified by the 'code=' clause will be retained in the resulting binary". </p>
  
  <p>From that, I would infer that the given compiler option only embeds machine code for GPUs with CC 1.3 and <em>no</em> PTX code. This would mean that it would <strong>not</strong> be possible to run this library e.g. on aa Maxwell generation card, as there is no PTX code embeded within the library from which the machine code could be 'just-in-time' (JIT) compiled.</p>
  
  <p>On the other side, on the GTC 2013 presentation 'Introduction to the CUDA Toolkit as an Application Build Tool' by NVIDIA it is stated that the '-gencode arch=compute_13,code=sm_13' is enough for all GPUs with CC >= 1.3, and that with this compiler option for GPUs with CC > 1.3 the machine code is JIT-ed from the PTX code. So, the information given in the Maxwell compatibility guide and this GTC presentation is conflicting in my opinion.</p>