Linux下CUDA+OpenMP混合编程命令详解

CUDA+OpenMP编译命令

nvcc -Xcompiler -fopenmp -arch=sm_70 XXX.cu

nvcc:

指定编译驱动器

-Xcompiler:

Specify options directly to the compiler/preprocessor(直接向编译器/预处理器指定选项)

-fopenmp:

打开openmp

对-Xcompiler这一类选项的解释:

These allow for passing options directly to the intended compilation phase. Using these, users have the ability to pass options to the lower level compilation tools without the need for nvcc to know about each and every such option.(可以通过这些选项直接达到预期的编译阶段,使用这些选项,使用者有能力通过这些选项达到低级的编译工具,不需要nvcc知道每一个选项)(个人理解:-Xcompiler可以链接到其他工具来执行后面的选项,比如上面的-fopenmp)

-arch:

指定虚拟计算架构(virtual compute architecture)的类型。(?)

-code:

指定真是GPU架构(Real sm architecture)的类型。(?)

-arch=sm_70:

等价于:-arch=compute_70 -code=sm_70,compute_70

你可能感兴趣的:(Problem,Be,Solved)