Skip to content

Commit

Permalink
Fix fill calculation for outermost level (possibly after bypassing).
Browse files Browse the repository at this point in the history
  • Loading branch information
angshuman-parashar committed Sep 21, 2023
1 parent be27768 commit 002b743
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/loop-analysis/tiling.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -589,8 +589,19 @@ void ComputeReadUpdateReductionAccesses_Legacy(std::vector<DataMovementInfo>& ti
{
tile_nest[cur].reads = std::round(tile_nest[cur].content_accesses + tile_nest[cur].peer_accesses - tile_nest[cur].partition_size);
tile_nest[cur].temporal_reductions = std::round(tile_nest[cur].content_accesses + tile_nest[cur].peer_accesses - tile_nest[cur].partition_size);

// Special case outermost level for fill calculation: do not subtract partition size.
tile_nest[cur].fills = (cur == num_tiling_levels-1) ?
bool is_outermost = true;
for (int level = cur+1; level < num_tiling_levels; level++)
{
if (tile_nest[level].size > 0)
{
is_outermost = false;
break;
}
}

tile_nest[cur].fills = is_outermost ?
std::round(tile_nest[cur].parent_access_share + tile_nest[cur].peer_fills) : // This is likely 0.
std::round(tile_nest[cur].parent_access_share + tile_nest[cur].peer_fills - tile_nest[cur].partition_size);
}
Expand Down Expand Up @@ -862,6 +873,7 @@ CompoundDataMovementNest CollapseDataMovementNest(analysis::CompoundDataMovement
collapsed_tile.access_stats = tiles[pv][innermost_loop].access_stats;
collapsed_tile.content_accesses = tiles[pv][innermost_loop].access_stats.TotalAccesses();
collapsed_tile.link_transfers = tiles[pv][innermost_loop].link_transfers;
collapsed_tile.fills = 0;
collapsed_tile.peer_accesses = 0;
collapsed_tile.peer_fills = 0;
collapsed_tile.replication_factor = tiles[pv][outermost_loop].replication_factor;
Expand Down

0 comments on commit 002b743

Please sign in to comment.