Fix codecheck warnings

This commit is contained in:
maning202007 2022-03-21 19:46:15 +08:00
parent 683597658a
commit d96201e5be
3 changed files with 6 additions and 2 deletions

View File

@ -592,7 +592,7 @@ void DebugServices::CheckWatchpointsForTensor(
// in offline mode remove the need for the data
tensor.reset();
#endif
tensor_processed_count_.fetch_add(1, std::memory_order_relaxed);
(void)tensor_processed_count_.fetch_add(1, std::memory_order_relaxed);
}
}

View File

@ -513,7 +513,7 @@ class DebugServices {
void CheckWatchpointProgress(size_t tensor_list_size);
size_t GetProcessedTensorCount() { return tensor_processed_count_; }
size_t GetProcessedTensorCount() const { return tensor_processed_count_; }
private:
std::mutex lock_;

View File

@ -29,12 +29,16 @@ DbgServices::DbgServices() { debug_services_ = std::make_shared<DebugServices>()
DbgServices::DbgServices(const DbgServices &other) {
MS_LOG(INFO) << "cpp DbgServices object is created via copy";
debug_services_ = other.debug_services_;
check_wp_in_progress_ = other.check_wp_in_progress_;
total_tensor_count_ = other.total_tensor_count_;
}
DbgServices &DbgServices::operator=(const DbgServices &other) {
MS_LOG(INFO) << "cpp DbgServices object is being assigned a different state";
if (this != &other) {
debug_services_ = other.debug_services_;
check_wp_in_progress_ = other.check_wp_in_progress_;
total_tensor_count_ = other.total_tensor_count_;
}
return *this;
}