What is the purpose of using multiple “arch” flags in Nvidia's NVCC compiler?

后端 未结 2 901
执笔经年
执笔经年 2020-11-27 12:43

I\'ve recently gotten my head around how NVCC compiles CUDA device code for different compute architectures.

From my understanding, when using NVCC\'s -gencode optio

2条回答
  •  余生分开走
    2020-11-27 13:30

    The purpose of multiple -arch flags is to use the __CUDA_ARCH__ macro for conditional compilation (ie, using #ifdef) of differently-optimized code paths.

    See here: http://docs.nvidia.com/cuda/cuda-compiler-driver-nvcc/index.html#virtual-architecture-identification-macro

提交回复
热议问题