Add the implementation to GetExecGraphInfo API in AUTO plugin (#16979)

This commit is contained in:
Wang Wangwang 2023-04-17 17:24:07 +08:00 committed by GitHub
parent aa1f26a2b7
commit 589bd6d076
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 1 deletions

View File

@ -34,4 +34,11 @@ void ExecutableNetwork::SetExeNetworkForContext() {
std::string ExecutableNetwork::GetLogTag() const noexcept {
return _sContext->_LogTag;
}
std::shared_ptr<ngraph::Function> ExecutableNetwork::GetExecGraphInfo() {
// TODO: When there are more then 2 executable networks, such as MULTI:GPU,CPU
auto autoSContext = std::dynamic_pointer_cast<AutoScheduleContext>(_sContext);
return autoSContext->_hwExecutableNetwork->GetExecGraphInfo();
}
} // namespace MultiDevicePlugin

View File

@ -20,6 +20,7 @@ public:
using Ptr = std::shared_ptr<ExecutableNetwork>;
ExecutableNetwork(const Schedule::Ptr& schedule, const ScheduleContext::Ptr& sContext);
IInferPtr CreateInferRequest() override;
std::shared_ptr<ngraph::Function> GetExecGraphInfo() override;
~ExecutableNetwork() override;
protected:

View File

@ -424,7 +424,11 @@ TEST_P(ExecGraphSerializationTest, ExecutionGraph) {
pugi::xml_document expected;
pugi::xml_document result;
ASSERT_TRUE(expected.load_string(target_device == "CPU" ? expected_serialized_model_cpu : expected_serialized_model));
if (target_device == "CPU" || target_device == "AUTO:CPU" || target_device == "MULTI:CPU") {
ASSERT_TRUE(expected.load_string(expected_serialized_model_cpu));
} else {
ASSERT_TRUE(expected.load_string(expected_serialized_model));
}
ASSERT_TRUE(result.load_file(m_out_xml_path.c_str()));
bool status;