[PATCH] D29660: [OpenMP] Add flag for overwriting default PTX version for OpenMP targets

Alexey Bataev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 5 13:10:39 PDT 2017


ABataev added inline comments.


================
Comment at: lib/Driver/ToolChains/Cuda.cpp:495-506
+
+  StringRef PtxVersion = DriverArgs.getLastArgValue(
+        options::OPT_fopenmp_ptx_EQ);
+
   CC1Args.push_back("+ptx42");
 
+  if (DeviceOffloadingKind == Action::OFK_OpenMP &&
----------------
I don't like this kind of code. It is better to make like this:
```
if (DeviceOffloadingKind == Action::OFK_OpenMP)
  CC1Args.push_back(DriverArgs.getLastArgValue(options::OPT_fopenmp_ptx_EQ, "+ptx42"));
else
  CC1Args.push_back("+ptx42");
```
or something like this


Repository:
  rL LLVM

https://reviews.llvm.org/D29660





More information about the cfe-commits mailing list