From a6eab267152f8ff9945e61214596a3bd3a5c368b Mon Sep 17 00:00:00 2001 From: enkilee Date: Mon, 5 Feb 2024 11:49:32 +0800 Subject: [PATCH] clangtidy 29 --- paddle/fluid/framework/details/eager_deletion_op_handle.cc | 2 +- paddle/fluid/framework/details/fused_all_reduce_op_handle.cc | 2 +- paddle/fluid/inference/api/resource_manager.cc | 2 +- paddle/phi/backends/onednn/onednn_context.cc | 2 +- paddle/phi/core/sparse_coo_tensor.cc | 2 +- paddle/phi/core/string_tensor.cc | 3 ++- 6 files changed, 7 insertions(+), 6 deletions(-) diff --git a/paddle/fluid/framework/details/eager_deletion_op_handle.cc b/paddle/fluid/framework/details/eager_deletion_op_handle.cc index 4012263f688cb5..0d5d1f81b3777f 100644 --- a/paddle/fluid/framework/details/eager_deletion_op_handle.cc +++ b/paddle/fluid/framework/details/eager_deletion_op_handle.cc @@ -74,7 +74,7 @@ EagerDeletionOpHandle::EagerDeletionOpHandle( } } -EagerDeletionOpHandle::~EagerDeletionOpHandle() { +EagerDeletionOpHandle::~EagerDeletionOpHandle() { // NOLINT #if defined(PADDLE_WITH_CUDA) || defined(PADDLE_WITH_HIP) if (event_) { auto gpu_place = dev_ctx_->GetPlace(); diff --git a/paddle/fluid/framework/details/fused_all_reduce_op_handle.cc b/paddle/fluid/framework/details/fused_all_reduce_op_handle.cc index 5aa2d32d9ee2c4..738a74d1d846f7 100644 --- a/paddle/fluid/framework/details/fused_all_reduce_op_handle.cc +++ b/paddle/fluid/framework/details/fused_all_reduce_op_handle.cc @@ -60,7 +60,7 @@ FusedAllReduceOpHandle::FusedAllReduceOpHandle( num_of_all_reduce_(num_of_all_reduce) {} #endif -FusedAllReduceOpHandle::~FusedAllReduceOpHandle() { +FusedAllReduceOpHandle::~FusedAllReduceOpHandle() { // NOLINT #if defined(PADDLE_WITH_NCCL) || defined(PADDLE_WITH_RCCL) auto destroy_event = [](gpuEvent_t event) { if (event == nullptr) return; diff --git a/paddle/fluid/inference/api/resource_manager.cc b/paddle/fluid/inference/api/resource_manager.cc index 2a8029555e94f5..b18ca6e1c2a555 100644 --- a/paddle/fluid/inference/api/resource_manager.cc +++ b/paddle/fluid/inference/api/resource_manager.cc @@ -138,7 +138,7 @@ GPUContextResource::GPUContextResource(const phi::Place& place, void* stream) InitGPUResource(stream); } -GPUContextResource::~GPUContextResource() { DestroyGPUResource(); } +GPUContextResource::~GPUContextResource() { DestroyGPUResource(); } // NOLINT void GPUContextResource::InitGPUResource(void* stream) { phi::backends::gpu::GPUDeviceGuard guard(place_.device); diff --git a/paddle/phi/backends/onednn/onednn_context.cc b/paddle/phi/backends/onednn/onednn_context.cc index 8392a0a45b38c4..d4025444191b28 100644 --- a/paddle/phi/backends/onednn/onednn_context.cc +++ b/paddle/phi/backends/onednn/onednn_context.cc @@ -40,7 +40,7 @@ OneDNNContextThreadLocals::Body::Body() // and other is to start inference // TODO(jczaja): Ideally it would be good to clear only part of cache // related to thread that is to be terminated -OneDNNContextThreadLocals::Body::~Body() { +OneDNNContextThreadLocals::Body::~Body() { // NOLINT auto cpu_place = phi::CPUPlace(); // TODO(YuanRisheng): we need remove the dependency on fluid device context // here diff --git a/paddle/phi/core/sparse_coo_tensor.cc b/paddle/phi/core/sparse_coo_tensor.cc index 95501527f51fd0..dfd519250aa37d 100644 --- a/paddle/phi/core/sparse_coo_tensor.cc +++ b/paddle/phi/core/sparse_coo_tensor.cc @@ -22,7 +22,7 @@ SparseCooTensor::SparseCooTensor() { this->SetMember(non_zero_indices, non_zero_elements, {1}, true); } -SparseCooTensor::SparseCooTensor(SparseCooTensor&& other) noexcept { +SparseCooTensor::SparseCooTensor(SparseCooTensor&& other) noexcept { // NOLINT this->non_zero_elements_ = other.non_zero_elements_; this->non_zero_indices_ = other.non_zero_indices_; this->coalesced_ = other.coalesced_; diff --git a/paddle/phi/core/string_tensor.cc b/paddle/phi/core/string_tensor.cc index 35c59c2d8d787d..d370be21f4cace 100644 --- a/paddle/phi/core/string_tensor.cc +++ b/paddle/phi/core/string_tensor.cc @@ -49,7 +49,8 @@ StringTensor& StringTensor::operator=(const StringTensor& other) { return *this; } -StringTensor& StringTensor::operator=(StringTensor&& other) noexcept { +StringTensor& StringTensor::operator=( + StringTensor&& other) noexcept { // NOLINT meta_ = std::move(other.meta_); std::swap(holder_, other.holder_); return *this;