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& 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
|
||||
|
||||
//
|
||||
@ -139,6 +146,7 @@ private:
|
||||
/// \throws ::ov::AssertFailure if the macro is executed.
|
||||
#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_NOT_IMPLEMENTED OPENVINO_ASSERT_HELPER(::ov::NotImplemented, "", false, "Not Implemented", "")
|
||||
|
||||
#define GLUE(x, y) x y
|
||||
|
||||
|
@ -62,7 +62,7 @@ protected:
|
||||
InferenceEngine::IInferRequestInternal::Ptr syncRequestImpl;
|
||||
try {
|
||||
syncRequestImpl = this->CreateInferRequestImpl(_parameters, _results);
|
||||
} catch (const NotImplemented&) {
|
||||
} catch (const InferenceEngine::NotImplemented&) {
|
||||
}
|
||||
if (!syncRequestImpl) {
|
||||
syncRequestImpl = this->CreateInferRequestImpl(_networkInputs, _networkOutputs);
|
||||
|
@ -13,8 +13,9 @@
|
||||
#include "description_buffer.hpp"
|
||||
|
||||
namespace InferenceEngine {
|
||||
#define CATCH_IE_EXCEPTION_TO_STATUS(StatusCode, ExceptionType) catch (const ExceptionType& ex) { \
|
||||
return InferenceEngine::DescriptionBuffer(StatusCode, resp) << ex.what(); \
|
||||
#define CATCH_IE_EXCEPTION_TO_STATUS(StatusCode, ExceptionType) \
|
||||
catch (const InferenceEngine::ExceptionType& ex) { \
|
||||
return InferenceEngine::DescriptionBuffer(StatusCode, resp) << ex.what(); \
|
||||
}
|
||||
|
||||
#define CATCH_IE_EXCEPTIONS_TO_STATUS \
|
||||
|
@ -16,8 +16,9 @@
|
||||
|
||||
namespace InferenceEngine {
|
||||
|
||||
#define CATCH_IE_EXCEPTION_TO_STATUS_NO_RESP(StatusCode, ExceptionType) catch (const ExceptionType& ex) { \
|
||||
return InferenceEngine::DescriptionBuffer(StatusCode) << ex.what(); \
|
||||
#define CATCH_IE_EXCEPTION_TO_STATUS_NO_RESP(StatusCode, ExceptionType) \
|
||||
catch (const InferenceEngine::ExceptionType& ex) { \
|
||||
return InferenceEngine::DescriptionBuffer(StatusCode) << ex.what(); \
|
||||
}
|
||||
|
||||
#define CATCH_IE_EXCEPTIONS_TO_STATUS_NO_RESP \
|
||||
@ -50,8 +51,9 @@ namespace InferenceEngine {
|
||||
return InferenceEngine::DescriptionBuffer(UNEXPECTED); \
|
||||
}
|
||||
|
||||
#define CATCH_IE_EXCEPTION_CALL_RETURN_STATUS(StatusCode, ExceptionType) catch (const ExceptionType& ex) { \
|
||||
return InferenceEngine::DescriptionBuffer(StatusCode, resp) << ex.what(); \
|
||||
#define CATCH_IE_EXCEPTION_CALL_RETURN_STATUS(StatusCode, ExceptionType) \
|
||||
catch (const InferenceEngine::ExceptionType& ex) { \
|
||||
return InferenceEngine::DescriptionBuffer(StatusCode, resp) << ex.what(); \
|
||||
}
|
||||
|
||||
#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) \
|
||||
catch (const ExceptionType&) { \
|
||||
catch (const ::InferenceEngine::ExceptionType&) { \
|
||||
return StatusCode; \
|
||||
}
|
||||
|
||||
|
@ -61,7 +61,7 @@ std::shared_ptr<IInferRequestInternal> IExecutableNetworkInternal::CreateInferRe
|
||||
std::shared_ptr<IInferRequestInternal> asyncRequestImpl;
|
||||
try {
|
||||
asyncRequestImpl = CreateInferRequestImpl(_parameters, _results);
|
||||
} catch (const NotImplemented&) {
|
||||
} catch (const InferenceEngine::NotImplemented&) {
|
||||
}
|
||||
if (!asyncRequestImpl)
|
||||
asyncRequestImpl = CreateInferRequestImpl(_networkInputs, _networkOutputs);
|
||||
|
@ -312,7 +312,7 @@ void IInferRequestInternal::convertBatchedInputBlob(const std::string& name, con
|
||||
if (net) {
|
||||
remote_context = net->GetContext();
|
||||
}
|
||||
} catch (const NotImplemented&) {
|
||||
} catch (const InferenceEngine::NotImplemented&) {
|
||||
}
|
||||
if (remote_context) {
|
||||
mem_blob = remote_context->CreateHostBlob(batched_desc);
|
||||
|
@ -45,31 +45,31 @@ namespace details {
|
||||
void Rethrow() {
|
||||
try {
|
||||
throw;
|
||||
} catch (const GeneralError& e) {
|
||||
} catch (const InferenceEngine::GeneralError& e) {
|
||||
throw e;
|
||||
} catch (const NotImplemented& e) {
|
||||
} catch (const InferenceEngine::NotImplemented& e) {
|
||||
throw e;
|
||||
} catch (const NetworkNotLoaded& e) {
|
||||
} catch (const InferenceEngine::NetworkNotLoaded& e) {
|
||||
throw e;
|
||||
} catch (const ParameterMismatch& e) {
|
||||
} catch (const InferenceEngine::ParameterMismatch& e) {
|
||||
throw e;
|
||||
} catch (const NotFound& e) {
|
||||
} catch (const InferenceEngine::NotFound& e) {
|
||||
throw e;
|
||||
} catch (const OutOfBounds& e) {
|
||||
} catch (const InferenceEngine::OutOfBounds& e) {
|
||||
throw e;
|
||||
} catch (const Unexpected& e) {
|
||||
} catch (const InferenceEngine::Unexpected& e) {
|
||||
throw e;
|
||||
} catch (const RequestBusy& e) {
|
||||
} catch (const InferenceEngine::RequestBusy& e) {
|
||||
throw e;
|
||||
} catch (const ResultNotReady& e) {
|
||||
} catch (const InferenceEngine::ResultNotReady& e) {
|
||||
throw e;
|
||||
} catch (const NotAllocated& e) {
|
||||
} catch (const InferenceEngine::NotAllocated& e) {
|
||||
throw e;
|
||||
} catch (const InferNotStarted& e) {
|
||||
} catch (const InferenceEngine::InferNotStarted& e) {
|
||||
throw e;
|
||||
} catch (const NetworkNotRead& e) {
|
||||
} catch (const InferenceEngine::NetworkNotRead& e) {
|
||||
throw e;
|
||||
} catch (const InferCancelled& e) {
|
||||
} catch (const InferenceEngine::InferCancelled& e) {
|
||||
throw e;
|
||||
} catch (const std::exception& e) {
|
||||
IE_THROW() << e.what();
|
||||
|
@ -644,7 +644,7 @@ std::shared_ptr<InferenceEngine::RemoteContext> MultiDeviceExecutableNetwork::Ge
|
||||
const auto& n = _networksPerDevice.at(device.deviceName);
|
||||
try {
|
||||
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."
|
||||
<< " 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))
|
||||
newNode = ol.release();
|
||||
} catch (const InferenceEngine::Exception& ex) {
|
||||
if (dynamic_cast<const NotImplemented*>(&ex) != nullptr) {
|
||||
if (dynamic_cast<const InferenceEngine::NotImplemented*>(&ex) != nullptr) {
|
||||
errorMessage += getExceptionDescWithoutStatus(ex);
|
||||
} else {
|
||||
throw;
|
||||
@ -1231,7 +1231,7 @@ Node* Node::NodesFactory::create(const std::shared_ptr<ngraph::Node>& op, const
|
||||
if (ol != nullptr && ol->created(extMgr))
|
||||
newNode = ol.release();
|
||||
} 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);
|
||||
if (!currErrorMess.empty())
|
||||
errorMessage += errorMessage.empty() ? currErrorMess : "\n" + currErrorMess;
|
||||
|
Loading…
Reference in New Issue
Block a user