diff --git a/ge/client/ge_api.cc b/ge/client/ge_api.cc index 66958310..75cc92d4 100644 --- a/ge/client/ge_api.cc +++ b/ge/client/ge_api.cc @@ -32,6 +32,9 @@ #include "graph/common/ge_call_wrapper.h" #include "register/op_registry.h" #include "common/ge/tbe_plugin_manager.h" +#ifndef ONLY_COMPILE_OPEN_SRC +#include "toolchain/plog.h" +#endif using domi::OpRegistry; using std::map; @@ -129,6 +132,11 @@ Status GEInitializeImpl(const std::map &options) { // Initialize GE, prepare for execution, call GELib::Initialize Status GEInitialize(const std::map &options) { +#ifndef ONLY_COMPILE_OPEN_SRC + if (DlogReportInitialize() != SUCCESS) { + GELOGW("Dlog report device log initialize failed."); + } +#endif return GEInitializeImpl(options); } @@ -143,6 +151,11 @@ Status GEInitialize(const std::map &options) { std::string val = option.second.GetString(); str_options[key] = val; } +#ifndef ONLY_COMPILE_OPEN_SRC + if (DlogReportInitialize() != SUCCESS) { + GELOGW("Dlog report device log initialize failed."); + } +#endif return GEInitializeImpl(str_options); } @@ -187,6 +200,12 @@ Status GEFinalize() { // to avoid memory fragment, use malloc_trim to back free stack to system malloc_trim(0); +#ifndef ONLY_COMPILE_OPEN_SRC + if (DlogReportFinalize() != SUCCESS) { + GELOGW("Dlog report device log finalize failed."); + } +#endif + GELOGT(TRACE_STOP, "GEFinalize finished"); return ret; } diff --git a/tests/ut/ge/CMakeLists.txt b/tests/ut/ge/CMakeLists.txt index 4499041b..f197ec4f 100755 --- a/tests/ut/ge/CMakeLists.txt +++ b/tests/ut/ge/CMakeLists.txt @@ -806,6 +806,7 @@ add_library(ge_build_common STATIC ${GRAPH_BUILD_COMMON_SRC_FILES} ${PROTO_SRCS} target_compile_definitions(ge_build_common PRIVATE google=ascend_private + $<$:ONLY_COMPILE_OPEN_SRC> ) target_link_libraries(ge_build_common PRIVATE