Browse Source

Fix UT compile errors

pull/1672/head
shengnan 4 years ago
parent
commit
bb034de598
4 changed files with 14 additions and 11 deletions
  1. +10
    -8
      CMakeLists.txt
  2. +1
    -1
      ge/host_cpu_engine/CMakeLists.txt
  3. +2
    -2
      ge/ir_build/option_utils.cc
  4. +1
    -0
      tests/depends/cce/CMakeLists.txt

+ 10
- 8
CMakeLists.txt View File

@@ -79,8 +79,6 @@ if (ENABLE_OPEN_SRC)
find_module(ascend_hal_stub libascend_hal.so ${GE_LIB_PATH})
find_module(msprofiler_fwk_ext libmsprofiler_fwk.a ${GE_LIB_PATH})
#find_module(ascendcl_static libascendcl.a ${GE_LIB_PATH})
elseif(ENABLE_GE_COV OR ENABLE_GE_UT)
add_subdirectory(tests)
else()
find_module(slog libalog.so ${ASCEND_ATC_DIR})
find_module(static_mmpa libmmpa.a ${ASCEND_ATC_DIR})
@@ -95,7 +93,7 @@ if (ENABLE_OPEN_SRC)
elseif(PLATFORM STREQUAL "inference")
find_module(adump_server libadump_server.a ${ASCEND_ACL_DIR})
find_module(runtime libruntime.so ${ASCEND_ACL_DIR})
find_module(runtime_compile libruntime_compile.so ${ASCEND_ATC_DIR})
find_module(runtime_compile libruntime_compile.so ${ASCEND_ATC_DIR})
find_module(msprofiler_ext libmsprofiler.a ${ASCEND_ACL_DIR})
if(PRODUCT STREQUAL "flr3")
elseif(PRODUCT STREQUAL "flr1")
@@ -106,17 +104,21 @@ if (ENABLE_OPEN_SRC)
find_module(ascend_hal_stub libascend_hal.so ${ASCEND_DRIVER_DIR})
endif()
elseif(PLATFORM STREQUAL "all")
find_module(adump_server libadump_server.a ${ASCEND_RUNTIME_DIR})
find_module(runtime libruntime.so ${ASCEND_RUNTIME_DIR})
find_module(adump_server libadump_server.a ${ASCEND_RUNTIME_DIR})
find_module(runtime libruntime.so ${ASCEND_RUNTIME_DIR})
find_module(msprofiler_fwk_ext libmsprofiler_fwk.a ${ASCEND_RUNTIME_DIR})
find_module(ascend_hal_stub libascend_hal.so ${ASCEND_DRIVER_DIR})
find_module(runtime_compile libruntime_compile.so ${ASCEND_ATC_DIR})
find_module(msprofiler_ext libmsprofiler.a ${ASCEND_ACL_DIR})
find_module(ascend_hal_stub libascend_hal.so ${ASCEND_DRIVER_DIR}/driver)
find_module(runtime_compile libruntime_compile.so ${ASCEND_ATC_DIR})
find_module(msprofiler_ext libmsprofiler.a ${ASCEND_ACL_DIR})
else()
message(STATUS "PLATFORM param is invalid, should be train or inference, you choose nothing!")
endif()
endif()

if(ENABLE_GE_COV OR ENABLE_GE_UT)
add_subdirectory(tests)
endif()

set(METADEF_DIR ${CMAKE_CURRENT_LIST_DIR}/metadef)
set(PARSER_DIR ${CMAKE_CURRENT_LIST_DIR}/parser)
set(GE_DEPEND_DIR ${CMAKE_CURRENT_LIST_DIR}/..)


+ 1
- 1
ge/host_cpu_engine/CMakeLists.txt View File

@@ -209,7 +209,7 @@ set_target_properties(atc_host_cpu_opskernel_builder PROPERTIES
)

############ libhost_cpu_opskernel_builder.a ############
add_library(host_cpu_opskernel_builder_static STATIC ${CPU_OPS_KERNEL_LIST})
add_library(host_cpu_opskernel_builder_static STATIC ${CPU_OPS_KERNEL_LIST} ${PROTO_HDRS})

target_compile_options(host_cpu_opskernel_builder_static PRIVATE
-Werror


+ 2
- 2
ge/ir_build/option_utils.cc View File

@@ -80,12 +80,12 @@ static bool StringToLongNoThrow(const string &str, long &val) {
try {
val = std::stol(str);
return true;
} catch (const std::invalid_argument) {
} catch (const std::invalid_argument &) {
REPORT_INPUT_ERROR("E10048", std::vector<std::string>({"shape_range", "reason", "sample"}),
std::vector<string>({str, kShapeRangeValueConvertError, kInputShapeRangeSample3}));
GELOGE(PARAM_INVALID, "[Parse][Parameter] str:%s to long failed, reason: %s, correct sample is %s.",
str.c_str(), kShapeRangeValueConvertError, kInputShapeRangeSample3);
} catch (const std::out_of_range) {
} catch (const std::out_of_range &) {
REPORT_INPUT_ERROR("E10048", std::vector<std::string>({"shape_range", "reason", "sample"}),
std::vector<string>({str, kShapeRangeValueConvertError, kInputShapeRangeSample3}));
GELOGE(PARAM_INVALID, "[Parse][Parameter] str:%s to long failed, reason: %s, correct sample is %s.",


+ 1
- 0
tests/depends/cce/CMakeLists.txt View File

@@ -65,6 +65,7 @@ set(SRCS
"${GE_CODE_DIR}/metadef/graph/utils/type_utils.cc"
"${GE_CODE_DIR}/metadef/ops/op_imp.cpp"
"${GE_CODE_DIR}/metadef/graph/shape_refiner.cc"
"${GE_CODE_DIR}/metadef/graph/format_refiner.cc"
"${GE_CODE_DIR}/metadef/graph/ge_tensor.cc"
"${GE_CODE_DIR}/metadef/graph/opsproto/opsproto_manager.cc"
)


Loading…
Cancel
Save