Shamrock 2025.10.0
Astrophysical Code
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Public Attributes | List of all members
sham::MultiRefOpt< Targ > Struct Template Reference

A variant of MultiRef for optional buffers. More...

#include <shambackends/include/shambackends/kernel_call.hpp>

Public Types

using storage_t = std::tuple< shambase::opt_ref< Targ >... >
 A tuple of optional references to the buffers.
 

Public Member Functions

 MultiRefOpt (shambase::opt_ref< Targ >... arg)
 Constructor from a tuple of optional references to the buffers.
 
auto get_read_access (sham::EventList &depends_list)
 Get a tuple of pointers to the data of the buffers, for reading.
 
auto get_write_access (sham::EventList &depends_list)
 Get a tuple of pointers to the data of the buffers, for writing.
 
void complete_event_state (sycl::event e)
 Complete the event state of the buffers.
 

Public Attributes

storage_t storage
 The tuple of optional references to the buffers.
 

Detailed Description

template<class... Targ>
struct sham::MultiRefOpt< Targ >

A variant of MultiRef for optional buffers.

This class is equivalent to MultiRef but it allows optional buffers. Only DeviceBuffer are supported as optional buffers.

See also
MultiRef

Definition at line 141 of file kernel_call.hpp.

Member Typedef Documentation

◆ storage_t

template<class... Targ>
using sham::MultiRefOpt< Targ >::storage_t = std::tuple<shambase::opt_ref<Targ>...>

A tuple of optional references to the buffers.

Definition at line 143 of file kernel_call.hpp.

Constructor & Destructor Documentation

◆ MultiRefOpt()

template<class... Targ>
sham::MultiRefOpt< Targ >::MultiRefOpt ( shambase::opt_ref< Targ >...  arg)
inline

Constructor from a tuple of optional references to the buffers.

Definition at line 149 of file kernel_call.hpp.

Member Function Documentation

◆ complete_event_state()

template<class... Targ>
void sham::MultiRefOpt< Targ >::complete_event_state ( sycl::event  e)
inline

Complete the event state of the buffers.

This function completes the event state of all the buffers in the MultiRefOpt by registering the event e in all the buffers.

Parameters
eThe SYCL event to register in the buffers.

Definition at line 193 of file kernel_call.hpp.

◆ get_read_access()

template<class... Targ>
auto sham::MultiRefOpt< Targ >::get_read_access ( sham::EventList depends_list)
inline

Get a tuple of pointers to the data of the buffers, for reading.

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

Parameters
depends_listThe list of events to wait for.
Returns
A tuple of pointers to the data of the buffers, or nullptr if the buffer is empty.

Definition at line 160 of file kernel_call.hpp.

◆ get_write_access()

template<class... Targ>
auto sham::MultiRefOpt< Targ >::get_write_access ( sham::EventList depends_list)
inline

Get a tuple of pointers to the data of the buffers, for writing.

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

Parameters
depends_listThe list of events to wait for.
Returns
A tuple of pointers to the data of the buffers, or nullptr if the buffer is empty.

Definition at line 177 of file kernel_call.hpp.

Member Data Documentation

◆ storage

template<class... Targ>
storage_t sham::MultiRefOpt< Targ >::storage

The tuple of optional references to the buffers.

Definition at line 146 of file kernel_call.hpp.


The documentation for this struct was generated from the following file: