zoukankan      html  css  js  c++  java
  • NVCC编译选项含义解析

    NVCC编译

    nvcc 是cuda程序的编译器。

    1. 编译阶段

    用于指定编译阶段最基本的编译参数。

    • -c: 同gcc,只预处理、编译和汇编为.o文件,不link
    • -lib:生成一个库文件,windows上为a.lib,其他为a.a后缀
    • -cuda:编译所有的.cu文件为.cu.cpp.ii
    • -cubin:编译所有的.cu/.gpu/.ptx文件为.cubin文件

    2. 文件 & 路径配置

    • -odir:指定输出文件的目录
    • -ccbin:指定host编译器的所在路径,如-ccbin cc
    • -cudart:指定CUDA runtime library使用类型(none, shared, static);默认为static
    • -include filename:添加头文件filename

    3. 编译器行为

    • -m:指定平台结构为32 或者 64

    4. 编译工具内部选项

    • -Xcompiler:用于直接指定编译器或预处理器的选项
    • -Xlinker:用于直接指定链接器的选项
    • -Xarchive:用于直接指定库管理器的选项
    • -Xptxas -v:显示代码生成的统计结果
    • -Xptxas -dlcm=cg:关闭L1 cache
  • 相关阅读:
    【iOS】找工作的面试题集锦
    APP项目优化--启动速度优化篇
    【Swift】Timer定时器到底准不准确?
    leetcode刷题 495~
    leetcode刷题 464~
    leetcode刷题 441~
    leetcode刷题 420~
    leetcode刷题 396~
    leetcode刷题 373~
    leetcode刷题 307~
  • 原文地址:https://www.cnblogs.com/CocoML/p/14643392.html
Copyright © 2011-2022 走看看