From 1bdbc03b746fceea975376ca40e38a941ec2ccb6 Mon Sep 17 00:00:00 2001 From: dongduo Date: Sat, 5 Dec 2020 17:50:43 +0800 Subject: [PATCH] Fix code check --- ge/client/ge_api.cc | 2 +- ge/graph/load/new_model_manager/davinci_model.cc | 2 +- ge/graph/load/new_model_manager/model_manager.cc | 2 +- ge/graph/optimize/mem_rw_conflict_optimize.cc | 2 +- ge/host_kernels/strided_slice_kernel.cc | 6 ++++-- ge/hybrid/model/hybrid_model_builder.cc | 6 +++--- ge/hybrid/node_executor/aicpu/aicpu_node_executor.cc | 2 +- ge/hybrid/node_executor/task_context.cc | 4 +--- tests/depends/error_manager/src/error_manager_stub.cc | 2 +- tests/depends/hccl/src/hccl_stub.cc | 10 +++++----- tests/depends/runtime/src/runtime_stub.cc | 2 +- .../graph/build/logical_stream_allocator_unittest.cc | 4 ++-- tests/ut/ge/graph/load/new_op_test_utils.h | 2 +- 13 files changed, 23 insertions(+), 23 deletions(-) diff --git a/ge/client/ge_api.cc b/ge/client/ge_api.cc index 9ecc3016..66958310 100644 --- a/ge/client/ge_api.cc +++ b/ge/client/ge_api.cc @@ -134,7 +134,7 @@ Status GEInitialize(const std::map &options) { Status GEInitialize(const std::map &options) { std::map str_options; - for (auto & option : options) { + for (auto &option : options) { if (option.first.GetString() == nullptr || option.second.GetString() == nullptr) { GELOGE(FAILED, "GEInitialize options is nullptr."); return FAILED; diff --git a/ge/graph/load/new_model_manager/davinci_model.cc b/ge/graph/load/new_model_manager/davinci_model.cc index e2923286..ba7ca226 100755 --- a/ge/graph/load/new_model_manager/davinci_model.cc +++ b/ge/graph/load/new_model_manager/davinci_model.cc @@ -2676,7 +2676,7 @@ Status DavinciModel::ReturnResult(uint32_t data_id, const bool rslt_flg, const b cur_dynamic_dims_.clear(); cur_dynamic_dims_.resize(shape_of_cur_dynamic_dims_); GE_CHK_RT_RET(rtMemcpy(cur_dynamic_dims_.data(), shape_of_cur_dynamic_dims_ * sizeof(int64_t), - netoutput_last_input_addr_, netoutput_last_input_size_, RT_MEMCPY_DEVICE_TO_HOST)); + netoutput_last_input_addr_, netoutput_last_input_size_, RT_MEMCPY_DEVICE_TO_HOST)); } GELOGD("Cur dynamic dims is %s.", formats::JoinToString(cur_dynamic_dims_).c_str()); if (GenOutputTensorInfo(op_desc, data_index, output_data, outputs) != SUCCESS) { diff --git a/ge/graph/load/new_model_manager/model_manager.cc b/ge/graph/load/new_model_manager/model_manager.cc index b7a0983d..080ca889 100755 --- a/ge/graph/load/new_model_manager/model_manager.cc +++ b/ge/graph/load/new_model_manager/model_manager.cc @@ -1055,7 +1055,7 @@ Status ModelManager::GenSessionId(uint64_t &session_id) { Status ModelManager::LoadModelOffline(uint32_t &model_id, const ModelData &model, shared_ptr listener, void *dev_ptr, size_t mem_size, void *weight_ptr, size_t weight_size) { GE_CHK_BOOL_RET_STATUS(model.key.empty() || mmAccess2(model.key.c_str(), M_F_OK) == EN_OK, - ACL_ERROR_GE_PARAM_INVALID, + ACL_ERROR_GE_PARAM_INVALID, "input key file path %s is invalid, %s", model.key.c_str(), strerror(errno)); GenModelId(&model_id); diff --git a/ge/graph/optimize/mem_rw_conflict_optimize.cc b/ge/graph/optimize/mem_rw_conflict_optimize.cc index 2fabc035..5888471a 100644 --- a/ge/graph/optimize/mem_rw_conflict_optimize.cc +++ b/ge/graph/optimize/mem_rw_conflict_optimize.cc @@ -643,7 +643,7 @@ Status HandleAllreduceDuplicateInput(ComputeGraphPtr &compute_graph) { auto ret = GraphUtils::InsertNodeBetweenDataAnchors(pre_out_anchor, in_data_anchor, identity_node); GE_CHK_STATUS_RET(ret, "Fail to insert identity."); GELOGI("InsertNode %s between %s and %s successfully.", identity_node->GetName().c_str(), - pre_node->GetName().c_str(), node->GetName().c_str()); + pre_node->GetName().c_str(), node->GetName().c_str()); } } } diff --git a/ge/host_kernels/strided_slice_kernel.cc b/ge/host_kernels/strided_slice_kernel.cc index d52bd328..213f6d91 100644 --- a/ge/host_kernels/strided_slice_kernel.cc +++ b/ge/host_kernels/strided_slice_kernel.cc @@ -284,8 +284,10 @@ void StridedSliceKernel::ExpandDimsWithNewAxis(const ConstGeTensorPtr &begin_ten } void StridedSliceKernel::ExpandStrideWithEllipsisMask(const size_t x_dims_num, - const vector &x_dims, vector &orig_begin_vec, - vector &orig_end_vec, vector &orig_stride_vec) { + const vector &x_dims, + vector &orig_begin_vec, + vector &orig_end_vec, + vector &orig_stride_vec) { if (attr_value_map_.at(STRIDE_SLICE_ATTR_ELLIPSIS_MASK) != 0) { auto end_mask = attr_value_map_.at(STRIDE_SLICE_ATTR_END_MASK); diff --git a/ge/hybrid/model/hybrid_model_builder.cc b/ge/hybrid/model/hybrid_model_builder.cc index d5a328f3..f9564a8f 100755 --- a/ge/hybrid/model/hybrid_model_builder.cc +++ b/ge/hybrid/model/hybrid_model_builder.cc @@ -313,9 +313,9 @@ Status HybridModelBuilder::ParseDependentForFusedSubgraph(NodeItem &node_item) { uint32_t parent_index = 0; if (!AttrUtils::GetInt(*op_desc, ATTR_NAME_PARENT_NODE_INDEX, parent_index)) { GELOGE(INTERNAL_ERROR, - "[%s] Failed to get attr [%s]", - op_desc->GetName().c_str(), - ATTR_NAME_PARENT_NODE_INDEX.c_str()); + "[%s] Failed to get attr [%s]", + op_desc->GetName().c_str(), + ATTR_NAME_PARENT_NODE_INDEX.c_str()); return INTERNAL_ERROR; } diff --git a/ge/hybrid/node_executor/aicpu/aicpu_node_executor.cc b/ge/hybrid/node_executor/aicpu/aicpu_node_executor.cc index db3c91cd..573739bc 100755 --- a/ge/hybrid/node_executor/aicpu/aicpu_node_executor.cc +++ b/ge/hybrid/node_executor/aicpu/aicpu_node_executor.cc @@ -724,7 +724,7 @@ Status AicpuNodeTask::UpdateIoAddr(TaskContext &context) { auto io_addr = args_.get() + sizeof(aicpu::AicpuParamHead); // if has input and output, need copy to ioaddr int cpy_ret = memcpy_s(io_addr, args_size_ - sizeof(aicpu::AicpuParamHead), - &io_addrs[0], sizeof(uint64_t) * io_addrs.size()); + &io_addrs[0], sizeof(uint64_t) * io_addrs.size()); GE_CHK_BOOL_RET_STATUS(cpy_ret == 0, INTERNAL_ERROR, "Node[%s] memcpy io addr to AicpuParamHead failed, ret=%d, args_size=%u, io nums=%zu.", node_name_.c_str(), cpy_ret, args_size_, io_addrs.size()); diff --git a/ge/hybrid/node_executor/task_context.cc b/ge/hybrid/node_executor/task_context.cc index b7152878..77004f99 100644 --- a/ge/hybrid/node_executor/task_context.cc +++ b/ge/hybrid/node_executor/task_context.cc @@ -233,9 +233,7 @@ Status TaskContext::AllocateOutput(int index, } else { GE_CHK_STATUS_RET_NOLOG(AllocateTensor(tensor_desc, outputs_start_[index], attr)); GELOGD("Allocating output successfully. node: %s. index = %d, size = %zu", - node_item_->NodeName().c_str(), - index, - outputs_start_[index].GetSize()); + node_item_->NodeName().c_str(), index, outputs_start_[index].GetSize()); } } } diff --git a/tests/depends/error_manager/src/error_manager_stub.cc b/tests/depends/error_manager/src/error_manager_stub.cc index 4f6b6b3d..edf5a487 100644 --- a/tests/depends/error_manager/src/error_manager_stub.cc +++ b/tests/depends/error_manager/src/error_manager_stub.cc @@ -58,7 +58,7 @@ /// @param [in] value: vector parameter value /// void ErrorManager::ATCReportErrMessage(std::string error_code, const std::vector &key, - const std::vector &value) { + const std::vector &value) { } /// diff --git a/tests/depends/hccl/src/hccl_stub.cc b/tests/depends/hccl/src/hccl_stub.cc index 1cc8fdb3..b9b9d4f6 100644 --- a/tests/depends/hccl/src/hccl_stub.cc +++ b/tests/depends/hccl/src/hccl_stub.cc @@ -19,26 +19,26 @@ #include "hccl/hcom.h" HcclResult hcom_all_gather(const char *tag, void *input_count_ptr, void *output_ptr, u64 input_count, - HcclDataType data_type, const char *group, rtStream_t stream) { + HcclDataType data_type, const char *group, rtStream_t stream) { return HCCL_SUCCESS; } HcclResult hcom_broadcast(const char *tag, void *ptr, u64 count, HcclDataType data_type, u32 root, - const char *group, rtStream_t stream) { + const char *group, rtStream_t stream) { return HCCL_SUCCESS; } HcclResult hcom_all_reduce(const char *tag, void *input_ptr, void *output_ptr, u64 count, HcclDataType data_type, - HcclReduceOp op, const char *group, rtStream_t stream) { + HcclReduceOp op, const char *group, rtStream_t stream) { return HCCL_SUCCESS; } HcclResult hcom_get_split_strategy(const char *group, const struct model_feature *feature, u32 max_segment_num, - u32 *segment_num, u32 *segment_idx) { + u32 *segment_num, u32 *segment_idx) { return HCCL_SUCCESS; } HcclResult hcom_reduce_scatter(const char *tag, void *input_ptr, void *output_ptr, u64 count, - HcclDataType data_type, HcclReduceOp op, const char *group, rtStream_t stream) { + HcclDataType data_type, HcclReduceOp op, const char *group, rtStream_t stream) { return HCCL_SUCCESS; } diff --git a/tests/depends/runtime/src/runtime_stub.cc b/tests/depends/runtime/src/runtime_stub.cc index 2ab6684d..75eefdd1 100644 --- a/tests/depends/runtime/src/runtime_stub.cc +++ b/tests/depends/runtime/src/runtime_stub.cc @@ -325,7 +325,7 @@ rtError_t rtSetTaskFailCallback(rtTaskFailCallback callback) } rtError_t rtMallocHostSharedMemory(rtMallocHostSharedMemoryIn *in, - rtMallocHostSharedMemoryOut *out) + rtMallocHostSharedMemoryOut *out) { out->ptr = new uint8_t[in->size]; out->devPtr = new uint8_t[in->size]; diff --git a/tests/ut/ge/graph/build/logical_stream_allocator_unittest.cc b/tests/ut/ge/graph/build/logical_stream_allocator_unittest.cc index 68416409..5b87939f 100644 --- a/tests/ut/ge/graph/build/logical_stream_allocator_unittest.cc +++ b/tests/ut/ge/graph/build/logical_stream_allocator_unittest.cc @@ -306,8 +306,8 @@ class UtestLogicalStreamAllocator : public testing::Test { max_parallel_num["aicpu"] = parallel_num; Status status = AssignLogicalStreams({const1, const2, get_next, genmask1, genmask2, domask, subgraph4, subgraph5, - subgraph6, allreduce1, allreduce2, apply1, apply2}, - confs, max_parallel_num); + subgraph6, allreduce1, allreduce2, apply1, apply2}, + confs, max_parallel_num); EXPECT_EQ(status, ge::SUCCESS); EXPECT_EQ(GetStream(get_next), 0); diff --git a/tests/ut/ge/graph/load/new_op_test_utils.h b/tests/ut/ge/graph/load/new_op_test_utils.h index 325a3f1f..4cbc78ac 100644 --- a/tests/ut/ge/graph/load/new_op_test_utils.h +++ b/tests/ut/ge/graph/load/new_op_test_utils.h @@ -154,7 +154,7 @@ class OmeTestOpUtils { if (model->HasAttr(MODEL_ATTR_TASKS)) { ge::Buffer task_buffer; GE_CHK_BOOL_RET_STATUS(ge::AttrUtils::GetZeroCopyBytes(model, MODEL_ATTR_TASKS, task_buffer), FAILED, - "Get bytes failed."); + "Get bytes failed."); std::shared_ptr task = ge::MakeShared(); GE_CHECK_NOTNULL(task); GE_IF_BOOL_EXEC(task_buffer.GetData() == nullptr, GELOGE(FAILED, "Get data fail"); return FAILED);