Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SYCL] Use inheritance to implement oneapi properties #16024

Merged
merged 5 commits into from
Nov 13, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 14 additions & 7 deletions sycl/include/sycl/ext/intel/esimd/memory_properties.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -238,13 +238,17 @@ template <typename PropertyListT> struct remove_alignment_property {
};
template <size_t Alignment, typename... LastTs>
struct remove_alignment_property<
properties<std::tuple<alignment_key::value_t<Alignment>, LastTs...>>> {
using type = properties<std::tuple<LastTs...>>;
properties<oneapi::experimental::detail::properties_type_list<
alignment_key::value_t<Alignment>, LastTs...>>> {
using type =
properties<oneapi::experimental::detail::properties_type_list<LastTs...>>;
};
template <typename FirstT, size_t Alignment, typename... LastTs>
struct remove_alignment_property<properties<
std::tuple<FirstT, alignment_key::value_t<Alignment>, LastTs...>>> {
using type = properties<std::tuple<FirstT, LastTs...>>;
struct remove_alignment_property<
properties<oneapi::experimental::detail::properties_type_list<
FirstT, alignment_key::value_t<Alignment>, LastTs...>>> {
using type = properties<
oneapi::experimental::detail::properties_type_list<FirstT, LastTs...>>;
};
template <typename PropertyListT>
using remove_alignment_property_t =
Expand Down Expand Up @@ -323,8 +327,11 @@ struct property_value<__ESIMD_NS::cache_hint_L3_key,

// Declare that esimd::properties is a property_list.
template <typename... PropertyValueTs>
struct is_property_list<__ESIMD_NS::properties<std::tuple<PropertyValueTs...>>>
: is_property_list<properties<std::tuple<PropertyValueTs...>>> {};
struct is_property_list<__ESIMD_NS::properties<
oneapi::experimental::detail::properties_type_list<PropertyValueTs...>>>
: is_property_list<
properties<oneapi::experimental::detail::properties_type_list<
PropertyValueTs...>>> {};

namespace detail {
// We do not override the class ConflictingProperties for cache_hint properties
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ annotated_arg(T, Args...)
-> annotated_arg<T, typename detail::DeducedProperties<Args...>::type>;

template <typename T, typename old, typename... ArgT>
annotated_arg(annotated_arg<T, old>, properties<std::tuple<ArgT...>>)
annotated_arg(annotated_arg<T, old>,
properties<detail::properties_type_list<ArgT...>>)
-> annotated_arg<
T, detail::merged_properties_t<old, detail::properties_t<ArgT...>>>;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,9 @@ using PropertiesFilter =

// filter properties that are applied on annotations
template <typename... Props>
using annotation_filter = properties<
PropertiesFilter<std::tuple<Props...>, propagateToPtrAnnotation>>;
using annotation_filter =
properties<PropertiesFilter<detail::properties_type_list<Props...>,
propagateToPtrAnnotation>>;
} // namespace detail

template <typename I, typename P> struct annotationHelper {};
Expand Down Expand Up @@ -245,7 +246,8 @@ annotated_ptr(T *, Args...)
-> annotated_ptr<T, typename detail::DeducedProperties<Args...>::type>;

template <typename T, typename old, typename... ArgT>
annotated_ptr(annotated_ptr<T, old>, properties<std::tuple<ArgT...>>)
annotated_ptr(annotated_ptr<T, old>,
properties<detail::properties_type_list<ArgT...>>)
-> annotated_ptr<
T, detail::merged_properties_t<old, detail::properties_t<ArgT...>>>;
#endif // __cpp_deduction_guides
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class __SYCL_SPECIAL_CLASS __SYCL_TYPE(work_group_memory) work_group_memory
void __init(decoratedPtr ptr) { this->ptr = ptr; }
#endif
private:
decoratedPtr ptr;
decoratedPtr ptr = nullptr;
};
} // namespace ext::oneapi::experimental
} // namespace _V1
Expand Down
Loading
Loading