Skip to content

Commit

Permalink
[tests] Fix build of extensions test for FEs if FEs disabled (openvin…
Browse files Browse the repository at this point in the history
…otoolkit#24029)

### Details:
- Fix build of extensions tests for frontends when build of fronded is
disabled.
 - Remove the warnings as error for unused functions.

### Tickets:
 - N/A
  • Loading branch information
praasz authored Apr 16, 2024
1 parent 85dc6a5 commit 53a4b73
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
// SPDX-License-Identifier: Apache-2.0
//

#include <openvino/core/extension.hpp>
#include <openvino/frontend/extension/conversion.hpp>
#include <openvino/opsets/opset8.hpp>
#include "openvino/core/extension.hpp"
#include "openvino/frontend/extension/conversion.hpp"
#include "openvino/opsets/opset8.hpp"

#ifdef ENABLE_OV_ONNX_FRONTEND
# include <openvino/frontend/onnx/extension/conversion.hpp>
# include "openvino/frontend/onnx/extension/conversion.hpp"
# define ONNX_EXT \
std::make_shared<ov::frontend::onnx::ConversionExtension>("NewCustomOp_3", CustomTranslatorONNX), \
std::make_shared<ov::frontend::onnx::ConversionExtension>("Relu", ReluToSwishTranslator),
Expand All @@ -16,7 +16,7 @@
#endif

#ifdef ENABLE_OV_PADDLE_FRONTEND
# include <openvino/frontend/paddle/extension/conversion.hpp>
# include "openvino/frontend/paddle/extension/conversion.hpp"
# define PADDLE_EXT \
std::make_shared<ov::frontend::paddle::ConversionExtension>("NewCustomOp_4", CustomTranslatorPaddle), \
std::make_shared<ov::frontend::paddle::ConversionExtension>("relu", ReluToSwishTranslatorPDPD), \
Expand All @@ -27,7 +27,7 @@
#endif

#ifdef ENABLE_OV_TF_FRONTEND
# include <openvino/frontend/tensorflow/extension/conversion.hpp>
# include "openvino/frontend/tensorflow/extension/conversion.hpp"
# define TF_EXT \
std::make_shared<ov::frontend::tensorflow::ConversionExtension>("NewCustomOp_5", CustomTranslatorTensorflow), \
std::make_shared<ov::frontend::tensorflow::ConversionExtension>("Relu", ReluToSwishTranslator),
Expand All @@ -36,7 +36,7 @@
#endif

#ifdef ENABLE_OV_TF_LITE_FRONTEND
# include <openvino/frontend/tensorflow_lite/extension/conversion.hpp>
# include "openvino/frontend/tensorflow_lite/extension/conversion.hpp"
# define TF_LITE_EXT \
std::make_shared<ov::frontend::tensorflow_lite::ConversionExtension>("NewCustomOp_6", \
CustomTranslatorTensorflow), \
Expand All @@ -55,17 +55,24 @@ std::map<std::string, ov::OutputVector> CustomTranslatorCommon_2(const ov::front
return std::map<std::string, ov::OutputVector>();
}

#if defined(ENABLE_OV_TF_FRONTEND) || defined(ENABLE_OV_TF_LITE_FRONTEND)
ov::OutputVector CustomTranslatorTensorflow(const ov::frontend::NodeContext& node) {
return ov::OutputVector();
}
#endif

#ifdef ENABLE_OV_ONNX_FRONTEND
ov::OutputVector CustomTranslatorONNX(const ov::frontend::NodeContext& node) {
return ov::OutputVector();
}
#endif

#if defined(ENABLE_OV_TF_FRONTEND) || defined(ENABLE_OV_TF_LITE_FRONTEND) || defined(ENABLE_OV_ONNX_FRONTEND) || \
defined(ENABLE_OV_PYTORCH_FRONTEND)
ov::OutputVector ReluToSwishTranslator(const ov::frontend::NodeContext& node) {
return {std::make_shared<ov::opset8::Swish>(node.get_input(0))};
}
#endif

#ifdef ENABLE_OV_PADDLE_FRONTEND
std::map<std::string, ov::OutputVector> ReluToSwishTranslatorPDPD(const ov::frontend::NodeContext& node) {
Expand Down Expand Up @@ -117,7 +124,6 @@ class CustomElu : public ov::op::Op {
default:
return false;
}
return false;
}

template <typename T>
Expand Down Expand Up @@ -147,10 +153,10 @@ class CustomElu : public ov::op::Op {
};

#ifdef ENABLE_OV_PYTORCH_FRONTEND
# include <openvino/frontend/extension/op.hpp>
# include <openvino/frontend/pytorch/extension/conversion.hpp>
# include <openvino/frontend/pytorch/extension/op.hpp>
# include <openvino/op/relu.hpp>
# include "openvino/frontend/extension/op.hpp"
# include "openvino/frontend/pytorch/extension/conversion.hpp"
# include "openvino/frontend/pytorch/extension/op.hpp"
# include "openvino/op/relu.hpp"
class ReluCustom : public ov::op::v0::Relu {
public:
OPENVINO_OP("ReluCustom");
Expand Down
7 changes: 6 additions & 1 deletion src/inference/tests/functional/caching_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2436,6 +2436,11 @@ INSTANTIATE_TEST_SUITE_P(CachingTest,
#endif // defined(ENABLE_OV_IR_FRONTEND)

class CacheTestWithProxyEnabled : public CachingTest {
public:
static std::string getTestCaseName(const testing::TestParamInfo<std::tuple<TestParam, std::string>>& obj) {
return std::get<1>(std::get<0>(obj.param)) + "_" + std::get<1>(obj.param);
}

protected:
void testLoadProxy(const std::function<void(ov::Core& core)>& func) {
ov::Core core;
Expand Down Expand Up @@ -2487,5 +2492,5 @@ TEST_P(CacheTestWithProxyEnabled, TestLoad) {
INSTANTIATE_TEST_SUITE_P(CacheTestWithProxyEnabled,
CacheTestWithProxyEnabled,
::testing::Combine(::testing::ValuesIn(loadVariants), ::testing::ValuesIn(cacheFolders)),
getTestCaseName);
CacheTestWithProxyEnabled::getTestCaseName);
#endif
2 changes: 2 additions & 0 deletions src/inference/tests/functional/ov_extension_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
using namespace testing;
using namespace ov::test::utils;

#if defined(ENABLE_OV_IR_FRONTEND)
namespace {

std::string getOVExtensionPath() {
Expand All @@ -30,6 +31,7 @@ std::string getRelativeOVExtensionPath() {
}

} // namespace
#endif

class CustomNewIdentity : public ov::op::Op {
public:
Expand Down

0 comments on commit 53a4b73

Please sign in to comment.