@@ -78,7 +78,7 @@ Roland Schulz, Intel
78
78
79
79
This extension is written against the SYCL 2020 specification, revision 3.
80
80
81
- It also depends on the `sycl::ext::oneapi::property_list ` extension.
81
+ It also depends on the `SYCL_EXT_ONEAPI_PROPERTY_LIST ` extension.
82
82
83
83
== Overview
84
84
@@ -171,14 +171,14 @@ A `device_global` on a given device maintains its state (address of the allocati
171
171
[source,c++]
172
172
----
173
173
namespace sycl::ext::oneapi {
174
- template <typename T, typename propertyListT = property_list<>>
174
+ template <typename T, typename PropertyListT = property_list<>>
175
175
class device_global {
176
176
...
177
177
----
178
178
179
- `device_global` is a class template, parameterized by the type of the underlying allocation _T_, and a list of properties _propertyListT_ . The type of the allocation _T_ also encodes the size of the allocation for potentially multidimensional array types.
179
+ `device_global` is a class template, parameterized by the type of the underlying allocation _T_, and a list of properties _PropertyListT_ . The type of the allocation _T_ also encodes the size of the allocation for potentially multidimensional array types.
180
180
181
- _T_ is restricted to types that have a trivial destructor and a trivial default constructor in this revision of the specification (the constructor restriction may be partially relaxed in a future revision). _propertyListT_ enables properties to be associated with a `device_global`.
181
+ _T_ is restricted to types that have a trivial destructor and a trivial default constructor in this revision of the specification (the constructor restriction may be partially relaxed in a future revision). _PropertyListT_ enables properties to be associated with a `device_global`.
182
182
183
183
Since _T_ is restricted to types with trivial default constructors in this version of the specification, there are no non-default `device_global` constructors, and therefore no initialization values may be specified for the content of a `device_global` allocation on a device.
184
184
@@ -229,7 +229,7 @@ The section below and the table following describe the constructors, member func
229
229
----
230
230
namespace sycl::ext::oneapi {
231
231
232
- template <typename T, typename property_listT = property_list<>>
232
+ template <typename T, typename PropertyListT = property_list<>>
233
233
class device_global {
234
234
public:
235
235
using element_type = std::remove_extent_t<T>;
@@ -431,74 +431,79 @@ global variable that isn’t `const` or `constexpr` unless the variable is of ty
431
431
Add the following functions to the `sycl::queue` interface described in Section 4.6.5.1 of
432
432
the SYCL 2020 specification.
433
433
434
+ [NOTE]
435
+ ====
436
+ A pointer to the allocation within a `device_global` may not be obtained by the host program (can only be extracted in device functions because allocations are per device), so pointer arithmetic can therefore not be used in the host program to define `copy`/`memcpy' offsets into data. `startIndex` and `offset` arguments are provided in these interfaces to allow offsetting without pointer arithmetic.
437
+ ====
438
+
434
439
```c++
435
440
namespace sycl {
436
441
class queue {
437
442
public:
438
443
// Copy to device_global
439
- template <typename T, typename propertyListT >
444
+ template <typename T, typename PropertyListT >
440
445
event copy(const std::remove_all_extents_t<T> *src,
441
- device_global<T, propertyListT >& dest,
446
+ device_global<T, PropertyListT >& dest,
442
447
size_t count = sizeof(T) / sizeof(std::remove_all_extents_t<T>),
443
448
size_t startIndex = 0);
444
449
445
- template <typename T, typename propertyListT >
450
+ template <typename T, typename PropertyListT >
446
451
event copy(const std::remove_all_extents_t<T> *src,
447
- device_global<T, propertyListT >& dest,
452
+ device_global<T, PropertyListT >& dest,
448
453
size_t count, size_t startIndex, event depEvent);
449
454
450
- template <typename T, typename propertyListT >
455
+ template <typename T, typename PropertyListT >
451
456
event copy(const std::remove_all_extents_t<T> *src,
452
- device_global<T, propertyListT >& dest,
457
+ device_global<T, PropertyListT >& dest,
453
458
size_t count, size_t startIndex,
454
459
const std::vector<event> &depEvents);
455
460
456
461
// Copy from device_global
457
- template <typename T, typename propertyListT >
458
- event copy(const device_global<T, propertyListT >& src,
462
+ template <typename T, typename PropertyListT >
463
+ event copy(const device_global<T, PropertyListT >& src,
459
464
std::remove_all_extents_t<T> *dest,
460
465
size_t count = sizeof(T) / sizeof(std::remove_all_extents_t<T>),
461
466
size_t startIndex = 0);
462
467
463
- template <typename T, typename propertyListT >
464
- event copy(const device_global<T, propertyListT >& src,
468
+ template <typename T, typename PropertyListT >
469
+ event copy(const device_global<T, PropertyListT >& src,
465
470
std::remove_all_extents_t<T> *dest,
466
471
size_t count, size_t startIndex, event depEvent);
467
472
468
- template <typename T, typename propertyListT >
469
- event copy(const device_global<T, propertyListT >& src,
473
+ template <typename T, typename PropertyListT >
474
+ event copy(const device_global<T, PropertyListT >& src,
470
475
std::remove_all_extents_t<T> *dest,
471
476
size_t count,size_t startIndex, const std::vector<event> &depEvents);
472
477
473
478
// memcpy to device_global
474
- template <typename T, typename propertyListT >
475
- event memcpy(device_global<T, propertyListT >& dest,
479
+ template <typename T, typename PropertyListT >
480
+ event memcpy(device_global<T, PropertyListT >& dest,
476
481
const void *src, size_t numBytes = sizeof(T), size_t offset = 0);
477
482
478
- template <typename T, typename propertyListT >
479
- event memcpy(device_global<T, propertyListT >& dest,
483
+ template <typename T, typename PropertyListT >
484
+ event memcpy(device_global<T, PropertyListT >& dest,
480
485
const void *src, size_t numBytes,
481
486
size_t offset, event depEvent);
482
487
483
- template <typename T, typename propertyListT >
484
- event memcpy(device_global<T, propertyListT >& dest,
488
+ template <typename T, typename PropertyListT >
489
+ event memcpy(device_global<T, PropertyListT >& dest,
485
490
const void *src, size_t numBytes,
486
491
size_t offset, const std::vector<event> &depEvents);
487
492
488
493
// memcpy from device_global
489
- template <typename T, typename propertyListT >
494
+ template <typename T, typename PropertyListT >
490
495
event memcpy(void *dest,
491
- const device_global<T, propertyListT >& src,
496
+ const device_global<T, PropertyListT >& src,
492
497
size_t numBytes = sizeof(T), size_t offset = 0);
493
498
494
- template <typename T, typename propertyListT >
499
+ template <typename T, typename PropertyListT >
495
500
event memcpy(void *dest,
496
- const device_global<T, propertyListT >& src, size_t numBytes,
501
+ const device_global<T, PropertyListT >& src, size_t numBytes,
497
502
size_t offset, event depEvent);
498
503
499
- template <typename T, typename propertyListT >
504
+ template <typename T, typename PropertyListT >
500
505
event memcpy(void *dest,
501
- const device_global<T, propertyListT >& src, size_t numBytes,
506
+ const device_global<T, PropertyListT >& src, size_t numBytes,
502
507
size_t offset, const std::vector<event> &depEvents);
503
508
};
504
509
} // namespace sycl
@@ -515,9 +520,9 @@ in Section 4.6.5.1 of the SYCL 2020 specification.
515
520
a|
516
521
[source, c++]
517
522
----
518
- template <typename T, typename propertyListT >
523
+ template <typename T, typename PropertyListT >
519
524
event copy(const std::remove_all_extents_t<T> *src,
520
- device_global<T, propertyListT >& dest,
525
+ device_global<T, PropertyListT >& dest,
521
526
size_t count = sizeof(T) / sizeof(std::remove_all_extents_t<T>),
522
527
size_t startIndex = 0);
523
528
----
@@ -526,28 +531,28 @@ event copy(const std::remove_all_extents_t<T> *src,
526
531
a|
527
532
[source, c++]
528
533
----
529
- template <typename T, typename propertyListT >
534
+ template <typename T, typename PropertyListT >
530
535
event copy(const std::remove_all_extents_t<T> *src,
531
- device_global<T, propertyListT >& dest,
536
+ device_global<T, PropertyListT >& dest,
532
537
size_t count, size_t startIndex, event depEvent);
533
538
----
534
539
| Explicit copy
535
540
536
541
a|
537
542
[source, c++]
538
543
----
539
- template <typename T, typename propertyListT >
544
+ template <typename T, typename PropertyListT >
540
545
event copy(const std::remove_all_extents_t<T> *src,
541
- device_global<T, propertyListT >& dest,
546
+ device_global<T, PropertyListT >& dest,
542
547
size_t count, size_t startIndex, const std::vector<event> &depEvents);
543
548
----
544
549
| Explicit copy
545
550
546
551
a|
547
552
[source, c++]
548
553
----
549
- template <typename T, typename propertyListT >
550
- event copy(const device_global<T, propertyListT >& src,
554
+ template <typename T, typename PropertyListT >
555
+ event copy(const device_global<T, PropertyListT >& src,
551
556
std::remove_all_extents_t<T> *dest,
552
557
size_t count = sizeof(T) / sizeof(std::remove_all_extents_t<T>),
553
558
size_t startIndex = 0);
@@ -557,8 +562,8 @@ event copy(const device_global<T, propertyListT>& src,
557
562
a|
558
563
[source, c++]
559
564
----
560
- template <typename T, typename propertyListT >
561
- event copy(const device_global<T, propertyListT >& src,
565
+ template <typename T, typename PropertyListT >
566
+ event copy(const device_global<T, PropertyListT >& src,
562
567
std::remove_all_extents_t<T> *dest,
563
568
size_t count, size_t startIndex, event depEvent);
564
569
----
@@ -567,8 +572,8 @@ event copy(const device_global<T, propertyListT>& src,
567
572
a|
568
573
[source, c++]
569
574
----
570
- template <typename T, typename propertyListT >
571
- event copy(const device_global<T, propertyListT >& src,
575
+ template <typename T, typename PropertyListT >
576
+ event copy(const device_global<T, PropertyListT >& src,
572
577
std::remove_all_extents_t<T> *dest,
573
578
size_t count, size_t startIndex, const std::vector<event> &depEvents);
574
579
----
@@ -577,17 +582,17 @@ event copy(const device_global<T, propertyListT>& src,
577
582
a|
578
583
[source, c++]
579
584
----
580
- template <typename T, typename propertyListT >
581
- event memcpy(device_global<T, propertyListT >& dest,
585
+ template <typename T, typename PropertyListT >
586
+ event memcpy(device_global<T, PropertyListT >& dest,
582
587
const void *src, size_t numBytes = sizeof(T), size_t offset = 0);
583
588
----
584
589
| Explicit copy
585
590
586
591
a|
587
592
[source, c++]
588
593
----
589
- template <typename T, typename propertyListT >
590
- event memcpy(device_global<T, propertyListT >& dest,
594
+ template <typename T, typename PropertyListT >
595
+ event memcpy(device_global<T, PropertyListT >& dest,
591
596
const void *src, size_t numBytes,
592
597
size_t offset, event depEvent);
593
598
----
@@ -596,8 +601,8 @@ event memcpy(device_global<T, propertyListT>& dest,
596
601
a|
597
602
[source, c++]
598
603
----
599
- template <typename T, typename propertyListT >
600
- event memcpy(device_global<T, propertyListT >& dest,
604
+ template <typename T, typename PropertyListT >
605
+ event memcpy(device_global<T, PropertyListT >& dest,
601
606
const void *src, size_t numBytes,
602
607
size_t offset, const std::vector<event> &depEvents);
603
608
----
@@ -606,29 +611,29 @@ event memcpy(device_global<T, propertyListT>& dest,
606
611
a|
607
612
[source, c++]
608
613
----
609
- template <typename T, typename propertyListT >
614
+ template <typename T, typename PropertyListT >
610
615
event memcpy(void *dest,
611
- const device_global<T, propertyListT >& src,
616
+ const device_global<T, PropertyListT >& src,
612
617
size_t numBytes = sizeof(T), size_t offset = 0);
613
618
----
614
619
| Explicit copy
615
620
616
621
a|
617
622
[source, c++]
618
623
----
619
- template <typename T, typename propertyListT >
624
+ template <typename T, typename PropertyListT >
620
625
event memcpy(void *dest,
621
- const device_global<T, propertyListT >& src, size_t numBytes,
626
+ const device_global<T, PropertyListT >& src, size_t numBytes,
622
627
size_t offset, event depEvent);
623
628
----
624
629
| Explicit copy
625
630
626
631
a|
627
632
[source, c++]
628
633
----
629
- template <typename T, typename propertyListT >
634
+ template <typename T, typename PropertyListT >
630
635
event memcpy(void *dest,
631
- const device_global<T, propertyListT >& src, size_t numBytes,
636
+ const device_global<T, PropertyListT >& src, size_t numBytes,
632
637
size_t offset, const std::vector<event> &depEvents);
633
638
----
634
639
| Explicit copy
@@ -650,9 +655,9 @@ Add to Table 130, "Member functions of the handler class".
650
655
a|
651
656
[source, c++]
652
657
----
653
- template <typename T, typename propertyListT >
658
+ template <typename T, typename PropertyListT >
654
659
void copy(const std::remove_all_extents_t<T> *src,
655
- device_global<T, propertyListT >& dest,
660
+ device_global<T, PropertyListT >& dest,
656
661
size_t count = sizeof(T) / sizeof(std::remove_all_extents_t<T>),
657
662
size_t startIndex = 0);
658
663
----
@@ -662,8 +667,8 @@ Copies _count_ elements of type `std::remove_all_extents_t<T>` from the pointer
662
667
a|
663
668
[source, c++]
664
669
----
665
- template <typename T, typename propertyListT >
666
- void copy(const device_global<T, propertyListT >& src,
670
+ template <typename T, typename PropertyListT >
671
+ void copy(const device_global<T, PropertyListT >& src,
667
672
std::remove_all_extents_t<T> *dest,
668
673
size_t count = sizeof(T) / sizeof(std::remove_all_extents_t<T>),
669
674
size_t startIndex = 0);
@@ -675,8 +680,8 @@ Copies _count_ elements of type `std::remove_all_extents_t<T>` from the `device_
675
680
a|
676
681
[source, c++]
677
682
----
678
- template <typename T, typename propertyListT >
679
- void memcpy(device_global<T, propertyListT >& dest,
683
+ template <typename T, typename PropertyListT >
684
+ void memcpy(device_global<T, PropertyListT >& dest,
680
685
const void *src, size_t numBytes = sizeof(T), size_t offset = 0);
681
686
----
682
687
|`T` must be device copyable.
@@ -686,9 +691,9 @@ Copies _count_ bytes from the pointer _src_ to the `device_global` _dest_, start
686
691
a|
687
692
[source, c++]
688
693
----
689
- template <typename T, typename propertyListT >
694
+ template <typename T, typename PropertyListT >
690
695
void memcpy(void *dest,
691
- const device_global<T, propertyListT >& src,
696
+ const device_global<T, PropertyListT >& src,
692
697
size_t numBytes = sizeof(T), size_t offset = 0);
693
698
----
694
699
|`T` must be device copyable.
@@ -708,7 +713,7 @@ A sketch of the anticipated constructor interface is:
708
713
----
709
714
namespace sycl::ext::oneapi {
710
715
711
- template <typename T, typename propertyListT = property_list<>>
716
+ template <typename T, typename PropertyListT = property_list<>>
712
717
class device_global {
713
718
public:
714
719
using element_type = std::remove_extent_t<T>;
0 commit comments