Simplified cancel behavior (#4224)
This commit is contained in:
@@ -162,10 +162,13 @@ public:
|
||||
CALL_STATUS_FNC_NO_ARGS(Infer);
|
||||
}
|
||||
|
||||
StatusCode Cancel() {
|
||||
ResponseDesc resp;
|
||||
if (actual == nullptr) THROW_IE_EXCEPTION << "InferRequest was not initialized.";
|
||||
return actual->Cancel(&resp);
|
||||
/**
|
||||
* @copybrief IInferRequest::Cancel
|
||||
*
|
||||
* Wraps IInferRequest::Cancel
|
||||
*/
|
||||
void Cancel() {
|
||||
CALL_STATUS_FNC_NO_ARGS(Cancel);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -60,6 +60,8 @@ inline void extract_exception(StatusCode status, const char* msg) {
|
||||
throw InferNotStarted(msg);
|
||||
case NETWORK_NOT_READ:
|
||||
throw NetworkNotRead(msg);
|
||||
case INFER_CANCELLED:
|
||||
throw InferCancelled(msg);
|
||||
default:
|
||||
THROW_IE_EXCEPTION << msg << InferenceEngine::details::as_status << status;
|
||||
}
|
||||
|
||||
@@ -334,6 +334,11 @@ class NetworkNotRead : public std::logic_error {
|
||||
using std::logic_error::logic_error;
|
||||
};
|
||||
|
||||
/** @brief This class represents StatusCode::INFER_CANCELLED exception */
|
||||
class InferCancelled : public std::logic_error {
|
||||
using std::logic_error::logic_error;
|
||||
};
|
||||
|
||||
} // namespace InferenceEngine
|
||||
|
||||
#if defined(_WIN32)
|
||||
|
||||
Reference in New Issue
Block a user