[PATCH] D43852: [OpenMP] Extend NVPTX SPMD implementation of combined constructs

Jonas Hahnfeld via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Feb 28 06:54:18 PST 2018


Hahnfeld added inline comments.


================
Comment at: lib/Driver/ToolChains/Clang.cpp:3976-3977
+      // cuda-mode flag
+      Args.AddLastArg(CmdArgs, options::OPT_fopenmp_cuda_mode,
+                      options::OPT_fno_openmp_cuda_mode);
       break;
----------------
I think most other boolean options do the following:
```lang=c++
if (Args.hasFlag(...))
  CmdArgs.push_back("...")
```

Is there a reason we need this differently here?


================
Comment at: lib/Frontend/CompilerInvocation.cpp:2533
+      Args.hasFlag(OPT_fopenmp_cuda_mode, OPT_fno_openmp_cuda_mode,
+                   /*Default=*/false);
+
----------------
ABataev wrote:
> After some thoughts I think it is better to make `true` by default, because `Generic` mode is not completed yet.
Yes, I'd also expect all SPMD constructs to default to CUDA mode. Or is there a case where this doesn't work? If yes, that should be explained in the summary.


Repository:
  rC Clang

https://reviews.llvm.org/D43852





More information about the cfe-commits mailing list