I am little bit confused about the ‘code=sm_X’ option within the ‘-gencode’ statement.
An example: What does the NVCC compiler option
embed in the library ?
Only the machine code (cubin code) for GPUs with CC 1.3, or also the PTX code for GPUs with CC 1.3 ?
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”.
From that, I would infer that the given compiler option only embeds machine code for GPUs with CC 1.3 and no PTX code. This would mean that it would not 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.
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.