Skip to content

Commit 1d028bb

Browse files
committed
Format code changes to be nicer
1 parent c6d4e09 commit 1d028bb

File tree

8 files changed

+38
-35
lines changed

8 files changed

+38
-35
lines changed

include/taco/index_notation/index_notation.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -691,7 +691,6 @@ class IndexStmt : public util::IntrusivePtr<const IndexStmtNode> {
691691
IndexStmt precompute(IndexExpr expr, std::vector<IndexVar> i_vars,
692692
std::vector<IndexVar> iw_vars, TensorVar workspace) const;
693693

694-
695694
/// bound specifies a compile-time constraint on an index variable's
696695
/// iteration space that allows knowledge of the
697696
/// size or structured sparsity pattern of the inputs to be
@@ -1134,7 +1133,6 @@ bool isReductionNotation(IndexStmt, std::string* reason=nullptr);
11341133
/// given a schedule described by the Provenance Graph
11351134
bool isReductionNotationScheduled(IndexStmt, ProvenanceGraph, std::string* reason=nullptr);
11361135

1137-
11381136
/// Check whether the statement is in the concrete index notation dialect.
11391137
/// This means every index variable has a forall node, there are no reduction
11401138
/// nodes, and that every reduction variable use is nested inside a compound

include/taco/parser/schedule_parser.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ std::vector<std::string> varListParser(const std::string);
1717
// serialize the result of a parse (for debugging)
1818
std::string serializeParsedSchedule(std::vector<std::vector<std::string>>);
1919

20-
21-
2220
}}
2321

2422
#endif //TACO_EINSUM_PARSER_H

src/index_notation/index_notation.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1461,8 +1461,6 @@ map<IndexVar,Dimension> IndexStmt::getIndexVarDomains() const {
14611461
return indexVarDomains;
14621462
}
14631463

