File tree 1 file changed +27
-27
lines changed
clang/include/clang/Basic 1 file changed +27
-27
lines changed Original file line number Diff line number Diff line change @@ -434,43 +434,43 @@ The syntax of the attribute is as follows:
434
434
435
435
.. code-block:: c++
436
436
437
- class __attribute__((sycl_special_class)) accessor {};
438
- class [[clang::sycl_special_class]] accessor {};
437
+ class __attribute__((sycl_special_class)) accessor {};
438
+ class [[clang::sycl_special_class]] accessor {};
439
439
440
440
This is a code example that illustrates the use of the attribute:
441
441
442
442
.. code-block:: c++
443
443
444
- class __attribute__((sycl_special_class)) SpecialType {
445
- int F1;
446
- int F2;
447
- void __init(int f1) {
448
- F1 = f1;
449
- F2 = f1;
450
- }
451
- void __finalize() {}
452
- public:
453
- SpecialType() = default;
454
- int getF2() const { return F2; }
455
- };
456
-
457
- int main () {
458
- SpecialType T;
459
- cgh.single_task([=] {
460
- T.getF2();
461
- });
462
- }
444
+ class __attribute__((sycl_special_class)) SpecialType {
445
+ int F1;
446
+ int F2;
447
+ void __init(int f1) {
448
+ F1 = f1;
449
+ F2 = f1;
450
+ }
451
+ void __finalize() {}
452
+ public:
453
+ SpecialType() = default;
454
+ int getF2() const { return F2; }
455
+ };
456
+
457
+ int main () {
458
+ SpecialType T;
459
+ cgh.single_task([=] {
460
+ T.getF2();
461
+ });
462
+ }
463
463
464
464
This would trigger the following kernel entry point in the AST:
465
465
466
466
.. code-block:: c++
467
467
468
- void __sycl_kernel(int f1) {
469
- SpecialType T;
470
- T.__init(f1);
471
- ...
472
- T.__finalize()
473
- }
468
+ void __sycl_kernel(int f1) {
469
+ SpecialType T;
470
+ T.__init(f1);
471
+ ...
472
+ T.__finalize()
473
+ }
474
474
}];
475
475
}
476
476
You can’t perform that action at this time.
0 commit comments