17 inline namespace _V1 {
18 namespace ext::oneapi::experimental {
24 template <data_placement_enum Placement>
28 std::integral_constant<int, static_cast<int>(Placement)>>;
31 template <data_placement_enum Placement>
56 template <
typename InputIteratorT,
typename OutputElemT>
59 typename std::iterator_traits<InputIteratorT>::iterator_category,
60 std::random_access_iterator_tag> &&
68 std::is_trivially_copyable_v<OutputElemT> &&
69 std::is_default_constructible_v<OutputElemT>;
71 template <
typename InputElemT,
typename OutputIteratorT>
74 typename std::iterator_traits<OutputIteratorT>::iterator_category,
75 std::random_access_iterator_tag> &&
76 std::is_convertible_v<InputElemT,
83 std::is_trivially_copyable_v<InputElemT> &&
84 std::is_default_constructible_v<InputElemT>;
87 if constexpr (
properties.template has_property<data_placement_key>())
88 return properties.template get_property<data_placement_key>() ==
94 template <
bool IsBlocked,
int VEC_OR_ARRAY_SIZE,
typename GroupTy>
96 if constexpr (IsBlocked)
97 return g.get_local_linear_id() * VEC_OR_ARRAY_SIZE + vec_or_array_idx;
99 return g.get_local_linear_id() +
100 g.get_local_linear_range() * vec_or_array_idx;
104 #ifdef __SYCL_DEVICE_ONLY__
106 template <
typename Group,
typename InputIteratorT,
typename OutputT,
107 std::size_t ElementsPerWorkItem,
108 typename Properties = decltype(properties())>
109 std::enable_if_t<detail::verify_load_types<InputIteratorT, OutputT> &&
110 detail::is_generic_group_v<Group>>
116 for (
int i = 0; i < out.
size(); ++i)
117 out[i] = in_ptr[detail::get_mem_idx<blocked, ElementsPerWorkItem>(g, i)];
122 template <
typename Group,
typename InputT, std::size_t ElementsPerWorkItem,
123 typename OutputIteratorT,
124 typename Properties = decltype(properties())>
125 std::enable_if_t<detail::verify_store_types<InputT, OutputIteratorT> &&
126 detail::is_generic_group_v<Group>>
128 OutputIteratorT out_ptr, Properties properties = {}) {
132 for (
int i = 0; i < in.
size(); ++i)
133 out_ptr[detail::get_mem_idx<blocked, ElementsPerWorkItem>(g, i)] = in[i];
138 template <
typename Group,
typename InputIteratorT,
typename OutputT,
139 typename Properties = decltype(properties())>
140 std::enable_if_t<detail::verify_load_types<InputIteratorT, OutputT> &&
141 detail::is_generic_group_v<Group>>
142 group_load(Group g, InputIteratorT in_ptr, OutputT &out,
143 Properties properties = {}) {
144 group_load(g, in_ptr, span<OutputT, 1>(&out, 1), properties);
148 template <
typename Group,
typename InputT,
typename OutputIteratorT,
149 typename Properties = decltype(properties())>
150 std::enable_if_t<detail::verify_store_types<InputT, OutputIteratorT> &&
151 detail::is_generic_group_v<Group>>
152 group_store(Group g,
const InputT &in, OutputIteratorT out_ptr,
153 Properties properties = {}) {
154 group_store(g, span<const InputT, 1>(&in, 1), out_ptr, properties);
158 template <
typename Group,
typename InputIteratorT,
typename OutputT,
int N,
159 typename Properties = decltype(properties())>
160 std::enable_if_t<detail::verify_load_types<InputIteratorT, OutputT> &&
161 detail::is_generic_group_v<Group>>
163 Properties properties = {}) {
164 group_load(g, in_ptr, span<OutputT, N>(&out[0], N), properties);
168 template <
typename Group,
typename InputT,
int N,
typename OutputIteratorT,
169 typename Properties = decltype(properties())>
170 std::enable_if_t<detail::verify_store_types<InputT, OutputIteratorT> &&
171 detail::is_generic_group_v<Group>>
173 Properties properties = {}) {
174 group_store(g, span<const InputT, N>(&in[0], N), out_ptr, properties);
181 "Group loads/stores are not supported on host.");
186 "Group loads/stores are not supported on host.");
constexpr _SYCL_SPAN_INLINE_VISIBILITY size_type size() const noexcept
class sycl::vec ///////////////////////// Provides a cross-patform vector class template that works e...
constexpr bool verify_load_types
constexpr bool verify_store_types
constexpr bool isBlocked(Properties properties)
int get_mem_idx(GroupTy g, int vec_or_array_idx)
constexpr data_placement_key::value_t< Placement > data_placement
constexpr data_placement_key::value_t< data_placement_enum::striped > data_placement_striped
void group_store(Args...)
constexpr full_group_key::value_t full_group
constexpr data_placement_key::value_t< data_placement_enum::blocked > data_placement_blocked
constexpr contiguous_memory_key::value_t contiguous_memory
void group_barrier(ext::oneapi::experimental::root_group< dimensions > G, memory_scope FenceScope=decltype(G)::fence_scope)
const std::error_category & sycl_category() noexcept
typename remove_decoration< T >::type remove_decoration_t