Skip to content

Commit c458aed

Browse files
author
iclsrc
committed
Merge from 'sycl' to 'sycl-web'
2 parents 7a1622a + 24eb1ab commit c458aed

File tree

16 files changed

+291
-402
lines changed

16 files changed

+291
-402
lines changed

clang/include/clang/Basic/Attr.td

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1233,6 +1233,13 @@ def SYCLKernel : InheritableAttr {
12331233
let Documentation = [SYCLKernelDocs];
12341234
}
12351235

1236+
def SYCLSpecialClass: InheritableAttr {
1237+
let Spellings = [Clang<"sycl_special_class">];
1238+
let Subjects = SubjectList<[CXXRecord]>;
1239+
let LangOpts = [SYCLIsDevice, SilentlyIgnoreSYCLIsHost];
1240+
let Documentation = [SYCLSpecialClassDocs];
1241+
}
1242+
12361243
// Marks functions which must not be vectorized via horizontal SIMT widening,
12371244
// e.g. because the function is already vectorized. Used to mark SYCL
12381245
// explicit SIMD kernels and functions.

clang/include/clang/Basic/AttrDocs.td

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -405,6 +405,26 @@ The SYCL kernel in the previous code sample meets these expectations.
405405
}];
406406
}
407407

408+
def SYCLSpecialClassDocs : Documentation {
409+
let Category = DocCatStmt;
410+
let Content = [{
411+
The ``__attribute__((sycl_special_class))`` attribute is used in SYCL
412+
headers to indicate that a class or a struct needs additional handling when
413+
it is passed from host to device. Please note that this is an attribute that is
414+
used for internal implementation and not intended to be used by external users.
415+
It is used for ``accessor``, ``sampler`` , or ``stream`` classes.
416+
The types that own this attribute are excluded from device-copyable and other
417+
type-legalization steps.
418+
419+
.. code-block:: c++
420+
class __attribute__((sycl_special_class)) accessor {
421+
422+
private:
423+
void __init() {}
424+
};
425+
}];
426+
}
427+
408428
def SYCLSimdDocs : Documentation {
409429
let Category = DocCatFunction;
410430
let Content = [{

clang/lib/Sema/SPIRVBuiltins.td

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -722,12 +722,6 @@ foreach VSize1 = [Vec2, Vec4, Vec8, Vec16] in {
722722

723723
// 2.8. Misc instructions
724724

725-
let IsVariadic = 1 in {
726-
foreach name = ["printf"] in {
727-
def : OCLSPVBuiltin<name, [Int, PointerType<ConstType<TrueChar>, ConstantAS>]>;
728-
}
729-
}
730-
731725
foreach name = ["prefetch"] in {
732726
def : OCLSPVBuiltin<name, [Void, PointerType<ConstType<AGenTypeN>, GlobalAS>, Size]>;
733727
}

clang/lib/Sema/SemaDeclAttr.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9796,6 +9796,9 @@ static void ProcessDeclAttribute(Sema &S, Scope *scope, Decl *D,
97969796
case ParsedAttr::AT_SYCLSimd:
97979797
handleSimpleAttribute<SYCLSimdAttr>(S, D, AL);
97989798
break;
9799+
case ParsedAttr::AT_SYCLSpecialClass:
9800+
handleSimpleAttribute<SYCLSpecialClassAttr>(S, D, AL);
9801+
break;
97999802
case ParsedAttr::AT_SYCLDevice:
98009803
handleSYCLDeviceAttr(S, D, AL);
98019804
break;

0 commit comments

Comments
 (0)