Commit 779e6525 authored by Shucai Xiao's avatar Shucai Xiao
Browse files

clang format

parent 51452c03
...@@ -548,7 +548,8 @@ auto get_flops_funcs() ...@@ -548,7 +548,8 @@ auto get_flops_funcs()
auto sb = vec_ss.at(1); auto sb = vec_ss.at(1);
auto batch = 1; auto batch = 1;
auto lens_a = sa.lens(); auto lens_a = sa.lens();
batch = std::accumulate(lens_a.rbegin() + 2, lens_a.rend(), 1, std::multiplies<std::size_t>{}); batch =
std::accumulate(lens_a.rbegin() + 2, lens_a.rend(), 1, std::multiplies<std::size_t>{});
auto m = lens_a[lens_a.size() - 2]; auto m = lens_a[lens_a.size() - 2];
auto k = lens_a.back(); auto k = lens_a.back();
auto lens_b = sb.lens(); auto lens_b = sb.lens();
...@@ -632,7 +633,7 @@ void program::perf_report(std::ostream& os, ...@@ -632,7 +633,7 @@ void program::perf_report(std::ostream& os,
this->print(names, [&](auto ins, auto ins_names) { this->print(names, [&](auto ins, auto ins_names) {
std::stringstream ss; std::stringstream ss;
instruction::print(ss, ins, ins_names); instruction::print(ss, ins, ins_names);
if (max_ins_len < ss.str().length()) if(max_ins_len < ss.str().length())
{ {
max_ins_len = ss.str().length(); max_ins_len = ss.str().length();
} }
...@@ -669,7 +670,7 @@ void program::perf_report(std::ostream& os, ...@@ -669,7 +670,7 @@ void program::perf_report(std::ostream& os,
double percent = 100.0 * avg / total_instruction_time; double percent = 100.0 * avg / total_instruction_time;
std::string pers = std::to_string(percent); std::string pers = std::to_string(percent);
auto loc = pers.find('.'); auto loc = pers.find('.');
if (loc != std::string::npos) if(loc != std::string::npos)
{ {
pers.erase(pers.begin() + loc + 6, pers.end()); pers.erase(pers.begin() + loc + 6, pers.end());
} }
...@@ -680,7 +681,7 @@ void program::perf_report(std::ostream& os, ...@@ -680,7 +681,7 @@ void program::perf_report(std::ostream& os,
std::string op_name = ins->name(); std::string op_name = ins->name();
auto nloc = op_name.find("::"); auto nloc = op_name.find("::");
op_name.erase(op_name.begin(), op_name.begin() + nloc + 2); op_name.erase(op_name.begin(), op_name.begin() + nloc + 2);
if (contains(flops_funcs, op_name)) if(contains(flops_funcs, op_name))
{ {
auto op_flop_func = flops_funcs.at(op_name); auto op_flop_func = flops_funcs.at(op_name);
auto inss = to_shapes(ins->inputs()); auto inss = to_shapes(ins->inputs());
...@@ -690,7 +691,7 @@ void program::perf_report(std::ostream& os, ...@@ -690,7 +691,7 @@ void program::perf_report(std::ostream& os,
flops /= 1.0e6; flops /= 1.0e6;
flps = std::to_string(flops); flps = std::to_string(flops);
auto floc = flps.find('.'); auto floc = flps.find('.');
if (floc != std::string::npos) if(floc != std::string::npos)
{ {
flps.erase(flps.begin() + floc + 4, flps.end()); flps.erase(flps.begin() + floc + 4, flps.end());
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment