Skip to content

Commit ed3e013

Browse files
committed
[SYCL] Apply comments, fix tests after rebase
Signed-off-by: Mariya Podchishchaeva <mariya.podchishchaeva@intel.com>
1 parent 22eb318 commit ed3e013

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed

clang/include/clang/Sema/Sema.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12096,10 +12096,11 @@ class Sema final {
1209612096
///
1209712097
/// Example usage:
1209812098
///
12099-
/// Asm is not allowed in SYCL device code.
12099+
/// Variables with thread storage duration are not allowed to be used in SYCL
12100+
/// device code
1210012101
/// if (getLangOpts().SYCLIsDevice)
12101-
/// SYCLDiagIfDeviceCode(AsmLoc, diag::err_sycl_restrict)
12102-
/// << KernelUseAssembly;
12102+
/// SYCLDiagIfDeviceCode(Loc, diag::err_thread_unsupported);
12103+
/// // Otherwise, continue parsing as normal.
1210312104
DeviceDiagBuilder SYCLDiagIfDeviceCode(SourceLocation Loc, unsigned DiagID);
1210412105

1210512106
/// Checks if Callee function is a device function and emits

clang/lib/Sema/SemaType.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1500,7 +1500,8 @@ static QualType ConvertDeclSpecToType(TypeProcessingState &state) {
15001500
Result = Context.DoubleTy;
15011501
break;
15021502
case DeclSpec::TST_float128:
1503-
if (S.getLangOpts().SYCLIsDevice)
1503+
if (!S.Context.getTargetInfo().hasFloat128Type() &&
1504+
S.getLangOpts().SYCLIsDevice)
15041505
S.SYCLDiagIfDeviceCode(DS.getTypeSpecTypeLoc(),
15051506
diag::err_type_unsupported)
15061507
<< "__float128";

clang/test/SemaSYCL/sycl-restrict.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ struct OverloadedNewDelete {
5959

6060
bool isa_B(A *a) {
6161
Check_User_Operators::Fraction f1(3, 8), f2(1, 2), f3(10, 2);
62-
// expected-note@+1 {{called by 'isa_B'}}
6362
if (f1 == f2) return false;
6463

6564
Check_VLA_Restriction::restriction(7);
@@ -77,7 +76,6 @@ bool isa_B(A *a) {
7776

7877
template<typename N, typename L>
7978
__attribute__((sycl_kernel)) void kernel1(L l) {
80-
// expected-note@+1 3{{called by 'kernel1}}
8179
l();
8280
}
8381
}
@@ -141,7 +139,6 @@ void usage(myFuncDef functionPtr) {
141139
b.f();
142140
Check_RTTI_Restriction::kernel1<class kernel_name>([]() {
143141
Check_RTTI_Restriction::A *a;
144-
// expected-note@+1 3{{called by 'operator()'}}
145142
Check_RTTI_Restriction::isa_B(a); });
146143

147144
// expected-error@+1 {{__float128 is not supported on this target}}
@@ -180,9 +177,12 @@ int use2 ( a_type ab, a_type *abp ) {
180177
// expected-note@+1 {{called by 'use2'}}
181178
eh_not_ok();
182179
Check_RTTI_Restriction:: A *a;
180+
// expected-note@+1 2{{called by 'use2'}}
183181
Check_RTTI_Restriction:: isa_B(a);
182+
// expected-note@+1 {{called by 'use2'}}
184183
usage(&addInt);
185184
Check_User_Operators::Fraction f1(3, 8), f2(1, 2), f3(10, 2);
185+
// expected-note@+1 {{called by 'use2'}}
186186
if (f1 == f2) return false;
187187
}
188188

@@ -191,7 +191,7 @@ __attribute__((sycl_kernel)) void kernel_single_task(Func kernelFunc) {
191191
kernelFunc();
192192
a_type ab;
193193
a_type *p;
194-
// expected-note@+1 {{called by 'kernel_single_task'}}
194+
// expected-note@+1 5{{called by 'kernel_single_task'}}
195195
use2(ab, p);
196196
}
197197

0 commit comments

Comments
 (0)