[clang] [clang][SYCL] Disable float128 device mode diagnostic (PR #128513)

Nicolas Miller via cfe-commits cfe-commits at lists.llvm.org
Mon Feb 24 05:59:07 PST 2025


================
@@ -4700,7 +4700,8 @@ void Sema::AddModeAttr(Decl *D, const AttributeCommonInfo &CI,
 
   if (NewElemTy.isNull()) {
     // Only emit diagnostic on host for 128-bit mode attribute
-    if (!(DestWidth == 128 && getLangOpts().CUDAIsDevice))
+    if (!(DestWidth == 128 &&
+          (getLangOpts().CUDAIsDevice || getLangOpts().SYCLIsDevice)))
----------------
npmiller wrote:

Side-note `CUDAIsDevice || SYCLIsDevice` seems like a pretty common pattern and I believe HIP also uses `CUDAIsDevice`, it could be good to refactor in the future this to have a common "device compilation" option if possible.

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


More information about the cfe-commits mailing list