Skip to content

Commit b4b243b

Browse files
committed
Respond to review comments
Signed-off-by: Zahira Ammarguellat <[email protected]>
1 parent be2a869 commit b4b243b

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

clang/include/clang/Basic/DiagnosticSemaKinds.td

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11610,6 +11610,8 @@ def err_sycl_expected_finalize_method : Error<
1161011610
def ext_sycl_2020_attr_spelling : ExtWarn<
1161111611
"use of attribute %0 is a SYCL 2020 extension">,
1161211612
InGroup<Sycl2017Compat>;
11613+
def err_sycl_esimd_not_supported_for_type : Error<
11614+
"type %0 is not support in 'esimd' context">;
1161311615

1161411616
// errors of expect.with.probability
1161511617
def err_probability_not_constant_float : Error<

clang/lib/Sema/SemaSYCL.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1567,6 +1567,7 @@ void KernelObjVisitor::visitArray(const CXXRecordDecl *Owner, FieldDecl *Field,
15671567
// A type to check the validity of all of the argument types.
15681568
class SyclKernelFieldChecker : public SyclKernelFieldHandler {
15691569
bool IsInvalid = false;
1570+
bool IsSIMD = false;
15701571
DiagnosticsEngine &Diag;
15711572
// Check whether the object should be disallowed from being copied to kernel.
15721573
// Return true if not copyable, false if copyable.
@@ -1663,7 +1664,12 @@ class SyclKernelFieldChecker : public SyclKernelFieldHandler {
16631664
if (TAL.size() > 5)
16641665
return checkPropertyListType(TAL.get(5), Loc.getBegin());
16651666
}
1666-
return false;
1667+
if (IsSIMD && !Util::isSyclType(Ty, "accessor", true /*Tmp*/))
1668+
return SemaRef.Diag(Loc.getBegin(),
1669+
diag::err_sycl_esimd_not_supported_for_type)
1670+
<< RecD;
1671+
else
1672+
return false;
16671673
}
16681674

16691675
public:

0 commit comments

Comments
 (0)