Skip to content

Commit 9143b2c

Browse files
[SYCL] Modernize prefetch property_key creation (#15904)
Simplified key creation was introduced in #12831 but this one was never updated. I think it happened because this property never defined `PropKind` enum entry and I'm not even sure how it worked or what are scenarios where it was broken. Regardless, fix and unify with all other properties with this PR.
1 parent 892cbc5 commit 9143b2c

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

sycl/include/sycl/ext/oneapi/experimental/prefetch.hpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ enum class cache_level { L1 = 0, L2 = 1, L3 = 2, L4 = 3 };
2020

2121
struct nontemporal;
2222

23-
struct prefetch_hint_key {
23+
struct prefetch_hint_key
24+
: detail::compile_time_property_key<detail::PropKind::Prefetch> {
2425
template <cache_level Level, typename Hint>
2526
using value_t =
2627
property_value<prefetch_hint_key,
@@ -51,8 +52,6 @@ inline constexpr prefetch_hint_key::value_t<cache_level::L4, nontemporal>
5152
namespace detail {
5253
using namespace sycl::detail;
5354

54-
template <> struct IsCompileTimeProperty<prefetch_hint_key> : std::true_type {};
55-
5655
template <cache_level Level, typename Hint>
5756
struct PropertyMetaInfo<prefetch_hint_key::value_t<Level, Hint>> {
5857
static constexpr const char *name = std::is_same_v<Hint, nontemporal>

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,8 +214,9 @@ enum PropKind : uint32_t {
214214
ResponseCapacity = 73,
215215
MaxWorkGroupSize = 74,
216216
MaxLinearWorkGroupSize = 75,
217+
Prefetch = 76,
217218
// PropKindSize must always be the last value.
218-
PropKindSize = 76,
219+
PropKindSize = 77,
219220
};
220221

221222
struct property_key_base_tag {};

0 commit comments

Comments
 (0)