ci format issue fix

This commit is contained in:
zhangzhaoju 2021-07-23 09:31:28 +08:00
parent 122f7a7ee7
commit 52f443d7db
5 changed files with 8 additions and 10 deletions

View File

@ -314,7 +314,7 @@ void Executor::RunTask(const std::shared_ptr<Task> &task, bool sync, bool long_r
if (sync && long_run) {
mindspore::ScopedLongRunning long_running;
sync_cond_var_.wait(lock, [this] { return sync_run_task_finished_; });
} else if (sync) {
} else {
sync_cond_var_.wait(lock, [this] { return sync_run_task_finished_; });
}
}

View File

@ -115,7 +115,6 @@ FuncGraphPtr PrimBpOptPassStep1(const opt::irpass::OptimizeIRPassLib &irpass, co
opt::OptPassConfig pynative_eliminate = opt::OptPassConfig({
irpass.pynative_eliminate_,
});
opt::irpass::ResolveIRPassLib resolve_irpass;
opt::OptPassConfig switch_simplify = opt::OptPassConfig({
irpass.switch_simplify_,
@ -320,7 +319,6 @@ OptPassGroupMap GetOptPassesA(const opt::irpass::OptimizeIRPassLib &irpass) {
false, true);
opt::OptPassConfig accelerated_algorithm = opt::OptPassConfig({irpass.less_batch_normalization_});
opt::OptPassConfig virtual_dataset = opt::OptPassConfig({irpass.virtual_dataset_eliminate_});
opt::irpass::ResolveIRPassLib resolve_irpass;
opt::OptPassConfig after_resolve_pass =
opt::OptPassConfig({irpass.get_make_ref_eliminate_, irpass.replace_old_param_});

View File

@ -87,7 +87,7 @@ bool OpenTsd(const std::shared_ptr<MsContext> &ms_context_ptr) {
}
ms_context_ptr->increase_param<uint32_t>(MS_CTX_TSD_REF);
#ifdef ENABLE_TDTQUE
auto thread_crt = [](std::string &path, acltdtChannelHandle *acl_handle) {
auto thread_crt = [](const std::string &path, const acltdtChannelHandle *acl_handle) {
return std::thread(TensorPrint(path, acl_handle));
};
ms_context_ptr->CreateTensorPrintThread(thread_crt);

View File

@ -30,14 +30,14 @@
namespace mindspore {
class TensorPrint {
public:
explicit TensorPrint(const std::string &path, acltdtChannelHandle *acl_handle)
explicit TensorPrint(const std::string &path, const acltdtChannelHandle *acl_handle)
: print_file_path_(path), acl_handle_(acl_handle) {}
~TensorPrint() = default;
void operator()();
private:
std::string print_file_path_;
acltdtChannelHandle *acl_handle_ = nullptr;
const acltdtChannelHandle *acl_handle_;
};
} // namespace mindspore
#endif

View File

@ -66,8 +66,8 @@ std::string GetTimeString() {
time_t time_seconds = time(0);
struct tm now_time;
localtime_s(&now_time, &time_seconds);
snprintf(buf, BUFLEN, "%d-%d-%d %d:%d:%d", now_time.tm_year + 1900, now_time.tm_mon + 1, now_time.tm_mday,
now_time.tm_hour, now_time.tm_min, now_time.tm_sec);
(void)snprintf(buf, BUFLEN, "%d-%d-%d %d:%d:%d", now_time.tm_year + 1900, now_time.tm_mon + 1, now_time.tm_mday,
now_time.tm_hour, now_time.tm_min, now_time.tm_sec);
#else
struct timeval cur_time;
(void)gettimeofday(&cur_time, nullptr);
@ -77,8 +77,8 @@ std::string GetTimeString() {
constexpr int64_t time_convert_unit = 1000;
(void)localtime_r(&cur_time.tv_sec, &now);
(void)strftime(buf, BUFLEN, "%Y-%m-%d-%H:%M:%S", &now); // format date and time
snprintf(buf + time_str_len, BUFLEN - time_str_len, ".%03ld.%03ld", cur_time.tv_usec / time_convert_unit,
cur_time.tv_usec % time_convert_unit);
(void)snprintf(buf + time_str_len, BUFLEN - time_str_len, ".%03ld.%03ld", cur_time.tv_usec / time_convert_unit,
cur_time.tv_usec % time_convert_unit);
#endif
return std::string(buf);
}