]> granicus.if.org Git - clang/commit
[CUDA] Invoke ptxas and fatbinary during compilation.
authorJustin Lebar <jlebar@google.com>
Thu, 14 Jan 2016 21:41:27 +0000 (21:41 +0000)
committerJustin Lebar <jlebar@google.com>
Thu, 14 Jan 2016 21:41:27 +0000 (21:41 +0000)
commit5001ed56f234095e3f01ac1f2057135efebda3b7
treec3d17b2ff4c80ad8a12dd3d1f55ed87f770be137
parent9c0291cdff2e9a819b7ecf0ffdfd63cd29d0a2c6
[CUDA] Invoke ptxas and fatbinary during compilation.

Summary:
Previously we compiled CUDA device code to PTX assembly and embedded
that asm as text in our host binary.  Now we compile to PTX assembly and
then invoke ptxas to assemble the PTX into a cubin file.  We gather the
ptx and cubin files for each of our --cuda-gpu-archs and combine them
using fatbinary, and then embed that into the host binary.

Adds two new command-line flags, -Xcuda_ptxas and -Xcuda_fatbinary,
which pass args down to the external tools.

Reviewers: tra, echristo

Subscribers: cfe-commits, jhen

Differential Revision: http://reviews.llvm.org/D16082

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@257809 91177308-0d34-0410-b5e6-96231b3b80d8
16 files changed:
include/clang/Driver/Action.h
include/clang/Driver/Options.td
include/clang/Driver/ToolChain.h
include/clang/Driver/Types.def
lib/CodeGen/CGCUDANV.cpp
lib/Driver/Action.cpp
lib/Driver/Driver.cpp
lib/Driver/ToolChains.cpp
lib/Driver/ToolChains.h
lib/Driver/Tools.cpp
lib/Driver/Tools.h
lib/Driver/Types.cpp
test/Driver/Inputs/CUDA/usr/local/cuda/bin/.keep [new file with mode: 0644]
test/Driver/cuda-arch-translation.cu [new file with mode: 0644]
test/Driver/cuda-external-tools.cu [new file with mode: 0644]
test/Driver/cuda-options.cu