32 template<
class... Targ>
54 "called DDMultiRef.get, id =",
78 template<
class index_t,
class RefIn,
class RefOut,
class Functor>
80 sham::DeviceScheduler_ptr dev_sched,
87 = thread_counts.template map<
decltype(in.get(0))>([&](
u64 id,
const index_t &n) {
88 shamlog_debug_ln(
"kern call",
"build multi ref in for patch",
id);
93 = thread_counts.template map<
decltype(in_out.get(0))>([&](
u64 id,
const index_t &n) {
94 shamlog_debug_ln(
"kern call",
"build multi ref in_out for patch",
id);
95 return in_out.get(
id);
98 thread_counts.
for_each([&](
u64 id,
const index_t &n) {
100 "kern call",
"calling sham::kernel_call on patch",
id,
" thread count", n);
102 dev_sched->get_queue(),
104 mrefs_in_out.get(
id),
106 std::forward<Functor>(func));
111 template<
class index_t,
class RefIn,
class RefOut,
class Functor>
112 inline void distributed_data_kernel_call_hndl(
113 sham::DeviceScheduler_ptr dev_sched,
117 Functor &&kernel_gen) {
120 = thread_counts.template map<
decltype(in.get(0))>([&](
u64 id,
const index_t &n) {
121 shamlog_debug_ln(
"kern call",
"build multi ref in for patch",
id);
126 = thread_counts.template map<
decltype(in_out.get(0))>([&](
u64 id,
const index_t &n) {
127 shamlog_debug_ln(
"kern call",
"build multi ref in_out for patch",
id);
128 return in_out.get(
id);
131 thread_counts.
for_each([&](
u64 id,
const index_t &n) {
133 "kern call",
"calling sham::kernel_call_hndl on patch",
id,
" thread count", n);
135 sham::kernel_call_hndl(
136 dev_sched->get_queue(),
138 mrefs_in_out.get(
id),
140 std::forward<Functor>(kernel_gen));
std::uint64_t u64
64 bit unsigned integer
Represents a collection of objects distributed across patches identified by a u64 id.
void for_each(std::function< void(u64, T &)> &&f)
Applies a function to each object in the collection.
namespace for backends this one is named only sham since shambackends is too long to write
void distributed_data_kernel_call(sham::DeviceScheduler_ptr dev_sched, RefIn in, RefOut in_out, const shambase::DistributedData< index_t > &thread_counts, Functor &&func)
A variant of sham::kernel_call for distributed data.
void kernel_call(sham::DeviceQueue &q, RefIn in, RefOut in_out, u32 n, Functor &&func, SourceLocation &&callsite=SourceLocation{})
Submit a kernel to a SYCL queue.
provide information about the source location
std::string format_one_line_func() const
format the location in a one liner with the function name displayed
A variant of sham::MultiRef for distributed data.
auto get(u64 id)
Get a MultiRef at a given id.
DDMultiRef(Targ &...arg)
Constructor.
std::tuple< Targ &... > storage_t
A tuple of references to the buffers.
storage_t storage
A tuple of references to the buffers.
A class that references multiple buffers or similar objects.