clean pclint and codex warning

This commit is contained in:
lianliguang 2021-09-22 14:31:33 +08:00
parent c3ce92a9f2
commit 33c879f69c
6 changed files with 12 additions and 14 deletions

View File

@ -54,7 +54,7 @@ void AnalysisSchedule::Yield(const AsyncInferTask *async_infer_task) {
if (async_infer_task->Ready() == 0) {
MS_LOG(DEBUG) << " The active thread count: " << activate_threads_.size() << " thread id: " << GetThreadID()
<< " async_infer_task thread id:" << async_infer_task->ThreadID();
activate_threads_.erase(GetThreadID());
(void)activate_threads_.erase(GetThreadID());
}
MS_LOG(DEBUG) << " The active thread count: " << activate_threads_.size()
<< " The infer_thread_count: " << infer_thread_count_
@ -129,7 +129,7 @@ bool AnalysisSchedule::SetNextReady() {
return item->HasResult();
});
if (it == scheduleList_.end()) {
if ((size_t)infer_thread_count_.load() >= scheduleList_.size()) {
if (IntToSize(infer_thread_count_.load()) >= scheduleList_.size()) {
MS_LOG(DEBUG) << "There is some task to be added. Please wait.";
return false;
}
@ -137,7 +137,7 @@ bool AnalysisSchedule::SetNextReady() {
<< " The infer_thread_count: " << infer_thread_count_
<< " schedule list size: " << scheduleList_.size();
// Enter endless loop if there is not ready result.
activate_threads_.insert(scheduleList_.front()->ThreadID());
(void)activate_threads_.insert(scheduleList_.front()->ThreadID());
// Let the first thread to trigger endless loop exception.
MS_LOG(DEBUG) << "Enter endless loop if there is not ready result.Set the async to trigger exception:"
<< scheduleList_.front().get() << " The active thread count: " << activate_threads_.size();
@ -146,9 +146,9 @@ bool AnalysisSchedule::SetNextReady() {
return true;
}
auto async_task = *it;
activate_threads_.insert(async_task->ThreadID());
(void)activate_threads_.insert(async_task->ThreadID());
async_task->SetReady();
scheduleList_.erase(it);
(void)scheduleList_.erase(it);
MS_LOG(DEBUG) << " Success to SetReady. The active thread count: " << activate_threads_.size()
<< " The infer_thread_count: " << infer_thread_count_ << " schedule list size: " << scheduleList_.size()
<< " async: " << async_task->ThreadID() << " address: " << async_task.get();

View File

@ -672,7 +672,7 @@ void FuncGraphSpecializer::ProcessCNode(const CNodePtr &new_node) {
while (IsPrimitiveCNode(func, prim::kPrimPartial)) {
std::vector<AnfNodePtr> inputs = func->cast<CNodePtr>()->inputs();
// First element is partial, second is func so arg is start from 2
(void)args.insert(args.begin(), inputs.begin() + IntToSize(arg_start_index), inputs.end());
(void)args.insert(args.begin(), inputs.begin() + SizeToInt(arg_start_index), inputs.end());
func = inputs[1];
}
new_inputs = args;

View File

@ -452,7 +452,7 @@ void AddSegmentDependency(const FuncGraphPtr &graph, const std::map<AnfNodePtr,
}
}
void RemoveUselessDependency(std::vector<GraphSegmentPtr> *segments) {
void RemoveUselessDependency(const std::vector<GraphSegmentPtr> *segments) {
MS_EXCEPTION_IF_NULL(segments);
for (auto &segment : *segments) {
MS_EXCEPTION_IF_NULL(segment);

View File

@ -34,7 +34,7 @@ AbstractBasePtr InferImplReturn(const AnalysisEnginePtr &, const PrimitivePtr &,
return abs_base;
}
AbstractBasePtr InferImplSwitch(const AnalysisEnginePtr &, const PrimitivePtr &prim,
AbstractBasePtr InferImplSwitch(const AnalysisEnginePtr &, const PrimitivePtr &,
const AbstractBasePtrList &args_spec_list) {
// Inputs: condition, true branch, false branch
if (args_spec_list.size() != 3) {
@ -187,7 +187,7 @@ AbstractBasePtr InferImplNotInDict(const AnalysisEnginePtr &, const PrimitivePtr
return std::make_shared<AbstractScalar>(!IsInDict(primitive, args_spec_list));
}
AbstractBasePtr InferImplIsConstant(const AnalysisEnginePtr &, const PrimitivePtr &primitive,
AbstractBasePtr InferImplIsConstant(const AnalysisEnginePtr &, const PrimitivePtr &,
const AbstractBasePtrList &args_spec_list) {
// statement: isconstant(x)
// Inputs: x

View File

@ -70,8 +70,8 @@ std::vector<int64_t> GetDependsFormMap(const CNodePtr &cnode) {
MS_EXCEPTION_IF_NULL(ms_context);
auto device = ms_context->get_param<std::string>(MS_CTX_DEVICE_TARGET);
if (device == kAscendDevice) {
dynamic_shape_depends.insert({kReduceSum, {1}});
dynamic_shape_depends.insert({kTranspose, {1}});
(void)dynamic_shape_depends.insert({kReduceSum, {1}});
(void)dynamic_shape_depends.insert({kTranspose, {1}});
}
MS_EXCEPTION_IF_NULL(cnode);

View File

@ -54,9 +54,7 @@ static const std::vector<std::string> sub_module_names = {
"GE", // SM_GE
};
const std::string GetSubModuleName(SubModuleId module_id) {
return sub_module_names[static_cast<size_t>(module_id % NUM_SUBMODUES)];
}
const std::string GetSubModuleName(SubModuleId module_id) { return sub_module_names[(module_id % NUM_SUBMODUES)]; }
// export GetTimeString for all sub modules
std::string GetTimeString() {