Enabled NCC check for frontends (#7033)
* Try to enable NCC for onnx_ngraph_frontend * naming style for PDPD * Enabled PDPD ncc
This commit is contained in:
parent
c771b1e2e0
commit
7f0b8698c6
@ -32,11 +32,12 @@ add_library(ngraph::onnx_ngraph_frontend ALIAS onnx_ngraph_frontend)
|
||||
|
||||
add_clang_format_target(onnx_ngraph_frontend_clang FOR_TARGETS onnx_ngraph_frontend)
|
||||
|
||||
# TODO: fix empty class name
|
||||
#ov_ncc_naming_style(FOR_TARGET onnx_ngraph_frontend
|
||||
# INCLUDE_DIRECTORY "${ONNX_FRONTEND_INCLUDE_DIR}"
|
||||
# ADDITIONAL_INCLUDE_DIRECTORIES
|
||||
# $<TARGET_PROPERTY:ngraph::frontend_manager::static,INTERFACE_INCLUDE_DIRECTORIES>)
|
||||
ov_ncc_naming_style(FOR_TARGET onnx_ngraph_frontend
|
||||
INCLUDE_DIRECTORY "${ONNX_FRONTEND_INCLUDE_DIR}"
|
||||
DEFINITIONS
|
||||
$<TARGET_PROPERTY:onnx,INTERFACE_COMPILE_DEFINITIONS>
|
||||
ADDITIONAL_INCLUDE_DIRECTORIES
|
||||
$<TARGET_PROPERTY:ngraph::frontend_manager::static,INTERFACE_INCLUDE_DIRECTORIES>)
|
||||
|
||||
if(COMMAND ie_add_vs_version_file)
|
||||
ie_add_vs_version_file(NAME onnx_ngraph_frontend
|
||||
|
@ -52,11 +52,10 @@ add_library(${TARGET_NAME} SHARED ${LIBRARY_SRC} ${LIBRARY_HEADERS} ${LIBRARY_P
|
||||
|
||||
add_dependencies(${TARGET_NAME} paddlepaddle_ngraph_frontend_proto)
|
||||
|
||||
# TODO enable: PDPD_ASSERT is in capital letters while it's a function
|
||||
# ov_ncc_naming_style(FOR_TARGET ${TARGET_NAME}
|
||||
# INCLUDE_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/include"
|
||||
# ADDITIONAL_INCLUDE_DIRECTORIES
|
||||
# $<TARGET_PROPERTY:ngraph::frontend_manager::static,INTERFACE_INCLUDE_DIRECTORIES>)
|
||||
ov_ncc_naming_style(FOR_TARGET ${TARGET_NAME}
|
||||
INCLUDE_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/include"
|
||||
ADDITIONAL_INCLUDE_DIRECTORIES
|
||||
$<TARGET_PROPERTY:ngraph::frontend_manager::static,INTERFACE_INCLUDE_DIRECTORIES>)
|
||||
|
||||
target_include_directories(${TARGET_NAME}
|
||||
PUBLIC
|
||||
|
@ -19,9 +19,9 @@ namespace ngraph
|
||||
class InputModelPDPDImpl;
|
||||
std::shared_ptr<InputModelPDPDImpl> _impl;
|
||||
|
||||
std::vector<std::shared_ptr<OpPlacePDPD>> getOpPlaces() const;
|
||||
std::map<std::string, std::shared_ptr<TensorPlacePDPD>> getVarPlaces() const;
|
||||
std::map<std::string, Output<Node>> getTensorValues() const;
|
||||
std::vector<std::shared_ptr<OpPlacePDPD>> get_op_places() const;
|
||||
std::map<std::string, std::shared_ptr<TensorPlacePDPD>> get_var_places() const;
|
||||
std::map<std::string, Output<Node>> get_tensor_values() const;
|
||||
|
||||
public:
|
||||
explicit InputModelPDPD(const std::string& path);
|
||||
|
@ -13,19 +13,12 @@
|
||||
#define PDPD_API NGRAPH_HELPER_DLL_IMPORT
|
||||
#endif // paddlepaddle_ngraph_frontend_EXPORTS
|
||||
|
||||
namespace ngraph
|
||||
{
|
||||
namespace frontend
|
||||
{
|
||||
inline void PDPD_ASSERT(bool ex, const std::string& msg = "Unspecified error.")
|
||||
{
|
||||
if (!ex)
|
||||
throw std::runtime_error(msg);
|
||||
}
|
||||
#define PDPD_ASSERT(ex, msg) \
|
||||
{ \
|
||||
if (!(ex)) \
|
||||
throw std::runtime_error(msg); \
|
||||
}
|
||||
|
||||
#define PDPD_THROW(msg) throw std::runtime_error(std::string("ERROR: ") + msg)
|
||||
|
||||
#define NOT_IMPLEMENTED(msg) throw std::runtime_error(std::string(msg) + " is not implemented")
|
||||
|
||||
} // namespace frontend
|
||||
} // namespace ngraph
|
||||
|
@ -166,7 +166,7 @@ namespace ngraph
|
||||
const std::map<std::string, Output<Node>>&, const std::shared_ptr<OpPlacePDPD>&)>
|
||||
func)
|
||||
{
|
||||
auto nodes_dict(model->getTensorValues());
|
||||
auto nodes_dict(model->get_tensor_values());
|
||||
ParameterVector parameter_nodes;
|
||||
ResultVector result_nodes;
|
||||
|
||||
@ -183,7 +183,7 @@ namespace ngraph
|
||||
parameter_nodes.push_back(param);
|
||||
}
|
||||
|
||||
const auto& op_places = model->getOpPlaces();
|
||||
const auto& op_places = model->get_op_places();
|
||||
for (const auto& op_place : op_places)
|
||||
{
|
||||
const auto& op_desc = op_place->get_desc();
|
||||
|
@ -47,12 +47,12 @@ namespace ngraph
|
||||
void setElementType(Place::Ptr place, const ngraph::element::Type&);
|
||||
void setTensorValue(Place::Ptr place, const void* value);
|
||||
|
||||
std::vector<std::shared_ptr<OpPlacePDPD>> getOpPlaces() const;
|
||||
std::map<std::string, std::shared_ptr<TensorPlacePDPD>> getVarPlaces() const
|
||||
std::vector<std::shared_ptr<OpPlacePDPD>> get_op_places() const;
|
||||
std::map<std::string, std::shared_ptr<TensorPlacePDPD>> get_var_places() const
|
||||
{
|
||||
return m_var_places;
|
||||
}
|
||||
std::map<pdpd::TensorName, Output<Node>> getTensorValues() const
|
||||
std::map<pdpd::TensorName, Output<Node>> get_tensor_values() const
|
||||
{
|
||||
return m_tensor_values;
|
||||
};
|
||||
@ -236,7 +236,7 @@ namespace ngraph
|
||||
} // namespace pdpd
|
||||
|
||||
std::vector<std::shared_ptr<OpPlacePDPD>>
|
||||
InputModelPDPD::InputModelPDPDImpl::getOpPlaces() const
|
||||
InputModelPDPD::InputModelPDPDImpl::get_op_places() const
|
||||
{
|
||||
if (m_graph_changed)
|
||||
{
|
||||
@ -519,19 +519,20 @@ namespace ngraph
|
||||
{
|
||||
}
|
||||
|
||||
std::vector<std::shared_ptr<OpPlacePDPD>> InputModelPDPD::getOpPlaces() const
|
||||
std::vector<std::shared_ptr<OpPlacePDPD>> InputModelPDPD::get_op_places() const
|
||||
{
|
||||
return _impl->getOpPlaces();
|
||||
return _impl->get_op_places();
|
||||
}
|
||||
|
||||
std::map<std::string, std::shared_ptr<TensorPlacePDPD>> InputModelPDPD::getVarPlaces() const
|
||||
std::map<std::string, std::shared_ptr<TensorPlacePDPD>>
|
||||
InputModelPDPD::get_var_places() const
|
||||
{
|
||||
return _impl->getVarPlaces();
|
||||
return _impl->get_var_places();
|
||||
}
|
||||
|
||||
std::map<pdpd::TensorName, Output<Node>> InputModelPDPD::getTensorValues() const
|
||||
std::map<pdpd::TensorName, Output<Node>> InputModelPDPD::get_tensor_values() const
|
||||
{
|
||||
return _impl->getTensorValues();
|
||||
return _impl->get_tensor_values();
|
||||
}
|
||||
|
||||
std::vector<Place::Ptr> InputModelPDPD::get_inputs() const { return _impl->getInputs(); }
|
||||
|
Loading…
Reference in New Issue
Block a user