Skip to content

Commit

Permalink
Merge pull request tensor-compiler#356 from rohany/fix-warnings
Browse files Browse the repository at this point in the history
lower,index_notation: fix compilation warnings
  • Loading branch information
stephenchouca authored Jan 13, 2021
2 parents fb2ed72 + ec1a9ac commit ce5baba
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/index_notation/provenance_graph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1068,7 +1068,7 @@ std::vector<ir::Expr> ProvenanceGraph::deriveIterBounds(IndexVar indexVar, std::

std::map<IndexVar, std::vector<ir::Expr>> parentIterBounds;
std::map<IndexVar, std::vector<ir::Expr>> parentCoordBounds;
for (const IndexVar parent : getParents(indexVar)) {
for (const IndexVar& parent : getParents(indexVar)) {
parentIterBounds[parent] = deriveIterBounds(parent, derivedVarOrder, underivedBounds, variableNames, iterators);
vector<IndexVar> underivedParentAncestors = getUnderivedAncestors(parent);
// TODO: this is okay for now because we don't need parentCoordBounds for fused taco_iassert(underivedParentAncestors.size() == 1);
Expand All @@ -1088,7 +1088,7 @@ bool ProvenanceGraph::hasCoordBounds(IndexVar indexVar) const {
bool ProvenanceGraph::isPosVariable(taco::IndexVar indexVar) const {
if (isUnderived(indexVar)) return false;
if (parentRelMap.at(indexVar).getRelType() == POS) return true;
for (const IndexVar parent : getParents(indexVar)) {
for (const IndexVar& parent : getParents(indexVar)) {
if (isPosVariable(parent)) {
return true;
}
Expand All @@ -1104,7 +1104,7 @@ bool ProvenanceGraph::isPosOfAccess(IndexVar indexVar, Access access) const {
else if (parentRelMap.at(indexVar).getRelType() == FUSE) {
return false; // lose pos of access status through fuse
}
for (const IndexVar parent : getParents(indexVar)) {
for (const IndexVar& parent : getParents(indexVar)) {
if (isPosOfAccess(parent, access)) {
return true;
}
Expand Down
2 changes: 1 addition & 1 deletion src/lower/lowerer_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ LowererImpl::lower(IndexStmt stmt, string name,

provGraph = ProvenanceGraph(stmt);

for (const IndexVar indexVar : provGraph.getAllIndexVars()) {
for (const IndexVar& indexVar : provGraph.getAllIndexVars()) {
if (iterators.modeIterators().count(indexVar)) {
indexVarToExprMap.insert({indexVar, iterators.modeIterators()[indexVar].getIteratorVar()});
}
Expand Down

0 comments on commit ce5baba

Please sign in to comment.