]> granicus.if.org Git - clang/commitdiff
[OpenMP] Pass -v to PTXAS if it was passed to the driver.
authorGheorghe-Teodor Bercea <gheorghe-teod.bercea@ibm.com>
Mon, 7 Aug 2017 20:19:23 +0000 (20:19 +0000)
committerGheorghe-Teodor Bercea <gheorghe-teod.bercea@ibm.com>
Mon, 7 Aug 2017 20:19:23 +0000 (20:19 +0000)
Summary: When compiling code being offloaded by OpenMP to an NVIDIA GPU, pass the -v to PTXAS if it was passed to the CLANG driver.

Reviewers: arpith-jacob, caomhin, carlo.bertolli, ABataev, jlebar, hfinkel, tstellar

Reviewed By: jlebar

Subscribers: Hahnfeld, rengolin, cfe-commits

Differential Revision: https://reviews.llvm.org/D29644

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@310295 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Driver/ToolChains/Cuda.cpp
test/Driver/cuda-external-tools.cu

index 9568f93b7819472f37147f2618577c8bac2ddd5c..70f472fb025f3f9fa6a06a963ddf7c4471f8c37f 100644 (file)
@@ -274,6 +274,10 @@ void NVPTX::Assembler::ConstructJob(Compilation &C, const JobAction &JA,
     CmdArgs.push_back("-O0");
   }
 
+  // Pass -v to ptxas if it was passed to the driver.
+  if (Args.hasArg(options::OPT_v))
+    CmdArgs.push_back("-v");
+
   CmdArgs.push_back("--gpu-name");
   CmdArgs.push_back(Args.MakeArgString(CudaArchToString(gpu_arch)));
   CmdArgs.push_back("--output-file");
index 809b8507683b6aa2eff2512c0fcf8328e9ded1ee..63b74fc06b9b575e444a7ec4362b5b254ff34fe6 100644 (file)
 // RUN: %clang -### -target x86_32-apple-macosx -c %s 2>&1 \
 // RUN: | FileCheck -check-prefix ARCH32 -check-prefix SM20 %s
 
+// Check that CLANG forwards the -v flag to PTXAS.
+// RUN:   %clang -### -save-temps -no-canonical-prefixes -v %s 2>&1 \
+// RUN:   | FileCheck -check-prefix=CHK-PTXAS-VERBOSE %s
+
 // Match clang job that produces PTX assembly.
 // CHECK: "-cc1" "-triple" "nvptx64-nvidia-cuda"
 // SM20: "-target-cpu" "sm_20"
 // Match the clang job for host compilation.
 // CHECK: "-cc1" "-triple" "x86_64--linux-gnu"
 // CHECK-SAME: "-fcuda-include-gpubinary" "[[FATBINARY]]"
+
+// CHK-PTXAS-VERBOSE: ptxas{{.*}}" "-v"
\ No newline at end of file