[clang] [CUDA] Add support for __grid_constant__ attribute (PR #114589)

Akshay Deodhar via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 5 10:57:58 PST 2024


================
@@ -12222,8 +12222,17 @@ bool Sema::CheckFunctionDeclaration(Scope *S, FunctionDecl *NewFD,
             << NewFD;
     }
 
-    if (!Redeclaration && LangOpts.CUDA)
+    if (!Redeclaration && LangOpts.CUDA) {
----------------
akshayrdeodhar wrote:

Makes sense. I also realized that you'd already addressed this in the description 🙂 
> One notable difference from NVCC is that the attribute can be used regardless of the targeted GPU. On the older GPUs it will just be ignored. The attribute is a performance hint, and does not warrant a hard error if compiler can't benefit from it on a particular GPU variant.

https://github.com/llvm/llvm-project/pull/114589


More information about the cfe-commits mailing list