diff --git a/sycl/doc/extensions/experimental/sycl_ext_oneapi_device_global.asciidoc b/sycl/doc/extensions/experimental/sycl_ext_oneapi_device_global.asciidoc index 804b30a1a979e..009dab4e197a2 100644 --- a/sycl/doc/extensions/experimental/sycl_ext_oneapi_device_global.asciidoc +++ b/sycl/doc/extensions/experimental/sycl_ext_oneapi_device_global.asciidoc @@ -649,11 +649,6 @@ inline constexpr implement_in_csr_key::value_t implement_in_csr; inline constexpr implement_in_csr_key::value_t implement_in_csr_on; inline constexpr implement_in_csr_key::value_t implement_in_csr_off; -template <> struct is_property_key : std::true_type {}; -template <> struct is_property_key : std::true_type {}; -template <> struct is_property_key : std::true_type {}; -template <> struct is_property_key : std::true_type {}; - template struct is_property_key_of> : std::true_type {}; diff --git a/sycl/doc/extensions/experimental/sycl_ext_oneapi_kernel_arg_properties.asciidoc b/sycl/doc/extensions/experimental/sycl_ext_oneapi_kernel_arg_properties.asciidoc index ff90009b812e3..4334aa9938cd0 100644 --- a/sycl/doc/extensions/experimental/sycl_ext_oneapi_kernel_arg_properties.asciidoc +++ b/sycl/doc/extensions/experimental/sycl_ext_oneapi_kernel_arg_properties.asciidoc @@ -104,9 +104,6 @@ struct restrict_key { inline constexpr restrict_key::value_t restrict; -template<> -struct is_property_key : std::true_type {}; - template struct is_property_key_of< restrict_key, annotated_ptr> : std::true_type {}; @@ -132,9 +129,6 @@ struct alignment_key { template inline constexpr alignment_key::value_t alignment; -template<> struct is_property_key< - sycl::ext::intel::experimental::alignment_key> : std::true_type {}; - template struct is_property_key_of< alignment_key, annotated_ptr> : std::true_type {}; diff --git a/sycl/doc/extensions/experimental/sycl_ext_oneapi_kernel_compiler.asciidoc b/sycl/doc/extensions/experimental/sycl_ext_oneapi_kernel_compiler.asciidoc index 223e9635fc766..21c7719a50b91 100644 --- a/sycl/doc/extensions/experimental/sycl_ext_oneapi_kernel_compiler.asciidoc +++ b/sycl/doc/extensions/experimental/sycl_ext_oneapi_kernel_compiler.asciidoc @@ -311,9 +311,6 @@ struct build_options { }; using build_options_key = build_options; -template<> -struct is_property_key : std::true_type {}; - } // namespace sycl::ext::oneapi::experimental ---- !==== @@ -345,9 +342,6 @@ struct save_log { }; using save_log_key = save_log; -template<> -struct is_property_key : std::true_type {}; - } // namespace sycl::ext::oneapi::experimental ---- !==== diff --git a/sycl/doc/extensions/experimental/sycl_ext_oneapi_kernel_properties.asciidoc b/sycl/doc/extensions/experimental/sycl_ext_oneapi_kernel_properties.asciidoc index 878f0862ac990..017c8e16a6205 100644 --- a/sycl/doc/extensions/experimental/sycl_ext_oneapi_kernel_properties.asciidoc +++ b/sycl/doc/extensions/experimental/sycl_ext_oneapi_kernel_properties.asciidoc @@ -180,11 +180,6 @@ inline constexpr sub_group_size_key::value_t sub_group_size; template inline constexpr device_has_key::value_t device_has; -template <> struct is_property_key : std::true_type {}; -template <> struct is_property_key : std::true_type {}; -template <> struct is_property_key : std::true_type {}; -template <> struct is_property_key : std::true_type {}; - } // namespace experimental } // namespace oneapi } // namespace ext diff --git a/sycl/doc/extensions/experimental/sycl_ext_oneapi_properties.asciidoc b/sycl/doc/extensions/experimental/sycl_ext_oneapi_properties.asciidoc index 82c6d6fb454c6..332ee5fcd1a53 100644 --- a/sycl/doc/extensions/experimental/sycl_ext_oneapi_properties.asciidoc +++ b/sycl/doc/extensions/experimental/sycl_ext_oneapi_properties.asciidoc @@ -100,7 +100,8 @@ property:: A property is represented by a key and value. Properties can be used property value:: An object of the property value class. A property value has zero or more property parameters. For runtime properties the value type is the same as the key type. -For compile time properties the value type is given by the `value_t` type alias of the key type. +For compile time properties the value type is a template instanstiation of +`property_value` with the first template argument the key_type. property key:: A class representing the property key. It is used to query properties. @@ -158,7 +159,7 @@ using foo_key = foo; ``` For compile-time constant parameters the value type is a template specialization of `property_value`. -The property key class contains a `value_t` alias which is templated on the property parameters. The `property_value` class holds the +The `property_value` class holds the values of the compile-time parameters as template arguments. The parameters to a compile- time-constant property can be either types or non-type values. The implementation provides a variable with the property value type. The variable has the name of the property without a suffix. @@ -169,76 +170,49 @@ namespace sycl::ext::oneapi::experimental { template struct property_value; // This property has no parameters. -struct bar_key { - using value_t = property_value; -}; -// bar is an object of the property value type of bar. -inline constexpr bar_key::value_t bar; +inline constexpr property_value bar; // This property has one integer non-type parameter. -struct baz_key { - template - using value_t = property_value >; - // Note: integral_constant is used for the example. An implementation can use a different mapping. -}; -// baz is an object of a property value type of baz. template -inline constexpr baz_key::value_t baz; +inline constexpr property_value> baz; // This property has an arbitrary number of type parameters. -struct boo_key { - template - using value_t = property_value; -}; -// boo is an object of a property value type of boo. template -inline constexpr boo_key::value_t boo; +inline constexpr property_value boo; } // namespace experimental::oneapi::ext::sycl ``` === Property traits -All runtime and compile-time-constant properties must have a specialization of -`is_property_key` and `is_property_value` that inherits from -`std::true_type`, and they must have a specialization of `is_property_key_of` -and `is_property_value_of` +Properties may add a specialization of `is_property_key_of` that inherits from `std::true_type` for each SYCL runtime class that the property can be applied to. All have a base case which inherits from `std::false_type`. ```c++ namespace sycl::ext::oneapi::experimental { //Base case -template struct is_property_key : std::false_type {}; template struct is_property_key_of : std::false_type {}; -template<> struct is_property_key : std::true_type {}; -template<> struct is_property_key : std::true_type {}; - // These properties can be applied to any SYCL object. template struct is_property_key_of : std::true_type {}; template struct is_property_key_of : std::true_type {}; -// is_property_value and is_property_value_of based on is_property_key(_of) -template struct is_property_value; -template struct is_property_value_of; -// Specialization for runtime properties -template struct is_property_value0)>> : is_property_key {}; -template struct is_property_value_of0)>> : is_property_key_of {}; +// is_property_value_of based on is_property_key_of. Base case for runtime properties +template struct is_property_value_of : is_property_key_of {}; // Specialization for compile-time-constant properties -template struct is_property_value> : - is_property_key {}; -template struct is_property_value_of> : - is_property_key_of {}; +template struct is_property_value_of, O> : + is_property_key_of {}; } // namespace experimental::oneapi::ext::sycl ``` === Property value class -The `property_value` class has implementation-defined template parameters. In +The `property_value` class has the property key as the first template argument, +followed by additional implementation-defined template arguments that convey the property parameters. In the common case when the property has a single parameter, it provides a member variable named `value` and a type alias named `value_t` to retrieve the value and type of the parameter. When a property has more than one parameter, the @@ -250,13 +224,10 @@ namespace sycl::ext::oneapi::experimental { template struct property_value { - // Alias of the property key type - using key_t = Property; - // Each property with multi-parameter property_value must define template // specializations for accessing the parameters. - // Available only when the property value has a single parameter and `value_t` of the property takes a non-type parameter + // Available only when the property value has a single non-type parameter static constexpr auto value = First::value; // Available only when the property value has a single parameter @@ -282,14 +253,7 @@ a| ```c++ using value_t = First; ``` -| Available only when there is exactly one parameter. When the parameter's value is a type, `value_t` -is that type. When the parameter's value is a non-type, `value_t` is an implementation-defined type -with a member constant `value` equal to the value. -a| -```c++ -using key_t = property; -``` -| The property key type. +| The type of the parameter. Available only when there is exactly one parameter. |=== -- @@ -415,7 +379,7 @@ using empty_properties_t = decltype(properties{}); [NOTE] ==== Implementations will need a deduction guide to satisfy the requirement that `properties` objects created from the same set of compile-time constant property values and runtime properties must have an identical type. -The requirement that `properties` objects have the same type if they contain the same set of compile-time constant property values and runtime properties also implies that implementations must define an ordering over all properties. This extension provides no mechanism for users to define their own properties. +The requirement that `properties` objects have the same type if they contain the same set of compile-time constant property values and runtime properties also implies that implementations must define an ordering over all properties. ==== The following table describes the constructors of the `properties` class: @@ -633,10 +597,10 @@ This section provides more detailed information for implementers. It is non-norm === Interface Guidelines for `properties` consumers -Adding a new compile-time constant property requires implementers to introduce the following: +Adding a new compile-time constant property requires the following: * A new class representing the property key -* Specializations of `sycl::is_property_key` and `sycl::is_property_key_of` for the new property class +* Specializations of `sycl::is_property_key_of` for the new property class (if desired) * A global variable that represents an object of the property value === Example of a Compile-time Constant Property @@ -646,20 +610,13 @@ This is an example showing the definition of a compile-time constant property `f ```c++ namespace sycl::ext::oneapi::experimental { -// foo is the property key class -struct foo_key { - template - using value_t = property_value>; -}; +// foo_key is the property key class +struct foo_key; // foo is a variable of the property value class that can be used to construct a // property list with this property template -inline constexpr foo::value_t foo; - -// foo is a property -template<> -struct is_property_key : std::true_type {}; +inline constexpr property_value> foo; // foo can be applied to any object template @@ -676,6 +633,7 @@ struct is_property_key_of : std::true_type {}; [options="header"] |======================================== |Rev|Date|Author|Changes +|3|2024-05-06|Roland Schulz|Remove value_t and key_t |2|2021-12-15|Roland Schulz|Rename of value/key |1|2021-07-13|Jason Sewall|Initial internal draft |======================================== diff --git a/sycl/doc/extensions/proposed/sycl_ext_intel_cache_controls.asciidoc b/sycl/doc/extensions/proposed/sycl_ext_intel_cache_controls.asciidoc index eb6fe235bc4e0..799d8e5b4bc80 100755 --- a/sycl/doc/extensions/proposed/sycl_ext_intel_cache_controls.asciidoc +++ b/sycl/doc/extensions/proposed/sycl_ext_intel_cache_controls.asciidoc @@ -195,8 +195,6 @@ inline constexpr read_hint_key::value_t read_hint; namespace oneapi { namespace experimental { -template <> -struct is_property_key : std::true_type {}; template struct is_property_key_of> : std::true_type {}; @@ -261,8 +259,6 @@ namespace oneapi { namespace experimental { template <> -struct is_property_key : std::true_type {}; -template struct is_property_key_of> : std::true_type {}; @@ -336,8 +332,6 @@ namespace oneapi { namespace experimental { template <> -struct is_property_key - : std::true_type {}; template struct is_property_key_of> : std::true_type {}; diff --git a/sycl/doc/extensions/proposed/sycl_ext_intel_fpga_kernel_arg_properties.asciidoc b/sycl/doc/extensions/proposed/sycl_ext_intel_fpga_kernel_arg_properties.asciidoc index ab153b893f566..cc426feab4413 100644 --- a/sycl/doc/extensions/proposed/sycl_ext_intel_fpga_kernel_arg_properties.asciidoc +++ b/sycl/doc/extensions/proposed/sycl_ext_intel_fpga_kernel_arg_properties.asciidoc @@ -234,29 +234,6 @@ inline constexpr wait_request_key::value_t wait_request_not_requested; } // namespace sycl::ext::intel::experimental -// Type trait specializations -namespace sycl::ext::oneapi::experimental { -template<> struct is_property_key< - sycl::ext::intel::experimental::conduit_key> : std::true_type {}; -template<> struct is_property_key< - sycl::ext::intel::experimental::register_map_key> : std::true_type {}; -template<> struct is_property_key< - sycl::ext::intel::experimental::stable_key> : std::true_type {}; -template<> struct is_property_key< - sycl::ext::intel::experimental::buffer_location_key> : std::true_type {}; -template<> struct is_property_key< - sycl::ext::intel::experimental::awidth_key> : std::true_type {}; -template<> struct is_property_key< - sycl::ext::intel::experimental::dwidth_key> : std::true_type {}; -template<> struct is_property_key< - sycl::ext::intel::experimental::read_write_mode_key> : std::true_type {}; -template<> struct is_property_key< - sycl::ext::intel::experimental::latency_key> : std::true_type {}; -template<> struct is_property_key< - sycl::ext::intel::experimental::maxburst_key> : std::true_type {}; -template<> struct is_property_key< - sycl::ext::intel::experimental::wait_request_key> : std::true_type {}; - template struct is_property_key_of< sycl::ext::intel::experimental::conduit_key, diff --git a/sycl/doc/extensions/proposed/sycl_ext_oneapi_forward_progress.asciidoc b/sycl/doc/extensions/proposed/sycl_ext_oneapi_forward_progress.asciidoc index 4777e7bc2bb97..47842c1c2bb1e 100644 --- a/sycl/doc/extensions/proposed/sycl_ext_oneapi_forward_progress.asciidoc +++ b/sycl/doc/extensions/proposed/sycl_ext_oneapi_forward_progress.asciidoc @@ -423,10 +423,6 @@ inline constexpr sub_group_progress_key::value_t s template inline constexpr work_item_progress_key::value_t work_item_progress; -template <> struct is_property_key : std::true_type {}; -template <> struct is_property_key : std::true_type {}; -template <> struct is_property_key : std::true_type {}; - } ---- diff --git a/sycl/doc/extensions/proposed/sycl_ext_oneapi_free_function_kernels.asciidoc b/sycl/doc/extensions/proposed/sycl_ext_oneapi_free_function_kernels.asciidoc index f2832edc31156..e3eaf813d126d 100644 --- a/sycl/doc/extensions/proposed/sycl_ext_oneapi_free_function_kernels.asciidoc +++ b/sycl/doc/extensions/proposed/sycl_ext_oneapi_free_function_kernels.asciidoc @@ -177,9 +177,6 @@ struct nd_range_kernel_key { template inline constexpr nd_range_kernel_key::value_t nd_range_kernel; -template<> -struct is_property_key : std::true_type {}; - } // namespace sycl::ext::oneapi::experimental ---- !==== @@ -219,9 +216,6 @@ struct single_task_kernel_key { inline constexpr single_task_kernel_key::value_t single_task_kernel; -template<> -struct is_property_key : std::true_type {}; - } // namespace sycl::ext::oneapi::experimental ---- !==== diff --git a/sycl/doc/extensions/proposed/sycl_ext_oneapi_work_group_specific.asciidoc b/sycl/doc/extensions/proposed/sycl_ext_oneapi_work_group_specific.asciidoc index 2eb56d7255123..2d528d037b2f8 100644 --- a/sycl/doc/extensions/proposed/sycl_ext_oneapi_work_group_specific.asciidoc +++ b/sycl/doc/extensions/proposed/sycl_ext_oneapi_work_group_specific.asciidoc @@ -222,8 +222,6 @@ struct work_group_specific_size { using work_group_specific_size_key = work_group_specific_size; -template <>struct is_property_key : std::true_type {}; - } // namespace sycl::ext::oneapi::experimental ----