hide character

pull/1033/head
shixingliang 4 years ago
parent 4174f7482b
commit ce034c9d92

@ -703,11 +703,13 @@ target_compile_definitions(ge_runner PRIVATE
FMK_SUPPORT_DUMP FMK_SUPPORT_DUMP
DAVINCI_CLOUD DAVINCI_CLOUD
google=ascend_private google=ascend_private
FUNC_VISIBILITY
) )
target_compile_options(ge_runner PRIVATE target_compile_options(ge_runner PRIVATE
-O2 -O2
-fno-common -fno-common
-fvisibility=hidden
$<$<STREQUAL:${CMAKE_CXX_COMPILER_VERSION},7.3.0>:-Werror=unused-variable> $<$<STREQUAL:${CMAKE_CXX_COMPILER_VERSION},7.3.0>:-Werror=unused-variable>
$<$<STREQUAL:${CMAKE_CXX_COMPILER_VERSION},7.3.0>:-Werror=unused-const-variable -Werror=format> $<$<STREQUAL:${CMAKE_CXX_COMPILER_VERSION},7.3.0>:-Werror=unused-const-variable -Werror=format>
) )
@ -738,6 +740,10 @@ target_include_directories(ge_runner SYSTEM PRIVATE
${GE_CODE_DIR}/third_party/fwkacllib/inc/toolchain ${GE_CODE_DIR}/third_party/fwkacllib/inc/toolchain
) )
target_link_options(ge_runner PRIVATE
-Wl,-Bsymbolic
)
target_link_libraries(ge_runner PRIVATE target_link_libraries(ge_runner PRIVATE
$<BUILD_INTERFACE:intf_pub> $<BUILD_INTERFACE:intf_pub>
adump_server adump_server
@ -772,11 +778,13 @@ target_compile_definitions(ge_compiler PRIVATE
FMK_HOST_INFER FMK_HOST_INFER
COMPILE_OMG_PACKAGE COMPILE_OMG_PACKAGE
google=ascend_private google=ascend_private
FUNC_VISIBILITY
) )
target_compile_options(ge_compiler PRIVATE target_compile_options(ge_compiler PRIVATE
-O2 -O2
-fno-common -fno-common
-fvisibility=hidden
$<$<STREQUAL:${CMAKE_CXX_COMPILER_VERSION},7.3.0>:-Werror=unused-variable> $<$<STREQUAL:${CMAKE_CXX_COMPILER_VERSION},7.3.0>:-Werror=unused-variable>
$<$<STREQUAL:${CMAKE_CXX_COMPILER_VERSION},7.3.0>:-Werror=unused-const-variable -Werror=format> $<$<STREQUAL:${CMAKE_CXX_COMPILER_VERSION},7.3.0>:-Werror=unused-const-variable -Werror=format>
) )
@ -807,6 +815,10 @@ target_include_directories(ge_compiler SYSTEM PRIVATE
${GE_CODE_DIR}/third_party/fwkacllib/inc/toolchain ${GE_CODE_DIR}/third_party/fwkacllib/inc/toolchain
) )
target_link_options(ge_compiler PRIVATE
-Wl,-Bsymbolic
)
target_link_libraries(ge_compiler PRIVATE target_link_libraries(ge_compiler PRIVATE
$<BUILD_INTERFACE:intf_pub> $<BUILD_INTERFACE:intf_pub>
static_mmpa static_mmpa
@ -868,6 +880,7 @@ target_compile_options(opensrc_ascendcl PRIVATE
-O2 -O2
-fvisibility=hidden -fvisibility=hidden
) )
target_link_options(opensrc_ascendcl PRIVATE target_link_options(opensrc_ascendcl PRIVATE
-rdynamic -rdynamic
-Wl,--allow-multiple-definition -Wl,--allow-multiple-definition
@ -875,6 +888,7 @@ target_link_options(opensrc_ascendcl PRIVATE
-Wl,-Bsymbolic -Wl,-Bsymbolic
-Wl,--exclude-libs,ALL -Wl,--exclude-libs,ALL
) )
target_link_libraries(opensrc_ascendcl PRIVATE target_link_libraries(opensrc_ascendcl PRIVATE
-Wl,--whole-archive -Wl,--whole-archive
ge_executor ge_executor

@ -73,6 +73,7 @@ target_compile_definitions(ge_common PRIVATE
FMK_SUPPORT_DUMP FMK_SUPPORT_DUMP
OS_CENTOS OS_CENTOS
google=ascend_private google=ascend_private
FUNC_VISIBILITY
) )
target_compile_options(ge_common PRIVATE target_compile_options(ge_common PRIVATE
@ -105,6 +106,10 @@ target_include_directories(ge_common PRIVATE
${GE_CODE_DIR}/third_party/fwkacllib/inc/toolchain ${GE_CODE_DIR}/third_party/fwkacllib/inc/toolchain
) )
target_link_options(ge_common PRIVATE
-Wl,-Bsymbolic
)
target_link_libraries(ge_common PRIVATE target_link_libraries(ge_common PRIVATE
$<BUILD_INTERFACE:intf_pub> $<BUILD_INTERFACE:intf_pub>
static_mmpa static_mmpa
@ -132,6 +137,7 @@ target_compile_definitions(ge_common_static PRIVATE
$<IF:$<STREQUAL:${TARGET_SYSTEM_NAME},Windows>,OS_TYPE=WIN,OS_TYPE=0> $<IF:$<STREQUAL:${TARGET_SYSTEM_NAME},Windows>,OS_TYPE=WIN,OS_TYPE=0>
$<$<STREQUAL:${TARGET_SYSTEM_NAME},Windows>:SECUREC_USING_STD_SECURE_LIB=0 NOMINMAX> $<$<STREQUAL:${TARGET_SYSTEM_NAME},Windows>:SECUREC_USING_STD_SECURE_LIB=0 NOMINMAX>
LOG_CPP LOG_CPP
FUNC_VISIBILITY
) )
target_compile_options(ge_common_static PRIVATE target_compile_options(ge_common_static PRIVATE
@ -181,6 +187,7 @@ target_compile_definitions(ge_common PRIVATE
OS_CENTOS OS_CENTOS
google=ascend_private google=ascend_private
LOG_CPP LOG_CPP
FUNC_VISIBILITY
) )
target_compile_options(ge_common PRIVATE target_compile_options(ge_common PRIVATE
@ -208,6 +215,10 @@ target_include_directories(ge_common PRIVATE
${GE_CODE_DIR}/third_party/fwkacllib/inc/toolchain ${GE_CODE_DIR}/third_party/fwkacllib/inc/toolchain
) )
target_link_options(ge_common PRIVATE
-Wl,-Bsymbolic
)
target_link_libraries(ge_common PRIVATE target_link_libraries(ge_common PRIVATE
$<BUILD_INTERFACE:intf_pub> $<BUILD_INTERFACE:intf_pub>
ascend_protobuf_static ascend_protobuf_static

@ -598,7 +598,7 @@ bool ModelCacheHelper::IsAllocatedGraphIdSameAsCache(Json &json) const {
return false; return false;
} }
// Compare allocated graph id info between json and VarManager // Compare allocated graph id info between json and VarManager
std::unordered_map<std::string, uint32_t> allocated_graph_id; std::map<std::string, uint32_t> allocated_graph_id;
auto ret = ParseAllocatedGraphIdFromJson(json, allocated_graph_id); auto ret = ParseAllocatedGraphIdFromJson(json, allocated_graph_id);
if (ret != SUCCESS) { if (ret != SUCCESS) {
GELOGW("Fail to parse AllocatedGraphId from Json."); GELOGW("Fail to parse AllocatedGraphId from Json.");
@ -667,7 +667,7 @@ bool ModelCacheHelper::IsChangedGraphIdSameAsCache(Json &json) const {
return false; return false;
} }
// Compare variable changed graph id info between json and VarManager // Compare variable changed graph id info between json and VarManager
std::unordered_map<std::string, uint32_t> changed_graph_id; std::map<std::string, uint32_t> changed_graph_id;
auto ret = ParseChangedGraphIdFromJson(json, changed_graph_id); auto ret = ParseChangedGraphIdFromJson(json, changed_graph_id);
if (ret != SUCCESS) { if (ret != SUCCESS) {
GELOGW("Fail to parse ChangedGraphId from Json."); GELOGW("Fail to parse ChangedGraphId from Json.");
@ -732,7 +732,7 @@ bool ModelCacheHelper::IsVarAddrMgrMapSameAsCache(Json &json) const {
} }
// Compare variable address info between json and VarManager // Compare variable address info between json and VarManager
std::vector<std::pair<std::string, VarAddrMgr>> var_addr_mgr_vector; std::vector<std::pair<std::string, VarAddrMgr>> var_addr_mgr_vector;
std::unordered_set<uint64_t> var_offset_set; std::set<uint64_t> var_offset_set;
auto ret = ParseVarAddrMgrMapFromJson(json, var_addr_mgr_vector, var_offset_set); auto ret = ParseVarAddrMgrMapFromJson(json, var_addr_mgr_vector, var_offset_set);
if (ret != SUCCESS) { if (ret != SUCCESS) {
GELOGW("Fail to parse VarAddrMgrMap from Json."); GELOGW("Fail to parse VarAddrMgrMap from Json.");
@ -942,7 +942,7 @@ Status ModelCacheHelper::RecoverAllocatedGraphId(const Json &json) const {
GELOGW("Input param json type should be null or array."); GELOGW("Input param json type should be null or array.");
return PARAM_INVALID; return PARAM_INVALID;
} }
std::unordered_map<std::string, uint32_t> allocated_graph_id; std::map<std::string, uint32_t> allocated_graph_id;
auto ret = ParseAllocatedGraphIdFromJson(json, allocated_graph_id); auto ret = ParseAllocatedGraphIdFromJson(json, allocated_graph_id);
if (ret != SUCCESS) { if (ret != SUCCESS) {
GELOGW("Fail to parse AllocatedGraphId from Json."); GELOGW("Fail to parse AllocatedGraphId from Json.");
@ -963,7 +963,7 @@ Status ModelCacheHelper::RecoverChangedGraphId(const Json &json) const {
GELOGW("Input param json type should be null or array."); GELOGW("Input param json type should be null or array.");
return PARAM_INVALID; return PARAM_INVALID;
} }
std::unordered_map<std::string, uint32_t> changed_graph_id; std::map<std::string, uint32_t> changed_graph_id;
auto ret = ParseChangedGraphIdFromJson(json, changed_graph_id); auto ret = ParseChangedGraphIdFromJson(json, changed_graph_id);
if (ret != SUCCESS) { if (ret != SUCCESS) {
GELOGW("Fail to parse AllocatedGraphId from Json."); GELOGW("Fail to parse AllocatedGraphId from Json.");
@ -985,7 +985,7 @@ Status ModelCacheHelper::RecoverVarAddrAndTensorDesc(const Json &json) const {
return PARAM_INVALID; return PARAM_INVALID;
} }
std::vector<std::pair<std::string, VarAddrMgr>> var_addr_mgr_vector; std::vector<std::pair<std::string, VarAddrMgr>> var_addr_mgr_vector;
std::unordered_set<uint64_t> var_offset_set; std::set<uint64_t> var_offset_set;
auto ret = ParseVarAddrMgrMapFromJson(json, var_addr_mgr_vector, var_offset_set); auto ret = ParseVarAddrMgrMapFromJson(json, var_addr_mgr_vector, var_offset_set);
if (ret != SUCCESS) { if (ret != SUCCESS) {
GELOGW("Fail to parse VarAddrMgrMap from Json."); GELOGW("Fail to parse VarAddrMgrMap from Json.");
@ -1508,7 +1508,7 @@ Status ModelCacheHelper::ParseMemResourceFromJson(const Json &json, map<rtMemTyp
Status ModelCacheHelper::ParseVarAddrMgrMapFromJson( Status ModelCacheHelper::ParseVarAddrMgrMapFromJson(
const Json &json, std::vector<std::pair<std::string, VarAddrMgr>> &var_addr_mgr_vector, const Json &json, std::vector<std::pair<std::string, VarAddrMgr>> &var_addr_mgr_vector,
std::unordered_set<uint64_t> &var_offset_set) { std::set<uint64_t> &var_offset_set) {
if (!(json.is_array() || json.is_null())) { if (!(json.is_array() || json.is_null())) {
GELOGW("Input param json type should be null or array."); GELOGW("Input param json type should be null or array.");
return PARAM_INVALID; return PARAM_INVALID;
@ -1606,7 +1606,7 @@ Status ModelCacheHelper::ParseTransRoadsFromJson(
} }
Status ModelCacheHelper::ParseChangedGraphIdFromJson(const Json &json, Status ModelCacheHelper::ParseChangedGraphIdFromJson(const Json &json,
std::unordered_map<std::string, uint32_t> &changed_graph_id) { std::map<std::string, uint32_t> &changed_graph_id) {
if (!(json.is_array() || json.is_null())) { if (!(json.is_array() || json.is_null())) {
GELOGW("Input param json type should be null or array."); GELOGW("Input param json type should be null or array.");
return PARAM_INVALID; return PARAM_INVALID;
@ -1624,7 +1624,7 @@ Status ModelCacheHelper::ParseChangedGraphIdFromJson(const Json &json,
} }
Status ModelCacheHelper::ParseAllocatedGraphIdFromJson(const Json &json, Status ModelCacheHelper::ParseAllocatedGraphIdFromJson(const Json &json,
std::unordered_map<std::string, uint32_t> &allocated_graph_id) { std::map<std::string, uint32_t> &allocated_graph_id) {
if (!(json.is_array() || json.is_null())) { if (!(json.is_array() || json.is_null())) {
GELOGW("Input param json type should be null or array."); GELOGW("Input param json type should be null or array.");
return PARAM_INVALID; return PARAM_INVALID;

@ -95,15 +95,15 @@ class ModelCacheHelper {
static Status ParseMemResourceFromJson(const Json &json, map<rtMemType_t, int64_t> &mem_resource); static Status ParseMemResourceFromJson(const Json &json, map<rtMemType_t, int64_t> &mem_resource);
static Status ParseVarAddrMgrMapFromJson(const Json &json, static Status ParseVarAddrMgrMapFromJson(const Json &json,
std::vector<std::pair<std::string, VarAddrMgr>> &var_addr_mgr_vector, std::vector<std::pair<std::string, VarAddrMgr>> &var_addr_mgr_vector,
std::unordered_set<uint64_t> &var_offset_set); std::set<uint64_t> &var_offset_set);
static Status ParseCurVarTensorDescMapFromJson( static Status ParseCurVarTensorDescMapFromJson(
const Json &json, std::unordered_map<std::string, ge::GeTensorDesc> &cur_var_tensor_desc_map); const Json &json, std::unordered_map<std::string, ge::GeTensorDesc> &cur_var_tensor_desc_map);
static Status ParseTransRoadsFromJson(const Json &json, static Status ParseTransRoadsFromJson(const Json &json,
std::unordered_map<std::string, std::vector<TransNodeInfo>> &trans_roads); std::unordered_map<std::string, std::vector<TransNodeInfo>> &trans_roads);
static Status ParseChangedGraphIdFromJson(const Json &json, static Status ParseChangedGraphIdFromJson(const Json &json,
std::unordered_map<std::string, uint32_t> &changed_graph_id); std::map<std::string, uint32_t> &changed_graph_id);
static Status ParseAllocatedGraphIdFromJson(const Json &json, static Status ParseAllocatedGraphIdFromJson(const Json &json,
std::unordered_map<std::string, uint32_t> &allocated_graph_id); std::map<std::string, uint32_t> &allocated_graph_id);
static Status ParseBroadcastInfoFromJson(const Json &json, static Status ParseBroadcastInfoFromJson(const Json &json,
std::unordered_map<std::string, VarBroadCastInfo> &var_broadcast_info); std::unordered_map<std::string, VarBroadCastInfo> &var_broadcast_info);
static Status GetVarNameFromVarKey(const string &var_key, const GeTensorDesc &tensor_desc, string &var_name); static Status GetVarNameFromVarKey(const string &var_key, const GeTensorDesc &tensor_desc, string &var_name);

@ -88,7 +88,7 @@ bool isProfConfigValid(const uint32_t *deviceid_list, uint32_t device_nums) {
return false; return false;
} }
std::unordered_set<uint32_t> record; std::set<uint32_t> record;
for (size_t i = 0; i < device_nums; ++i) { for (size_t i = 0; i < device_nums; ++i) {
uint32_t dev_id = deviceid_list[i]; uint32_t dev_id = deviceid_list[i];
if (dev_id >= static_cast<uint32_t>(dev_count)) { if (dev_id >= static_cast<uint32_t>(dev_count)) {

@ -214,12 +214,14 @@ target_compile_options(ge_executor_shared PRIVATE
-Werror -Werror
-O2 -O2
-Wno-deprecated-declarations -Wno-deprecated-declarations
-fvisibility=hidden
) )
target_compile_definitions(ge_executor_shared PRIVATE target_compile_definitions(ge_executor_shared PRIVATE
PROTOBUF_INLINE_NOT_IN_HEADERS=0 PROTOBUF_INLINE_NOT_IN_HEADERS=0
DAVINCI_SUPPORT_PROFILING DAVINCI_SUPPORT_PROFILING
google=ascend_private google=ascend_private
FUNC_VISIBILITY
) )
target_include_directories(ge_executor_shared PRIVATE target_include_directories(ge_executor_shared PRIVATE
@ -240,6 +242,10 @@ target_include_directories(ge_executor_shared PRIVATE
${GE_CODE_DIR}/third_party/fwkacllib/inc ${GE_CODE_DIR}/third_party/fwkacllib/inc
) )
target_link_options(ge_executor_shared PRIVATE
-Wl,-Bsymbolic
)
target_link_libraries(ge_executor_shared PRIVATE target_link_libraries(ge_executor_shared PRIVATE
$<BUILD_INTERFACE:intf_pub> $<BUILD_INTERFACE:intf_pub>
msprofiler msprofiler

@ -27,10 +27,12 @@ add_library(ge_local_engine SHARED ${SRC_LIST} ${PROTO_HDRS})
target_compile_options(ge_local_engine PRIVATE target_compile_options(ge_local_engine PRIVATE
-Werror -Werror
-fno-common -fno-common
-fvisibility=hidden
) )
target_compile_definitions(ge_local_engine PRIVATE target_compile_definitions(ge_local_engine PRIVATE
google=ascend_private google=ascend_private
FUNC_VISIBILITY
) )
target_include_directories(ge_local_engine PRIVATE target_include_directories(ge_local_engine PRIVATE
@ -51,6 +53,10 @@ target_include_directories(ge_local_engine PRIVATE
${GE_CODE_DIR}/third_party/fwkacllib/inc ${GE_CODE_DIR}/third_party/fwkacllib/inc
) )
target_link_options(ge_local_engine PRIVATE
-Wl,-Bsymbolic
)
target_link_libraries(ge_local_engine PRIVATE target_link_libraries(ge_local_engine PRIVATE
$<BUILD_INTERFACE:intf_pub> $<BUILD_INTERFACE:intf_pub>
-Wl,--no-as-needed -Wl,--no-as-needed
@ -67,11 +73,13 @@ add_library(atc_ge_local_engine SHARED ${SRC_LIST} ${PROTO_HDRS})
target_compile_options(atc_ge_local_engine PRIVATE target_compile_options(atc_ge_local_engine PRIVATE
-Werror -Werror
-fno-common -fno-common
-fvisibility=hidden
) )
target_compile_definitions(atc_ge_local_engine PRIVATE target_compile_definitions(atc_ge_local_engine PRIVATE
COMPILE_OMG_PACKAGE COMPILE_OMG_PACKAGE
google=ascend_private google=ascend_private
FUNC_VISIBILITY
) )
target_include_directories(atc_ge_local_engine PRIVATE target_include_directories(atc_ge_local_engine PRIVATE
@ -92,6 +100,10 @@ target_include_directories(atc_ge_local_engine PRIVATE
${GE_CODE_DIR}/third_party/fwkacllib/inc ${GE_CODE_DIR}/third_party/fwkacllib/inc
) )
target_link_options(atc_ge_local_engine PRIVATE
-Wl,-Bsymbolic
)
target_link_libraries(atc_ge_local_engine PRIVATE target_link_libraries(atc_ge_local_engine PRIVATE
$<BUILD_INTERFACE:intf_pub> $<BUILD_INTERFACE:intf_pub>
-Wl,--no-as-needed -Wl,--no-as-needed
@ -113,10 +125,12 @@ add_library(ge_local_opskernel_builder SHARED ${OPS_KERNEL_SRC_LIST} ${PROTO_HDR
target_compile_options(ge_local_opskernel_builder PRIVATE target_compile_options(ge_local_opskernel_builder PRIVATE
-Werror -Werror
-fno-common -fno-common
-fvisibility=hidden
) )
target_compile_definitions(ge_local_opskernel_builder PRIVATE target_compile_definitions(ge_local_opskernel_builder PRIVATE
google=ascend_private google=ascend_private
FUNC_VISIBILITY
) )
target_include_directories(ge_local_opskernel_builder PRIVATE target_include_directories(ge_local_opskernel_builder PRIVATE
@ -137,6 +151,10 @@ target_include_directories(ge_local_opskernel_builder PRIVATE
${GE_CODE_DIR}/third_party/fwkacllib/inc ${GE_CODE_DIR}/third_party/fwkacllib/inc
) )
target_link_options(ge_local_opskernel_builder PRIVATE
-Wl,-Bsymbolic
)
target_link_libraries(ge_local_opskernel_builder PRIVATE target_link_libraries(ge_local_opskernel_builder PRIVATE
$<BUILD_INTERFACE:intf_pub> $<BUILD_INTERFACE:intf_pub>
-Wl,--no-as-needed -Wl,--no-as-needed
@ -154,10 +172,12 @@ add_library(atc_ge_local_opskernel_builder SHARED ${OPS_KERNEL_SRC_LIST} ${PROTO
target_compile_options(atc_ge_local_opskernel_builder PRIVATE target_compile_options(atc_ge_local_opskernel_builder PRIVATE
-Werror -Werror
-fno-common -fno-common
-fvisibility=hidden
) )
target_compile_definitions(atc_ge_local_opskernel_builder PRIVATE target_compile_definitions(atc_ge_local_opskernel_builder PRIVATE
google=ascend_private google=ascend_private
FUNC_VISIBILITY
) )
target_include_directories(atc_ge_local_opskernel_builder PRIVATE target_include_directories(atc_ge_local_opskernel_builder PRIVATE
@ -178,6 +198,10 @@ target_include_directories(atc_ge_local_opskernel_builder PRIVATE
${GE_CODE_DIR}/third_party/fwkacllib/inc ${GE_CODE_DIR}/third_party/fwkacllib/inc
) )
target_link_options(atc_ge_local_opskernel_builder PRIVATE
-Wl,-Bsymbolic
)
target_link_libraries(atc_ge_local_opskernel_builder PRIVATE target_link_libraries(atc_ge_local_opskernel_builder PRIVATE
$<BUILD_INTERFACE:intf_pub> $<BUILD_INTERFACE:intf_pub>
-Wl,--no-as-needed -Wl,--no-as-needed
@ -200,11 +224,13 @@ add_library(ge_local_opskernel_builder_static STATIC ${OPS_KERNEL_SRC_LIST} ${PR
target_compile_options(ge_local_opskernel_builder_static PRIVATE target_compile_options(ge_local_opskernel_builder_static PRIVATE
-Werror -Werror
-fno-common -fno-common
-fvisibility=hidden
) )
target_compile_definitions(ge_local_opskernel_builder_static PRIVATE target_compile_definitions(ge_local_opskernel_builder_static PRIVATE
google=ascend_private google=ascend_private
LOG_CPP LOG_CPP
FUNC_VISIBILITY
) )
target_include_directories(ge_local_opskernel_builder_static PRIVATE target_include_directories(ge_local_opskernel_builder_static PRIVATE

@ -17,6 +17,20 @@
#ifndef GE_GE_LOCAL_ENGINE_ENGINE_GE_LOCAL_ENGINE_H_ #ifndef GE_GE_LOCAL_ENGINE_ENGINE_GE_LOCAL_ENGINE_H_
#define GE_GE_LOCAL_ENGINE_ENGINE_GE_LOCAL_ENGINE_H_ #define GE_GE_LOCAL_ENGINE_ENGINE_GE_LOCAL_ENGINE_H_
#if defined(_MSC_VER)
#ifdef FUNC_VISIBILITY
#define GE_FUNC_VISIBILITY _declspec(dllexport)
#else
#define GE_FUNC_VISIBILITY
#endif
#else
#ifdef FUNC_VISIBILITY
#define GE_FUNC_VISIBILITY __attribute__((visibility("default")))
#else
#define GE_FUNC_VISIBILITY
#endif
#endif
#include <map> #include <map>
#include <memory> #include <memory>
#include <string> #include <string>
@ -32,7 +46,7 @@ namespace ge_local {
* ge local engine. * ge local engine.
* Used for the ops not belong to any engine. eg:netoutput * Used for the ops not belong to any engine. eg:netoutput
*/ */
class GeLocalEngine { class GE_FUNC_VISIBILITY GeLocalEngine {
public: public:
/** /**
* get GeLocalEngine instance. * get GeLocalEngine instance.
@ -94,25 +108,25 @@ extern "C" {
* When Ge start, GE will invoke this interface * When Ge start, GE will invoke this interface
* @return The status whether initialize successfully * @return The status whether initialize successfully
*/ */
ge::Status Initialize(const map<string, string> &options); GE_FUNC_VISIBILITY ge::Status Initialize(const map<string, string> &options);
/** /**
* After the initialize, GE will invoke this interface to get the Ops kernel Store * After the initialize, GE will invoke this interface to get the Ops kernel Store
* @param ops_kernel_map The ge local's ops kernel info * @param ops_kernel_map The ge local's ops kernel info
*/ */
void GetOpsKernelInfoStores(std::map<std::string, OpsKernelInfoStorePtr> &ops_kernel_map); GE_FUNC_VISIBILITY void GetOpsKernelInfoStores(std::map<std::string, OpsKernelInfoStorePtr> &ops_kernel_map);
/** /**
* After the initialize, GE will invoke this interface to get the Graph Optimizer * After the initialize, GE will invoke this interface to get the Graph Optimizer
* @param graph_optimizers The ge local's Graph Optimizer objs * @param graph_optimizers The ge local's Graph Optimizer objs
*/ */
void GetGraphOptimizerObjs(std::map<std::string, GraphOptimizerPtr> &graph_optimizers); GE_FUNC_VISIBILITY void GetGraphOptimizerObjs(std::map<std::string, GraphOptimizerPtr> &graph_optimizers);
/** /**
* When the graph finished, GE will invoke this interface * When the graph finished, GE will invoke this interface
* @return The status whether initialize successfully * @return The status whether initialize successfully
*/ */
ge::Status Finalize(); GE_FUNC_VISIBILITY ge::Status Finalize();
} }
#endif // GE_GE_LOCAL_ENGINE_ENGINE_GE_LOCAL_ENGINE_H_ #endif // GE_GE_LOCAL_ENGINE_ENGINE_GE_LOCAL_ENGINE_H_

@ -16,6 +16,20 @@
#ifndef GE_GE_LOCAL_ENGINE_ENGINE_HOST_CPU_ENGINE_H_ #ifndef GE_GE_LOCAL_ENGINE_ENGINE_HOST_CPU_ENGINE_H_
#define GE_GE_LOCAL_ENGINE_ENGINE_HOST_CPU_ENGINE_H_ #define GE_GE_LOCAL_ENGINE_ENGINE_HOST_CPU_ENGINE_H_
#if defined(_MSC_VER)
#ifdef FUNC_VISIBILITY
#define GE_FUNC_VISIBILITY _declspec(dllexport)
#else
#define GE_FUNC_VISIBILITY
#endif
#else
#ifdef FUNC_VISIBILITY
#define GE_FUNC_VISIBILITY __attribute__((visibility("default")))
#else
#define GE_FUNC_VISIBILITY
#endif
#endif
#include <mutex> #include <mutex>
#include "framework/common/ge_inner_error_codes.h" #include "framework/common/ge_inner_error_codes.h"
#include "graph/node.h" #include "graph/node.h"
@ -23,7 +37,7 @@
#include "external/../register/register.h" #include "external/../register/register.h"
namespace ge { namespace ge {
class HostCpuEngine { class GE_FUNC_VISIBILITY HostCpuEngine {
public: public:
~HostCpuEngine() = default; ~HostCpuEngine() = default;

@ -22,7 +22,7 @@
namespace ge { namespace ge {
namespace ge_local { namespace ge_local {
class GeLocalOpsKernelBuilder : public OpsKernelBuilder { class GE_FUNC_VISIBILITY GeLocalOpsKernelBuilder : public OpsKernelBuilder {
public: public:
~GeLocalOpsKernelBuilder() override; ~GeLocalOpsKernelBuilder() override;
Status Initialize(const map<std::string, std::string> &options) override; Status Initialize(const map<std::string, std::string> &options) override;

@ -17,6 +17,20 @@
#ifndef GE_GE_LOCAL_ENGINE_OPS_KERNEL_STORE_GE_LOCAL_OPS_KERNEL_INFO_H_ #ifndef GE_GE_LOCAL_ENGINE_OPS_KERNEL_STORE_GE_LOCAL_OPS_KERNEL_INFO_H_
#define GE_GE_LOCAL_ENGINE_OPS_KERNEL_STORE_GE_LOCAL_OPS_KERNEL_INFO_H_ #define GE_GE_LOCAL_ENGINE_OPS_KERNEL_STORE_GE_LOCAL_OPS_KERNEL_INFO_H_
#if defined(_MSC_VER)
#ifdef FUNC_VISIBILITY
#define GE_FUNC_VISIBILITY _declspec(dllexport)
#else
#define GE_FUNC_VISIBILITY
#endif
#else
#ifdef FUNC_VISIBILITY
#define GE_FUNC_VISIBILITY __attribute__((visibility("default")))
#else
#define GE_FUNC_VISIBILITY
#endif
#endif
#include <map> #include <map>
#include <string> #include <string>
#include <vector> #include <vector>
@ -25,7 +39,7 @@
namespace ge { namespace ge {
namespace ge_local { namespace ge_local {
class GeLocalOpsKernelInfoStore : public OpsKernelInfoStore { class GE_FUNC_VISIBILITY GeLocalOpsKernelInfoStore : public OpsKernelInfoStore {
public: public:
GeLocalOpsKernelInfoStore() = default; GeLocalOpsKernelInfoStore() = default;

@ -21,7 +21,7 @@
namespace ge { namespace ge {
namespace ge_local { namespace ge_local {
class GeDeletedOp : public Op { class GE_FUNC_VISIBILITY GeDeletedOp : public Op {
public: public:
GeDeletedOp(const Node &node, RunContext &run_context); GeDeletedOp(const Node &node, RunContext &run_context);

@ -21,7 +21,7 @@
namespace ge { namespace ge {
namespace ge_local { namespace ge_local {
class NoOp : public Op { class GE_FUNC_VISIBILITY NoOp : public Op {
public: public:
NoOp(const Node &node, RunContext &run_context); NoOp(const Node &node, RunContext &run_context);

@ -29,7 +29,7 @@ namespace ge_local {
/** /**
* The base class for all op. * The base class for all op.
*/ */
class Op { class GE_FUNC_VISIBILITY Op {
public: public:
Op(const Node &node, RunContext &run_context); Op(const Node &node, RunContext &run_context);

@ -32,7 +32,7 @@ using OP_CREATOR_FUNC = std::function<std::shared_ptr<Op>(const Node &, RunConte
/** /**
* manage all the op, support create op. * manage all the op, support create op.
*/ */
class OpFactory { class GE_FUNC_VISIBILITY OpFactory {
public: public:
static OpFactory &Instance(); static OpFactory &Instance();
@ -72,7 +72,7 @@ class OpFactory {
std::vector<std::string> all_ops_; std::vector<std::string> all_ops_;
}; };
class OpRegistrar { class GE_FUNC_VISIBILITY OpRegistrar {
public: public:
OpRegistrar(const std::string &type, const OP_CREATOR_FUNC &func) { OpRegistrar(const std::string &type, const OP_CREATOR_FUNC &func) {
OpFactory::Instance().RegisterCreator(type, func); OpFactory::Instance().RegisterCreator(type, func);

@ -53,6 +53,10 @@ target_include_directories(ge_runtime PRIVATE
${CMAKE_BINARY_DIR}/proto/ge ${CMAKE_BINARY_DIR}/proto/ge
) )
target_link_options(ge_runtime PRIVATE
-Wl,-Bsymbolic
)
target_link_libraries(ge_runtime PRIVATE target_link_libraries(ge_runtime PRIVATE
$<BUILD_INTERFACE:intf_pub> $<BUILD_INTERFACE:intf_pub>
-Wl,--no-as-needed -Wl,--no-as-needed

@ -464,7 +464,7 @@ class BlockMemAssigner : public MemAssigner {
std::unordered_map<std::string, std::unordered_map<uint32_t, MemoryBlock *>> node_continuous_input_blocks_; std::unordered_map<std::string, std::unordered_map<uint32_t, MemoryBlock *>> node_continuous_input_blocks_;
std::unordered_map<std::string, uint32_t> node_continuous_input_counts_; std::map<std::string, uint32_t> node_continuous_input_counts_;
// reuse memory // reuse memory
vector<string> op_no_reuse_mem_vec_; vector<string> op_no_reuse_mem_vec_;

@ -211,7 +211,7 @@ Status TaskGenerator::SaveFusionNodes(map<int64_t, std::vector<NodePtr>> &fusion
// and it have no attr or group attr different // and it have no attr or group attr different
// which means bad case, return error // which means bad case, return error
bool call_check = true; bool call_check = true;
std::unordered_set<int64_t> input_group_ids; std::set<int64_t> input_group_ids;
for (const auto &input_node : node->GetInNodes()) { for (const auto &input_node : node->GetInNodes()) {
auto iter = nodes_with_group_attr.find(input_node); auto iter = nodes_with_group_attr.find(input_node);
if (iter == nodes_with_group_attr.end()) { if (iter == nodes_with_group_attr.end()) {

@ -44,7 +44,7 @@ class GE_FUNC_HOST_VISIBILITY GE_FUNC_DEV_VISIBILITY TransOpUtil {
static TransOpUtil &Instance(); static TransOpUtil &Instance();
typedef std::unordered_map<std::string, int> transop_index_op; typedef std::map<std::string, int> transop_index_op;
transop_index_op transop_index_map_; transop_index_op transop_index_map_;
}; };
} // namespace ge } // namespace ge

@ -100,8 +100,8 @@ class TsMemMall {
private: private:
std::mutex mem_mutex_; std::mutex mem_mutex_;
std::unordered_map<int64_t, void *> mem_store_size_; std::map<int64_t, void *> mem_store_size_;
std::unordered_map<void *, int64_t> mem_store_addr_; std::map<void *, int64_t> mem_store_addr_;
rtMemType_t mem_type_; rtMemType_t mem_type_;
}; };
} // namespace ge } // namespace ge

@ -131,7 +131,7 @@ bool IsTailingOptimization() {
} }
ge::Status CheckFpCeilingMode() { ge::Status CheckFpCeilingMode() {
static const std::unordered_set<std::string> kValidFpCeilingMode = {"0", "1", "2"}; static const std::set<std::string> kValidFpCeilingMode = {"0", "1", "2"};
string mode; string mode;
auto ret = ge::GetContext().GetOption("ge.fpCeilingMode", mode); auto ret = ge::GetContext().GetOption("ge.fpCeilingMode", mode);
if (ret == ge::GRAPH_SUCCESS) { if (ret == ge::GRAPH_SUCCESS) {

@ -170,8 +170,8 @@ class VarResource {
std::unordered_map<std::string, VarAddrMgr> var_addr_mgr_map_; std::unordered_map<std::string, VarAddrMgr> var_addr_mgr_map_;
std::unordered_map<std::string, ge::GeTensorDesc> cur_var_tensor_desc_map_; std::unordered_map<std::string, ge::GeTensorDesc> cur_var_tensor_desc_map_;
std::unordered_map<std::string, std::vector<TransNodeInfo>> var_to_trans_road_; std::unordered_map<std::string, std::vector<TransNodeInfo>> var_to_trans_road_;
std::unordered_map<std::string, uint32_t> var_names_to_changed_graph_id_; std::map<std::string, uint32_t> var_names_to_changed_graph_id_;
std::unordered_map<std::string, uint32_t> var_names_to_allocated_graph_id_; std::map<std::string, uint32_t> var_names_to_allocated_graph_id_;
std::map<uint32_t, std::unordered_map<std::string, VarBroadCastInfo>> var_broad_cast_info_; std::map<uint32_t, std::unordered_map<std::string, VarBroadCastInfo>> var_broad_cast_info_;
}; };

@ -843,7 +843,7 @@ bool ge::GraphPartitioner::HasSecondPath(size_t src, size_t dst, size_t upper_bo
/// Avoid recursion since stack space might be limited. /// Avoid recursion since stack space might be limited.
/// We instead keep a stack of nodes to visit. /// We instead keep a stack of nodes to visit.
std::vector<size_t> temp_stack; std::vector<size_t> temp_stack;
std::unordered_set<size_t> visited; std::set<size_t> visited;
temp_stack.push_back(src); temp_stack.push_back(src);
while (!temp_stack.empty()) { while (!temp_stack.empty()) {
size_t cluster = temp_stack.back(); size_t cluster = temp_stack.back();

@ -36,7 +36,7 @@ using PartitionMap = std::unordered_map<ComputeGraphPtr, std::string>;
using NodetoNodeMap = std::unordered_map<NodePtr, NodePtr>; using NodetoNodeMap = std::unordered_map<NodePtr, NodePtr>;
using EnginetoGraphMap = std::unordered_map<std::string, ComputeGraphPtr>; using EnginetoGraphMap = std::unordered_map<std::string, ComputeGraphPtr>;
using EdgeMap = std::set<std::pair<AnchorPtr, AnchorPtr>>; using EdgeMap = std::set<std::pair<AnchorPtr, AnchorPtr>>;
using ClusterSet = std::unordered_set<size_t>; using ClusterSet = std::set<size_t>;
class Cluster { class Cluster {
public: public:
size_t index_; // corresponding to rank of node size_t index_; // corresponding to rank of node

@ -50,12 +50,12 @@ Status RunOpKernelWithCheck(NodePtr &node,
return FoldingPass::RunOpKernel(node, inputs, outputs); return FoldingPass::RunOpKernel(node, inputs, outputs);
} }
const std::unordered_map<std::string, std::pair<std::uint64_t, uint64_t>> const std::map<std::string, std::pair<std::uint64_t, uint64_t>>
&ConstantFoldingPass::GetGeConstantFoldingPerfStatistic() const { &ConstantFoldingPass::GetGeConstantFoldingPerfStatistic() const {
return statistic_of_ge_constant_folding_; return statistic_of_ge_constant_folding_;
} }
const std::unordered_map<std::string, std::pair<std::uint64_t, uint64_t>> const std::map<std::string, std::pair<std::uint64_t, uint64_t>>
&ConstantFoldingPass::GetOpConstantFoldingPerfStatistic() const { &ConstantFoldingPass::GetOpConstantFoldingPerfStatistic() const {
return statistic_of_op_constant_folding_; return statistic_of_op_constant_folding_;
} }

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

Loading…
Cancel
Save