18 #include <flecsi-config.h> 20 #if !defined(__FLECSI_PRIVATE__) 21 #error Do not include this file directly! 32 #if !defined(FLECSI_ENABLE_LEGION) 33 #error FLECSI_ENABLE_LEGION not defined! This file depends on Legion! 40 inline log::devel_tag bind_accessors_tag(
"bind_accessors");
61 Legion::Context & legion_context,
62 std::vector<Legion::PhysicalRegion>
const & regions,
63 std::vector<Legion::Future>
const & futures)
64 : legion_runtime_(legion_runtime), legion_context_(legion_context),
65 regions_(regions), futures_(futures) {}
67 template<
typename DATA_TYPE,
size_t PRIVILEGES>
69 auto & reg = regions_[region++];
72 const Legion::UnsafeFieldAccessor<DATA_TYPE,
75 Realm::AffineAccessor<DATA_TYPE, 1, Legion::coord_t>>
76 ac(reg, accessor.identifier(),
sizeof(DATA_TYPE));
77 const auto dom = legion_runtime_->get_index_space_domain(
78 legion_context_, reg.get_logical_region().get_index_space());
79 const auto r = dom.get_rect<1>();
82 r.hi[0] - r.lo[0] + 1,
83 ac.ptr(Legion::Domain::DomainPointIterator(dom).p));
86 template<
typename DATA_TYPE,
size_t PRIVILEGES>
88 visit(accessor.get_base());
91 template<
class Topo, std::
size_t Priv>
93 a.bind([&](
auto & x) { visit(x); });
99 template<
typename DATA_TYPE>
101 f = {futures_[future_id++]};
108 template<
typename DATA_TYPE>
109 static typename std::enable_if_t<
110 !std::is_base_of_v<data::reference_base, DATA_TYPE>>
114 flog_devel(info) <<
"Skipping argument with type " 115 << util::type<DATA_TYPE>() << std::endl;
120 Legion::Runtime * legion_runtime_;
121 Legion::Context & legion_context_;
123 const std::vector<Legion::PhysicalRegion> & regions_;
124 size_t future_id = 0;
125 const std::vector<Legion::Future> & futures_;
Definition: topology_accessor.hh:39
Definition: bind_accessors.hh:51
bind_accessors_t(Legion::Runtime *legion_runtime, Legion::Context &legion_context, std::vector< Legion::PhysicalRegion > const ®ions, std::vector< Legion::Future > const &futures)
Definition: bind_accessors.hh:60
Definition: tuple_walker.hh:34
Definition: control.hh:31