Skip to content

Commit f452f04

Browse files
Tsung-Wei HuangTsung-Wei Huang
authored andcommitted
modified dump and matrix example
1 parent 527b03e commit f452f04

2 files changed

Lines changed: 8 additions & 14 deletions

File tree

example/matrix.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,21 +118,21 @@ void openmp(const std::vector<size_t>& D) {
118118
std::cout << "Generating matrix As ...\n";
119119
std::vector<matrix_t> As(D.size());
120120
#pragma omp parallel for
121-
for(int j=0; j<D.size(); ++j) {
121+
for(int j=0; j<(int)D.size(); ++j) {
122122
As[j] = random_matrix(D[j]);
123123
}
124124

125125
std::cout << "Generating matrix Bs ...\n";
126126
std::vector<matrix_t> Bs(D.size());
127127
#pragma omp parallel for
128-
for(int j=0; j<D.size(); ++j) {
128+
for(int j=0; j<(int)D.size(); ++j) {
129129
Bs[j] = random_matrix(D[j]);
130130
}
131131

132132
std::cout << "Computing matrix product values Cs ...\n";
133133
std::vector<matrix_t> Cs(D.size());
134134
#pragma omp parallel for
135-
for(int j=0; j<D.size(); ++j) {
135+
for(int j=0; j<(int)D.size(); ++j) {
136136
Cs[j] = As[j] * Bs[j];
137137
}
138138

taskflow.hpp

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1033,19 +1033,13 @@ std::string BasicTaskflow<F>::dump() const {
10331033

10341034
for(const auto& node : _nodes) {
10351035

1036-
os << " \"";
1037-
if(!node.name().empty()) os << node.name();
1038-
else os << &node;
1039-
os << "\";\n";
1036+
os << " \"" << (node.name().empty() ? &node : node.name()) << "\";\n";
10401037

10411038
for(const auto s : node._successors) {
1042-
os << " \"";
1043-
if(!node.name().empty()) os << node.name();
1044-
else os << &node;
1045-
os << "\" -> \"";
1046-
if(s->name() != "") os << s->name();
1047-
else os << s;
1048-
os << "\";\n";
1039+
os << " \"" << (node.name().empty() ? &node : node.name())
1040+
<< "\" -> \""
1041+
<< (s->name().empty() ? s : s->name())
1042+
<< "\";\n";
10491043
}
10501044
}
10511045

0 commit comments

Comments
 (0)