From 6510e7bef1a62d1704be5a3094b8d3255da7812d Mon Sep 17 00:00:00 2001 From: Fabian Knorr Date: Sat, 2 Nov 2024 08:11:03 +0100 Subject: [PATCH] [RM] try optimizing get_mode_requirements --- src/task.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/task.cc b/src/task.cc index 83693b20b..71c8a950c 100644 --- a/src/task.cc +++ b/src/task.cc @@ -48,12 +48,13 @@ namespace detail { region<3> buffer_access_map::get_mode_requirements( const buffer_id bid, const access_mode mode, const int kernel_dims, const subrange<3>& sr, const range<3>& global_size) const { - region<3> region; + box_vector<3> boxes; for(size_t i = 0; i < m_accesses.size(); ++i) { if(m_accesses[i].first != bid || m_accesses[i].second->get_access_mode() != mode) continue; - region = region_union(region, get_requirements_for_nth_access(i, kernel_dims, sr, global_size)); + const auto r = get_requirements_for_nth_access(i, kernel_dims, sr, global_size); + boxes.insert(boxes.end(), r.get_boxes().begin(), r.get_boxes().end()); } - return region; + return region(std::move(boxes)); } region<3> buffer_access_map::get_requirements_for_nth_access(