Skip to content

Commit 2508ba0

Browse files
Minor changes, mostly comments
1 parent e455c33 commit 2508ba0

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

sycl/include/sycl/ext/oneapi/properties/properties.hpp

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@ template <typename... property_tys>
181181
class __SYCL_EBO properties<
182182
detail::properties_type_list<property_tys...>,
183183
std::enable_if_t<!detail::property_names_are_unique<property_tys...>>> {
184+
static_assert((is_property_v<property_tys> && ...));
184185

185186
// This is a separate specialization to report an error, we can afford doing
186187
// extra work to provide nice error message without sacrificing compile time
@@ -206,10 +207,14 @@ class __SYCL_EBO properties<
206207
static_assert((is_property_v<property_tys> && ...));
207208
};
208209

210+
// NOTE: Meta-function to implement CTAD rules isn't allowed to return
211+
// `properties<something>` and it's impossible to return a pack as well. As
212+
// such, we're forced to have an extra level of `detail::properties_type_list`
213+
// for the purpose of providing CTAD rules.
209214
template <typename... property_tys>
210-
class __SYCL_EBO
211-
properties<detail::properties_type_list<property_tys...>,
212-
std::enable_if_t<detail::properties_are_sorted<property_tys...>>>
215+
class __SYCL_EBO properties<
216+
detail::properties_type_list<property_tys...>,
217+
std::enable_if_t<detail::property_names_are_unique<property_tys...>>>
213218
: public property_tys... {
214219
static_assert((is_property_v<property_tys> && ...));
215220
static_assert(
@@ -253,7 +258,7 @@ class __SYCL_EBO
253258
// static constexpr auto get_property() requires(is_empty_v<ret_t>) {
254259
// return ret_t{};
255260
// }
256-
// constexpr auto get_property() requires(!is_empty_v<ret_t>) {
261+
// constexpr auto get_property() const requires(!is_empty_v<ret_t>) {
257262
// return get_property(key_tag<property_key_t>{});
258263
// }
259264
template <typename property_key_t>
@@ -275,6 +280,8 @@ class __SYCL_EBO
275280
return get_property(detail::property_key_tag<property_key_t>{});
276281
}
277282

283+
// TODO: Do we need separate `static` overload if we decide to keep this
284+
// interface?
278285
template <typename property_key_t, typename default_property_t>
279286
constexpr auto
280287
get_property_or_default_to(default_property_t default_property) {
@@ -305,7 +312,7 @@ properties(properties<detail::properties_type_list<other_property_list_tys...>>,
305312

306313
using empty_properties_t = decltype(properties{});
307314

308-
template <typename, typename> struct is_property_key_of : std::false_type {};
315+
template <typename, typename> struct is_property_of : std::false_type {};
309316
} // namespace new_properties
310317
} // namespace ext::oneapi::experimental
311318
} // namespace _V1

0 commit comments

Comments
 (0)