0

I'm confused with the NVCC documentation: 3.2.7. Options for Steering GPU Code Generation

What's the difference between

nvcc -arch=compute_50 -code=sm_50,compute_50 (equivalent to nvcc -arch=sm_50)

and

nvcc -arch=compute_50 -code=sm_50

chaosink
  • 1,329
  • 13
  • 27

1 Answers1

4

This:

nvcc -arch=compute_50 -code=sm_50,compute_50 (equivalent to nvcc -arch=sm_50)

embeds both PTX and SASS into your fatbinary. The inclusion of PTX into your fatbinary makes it more likely that your code will run on future/higher than cc 5.0 architectures.

This:

nvcc -arch=compute_50 -code=sm_50

embeds only SASS. The code will run only on an architecture that is binary compatible with cc5.0

More info is here and here.

Robert Crovella
  • 143,785
  • 11
  • 213
  • 257
  • I see that this was already explained to you [here](https://stackoverflow.com/questions/47532255/why-the-compiled-binary-gets-smaller-when-gencode-used) – Robert Crovella Dec 20 '17 at 15:26
  • Thanks for explanation and links. I also find this part [5.4. Virtual Architectures](http://docs.nvidia.com/cuda/cuda-compiler-driver-nvcc/index.html#virtual-architectures) which is very clear. Sorry for the last uncompleted comment. – chaosink Dec 20 '17 at 15:36
  • BTW, what does SASS stand for? – chaosink Dec 20 '17 at 15:43
  • SASS is the assembly code (machine code) used by NVIDIA GPUs. It is documented [here](http://docs.nvidia.com/cuda/cuda-binary-utilities/index.html#instruction-set-ref). If you're asking for how was the SASS acronym created, NVIDIA doesn't give a clear public definition that I know of. I have seen "streaming assembly" and also "shader assembly", as mentioned [here](https://stackoverflow.com/questions/9798258/what-is-sass-short-for) – Robert Crovella Dec 20 '17 at 15:50