Skip to content

Commit 7f415e4

Browse files
authored
[clang][SYCL] Disable float128 device mode diagnostic (#128513)
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 e27fe2e commit 7f415e4

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
@@ -4847,7 +4847,8 @@ void Sema::AddModeAttr(Decl *D, const AttributeCommonInfo &CI,
48474847

48484848
if (NewElemTy.isNull()) {
48494849
// Only emit diagnostic on host for 128-bit mode attribute
4850-
if (!(DestWidth == 128 && getLangOpts().CUDAIsDevice))
4850+
if (!(DestWidth == 128 &&
4851+
(getLangOpts().CUDAIsDevice || getLangOpts().SYCLIsDevice)))
48514852
Diag(AttrLoc, diag::err_machine_mode) << 1 /*Unsupported*/ << Name;
48524853
return;
48534854
}

clang/test/SemaSYCL/float128.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// RUN: %clang_cc1 -triple spir64 -fsycl-is-device -verify -fsyntax-only %s
22
// RUN: %clang_cc1 -triple x86_64-linux-gnu -fsycl-is-device -fsyntax-only %s
33

4+
typedef _Complex float __cfloat128 __attribute__ ((__mode__ (__TC__)));
45
typedef __float128 BIGTY;
56

67
template <class T>

0 commit comments

Comments
 (0)