Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix/coloring #15

Merged
merged 2 commits into from
Apr 23, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion sparsetiling/src/coloring.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,14 @@ void color_diff_adj (inspector_t* insp, map_t* seedMap,
int offset, size, element = tile2iter->offsets[*it];
map_ofs(seedMap, element, &offset, &size);
mask |= work[seedIndMap[offset + 0]];

// When the frontier of a tile expands (at most k vertices), the given conflicts
// cannot be captured by considering the adjacent tiles in the seed loop's iteration space.
// Hence the colors of the conflicting tiles are added to the mask, in case they are not
// adjacent in the seed loop's iteration space.
if(colors[*it] != -1){
mask |= 1 << colors[*it];
}
}

for (int e = prevOffset; e < nextOffset; e++) {
Expand All @@ -192,7 +200,7 @@ void color_diff_adj (inspector_t* insp, map_t* seedMap,
nColors = MAX(nColors, nColor + color + 1);
for (int e = prevOffset; e < nextOffset; e++) {
int offset, size, element = tile2iter->values[e];
map_ofs(seedMap, e, &offset, &size);
map_ofs(seedMap, element, &offset, &size);
for (int j = 0; j < size; j++) {
work[seedIndMap[offset + j]] |= mask;
}
Expand Down
2 changes: 1 addition & 1 deletion sparsetiling/src/inspector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,7 @@ static void print_tiled_loop (tile_list* tiles, loop_t* loop, int verbosityTiles
int range = MIN(tileLoopSize, verbosityTiles);
cout << " " << tileInfo << " " << i << " | " << tiles->at(i)->color << " | "
<< tileLoopSize << " : {";
if (tileLoopSize == 0) {
if (tileLoopSize <= 0) {
cout << "No iterations}" << endl;
continue;
}
Expand Down