Move Extension tests from ieFuncTests to cpuFuncTests (#3927)

* Move Extension tests from ieFuncTests to cpuFuncTests

* Move extension directory up
This commit is contained in:
Mateusz Tabaka 2021-02-02 09:55:14 +01:00 committed by GitHub
parent c56f3cd170
commit 4e601eb315
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 22 additions and 22 deletions

View File

@ -1,4 +1,4 @@
# Copyright (C) 2019 Intel Corporation
# Copyright (C) 2019-2021 Intel Corporation
#
# SPDX-License-Identifier: Apache-2.0
#
@ -25,18 +25,10 @@ set(DEPENDENCIES
sharedTestClasses
)
if (NGRAPH_ONNX_IMPORT_ENABLE AND NOT NGRAPH_USE_PROTOBUF_LITE)
list(APPEND INCLUDES "${OpenVINO_MAIN_SOURCE_DIR}/docs/onnx_custom_op")
list(APPEND LINK_LIBRARIES onnx_custom_op)
list(APPEND DEPENDENCIES onnx_custom_op)
else()
if (NOT NGRAPH_ONNX_IMPORT_ENABLE OR NGRAPH_USE_PROTOBUF_LITE)
set(EXCLUDED_SOURCE_PATHS "${CMAKE_CURRENT_SOURCE_DIR}/onnx_reader")
endif()
if (NOT NGRAPH_ONNX_IMPORT_ENABLE OR NOT ENABLE_MKL_DNN OR NGRAPH_USE_PROTOBUF_LITE)
set(EXCLUDED_SOURCE_PATHS ${EXCLUDED_SOURCE_PATHS} "${CMAKE_CURRENT_SOURCE_DIR}/extension.cpp")
endif()
addIeTargetTest(
NAME ${TARGET_NAME}
ROOT ${CMAKE_CURRENT_SOURCE_DIR}

View File

@ -1,4 +1,4 @@
# Copyright (C) 2019-2020 Intel Corporation
# Copyright (C) 2019-2021 Intel Corporation
#
# SPDX-License-Identifier: Apache-2.0
#
@ -9,16 +9,24 @@ add_library(cpuSpecificRtInfo STATIC ${IE_MAIN_SOURCE_DIR}/src/mkldnn_plugin/uti
${IE_MAIN_SOURCE_DIR}/src/mkldnn_plugin/utils/rt_info/memory_formats_attribute.cpp)
target_link_libraries(cpuSpecificRtInfo PRIVATE ${NGRAPH_LIBRARIES})
set(INCLUDES ${CMAKE_CURRENT_SOURCE_DIR} ${IE_MAIN_SOURCE_DIR}/src/mkldnn_plugin)
set(DEPENDENCIES MKLDNNPlugin)
set(LINK_LIBRARIES funcSharedTests cpuSpecificRtInfo)
if (NGRAPH_ONNX_IMPORT_ENABLE AND NOT NGRAPH_USE_PROTOBUF_LITE)
list(APPEND INCLUDES "${OpenVINO_MAIN_SOURCE_DIR}/docs/onnx_custom_op")
list(APPEND LINK_LIBRARIES onnx_custom_op)
list(APPEND DEPENDENCIES template_extension onnx_custom_op)
else()
set(EXCLUDED_SOURCE_PATHS "${CMAKE_CURRENT_SOURCE_DIR}/extension")
endif()
addIeTargetTest(
NAME ${TARGET_NAME}
ROOT ${CMAKE_CURRENT_SOURCE_DIR}
INCLUDES ${CMAKE_CURRENT_SOURCE_DIR}
${IE_MAIN_SOURCE_DIR}/src/mkldnn_plugin
DEPENDENCIES
MKLDNNPlugin
LINK_LIBRARIES
funcSharedTests
cpuSpecificRtInfo
INCLUDES ${INCLUDES}
EXCLUDED_SOURCE_PATHS ${EXCLUDED_SOURCE_PATHS}
DEPENDENCIES ${DEPENDENCIES}
LINK_LIBRARIES ${LINK_LIBRARIES}
ADD_CPPLINT
LABELS
CPU

View File

@ -1,4 +1,4 @@
// Copyright (C) 2020 Intel Corporation
// Copyright (C) 2020-2021 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//
@ -129,7 +129,8 @@ class CustomAbsExtension : public InferenceEngine::IExtension {
}
};
void infer_model(InferenceEngine::Core& ie, const std::string& model, const std::vector<float>& input_values, const std::vector<float>& expected) {
void infer_model(InferenceEngine::Core& ie, const std::string& model,
const std::vector<float>& input_values, const std::vector<float>& expected) {
InferenceEngine::Blob::CPtr weights;
auto network = ie.ReadNetwork(model, weights);
auto function = network.getFunction();
@ -269,8 +270,7 @@ TEST(Extension, XmlModelWithCustomAbs) {
static std::string get_extension_path() {
return FileUtils::makePluginLibraryName<char>({},
std::string("template_extension") + IE_BUILD_POSTFIX);
return FileUtils::makePluginLibraryName<char>({}, std::string("template_extension") + IE_BUILD_POSTFIX);
}