Added ov::NotImplemented Exception (#11124)
* Added ov::NotImplemented Exception * add ie namespace * Try fix
This commit is contained in:
parent
88e20199f0
commit
78285f9db4
@ -45,6 +45,13 @@ private:
|
|||||||
const std::string& context_info,
|
const std::string& context_info,
|
||||||
const std::string& explanation);
|
const std::string& explanation);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/// Exception class to be thrown on not implemented code
|
||||||
|
class OPENVINO_API NotImplemented : public AssertFailure {
|
||||||
|
public:
|
||||||
|
NotImplemented(const CheckLocInfo& check_loc_info, const std::string& context_info, const std::string& explanation)
|
||||||
|
: AssertFailure(check_loc_info, context_info, explanation) {}
|
||||||
|
};
|
||||||
} // namespace ov
|
} // namespace ov
|
||||||
|
|
||||||
//
|
//
|
||||||
@ -139,6 +146,7 @@ private:
|
|||||||
/// \throws ::ov::AssertFailure if the macro is executed.
|
/// \throws ::ov::AssertFailure if the macro is executed.
|
||||||
#define OPENVINO_UNREACHABLE(...) OPENVINO_ASSERT(false, "Unreachable: ", __VA_ARGS__)
|
#define OPENVINO_UNREACHABLE(...) OPENVINO_ASSERT(false, "Unreachable: ", __VA_ARGS__)
|
||||||
#define OPENVINO_ASSERT_HELPER(exc_class, ctx, ...) CALL_OVERLOAD(OPENVINO_ASSERT_HELPER, exc_class, ctx, __VA_ARGS__)
|
#define OPENVINO_ASSERT_HELPER(exc_class, ctx, ...) CALL_OVERLOAD(OPENVINO_ASSERT_HELPER, exc_class, ctx, __VA_ARGS__)
|
||||||
|
#define OPENVINO_NOT_IMPLEMENTED OPENVINO_ASSERT_HELPER(::ov::NotImplemented, "", false, "Not Implemented", "")
|
||||||
|
|
||||||
#define GLUE(x, y) x y
|
#define GLUE(x, y) x y
|
||||||
|
|
||||||
|
@ -62,7 +62,7 @@ protected:
|
|||||||
InferenceEngine::IInferRequestInternal::Ptr syncRequestImpl;
|
InferenceEngine::IInferRequestInternal::Ptr syncRequestImpl;
|
||||||
try {
|
try {
|
||||||
syncRequestImpl = this->CreateInferRequestImpl(_parameters, _results);
|
syncRequestImpl = this->CreateInferRequestImpl(_parameters, _results);
|
||||||
} catch (const NotImplemented&) {
|
} catch (const InferenceEngine::NotImplemented&) {
|
||||||
}
|
}
|
||||||
if (!syncRequestImpl) {
|
if (!syncRequestImpl) {
|
||||||
syncRequestImpl = this->CreateInferRequestImpl(_networkInputs, _networkOutputs);
|
syncRequestImpl = this->CreateInferRequestImpl(_networkInputs, _networkOutputs);
|
||||||
|
@ -13,8 +13,9 @@
|
|||||||
#include "description_buffer.hpp"
|
#include "description_buffer.hpp"
|
||||||
|
|
||||||
namespace InferenceEngine {
|
namespace InferenceEngine {
|
||||||
#define CATCH_IE_EXCEPTION_TO_STATUS(StatusCode, ExceptionType) catch (const ExceptionType& ex) { \
|
#define CATCH_IE_EXCEPTION_TO_STATUS(StatusCode, ExceptionType) \
|
||||||
return InferenceEngine::DescriptionBuffer(StatusCode, resp) << ex.what(); \
|
catch (const InferenceEngine::ExceptionType& ex) { \
|
||||||
|
return InferenceEngine::DescriptionBuffer(StatusCode, resp) << ex.what(); \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define CATCH_IE_EXCEPTIONS_TO_STATUS \
|
#define CATCH_IE_EXCEPTIONS_TO_STATUS \
|
||||||
|
@ -16,8 +16,9 @@
|
|||||||
|
|
||||||
namespace InferenceEngine {
|
namespace InferenceEngine {
|
||||||
|
|
||||||
#define CATCH_IE_EXCEPTION_TO_STATUS_NO_RESP(StatusCode, ExceptionType) catch (const ExceptionType& ex) { \
|
#define CATCH_IE_EXCEPTION_TO_STATUS_NO_RESP(StatusCode, ExceptionType) \
|
||||||
return InferenceEngine::DescriptionBuffer(StatusCode) << ex.what(); \
|
catch (const InferenceEngine::ExceptionType& ex) { \
|
||||||
|
return InferenceEngine::DescriptionBuffer(StatusCode) << ex.what(); \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define CATCH_IE_EXCEPTIONS_TO_STATUS_NO_RESP \
|
#define CATCH_IE_EXCEPTIONS_TO_STATUS_NO_RESP \
|
||||||
@ -50,8 +51,9 @@ namespace InferenceEngine {
|
|||||||
return InferenceEngine::DescriptionBuffer(UNEXPECTED); \
|
return InferenceEngine::DescriptionBuffer(UNEXPECTED); \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define CATCH_IE_EXCEPTION_CALL_RETURN_STATUS(StatusCode, ExceptionType) catch (const ExceptionType& ex) { \
|
#define CATCH_IE_EXCEPTION_CALL_RETURN_STATUS(StatusCode, ExceptionType) \
|
||||||
return InferenceEngine::DescriptionBuffer(StatusCode, resp) << ex.what(); \
|
catch (const InferenceEngine::ExceptionType& ex) { \
|
||||||
|
return InferenceEngine::DescriptionBuffer(StatusCode, resp) << ex.what(); \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define CATCH_IE_EXCEPTIONS_CALL_RETURN_STATUS \
|
#define CATCH_IE_EXCEPTIONS_CALL_RETURN_STATUS \
|
||||||
|
@ -134,7 +134,7 @@ void InferRequest::SetCompletionCallbackImpl(std::function<void()> callbackToSet
|
|||||||
}
|
}
|
||||||
|
|
||||||
#define CATCH_IE_EXCEPTION_RETURN(StatusCode, ExceptionType) \
|
#define CATCH_IE_EXCEPTION_RETURN(StatusCode, ExceptionType) \
|
||||||
catch (const ExceptionType&) { \
|
catch (const ::InferenceEngine::ExceptionType&) { \
|
||||||
return StatusCode; \
|
return StatusCode; \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -61,7 +61,7 @@ std::shared_ptr<IInferRequestInternal> IExecutableNetworkInternal::CreateInferRe
|
|||||||
std::shared_ptr<IInferRequestInternal> asyncRequestImpl;
|
std::shared_ptr<IInferRequestInternal> asyncRequestImpl;
|
||||||
try {
|
try {
|
||||||
asyncRequestImpl = CreateInferRequestImpl(_parameters, _results);
|
asyncRequestImpl = CreateInferRequestImpl(_parameters, _results);
|
||||||
} catch (const NotImplemented&) {
|
} catch (const InferenceEngine::NotImplemented&) {
|
||||||
}
|
}
|
||||||
if (!asyncRequestImpl)
|
if (!asyncRequestImpl)
|
||||||
asyncRequestImpl = CreateInferRequestImpl(_networkInputs, _networkOutputs);
|
asyncRequestImpl = CreateInferRequestImpl(_networkInputs, _networkOutputs);
|
||||||
|
@ -312,7 +312,7 @@ void IInferRequestInternal::convertBatchedInputBlob(const std::string& name, con
|
|||||||
if (net) {
|
if (net) {
|
||||||
remote_context = net->GetContext();
|
remote_context = net->GetContext();
|
||||||
}
|
}
|
||||||
} catch (const NotImplemented&) {
|
} catch (const InferenceEngine::NotImplemented&) {
|
||||||
}
|
}
|
||||||
if (remote_context) {
|
if (remote_context) {
|
||||||
mem_blob = remote_context->CreateHostBlob(batched_desc);
|
mem_blob = remote_context->CreateHostBlob(batched_desc);
|
||||||
|
@ -45,31 +45,31 @@ namespace details {
|
|||||||
void Rethrow() {
|
void Rethrow() {
|
||||||
try {
|
try {
|
||||||
throw;
|
throw;
|
||||||
} catch (const GeneralError& e) {
|
} catch (const InferenceEngine::GeneralError& e) {
|
||||||
throw e;
|
throw e;
|
||||||
} catch (const NotImplemented& e) {
|
} catch (const InferenceEngine::NotImplemented& e) {
|
||||||
throw e;
|
throw e;
|
||||||
} catch (const NetworkNotLoaded& e) {
|
} catch (const InferenceEngine::NetworkNotLoaded& e) {
|
||||||
throw e;
|
throw e;
|
||||||
} catch (const ParameterMismatch& e) {
|
} catch (const InferenceEngine::ParameterMismatch& e) {
|
||||||
throw e;
|
throw e;
|
||||||
} catch (const NotFound& e) {
|
} catch (const InferenceEngine::NotFound& e) {
|
||||||
throw e;
|
throw e;
|
||||||
} catch (const OutOfBounds& e) {
|
} catch (const InferenceEngine::OutOfBounds& e) {
|
||||||
throw e;
|
throw e;
|
||||||
} catch (const Unexpected& e) {
|
} catch (const InferenceEngine::Unexpected& e) {
|
||||||
throw e;
|
throw e;
|
||||||
} catch (const RequestBusy& e) {
|
} catch (const InferenceEngine::RequestBusy& e) {
|
||||||
throw e;
|
throw e;
|
||||||
} catch (const ResultNotReady& e) {
|
} catch (const InferenceEngine::ResultNotReady& e) {
|
||||||
throw e;
|
throw e;
|
||||||
} catch (const NotAllocated& e) {
|
} catch (const InferenceEngine::NotAllocated& e) {
|
||||||
throw e;
|
throw e;
|
||||||
} catch (const InferNotStarted& e) {
|
} catch (const InferenceEngine::InferNotStarted& e) {
|
||||||
throw e;
|
throw e;
|
||||||
} catch (const NetworkNotRead& e) {
|
} catch (const InferenceEngine::NetworkNotRead& e) {
|
||||||
throw e;
|
throw e;
|
||||||
} catch (const InferCancelled& e) {
|
} catch (const InferenceEngine::InferCancelled& e) {
|
||||||
throw e;
|
throw e;
|
||||||
} catch (const std::exception& e) {
|
} catch (const std::exception& e) {
|
||||||
IE_THROW() << e.what();
|
IE_THROW() << e.what();
|
||||||
|
@ -644,7 +644,7 @@ std::shared_ptr<InferenceEngine::RemoteContext> MultiDeviceExecutableNetwork::Ge
|
|||||||
const auto& n = _networksPerDevice.at(device.deviceName);
|
const auto& n = _networksPerDevice.at(device.deviceName);
|
||||||
try {
|
try {
|
||||||
return n->GetContext();
|
return n->GetContext();
|
||||||
} catch (const NotImplemented&) {}
|
} catch (const InferenceEngine::NotImplemented&) {}
|
||||||
}
|
}
|
||||||
IE_THROW(NotImplemented) << "None of the devices in the MULTI device has an associated remote context."
|
IE_THROW(NotImplemented) << "None of the devices in the MULTI device has an associated remote context."
|
||||||
<< " Current list of devices allowed via the DEVICE_PRIORITIES config: " << devices_names;
|
<< " Current list of devices allowed via the DEVICE_PRIORITIES config: " << devices_names;
|
||||||
|
@ -1217,7 +1217,7 @@ Node* Node::NodesFactory::create(const std::shared_ptr<ngraph::Node>& op, const
|
|||||||
if (ol != nullptr && ol->created(extMgr))
|
if (ol != nullptr && ol->created(extMgr))
|
||||||
newNode = ol.release();
|
newNode = ol.release();
|
||||||
} catch (const InferenceEngine::Exception& ex) {
|
} catch (const InferenceEngine::Exception& ex) {
|
||||||
if (dynamic_cast<const NotImplemented*>(&ex) != nullptr) {
|
if (dynamic_cast<const InferenceEngine::NotImplemented*>(&ex) != nullptr) {
|
||||||
errorMessage += getExceptionDescWithoutStatus(ex);
|
errorMessage += getExceptionDescWithoutStatus(ex);
|
||||||
} else {
|
} else {
|
||||||
throw;
|
throw;
|
||||||
@ -1231,7 +1231,7 @@ Node* Node::NodesFactory::create(const std::shared_ptr<ngraph::Node>& op, const
|
|||||||
if (ol != nullptr && ol->created(extMgr))
|
if (ol != nullptr && ol->created(extMgr))
|
||||||
newNode = ol.release();
|
newNode = ol.release();
|
||||||
} catch (const InferenceEngine::Exception& ex) {
|
} catch (const InferenceEngine::Exception& ex) {
|
||||||
if (dynamic_cast<const NotImplemented*>(&ex) != nullptr) {
|
if (dynamic_cast<const InferenceEngine::NotImplemented*>(&ex) != nullptr) {
|
||||||
const auto currErrorMess = getExceptionDescWithoutStatus(ex);
|
const auto currErrorMess = getExceptionDescWithoutStatus(ex);
|
||||||
if (!currErrorMess.empty())
|
if (!currErrorMess.empty())
|
||||||
errorMessage += errorMessage.empty() ? currErrorMess : "\n" + currErrorMess;
|
errorMessage += errorMessage.empty() ? currErrorMess : "\n" + currErrorMess;
|
||||||
|
Loading…
Reference in New Issue
Block a user