openvino/ngraph/test/frontend/mock_frontend.cpp

34 lines
873 B
C++

// Copyright (C) 2018-2021 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//
#include "frontend_manager/frontend_manager.hpp"
#include "frontend_manager/frontend_manager_defs.hpp"
#include "ngraph/visibility.hpp"
// Defined if we are building the plugin DLL (instead of using it)
#ifdef mock1_ngraph_frontend_EXPORTS
#define MOCK_API NGRAPH_HELPER_DLL_EXPORT
#else
#define MOCK_API NGRAPH_HELPER_DLL_IMPORT
#endif // mock1_ngraph_frontend_EXPORTS
using namespace ngraph;
using namespace ngraph::frontend;
class FrontEndMock : public FrontEnd
{
};
extern "C" MOCK_API FrontEndVersion GetAPIVersion()
{
return OV_FRONTEND_API_VERSION;
}
extern "C" MOCK_API void* GetFrontEndData()
{
FrontEndPluginInfo* res = new FrontEndPluginInfo();
res->m_name = "mock1";
res->m_creator = []() { return std::make_shared<FrontEndMock>(); };
return res;
}