[PATCH] D123471: [CUDA] Create offloading entries when using the new driver

Artem Belevich via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri May 6 14:55:58 PDT 2022


tra added inline comments.


================
Comment at: clang/lib/CodeGen/CGCUDARuntime.h:56-70
+    enum OffloadRegionEntryKindFlag : uint32_t {
+      /// Mark the region entry as a kernel.
+      OffloadRegionKernelEntry = 0x0,
+    };
+
+    /// The kind flag of the global variable entry.
+    enum OffloadVarEntryKindFlag : uint32_t {
----------------
jhuber6 wrote:
> tra wrote:
> > We can also fold both enums into one, as we still have the ambiguity of what `flags=0` means. 
> They're selected based on the size, if the size is zero it uses the kernel flags, otherwise it uses the variable flags. That's how it's done for OpenMP. I figured keeping the enums separate makes that more clear.
> They're selected based on the size, if the size is zero it uses the kernel flags, otherwise it uses the variable flags. 

Why use two different enums, when one would do? It does not buy us anything other than unnecessary additional complexity.



Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D123471/new/

https://reviews.llvm.org/D123471



More information about the cfe-commits mailing list