Skip to content

Commit

Permalink
[RM] try optimizing get_mode_requirements
Browse files Browse the repository at this point in the history
  • Loading branch information
fknorr committed Nov 2, 2024
1 parent bb23fc9 commit 6510e7b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/task.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 6510e7b

Please sign in to comment.