Shamrock 2025.10.0
Astrophysical Code
Loading...
Searching...
No Matches
buffer_access_utils.hpp File Reference
Include dependency graph for buffer_access_utils.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  sham
 namespace for backends this one is named only sham since shambackends is too long to write

Functions

template<class T>
const T * sham::details::read_access_optional (shambase::opt_ref< sham::DeviceBuffer< T > > buffer, sham::EventList &depends_list)
 Get a pointer to the data of an optional device buffer, for reading.
template<class T>
T * sham::details::write_access_optional (shambase::opt_ref< sham::DeviceBuffer< T > > buffer, sham::EventList &depends_list)
 Get a pointer to the data of an optional device buffer, for writing.
template<class T>
void sham::details::complete_state_optional (sycl::event e, shambase::opt_ref< T > buffer)
 Complete the event state of an optional device buffer.
template<class Obj>
auto sham::details::get_read_access (Obj &o, sham::EventList &depends_list)
template<class Obj>
auto sham::details::get_write_access (Obj &o, sham::EventList &depends_list)
template<class Obj>
auto sham::details::complete_event_state (Obj &o, sycl::event e)
template<class Obj>
auto sham::details::get_read_access (std::reference_wrapper< Obj > &o, sham::EventList &depends_list)
template<class Obj>
auto sham::details::get_write_access (std::reference_wrapper< Obj > &o, sham::EventList &depends_list)
template<class Obj>
auto sham::details::complete_event_state (std::reference_wrapper< Obj > &o, sycl::event e)

Detailed Description

Author
Timothée David–Cléris (tim.s.nosp@m.hamr.nosp@m.ock@p.nosp@m.roto.nosp@m.n.me)

Definition in file buffer_access_utils.hpp.

Function Documentation

◆ complete_event_state() [1/2]

template<class Obj>
auto sham::details::complete_event_state ( Obj & o,
sycl::event e )
inline

Definition at line 83 of file buffer_access_utils.hpp.

◆ complete_event_state() [2/2]

template<class Obj>
auto sham::details::complete_event_state ( std::reference_wrapper< Obj > & o,
sycl::event e )
inline

Definition at line 97 of file buffer_access_utils.hpp.

◆ complete_state_optional()

template<class T>
void sham::details::complete_state_optional ( sycl::event e,
shambase::opt_ref< T > buffer )

Complete the event state of an optional device buffer.

If the optional is empty, nothing is done. Otherwise, the event state of the buffer is completed with the given event.

Definition at line 67 of file buffer_access_utils.hpp.

◆ get_read_access() [1/2]

template<class Obj>
auto sham::details::get_read_access ( Obj & o,
sham::EventList & depends_list )
inline

Definition at line 74 of file buffer_access_utils.hpp.

◆ get_read_access() [2/2]

template<class Obj>
auto sham::details::get_read_access ( std::reference_wrapper< Obj > & o,
sham::EventList & depends_list )
inline

Definition at line 88 of file buffer_access_utils.hpp.

◆ get_write_access() [1/2]

template<class Obj>
auto sham::details::get_write_access ( Obj & o,
sham::EventList & depends_list )
inline

Definition at line 79 of file buffer_access_utils.hpp.

◆ get_write_access() [2/2]

template<class Obj>
auto sham::details::get_write_access ( std::reference_wrapper< Obj > & o,
sham::EventList & depends_list )
inline

Definition at line 93 of file buffer_access_utils.hpp.

◆ read_access_optional()

template<class T>
const T * sham::details::read_access_optional ( shambase::opt_ref< sham::DeviceBuffer< T > > buffer,
sham::EventList & depends_list )

Get a pointer to the data of an optional device buffer, for reading.

If the optional is empty, a null pointer is returned. Otherwise, the read access of the buffer is requested and the depends_list is updated accordingly.

Parameters
bufferAn optional holding a reference to the device buffer.
depends_listThe list of events to wait for.
Returns
A pointer to the data of the buffer, or nullptr if the optional is empty.

Definition at line 33 of file buffer_access_utils.hpp.

◆ write_access_optional()

template<class T>
T * sham::details::write_access_optional ( shambase::opt_ref< sham::DeviceBuffer< T > > buffer,
sham::EventList & depends_list )

Get a pointer to the data of an optional device buffer, for writing.

If the optional is empty, a null pointer is returned. Otherwise, the write access of the buffer is requested and the depends_list is updated accordingly.

Parameters
bufferAn optional holding a reference to the device buffer.
depends_listThe list of events to wait for.
Returns
A pointer to the data of the buffer, or nullptr if the optional is empty.

Definition at line 52 of file buffer_access_utils.hpp.