[PATCH] D94884: [Clang][OpenMP] Include header for CUDA builtin vars into OpenMP wrapper header

Johannes Doerfert via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 18 14:28:12 PST 2021


jdoerfert added inline comments.


================
Comment at: clang/lib/Headers/__clang_cuda_builtin_vars.h:52
+      property(get = __fetch_builtin_##NAME##_##FIELD)) unsigned int FIELD;
+#endif
 
----------------
Why do we need these __fetch_builtins (for C). They have a different name than in the C++ variant anyway. In C we could just not define the __fetch stuff but only the Field. So `gridDim.x` will work fine.


================
Comment at: clang/lib/Headers/__clang_cuda_builtin_vars.h:95
   // uint3).  This function is defined after we pull in vector_types.h.
-  __attribute__((device)) operator dim3() const;
-  __attribute__((device)) operator uint3() const;
+  DEVICE operator dim3() const;
+  DEVICE operator uint3() const;
----------------
tianshilei1992 wrote:
> How can we deal with the conversion in C?
We don't. Given that CUDA is C++ we can just limit us to the C subset. 


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D94884



More information about the cfe-commits mailing list