![]() |
Shamrock 2025.10.0
Astrophysical Code
|
Represents a span of data within a PatchDataField. More...
#include <shamrock/include/shamrock/patch/PatchDataFieldSpan.hpp>
Public Member Functions | |
| PatchDataFieldSpan (PatchDataField< T > &field_ref, u32 start, u32 count, SourceLocation loc=SourceLocation{}) | |
| Constructor. | |
| template<typename Dummy = void, typename = std::enable_if_t<is_nvar_dynamic() && is_span_access(), Dummy>> | |
| 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. | |
| template<typename Dummy = void, typename = std::enable_if_t<is_nvar_dynamic() && is_span_access(), Dummy>> | |
| 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. | |
| template<typename Dummy = void, typename = std::enable_if_t<is_nvar_static() && is_span_access(), Dummy>> | |
| 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. | |
| template<typename Dummy = void, typename = std::enable_if_t<is_nvar_static() && is_span_access(), Dummy>> | |
| 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. | |
| template<typename Dummy = void, typename = std::enable_if_t<is_pointer_access(), Dummy>> | |
| auto | get_read_access (sham::EventList &depends_list, SourceLocation src_loc=SourceLocation{}) const -> const T * |
| template<typename Dummy = void, typename = std::enable_if_t<is_pointer_access(), Dummy>> | |
| auto | get_write_access (sham::EventList &depends_list, SourceLocation src_loc=SourceLocation{}) -> T * |
| void | complete_event_state (sycl::event e) const |
| Completes the event state of the underlying buffer. | |
Static Public Member Functions | |
| static constexpr bool | is_nvar_dynamic () |
| Returns true if the number of variables is dynamic. | |
| static constexpr bool | is_nvar_static () |
| Returns true if the number of variables is static. | |
| static constexpr bool | is_pointer_access () |
| static constexpr bool | is_span_access () |
Public Attributes | |
| PatchDataField< T > & | field_ref |
| Reference to the PatchDataField. | |
| u32 | start |
| Starting element index of the span. | |
| u32 | count |
| Number of elements. | |
Represents a span of data within a PatchDataField.
This class provides a way to access a contiguous range of elements within a PatchDataField. It provides either static or dynamic number of variables.
| T | The type of data stored in the PatchDataField. |
| nvar | The number of variables in the PatchDataField. Defaults to dynamic_nvar. |
Definition at line 143 of file PatchDataFieldSpan.hpp.
|
inline |
Constructor.
Initializes the span with a reference to a PatchDataField, a starting index, and a count of elements.
| field_ref | Reference to the PatchDataField. |
| start | Starting index of the span. |
| count | Number of elements in the span. |
| std::invalid_argument | If the underlying buffer is empty. |
| std::invalid_argument | If the number of variables is static and does not match the number of variables in the PatchDataField. |
Definition at line 178 of file PatchDataFieldSpan.hpp.
|
inline |
Completes the event state of the underlying buffer.
| e | Event to complete. |
Definition at line 330 of file PatchDataFieldSpan.hpp.
|
inline |
Definition at line 307 of file PatchDataFieldSpan.hpp.
|
inline |
Returns a read-only accessor to the data in the span.
The type of accessor returned depends on whether the number of variables is static or dynamic.
| depends_list | Event list that the accessor depends on. |
Definition at line 229 of file PatchDataFieldSpan.hpp.
|
inline |
Returns a read-only accessor to the data in the span.
The type of accessor returned depends on whether the number of variables is static or dynamic.
| depends_list | Event list that the accessor depends on. |
Definition at line 275 of file PatchDataFieldSpan.hpp.
|
inline |
Returns a read-write accessor to the data in the span.
The type of accessor returned depends on whether the number of variables is static or dynamic.
| depends_list | Event list that the accessor depends on. |
Definition at line 252 of file PatchDataFieldSpan.hpp.
|
inline |
Returns a read-write accessor to the data in the span.
The type of accessor returned depends on whether the number of variables is static or dynamic.
| depends_list | Event list that the accessor depends on. |
Definition at line 297 of file PatchDataFieldSpan.hpp.
|
inline |
Definition at line 317 of file PatchDataFieldSpan.hpp.
|
inlinestaticconstexpr |
Returns true if the number of variables is dynamic.
Definition at line 150 of file PatchDataFieldSpan.hpp.
|
inlinestaticconstexpr |
Returns true if the number of variables is static.
Definition at line 157 of file PatchDataFieldSpan.hpp.
|
inlinestaticconstexpr |
Definition at line 159 of file PatchDataFieldSpan.hpp.
|
inlinestaticconstexpr |
Definition at line 162 of file PatchDataFieldSpan.hpp.
| u32 shamrock::PatchDataFieldSpan< T, nvar, pointer_access >::count |
Number of elements.
Definition at line 342 of file PatchDataFieldSpan.hpp.
| PatchDataField<T>& shamrock::PatchDataFieldSpan< T, nvar, pointer_access >::field_ref |
Reference to the PatchDataField.
Definition at line 336 of file PatchDataFieldSpan.hpp.
| u32 shamrock::PatchDataFieldSpan< T, nvar, pointer_access >::start |
Starting element index of the span.
Definition at line 339 of file PatchDataFieldSpan.hpp.