Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions clang/lib/Sema/SemaDeclAttr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10710,6 +10710,11 @@ void Sema::AddSYCLDeviceHasAttr(Decl *D, const AttributeCommonInfo &CI,
}

static void handleSYCLDeviceHasAttr(Sema &S, Decl *D, const ParsedAttr &A) {
// Ignore the attribute if compiling for the host side because aspects may not
// be marked properly for such compilation
if (!S.Context.getLangOpts().SYCLIsDevice)
return;

SmallVector<Expr *, 5> Args;
for (unsigned I = 0; I < A.getNumArgs(); ++I)
Args.push_back(A.getArgAsExpr(I));
Expand Down Expand Up @@ -10751,6 +10756,11 @@ void Sema::AddSYCLUsesAspectsAttr(Decl *D, const AttributeCommonInfo &CI,
}

static void handleSYCLUsesAspectsAttr(Sema &S, Decl *D, const ParsedAttr &A) {
// Ignore the attribute if compiling for the host because aspects may not be
// marked properly for such compilation
if (!S.Context.getLangOpts().SYCLIsDevice)
return;

SmallVector<Expr *, 5> Args;
for (unsigned I = 0; I < A.getNumArgs(); ++I)
Args.push_back(A.getArgAsExpr(I));
Expand Down
3 changes: 2 additions & 1 deletion sycl/include/sycl/detail/defines.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
#define __SYCL_SPECIAL_CLASS
#endif

#if __has_cpp_attribute(__sycl_detail__::sycl_type)
#if __has_cpp_attribute(__sycl_detail__::sycl_type) && \
(defined __SYCL_DEVICE_ONLY__)
#define __SYCL_TYPE(x) [[__sycl_detail__::sycl_type(x)]]
#else
#define __SYCL_TYPE(x)
Expand Down