[PATCH] D140226: [NVPTX] Introduce attribute to mark kernels without a language mode

Artem Belevich via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Dec 16 12:55:00 PST 2022


tra added a comment.

LGTM.

General question -- what happens now that the `global` and `launch_bounds` are target-specific as opposed to language-specific, if they happen to be used in a C++ compilation targeting `x86`? I assume they will still be ignored, right?



================
Comment at: clang/include/clang/Basic/Attr.td:1198
 
-def CUDAGlobal : InheritableAttr {
-  let Spellings = [GNU<"global">, Declspec<"__global__">];
+def CUDAGlobal : InheritableAttr, TargetSpecificAttr<TargetNVPTX> {
+  let Spellings = [GNU<"global">, Declspec<"__global__">, Clang<"nvptx_kernel">];
----------------
Nice.

This reminded me that we have a project compiling CUDA, but targeting SPIR-V instead of NVPTX. It looks like this will likely break them. The project is out-of-tree, but I'd still need to figure out how to keep them working.  I guess it would be easy enough to expand TargetNVPTX to TargetNVPTXOrSpirV. I'm mostly concerned about logistics of making it happen without disruption.




Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D140226



More information about the cfe-commits mailing list