Fixed WASM build for tests (#15376)
* Fixed WASM build for tests * Update cmake/developer_package/models.cmake
This commit is contained in:
@@ -105,17 +105,6 @@ function(ie_add_plugin)
|
||||
|
||||
add_dependencies(ov_plugins ${IE_PLUGIN_NAME})
|
||||
|
||||
# fake dependencies to build in the following order:
|
||||
# OV -> OV frontends -> OV inference plugins -> OV-based apps
|
||||
if(BUILD_SHARED_LIBS)
|
||||
add_dependencies(${IE_PLUGIN_NAME} ov_frontends)
|
||||
|
||||
# TODO: remove with legacy CNNNLayer API / IR v7
|
||||
if(TARGET inference_engine_ir_v7_reader)
|
||||
add_dependencies(${IE_PLUGIN_NAME} inference_engine_ir_v7_reader)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# install rules
|
||||
if(NOT IE_PLUGIN_SKIP_INSTALL OR NOT BUILD_SHARED_LIBS)
|
||||
string(TOLOWER "${IE_PLUGIN_DEVICE_NAME}" install_component)
|
||||
|
||||
@@ -79,13 +79,7 @@ ie_dependent_option (ENABLE_INTEL_GNA "GNA support for OpenVINO Runtime" ON
|
||||
|
||||
ie_option (ENABLE_INTEL_GNA_DEBUG "GNA debug build" OFF)
|
||||
|
||||
if((ENABLE_TESTS OR BUILD_SHARED_LIBS) AND ENABLE_INTEL_GNA)
|
||||
set(ENABLE_IR_V7_READER_DEFAULT ON)
|
||||
else()
|
||||
set(ENABLE_IR_V7_READER_DEFAULT OFF)
|
||||
endif()
|
||||
|
||||
ie_option (ENABLE_IR_V7_READER "Enables IR v7 reader" ${ENABLE_IR_V7_READER_DEFAULT})
|
||||
ie_dependent_option (ENABLE_IR_V7_READER "Enables IR v7 reader" ${BUILD_SHARED_LIBS} "ENABLE_TESTS;ENABLE_INTEL_GNA" OFF)
|
||||
|
||||
ie_option (ENABLE_GAPI_PREPROCESSING "Enables G-API preprocessing" ON)
|
||||
|
||||
@@ -156,7 +150,7 @@ ie_option(ENABLE_OV_TF_LITE_FRONTEND "Enable TensorFlow Lite FrontEnd" ON)
|
||||
ie_dependent_option(ENABLE_SYSTEM_PROTOBUF "Use system protobuf" OFF
|
||||
"ENABLE_OV_ONNX_FRONTEND OR ENABLE_OV_PADDLE_FRONTEND OR ENABLE_OV_TF_FRONTEND;BUILD_SHARED_LIBS" OFF)
|
||||
ie_option(ENABLE_OV_IR_FRONTEND "Enable IR FrontEnd" ON)
|
||||
ie_dependent_option(ENABLE_SYSTEM_FLATBUFFERS "Use system flatbuffers" ${ENABLE_SYSTEM_LIBS_DEFAULT}
|
||||
ie_dependent_option(ENABLE_SYSTEM_FLATBUFFERS "Use system flatbuffers" ON
|
||||
"ENABLE_OV_TF_LITE_FRONTEND" OFF)
|
||||
|
||||
ie_dependent_option(ENABLE_OV_CORE_UNIT_TESTS "Enables OpenVINO core unit tests" ON "ENABLE_TESTS" OFF)
|
||||
|
||||
@@ -32,7 +32,7 @@ public:
|
||||
OPENVINO_OP("ControlDependencyOp");
|
||||
virtual std::shared_ptr<Node> clone_with_new_inputs(const OutputVector& new_args) const override {
|
||||
auto clone = make_shared<ControlDependencyOp>(new_args, std::set<std::shared_ptr<Node>>{});
|
||||
return move(clone);
|
||||
return std::move(clone);
|
||||
}
|
||||
|
||||
ControlDependencyOp(const OutputVector& args, const std::set<std::shared_ptr<Node>>& deps) : Op(args) {
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
FILE* port_open(const char* command, const char* type) {
|
||||
#ifdef _WIN32
|
||||
return _popen(command, type);
|
||||
#elif defined(__linux) || defined(__APPLE__)
|
||||
#elif defined(__linux) || defined(__EMSCRIPTEN__) || defined(__APPLE__)
|
||||
return popen(command, type);
|
||||
#endif
|
||||
}
|
||||
@@ -15,7 +15,7 @@ FILE* port_open(const char* command, const char* type) {
|
||||
int port_close(FILE* stream) {
|
||||
#ifdef _WIN32
|
||||
return _pclose(stream);
|
||||
#elif defined(__linux) || defined(__APPLE__)
|
||||
#elif defined(__linux) || defined(__EMSCRIPTEN__) || defined(__APPLE__)
|
||||
return pclose(stream);
|
||||
#endif
|
||||
}
|
||||
@@ -23,7 +23,7 @@ int port_close(FILE* stream) {
|
||||
int set_environment(const char* name, const char* value, int overwrite) {
|
||||
#ifdef _WIN32
|
||||
return _putenv_s(name, value);
|
||||
#elif defined(__linux) || defined(__APPLE__)
|
||||
#elif defined(__linux) || defined(__EMSCRIPTEN__) || defined(__APPLE__)
|
||||
return setenv(name, value, overwrite);
|
||||
#endif
|
||||
}
|
||||
@@ -31,7 +31,7 @@ int set_environment(const char* name, const char* value, int overwrite) {
|
||||
int unset_environment(const char* name) {
|
||||
#ifdef _WIN32
|
||||
return _putenv_s(name, "");
|
||||
#elif defined(__linux) || defined(__APPLE__)
|
||||
#elif defined(__linux) || defined(__EMSCRIPTEN__) || defined(__APPLE__)
|
||||
return unsetenv(name);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -115,7 +115,7 @@ std::vector<SerializationFromModelParams> get_models() {
|
||||
std::vector<size_t> shifts = {0, 1, 2, 4, 8, 16, 20};
|
||||
for (const auto& shift : shifts) {
|
||||
for (size_t offset = 0; offset < 2; offset++) {
|
||||
auto s = (1llu << shift) + offset;
|
||||
size_t s = (1llu << shift) + offset;
|
||||
auto builder = [s]() {
|
||||
using namespace ov;
|
||||
auto shape = Shape{s};
|
||||
|
||||
@@ -155,12 +155,6 @@ endif()
|
||||
target_include_directories(ov_onnx_frontend_tests PRIVATE
|
||||
$<TARGET_PROPERTY:openvino_onnx_frontend,INCLUDE_DIRECTORIES>)
|
||||
|
||||
if(OV_COMPILER_IS_APPLECLANG)
|
||||
target_link_options(ov_onnx_frontend_tests PRIVATE -Wl,-dead_strip)
|
||||
elseif(CMAKE_COMPILER_IS_GNUCXX OR OV_COMPILER_IS_CLANG)
|
||||
target_link_options(ov_onnx_frontend_tests PRIVATE -Wl,--exclude-libs,ALL)
|
||||
endif()
|
||||
|
||||
install(TARGETS ov_onnx_frontend_tests
|
||||
RUNTIME DESTINATION tests
|
||||
COMPONENT tests
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
// Copyright (C) 2018-2023 Intel Corporation
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
#include "functional_test_utils/lib_close.hpp"
|
||||
|
||||
#include "lib_close.hpp"
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Copyright (C) 2018-2023 Intel Corporation
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
#include "functional_test_utils/lib_close.hpp"
|
||||
#include "lib_close.hpp"
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ shared_ptr<Model> gen_model(Dimension batch_size,
|
||||
if (with_two_outputs) {
|
||||
auto prev_cell_states = make_shared<Constant>(
|
||||
ov::element::f32,
|
||||
ov::Shape{1, static_cast<uint64_t>(batch_size.get_length()), static_cast<uint64_t>(hidden_size)},
|
||||
ov::Shape{1, static_cast<std::size_t>(batch_size.get_length()), static_cast<std::size_t>(hidden_size)},
|
||||
0);
|
||||
auto concat = make_shared<Concat>(OutputVector{prev_cell_states, block_lstm->output(1)}, 0);
|
||||
auto indices_const = make_shared<Constant>(ov::element::i32,
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "tensor_lite_place.hpp"
|
||||
#include "graph_iterator_flatbuffer.hpp"
|
||||
#include "openvino/frontend/tensorflow_lite/visibility.hpp"
|
||||
|
||||
@@ -18,7 +18,7 @@ target_include_directories(${TARGET_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../
|
||||
target_link_libraries(${TARGET_NAME}
|
||||
PUBLIC
|
||||
engines_test_util offline_transformations
|
||||
commonTestUtils ngraph_test_util openvino::util
|
||||
commonTestUtils ngraph_test_util funcTestUtils openvino::util
|
||||
openvino::runtime
|
||||
PRIVATE
|
||||
cnpy)
|
||||
|
||||
@@ -43,7 +43,7 @@ inline std::string fileToTestName(const std::string& fileName) {
|
||||
inline int set_test_env(const char* name, const char* value) {
|
||||
#ifdef _WIN32
|
||||
return _putenv_s(name, value);
|
||||
#elif defined(__linux) || defined(__APPLE__)
|
||||
#elif defined(__linux) || defined(__EMSCRIPTEN__) || defined(__APPLE__)
|
||||
std::string var = std::string(name) + "=" + value;
|
||||
return setenv(name, value, 0);
|
||||
#endif
|
||||
|
||||
+5
-1
@@ -2,7 +2,7 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
|
||||
#include "functional_test_utils/lib_close.hpp"
|
||||
#include "lib_close.hpp"
|
||||
|
||||
#include "common_test_utils/file_utils.hpp"
|
||||
#include "functional_test_utils/skip_tests_config.hpp"
|
||||
@@ -54,6 +54,8 @@ TEST_P(FrontendLibCloseTest, testPlaceIsLastDeletedObject) {
|
||||
EXPECT_EQ(place->get_names().at(0), exp_name);
|
||||
}
|
||||
|
||||
#ifndef __EMSCRIPTEN__
|
||||
|
||||
/** \brief Frontend library unload before object deletion, expecting segfault. */
|
||||
TEST_P(FrontendLibCloseTest, testUnloadLibBeforeDeletingDependentObject) {
|
||||
EXPECT_DEATH(
|
||||
@@ -73,6 +75,8 @@ TEST_P(FrontendLibCloseTest, testUnloadLibBeforeDeletingDependentObject) {
|
||||
".*");
|
||||
}
|
||||
|
||||
#endif // __EMSCRIPTEN__
|
||||
|
||||
/** \brief Delete place which is created from other place instance. */
|
||||
TEST_P(FrontendLibCloseTest, testPlaceFromPlaceIsLastDeletedObject) {
|
||||
Place::Ptr port_place;
|
||||
@@ -51,6 +51,8 @@ static void release_order_test(std::vector<std::size_t> order, const std::string
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef __EMSCRIPTEN__
|
||||
|
||||
TEST_P(OVHoldersTest, Orders) {
|
||||
std::vector<std::string> objects{ "core", "compiled_model", "request"};
|
||||
std::vector<std::size_t> order(objects.size());
|
||||
@@ -64,6 +66,8 @@ TEST_P(OVHoldersTest, Orders) {
|
||||
} while (std::next_permutation(order.begin(), order.end()));
|
||||
}
|
||||
|
||||
#endif // __EMSCRIPTEN__
|
||||
|
||||
TEST_P(OVHoldersTest, LoadedState) {
|
||||
std::vector<ov::VariableState> states;
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user