Shamrock 2025.10.0
Astrophysical Code
Loading...
Searching...
No Matches
Classes | Namespaces | Functions
kernel_call.hpp File Reference
#include "shambase/optional.hpp"
#include "shambackends/DeviceBuffer.hpp"
#include <functional>
#include <optional>
+ Include dependency graph for kernel_call.hpp:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  sham::MultiRefOpt< Targ >
 A variant of MultiRef for optional buffers. More...
 
struct  sham::details::mapper< T >
 internal_utility for MultiRef template deduction guide More...
 
struct  sham::details::mapper< shambase::opt_ref< T > >
 internal_utility for MultiRef template deduction guide More...
 
struct  sham::MultiRef< Targ >
 A class that references multiple buffers or similar objects. More...
 

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)
 
template<class T >
shambase::opt_ref< T > sham::to_opt_ref (T &t)
 Converts a reference to a given object into an optional reference wrapper.
 
template<class T >
auto sham::empty_buf_ref ()
 Returns an empty optional containing a reference to a sham::DeviceBuffer<T>.
 
template<class... Targ>
 sham::MultiRefOpt (Targ... arg) -> MultiRefOpt< typename details::mapper< Targ >::type... >
 deduction guide to allow the MutliRefOpt to be build without the use of sham::to_opt_ref
 
template<class index_t , class RefIn , class RefOut , class Functor >
void sham::details::typed_index_kernel_call_lambda (sham::DeviceQueue &q, RefIn in, RefOut in_out, index_t n, Functor &&kernel_gen, SourceLocation &&callsite=SourceLocation{})
 internal implementation of typed_index_kernel_call
 
template<class index_t , class RefIn , class RefOut , class Functor >
void sham::details::typed_index_kernel_call (sham::DeviceQueue &q, RefIn in, RefOut in_out, index_t n, Functor &&func, SourceLocation &&callsite=SourceLocation{})
 internal implementation of typed_index_kernel_call
 
template<class RefIn , class RefOut , class Functor >
void sham::kernel_call (sham::DeviceQueue &q, RefIn in, RefOut in_out, u32 n, Functor &&func, SourceLocation &&callsite=SourceLocation{})
 Submit a kernel to a SYCL queue.
 
template<class RefIn , class RefOut , class Functor >
void sham::kernel_call_u64 (sham::DeviceQueue &q, RefIn in, RefOut in_out, u64 n, Functor &&func, SourceLocation &&callsite=SourceLocation{})
 u64 indexed variant of kernel_call
 
template<class RefIn , class RefOut , class Functor >
void sham::kernel_call_hndl (sham::DeviceQueue &q, RefIn in, RefOut in_out, u32 n, Functor &&kernel_gen, SourceLocation &&callsite=SourceLocation{})
 
template<class RefIn , class RefOut , class Functor >
void sham::kernel_call_hndl_u64 (sham::DeviceQueue &q, RefIn in, RefOut in_out, u64 n, Functor &&kernel_gen, SourceLocation &&callsite=SourceLocation{})
 u64 indexed variant of kernel_call_hndl
 

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 kernel_call.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 88 of file kernel_call.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 103 of file kernel_call.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 72 of file kernel_call.hpp.

+ Here is the call graph for this function:

◆ get_read_access() [1/2]

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

Definition at line 79 of file kernel_call.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 93 of file kernel_call.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 84 of file kernel_call.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 98 of file kernel_call.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 38 of file kernel_call.hpp.

+ Here is the call graph for this function:

◆ typed_index_kernel_call()

template<class index_t , class RefIn , class RefOut , class Functor >
void sham::details::typed_index_kernel_call ( sham::DeviceQueue q,
RefIn  in,
RefOut  in_out,
index_t  n,
Functor &&  func,
SourceLocation &&  callsite = SourceLocation{} 
)

internal implementation of typed_index_kernel_call

Definition at line 321 of file kernel_call.hpp.

+ Here is the call graph for this function:

◆ typed_index_kernel_call_lambda()

template<class index_t , class RefIn , class RefOut , class Functor >
void sham::details::typed_index_kernel_call_lambda ( sham::DeviceQueue q,
RefIn  in,
RefOut  in_out,
index_t  n,
Functor &&  kernel_gen,
SourceLocation &&  callsite = SourceLocation{} 
)

internal implementation of typed_index_kernel_call

Definition at line 282 of file kernel_call.hpp.

+ Here is the call graph for this function:

◆ 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 57 of file kernel_call.hpp.

+ Here is the call graph for this function: