60 template<
class T, u32 nvar>
68 template<
typename Dummy =
void,
typename = std::enable_if_t<nvar == 1, Dummy>>
75 template<
class T, u32 nvar>
83 template<
typename Dummy =
void,
typename = std::enable_if_t<nvar == 1, Dummy>>
99 template<
class T, u32 nvar>
103 template<
class T, u32 nvar>
109 inline constexpr bool access_t_pointer =
true;
110 inline constexpr bool access_t_span = !access_t_pointer;
142 template<
class T, u32 nvar = dynamic_nvar,
bool po
inter_access = access_t_span>
159 inline static constexpr bool is_pointer_access() {
160 return pointer_access == access_t_pointer;
162 inline static constexpr bool is_span_access() {
return pointer_access == access_t_span; }
190 "PatchDataFieldSpan can not be binded to empty buffer", loc);
197 "You are trying to bind a PatchDataFieldSpan with static nvar={} to a "
198 "PatchDataField with nvar={}",
208 "PatchDataFieldSpan out of bounds: {} + {} > {}",
227 typename Dummy = void,
228 typename = std::enable_if_t<
is_nvar_dynamic() && is_span_access(), Dummy>>
233 return details::PatchDataFieldSpan_access_ro_dyn_nvar<T>{
234 get_buf().get_read_access(depends_list, std::move(src_loc))
250 typename Dummy = void,
251 typename = std::enable_if_t<
is_nvar_dynamic() && is_span_access(), Dummy>>
256 return details::PatchDataFieldSpan_access_rw_dyn_nvar<T>{
257 get_buf().get_write_access(depends_list, std::move(src_loc))
273 typename Dummy = void,
274 typename = std::enable_if_t<
is_nvar_static() && is_span_access(), Dummy>>
279 return details::PatchDataFieldSpan_access_ro_static_nvar<T, nvar>{
280 get_buf().get_read_access(depends_list, std::move(src_loc))
295 typename Dummy = void,
296 typename = std::enable_if_t<
is_nvar_static() && is_span_access(), Dummy>>
301 return details::PatchDataFieldSpan_access_rw_static_nvar<T, nvar>{
302 get_buf().get_write_access(depends_list, std::move(src_loc))
306 template<
typename Dummy =
void,
typename = std::enable_if_t<is_po
inter_access(), Dummy>>
312 get_buf().get_read_access(depends_list, std::move(src_loc))
316 template<
typename Dummy =
void,
typename = std::enable_if_t<is_po
inter_access(), Dummy>>
321 get_buf().get_write_access(depends_list, std::move(src_loc))
332 get_buf().complete_event_state(e);
353 using PatchDataFieldSpanPointer = PatchDataFieldSpan<T, dynamic_nvar, access_t_pointer>;
std::uint32_t u32
32 bit unsigned integer
A buffer allocated in USM (Unified Shared Memory)
Class to manage a list of SYCL events.
Represents a span of data within a PatchDataField.
static constexpr bool is_nvar_dynamic()
Returns true if the number of variables is dynamic.
auto get_read_access(sham::EventList &depends_list, SourceLocation src_loc=SourceLocation{}) const -> details::PatchDataFieldSpan_access_ro_dyn_nvar< T >
Returns a read-only accessor to the data in the span.
void complete_event_state(sycl::event e) const
Completes the event state of the underlying buffer.
auto get_read_access(sham::EventList &depends_list, SourceLocation src_loc=SourceLocation{}) const -> details::PatchDataFieldSpan_access_ro_static_nvar< T, nvar >
Returns a read-only accessor to the data in the span.
auto get_write_access(sham::EventList &depends_list, SourceLocation src_loc=SourceLocation{}) -> details::PatchDataFieldSpan_access_rw_dyn_nvar< T >
Returns a read-write accessor to the data in the span.
PatchDataFieldSpan(PatchDataField< T > &field_ref, u32 start, u32 count, SourceLocation loc=SourceLocation{})
Constructor.
u32 start
Starting element index of the span.
PatchDataField< T > & field_ref
Reference to the PatchDataField.
u32 count
Number of elements.
static constexpr bool is_nvar_static()
Returns true if the number of variables is static.
auto get_write_access(sham::EventList &depends_list, SourceLocation src_loc=SourceLocation{}) -> details::PatchDataFieldSpan_access_rw_static_nvar< T, nvar >
Returns a read-write accessor to the data in the span.
Namespace for internal details of the logs module.
void throw_with_loc(std::string message, SourceLocation loc=SourceLocation{})
Throw an exception and append the source location to it.
namespace for the main framework
constexpr u32 dynamic_nvar
Constant for dynamic number of variables.
constexpr u32 u32_max
u32 max value
This file contains the definition for the stacktrace related functionality.
provide information about the source location
Accessor for read-only access to dynamic nvar buffer data.
const T & operator()(u32 idx, u32 offset) const
Access to element at index idx and offset var.
const T * ptr
Pointer to the data.
u32 nvar
Number of variables.
const T & operator[](u32 idx) const
Access the underlying pointer.
Accessor for read-only access to static nvar buffer data.
const T & operator()(u32 idx, u32 offset) const
Access to element at index idx and offset var.
const T * ptr
Pointer to the data.
const T & operator()(u32 idx) const
Access without offset if nvar is 1.
Accessor for read-write access to dynamic nvar buffer data.
T * ptr
Pointer to the data.
T & operator()(u32 idx, u32 offset) const
Access to element at index idx and offset var.
T & operator[](u32 idx) const
Access the underlying pointer.
u32 nvar
Number of variables.
Accessor for read-write access to static nvar buffer data.
T & operator()(u32 idx, u32 offset) const
Access to element at index idx and offset var.
T * ptr
Pointer to the data.
T & operator()(u32 idx) const
Access without offset if nvar is 1.