When compiling your CUDA code, you have to select for which architecture your code is being generated. nvcc provides two parameters to specify this architecture, basically:
archspecifies the virtual arquictecture, which can becompute_10,compute_11, etc.codespecifies the real architecture, which can besm_10,sm_11, etc.
So a command like this:
nvcc x.cu -arch=compute_13 -code=sm_13
Will generate ‘cubin’ code for devices with 1.3 compute capability. Please correct me if I’m wrong. Which I would like to know is which are the default values for these two parameters? Which is the default architecture that nvcc uses when no value for arch or code is specified?
Ok, I’ve finally managed to discover the default values. My fault for not reading the whole chapter on GPU compilation in the NVCC documentation from the beginning to the very very end. So,
is equivalent for
Those are the default values. The compilation is performed by default to the virtual architecture
compute_10, and thea.outthat results from the compilation will include the CUBIN code for thesm_10real architecture, and the PTX assembly code for thecompute_10architecture, which will be recompiled ‘just in time’ by the CUDA driver if your architecture is greater thansm_10.