提交 f950dd9f 编写于 作者: D dolphin8

fix clang-format

上级 1ac296e1
...@@ -16,11 +16,11 @@ limitations under the License. */ ...@@ -16,11 +16,11 @@ limitations under the License. */
#include <vector> #include <vector>
#define PADDLE_MOBILE_PROFILE #define PADDLE_MOBILE_PROFILE
#ifdef PADDLE_MOBILE_PROFILE #ifdef PADDLE_MOBILE_PROFILE
#include <algorithm>
#include <ctime> #include <ctime>
#include <unordered_map>
#include <map> #include <map>
#include <algorithm>
#include <numeric> #include <numeric>
#include <unordered_map>
#endif #endif
#include "common/enforce.h" #include "common/enforce.h"
...@@ -359,22 +359,22 @@ std::shared_ptr<framework::Tensor> Executor<Dtype, P>::Predict( ...@@ -359,22 +359,22 @@ std::shared_ptr<framework::Tensor> Executor<Dtype, P>::Predict(
} }
#ifdef PADDLE_MOBILE_PROFILE #ifdef PADDLE_MOBILE_PROFILE
{ {
std::cout << "========================[ profile ]==========================\n"; std::cout << "====================[ profile ]======================\n";
std::vector<std::pair<std::string, clock_t>> _tprofile(_profile.begin(), _profile.end()); std::vector<std::pair<std::string, clock_t>> _tprofile(_profile.begin(),
_profile.end());
clock_t _ptotal; clock_t _ptotal;
for (auto const& p : _tprofile) { for (auto const &p : _tprofile) {
_ptotal += p.second; _ptotal += p.second;
} }
std::sort(_tprofile.begin(), _tprofile.end(), [](auto& a, auto& b) { std::sort(_tprofile.begin(), _tprofile.end(),
return a.second > b.second; [](auto &a, auto &b) { return a.second > b.second; });
});
_tprofile.push_back(std::make_pair("total", _ptotal)); _tprofile.push_back(std::make_pair("total", _ptotal));
for (auto const &p : _tprofile) { for (auto const &p : _tprofile) {
std::cout << p.first << std::string(16 - p.first.size(), ' ') << "\t" std::cout << p.first << std::string(16 - p.first.size(), ' ') << "\t"
<< p.second << "\t\t" << p.second << "\t\t" << (float)p.second / _ptotal * 100.0
<< (float)p.second / _ptotal * 100.0 << "\n"; << "\n";
} }
std::cout << "========================[---------]==========================\n"; std::cout << "====================[---------]======================\n";
} }
#endif #endif
auto ops = ops_of_block_[*to_predict_program_->Block(0)]; auto ops = ops_of_block_[*to_predict_program_->Block(0)];
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册