@@ -36,7 +36,7 @@ around copyability and constructors/destructors.
36
36
37
37
== Notice
38
38
39
- Copyright (c) 2021 Intel Corporation. All rights reserved.
39
+ Copyright (c) 2021 - 2022 Intel Corporation. All rights reserved.
40
40
41
41
NOTE: Khronos(R) is a registered trademark and SYCL(TM) and SPIR(TM) are
42
42
trademarks of The Khronos Group Inc. OpenCL(TM) is a trademark of Apple Inc.
@@ -79,7 +79,7 @@ Roland Schulz, Intel
79
79
80
80
This extension is written against the SYCL 2020 specification, revision 3.
81
81
82
- It also depends on the `SYCL_EXT_ONEAPI_PROPERTY_LIST ` extension.
82
+ It also depends on the `SYCL_EXT_ONEAPI_PROPERTIES ` extension.
83
83
84
84
== Overview
85
85
@@ -172,7 +172,7 @@ A `device_global` on a given device maintains its state (address of the allocati
172
172
[source,c++]
173
173
----
174
174
namespace sycl::ext::oneapi::experimental {
175
- template <typename T, typename PropertyListT = property_list <>>
175
+ template <typename T, typename PropertyListT = properties <>>
176
176
class device_global {
177
177
...
178
178
----
@@ -203,7 +203,7 @@ The section below and the table following describe the constructors, member func
203
203
----
204
204
namespace sycl::ext::oneapi::experimental {
205
205
206
- template <typename T, typename PropertyListT = property_list <>>
206
+ template <typename T, typename PropertyListT = properties <>>
207
207
class device_global {
208
208
using subscript_return_t =
209
209
std::remove_reference_t<decltype(std::declval<T>()[std::ptrdiff_t{}])>;
@@ -378,7 +378,7 @@ template<typename propertyT>
378
378
static constexpr bool has_property();
379
379
----
380
380
| Returns true if the `PropertyListT` contains the property specified by `propertyT`. Returns false if it does not.
381
- Available only if `sycl::is_property_of_v <propertyT, sycl::ext::oneapi::experimental::device_global>` is true.
381
+ Available only if `sycl::is_property_key_of_v <propertyT, sycl::ext::oneapi::experimental::device_global>` is true.
382
382
383
383
// --- ROW BREAK ---
384
384
a|
@@ -389,7 +389,7 @@ static constexpr auto get_property();
389
389
----
390
390
| Returns an object of the class used to represent the value of property `propertyT`.
391
391
Must produce a compiler diagnostic if `PropertyListT` does not contain a `propertyT` property.
392
- Available only if `sycl::is_property_of_v <propertyT, sycl::ext::oneapi::experimental::device_global>` is true.
392
+ Available only if `sycl::is_property_key_of_v <propertyT, sycl::ext::oneapi::experimental::device_global>` is true.
393
393
394
394
|===
395
395
@@ -491,8 +491,8 @@ parameter as shown in this example:
491
491
----
492
492
using namespace sycl::ext::oneapi::experimental;
493
493
494
- device_global<MyClass, property_list_t< device_image_scope::value_t> > dm1;
495
- device_global<int[4], property_list_t<host_access::value_t<host_access::access::read> > dm2;
494
+ device_global<MyClass, decltype(properties( device_image_scope)) > dm1;
495
+ device_global<int[4], decltype(properties(host_access_read)) > dm2;
496
496
----
497
497
498
498
The following code synopsis shows the set of supported properties, and the
@@ -502,45 +502,83 @@ following table describes their effect.
502
502
----
503
503
namespace sycl::ext::oneapi::experimental {
504
504
505
- struct device_image_scope {
506
- using value_t = property_value<device_image_scope >;
505
+ struct device_image_scope_key {
506
+ using value_t = property_value<device_image_scope_key >;
507
507
};
508
508
509
- struct host_access {
510
- enum class access: /*unspecified*/ {
511
- read,
512
- write,
513
- read_write,
514
- none
515
- };
516
- template<access A>
517
- using value_t = property_value<host_access, std::integral_constant<access, A>>;
518
-
519
- struct init_mode {
520
- enum class trigger: /*unspecified*/ {
521
- reprogram,
522
- reset
523
- };
524
- template<trigger T>
525
- using value_t = property_value<init_mode, std::integral_constant<trigger, T>>;
509
+ enum class host_access_enum : /* unspecified */ {
510
+ read,
511
+ write,
512
+ read_write,
513
+ none
526
514
};
527
515
528
- struct implement_in_csr {
529
- template <bool Enable>
530
- using value_t = property_value<implement_in_csr, std::bool_constant<Enable>>;
516
+ struct host_access_key {
517
+ template <host_access_enum Access>
518
+ using value_t =
519
+ property_value<host_access_key,
520
+ std::integral_constant<host_access_enum, Access>>;
531
521
};
532
522
523
+ enum class init_mode_enum : /* unspecified */ {
524
+ reprogram,
525
+ reset
526
+ };
533
527
534
- inline constexpr device_image_scope::value_t device_image_scope_v;
528
+ struct init_mode_key {
529
+ template <init_mode_enum Trigger>
530
+ using value_t =
531
+ property_value<init_mode_key,
532
+ std::integral_constant<init_mode_enum, Trigger>>;
533
+ };
535
534
536
- template<host_access::access A>
537
- inline constexpr host_access::value_t<A> host_access_v;
535
+ struct implement_in_csr_key {
536
+ template <bool Enable>
537
+ using value_t =
538
+ property_value<implement_in_csr_key, std::bool_constant<Enable>>;
539
+ };
538
540
539
- template<init_mode::trigger T>
540
- inline constexpr init_mode::value_t<T> init_mode_v;
541
+ inline constexpr device_image_scope_key::value_t device_image_scope;
542
+
543
+ template <host_access_enum Access>
544
+ inline constexpr host_access_key::value_t<Access> host_access;
545
+ inline constexpr host_access_key::value_t<host_access_enum::read>
546
+ host_access_read;
547
+ inline constexpr host_access_key::value_t<host_access_enum::write>
548
+ host_access_write;
549
+ inline constexpr host_access_key::value_t<host_access_enum::read_write>
550
+ host_access_read_write;
551
+ inline constexpr host_access_key::value_t<host_access_enum::none>
552
+ host_access_none;
553
+
554
+ template <init_mode_enum Trigger>
555
+ inline constexpr init_mode_key::value_t<Trigger> init_mode;
556
+ inline constexpr init_mode_key::value_t<init_mode_enum::reprogram>
557
+ init_mode_reprogram;
558
+ inline constexpr init_mode_key::value_t<init_mode_enum::reset> init_mode_reset;
559
+
560
+ template <bool Enable>
561
+ inline constexpr implement_in_csr_key::value_t<Enable> implement_in_csr;
562
+ inline constexpr implement_in_csr_key::value_t<true> implement_in_csr_on;
563
+ inline constexpr implement_in_csr_key::value_t<false> implement_in_csr_off;
564
+
565
+ template <> struct is_property_key<device_image_scope_key> : std::true_type {};
566
+ template <> struct is_property_key<host_access_key> : std::true_type {};
567
+ template <> struct is_property_key<init_mode_key> : std::true_type {};
568
+ template <> struct is_property_key<implement_in_csr_key> : std::true_type {};
541
569
542
- template<bool Enable>
543
- inline constexpr implement_in_csr::value_t<Enable> implement_in_csr_v;
570
+ template <typename T, typename PropertyListT>
571
+ struct is_property_key_of<device_image_scope_key, device_global<T, PropertyListT>>
572
+ : std::true_type {};
573
+ template <typename T, typename PropertyListT>
574
+ struct is_property_key_of<host_access_key, device_global<T, PropertyListT>>
575
+ : std::true_type {};
576
+ template <typename T, typename PropertyListT>
577
+ struct is_property_key_of<init_mode_key, device_global<T, PropertyListT>>
578
+ : std::true_type {};
579
+ template <typename T, typename PropertyListT>
580
+ struct is_property_key_of<implement_in_csr_key, device_global<T, PropertyListT>>
581
+ : std::true_type {};
544
582
545
583
} // namespace sycl::ext::oneapi::experimental
546
584
----
@@ -1078,7 +1116,7 @@ A sketch of the anticipated constructor interface is:
1078
1116
----
1079
1117
namespace sycl::ext::oneapi::experimental {
1080
1118
1081
- template <typename T, typename PropertyListT = property_list <>>
1119
+ template <typename T, typename PropertyListT = properties <>>
1082
1120
class device_global {
1083
1121
public:
1084
1122
using element_type = std::remove_extent_t<T>;
0 commit comments