From d71b1583f87ed18a497caa0650b19b5371fa06d4 Mon Sep 17 00:00:00 2001 From: aelovikov-intel Date: Thu, 7 Nov 2024 08:30:56 -0800 Subject: [PATCH] [NFCI][SYCL] Introduce `oneapi::experimental::detail::property_base` (#15993) This lays some ground base for subsequent refactoring PRs by isolating simple but noisy diff into a separate change. We're anticipating at least two changes that would be built on top of this: * Change implementation of `has_property`/`get_property` to be inheritance-based vs type-lists/boost. * Bigger design-wise refactoring of the compile time properties, e.g. removal of `property_value` class template. --- .../ext/intel/esimd/memory_properties.hpp | 24 +++-- .../kernel_execution_properties.hpp | 5 +- .../experimental/cluster_group_prop.hpp | 1 + .../oneapi/kernel_properties/properties.hpp | 97 +++++++++++++------ .../ext/oneapi/latency_control/properties.hpp | 11 ++- .../sycl/ext/oneapi/properties/properties.hpp | 4 + .../sycl/ext/oneapi/properties/property.hpp | 35 +++++-- .../ext/oneapi/properties/property_value.hpp | 8 +- sycl/include/sycl/kernel_bundle.hpp | 12 ++- .../abi/sycl_classes_abi_neutral_test.cpp | 15 ++- .../annotated_usm/fake_properties.hpp | 72 +++++++------- .../mock_compile_time_properties.hpp | 6 +- 12 files changed, 189 insertions(+), 101 deletions(-) diff --git a/sycl/include/sycl/ext/intel/esimd/memory_properties.hpp b/sycl/include/sycl/ext/intel/esimd/memory_properties.hpp index c5d57e6b496fa..b25f24bdc829c 100644 --- a/sycl/include/sycl/ext/intel/esimd/memory_properties.hpp +++ b/sycl/include/sycl/ext/intel/esimd/memory_properties.hpp @@ -289,22 +289,34 @@ namespace ext::oneapi::experimental { template <__ESIMD_NS::cache_hint Hint> struct property_value<__ESIMD_NS::cache_hint_L1_key, - std::integral_constant<__ESIMD_NS::cache_hint, Hint>> { - using key_t = __ESIMD_NS::cache_hint_L1_key; + std::integral_constant<__ESIMD_NS::cache_hint, Hint>> + : detail::property_base< + property_value<__ESIMD_NS::cache_hint_L1_key, + std::integral_constant<__ESIMD_NS::cache_hint, Hint>>, + oneapi::experimental::detail::PropKind::ESIMDL1CacheHint, + __ESIMD_NS::cache_hint_L1_key> { static constexpr __ESIMD_NS::cache_level level = __ESIMD_NS::cache_level::L1; static constexpr __ESIMD_NS::cache_hint hint = Hint; }; template <__ESIMD_NS::cache_hint Hint> struct property_value<__ESIMD_NS::cache_hint_L2_key, - std::integral_constant<__ESIMD_NS::cache_hint, Hint>> { - using key_t = __ESIMD_NS::cache_hint_L2_key; + std::integral_constant<__ESIMD_NS::cache_hint, Hint>> + : detail::property_base< + property_value<__ESIMD_NS::cache_hint_L2_key, + std::integral_constant<__ESIMD_NS::cache_hint, Hint>>, + oneapi::experimental::detail::PropKind::ESIMDL2CacheHint, + __ESIMD_NS::cache_hint_L2_key> { static constexpr __ESIMD_NS::cache_level level = __ESIMD_NS::cache_level::L2; static constexpr __ESIMD_NS::cache_hint hint = Hint; }; template <__ESIMD_NS::cache_hint Hint> struct property_value<__ESIMD_NS::cache_hint_L3_key, - std::integral_constant<__ESIMD_NS::cache_hint, Hint>> { - using key_t = __ESIMD_NS::cache_hint_L3_key; + std::integral_constant<__ESIMD_NS::cache_hint, Hint>> + : detail::property_base< + property_value<__ESIMD_NS::cache_hint_L3_key, + std::integral_constant<__ESIMD_NS::cache_hint, Hint>>, + oneapi::experimental::detail::PropKind::ESIMDL3CacheHint, + __ESIMD_NS::cache_hint_L3_key> { static constexpr __ESIMD_NS::cache_level level = __ESIMD_NS::cache_level::L3; static constexpr __ESIMD_NS::cache_hint hint = Hint; }; diff --git a/sycl/include/sycl/ext/intel/experimental/kernel_execution_properties.hpp b/sycl/include/sycl/ext/intel/experimental/kernel_execution_properties.hpp index e65a39c072110..a88839b313504 100644 --- a/sycl/include/sycl/ext/intel/experimental/kernel_execution_properties.hpp +++ b/sycl/include/sycl/ext/intel/experimental/kernel_execution_properties.hpp @@ -26,8 +26,9 @@ inline constexpr cache_config_enum large_slm = inline constexpr cache_config_enum large_data = cache_config_enum::large_data; -struct cache_config : oneapi::experimental::detail::run_time_property_key< - oneapi::experimental::detail::PropKind::CacheConfig> { +struct cache_config + : oneapi::experimental::detail::run_time_property_key< + cache_config, oneapi::experimental::detail::PropKind::CacheConfig> { cache_config(cache_config_enum v) : value(v) {} cache_config_enum value; }; diff --git a/sycl/include/sycl/ext/oneapi/experimental/cluster_group_prop.hpp b/sycl/include/sycl/ext/oneapi/experimental/cluster_group_prop.hpp index 31487beffd810..f035a431ca2a1 100644 --- a/sycl/include/sycl/ext/oneapi/experimental/cluster_group_prop.hpp +++ b/sycl/include/sycl/ext/oneapi/experimental/cluster_group_prop.hpp @@ -19,6 +19,7 @@ namespace cuda { template struct cluster_size : ::sycl::ext::oneapi::experimental::detail::run_time_property_key< + cluster_size, ::sycl::ext::oneapi::experimental::detail::ClusterLaunch> { cluster_size(const range &size) : size(size) {} sycl::range get_cluster_size() { return size; } diff --git a/sycl/include/sycl/ext/oneapi/kernel_properties/properties.hpp b/sycl/include/sycl/ext/oneapi/kernel_properties/properties.hpp index 70055c6680b74..9f91607456dd6 100644 --- a/sycl/include/sycl/ext/oneapi/kernel_properties/properties.hpp +++ b/sycl/include/sycl/ext/oneapi/kernel_properties/properties.hpp @@ -60,13 +60,15 @@ struct device_has_key std::integral_constant...>; }; -struct nd_range_kernel_key { +struct nd_range_kernel_key + : detail::compile_time_property_key { template using value_t = property_value>; }; -struct single_task_kernel_key { +struct single_task_kernel_key + : detail::compile_time_property_key { using value_t = property_value; }; @@ -87,15 +89,18 @@ struct max_linear_work_group_size_key template struct property_value, - std::integral_constant...> { + std::integral_constant...> + : detail::property_base< + property_value, + std::integral_constant...>, + detail::PropKind::WorkGroupSize, work_group_size_key> { static_assert( sizeof...(Dims) + 1 <= 3, "work_group_size property currently only supports up to three values."); static_assert(detail::AllNonZero::value, "work_group_size property must only contain non-zero values."); - using key_t = work_group_size_key; - constexpr size_t operator[](int Dim) const { return std::array{Dim0, Dims...}[Dim]; } @@ -104,7 +109,12 @@ struct property_value, template struct property_value, - std::integral_constant...> { + std::integral_constant...> + : detail::property_base< + property_value, + std::integral_constant...>, + detail::PropKind::WorkGroupSizeHint, work_group_size_hint_key> { static_assert(sizeof...(Dims) + 1 <= 3, "work_group_size_hint property currently " "only supports up to three values."); @@ -112,8 +122,6 @@ struct property_value::value, "work_group_size_hint property must only contain non-zero values."); - using key_t = work_group_size_hint_key; - constexpr size_t operator[](int Dim) const { return std::array{Dim0, Dims...}[Dim]; } @@ -121,41 +129,57 @@ struct property_value struct property_value> { + std::integral_constant> + : detail::property_base< + property_value>, + detail::PropKind::SubGroupSize, sub_group_size_key> { static_assert(Size != 0, "sub_group_size_key property must contain a non-zero value."); - using key_t = sub_group_size_key; using value_t = std::integral_constant; static constexpr uint32_t value = Size; }; template struct property_value...> { - using key_t = device_has_key; + std::integral_constant...> + : detail::property_base< + property_value...>, + detail::PropKind::DeviceHas, device_has_key> { static constexpr std::array value{Aspects...}; }; template -struct property_value> { +struct property_value> + : detail::property_base>, + detail::PropKind::NDRangeKernel, + nd_range_kernel_key> { static_assert( Dims >= 1 && Dims <= 3, "nd_range_kernel_key property must use dimension of 1, 2 or 3."); - using key_t = nd_range_kernel_key; using value_t = int; static constexpr int dimensions = Dims; }; -template <> struct property_value { - using key_t = single_task_kernel_key; -}; +template <> +struct property_value + : detail::property_base, + detail::PropKind::SingleTaskKernel, + single_task_kernel_key> {}; template struct property_value, - std::integral_constant...> { + std::integral_constant...> + : detail::property_base< + property_value, + std::integral_constant...>, + detail::PropKind::MaxWorkGroupSize, max_work_group_size_key> { static_assert(sizeof...(Dims) + 1 <= 3, "max_work_group_size property currently " "only supports up to three values."); @@ -163,16 +187,16 @@ struct property_value::value, "max_work_group_size property must only contain non-zero values."); - using key_t = max_work_group_size_key; - constexpr size_t operator[](int Dim) const { return std::array{Dim0, Dims...}[Dim]; } }; -template <> struct property_value { - using key_t = max_linear_work_group_size_key; -}; +template <> +struct property_value + : detail::property_base, + detail::PropKind::MaxLinearWorkGroupSize, + max_linear_work_group_size_key> {}; template inline constexpr work_group_size_key::value_t work_group_size; @@ -235,8 +259,13 @@ template , - std::integral_constant> { - using key_t = work_group_progress_key; + std::integral_constant> + : detail::property_base< + property_value< + work_group_progress_key, + std::integral_constant, + std::integral_constant>, + detail::PropKind::WorkGroupProgress, work_group_progress_key> { static constexpr forward_progress_guarantee guarantee = Guarantee; static constexpr execution_scope coordinationScope = CoordinationScope; }; @@ -246,8 +275,13 @@ template , - std::integral_constant> { - using key_t = work_group_progress_key; + std::integral_constant> + : detail::property_base< + property_value< + sub_group_progress_key, + std::integral_constant, + std::integral_constant>, + detail::PropKind::SubGroupProgress, sub_group_progress_key> { static constexpr forward_progress_guarantee guarantee = Guarantee; static constexpr execution_scope coordinationScope = CoordinationScope; }; @@ -257,8 +291,13 @@ template , - std::integral_constant> { - using key_t = work_group_progress_key; + std::integral_constant> + : detail::property_base< + property_value< + work_item_progress_key, + std::integral_constant, + std::integral_constant>, + detail::PropKind::WorkItemProgress, work_item_progress_key> { static constexpr forward_progress_guarantee guarantee = Guarantee; static constexpr execution_scope coordinationScope = CoordinationScope; }; diff --git a/sycl/include/sycl/ext/oneapi/latency_control/properties.hpp b/sycl/include/sycl/ext/oneapi/latency_control/properties.hpp index 0716720a3ab36..ef7a5e7f6b704 100644 --- a/sycl/include/sycl/ext/oneapi/latency_control/properties.hpp +++ b/sycl/include/sycl/ext/oneapi/latency_control/properties.hpp @@ -58,8 +58,15 @@ struct property_value< intel::experimental::latency_constraint_key, std::integral_constant, std::integral_constant, - std::integral_constant> { - using key_t = intel::experimental::latency_constraint_key; + std::integral_constant> + : detail::property_base< + property_value, + std::integral_constant< + intel::experimental::latency_control_type, Type>, + std::integral_constant>, + oneapi::experimental::detail::PropKind::LatencyConstraint, + intel::experimental::latency_constraint_key> { static constexpr int target = Target; static constexpr intel::experimental::latency_control_type type = Type; static constexpr int cycle = Cycle; diff --git a/sycl/include/sycl/ext/oneapi/properties/properties.hpp b/sycl/include/sycl/ext/oneapi/properties/properties.hpp index 1c93e00dbe880..b7db9715cad4d 100644 --- a/sycl/include/sycl/ext/oneapi/properties/properties.hpp +++ b/sycl/include/sycl/ext/oneapi/properties/properties.hpp @@ -200,6 +200,10 @@ template class properties { static_assert(NumContainedProps == sizeof...(PropertyValueTs), "One or more property argument is not a property in the " "property list."); + // We're in process of refactoring properties infrastructure, make sure that + // any newly added properties use `detail::property_base`! + static_assert( + (std::is_base_of_v && ...)); } template diff --git a/sycl/include/sycl/ext/oneapi/properties/property.hpp b/sycl/include/sycl/ext/oneapi/properties/property.hpp index 0b3e0c610c30f..41a59337440b8 100644 --- a/sycl/include/sycl/ext/oneapi/properties/property.hpp +++ b/sycl/include/sycl/ext/oneapi/properties/property.hpp @@ -94,7 +94,7 @@ enum PropKind : uint32_t { namespace sycl::ext::oneapi::experimental { // (2.) -struct foo : detail::run_time_property_key { +struct foo : detail::run_time_property_key { foo(int v) : value(v) {} int value; }; @@ -215,10 +215,35 @@ enum PropKind : uint32_t { PropKindSize = 79, }; +template struct PropertyToKind { + static constexpr PropKind Kind = PropertyT::Kind; +}; + +struct property_tag {}; +template +struct property_base : property_tag { + using key_t = property_key_t; +#if !defined(_MSC_VER) + // Temporary, to ensure new code matches previous behavior and to catch any + // silly copy-paste mistakes. MSVC can't compile it, but linux-only is enough + // for this temporary check. + static_assert([]() constexpr { + if constexpr (std::is_same_v) + // key_t is incomplete at this point for runtime properties. + return true; + else + return Kind == PropertyToKind::Kind; + }()); +#endif +}; + struct property_key_base_tag {}; struct compile_time_property_key_base_tag : property_key_base_tag {}; -template struct run_time_property_key : property_key_base_tag { +template +struct run_time_property_key : property_key_base_tag, + property_base { protected: static constexpr PropKind Kind = Kind_; @@ -235,12 +260,6 @@ struct compile_time_property_key : compile_time_property_key_base_tag { friend struct PropertyToKind; }; -// This trait must be specialized for all properties and must have a unique -// constexpr PropKind member named Kind. -template struct PropertyToKind { - static constexpr PropKind Kind = PropertyT::Kind; -}; - // Get unique ID for property. template struct PropertyID { static constexpr int value = diff --git a/sycl/include/sycl/ext/oneapi/properties/property_value.hpp b/sycl/include/sycl/ext/oneapi/properties/property_value.hpp index dc7d13145677d..629ae794a0b1c 100644 --- a/sycl/include/sycl/ext/oneapi/properties/property_value.hpp +++ b/sycl/include/sycl/ext/oneapi/properties/property_value.hpp @@ -41,9 +41,11 @@ struct PropertyValueBase : public detail::SingleNontypePropertyValueBase { } // namespace detail template -struct property_value : public detail::PropertyValueBase { - using key_t = PropertyT; -}; +struct property_value + : public detail::PropertyValueBase, + public detail::property_base, + detail::PropertyToKind::Kind, + PropertyT> {}; template constexpr std::enable_if_t::value, diff --git a/sycl/include/sycl/kernel_bundle.hpp b/sycl/include/sycl/kernel_bundle.hpp index 1237bc0651b40..73c336d3d131e 100644 --- a/sycl/include/sycl/kernel_bundle.hpp +++ b/sycl/include/sycl/kernel_bundle.hpp @@ -901,7 +901,8 @@ struct build_source_bundle_props; // PropertyT syclex::include_files ///////////////////////// struct include_files - : detail::run_time_property_key { + : detail::run_time_property_key { include_files(); include_files(const std::string &name, const std::string &content) { record.emplace_back(std::make_pair(name, content)); @@ -922,7 +923,8 @@ struct is_property_key_of { + : detail::run_time_property_key { std::vector opts; build_options(const std::string &optsArg) : opts{optsArg} {} build_options(const std::vector &optsArg) : opts(optsArg) {} @@ -936,7 +938,8 @@ struct is_property_key_of ///////////////////////// // PropertyT syclex::save_log ///////////////////////// -struct save_log : detail::run_time_property_key { +struct save_log + : detail::run_time_property_key { std::string *log; save_log(std::string *logArg) : log(logArg) {} }; @@ -950,7 +953,8 @@ struct is_property_key_of // PropertyT syclex::registered_kernel_names ///////////////////////// struct registered_kernel_names - : detail::run_time_property_key { + : detail::run_time_property_key { std::vector kernel_names; registered_kernel_names() {} registered_kernel_names(const std::string &knArg) : kernel_names{knArg} {} diff --git a/sycl/test/abi/sycl_classes_abi_neutral_test.cpp b/sycl/test/abi/sycl_classes_abi_neutral_test.cpp index 071481d0d1be0..fc494d500ce90 100644 --- a/sycl/test/abi/sycl_classes_abi_neutral_test.cpp +++ b/sycl/test/abi/sycl_classes_abi_neutral_test.cpp @@ -16,9 +16,8 @@ // member is not crossing ABI boundary. All current exclusions are listed below. // CHECK: 0 | struct sycl::ext::oneapi::experimental::build_options -// CHECK-NEXT: 0 | struct sycl::ext::oneapi::experimental::detail::run_time_property_key (base) (empty) -// CHECK-NEXT: 0 | struct sycl::ext::oneapi::experimental::detail::property_key_base_tag (base) (empty) -// CHECK-NEXT: 0 | class std::vector > opts +// CHECK-NEXT: 0 | struct sycl::ext::oneapi::experimental::detail::run_time_property_key +// CHECK: 0 | class std::vector > opts // CHECK-NEXT: 0 | struct std::_Vector_base, class std::allocator > > (base) // CHECK-NEXT: 0 | struct std::_Vector_base, class std::allocator > >::_Vector_impl _M_impl // CHECK-NEXT: 0 | class std::allocator > (base) (empty) @@ -26,9 +25,8 @@ // CHECK-NEXT: 0 | {{(struct std::_Vector_base, class std::allocator > >::_Vector_impl_data \(base\)|pointer _M_start)}} // CHECK: 0 | struct sycl::ext::oneapi::experimental::include_files -// CHECK-NEXT: 0 | struct sycl::ext::oneapi::experimental::detail::run_time_property_key (base) (empty) -// CHECK-NEXT: 0 | struct sycl::ext::oneapi::experimental::detail::property_key_base_tag (base) (empty) -// CHECK-NEXT: 0 | class std::vector, class std::basic_string > > record +// CHECK-NEXT: 0 | struct sycl::ext::oneapi::experimental::detail::run_time_property_key +// CHECK: 0 | class std::vector, class std::basic_string > > record // CHECK-NEXT: 0 | struct std::_Vector_base, class std::basic_string >, class std::allocator, class std::basic_string > > > (base) // CHECK-NEXT: 0 | struct std::_Vector_base, class std::basic_string >, class std::allocator, class std::basic_string > > >::_Vector_impl _M_impl // CHECK-NEXT: 0 | class std::allocator, class std::basic_string > > (base) (empty) @@ -36,9 +34,8 @@ // CHECK-NEXT: 0 | {{(struct std::_Vector_base, class std::basic_string >, class std::allocator, class std::basic_string > > >::_Vector_impl_data \(base\)|pointer _M_start)}} // CHECK: 0 | struct sycl::ext::oneapi::experimental::registered_kernel_names -// CHECK-NEXT: 0 | struct sycl::ext::oneapi::experimental::detail::run_time_property_key (base) (empty) -// CHECK-NEXT: 0 | struct sycl::ext::oneapi::experimental::detail::property_key_base_tag (base) (empty) -// CHECK-NEXT: 0 | class std::vector > kernel_names +// CHECK-NEXT: 0 | struct sycl::ext::oneapi::experimental::detail::run_time_property_key +// CHECK: 0 | class std::vector > kernel_names // CHECK-NEXT: 0 | struct std::_Vector_base, class std::allocator > > (base) // CHECK-NEXT: 0 | struct std::_Vector_base, class std::allocator > >::_Vector_impl _M_impl // CHECK-NEXT: 0 | class std::allocator > (base) (empty) diff --git a/sycl/test/extensions/annotated_usm/fake_properties.hpp b/sycl/test/extensions/annotated_usm/fake_properties.hpp index 656ea1a1ad75e..0462b96e8e24c 100644 --- a/sycl/test/extensions/annotated_usm/fake_properties.hpp +++ b/sycl/test/extensions/annotated_usm/fake_properties.hpp @@ -49,51 +49,53 @@ struct is_property_key_of : std::true_type {}; // Runtime properties enum foo_enum : unsigned { a, b, c }; -struct foo : detail::run_time_property_key { +struct foo : detail::run_time_property_key { constexpr foo(foo_enum v) : value(v) {} foo_enum value; }; -struct foz : detail::run_time_property_key { +struct foz : detail::run_time_property_key { float value1; bool value2; foz(float value1, bool value2) : value1(value1), value2(value2) {} }; -struct rt_prop1 : detail::run_time_property_key {}; -struct rt_prop2 : detail::run_time_property_key {}; -struct rt_prop3 : detail::run_time_property_key {}; -struct rt_prop4 : detail::run_time_property_key {}; -struct rt_prop5 : detail::run_time_property_key {}; -struct rt_prop6 : detail::run_time_property_key {}; -struct rt_prop7 : detail::run_time_property_key {}; -struct rt_prop8 : detail::run_time_property_key {}; -struct rt_prop9 : detail::run_time_property_key {}; -struct rt_prop10 : detail::run_time_property_key {}; -struct rt_prop11 : detail::run_time_property_key {}; -struct rt_prop12 : detail::run_time_property_key {}; -struct rt_prop13 : detail::run_time_property_key {}; -struct rt_prop14 : detail::run_time_property_key {}; -struct rt_prop15 : detail::run_time_property_key {}; -struct rt_prop16 : detail::run_time_property_key {}; -struct rt_prop17 : detail::run_time_property_key {}; -struct rt_prop18 : detail::run_time_property_key {}; -struct rt_prop19 : detail::run_time_property_key {}; -struct rt_prop20 : detail::run_time_property_key {}; -struct rt_prop21 : detail::run_time_property_key {}; -struct rt_prop22 : detail::run_time_property_key {}; -struct rt_prop23 : detail::run_time_property_key {}; -struct rt_prop24 : detail::run_time_property_key {}; -struct rt_prop25 : detail::run_time_property_key {}; -struct rt_prop26 : detail::run_time_property_key {}; -struct rt_prop27 : detail::run_time_property_key {}; -struct rt_prop28 : detail::run_time_property_key {}; -struct rt_prop29 : detail::run_time_property_key {}; -struct rt_prop30 : detail::run_time_property_key {}; -struct rt_prop31 : detail::run_time_property_key {}; -struct rt_prop32 : detail::run_time_property_key {}; -struct rt_prop33 : detail::run_time_property_key {}; +// clang-format off +struct rt_prop1 : detail::run_time_property_key {}; +struct rt_prop2 : detail::run_time_property_key {}; +struct rt_prop3 : detail::run_time_property_key {}; +struct rt_prop4 : detail::run_time_property_key {}; +struct rt_prop5 : detail::run_time_property_key {}; +struct rt_prop6 : detail::run_time_property_key {}; +struct rt_prop7 : detail::run_time_property_key {}; +struct rt_prop8 : detail::run_time_property_key {}; +struct rt_prop9 : detail::run_time_property_key {}; +struct rt_prop10 : detail::run_time_property_key {}; +struct rt_prop11 : detail::run_time_property_key {}; +struct rt_prop12 : detail::run_time_property_key {}; +struct rt_prop13 : detail::run_time_property_key {}; +struct rt_prop14 : detail::run_time_property_key {}; +struct rt_prop15 : detail::run_time_property_key {}; +struct rt_prop16 : detail::run_time_property_key {}; +struct rt_prop17 : detail::run_time_property_key {}; +struct rt_prop18 : detail::run_time_property_key {}; +struct rt_prop19 : detail::run_time_property_key {}; +struct rt_prop20 : detail::run_time_property_key {}; +struct rt_prop21 : detail::run_time_property_key {}; +struct rt_prop22 : detail::run_time_property_key {}; +struct rt_prop23 : detail::run_time_property_key {}; +struct rt_prop24 : detail::run_time_property_key {}; +struct rt_prop25 : detail::run_time_property_key {}; +struct rt_prop26 : detail::run_time_property_key {}; +struct rt_prop27 : detail::run_time_property_key {}; +struct rt_prop28 : detail::run_time_property_key {}; +struct rt_prop29 : detail::run_time_property_key {}; +struct rt_prop30 : detail::run_time_property_key {}; +struct rt_prop31 : detail::run_time_property_key {}; +struct rt_prop32 : detail::run_time_property_key {}; +struct rt_prop33 : detail::run_time_property_key {}; +// clang-format on using foo_key = foo; using foz_key = foz; diff --git a/sycl/test/extensions/properties/mock_compile_time_properties.hpp b/sycl/test/extensions/properties/mock_compile_time_properties.hpp index f9743e27e3896..ea8d98ffa5e58 100644 --- a/sycl/test/extensions/properties/mock_compile_time_properties.hpp +++ b/sycl/test/extensions/properties/mock_compile_time_properties.hpp @@ -34,7 +34,7 @@ struct boo_key : detail::compile_time_property_key { template using value_t = property_value; }; -struct foo : detail::run_time_property_key { +struct foo : detail::run_time_property_key { constexpr foo(int v = 0) : value(v) {} int value; }; @@ -44,7 +44,7 @@ inline bool operator==(const foo &lhs, const foo &rhs) { } inline bool operator!=(const foo &lhs, const foo &rhs) { return !(lhs == rhs); } -struct foz : detail::run_time_property_key { +struct foz : detail::run_time_property_key { constexpr foz(float v1, bool v2) : value1(v1), value2(v2) {} // Define copy constructor to make foz non-trivially copyable constexpr foz(const foz &f) { @@ -60,7 +60,7 @@ inline bool operator==(const foz &lhs, const foz &rhs) { } inline bool operator!=(const foz &lhs, const foz &rhs) { return !(lhs == rhs); } -struct fir : detail::run_time_property_key { +struct fir : detail::run_time_property_key { // Intentionally not constexpr to test for properties that cannot be constexpr fir(float v1, bool v2) : value1(v1), value2(v2) {} // Define copy constructor to make foz non-trivially copyable