Skip to content

Commit fa39fa2

Browse files
authored
[clang][SYCL] Disable float128 device mode diagnostic (#128513) (#17430)
Cherry-pick of: llvm/llvm-project#128513 Fixes: #16903 ------ This diagnostic is disabled for device compilation as float128 is not supported on the device side. Other diagnostics are already covering the cases where float128 is actually used in the kernel code, and it's already tested for in the existing test. This is expanding on the patch 318bff6 that handled this for cuda compilation.
1 parent b2db12a commit fa39fa2

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

clang/lib/Sema/SemaDeclAttr.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4725,7 +4725,8 @@ void Sema::AddModeAttr(Decl *D, const AttributeCommonInfo &CI,
47254725

47264726
if (NewElemTy.isNull()) {
47274727
// Only emit diagnostic on host for 128-bit mode attribute
4728-
if (!(DestWidth == 128 && getLangOpts().CUDAIsDevice))
4728+
if (!(DestWidth == 128 &&
4729+
(getLangOpts().CUDAIsDevice || getLangOpts().SYCLIsDevice)))
47294730
Diag(AttrLoc, diag::err_machine_mode) << 1 /*Unsupported*/ << Name;
47304731
return;
47314732
}

clang/test/SemaSYCL/float128.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
sycl::queue deviceQueue;
77

8+
typedef _Complex float __cfloat128 __attribute__ ((__mode__ (__TC__)));
89
typedef __float128 BIGTY;
910

1011
template <class T>

0 commit comments

Comments
 (0)