update code from yellow zone 20201013

pull/89/head
taoxiangdong 4 years ago
parent aecd9e431b
commit e91dae1239

@ -1,5 +1,5 @@
/** /**
* Copyright 2020 Huawei Technologies Co., Ltd * Copyright 2019-2020 Huawei Technologies Co., Ltd
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -77,9 +77,8 @@ Status Analyzer::BuildJsonObject(uint64_t session_id, uint64_t graph_id) {
std::lock_guard<std::recursive_mutex> lg(mutex_); std::lock_guard<std::recursive_mutex> lg(mutex_);
auto iter = graph_infos_.find(session_id); auto iter = graph_infos_.find(session_id);
if (iter == graph_infos_.end()) { if (iter == graph_infos_.end()) {
auto p = new(std::nothrow) GraphInfo(); std::shared_ptr<GraphInfo> graph_info(new(std::nothrow) GraphInfo());
GE_CHECK_NOTNULL(p); GE_CHECK_NOTNULL(graph_info);
std::shared_ptr<GraphInfo> graph_info(p);
std::map<uint64_t, std::shared_ptr<GraphInfo>> graph_map; std::map<uint64_t, std::shared_ptr<GraphInfo>> graph_map;
graph_map[graph_id] = graph_info; graph_map[graph_id] = graph_info;
graph_info->session_id = session_id; graph_info->session_id = session_id;
@ -88,9 +87,8 @@ Status Analyzer::BuildJsonObject(uint64_t session_id, uint64_t graph_id) {
} else { } else {
auto iter1 = (iter->second).find(graph_id); auto iter1 = (iter->second).find(graph_id);
if (iter1 == (iter->second).end()) { if (iter1 == (iter->second).end()) {
auto p = new(std::nothrow) GraphInfo(); std::shared_ptr<GraphInfo> graph_info(new(std::nothrow) GraphInfo());
GE_CHECK_NOTNULL(p); GE_CHECK_NOTNULL(graph_info);
std::shared_ptr<GraphInfo> graph_info(p);
graph_info->session_id = session_id; graph_info->session_id = session_id;
graph_info->graph_id = graph_id; graph_info->graph_id = graph_id;
(iter->second).insert({graph_id, graph_info}); (iter->second).insert({graph_id, graph_info});

@ -1,5 +1,5 @@
/** /**
* Copyright 2020 Huawei Technologies Co., Ltd * Copyright 2019-2020 Huawei Technologies Co., Ltd
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.

@ -16,6 +16,7 @@
#include "ge/ge_api.h" #include "ge/ge_api.h"
#include <iostream> #include <iostream>
#include <malloc.h>
#include "common/debug/log.h" #include "common/debug/log.h"
#include "framework/common/debug/ge_log.h" #include "framework/common/debug/ge_log.h"
#include "common/ge/datatype_util.h" #include "common/ge/datatype_util.h"
@ -163,6 +164,9 @@ Status GEFinalize() {
g_ge_initialized = false; g_ge_initialized = false;
} }
// to avoid memory fragment, use malloc_trim to back free stack to system
malloc_trim(0);
GELOGT(TRACE_STOP, "GEFinalize finished"); GELOGT(TRACE_STOP, "GEFinalize finished");
return ret; return ret;
} }

@ -1,5 +1,5 @@
/** /**
* Copyright 2020 Huawei Technologies Co., Ltd * Copyright 2019-2020 Huawei Technologies Co., Ltd
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -324,10 +324,17 @@ Status aclgrphProfStop(aclgrphProfConfig *profiler_config) {
return GE_PROF_NOT_INIT; return GE_PROF_NOT_INIT;
} }
Status ret = ProfStopProfiling(&profiler_config->config); for (uint32_t i = 0; i < profiler_config->config.devNums; i++) {
if (ret != SUCCESS) { uint64_t data_type_config;
GELOGE(ret, "Stop profiling failed, prof result = %d", ret); Status status = ProfGetDataTypeConfig(profiler_config->config.devIdList[i], data_type_config);
return ret; if (status != SUCCESS) {
GELOGE(status, "Prof get data type config failed, prof result = %d", status);
return status;
}
if (data_type_config != profiler_config->config.dataTypeConfig) {
GELOGE(FAILED, "data type config verify failed");
return FAILED;
}
} }
std::vector<string> prof_params; std::vector<string> prof_params;
@ -344,12 +351,18 @@ Status aclgrphProfStop(aclgrphProfConfig *profiler_config) {
command.module_index = profiler_config->config.dataTypeConfig; command.module_index = profiler_config->config.dataTypeConfig;
GELOGI("Profiling will stop, device nums:%s , deviceID:[%s], data type config: 0x%llx", prof_params[0].c_str(), GELOGI("Profiling will stop, device nums:%s , deviceID:[%s], data type config: 0x%llx", prof_params[0].c_str(),
prof_params[kDeviceListIndex].c_str(), command.module_index); prof_params[kDeviceListIndex].c_str(), command.module_index);
ret = graph_loader.CommandHandle(command); Status ret = graph_loader.CommandHandle(command);
if (ret != SUCCESS) { if (ret != SUCCESS) {
GELOGE(ret, "Handle profiling command failed"); GELOGE(ret, "Handle profiling command failed");
return FAILED; return FAILED;
} }
ret = ProfStopProfiling(&profiler_config->config);
if (ret != SUCCESS) {
GELOGE(ret, "Stop profiling failed, prof result = %d", ret);
return ret;
}
GELOGI("Successfully execute GraphProfStopProfiling."); GELOGI("Successfully execute GraphProfStopProfiling.");
return SUCCESS; return SUCCESS;
} }

@ -1,5 +1,5 @@
/** /**
* Copyright 2020 Huawei Technologies Co., Ltd * Copyright 2019-2020 Huawei Technologies Co., Ltd
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.

@ -1,5 +1,5 @@
/** /**
* Copyright 2020 Huawei Technologies Co., Ltd * Copyright 2019-2020 Huawei Technologies Co., Ltd
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.

@ -1,5 +1,5 @@
/** /**
* Copyright 2020 Huawei Technologies Co., Ltd * Copyright 2019-2020 Huawei Technologies Co., Ltd
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.

@ -1,5 +1,5 @@
/** /**
* Copyright 2020 Huawei Technologies Co., Ltd * Copyright 2019-2020 Huawei Technologies Co., Ltd
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.

@ -1,5 +1,5 @@
/** /**
* Copyright 2020 Huawei Technologies Co., Ltd * Copyright 2019-2020 Huawei Technologies Co., Ltd
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.

@ -1,5 +1,5 @@
/** /**
* Copyright 2020 Huawei Technologies Co., Ltd * Copyright 2019-2020 Huawei Technologies Co., Ltd
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.

@ -1,5 +1,5 @@
/** /**
* Copyright 2020 Huawei Technologies Co., Ltd * Copyright 2019-2020 Huawei Technologies Co., Ltd
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.

@ -1,5 +1,5 @@
/** /**
* Copyright 2020 Huawei Technologies Co., Ltd * Copyright 2019-2020 Huawei Technologies Co., Ltd
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.

@ -1,5 +1,5 @@
/** /**
* Copyright 2020 Huawei Technologies Co., Ltd * Copyright 2019-2020 Huawei Technologies Co., Ltd
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.

@ -1,5 +1,5 @@
/** /**
* Copyright 2020 Huawei Technologies Co., Ltd * Copyright 2019-2020 Huawei Technologies Co., Ltd
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.

@ -172,18 +172,18 @@ Status DumpOp::ExecutorDumpOp(aicpu::dump::OpMappingInfo &op_mapping_info) {
return RT_FAILED; return RT_FAILED;
} }
constexpr int32_t ioAddrNum = 2; constexpr int32_t io_addr_num = 2;
constexpr uint32_t argsSize = sizeof(aicpu::AicpuParamHead) + ioAddrNum * sizeof(uint64_t); constexpr uint32_t args_size = sizeof(aicpu::AicpuParamHead) + io_addr_num * sizeof(uint64_t);
char args[argsSize] = {0}; char args[args_size] = {0};
auto paramHead = reinterpret_cast<aicpu::AicpuParamHead *>(args); auto param_head = reinterpret_cast<aicpu::AicpuParamHead *>(args);
paramHead->length = argsSize; param_head->length = args_size;
paramHead->ioAddrNum = ioAddrNum; param_head->ioAddrNum = io_addr_num;
auto ioAddr = reinterpret_cast<uint64_t *>(args + sizeof(aicpu::AicpuParamHead)); auto io_addr = reinterpret_cast<uint64_t *>(args + sizeof(aicpu::AicpuParamHead));
ioAddr[0] = reinterpret_cast<uintptr_t>(proto_dev_mem_); io_addr[0] = reinterpret_cast<uintptr_t>(proto_dev_mem_);
ioAddr[1] = reinterpret_cast<uintptr_t>(proto_size_dev_mem_); io_addr[1] = reinterpret_cast<uintptr_t>(proto_size_dev_mem_);
rt_ret = rtCpuKernelLaunch(nullptr, kDumpKernelsDumpOp, rt_ret = rtCpuKernelLaunch(nullptr, kDumpKernelsDumpOp,
1, // blockDim default 1 1, // blockDim default 1
args, argsSize, args, args_size,
nullptr, // no need smDesc nullptr, // no need smDesc
stream_); stream_);
if (rt_ret != RT_ERROR_NONE) { if (rt_ret != RT_ERROR_NONE) {

@ -1,5 +1,5 @@
/** /**
* Copyright 2020 Huawei Technologies Co., Ltd * Copyright 2019-2020 Huawei Technologies Co., Ltd
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.

@ -1,5 +1,5 @@
/** /**
* Copyright 2020 Huawei Technologies Co., Ltd * Copyright 2019-2020 Huawei Technologies Co., Ltd
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.

@ -1,5 +1,5 @@
/** /**
* Copyright 2020 Huawei Technologies Co., Ltd * Copyright 2019-2020 Huawei Technologies Co., Ltd
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.

@ -1,5 +1,5 @@
/** /**
* Copyright 2020 Huawei Technologies Co., Ltd * Copyright 2019-2020 Huawei Technologies Co., Ltd
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.

@ -1,5 +1,5 @@
/** /**
* Copyright 2020 Huawei Technologies Co., Ltd * Copyright 2019-2020 Huawei Technologies Co., Ltd
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.

@ -1,5 +1,5 @@
/** /**
* Copyright 2020 Huawei Technologies Co., Ltd * Copyright 2019-2020 Huawei Technologies Co., Ltd
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.

@ -1,5 +1,5 @@
/** /**
* Copyright 2020 Huawei Technologies Co., Ltd * Copyright 2019-2020 Huawei Technologies Co., Ltd
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.

@ -1,5 +1,5 @@
/** /**
* Copyright 2020 Huawei Technologies Co., Ltd * Copyright 2019-2020 Huawei Technologies Co., Ltd
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.

@ -1,5 +1,5 @@
/** /**
* Copyright 2020 Huawei Technologies Co., Ltd * Copyright 2019-2020 Huawei Technologies Co., Ltd
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.

@ -1,5 +1,5 @@
/** /**
* Copyright 2020 Huawei Technologies Co., Ltd * Copyright 2019-2020 Huawei Technologies Co., Ltd
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
#include "common/formats/format_transfers/format_transfer_dhwcn_fracz3D.h" #include "common/formats/format_transfers/format_transfer_dhwcn_fracz3D.h"
#include <securec.h> #include <securec.h>

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save