1464-
1465-
14661464
IndexStmt IndexStmt::concretizeScheduled(ProvenanceGraph provGraph, vector<IndexVar> forallIndexVarList) const {
14671465
IndexStmt stmt = *this;
14681466
string r;
@@ -2785,7 +2783,8 @@ IndexStmt makeReductionNotationScheduled(IndexStmt stmt, ProvenanceGraph provGra
27852783
return makeReductionNotationScheduled(to<Assignment>(stmt), provGraph);
27862784
}
27872785

2788-
IndexStmt makeConcreteNotationScheduled(IndexStmt stmt, ProvenanceGraph provGraph, vector<IndexVar> forallIndexVars) {
2786+
IndexStmt makeConcreteNotationScheduled(IndexStmt stmt, ProvenanceGraph provGraph,
2787+
vector<IndexVar> forallIndexVars) {
27892788
std::string reason;
27902789
taco_iassert(isReductionNotationScheduled(stmt, provGraph, &reason))
27912790
<< "Not reduction notation: " << stmt << std::endl << reason;
@@ -2820,7 +2819,8 @@ IndexStmt makeConcreteNotationScheduled(IndexStmt stmt, ProvenanceGraph provGrap
28202819
stmt = forall(i, stmt);
28212820
}
28222821
} else {
2823-
reductionAndFreeVars.insert(reductionAndFreeVars.end(), topLevelReductions.begin(), topLevelReductions.end());
2822+
reductionAndFreeVars.insert(reductionAndFreeVars.end(), topLevelReductions.begin(),
2823+
topLevelReductions.end());
28242824
}
28252825
}
28262826
else {
@@ -2873,7 +2873,8 @@ IndexStmt makeConcreteNotationScheduled(IndexStmt stmt, ProvenanceGraph provGrap
28732873
auto ancestorVars = provGraph.getUnderivedAncestors(i);
28742874
IndexVar ancestorI = *reductionAndFreeVars.begin();
28752875
for (auto &ancestorVar : ancestorVars) {
2876-
if (std::find(reductionAndFreeVars.begin(), reductionAndFreeVars.end(), ancestorVar) != reductionAndFreeVars.end()) {
2876+
if (std::find(reductionAndFreeVars.begin(), reductionAndFreeVars.end(), ancestorVar)
2877+
!= reductionAndFreeVars.end()) {
28772878
stmt = forall(i, stmt);
28782879
}
28792880
}

src/ir/workspace_rewriter.cpp

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ using namespace taco::ir;
1515
namespace taco {
1616

1717
struct WorkspaceRewriter : ir::IRRewriter {
18-
WorkspaceRewriter(std::vector<TensorVar> whereTemps, std::map<TensorVar, std::vector<ir::Expr>> temporarySizeMap) : whereTemps(whereTemps),
18+
WorkspaceRewriter(std::vector<TensorVar> whereTemps, std::map<TensorVar,
19+
std::vector<ir::Expr>> temporarySizeMap) : whereTemps(whereTemps),
1920
temporarySizeMap(temporarySizeMap) {}
2021
std::vector<TensorVar> whereTemps;
2122
std::map<TensorVar, std::vector<ir::Expr>> temporarySizeMap;
@@ -29,14 +30,18 @@ struct WorkspaceRewriter : ir::IRRewriter {
2930
string gpName = temp.getName() + to_string(op->mode + 1) + "_dimension";
3031

3132
if (temp.defined() && gpName == op->name) {
32-
taco_iassert(temporarySizeMap.find(temp) != temporarySizeMap.end()) << "Cannot rewrite workspace Dimension "
33-
"GetProperty due to tensorVar not in expression map";
33+
taco_iassert(temporarySizeMap.find(temp) != temporarySizeMap.end()) << "Cannot rewrite workspace "
34+
"Dimension GetProperty due "
35+
"to tensorVar not in "
36+
"expression map";
3437
auto tempExprList = temporarySizeMap.at(temp);
3538

36-
taco_iassert((int)tempExprList.size() > op->mode) << "Cannot rewrite workspace (" << op->tensor <<
37-
") Dimension GetProperty "
38-
"due to mode (" << op->mode << ") not in expression map (size = "
39-
<< tempExprList.size() << ")";
39+
taco_iassert((int)tempExprList.size() > op->mode) << "Cannot rewrite workspace ("
40+
<< op->tensor
41+
<< ") Dimension GetProperty due to mode ("
42+
<< op->mode
43+
<< ") not in expression map (size = "
44+
<< tempExprList.size() << ")";
4045
expr = tempExprList.at(op->mode);
4146
return;
4247
}

src/parser/schedule_parser.cpp

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,9 @@ vector<vector<string>> ScheduleParser(const string argValue) {
4545
parenthesesCnt++;
4646
break;
4747
case parser::Token::rparen:
48-
taco_uassert(parenthesesCnt > 0) << "mismatched parentheses (too many right-parens, negative nesting level) in schedule expression '" << argValue << "'";
48+
taco_uassert(parenthesesCnt > 0) << "mismatched parentheses"
49+
"(too many right-parens, negative nesting level) "
50+
"in schedule expression '" << argValue << "'";
4951
if(parenthesesCnt > 1)
5052
current_element += lexer.tokenString(tok);
5153
parenthesesCnt--;
@@ -76,8 +78,9 @@ vector<vector<string>> ScheduleParser(const string argValue) {
7678
curlyParenthesesCnt++;
7779
break;
7880
case parser::Token::rcurly:
79-
taco_uassert(curlyParenthesesCnt > 0) << "mismatched curly parentheses (too many right-curly-parens, "
80-
"negative nesting level) in schedule expression '" << argValue << "'";
81+
taco_uassert(curlyParenthesesCnt > 0) << "mismatched curly parentheses "
82+
"(too many right-curly-parens, negative nesting level)"
83+
" in schedule expression '" << argValue << "'";
8184
current_element += lexer.tokenString(tok);
8285
curlyParenthesesCnt--;
8386
break;
@@ -95,7 +98,8 @@ vector<vector<string>> ScheduleParser(const string argValue) {
9598
break;
9699
}
97100
}
98-
taco_uassert(parenthesesCnt == 0) << "imbalanced parentheses (too few right-parens) in schedule expression '" << argValue << "'";
101+
taco_uassert(parenthesesCnt == 0) << "imbalanced parentheses (too few right-parens) "
102+
"in schedule expression '" << argValue << "'";
99103
if(current_element.length() > 0)
100104
current_schedule.push_back(current_element);
101105
if(current_schedule.size() > 0)
@@ -131,8 +135,9 @@ vector<string> varListParser(const string argValue) {
131135
curlyParenthesesCnt++;
132136
break;
133137
case parser::Token::rcurly:
134-
taco_uassert(curlyParenthesesCnt > 0) << "mismatched curly parentheses (too many right-curly-parens, "
135-
"negative nesting level) in schedule expression '" << argValue << "'";
138+
taco_uassert(curlyParenthesesCnt > 0) << "mismatched curly parentheses "
139+
"(too many right-curly-parens, negative nesting level)"
140+
" in schedule expression '" << argValue << "'";
136141
if (curlyParenthesesCnt == 1) {
137142
parsed.push_back(current_element);
138143
current_element = "";
@@ -159,8 +164,8 @@ vector<string> varListParser(const string argValue) {
159164
break;
160165
}
161166
}
162-
taco_uassert(curlyParenthesesCnt == 0) << "imbalanced curly brackets (too few right-curly brackets) in"
163-
" schedule expression '" << argValue << "'";
167+
taco_uassert(curlyParenthesesCnt == 0) << "imbalanced curly brackets (too few right-curly brackets) "
168+
"in schedule expression '" << argValue << "'";
164169
if(current_element.length() > 0)
165170
parsed.push_back(current_element);
166171
return parsed;

test/tests-scheduling-eval.cpp

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -76,25 +76,19 @@ IndexStmt scheduleSpGEMMCPU(IndexStmt stmt, bool doPrecompute) {
7676
{result.getType().getShape().getDimension(1)}), taco::dense);
7777
stmt = stmt.precompute(assign.getRhs(), j, j, w);
7878
}
79-
cout << "SPGEMM: " << stmt << endl;
8079
stmt = stmt.assemble(result, AssembleStrategy::Insert, true);
81-
cout << "Post Assembly SPGEMM: " << stmt << endl;
8280
auto qi_stmt = stmt.as<Assemble>().getQueries();
8381
IndexVar qi;
8482
if (isa<Where>(qi_stmt)) {
8583
qi = qi_stmt.as<Where>().getConsumer().as<Forall>().getIndexVar();
8684
} else {
8785
qi = qi_stmt.as<Forall>().getIndexVar();
8886
}
89-
;
9087
stmt = stmt.parallelize(i, ParallelUnit::CPUThread,
91-
OutputRaceStrategy::NoRaces);
92-
cout << "\nPost Parallelize SPGEMM: " << stmt << endl;
93-
stmt = stmt
88+
OutputRaceStrategy::NoRaces)
9489
.parallelize(qi, ParallelUnit::CPUThread,
9590
OutputRaceStrategy::NoRaces);
9691

97-
cout << "Post Scheduled SPGEMM: " << stmt << endl;
9892
return stmt;
9993
}
10094

test/tests-workspaces.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,8 +247,10 @@ TEST(workspaces, precompute4D_add) {
247247

248248

249249
IndexStmt stmt = A.getAssignment().concretize();
250-
TensorVar ws1("ws1", Type(Float64, {(size_t)N, (size_t)N, (size_t)N, (size_t)N}), Format{Dense, Dense, Dense, Dense});
251-
TensorVar ws2("ws2", Type(Float64, {(size_t)N, (size_t)N, (size_t)N, (size_t)N}), Format{Dense, Dense, Dense, Dense});
250+
TensorVar ws1("ws1", Type(Float64, {(size_t)N, (size_t)N, (size_t)N, (size_t)N}),
251+
Format{Dense, Dense, Dense, Dense});
252+
TensorVar ws2("ws2", Type(Float64, {(size_t)N, (size_t)N, (size_t)N, (size_t)N}),
253+
Format{Dense, Dense, Dense, Dense});
252254
stmt = stmt.precompute(precomputedExpr, {i, j, k, l}, {i, j, k, l}, ws1)
253255
.precompute(ws1(i, j, k, l) + D(i, j, k, l), {i, j, k, l}, {i, j, k ,l}, ws2);
254256

tools/taco.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -389,8 +389,8 @@ static bool setSchedulingCommands(vector<vector<string>> scheduleCommands, parse
389389
cout << endl;
390390
taco_uassert(scheduleCommand.size() == 3 || scheduleCommand.size() == 4)
391391
<< "'precompute' scheduling directive takes 3 or 4 parameters: "
392-
<< "precompute(expr, i, iw [, workspace_name]) or precompute(expr, {i_vars}, {iw_vars} [, workspace_name])"
393-
<< scheduleCommand.size();
392+
<< "precompute(expr, i, iw [, workspace_name]) or precompute(expr, {i_vars}, "
393+
"{iw_vars} [, workspace_name])" << scheduleCommand.size();
394394

395395
exprStr = scheduleCommand[0];
396396
// i = scheduleCommand[1];

0 commit comments

Comments
 (0)