Used IE_THROW macro (#4869)

* Added ie throw macro

* Used IE_THROW macro
This commit is contained in:
Anton Pankratv 2021-03-23 18:57:12 +03:00 committed by GitHub
parent c3fc40052c
commit 3b3d9a0989
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
346 changed files with 2496 additions and 2483 deletions

View File

@ -12,15 +12,15 @@ OpImplementation::OpImplementation(const std::shared_ptr<ngraph::Node> &node) {
try {
auto castedNode = std::dynamic_pointer_cast<Operation>(node);
if (!castedNode)
THROW_IE_EXCEPTION << "Cannot create implementation for unknown operation!";
IE_THROW() << "Cannot create implementation for unknown operation!";
if (castedNode->inputs().size() != 1 || castedNode->outputs().size() != 1)
THROW_IE_EXCEPTION << "Cannot create implementation for operation with incorrect number of inputs or outputs!";
IE_THROW() << "Cannot create implementation for operation with incorrect number of inputs or outputs!";
if (castedNode->get_input_partial_shape(0).is_dynamic() || castedNode->get_output_partial_shape(0).is_dynamic())
THROW_IE_EXCEPTION << "Cannot create implementation for op with dynamic shapes!";
IE_THROW() << "Cannot create implementation for op with dynamic shapes!";
if (castedNode->get_input_shape(0).size() != 4 || castedNode->get_output_shape(0).size() != 4)
THROW_IE_EXCEPTION << "Operation supports only 4d tensors for input and output.";
IE_THROW() << "Operation supports only 4d tensors for input and output.";
if (castedNode->get_input_element_type(0) != ngraph::element::f32 || castedNode->get_output_element_type(0) != ngraph::element::f32)
THROW_IE_EXCEPTION << "Operation supports only FP32 tensors.";
IE_THROW() << "Operation supports only FP32 tensors.";
add = castedNode->getAddAttr();
inShape = castedNode->get_input_shape(0);
outShape = castedNode->get_output_shape(0);
@ -87,17 +87,17 @@ InferenceEngine::StatusCode OpImplementation::getSupportedConfigurations(std::ve
InferenceEngine::StatusCode OpImplementation::init(InferenceEngine::LayerConfig &config, InferenceEngine::ResponseDesc *resp) noexcept {
try {
if (config.inConfs.size() != 1 || config.outConfs.size() != 1) {
THROW_IE_EXCEPTION << "Operation cannot be initialized with incorrect number of inputs/outputs!";
IE_THROW() << "Operation cannot be initialized with incorrect number of inputs/outputs!";
}
if (config.inConfs[0].desc.getDims().size() != 4 || config.outConfs[0].desc.getDims().size() != 4) {
THROW_IE_EXCEPTION
IE_THROW()
<< "Operation can be initialized only with 4d input/output tensors!";
}
if (config.outConfs[0].desc.getPrecision() != InferenceEngine::Precision::FP32 ||
config.inConfs[0].desc.getPrecision() != InferenceEngine::Precision::FP32) {
THROW_IE_EXCEPTION << "Operation supports only FP32 precisions!";
IE_THROW() << "Operation supports only FP32 precisions!";
}
} catch (InferenceEngine::Exception& ex) {
if (resp) {

View File

@ -14,13 +14,13 @@ using namespace TemplateExtension;
FFTImpl::FFTImpl(const std::shared_ptr<ngraph::Node> &node) {
auto castedNode = std::dynamic_pointer_cast<FFTOp>(node);
if (!castedNode)
THROW_IE_EXCEPTION << "Cannot create implementation for unknown operation!";
IE_THROW() << "Cannot create implementation for unknown operation!";
if (castedNode->inputs().size() != 1 || castedNode->outputs().size() != 1)
THROW_IE_EXCEPTION << "Cannot create implementation for operation with incorrect number of inputs or outputs!";
IE_THROW() << "Cannot create implementation for operation with incorrect number of inputs or outputs!";
if (castedNode->get_input_partial_shape(0).is_dynamic() || castedNode->get_output_partial_shape(0).is_dynamic())
THROW_IE_EXCEPTION << "Cannot create implementation for op with dynamic shapes!";
IE_THROW() << "Cannot create implementation for op with dynamic shapes!";
if (castedNode->get_input_element_type(0) != ngraph::element::f32 || castedNode->get_output_element_type(0) != ngraph::element::f32)
THROW_IE_EXCEPTION << "Operation supports only FP32 tensors.";
IE_THROW() << "Operation supports only FP32 tensors.";
inpShape = castedNode->get_input_shape(0);
outShape = castedNode->get_output_shape(0);
inverse = castedNode->inverse;
@ -57,12 +57,12 @@ InferenceEngine::StatusCode FFTImpl::getSupportedConfigurations(std::vector<Infe
InferenceEngine::StatusCode FFTImpl::init(InferenceEngine::LayerConfig &config, InferenceEngine::ResponseDesc *resp) noexcept {
try {
if (config.inConfs.size() != 1 || config.outConfs.size() != 1) {
THROW_IE_EXCEPTION << "Operation cannot be initialized with incorrect number of inputs/outputs!";
IE_THROW() << "Operation cannot be initialized with incorrect number of inputs/outputs!";
}
if (config.outConfs[0].desc.getPrecision() != InferenceEngine::Precision::FP32 ||
config.inConfs[0].desc.getPrecision() != InferenceEngine::Precision::FP32) {
THROW_IE_EXCEPTION << "Operation supports only FP32 precisions!";
IE_THROW() << "Operation supports only FP32 precisions!";
}
} catch (InferenceEngine::Exception& ex) {
if (resp) {

View File

@ -29,12 +29,12 @@ Configuration::Configuration(const ConfigMap& config, const Configuration & defa
} else if (CONFIG_KEY(DEVICE_ID) == key) {
deviceId = std::stoi(value);
if (deviceId > 0) {
THROW_IE_EXCEPTION << "Device ID " << deviceId << " is not supported";
IE_THROW() << "Device ID " << deviceId << " is not supported";
}
} else if (CONFIG_KEY(PERF_COUNT) == key) {
perfCount = (CONFIG_VALUE(YES) == value);
} else if (throwOnUnsupported) {
THROW_IE_EXCEPTION_WITH_STATUS(NotFound) << ": " << key;
IE_THROW(NotFound) << ": " << key;
}
}
}
@ -53,6 +53,6 @@ InferenceEngine::Parameter Configuration::Get(const std::string& name) const {
} else if (name == CONFIG_KEY_INTERNAL(CPU_THREADS_PER_STREAM)) {
return {std::to_string(_streamsExecutorConfig._threadsPerStream)};
} else {
THROW_IE_EXCEPTION_WITH_STATUS(NotFound) << ": " << name;
IE_THROW(NotFound) << ": " << name;
}
}

View File

@ -30,9 +30,9 @@ TemplatePlugin::ExecutableNetwork::ExecutableNetwork(const std::shared_ptr<const
} catch (const InferenceEngine::Exception&) {
throw;
} catch (const std::exception & e) {
THROW_IE_EXCEPTION << "Standard exception from compilation library: " << e.what();
IE_THROW() << "Standard exception from compilation library: " << e.what();
} catch (...) {
THROW_IE_EXCEPTION << "Generic exception is thrown";
IE_THROW() << "Generic exception is thrown";
}
}
// ! [executable_network:ctor_cnnnetwork]
@ -77,9 +77,9 @@ TemplatePlugin::ExecutableNetwork::ExecutableNetwork(std::istream & model,
} catch (const InferenceEngine::Exception&) {
throw;
} catch (const std::exception & e) {
THROW_IE_EXCEPTION << "Standard exception from compilation library: " << e.what();
IE_THROW() << "Standard exception from compilation library: " << e.what();
} catch (...) {
THROW_IE_EXCEPTION << "Generic exception is thrown";
IE_THROW() << "Generic exception is thrown";
}
}
// ! [executable_network:ctor_import_stream]
@ -181,7 +181,7 @@ InferenceEngine::Parameter TemplatePlugin::ExecutableNetwork::GetMetric(const st
unsigned int value = _cfg._streamsExecutorConfig._streams;
IE_SET_METRIC_RETURN(OPTIMAL_NUMBER_OF_INFER_REQUESTS, value);
} else {
THROW_IE_EXCEPTION << "Unsupported ExecutableNetwork metric: " << name;
IE_THROW() << "Unsupported ExecutableNetwork metric: " << name;
}
}
// ! [executable_network:get_metric]

View File

@ -86,7 +86,7 @@ static void AllocateImpl(const BlobDataMap& blobDataMap,
case Precision::FP32 : {
blob = InferenceEngine::make_shared_blob<float>({precision, dims, layout});
} break;
default: THROW_IE_EXCEPTION << "Template Plugin: Unsupported Input/Output Presision";
default: IE_THROW() << "Template Plugin: Unsupported Input/Output Presision";
}
blob->allocate();
blobMap[blobData.first] = blob;
@ -101,7 +101,7 @@ static void AllocateImpl(const BlobDataMap& blobDataMap,
networkBlob = InferenceEngine::make_shared_blob<float>({Precision::FP32, dims, layout});
}
} break;
default: THROW_IE_EXCEPTION << "Template Plugin: Unsupported network Input/Output Presision";
default: IE_THROW() << "Template Plugin: Unsupported network Input/Output Presision";
}
if (blob != networkBlob) {
networkBlob->allocate();
@ -147,7 +147,7 @@ static void blobCopy(const Blob::Ptr& src, const Blob::Ptr& dst) {
blobCopy<std::uint8_t, float>(src, dst);
} break;
default : {
THROW_IE_EXCEPTION << "Unsupported precision conversion from "
IE_THROW() << "Unsupported precision conversion from "
<< src->getTensorDesc().getPrecision() <<" to " << dst->getTensorDesc().getPrecision();
}
}
@ -159,13 +159,13 @@ static void blobCopy(const Blob::Ptr& src, const Blob::Ptr& dst) {
blobCopy<float, std::uint8_t>(src, dst);
} break;
default : {
THROW_IE_EXCEPTION << "Unsupported precision conversion from "
IE_THROW() << "Unsupported precision conversion from "
<< src->getTensorDesc().getPrecision() <<" to " << dst->getTensorDesc().getPrecision();
}
}
} break;
default : {
THROW_IE_EXCEPTION << "Unsupported precision conversion from " << src->getTensorDesc().getPrecision();
IE_THROW() << "Unsupported precision conversion from " << src->getTensorDesc().getPrecision();
}
}
}

View File

@ -89,7 +89,7 @@ InferenceEngine::ExecutableNetworkInternal::Ptr Plugin::LoadExeNetworkImpl(const
if (output_precision != InferenceEngine::Precision::FP32 &&
output_precision != InferenceEngine::Precision::FP16 &&
output_precision != InferenceEngine::Precision::U8) {
THROW_IE_EXCEPTION << "Template device supports only U8, FP16 and FP32 output precision.";
IE_THROW() << "Template device supports only U8, FP16 and FP32 output precision.";
}
}
@ -100,14 +100,14 @@ InferenceEngine::ExecutableNetworkInternal::Ptr Plugin::LoadExeNetworkImpl(const
input_precision != InferenceEngine::Precision::FP16 &&
input_precision != InferenceEngine::Precision::I16 &&
input_precision != InferenceEngine::Precision::U8) {
THROW_IE_EXCEPTION << "Input image format " << input_precision << " is not supported yet.\n"
IE_THROW() << "Input image format " << input_precision << " is not supported yet.\n"
<< "Supported formats are: FP32, FP16, I16 and U8.";
}
}
auto function = network.getFunction();
if (function == nullptr) {
THROW_IE_EXCEPTION << "TEMPLATE plugin can compile only IR v10 networks";
IE_THROW() << "TEMPLATE plugin can compile only IR v10 networks";
}
return std::make_shared<ExecutableNetwork>(function, cfg, std::static_pointer_cast<Plugin>(shared_from_this()));
@ -135,7 +135,7 @@ InferenceEngine::QueryNetworkResult Plugin::QueryNetwork(const InferenceEngine::
auto function = network.getFunction();
if (function == nullptr) {
THROW_IE_EXCEPTION << "Template Plugin supports only ngraph cnn network representation";
IE_THROW() << "Template Plugin supports only ngraph cnn network representation";
}
// 1. First of all we should store initial input operation set
@ -215,7 +215,7 @@ InferenceEngine::QueryNetworkResult Plugin::QueryNetwork(const InferenceEngine::
// ! [plugin:add_extension]
void Plugin::AddExtension(InferenceEngine::IExtensionPtr /*extension*/) {
// TODO: add extensions if plugin supports extensions
THROW_IE_EXCEPTION_WITH_STATUS(NotImplemented);
IE_THROW(NotImplemented);
}
// ! [plugin:add_extension]
@ -278,7 +278,7 @@ InferenceEngine::Parameter Plugin::GetMetric(const std::string& name, const std:
using uint = unsigned int;
IE_SET_METRIC_RETURN(RANGE_FOR_ASYNC_INFER_REQUESTS, std::make_tuple(uint{1}, uint{1}, uint{1}));
} else {
THROW_IE_EXCEPTION << "Unsupported device metric: " << name;
IE_THROW() << "Unsupported device metric: " << name;
}
}
// ! [plugin:get_metric]

View File

@ -34,7 +34,7 @@ std::map <std::string, InferenceEngine::Layout> layout_map = {{"ANY", Infere
#define IE_CHECK_CALL(expr) { \
auto ret = (expr); \
if (ret != InferenceEngine::StatusCode::OK) { \
THROW_IE_EXCEPTION << response.msg; \
IE_THROW() << response.msg; \
} \
} \
@ -51,14 +51,14 @@ uint32_t getOptimalNumberOfRequests(const InferenceEngine::IExecutableNetwork::P
if (parameter_value.is<unsigned int>())
return parameter_value.as<unsigned int>();
else
THROW_IE_EXCEPTION << "Unsupported format for " << key << "!"
IE_THROW() << "Unsupported format for " << key << "!"
<< " Please specify number of infer requests directly!";
} else {
THROW_IE_EXCEPTION << "Can't load network: " << key << " is not supported!"
IE_THROW() << "Can't load network: " << key << " is not supported!"
<< " Please specify number of infer requests directly!";
}
} catch (const std::exception &ex) {
THROW_IE_EXCEPTION << "Can't load network: " << ex.what()
IE_THROW() << "Can't load network: " << ex.what()
<< " Please specify number of infer requests directly!";
}
}
@ -176,7 +176,7 @@ InferenceEnginePython::IENetwork::IENetwork(const std::string &model, const std:
InferenceEnginePython::IENetwork::IENetwork(const std::shared_ptr<InferenceEngine::CNNNetwork> &cnn_network)
: actual(cnn_network) {
if (actual == nullptr) THROW_IE_EXCEPTION << "IENetwork was not initialized.";
if (actual == nullptr) IE_THROW() << "IENetwork was not initialized.";
name = actual->getName();
batch_size = actual->getBatchSize();
}
@ -185,7 +185,7 @@ InferenceEnginePython::IENetwork::IENetwork(PyObject* network) {
auto* capsule_ptr = PyCapsule_GetPointer(network, "ngraph_function");
auto* function_sp = static_cast<std::shared_ptr<ngraph::Function>*>(capsule_ptr);
if (function_sp == nullptr)
THROW_IE_EXCEPTION << "Cannot create CNNNetwork from capsule! Capsule doesn't contain nGraph function!";
IE_THROW() << "Cannot create CNNNetwork from capsule! Capsule doesn't contain nGraph function!";
InferenceEngine::CNNNetwork cnnNetwork(*function_sp);
actual = std::make_shared<InferenceEngine::CNNNetwork>(cnnNetwork);

View File

@ -90,7 +90,7 @@ public:
InferenceEngine::details::SharedObjectLoader::Ptr splg = {}):
actual(request), plg(splg) {
// plg can be null, but not the actual
if (actual == nullptr) THROW_IE_EXCEPTION << "InferRequest was not initialized.";
if (actual == nullptr) IE_THROW() << "InferRequest was not initialized.";
}
/**
@ -125,8 +125,8 @@ public:
std::string error = "Internal error: blob with name `" + name + "` is not allocated!";
auto blobPtr = data.get();
const bool remoteBlobPassed = blobPtr->is<RemoteBlob>();
if (blobPtr == nullptr) THROW_IE_EXCEPTION << error;
if (!remoteBlobPassed && blobPtr->buffer() == nullptr) THROW_IE_EXCEPTION << error;
if (blobPtr == nullptr) IE_THROW() << error;
if (!remoteBlobPassed && blobPtr->buffer() == nullptr) IE_THROW() << error;
return data;
}
@ -240,7 +240,7 @@ public:
*/
StatusCode Wait(int64_t millis_timeout) {
ResponseDesc resp;
if (actual == nullptr) THROW_IE_EXCEPTION << "InferRequest was not initialized.";
if (actual == nullptr) IE_THROW() << "InferRequest was not initialized.";
auto res = actual->Wait(millis_timeout, &resp);
if (res != OK && res != RESULT_NOT_READY &&
res != INFER_NOT_STARTED && res != INFER_CANCELLED) {
@ -273,7 +273,7 @@ public:
*/
std::vector<VariableState> QueryState() {
IE_SUPPRESS_DEPRECATED_START
if (actual == nullptr) THROW_IE_EXCEPTION << "ExecutableNetwork was not initialized.";
if (actual == nullptr) IE_THROW() << "ExecutableNetwork was not initialized.";
IVariableState::Ptr pState = nullptr;
auto res = OK;
std::vector<VariableState> controller;
@ -281,7 +281,7 @@ public:
ResponseDesc resp;
res = actual->QueryState(pState, idx, &resp);
if (res != OK && res != OUT_OF_BOUNDS) {
THROW_IE_EXCEPTION << resp.msg;
IE_THROW() << resp.msg;
}
if (res != OUT_OF_BOUNDS) {
controller.push_back(VariableState(pState, plg));
@ -297,7 +297,7 @@ public:
* @return A shared pointer to underlying IInferRequest interface
*/
operator IInferRequest::Ptr&() {
if (actual == nullptr) THROW_IE_EXCEPTION << "InferRequest was not initialized.";
if (actual == nullptr) IE_THROW() << "InferRequest was not initialized.";
return actual;
}

View File

@ -82,7 +82,7 @@ public:
*/
explicit SOPointer(T* pointedObj): _so_loader(), _pointedObj(pointedObj) {
if (_pointedObj == nullptr) {
THROW_IE_EXCEPTION << "Cannot create SOPointer<T, Loader> from nullptr";
IE_THROW() << "Cannot create SOPointer<T, Loader> from nullptr";
}
}
@ -193,9 +193,9 @@ protected:
reinterpret_cast<CreateF*>(create)(_pointedObj);
}
} CATCH_IE_EXCEPTIONS catch (const std::exception& ex) {
THROW_IE_EXCEPTION << ex.what();
IE_THROW() << ex.what();
} catch(...) {
THROW_IE_EXCEPTION_WITH_STATUS(Unexpected);
IE_THROW(Unexpected);
}
}
@ -207,9 +207,9 @@ protected:
using CreateF = void(std::shared_ptr<T>&);
reinterpret_cast<CreateF*>(_so_loader->get_symbol(SOCreatorTrait<T>::name))(_pointedObj);
} CATCH_IE_EXCEPTIONS catch (const std::exception& ex) {
THROW_IE_EXCEPTION << ex.what();
IE_THROW() << ex.what();
} catch(...) {
THROW_IE_EXCEPTION_WITH_STATUS(Unexpected);
IE_THROW(Unexpected);
}
}
#undef CATCH_IE_EXCEPTION

View File

@ -34,15 +34,15 @@ protected:
const std::string& obj_T2 = "__") const {
auto itrType = params.find(type_Key);
if (itrType == params.end())
THROW_IE_EXCEPTION << "Parameter of type " << type_Key << " not found";
IE_THROW() << "Parameter of type " << type_Key << " not found";
std::string param_val = itrType->second.as<std::string>();
if (obj_T1 != param_val && obj_T2 != param_val)
THROW_IE_EXCEPTION << "Unexpected object type " << param_val;
IE_THROW() << "Unexpected object type " << param_val;
auto itrHandle = params.find(handle_Key);
if (itrHandle == params.end()) {
THROW_IE_EXCEPTION << "No parameter " << handle_Key << " found";
IE_THROW() << "No parameter " << handle_Key << " found";
}
Tmp handle = itrHandle->second;
@ -57,7 +57,7 @@ protected:
Result _ObjFromParamSimple(const ParamMap& params, const std::string& handle_Key) const {
auto itrHandle = params.find(handle_Key);
if (itrHandle == params.end()) {
THROW_IE_EXCEPTION << "No parameter " << handle_Key << " found";
IE_THROW() << "No parameter " << handle_Key << " found";
}
Result handle = itrHandle->second;
@ -72,7 +72,7 @@ protected:
std::string Key) const {
auto itrType = params.find(Key);
if (itrType == params.end())
THROW_IE_EXCEPTION << "Parameter key " << Key << " not found";
IE_THROW() << "Parameter key " << Key << " not found";
return itrType->second.as<std::string>();
}
};

View File

@ -128,7 +128,7 @@ public:
static inline Blob::Ptr make_shared_blob_nv12(size_t height, size_t width, RemoteContext::Ptr ctx, ID3D11Texture2D* nv12_surf) {
auto casted = std::dynamic_pointer_cast<D3DContext>(ctx);
if (nullptr == casted) {
THROW_IE_EXCEPTION << "Invalid remote context passed";
IE_THROW() << "Invalid remote context passed";
}
// despite of layout, blob dimensions always follow in N,C,H,W order
@ -174,7 +174,7 @@ static inline D3DContext::Ptr make_shared_context(Core& core, std::string device
static inline Blob::Ptr make_shared_blob(const TensorDesc& desc, RemoteContext::Ptr ctx, ID3D11Buffer* buffer) {
auto casted = std::dynamic_pointer_cast<D3DContext>(ctx);
if (nullptr == casted) {
THROW_IE_EXCEPTION << "Invalid remote context passed";
IE_THROW() << "Invalid remote context passed";
}
ParamMap params = {
@ -196,7 +196,7 @@ static inline Blob::Ptr make_shared_blob(const TensorDesc& desc, RemoteContext::
static inline Blob::Ptr make_shared_blob(const TensorDesc& desc, RemoteContext::Ptr ctx, ID3D11Texture2D* surface, uint32_t plane = 0) {
auto casted = std::dynamic_pointer_cast<D3DContext>(ctx);
if (nullptr == casted) {
THROW_IE_EXCEPTION << "Invalid remote context passed";
IE_THROW() << "Invalid remote context passed";
}
ParamMap params = {
{ GPU_PARAM_KEY(SHARED_MEM_TYPE), GPU_PARAM_VALUE(VA_SURFACE) },

View File

@ -177,7 +177,7 @@ public:
static inline Blob::Ptr make_shared_blob_nv12(RemoteContext::Ptr ctx, cl::Image2D& nv12_image_plane_y, cl::Image2D& nv12_image_plane_uv) {
auto casted = std::dynamic_pointer_cast<ClContext>(ctx);
if (nullptr == casted) {
THROW_IE_EXCEPTION << "Invalid remote context passed";
IE_THROW() << "Invalid remote context passed";
}
size_t width = nv12_image_plane_y.getImageInfo<CL_IMAGE_WIDTH>();
@ -235,7 +235,7 @@ static inline Blob::Ptr make_shared_blob(const TensorDesc& desc, ClContext::Ptr
static inline Blob::Ptr make_shared_blob(const TensorDesc& desc, RemoteContext::Ptr ctx, cl::Buffer& buffer) {
auto casted = std::dynamic_pointer_cast<ClContext>(ctx);
if (nullptr == casted) {
THROW_IE_EXCEPTION << "Invalid remote context passed";
IE_THROW() << "Invalid remote context passed";
}
ParamMap params = {
@ -255,7 +255,7 @@ static inline Blob::Ptr make_shared_blob(const TensorDesc& desc, RemoteContext::
static inline Blob::Ptr make_shared_blob(const TensorDesc& desc, RemoteContext::Ptr ctx, cl_mem buffer) {
auto casted = std::dynamic_pointer_cast<ClContext>(ctx);
if (nullptr == casted) {
THROW_IE_EXCEPTION << "Invalid remote context passed";
IE_THROW() << "Invalid remote context passed";
}
ParamMap params = {
@ -275,7 +275,7 @@ static inline Blob::Ptr make_shared_blob(const TensorDesc& desc, RemoteContext::
static inline Blob::Ptr make_shared_blob(const TensorDesc& desc, RemoteContext::Ptr ctx, cl::Image2D& image) {
auto casted = std::dynamic_pointer_cast<ClContext>(ctx);
if (nullptr == casted) {
THROW_IE_EXCEPTION << "Invalid remote context passed";
IE_THROW() << "Invalid remote context passed";
}
ParamMap params = {

View File

@ -92,7 +92,7 @@ public:
static inline Blob::Ptr make_shared_blob_nv12(size_t height, size_t width, RemoteContext::Ptr ctx, VASurfaceID nv12_surf) {
auto casted = std::dynamic_pointer_cast<VAContext>(ctx);
if (nullptr == casted) {
THROW_IE_EXCEPTION << "Invalid remote context passed";
IE_THROW() << "Invalid remote context passed";
}
// despite of layout, blob dimensions always follow in N,C,H,W order
@ -128,7 +128,7 @@ static inline VAContext::Ptr make_shared_context(Core& core, std::string deviceN
static inline VASurfaceBlob::Ptr make_shared_blob(const TensorDesc& desc, RemoteContext::Ptr ctx, VASurfaceID surface, uint32_t plane = 0) {
auto casted = std::dynamic_pointer_cast<VAContext>(ctx);
if (nullptr == casted) {
THROW_IE_EXCEPTION << "Invalid remote context passed";
IE_THROW() << "Invalid remote context passed";
}
ParamMap params = {
{ GPU_PARAM_KEY(SHARED_MEM_TYPE), GPU_PARAM_VALUE(VA_SURFACE) },

View File

@ -524,7 +524,7 @@ public:
}
if (data_size != 0 && ptr == nullptr) {
THROW_IE_EXCEPTION << "Using Blob on external nullptr memory";
IE_THROW() << "Using Blob on external nullptr memory";
}
_allocator = details::make_pre_allocator(ptr, data_size);
@ -541,7 +541,7 @@ public:
*/
TBlob(const TensorDesc& tensorDesc, const std::shared_ptr<IAllocator>& alloc)
: MemoryBlob(tensorDesc), _allocator(alloc) {
if (_allocator == nullptr) THROW_IE_EXCEPTION << "TBlob allocator was not initialized.";
if (_allocator == nullptr) IE_THROW() << "TBlob allocator was not initialized.";
}
/**
@ -831,7 +831,7 @@ extern template class INFERENCE_ENGINE_API_CLASS(InferenceEngine::TBlob<unsigned
template <typename Type>
inline typename InferenceEngine::TBlob<Type>::Ptr make_shared_blob(const TensorDesc& tensorDesc) {
if (!tensorDesc.getPrecision().hasStorageType<Type>())
THROW_IE_EXCEPTION << "Cannot make shared blob! "
IE_THROW() << "Cannot make shared blob! "
<< "The blob type cannot be used to store objects of current precision";
return std::make_shared<InferenceEngine::TBlob<Type>>(tensorDesc);
}
@ -849,7 +849,7 @@ template <typename Type>
inline typename InferenceEngine::TBlob<Type>::Ptr make_shared_blob(const TensorDesc& tensorDesc, Type* ptr,
size_t size = 0) {
if (!tensorDesc.getPrecision().hasStorageType<Type>())
THROW_IE_EXCEPTION << "Cannot make shared blob! "
IE_THROW() << "Cannot make shared blob! "
<< "The blob type cannot be used to store objects of current precision";
return std::make_shared<InferenceEngine::TBlob<Type>>(tensorDesc, ptr, size);
}
@ -866,7 +866,7 @@ template <typename Type>
inline typename InferenceEngine::TBlob<Type>::Ptr make_shared_blob(
const TensorDesc& tensorDesc, const std::shared_ptr<InferenceEngine::IAllocator>& alloc) {
if (!tensorDesc.getPrecision().hasStorageType<Type>())
THROW_IE_EXCEPTION << "Cannot make shared blob! "
IE_THROW() << "Cannot make shared blob! "
<< "The blob type cannot be used to store objects of current precision";
return std::make_shared<InferenceEngine::TBlob<Type>>(tensorDesc, alloc);
}

View File

@ -359,6 +359,7 @@ INFERENCE_ENGINE_DECLARE_EXCEPTION(InferCancelled, INFER_CANCELLED)
*/
#undef INFERENCE_ENGINE_DECLARE_EXCEPTION
// TODO: Move this section out of public API
namespace details {
/**
* @brief Tag struct used to throw exception
@ -378,27 +379,34 @@ struct ThrowNow final {
#else
#define IE_LOCATION ""
#endif // NDEBUG
// WARNING: DO NOT USE THIS MACRO! Use openvino/pp.hpp macro library
#define IE_PP_EXPAND(X) X
#define IE_PP_NARG(...) IE_PP_EXPAND(IE_PP_NARG_(__VA_ARGS__, IE_PP_RSEQ_N()))
#define IE_PP_NARG_(...) IE_PP_EXPAND(IE_PP_ARG_N(__VA_ARGS__))
#define IE_PP_ARG_N(_0, _1, N, ...) N
#define IE_PP_RSEQ_N() 0, 1, 0
#define IE_PP_NO_ARGS(NAME) ,
#define IE_PP_CAT3_(x, y, z) x ## y ## z
#define IE_PP_CAT3(x, y, z) IE_PP_CAT3_(x, y, z)
#define IE_PP_OVERLOAD(NAME, ...) IE_PP_EXPAND(IE_PP_CAT3(NAME, _, IE_PP_EXPAND(IE_PP_NARG(IE_PP_NO_ARGS __VA_ARGS__ (NAME))))(__VA_ARGS__))
// ENDWARNING
#define IE_THROW_0() \
InferenceEngine::details::ThrowNow<InferenceEngine::GeneralError> {} <<= std::stringstream {} \
<< IE_LOCATION
#define IE_THROW_1(ExceptionType) \
InferenceEngine::details::ThrowNow<InferenceEngine::ExceptionType> {} <<= std::stringstream {} \
<< IE_LOCATION << InferenceEngine::details::ExceptionTraits<InferenceEngine::ExceptionType>::string() << ' '
/// @endcond
/**
* @def IE_THROW
* @brief A macro used to throw specefied exception with a description
* @brief A macro used to throw specified exception with a description
*/
#define IE_THROW(ExceptionType) \
InferenceEngine::details::ThrowNow<InferenceEngine::ExceptionType>{} <<= std::stringstream{} << IE_LOCATION
/**
* @def THROW_IE_EXCEPTION
* @brief A macro used to throw general exception with a description
*/
#define THROW_IE_EXCEPTION IE_THROW(GeneralError)
/**
* @def THROW_IE_EXCEPTION_WITH_STATUS
* @brief A macro used to throw general exception with a description and status
*/
#define THROW_IE_EXCEPTION_WITH_STATUS(ExceptionType) \
IE_THROW(ExceptionType) << InferenceEngine::details::ExceptionTraits<InferenceEngine::ExceptionType>::string() << ' '
#define IE_THROW(...) IE_PP_OVERLOAD(IE_THROW, __VA_ARGS__)
/**
* @def IE_ASSERT
@ -423,6 +431,10 @@ struct NullStream {
#endif // NDEBUG
/// @cond
#define THROW_IE_EXCEPTION \
InferenceEngine::details::ThrowNow<InferenceEngine::details::InferenceEngineException> {} <<= std::stringstream {} \
<< IE_LOCATION
#define IE_EXCEPTION_CASE(TYPE_ALIAS, STATUS_CODE, EXCEPTION_TYPE, ...) \
case InferenceEngine::STATUS_CODE : { \
using InferenceEngine::EXCEPTION_TYPE; using TYPE_ALIAS = EXCEPTION_TYPE; __VA_ARGS__; \
@ -455,7 +467,7 @@ struct NullStream {
* @private
*/
#define CALL_STATUS_FNC(function, ...) \
if (!actual) THROW_IE_EXCEPTION << "Wrapper used was not initialized."; \
if (!actual) IE_THROW() << "Wrapper used was not initialized."; \
ResponseDesc resp; \
auto res = actual->function(__VA_ARGS__, &resp); \
if (res != OK) IE_EXCEPTION_SWITCH(res, ExceptionType, \
@ -466,7 +478,7 @@ struct NullStream {
* @private
*/
#define CALL_STATUS_FNC_NO_ARGS(function) \
if (!actual) THROW_IE_EXCEPTION << "Wrapper used in the CALL_STATUS_FNC_NO_ARGS was not initialized."; \
if (!actual) IE_THROW() << "Wrapper used in the CALL_STATUS_FNC_NO_ARGS was not initialized."; \
ResponseDesc resp; \
auto res = actual->function(&resp); \
if (res != OK) IE_EXCEPTION_SWITCH(res, ExceptionType, \
@ -477,11 +489,11 @@ struct NullStream {
* @private
*/
#define CALL_FNC_NO_ARGS(function) \
if (!actual) THROW_IE_EXCEPTION << "Wrapper used in the CALL_FNC_NO_ARGS was not initialized."; \
if (!actual) IE_THROW() << "Wrapper used in the CALL_FNC_NO_ARGS was not initialized."; \
ResponseDesc resp; \
auto result = actual->function(&resp); \
if (resp.msg[0] != '\0') { \
THROW_IE_EXCEPTION << resp.msg \
IE_THROW() << resp.msg \
} \
return result;
} // namespace details

View File

@ -78,7 +78,7 @@ public:
* @return vector of strings
*/
std::vector<std::string> getImplTypes(const std::shared_ptr<ngraph::Node>& node) override {
if (node == nullptr) THROW_IE_EXCEPTION << "Provided ngraph::Node pointer is nullptr.";
if (node == nullptr) IE_THROW() << "Provided ngraph::Node pointer is nullptr.";
return actual->getImplTypes(node);
}
@ -89,7 +89,7 @@ public:
* @return shared pointer to implementation
*/
ILayerImpl::Ptr getImplementation(const std::shared_ptr<ngraph::Node>& node, const std::string& implType) override {
if (node == nullptr) THROW_IE_EXCEPTION << "Provided ngraph::Node pointer is nullptr.";
if (node == nullptr) IE_THROW() << "Provided ngraph::Node pointer is nullptr.";
return actual->getImplementation(node, implType);
}

View File

@ -44,7 +44,7 @@ public:
*/
Precision getPrecision() const {
if (!_inputData) {
THROW_IE_EXCEPTION << "Data is empty!";
IE_THROW() << "Data is empty!";
}
return _inputData->getPrecision();
}
@ -57,7 +57,7 @@ public:
*/
void setPrecision(Precision p) {
if (!_inputData) {
THROW_IE_EXCEPTION << "Data is empty!";
IE_THROW() << "Data is empty!";
}
_inputData->setPrecision(p);
}
@ -76,7 +76,7 @@ public:
*/
Layout getLayout() {
if (!_inputData) {
THROW_IE_EXCEPTION << "Data is empty!";
IE_THROW() << "Data is empty!";
}
return _inputData->getLayout();
}
@ -89,7 +89,7 @@ public:
*/
void setLayout(Layout l) {
if (!_inputData) {
THROW_IE_EXCEPTION << "Data is empty!";
IE_THROW() << "Data is empty!";
}
_inputData->setLayout(l);
}
@ -101,7 +101,7 @@ public:
*/
const std::string& name() const {
if (!_inputData) {
THROW_IE_EXCEPTION << "Data is empty!";
IE_THROW() << "Data is empty!";
}
return _inputData->getName();
}
@ -133,7 +133,7 @@ public:
*/
const TensorDesc& getTensorDesc() const {
if (!_inputData) {
THROW_IE_EXCEPTION << "Data is empty!";
IE_THROW() << "Data is empty!";
}
return _inputData->getTensorDesc();
}

View File

@ -306,7 +306,7 @@ private:
template <class U>
typename std::enable_if<!HasOperatorEqual<U>::value, bool>::type
equal(const Any& left, const Any& rhs) const {
THROW_IE_EXCEPTION << "Parameter doesn't contain equal operator";
IE_THROW() << "Parameter doesn't contain equal operator";
}
template <class U>
@ -322,13 +322,13 @@ private:
template <typename T>
static T& dyn_cast(Any* obj) {
if (obj == nullptr) THROW_IE_EXCEPTION << "Parameter is empty!";
if (obj == nullptr) IE_THROW() << "Parameter is empty!";
return dynamic_cast<RealData<T>&>(*obj).get();
}
template <typename T>
static const T& dyn_cast(const Any* obj) {
if (obj == nullptr) THROW_IE_EXCEPTION << "Parameter is empty!";
if (obj == nullptr) IE_THROW() << "Parameter is empty!";
return dynamic_cast<const RealData<T>&>(*obj).get();
}

View File

@ -78,7 +78,7 @@ public:
*/
explicit Precision(size_t bitsSize, const char* name = nullptr) {
if (bitsSize == 0) {
THROW_IE_EXCEPTION << "Precision with 0 elements size not supported";
IE_THROW() << "Precision with 0 elements size not supported";
}
precisionInfo.bitsSize = bitsSize;
if (name == nullptr) {
@ -240,7 +240,7 @@ public:
*/
size_t size() const {
if (precisionInfo.bitsSize == 0) {
THROW_IE_EXCEPTION << " cannot estimate element if precision is " << precisionInfo.name;
IE_THROW() << " cannot estimate element if precision is " << precisionInfo.name;
}
return precisionInfo.bitsSize >> 3;
}

View File

@ -74,10 +74,10 @@ public:
*/
PreProcessChannel::Ptr& operator[](size_t index) {
if (_channelsInfo.empty()) {
THROW_IE_EXCEPTION << "accessing pre-process when nothing was set.";
IE_THROW() << "accessing pre-process when nothing was set.";
}
if (index >= _channelsInfo.size()) {
THROW_IE_EXCEPTION << "pre process index " << index << " is out of bounds.";
IE_THROW() << "pre process index " << index << " is out of bounds.";
}
return _channelsInfo[index];
}
@ -92,10 +92,10 @@ public:
*/
const PreProcessChannel::Ptr& operator[](size_t index) const {
if (_channelsInfo.empty()) {
THROW_IE_EXCEPTION << "accessing pre-process when nothing was set.";
IE_THROW() << "accessing pre-process when nothing was set.";
}
if (index >= _channelsInfo.size()) {
THROW_IE_EXCEPTION << "pre process index " << index << " is out of bounds.";
IE_THROW() << "pre process index " << index << " is out of bounds.";
}
return _channelsInfo[index];
}
@ -130,13 +130,13 @@ public:
*/
void setMeanImage(const Blob::Ptr& meanImage) {
if (meanImage.get() == nullptr) {
THROW_IE_EXCEPTION << "Failed to set invalid mean image: nullptr";
IE_THROW() << "Failed to set invalid mean image: nullptr";
} else if (meanImage.get()->getTensorDesc().getLayout() != Layout::CHW) {
THROW_IE_EXCEPTION << "Mean image layout should be CHW";
IE_THROW() << "Mean image layout should be CHW";
} else if (meanImage.get()->getTensorDesc().getDims().size() != 3) {
THROW_IE_EXCEPTION << "Failed to set invalid mean image: number of dimensions != 3";
IE_THROW() << "Failed to set invalid mean image: number of dimensions != 3";
} else if (meanImage.get()->getTensorDesc().getDims()[0] != getNumberOfChannels()) {
THROW_IE_EXCEPTION << "Failed to set invalid mean image: number of channels != " << getNumberOfChannels();
IE_THROW() << "Failed to set invalid mean image: number of channels != " << getNumberOfChannels();
}
_variant = MEAN_IMAGE;
}
@ -151,11 +151,11 @@ public:
*/
void setMeanImageForChannel(const Blob::Ptr& meanImage, const size_t channel) {
if (meanImage.get() == nullptr) {
THROW_IE_EXCEPTION << "Failed to set invalid mean image for channel: nullptr";
IE_THROW() << "Failed to set invalid mean image for channel: nullptr";
} else if (meanImage.get()->getTensorDesc().getDims().size() != 2) {
THROW_IE_EXCEPTION << "Failed to set invalid mean image for channel: number of dimensions != 2";
IE_THROW() << "Failed to set invalid mean image for channel: number of dimensions != 2";
} else if (channel >= _channelsInfo.size()) {
THROW_IE_EXCEPTION << "Channel " << channel
IE_THROW() << "Channel " << channel
<< " exceed number of PreProcess channels: " << _channelsInfo.size();
}
_variant = MEAN_IMAGE;

View File

@ -54,7 +54,7 @@ void fillBlobImage(Blob::Ptr& inputBlob,
const size_t& inputSize) {
MemoryBlob::Ptr minput = as<MemoryBlob>(inputBlob);
if (!minput) {
THROW_IE_EXCEPTION << "We expect inputBlob to be inherited from MemoryBlob in fillBlobImage, " <<
IE_THROW() << "We expect inputBlob to be inherited from MemoryBlob in fillBlobImage, " <<
"but by fact we were not able to cast inputBlob to MemoryBlob";
}
// locked memory holder should be alive all time while access to its buffer happens
@ -114,7 +114,7 @@ void fillBlobBinary(Blob::Ptr& inputBlob,
const size_t& inputSize) {
MemoryBlob::Ptr minput = as<MemoryBlob>(inputBlob);
if (!minput) {
THROW_IE_EXCEPTION << "We expect inputBlob to be inherited from MemoryBlob in fillBlobBinary, " <<
IE_THROW() << "We expect inputBlob to be inherited from MemoryBlob in fillBlobBinary, " <<
"but by fact we were not able to cast inputBlob to MemoryBlob";
}
// locked memory holder should be alive all time while access to its buffer happens
@ -127,17 +127,17 @@ void fillBlobBinary(Blob::Ptr& inputBlob,
slog::info << "Prepare binary file " << filePaths[inputIndex] << slog::endl;
std::ifstream binaryFile(filePaths[inputIndex], std::ios_base::binary | std::ios_base::ate);
if (!binaryFile) {
THROW_IE_EXCEPTION << "Cannot open " << filePaths[inputIndex];
IE_THROW() << "Cannot open " << filePaths[inputIndex];
}
auto fileSize = static_cast<std::size_t>(binaryFile.tellg());
binaryFile.seekg(0, std::ios_base::beg);
if (!binaryFile.good()) {
THROW_IE_EXCEPTION << "Can not read " << filePaths[inputIndex];
IE_THROW() << "Can not read " << filePaths[inputIndex];
}
auto inputSize = inputBlob->size()*sizeof(T)/batchSize;
if (fileSize != inputSize) {
THROW_IE_EXCEPTION << "File " << filePaths[inputIndex] << " contains " << std::to_string(fileSize) << " bytes "
IE_THROW() << "File " << filePaths[inputIndex] << " contains " << std::to_string(fileSize) << " bytes "
"but the network expects " << std::to_string(inputSize);
}
binaryFile.read(&inputBlobData[i*inputSize], inputSize);
@ -161,7 +161,7 @@ void fillBlobRandom(Blob::Ptr& inputBlob,
T rand_max = std::numeric_limits<T>::max()) {
MemoryBlob::Ptr minput = as<MemoryBlob>(inputBlob);
if (!minput) {
THROW_IE_EXCEPTION << "We expect inputBlob to be inherited from MemoryBlob in fillBlobRandom, "
IE_THROW() << "We expect inputBlob to be inherited from MemoryBlob in fillBlobRandom, "
<< "but by fact we were not able to cast inputBlob to MemoryBlob";
}
// locked memory holder should be alive all time while access to its buffer happens
@ -181,7 +181,7 @@ void fillBlobImInfo(Blob::Ptr& inputBlob,
std::pair<size_t, size_t> image_size) {
MemoryBlob::Ptr minput = as<MemoryBlob>(inputBlob);
if (!minput) {
THROW_IE_EXCEPTION << "We expect inputBlob to be inherited from MemoryBlob in fillBlobImInfo, " <<
IE_THROW() << "We expect inputBlob to be inherited from MemoryBlob in fillBlobImInfo, " <<
"but by fact we were not able to cast inputBlob to MemoryBlob";
}
// locked memory holder should be alive all time while access to its buffer happens
@ -300,7 +300,7 @@ void fillBlobs(const std::vector<std::string>& inputFiles,
} else if ((precision == InferenceEngine::Precision::U8) || (precision == InferenceEngine::Precision::BOOL)) {
fillBlobBinary<uint8_t>(inputBlob, binaryFiles, batchSize, requestId, binaryInputId++, binaryInputCount);
} else {
THROW_IE_EXCEPTION << "Input precision is not supported for " << item.first;
IE_THROW() << "Input precision is not supported for " << item.first;
}
continue;
}
@ -319,7 +319,7 @@ void fillBlobs(const std::vector<std::string>& inputFiles,
} else if (precision == InferenceEngine::Precision::I64) {
fillBlobImInfo<int64_t>(inputBlob, batchSize, image_size);
} else {
THROW_IE_EXCEPTION << "Input precision is not supported for image info!";
IE_THROW() << "Input precision is not supported for image info!";
}
continue;
}
@ -349,7 +349,7 @@ void fillBlobs(const std::vector<std::string>& inputFiles,
} else if (precision == InferenceEngine::Precision::BOOL) {
fillBlobRandom<uint8_t, uint32_t>(inputBlob, 0, 1);
} else {
THROW_IE_EXCEPTION << "Input precision is not supported for " << item.first;
IE_THROW() << "Input precision is not supported for " << item.first;
}
}
}

View File

@ -88,7 +88,7 @@ static void next_step(const std::string additional_info = "") {
step_id++;
if (step_names.count(step_id) == 0)
THROW_IE_EXCEPTION << "Step ID " << step_id << " is out of total steps number " << step_names.size();
IE_THROW() << "Step ID " << step_id << " is out of total steps number " << step_names.size();
std::cout << "[Step " << step_id << "/" << step_names.size() << "] " << step_names.at(step_id)
<< (additional_info.empty() ? "" : " (" + additional_info + ")") << std::endl;
@ -433,7 +433,7 @@ int main(int argc, char *argv[]) {
try {
nireq = exeNetwork.GetMetric(key).as<unsigned int>();
} catch (const std::exception& ex) {
THROW_IE_EXCEPTION
IE_THROW()
<< "Every device used with the benchmark_app should "
<< "support OPTIMAL_NUMBER_OF_INFER_REQUESTS ExecutableNetwork metric. "
<< "Failed to query the metric for the " << device_name << " with error:" << ex.what();
@ -531,7 +531,7 @@ int main(int argc, char *argv[]) {
// warming up - out of scope
auto inferRequest = inferRequestsQueue.getIdleRequest();
if (!inferRequest) {
THROW_IE_EXCEPTION << "No idle Infer Requests!";
IE_THROW() << "No idle Infer Requests!";
}
if (FLAGS_api == "sync") {
inferRequest->infer();
@ -560,7 +560,7 @@ int main(int argc, char *argv[]) {
(FLAGS_api == "async" && iteration % nireq != 0)) {
inferRequest = inferRequestsQueue.getIdleRequest();
if (!inferRequest) {
THROW_IE_EXCEPTION << "No idle Infer Requests!";
IE_THROW() << "No idle Infer Requests!";
}
if (FLAGS_api == "sync") {

View File

@ -55,7 +55,7 @@ private:
void topResults(unsigned int n, InferenceEngine::TBlob<T>& input, std::vector<unsigned>& output) {
InferenceEngine::SizeVector dims = input.getTensorDesc().getDims();
size_t input_rank = dims.size();
if (!input_rank || !dims[0]) THROW_IE_EXCEPTION << "Input blob has incorrect dimensions!";
if (!input_rank || !dims[0]) IE_THROW() << "Input blob has incorrect dimensions!";
size_t batchSize = dims[0];
std::vector<unsigned> indexes(input.size() / batchSize);
@ -109,7 +109,7 @@ private:
TBLOB_TOP_RESULT(U64);
TBLOB_TOP_RESULT(I64);
default:
THROW_IE_EXCEPTION << "cannot locate blob for precision: " << input.getTensorDesc().getPrecision();
IE_THROW() << "cannot locate blob for precision: " << input.getTensorDesc().getPrecision();
}
#undef TBLOB_TOP_RESULT

View File

@ -137,7 +137,7 @@ static UNUSED std::vector<std::vector<size_t>> blobToImageOutputArray(InferenceE
H = outputDims.at(3);
W = outputDims.at(4);
} else {
THROW_IE_EXCEPTION << "Output blob has unsupported layout " << output->getTensorDesc().getLayout();
IE_THROW() << "Output blob has unsupported layout " << output->getTensorDesc().getLayout();
}
// Get classes
@ -268,7 +268,7 @@ static UNUSED void writeOutputBmp(std::vector<std::vector<size_t>> data, size_t
auto width = data.at(0).size();
if (height > (size_t) std::numeric_limits<int32_t>::max || width > (size_t) std::numeric_limits<int32_t>::max) {
THROW_IE_EXCEPTION << "File size is too big: " << height << " X " << width;
IE_THROW() << "File size is too big: " << height << " X " << width;
}
int padSize = static_cast<int>(4 - (width * 3) % 4) % 4;
@ -351,7 +351,7 @@ static UNUSED bool writeOutputBmp(std::string name, unsigned char *data, size_t
};
if (height > (size_t)std::numeric_limits<int32_t>::max || width > (size_t)std::numeric_limits<int32_t>::max) {
THROW_IE_EXCEPTION << "File size is too big: " << height << " X " << width;
IE_THROW() << "File size is too big: " << height << " X " << width;
}
int padSize = static_cast<int>(4 - (width * 3) % 4) % 4;
@ -520,7 +520,7 @@ static UNUSED bool writeOutputBmp(unsigned char *data, size_t height, size_t wid
};
if (height > (size_t)std::numeric_limits<int32_t>::max || width > (size_t)std::numeric_limits<int32_t>::max) {
THROW_IE_EXCEPTION << "File size is too big: " << height << " X " << width;
IE_THROW() << "File size is too big: " << height << " X " << width;
}
int padSize = static_cast<int>(4 - (width * 3) % 4) % 4;
@ -1034,7 +1034,7 @@ inline std::size_t getTensorWidth(const InferenceEngine::TensorDesc& desc) {
// Regardless of layout, dimensions are stored in fixed order
return dims.back();
} else {
THROW_IE_EXCEPTION << "Tensor does not have width dimension";
IE_THROW() << "Tensor does not have width dimension";
}
return 0;
}
@ -1057,7 +1057,7 @@ inline std::size_t getTensorHeight(const InferenceEngine::TensorDesc& desc) {
// Regardless of layout, dimensions are stored in fixed order
return dims.at(size - 2);
} else {
THROW_IE_EXCEPTION << "Tensor does not have height dimension";
IE_THROW() << "Tensor does not have height dimension";
}
return 0;
}
@ -1083,10 +1083,10 @@ inline std::size_t getTensorChannels(const InferenceEngine::TensorDesc& desc) {
case InferenceEngine::Layout::SCALAR: // [[fallthrough]]
case InferenceEngine::Layout::BLOCKED: // [[fallthrough]]
default:
THROW_IE_EXCEPTION << "Tensor does not have channels dimension";
IE_THROW() << "Tensor does not have channels dimension";
}
} else {
THROW_IE_EXCEPTION << "Tensor does not have channels dimension";
IE_THROW() << "Tensor does not have channels dimension";
}
return 0;
}
@ -1110,10 +1110,10 @@ inline std::size_t getTensorBatch(const InferenceEngine::TensorDesc& desc) {
case InferenceEngine::Layout::SCALAR: // [[fallthrough]]
case InferenceEngine::Layout::BLOCKED: // [[fallthrough]]
default:
THROW_IE_EXCEPTION << "Tensor does not have channels dimension";
IE_THROW() << "Tensor does not have channels dimension";
}
} else {
THROW_IE_EXCEPTION << "Tensor does not have channels dimension";
IE_THROW() << "Tensor does not have channels dimension";
}
return 0;
}

View File

@ -26,7 +26,7 @@ void matU8ToBlob(const cv::Mat& orig_image, InferenceEngine::Blob::Ptr& blob, in
const size_t channels = blobSize[1];
InferenceEngine::MemoryBlob::Ptr mblob = InferenceEngine::as<InferenceEngine::MemoryBlob>(blob);
if (!mblob) {
THROW_IE_EXCEPTION << "We expect blob to be inherited from MemoryBlob in matU8ToBlob, "
IE_THROW() << "We expect blob to be inherited from MemoryBlob in matU8ToBlob, "
<< "but by fact we were not able to cast inputBlob to MemoryBlob";
}
// locked memory holder should be alive all time while access to its buffer happens
@ -71,7 +71,7 @@ static UNUSED InferenceEngine::Blob::Ptr wrapMat2Blob(const cv::Mat &mat) {
strideW == channels &&
strideH == channels * width;
if (!is_dense) THROW_IE_EXCEPTION
if (!is_dense) IE_THROW()
<< "Doesn't support conversion from not dense cv::Mat";
InferenceEngine::TensorDesc tDesc(InferenceEngine::Precision::U8,

View File

@ -95,7 +95,7 @@ int main(int argc, char* argv[]) {
throw std::logic_error("Incorrect output dimensions for SSD model");
}
if (output_info == nullptr) {
THROW_IE_EXCEPTION << "[SAMPLES] internal error - output information is empty";
IE_THROW() << "[SAMPLES] internal error - output information is empty";
}
output_info->setPrecision(Precision::FP32);

View File

@ -85,7 +85,7 @@ std::shared_ptr<Function> createNgraphFunction() {
TBlob<uint8_t>::CPtr weightsPtr = ReadWeights(FLAGS_m);
if (weightsPtr->byteSize() != 1724336)
THROW_IE_EXCEPTION << "Incorrect weights file";
IE_THROW() << "Incorrect weights file";
// -------input------
std::vector<ptrdiff_t> padBegin{ 0, 0 };

View File

@ -23,7 +23,7 @@ const auto CldnnTensorFromIEDims = [](const InferenceEngine::SizeVector& dims, i
case 4: return cldnn::tensor(cldnn::batch(dims[0]), cldnn::feature(dims[1]), cldnn::spatial(dims[3], dims[2]));
case 5: return cldnn::tensor(cldnn::batch(dims[0]), cldnn::feature(dims[1]), cldnn::spatial(dims[4], dims[3], dims[2]));
case 6: return cldnn::tensor(cldnn::batch(dims[0]), cldnn::feature(dims[1]), cldnn::spatial(dims[5], dims[4], dims[3], dims[2]));
default: THROW_IE_EXCEPTION << "Invalid dimensions size(" << dims.size() << ") for clDNN tensor";
default: IE_THROW() << "Invalid dimensions size(" << dims.size() << ") for clDNN tensor";
}
};
@ -48,7 +48,7 @@ inline cldnn::data_types DataTypeFromPrecision(InferenceEngine::Precision p) {
case InferenceEngine::Precision::BOOL:
return cldnn::data_types::i8;
default:
THROW_IE_EXCEPTION_WITH_STATUS(ParameterMismatch)
IE_THROW(ParameterMismatch)
<< "The plugin does not support " << p.name() << " precision";
}
}
@ -74,7 +74,7 @@ inline cldnn::data_types DataTypeFromPrecision(ngraph::element::Type t) {
case ngraph::element::Type_t::u1:
return cldnn::data_types::bin;
default:
THROW_IE_EXCEPTION_WITH_STATUS(ParameterMismatch)
IE_THROW(ParameterMismatch)
<< "The plugin does not support " << t.get_type_name()<< " precision";
}
}
@ -95,7 +95,7 @@ inline cldnn::format FormatFromLayout(InferenceEngine::Layout l) {
case InferenceEngine::Layout::NHWC:
return cldnn::format::byxf;
default:
THROW_IE_EXCEPTION_WITH_STATUS(ParameterMismatch) << "The plugin does not support " << l << " layout";
IE_THROW(ParameterMismatch) << "The plugin does not support " << l << " layout";
}
}
@ -120,7 +120,7 @@ inline cldnn::format FormatFromTensorDesc(InferenceEngine::TensorDesc desc) {
case InferenceEngine::Layout::NHWC:
return cldnn::format::byxf;
default:
THROW_IE_EXCEPTION_WITH_STATUS(ParameterMismatch)
IE_THROW(ParameterMismatch)
<< "The plugin does not support " << desc.getLayout() << " layout";
}
}
@ -137,7 +137,7 @@ inline cldnn::format ImageFormatFromLayout(InferenceEngine::Layout l) {
case InferenceEngine::Layout::NHWC:
return cldnn::format::nv12;
default:
THROW_IE_EXCEPTION_WITH_STATUS(ParameterMismatch)
IE_THROW(ParameterMismatch)
<< "The plugin does not support " << l << " image layout";
}
}
@ -155,7 +155,7 @@ inline cldnn::format DefaultFormatForDims(size_t dimensions) {
case 6:
return cldnn::format::bfwzyx;
default:
THROW_IE_EXCEPTION << "Unsupported number of dimensions: " << dimensions;
IE_THROW() << "Unsupported number of dimensions: " << dimensions;
}
return cldnn::format::bfyx; // Should not get here

View File

@ -35,7 +35,7 @@ static void createDirectory(std::string _path) {
auto err = mkdir(path, 0755);
if (err != 0 && errno != EEXIST) {
THROW_IE_EXCEPTION << "Couldn't create directory! (err=" << err << "; errno=" << errno << ")";
IE_THROW() << "Couldn't create directory! (err=" << err << "; errno=" << errno << ")";
}
}
@ -51,7 +51,7 @@ void Config::UpdateFromMap(const std::map<std::string, std::string>& configMap)
} else if (val.compare(PluginConfigParams::NO) == 0) {
useProfiling = false;
} else {
THROW_IE_EXCEPTION_WITH_STATUS(NotFound) << "Unsupported property value by plugin: " << val;
IE_THROW(NotFound) << "Unsupported property value by plugin: " << val;
}
} else if (key.compare(PluginConfigParams::KEY_DYN_BATCH_ENABLED) == 0) {
if (val.compare(PluginConfigParams::YES) == 0) {
@ -59,7 +59,7 @@ void Config::UpdateFromMap(const std::map<std::string, std::string>& configMap)
} else if (val.compare(PluginConfigParams::NO) == 0) {
enableDynamicBatch = false;
} else {
THROW_IE_EXCEPTION_WITH_STATUS(NotFound) << "Unsupported property value by plugin: " << val;
IE_THROW(NotFound) << "Unsupported property value by plugin: " << val;
}
} else if (key.compare(PluginConfigParams::KEY_DUMP_KERNELS) == 0) {
if (val.compare(PluginConfigParams::YES) == 0) {
@ -67,14 +67,14 @@ void Config::UpdateFromMap(const std::map<std::string, std::string>& configMap)
} else if (val.compare(PluginConfigParams::NO) == 0) {
dumpCustomKernels = false;
} else {
THROW_IE_EXCEPTION_WITH_STATUS(NotFound) << "Unsupported property value by plugin: " << val;
IE_THROW(NotFound) << "Unsupported property value by plugin: " << val;
}
} else if (key.compare(CLDNNConfigParams::KEY_CLDNN_PLUGIN_PRIORITY) == 0) {
std::stringstream ss(val);
uint32_t uVal(0);
ss >> uVal;
if (ss.fail()) {
THROW_IE_EXCEPTION_WITH_STATUS(NotFound) << "Unsupported property value by plugin: " << val;
IE_THROW(NotFound) << "Unsupported property value by plugin: " << val;
}
switch (uVal) {
case 0:
@ -90,7 +90,7 @@ void Config::UpdateFromMap(const std::map<std::string, std::string>& configMap)
queuePriority = cldnn::priority_mode_types::high;
break;
default:
THROW_IE_EXCEPTION_WITH_STATUS(ParameterMismatch) << "Unsupported queue priority value: " << uVal;
IE_THROW(ParameterMismatch) << "Unsupported queue priority value: " << uVal;
}
} else if (key.compare(CLDNNConfigParams::KEY_CLDNN_PLUGIN_THROTTLE) == 0) {
@ -98,7 +98,7 @@ void Config::UpdateFromMap(const std::map<std::string, std::string>& configMap)
uint32_t uVal(0);
ss >> uVal;
if (ss.fail()) {
THROW_IE_EXCEPTION_WITH_STATUS(NotFound) << "Unsupported property value by plugin: " << val;
IE_THROW(NotFound) << "Unsupported property value by plugin: " << val;
}
switch (uVal) {
case 0:
@ -114,7 +114,7 @@ void Config::UpdateFromMap(const std::map<std::string, std::string>& configMap)
queueThrottle = cldnn::throttle_mode_types::high;
break;
default:
THROW_IE_EXCEPTION_WITH_STATUS(ParameterMismatch) << "Unsupported queue throttle value: " << uVal;
IE_THROW(ParameterMismatch) << "Unsupported queue throttle value: " << uVal;
}
} else if (key.compare(PluginConfigParams::KEY_CONFIG_FILE) == 0) {
std::stringstream ss(val);
@ -136,7 +136,7 @@ void Config::UpdateFromMap(const std::map<std::string, std::string>& configMap)
} else if (val.compare(PluginConfigParams::TUNING_RETUNE) == 0) {
tuningConfig.mode = cldnn::tuning_mode::tuning_retune_and_cache;
} else {
THROW_IE_EXCEPTION_WITH_STATUS(NotFound) << "Unsupported tuning mode value by plugin: " << val;
IE_THROW(NotFound) << "Unsupported tuning mode value by plugin: " << val;
}
} else if (key.compare(PluginConfigParams::KEY_TUNING_FILE) == 0) {
tuningConfig.cache_file_path = val;
@ -146,7 +146,7 @@ void Config::UpdateFromMap(const std::map<std::string, std::string>& configMap)
} else if (val.compare(PluginConfigParams::NO) == 0) {
memory_pool_on = false;
} else {
THROW_IE_EXCEPTION_WITH_STATUS(NotFound) << "Unsupported memory pool flag value: " << val;
IE_THROW(NotFound) << "Unsupported memory pool flag value: " << val;
}
} else if (key.compare(CLDNNConfigParams::KEY_CLDNN_GRAPH_DUMPS_DIR) == 0) {
if (!val.empty()) {
@ -169,7 +169,7 @@ void Config::UpdateFromMap(const std::map<std::string, std::string>& configMap)
} else if (val.compare(PluginConfigParams::NO) == 0) {
exclusiveAsyncRequests = false;
} else {
THROW_IE_EXCEPTION_WITH_STATUS(NotFound) << "Unsupported property value by plugin: " << val;
IE_THROW(NotFound) << "Unsupported property value by plugin: " << val;
}
} else if (key.compare(PluginConfigParams::KEY_GPU_THROUGHPUT_STREAMS) == 0) {
if (val.compare(PluginConfigParams::GPU_THROUGHPUT_AUTO) == 0) {
@ -179,7 +179,7 @@ void Config::UpdateFromMap(const std::map<std::string, std::string>& configMap)
try {
val_i = std::stoi(val);
} catch (const std::exception&) {
THROW_IE_EXCEPTION << "Wrong value for property key " << PluginConfigParams::KEY_GPU_THROUGHPUT_STREAMS
IE_THROW() << "Wrong value for property key " << PluginConfigParams::KEY_GPU_THROUGHPUT_STREAMS
<< ". Expected only positive numbers (#streams) or "
<< "PluginConfigParams::GPU_THROUGHPUT_AUTO";
}
@ -192,7 +192,7 @@ void Config::UpdateFromMap(const std::map<std::string, std::string>& configMap)
int val_i = std::stoi(val);
(void)val_i;
} catch (const std::exception&) {
THROW_IE_EXCEPTION << "Wrong value for property key " << PluginConfigParams::KEY_DEVICE_ID
IE_THROW() << "Wrong value for property key " << PluginConfigParams::KEY_DEVICE_ID
<< ". DeviceIDs are only represented by positive numbers";
}
// Set this value.
@ -203,7 +203,7 @@ void Config::UpdateFromMap(const std::map<std::string, std::string>& configMap)
} else if (val.compare(PluginConfigParams::NO) == 0) {
enableInt8 = false;
} else {
THROW_IE_EXCEPTION_WITH_STATUS(NotFound) << "Unsupported property value by plugin: " << val;
IE_THROW(NotFound) << "Unsupported property value by plugin: " << val;
}
} else if (key.compare(CLDNNConfigParams::KEY_CLDNN_NV12_TWO_INPUTS) == 0) {
if (val.compare(PluginConfigParams::YES) == 0) {
@ -211,7 +211,7 @@ void Config::UpdateFromMap(const std::map<std::string, std::string>& configMap)
} else if (val.compare(PluginConfigParams::NO) == 0) {
nv12_two_inputs = false;
} else {
THROW_IE_EXCEPTION_WITH_STATUS(NotFound) << "Unsupported NV12 flag value: " << val;
IE_THROW(NotFound) << "Unsupported NV12 flag value: " << val;
}
} else if (key.compare(CLDNNConfigParams::KEY_CLDNN_ENABLE_FP16_FOR_QUANTIZED_MODELS) == 0) {
if (val.compare(PluginConfigParams::YES) == 0) {
@ -219,10 +219,10 @@ void Config::UpdateFromMap(const std::map<std::string, std::string>& configMap)
} else if (val.compare(PluginConfigParams::NO) == 0) {
enable_fp16_for_quantized_models = false;
} else {
THROW_IE_EXCEPTION_WITH_STATUS(NotFound) << "Unsupported KEY_CLDNN_ENABLE_FP16_FOR_QUANTIZED_MODELS flag value: " << val;
IE_THROW(NotFound) << "Unsupported KEY_CLDNN_ENABLE_FP16_FOR_QUANTIZED_MODELS flag value: " << val;
}
} else {
THROW_IE_EXCEPTION_WITH_STATUS(NotFound) << "Unsupported property key by plugin: " << key;
IE_THROW(NotFound) << "Unsupported property key by plugin: " << key;
}
adjustKeyMapValues();

View File

@ -233,7 +233,7 @@ void CLDNNCustomLayer::LoadFromFile(const std::string configFile, CLDNNCustomLay
// config file might not exist - like global config, for example
return;
} else {
THROW_IE_EXCEPTION << "Error loading custom layer configuration file: " << configFile << ", " << res.description()
IE_THROW() << "Error loading custom layer configuration file: " << configFile << ", " << res.description()
<< " at offset " << res.offset;
}
}
@ -246,7 +246,7 @@ void CLDNNCustomLayer::LoadFromFile(const std::string configFile, CLDNNCustomLay
char* abs_path_ptr = realpath(configFile.c_str(), path);
#endif
if (abs_path_ptr == nullptr) {
THROW_IE_EXCEPTION << "Error loading custom layer configuration file: " << configFile << ", "
IE_THROW() << "Error loading custom layer configuration file: " << configFile << ", "
<< "Can't get canonicalized absolute pathname.";
}
@ -262,7 +262,7 @@ void CLDNNCustomLayer::LoadFromFile(const std::string configFile, CLDNNCustomLay
// path is absolute
dir_path = abs_file_name.substr(0, dir_split_pos);
} else {
THROW_IE_EXCEPTION << "Error loading custom layer configuration file: " << configFile << ", "
IE_THROW() << "Error loading custom layer configuration file: " << configFile << ", "
<< "Path is not valid";
}
@ -271,7 +271,7 @@ void CLDNNCustomLayer::LoadFromFile(const std::string configFile, CLDNNCustomLay
layer->LoadSingleLayer(r);
if (layer->Error()) {
customLayers.clear();
THROW_IE_EXCEPTION << layer->m_ErrorMessage;
IE_THROW() << layer->m_ErrorMessage;
} else {
customLayers[layer->Name()] = layer;
}

View File

@ -113,7 +113,7 @@ cldnn::device_info clDNNEngine::GetDeviceInfo(const std::map<std::string, std::s
if (config.find(PluginConfigParams::KEY_DEVICE_ID) != config.end()) {
auto val = config.at(PluginConfigParams::KEY_DEVICE_ID);
if (device_map.find(val) == device_map.end()) {
THROW_IE_EXCEPTION << "Invalid device ID: " << val;
IE_THROW() << "Invalid device ID: " << val;
}
device_info = device_map.at(val).get_info();
}
@ -441,7 +441,7 @@ auto check_inputs = [](InferenceEngine::InputsDataMap _networkInputs) {
input_precision != InferenceEngine::Precision::I32 &&
input_precision != InferenceEngine::Precision::I64 &&
input_precision != InferenceEngine::Precision::BOOL) {
THROW_IE_EXCEPTION_WITH_STATUS(NotImplemented)
IE_THROW(NotImplemented)
<< "Input image format " << input_precision << " is not supported yet...";
}
}
@ -514,7 +514,7 @@ ExecutableNetworkInternal::Ptr clDNNEngine::LoadExeNetworkImpl(const InferenceEn
auto casted = std::dynamic_pointer_cast<ClContext>(context);
if (nullptr == casted) {
THROW_IE_EXCEPTION << "Invalid context";
IE_THROW() << "Invalid context";
}
CLDNNPlugin::Config conf = getContextImpl(casted)->GetConfig();
@ -539,7 +539,7 @@ RemoteContext::Ptr clDNNEngine::CreateContext(const ParamMap& params) {
#endif
return std::dynamic_pointer_cast<RemoteContext>(context);
} else {
THROW_IE_EXCEPTION << "Invalid remote context type" << contextTypeStr;
IE_THROW() << "Invalid remote context type" << contextTypeStr;
}
}
@ -569,7 +569,7 @@ QueryNetworkResult clDNNEngine::QueryNetwork(const CNNNetwork& network,
Program prog(m_defaultContext->getImpl()->GetEngine(), conf);
auto function = network.getFunction();
if (function == nullptr) {
THROW_IE_EXCEPTION << "CNNetworkImpl representation is not supported anymore";
IE_THROW() << "CNNetworkImpl representation is not supported anymore";
}
std::unordered_set<std::string> originalOpNames;
@ -781,7 +781,7 @@ Parameter clDNNEngine::GetConfig(const std::string& name, const std::map<std::st
if (option != _impl->m_config.key_config_map.end()) {
result = option->second;
} else {
THROW_IE_EXCEPTION << "Unsupported config key : " << name;
IE_THROW() << "Unsupported config key : " << name;
}
return result;
}
@ -856,7 +856,7 @@ Parameter clDNNEngine::GetMetric(const std::string& name, const std::map<std::st
std::tuple<unsigned int, unsigned int> range = std::make_tuple(1, 2);
IE_SET_METRIC_RETURN(RANGE_FOR_STREAMS, range);
} else {
THROW_IE_EXCEPTION << "Unsupported metric key " << name;
IE_THROW() << "Unsupported metric key " << name;
}
}

View File

@ -50,7 +50,7 @@ CLDNNExecNetwork::CLDNNExecNetwork(InferenceEngine::CNNNetwork &network, RemoteC
auto casted_context = std::dynamic_pointer_cast<gpu::ClContext>(context);
if (nullptr == casted_context) {
THROW_IE_EXCEPTION << "Invalid remote context";
IE_THROW() << "Invalid remote context";
}
m_context = casted_context;
@ -66,16 +66,16 @@ InferRequestInternal::Ptr CLDNNExecNetwork::CreateInferRequestImpl(InputsDataMap
OutputsDataMap networkOutputs) {
OV_ITT_SCOPED_TASK(itt::domains::CLDNNPlugin, "CLDNNExecNetwork::CreateInferRequestImpl");
if (m_graphs.empty()) {
THROW_IE_EXCEPTION_WITH_STATUS(NetworkNotLoaded);
IE_THROW(NetworkNotLoaded);
}
for (auto& graph : m_graphs) {
if (graph == nullptr) {
THROW_IE_EXCEPTION_WITH_STATUS(NetworkNotLoaded);
IE_THROW(NetworkNotLoaded);
}
if (!graph->IsLoaded()) {
THROW_IE_EXCEPTION_WITH_STATUS(NetworkNotLoaded) << ": no networks created";
IE_THROW(NetworkNotLoaded) << ": no networks created";
}
}
@ -98,7 +98,7 @@ IInferRequest::Ptr CLDNNExecNetwork::CreateInferRequest() {
InferenceEngine::CNNNetwork CLDNNExecNetwork::GetExecGraphInfo() {
if (m_graphs.empty())
THROW_IE_EXCEPTION_WITH_STATUS(NetworkNotLoaded);
IE_THROW(NetworkNotLoaded);
return m_graphs.front()->GetExecGraphInfo();
}
@ -108,7 +108,7 @@ InferenceEngine::Parameter CLDNNExecNetwork::GetConfig(const std::string &name)
if (it != m_config.key_config_map.end()) {
return it->second;
} else {
THROW_IE_EXCEPTION << "Unsupported ExecutableNetwork config key: " << name;
IE_THROW() << "Unsupported ExecutableNetwork config key: " << name;
}
}
@ -132,7 +132,7 @@ InferenceEngine::Parameter CLDNNExecNetwork::GetMetric(const std::string &name)
unsigned int nr = m_config.throughput_streams * 2u;
IE_SET_METRIC_RETURN(OPTIMAL_NUMBER_OF_INFER_REQUESTS, nr);
} else {
THROW_IE_EXCEPTION << "Unsupported ExecutableNetwork metric: " << name;
IE_THROW() << "Unsupported ExecutableNetwork metric: " << name;
}
}

View File

@ -743,7 +743,7 @@ std::map<std::string, InferenceEngine::InferenceEngineProfileInfo> CLDNNGraph::G
std::shared_ptr<cldnn::network> CLDNNGraph::GetNetwork(size_t idx) const {
if (idx >= GetNetworksCount())
THROW_IE_EXCEPTION << "Unable to find network with id=" << idx << ". Stored networks count: " << GetNetworksCount();
IE_THROW() << "Unable to find network with id=" << idx << ". Stored networks count: " << GetNetworksCount();
return m_networks[idx];
}
@ -755,18 +755,18 @@ std::string CLDNNGraph::MapOutputName(std::string outName) const {
// Find correct output ID. Start with name stored in IR.
if (primitiveIDs.find(outName) == primitiveIDs.end()) {
THROW_IE_EXCEPTION << "output with name " << outName << " was not found in primitiveIDs";
IE_THROW() << "output with name " << outName << " was not found in primitiveIDs";
}
std::string outputID = primitiveIDs.at(outName);
while (std::find(networkOutputsIDs.begin(), networkOutputsIDs.end(), outputID) == networkOutputsIDs.end()) {
// If current ID isn't found in cldnn network outputs, get previous primitive id and try again.
auto prim = allPrimitiveIds.find(outputID);
if (prim == allPrimitiveIds.end()) {
THROW_IE_EXCEPTION << "Unknown primitive id " << outputID;
IE_THROW() << "Unknown primitive id " << outputID;
}
if (prevPrimitiveIDs.at(outputID).size() != 1 || prim->second != "_optimized_") {
THROW_IE_EXCEPTION << "Unable to find parent for output primitive " << outputID;
IE_THROW() << "Unable to find parent for output primitive " << outputID;
}
outputID = prevPrimitiveIDs.at(outputID)[0];
}

View File

@ -73,7 +73,7 @@ Blob::Ptr CLDNNInferRequest::createInputBlob(const TensorDesc& desc, uint8_t* me
else
return make_shared_blob<uint8_t>(desc);
default:
THROW_IE_EXCEPTION << "The plugin does not support input " << p.name() << " precision";
IE_THROW() << "The plugin does not support input " << p.name() << " precision";
}
}
@ -103,7 +103,7 @@ Blob::Ptr CLDNNInferRequest::createOutputBlob(const TensorDesc& desc, uint8_t* m
else
return make_shared_blob<int64_t>(desc);
default:
THROW_IE_EXCEPTION << "The plugin does not support output " << p.name() << " precision";
IE_THROW() << "The plugin does not support output " << p.name() << " precision";
}
}
@ -149,7 +149,7 @@ void CLDNNInferRequest::copyOutputData(const cldnn::memory& outputMemory,
case Precision::FP32: {
auto out_f = locked.as<float*>();
if (out_f == nullptr) {
THROW_IE_EXCEPTION << "Invalid output blob";
IE_THROW() << "Invalid output blob";
}
auto resPtr = outputMemory.pointer<float>();
float *resVec = out_f + offset;
@ -179,7 +179,7 @@ void CLDNNInferRequest::copyOutputData(const cldnn::memory& outputMemory,
case Precision::FP16: {
auto out_f = locked.as<uint16_t*>();
if (out_f == nullptr) {
THROW_IE_EXCEPTION << "Invalid output blob";
IE_THROW() << "Invalid output blob";
}
auto resPtr = outputMemory.pointer<uint16_t>();
uint16_t* resVec = out_f + offset;
@ -209,7 +209,7 @@ void CLDNNInferRequest::copyOutputData(const cldnn::memory& outputMemory,
case Precision::I32: {
auto out_f = locked.as<int32_t*>();
if (out_f == nullptr) {
THROW_IE_EXCEPTION << "Invalid output blob";
IE_THROW() << "Invalid output blob";
}
auto resPtr = outputMemory.pointer<int32_t>();
int32_t* resVec = out_f + offset;
@ -239,7 +239,7 @@ void CLDNNInferRequest::copyOutputData(const cldnn::memory& outputMemory,
case Precision::I64: {
auto out_f = locked.as<int64_t*>();
if (out_f == nullptr) {
THROW_IE_EXCEPTION << "Invalid output blob";
IE_THROW() << "Invalid output blob";
}
auto resPtr = outputMemory.pointer<int64_t>();
int64_t* resVec = out_f + offset;
@ -267,7 +267,7 @@ void CLDNNInferRequest::copyOutputData(const cldnn::memory& outputMemory,
}
break;
default:
THROW_IE_EXCEPTION << "The plugin does not support output " << bptr->getTensorDesc().getPrecision() << " precision";
IE_THROW() << "The plugin does not support output " << bptr->getTensorDesc().getPrecision() << " precision";
}
}
@ -318,7 +318,7 @@ void CLDNNInferRequest::copyInputData(std::shared_ptr<cldnn::network> network,
break;
}
default:
THROW_IE_EXCEPTION << "The plugin does not support input " << inputBlob.getTensorDesc().getPrecision() << " precision";
IE_THROW() << "The plugin does not support input " << inputBlob.getTensorDesc().getPrecision() << " precision";
}
}
@ -329,7 +329,7 @@ void checkInputBlob(const Blob::Ptr &blob,
const std::string strNotMatched("The input blob size is not equal to the network input size");
if (!blob) {
THROW_IE_EXCEPTION << str_not_allocated;
IE_THROW() << str_not_allocated;
}
if (ColorFormat::NV12 == foundInput->getPreProcess().getColorFormat() &&
@ -337,19 +337,19 @@ void checkInputBlob(const Blob::Ptr &blob,
auto nv12_ptr = blob->as<NV12Blob>();
if (nv12_ptr == nullptr) {
THROW_IE_EXCEPTION_WITH_STATUS(ParameterMismatch) << wrong_nv12_blob;
IE_THROW(ParameterMismatch) << wrong_nv12_blob;
}
auto y_ptr = nv12_ptr->y()->as<gpu::ClBlob>();
// if the blobs are not remote, check their size
if (!y_ptr) {
if (nv12_ptr->y()->buffer() == nullptr) THROW_IE_EXCEPTION << str_not_allocated;
if (nv12_ptr->y()->buffer() == nullptr) IE_THROW() << str_not_allocated;
}
auto uv_ptr = nv12_ptr->uv()->as<gpu::ClBlob>();
if (!uv_ptr) {
if (nv12_ptr->uv()->buffer() == nullptr) THROW_IE_EXCEPTION << str_not_allocated;
if (nv12_ptr->uv()->buffer() == nullptr) IE_THROW() << str_not_allocated;
}
} else {
SizeVector dims = foundInput->getTensorDesc().getDims();
@ -359,11 +359,11 @@ void checkInputBlob(const Blob::Ptr &blob,
: 1;
if (refSize != blob->size()) {
THROW_IE_EXCEPTION << strNotMatched + ": got " << blob->size() << " expecting " << refSize;
IE_THROW() << strNotMatched + ": got " << blob->size() << " expecting " << refSize;
}
if (!blob->is<gpu::ClBlob>()) {
if (blob->buffer() == nullptr) THROW_IE_EXCEPTION << str_not_allocated;
if (blob->buffer() == nullptr) IE_THROW() << str_not_allocated;
}
}
}
@ -375,7 +375,7 @@ void checkOutputBlob(const Blob::Ptr &blob,
const std::string strNotMatched("The output blob size is not equal to the network output size");
if (!blob) {
THROW_IE_EXCEPTION << strNotAllocated;
IE_THROW() << strNotAllocated;
}
SizeVector dims = foundOutput->getTensorDesc().getDims();
size_t refSize = foundOutput->getTensorDesc().getLayout() != SCALAR
@ -383,11 +383,11 @@ void checkOutputBlob(const Blob::Ptr &blob,
: 1;
if (refSize != blob->size()) {
THROW_IE_EXCEPTION << strNotMatched + ": got " << blob->size() << " expecting " << refSize;
IE_THROW() << strNotMatched + ": got " << blob->size() << " expecting " << refSize;
}
if (!blob->is<gpu::ClBlob>()) {
if (blob->buffer() == nullptr) THROW_IE_EXCEPTION << strNotAllocated;
if (blob->buffer() == nullptr) IE_THROW() << strNotAllocated;
}
}
@ -402,7 +402,7 @@ void CLDNNInferRequest::checkBlobs() {
if (foundInputPair != std::end(_networkInputs)) {
foundInput = foundInputPair->second;
} else {
THROW_IE_EXCEPTION_WITH_STATUS(NotFound)
IE_THROW(NotFound)
<< "Failed to find input with name: \'" << input.first << "\'";
}
checkInputBlob(input.second, input.first, foundInput, m_graph->getConfig().nv12_two_inputs);
@ -416,7 +416,7 @@ void CLDNNInferRequest::checkBlobs() {
if (foundOutputPair != std::end(_networkOutputs)) {
foundOutput = foundOutputPair->second;
} else {
THROW_IE_EXCEPTION_WITH_STATUS(NotFound)
IE_THROW(NotFound)
<< "Failed to find output with name: \'" << output.first << "\'";
}
checkOutputBlob(output.second, output.first, foundOutput);
@ -451,14 +451,14 @@ void CLDNNInferRequest::SetBlob(const std::string& name, const Blob::Ptr &data)
// perform all common checks first
if (name.empty()) {
THROW_IE_EXCEPTION_WITH_STATUS(NotFound) << "Failed to set blob with empty name";
IE_THROW(NotFound) << "Failed to set blob with empty name";
}
if (!data)
THROW_IE_EXCEPTION_WITH_STATUS(NotAllocated) << "Failed to set empty blob with name: \'" << name << "\'";
IE_THROW(NotAllocated) << "Failed to set empty blob with name: \'" << name << "\'";
size_t dataSize = data->size();
if (0 == dataSize) {
THROW_IE_EXCEPTION << "Input data is empty. Input name: \'" << name << "\'";
IE_THROW() << "Input data is empty. Input name: \'" << name << "\'";
}
const bool compoundBlobPassed = data->is<CompoundBlob>();
@ -472,7 +472,7 @@ void CLDNNInferRequest::SetBlob(const std::string& name, const Blob::Ptr &data)
: foundOutput->getTensorDesc();
if (desc.getPrecision() != blobDesc.getPrecision()) {
THROW_IE_EXCEPTION_WITH_STATUS(ParameterMismatch)
IE_THROW(ParameterMismatch)
<< "Failed to set Blob with precision not corresponding to user "
<< (is_input ? "input" : "output") << " precision";
}
@ -500,7 +500,7 @@ void CLDNNInferRequest::SetBlob(const std::string& name, const Blob::Ptr &data)
auto nv12_ptr = data->as<NV12Blob>();
if (nv12_ptr == nullptr) {
THROW_IE_EXCEPTION_WITH_STATUS(ParameterMismatch) << wrong_nv12_blob;
IE_THROW(ParameterMismatch) << wrong_nv12_blob;
}
auto y_ptr = nv12_ptr->y()->as<gpu::ClBlob>();
@ -532,25 +532,25 @@ void CLDNNInferRequest::SetBlob(const std::string& name, const Blob::Ptr &data)
_preProcData[name]->setRoiBlob(data);
} else {
if (compoundBlobPassed) {
THROW_IE_EXCEPTION_WITH_STATUS(NotImplemented) << cannot_set_compound;
IE_THROW(NotImplemented) << cannot_set_compound;
}
size_t blobSize = desc.getLayout() != SCALAR
? details::product(desc.getDims())
: 1;
if (dataSize != blobSize) {
THROW_IE_EXCEPTION << "Input blob size is not equal network input size ("
IE_THROW() << "Input blob size is not equal network input size ("
<< dataSize << "!=" << blobSize << ").";
}
if (data->buffer() == nullptr)
THROW_IE_EXCEPTION << str_not_allocated << " Input name: \'" << name << "\'";
IE_THROW() << str_not_allocated << " Input name: \'" << name << "\'";
_inputs[name] = data;
}
}
} else {
if (compoundBlobPassed) {
THROW_IE_EXCEPTION_WITH_STATUS(NotImplemented) << cannot_set_compound;
IE_THROW(NotImplemented) << cannot_set_compound;
}
if (is_remote) {
@ -562,11 +562,11 @@ void CLDNNInferRequest::SetBlob(const std::string& name, const Blob::Ptr &data)
? details::product(desc.getDims())
: 1;
if (dataSize != outputSize) {
THROW_IE_EXCEPTION << "Output blob size is not equal network output size (" << dataSize
IE_THROW() << "Output blob size is not equal network output size (" << dataSize
<< "!=" << outputSize << ").";
}
if (data->buffer() == nullptr)
THROW_IE_EXCEPTION << str_not_allocated << " Input name: \'" << name << "\'";
IE_THROW() << str_not_allocated << " Input name: \'" << name << "\'";
}
_outputs[name] = data;
}
@ -586,10 +586,10 @@ void CLDNNInferRequest::AllocateInputs() {
cldnn::primitive_id UVName(name + "_UV");
if (inputLayouts.find(YName) == inputLayouts.end()) {
THROW_IE_EXCEPTION << "Input layout for " << YName << " is not found";
IE_THROW() << "Input layout for " << YName << " is not found";
}
if (inputLayouts.find(UVName) == inputLayouts.end()) {
THROW_IE_EXCEPTION << "Input layout for " << UVName << " is not found";
IE_THROW() << "Input layout for " << UVName << " is not found";
}
input_alloc(YName, inputLayouts.at(YName));
input_alloc(UVName, inputLayouts.at(UVName));
@ -606,7 +606,7 @@ void CLDNNInferRequest::AllocateInputs() {
_inputs[name] = make_shared_blob<NV12Blob>(blobY, blobUV);
} else {
if (inputLayouts.find(name) == inputLayouts.end()) {
THROW_IE_EXCEPTION << "Input layout for " << name << " is not found";
IE_THROW() << "Input layout for " << name << " is not found";
}
cldnn::layout layout = inputLayouts.at(name);
input_alloc(name, layout);
@ -633,7 +633,7 @@ void CLDNNInferRequest::AllocateInputsDyn() {
if (!dims.empty()) {
*dims.begin() = static_cast<size_t>(m_graph->GetMaxDynamicBatchSize());
} else {
THROW_IE_EXCEPTION << "Empty dimensions for input blob " << input.first;
IE_THROW() << "Empty dimensions for input blob " << input.first;
}
Blob::Ptr inputBlob = createInputBlob(desc);
@ -657,7 +657,7 @@ void CLDNNInferRequest::AllocateOutputs() {
cldnn::memory output_mem = m_graph->GetNetwork()->get_output_memory(outputID);
cldnn::pointer<uint8_t> output_mem_ptr = output_mem.pointer<uint8_t>();
if (output_mem_ptr.data() == nullptr) {
THROW_IE_EXCEPTION << "Empty output memory for primitive " << outputID;
IE_THROW() << "Empty output memory for primitive " << outputID;
}
DataPtr oi = no.second;
@ -685,7 +685,7 @@ void CLDNNInferRequest::AllocateOutputsDyn() {
if (!dims.empty()) {
*dims.begin() = static_cast<size_t>(m_graph->GetMaxDynamicBatchSize());
} else {
THROW_IE_EXCEPTION << "Empty dimensions for output blob " << no.first;
IE_THROW() << "Empty dimensions for output blob " << no.first;
}
Blob::Ptr outputBlob = createOutputBlob(desc);
@ -699,7 +699,7 @@ void CLDNNInferRequest::SetGraph(std::shared_ptr<CLDNNPlugin::CLDNNGraph> graph)
m_graph = graph;
if (m_graph == nullptr) {
THROW_IE_EXCEPTION_WITH_STATUS(NetworkNotLoaded);
IE_THROW(NetworkNotLoaded);
}
if (m_graph->GetMaxDynamicBatchSize() > 1) {
@ -715,10 +715,10 @@ void CLDNNInferRequest::SetGraph(std::shared_ptr<CLDNNPlugin::CLDNNGraph> graph)
void CLDNNInferRequest::SetBatch(int new_batch) {
OV_ITT_SCOPED_TASK(itt::domains::CLDNNPlugin, "CLDNNInferRequest::SetBatch");
if (m_graph->GetMaxDynamicBatchSize() < 0)
THROW_IE_EXCEPTION << "Dynamic batch is not enabled.";
IE_THROW() << "Dynamic batch is not enabled.";
if (new_batch < 1 || new_batch > m_graph->GetMaxDynamicBatchSize()) {
THROW_IE_EXCEPTION << "Invalid dynamic batch size " << new_batch <<
IE_THROW() << "Invalid dynamic batch size " << new_batch <<
" for this request. Got: " << new_batch << ". Expected value in range [1;" << m_graph->GetMaxDynamicBatchSize() << "]";
}
@ -891,7 +891,7 @@ void CLDNNInferRequest::InferImpl() {
std::map<std::string, InferenceEngineProfileInfo> CLDNNInferRequest::GetPerformanceCounts() const {
OV_ITT_SCOPED_TASK(itt::domains::CLDNNPlugin, "CLDNNInferRequest::GetPerformanceCounts");
if (!m_useProfiling) {
THROW_IE_EXCEPTION << "Performance counters were not enabled";
IE_THROW() << "Performance counters were not enabled";
} else {
return m_graph->GetPerformanceCounts();
}
@ -907,13 +907,13 @@ void copyToFloat(float* dst, const InferenceEngine::Blob* src) {
}
const InferenceEngine::TBlob<T>* t_blob = dynamic_cast<const InferenceEngine::TBlob<T>*>(src);
if (t_blob == nullptr) {
THROW_IE_EXCEPTION << "input type is " << src->getTensorDesc().getPrecision() << " but input is not "
IE_THROW() << "input type is " << src->getTensorDesc().getPrecision() << " but input is not "
<< typeid(T).name();
}
const T* srcPtr = t_blob->readOnly();
if (srcPtr == nullptr) {
THROW_IE_EXCEPTION << "Input data was not allocated.";
IE_THROW() << "Input data was not allocated.";
}
for (size_t i = 0; i < t_blob->size(); i++) dst[i] = srcPtr[i];
}
@ -924,7 +924,7 @@ void CLDNNInferRequest::PrepareInput(const cldnn::primitive_id &inputName, const
OV_ITT_SCOPED_TASK(itt::domains::CLDNNPlugin, "CLDNNInferRequest::PrepareInput");
// Get input layout
if (m_graph->GetInputLayouts().find(inputName) == m_graph->GetInputLayouts().end()) {
THROW_IE_EXCEPTION << "Input name mismatch.";
IE_THROW() << "Input name mismatch.";
}
auto inputLayout = m_graph->GetInputLayouts().at(inputName);
auto is_same_buffer = [](const Blob& blob, const cldnn::memory& memory) -> bool {
@ -933,7 +933,7 @@ void CLDNNInferRequest::PrepareInput(const cldnn::primitive_id &inputName, const
const uint8_t* blob_ptr = blob.cbuffer().as<const uint8_t*>();
const uint8_t* mem_ptr = ptr.data();
if (blob_ptr == nullptr || mem_ptr == nullptr) {
THROW_IE_EXCEPTION << str_not_allocated;
IE_THROW() << str_not_allocated;
}
return (blob_ptr == mem_ptr) && (blob.byteSize() == memory.size());
};
@ -971,7 +971,7 @@ void CLDNNInferRequest::PrepareInput(const cldnn::primitive_id &inputName, const
break;
}
default:
THROW_IE_EXCEPTION << "Unsupported input precision " << prec;
IE_THROW() << "Unsupported input precision " << prec;
}
} else {
// Otherwise, we have to attach to user memory and then copy the data.

View File

@ -48,7 +48,7 @@ void Program::ValidateInputs(const std::shared_ptr<ngraph::Node>& op, std::vecto
}
}
THROW_IE_EXCEPTION << "Invalid inputs count (" << op->get_input_size() << ") in "
IE_THROW() << "Invalid inputs count (" << op->get_input_size() << ") in "
<< op->get_friendly_name() << " (" << op->get_type_name()
<< " op::v" << op->get_type_info().version << ")";
}
@ -103,7 +103,7 @@ Program::Program(InferenceEngine::CNNNetwork& network, std::shared_ptr<const cld
auto func = network.getFunction();
if (!func) {
THROW_IE_EXCEPTION << "Function pointer inside CNNNetwork is nullptr";
IE_THROW() << "Function pointer inside CNNNetwork is nullptr";
}
auto ops = func->get_ordered_ops();
@ -111,7 +111,7 @@ Program::Program(InferenceEngine::CNNNetwork& network, std::shared_ptr<const cld
if (m_config.max_dynamic_batch > 1) {
// check topology for applicability
if (!CanProcessDynBatch(ops, networkInputs)) {
THROW_IE_EXCEPTION << "Such topology cannot be compiled for dynamic batch!";
IE_THROW() << "Such topology cannot be compiled for dynamic batch!";
}
}
@ -156,7 +156,7 @@ int Program::GetMaxBatchSizeForSingleProgram() {
std::shared_ptr<cldnn::program> Program::GetCompiledProgram(int program_id) {
if (program_id >= m_programs.size())
THROW_IE_EXCEPTION << "Invalid program ID";
IE_THROW() << "Invalid program ID";
return m_programs[program_id];
}
@ -247,7 +247,7 @@ void Program::CreateSingleLayerPrimitive(cldnn::topology& topology, const std::s
}
if (!is_created) {
THROW_IE_EXCEPTION << "Operation: " << op->get_friendly_name()
IE_THROW() << "Operation: " << op->get_friendly_name()
<< " of type " << op->get_type_name()
<< "(op::v" << op->get_type_info().version << ") is not supported";
}
@ -268,7 +268,7 @@ std::vector<cldnn::primitive_id> Program::GetInputPrimitiveIDs(const std::shared
if (!queryMode) {
if (primitiveIDs.find(prevName) == primitiveIDs.end()) {
THROW_IE_EXCEPTION << "Input " << prevName << " hasn't been found in primitiveIDs map";
IE_THROW() << "Input " << prevName << " hasn't been found in primitiveIDs map";
}
inputPrimitives.push_back(primitiveIDs.at(prevName));
} else {

View File

@ -38,7 +38,7 @@ void __register ## _ ## op_name ## _ ## op_version() {
[](Program& p, const std::shared_ptr<ngraph::Node>& op) { \
auto op_casted = std::dynamic_pointer_cast<ngraph::op::op_version::op_name>(op); \
if (!op_casted) \
THROW_IE_EXCEPTION << "Invalid ngraph Node type passed into " << __PRETTY_FUNCTION__; \
IE_THROW() << "Invalid ngraph Node type passed into " << __PRETTY_FUNCTION__; \
Create##op_name##Op(p, op_casted); \
}); \
}
@ -137,7 +137,7 @@ public:
template<typename PType>
void AddPrimitive(PType prim) {
if (m_topology == nullptr) {
THROW_IE_EXCEPTION << "m_topology object was not created in clDNNPlugin::Program";
IE_THROW() << "m_topology object was not created in clDNNPlugin::Program";
}
m_topology->add(prim);

View File

@ -62,7 +62,7 @@ ParamMap CLDNNRemoteBlobImpl::getParams() const {
{ GPU_PARAM_KEY(VA_PLANE), params.plane }
};
default:
THROW_IE_EXCEPTION << "Unsupported shared object type " << m_mem_type;
IE_THROW() << "Unsupported shared object type " << m_mem_type;
}
}
@ -110,7 +110,7 @@ void CLDNNRemoteBlobImpl::allocate_if_needed() {
m_memObject = std::unique_ptr<cldnn::memory>(new cldnn::memory(cldnn::memory::share_image(*eng, m_layout, m_mem)));
break;
default:
THROW_IE_EXCEPTION << unsupported_str << m_mem_type;
IE_THROW() << unsupported_str << m_mem_type;
}
}
@ -240,7 +240,7 @@ CLDNNExecutionContextImpl::CLDNNExecutionContextImpl(const std::shared_ptr<IInfe
m_va_display = _va_device = _ObjFromParamSimple<gpu_handle_param>(params, GPU_PARAM_KEY(VA_DEVICE));
m_type = ContextType::DEV_SHARED;
} else {
THROW_IE_EXCEPTION << "Invalid execution context type" << contextTypeStr;
IE_THROW() << "Invalid execution context type" << contextTypeStr;
}
}
@ -283,7 +283,7 @@ ParamMap CLDNNExecutionContextImpl::getParams() const {
ret[GPU_PARAM_KEY(VA_DEVICE)] = m_va_display;
break;
default:
THROW_IE_EXCEPTION << "Unsupported shared context type " << m_type;
IE_THROW() << "Unsupported shared context type " << m_type;
}
return ret;

View File

@ -363,7 +363,7 @@ class typedCLDNNExecutionContext : public TpublicContextAPI,
void check_if_shared() {
if (GetType() != CLDNNExecutionContextImpl::ContextType::DEV_SHARED)
THROW_IE_EXCEPTION << "Shared context is required to to share this type of memory";
IE_THROW() << "Shared context is required to to share this type of memory";
}
public:
using Ptr = std::shared_ptr<typedCLDNNExecutionContext>;
@ -407,7 +407,7 @@ public:
check_if_shared();
#endif
} else {
THROW_IE_EXCEPTION << "Unsupported shared object type " << memTypeStr;
IE_THROW() << "Unsupported shared object type " << memTypeStr;
}
return reuse_obj(tensorDesc, mem, blob_type);

View File

@ -26,7 +26,7 @@ void CreateBatchToSpaceOp(Program& p, const std::shared_ptr<ngraph::op::v1::Batc
for (size_t i = 1; i < 4; ++i) {
auto inConst = std::dynamic_pointer_cast<ngraph::op::Constant>(op->get_input_node_shared_ptr(i));
if (!inConst)
THROW_IE_EXCEPTION << "Unsupported parameter nodes type in " << op->get_friendly_name() << " (" << op->get_type_name() << ")";
IE_THROW() << "Unsupported parameter nodes type in " << op->get_friendly_name() << " (" << op->get_type_name() << ")";
std::vector<int32_t> sizes = inConst->cast_vector<int32_t>();
int32_t default_size = i == 1 ? 1 : 0;

View File

@ -86,7 +86,7 @@ void CreateBroadcastOp(Program& p, const std::shared_ptr<ngraph::op::v1::Broadca
if (op->get_broadcast_spec().m_type == ngraph::op::AutoBroadcastType::NONE && op->get_input_size() == 3) {
auto axis_mapping_node = std::dynamic_pointer_cast<ngraph::op::v0::Constant>(op->get_input_node_shared_ptr(2));
if (!axis_mapping_node)
THROW_IE_EXCEPTION << "Unsupported parameter nodes type in " << op->get_friendly_name() << " (" << op->get_type_name() << ")";
IE_THROW() << "Unsupported parameter nodes type in " << op->get_friendly_name() << " (" << op->get_type_name() << ")";
auto axis_mapping = axis_mapping_node->get_axis_set_val();
CreateCommonBroadcastOp(p, op, axis_mapping);
@ -102,7 +102,7 @@ void CreateBroadcastOp(Program& p, const std::shared_ptr<ngraph::op::v3::Broadca
if (op->get_input_size() == 3) {
auto axis_mapping_node = std::dynamic_pointer_cast<ngraph::op::v0::Constant>(op->get_input_node_shared_ptr(2));
if (!axis_mapping_node)
THROW_IE_EXCEPTION << "Unsupported parameter nodes type in " << op->get_friendly_name() << " (" << op->get_type_name() << ")";
IE_THROW() << "Unsupported parameter nodes type in " << op->get_friendly_name() << " (" << op->get_type_name() << ")";
axis_mapping = axis_mapping_node->get_axis_set_val();
}

View File

@ -13,7 +13,7 @@ namespace CLDNNPlugin {
static cldnn::concatenation::concatenation_axis GetConcatAxis(int32_t axis, size_t rank) {
if (axis >= rank)
THROW_IE_EXCEPTION << "Concatenation axis exceeds number of dimensions";
IE_THROW() << "Concatenation axis exceeds number of dimensions";
// Difference in dimension ordering between IE and clDNN,
// reverse spatial dimensions after batch and feature.
@ -32,7 +32,7 @@ static cldnn::concatenation::concatenation_axis GetConcatAxis(int32_t axis, size
case 3: return cldnn::concatenation::concatenation_axis::along_y;
case 4: return cldnn::concatenation::concatenation_axis::along_z;
case 5: return cldnn::concatenation::concatenation_axis::along_w;
default: THROW_IE_EXCEPTION << "Unsupported concatenation axis: " << axis;
default: IE_THROW() << "Unsupported concatenation axis: " << axis;
}
return cldnn::concatenation::concatenation_axis::along_f; // shouldn't get here

View File

@ -72,7 +72,7 @@ static cldnn::tensor getConstTensor(const ngraph::Shape constDims) {
break;
case 0: constTensor = cldnn::tensor(1, 1, 1, 1);
break;
default: THROW_IE_EXCEPTION << "Invalid constant blob dimensions";
default: IE_THROW() << "Invalid constant blob dimensions";
}
return constTensor;
}
@ -138,7 +138,7 @@ void CreateConstantOp(Program& p, const std::shared_ptr<ngraph::op::v0::Constant
if (swap_oi) {
size_t expected_min_rank = 2 + (prop.hasGroupDimension ? 1 : 0);
if (expected_min_rank > constDims.size())
THROW_IE_EXCEPTION << "Invalid constant properties or shape";
IE_THROW() << "Invalid constant properties or shape";
auto newDims = constDims;
if (prop.hasGroupDimension) {

View File

@ -34,7 +34,7 @@ static ConvoltuionParameters GetConvolutionParameters(const ngraph::CoordinateDi
uint32_t groups) {
cldnn::tensor stride, padding, dilation;
if (pads_begin.size() != strides.size() || dilations.size() != strides.size())
THROW_IE_EXCEPTION << "Strides, Dilations and Pads are supposed to have the same elements count";
IE_THROW() << "Strides, Dilations and Pads are supposed to have the same elements count";
switch (strides.size()) {
case 3: {
@ -55,7 +55,7 @@ static ConvoltuionParameters GetConvolutionParameters(const ngraph::CoordinateDi
dilation = cldnn::tensor(cldnn::batch(1), cldnn::feature(1), cldnn::spatial(dilations[0], 1, 1));
break;
}
default: THROW_IE_EXCEPTION << "Unsupported convolve parameters size. Only 1d, 2d, and 3d cases are supported";
default: IE_THROW() << "Unsupported convolve parameters size. Only 1d, 2d, and 3d cases are supported";
}
return {stride, padding, dilation, groups};
@ -127,7 +127,7 @@ void CreateConvolutionBackpropDataOp(Program& p, const std::shared_ptr<ngraph::o
auto dilations = op->get_dilations();
for (auto d : dilations) {
if (d != 1) {
THROW_IE_EXCEPTION << "Unsupported dilation in ConvolutionBackpropData " << op->get_friendly_name();
IE_THROW() << "Unsupported dilation in ConvolutionBackpropData " << op->get_friendly_name();
}
}
@ -180,7 +180,7 @@ void CreateGroupConvolutionBackpropDataOp(Program& p, const std::shared_ptr<ngra
auto dilations = op->get_dilations();
for (auto d : dilations) {
if (d != 1) {
THROW_IE_EXCEPTION << "Unsupported dilation in GroupConvolutionBackpropData " << op->get_friendly_name();
IE_THROW() << "Unsupported dilation in GroupConvolutionBackpropData " << op->get_friendly_name();
}
}

View File

@ -46,11 +46,11 @@ void CreateCommonCTCGreedyDecoderOp(Program& p, const std::shared_ptr<ngraph::No
if (reorderedInputs.size() == 3) {
auto blank_index_node = std::dynamic_pointer_cast<ngraph::op::v0::Constant>(op->get_input_node_shared_ptr(2));
if (!blank_index_node) {
THROW_IE_EXCEPTION << "Unsupported blank_index node type in " << op->get_friendly_name() << " (" << op->get_type_name() << ")";
IE_THROW() << "Unsupported blank_index node type in " << op->get_friendly_name() << " (" << op->get_type_name() << ")";
}
float val;
if (ngraph::shape_size(blank_index_node->get_output_shape(0)) != 1 || !ngraph::op::util::get_single_value(blank_index_node, val)) {
THROW_IE_EXCEPTION << "Unsupported parameter size in " << op->get_friendly_name() << " (" << op->get_type_name() << ")";
IE_THROW() << "Unsupported parameter size in " << op->get_friendly_name() << " (" << op->get_type_name() << ")";
}
blank_index = static_cast<uint32_t>(val);
reorderedInputs.pop_back();

View File

@ -16,7 +16,7 @@ static inline cldnn::cum_sum::cum_sum_axis GetCumSumAxis(int32_t axis, uint32_t
if (axis < 0)
axis += rank;
if (axis < 0 || axis >= rank)
THROW_IE_EXCEPTION << "CumSum axis is not correspond to number of dimensions";
IE_THROW() << "CumSum axis is not correspond to number of dimensions";
// Difference in dimension ordering between IE and clDNN,
// reverse spatial dimensions after batch and feature.
@ -35,7 +35,7 @@ static inline cldnn::cum_sum::cum_sum_axis GetCumSumAxis(int32_t axis, uint32_t
case 3: return cldnn::cum_sum::cum_sum_axis::along_y;
case 4: return cldnn::cum_sum::cum_sum_axis::along_z;
case 5: return cldnn::cum_sum::cum_sum_axis::along_w;
default: THROW_IE_EXCEPTION << "Unsupported CumSum axis: " << axis;
default: IE_THROW() << "Unsupported CumSum axis: " << axis;
}
return cldnn::cum_sum::cum_sum_axis::along_f; // shouldn't get here
@ -54,7 +54,7 @@ void CreateCumSumOp(Program& p, const std::shared_ptr<ngraph::op::v0::CumSum>& o
if (op->get_input_size() == 2) {
auto axes_constant = std::dynamic_pointer_cast<ngraph::op::Constant>(op->get_input_node_shared_ptr(1));
if (!axes_constant) {
THROW_IE_EXCEPTION << "Unsupported parameter nodes type in " << op->get_friendly_name() << " (" << op->get_type_name() << ")";
IE_THROW() << "Unsupported parameter nodes type in " << op->get_friendly_name() << " (" << op->get_type_name() << ")";
}
axis = axes_constant->cast_vector<int32_t>()[0];
}

View File

@ -43,7 +43,7 @@ public:
CustomLayerAttributeVisitor() : m_values({}) { }
void on_adapter(const std::string& name, ngraph::ValueAccessor<void>& adapter) override {
THROW_IE_EXCEPTION << "Attribute " << name << " can't be processed\n";
IE_THROW() << "Attribute " << name << " can't be processed\n";
}
// The remaining adapter methods fall back on the void adapter if not implemented
void on_adapter(const std::string& name, ngraph::ValueAccessor<std::string>& adapter) override {
@ -165,7 +165,7 @@ void CreateCustomOp(Program& p, const std::shared_ptr<ngraph::Node>& op, CLDNNCu
break;
}
default:
THROW_IE_EXCEPTION << "Invalid custom layer param type: " << param.type << " in operation: " << op->get_friendly_name();
IE_THROW() << "Invalid custom layer param type: " << param.type << " in operation: " << op->get_friendly_name();
}
}
const std::string layerTitle("\n// Layer " + op->get_friendly_name() + " using Custom Layer " + customLayer->Name() + "\n");
@ -194,7 +194,7 @@ void CreateCustomOp(Program& p, const std::shared_ptr<ngraph::Node>& op, CLDNNCu
// if input index is greater than -1, take dimension from input
if (iidx >= 0) {
if (iidx >= op->get_input_size())
THROW_IE_EXCEPTION << "Invalid input tensor for index: " << iidx;
IE_THROW() << "Invalid input tensor for index: " << iidx;
auto inputDims = op->get_input_shape(iidx);
xDim = inputDims[inputDims.size() - 1];

View File

@ -17,7 +17,7 @@ static cldnn::depth_to_space_mode GetDepthMode(ngraph::op::v0::DepthToSpace::Dep
return cldnn::depth_to_space_mode::blocks_first;
case ngraph::op::v0::DepthToSpace::DepthToSpaceMode::DEPTH_FIRST:
return cldnn::depth_to_space_mode::depth_first;
default: THROW_IE_EXCEPTION << "Unsupported DepthToSpaceMode value: " << static_cast<int>(mode);
default: IE_THROW() << "Unsupported DepthToSpaceMode value: " << static_cast<int>(mode);
}
return cldnn::depth_to_space_mode::blocks_first;
}

View File

@ -21,7 +21,7 @@ static cldnn::prior_box_code_type PriorBoxCodeFromString(const std::string& str)
if (it != CodeNameToType.end()) {
return it->second;
} else {
THROW_IE_EXCEPTION << "Unknown Prior-Box code type: " << str;
IE_THROW() << "Unknown Prior-Box code type: " << str;
}
return cldnn::prior_box_code_type::corner;
}

View File

@ -151,7 +151,7 @@ void CreatePowerOp(Program& p, const std::shared_ptr<ngraph::op::v1::Power>& op)
if (ngraph::shape_size(power_node->get_output_shape(0)) == 1) {
float pow;
if (!ngraph::op::util::get_single_value(power_node, pow))
THROW_IE_EXCEPTION << "Invalid parameter size in " << op->get_friendly_name() << " (" << op->get_type_name() << ")";
IE_THROW() << "Invalid parameter size in " << op->get_friendly_name() << " (" << op->get_type_name() << ")";
CreateUnaryEltwiseOp(p, op, cldnn::activation_func::pow, {pow});
return;
}

View File

@ -25,12 +25,12 @@ void CreateEmbeddingBagOffsetsSumOp(Program& p, const std::shared_ptr<ngraph::op
if (inputPrimitives.size() > 3) {
auto index_node = std::dynamic_pointer_cast<ngraph::op::v0::Constant>(op->get_input_node_shared_ptr(3));
if (!index_node) {
THROW_IE_EXCEPTION << "Unsupported parameter nodes type in " << op->get_friendly_name() << " (" << op->get_type_name() << ")";
IE_THROW() << "Unsupported parameter nodes type in " << op->get_friendly_name() << " (" << op->get_type_name() << ")";
}
float val;
if (ngraph::shape_size(index_node->get_output_shape(0)) != 1 || !ngraph::op::util::get_single_value(index_node, val))
THROW_IE_EXCEPTION << "Unsupported parameter size in " << op->get_friendly_name() << " (" << op->get_type_name() << ")";
IE_THROW() << "Unsupported parameter size in " << op->get_friendly_name() << " (" << op->get_type_name() << ")";
defaultIndex = static_cast<int32_t>(val);
inputPrimitives.erase(inputPrimitives.begin() + 3); // Remove "default_index"
@ -116,12 +116,12 @@ void CreateEmbeddingSegmentsSumOp(Program& p, const std::shared_ptr<ngraph::op::
if (inputPrimitives.size() > 3) {
auto index_node = std::dynamic_pointer_cast<ngraph::op::v0::Constant>(op->get_input_node_shared_ptr(4));
if (!index_node) {
THROW_IE_EXCEPTION << "Unsupported parameter nodes type in " << op->get_friendly_name() << " (" << op->get_type_name() << ")";
IE_THROW() << "Unsupported parameter nodes type in " << op->get_friendly_name() << " (" << op->get_type_name() << ")";
}
float val;
if (ngraph::shape_size(index_node->get_output_shape(0)) != 1 || !ngraph::op::util::get_single_value(index_node, val))
THROW_IE_EXCEPTION << "Unsupported parameter size in " << op->get_friendly_name() << " (" << op->get_type_name() << ")";
IE_THROW() << "Unsupported parameter size in " << op->get_friendly_name() << " (" << op->get_type_name() << ")";
defaultIndex = static_cast<int32_t>(val);
inputPrimitives.erase(inputPrimitives.begin() + 3); // Remove "default_index"

View File

@ -16,7 +16,7 @@ static inline std::string PadToString(ngraph::op::PadType pad) {
case ngraph::op::PadType::SAME_UPPER: return "same_upper";
case ngraph::op::PadType::SAME_LOWER: return "same_lower";
case ngraph::op::PadType::VALID: return "valid";
default: THROW_IE_EXCEPTION << "Unsupported pad type in ExtractImagePatches primitive " << pad;
default: IE_THROW() << "Unsupported pad type in ExtractImagePatches primitive " << pad;
}
return "";

View File

@ -26,7 +26,7 @@ static cldnn::gather::gather_axis GetGatherAxis(int32_t axis, cldnn::format inpu
case -1: return cldnn::gather::gather_axis::along_y;
case -2: return cldnn::gather::gather_axis::along_f;
case -3: return cldnn::gather::gather_axis::along_b;
default: THROW_IE_EXCEPTION << "Unsupported gather axis: " << axis;
default: IE_THROW() << "Unsupported gather axis: " << axis;
}
} else if (inputFormat == cldnn::format::bfzyx) {
switch (axis) {
@ -37,7 +37,7 @@ static cldnn::gather::gather_axis GetGatherAxis(int32_t axis, cldnn::format inpu
case -2: return cldnn::gather::gather_axis::along_z;
case -3: return cldnn::gather::gather_axis::along_f;
case -4: return cldnn::gather::gather_axis::along_b;
default: THROW_IE_EXCEPTION << "Unsupported gather axis: " << axis;
default: IE_THROW() << "Unsupported gather axis: " << axis;
}
} else if (inputFormat == cldnn::format::bfwzyx) {
switch (axis) {
@ -50,10 +50,10 @@ static cldnn::gather::gather_axis GetGatherAxis(int32_t axis, cldnn::format inpu
case -3: return cldnn::gather::gather_axis::along_w;
case -4: return cldnn::gather::gather_axis::along_f;
case -5: return cldnn::gather::gather_axis::along_b;
default: THROW_IE_EXCEPTION << "Unsupported gather axis: " << axis;
default: IE_THROW() << "Unsupported gather axis: " << axis;
}
} else {
THROW_IE_EXCEPTION << "Unsupported gather axis: " << axis;
IE_THROW() << "Unsupported gather axis: " << axis;
}
}

View File

@ -27,7 +27,7 @@ static cldnn::coordinate_transformation_mode GetCoordinateTransformationMode(ngr
return cldnn::coordinate_transformation_mode::align_corners;
}
THROW_IE_EXCEPTION << "Unknown coordinate transformation mode: " << static_cast<int>(mode);
IE_THROW() << "Unknown coordinate transformation mode: " << static_cast<int>(mode);
}
static cldnn::nearest_mode GetNearestMode(ngraph::op::v4::Interpolate::NearestMode mode) {
@ -44,7 +44,7 @@ static cldnn::nearest_mode GetNearestMode(ngraph::op::v4::Interpolate::NearestMo
return cldnn::nearest_mode::simple;
}
THROW_IE_EXCEPTION << "Unknown nearest mode: " << static_cast<int>(mode);
IE_THROW() << "Unknown nearest mode: " << static_cast<int>(mode);
}
static cldnn::shape_calculation_mode GetShapeCalculationMode(ngraph::op::v4::Interpolate::ShapeCalcMode mode) {
@ -52,7 +52,7 @@ static cldnn::shape_calculation_mode GetShapeCalculationMode(ngraph::op::v4::Int
case ngraph::op::v4::Interpolate::ShapeCalcMode::sizes: return cldnn::shape_calculation_mode::sizes;
case ngraph::op::v4::Interpolate::ShapeCalcMode::scales: return cldnn::shape_calculation_mode::scales;
}
THROW_IE_EXCEPTION << "Unknown shape calculation mode: " << static_cast<int>(mode);
IE_THROW() << "Unknown shape calculation mode: " << static_cast<int>(mode);
}
static cldnn::resample_type GetResampleType(ngraph::op::v4::Interpolate::InterpolateMode mode) {
@ -62,14 +62,14 @@ static cldnn::resample_type GetResampleType(ngraph::op::v4::Interpolate::Interpo
case ngraph::op::v4::Interpolate::InterpolateMode::linear_onnx: return cldnn::resample_type::linear_onnx;
case ngraph::op::v4::Interpolate::InterpolateMode::cubic: return cldnn::resample_type::cubic;
}
THROW_IE_EXCEPTION << "Unknown interpolation mode: " << static_cast<int>(mode);
IE_THROW() << "Unknown interpolation mode: " << static_cast<int>(mode);
}
static cldnn::resample::resample_axis GetInterpolationAxis(int32_t axis, uint32_t sz) {
if (axis < 0)
axis += sz;
if (axis < 0 || axis >= sz)
THROW_IE_EXCEPTION << "Interpolate axis is not correspond to number of dimensions";
IE_THROW() << "Interpolate axis is not correspond to number of dimensions";
// Difference in dimension ordering between IE and clDNN,
// reverse spatial dimensions after batch and feature.
@ -97,7 +97,7 @@ static cldnn::resample::resample_axis GetInterpolationAxis(int32_t axis, uint32_
default:
break;
}
THROW_IE_EXCEPTION << "Unsupported Interpolate axis: " << axis;
IE_THROW() << "Unsupported Interpolate axis: " << axis;
}
void CreateInterpolateOp(Program& p, const std::shared_ptr<ngraph::op::v4::Interpolate>& op) {
@ -139,7 +139,7 @@ void CreateInterpolateOp(Program& p, const std::shared_ptr<ngraph::op::v4::Inter
auto scales_constant = std::dynamic_pointer_cast<ngraph::op::Constant>(op->get_input_node_shared_ptr(SCALES_INDEX));
if (!scales_constant) {
THROW_IE_EXCEPTION << "Unsupported parameter node type in " << op->get_friendly_name() << " (" << op->get_type_name() << ")";
IE_THROW() << "Unsupported parameter node type in " << op->get_friendly_name() << " (" << op->get_type_name() << ")";
}
std::vector<float> scales = scales_constant->cast_vector<float>();
@ -147,7 +147,7 @@ void CreateInterpolateOp(Program& p, const std::shared_ptr<ngraph::op::v4::Inter
if (op->get_input_size() == 4) {
auto axes_constant = std::dynamic_pointer_cast<ngraph::op::Constant>(op->get_input_node_shared_ptr(AXES_INDEX));
if (!axes_constant) {
THROW_IE_EXCEPTION << "Unsupported parameter node type in " << op->get_friendly_name() << " (" << op->get_type_name() << ")";
IE_THROW() << "Unsupported parameter node type in " << op->get_friendly_name() << " (" << op->get_type_name() << ")";
}
auto ie_axes = axes_constant->cast_vector<int32_t>();
for (auto axis : ie_axes) {
@ -160,7 +160,7 @@ void CreateInterpolateOp(Program& p, const std::shared_ptr<ngraph::op::v4::Inter
}
if (axes.size() != scales.size())
THROW_IE_EXCEPTION << op->get_friendly_name() << " Incorrect axes and scales should be the same size";
IE_THROW() << op->get_friendly_name() << " Incorrect axes and scales should be the same size";
cldnn::resample::AxesAndScales axesAndScales;
for (size_t i = 0; i < axes.size(); ++i) {
@ -169,9 +169,9 @@ void CreateInterpolateOp(Program& p, const std::shared_ptr<ngraph::op::v4::Inter
if (cldnnSampleType == cldnn::resample_type::linear_onnx) {
if (inputRank != 2 && inputRank != 4)
THROW_IE_EXCEPTION << "mode 'linear_onnx' supports only 2D or 4D tensors";
IE_THROW() << "mode 'linear_onnx' supports only 2D or 4D tensors";
if (axes.size() != 2 && inputRank != axes.size())
THROW_IE_EXCEPTION << "mode 'linear_onnx' supports only axes with size 2 or equal to input rank";
IE_THROW() << "mode 'linear_onnx' supports only axes with size 2 or equal to input rank";
bool correctAxes =
((axes[0] == cldnn::resample::resample_axis::along_b) &&
(axes[1] == cldnn::resample::resample_axis::along_f)) ||
@ -184,7 +184,7 @@ void CreateInterpolateOp(Program& p, const std::shared_ptr<ngraph::op::v4::Inter
axes[3] == cldnn::resample::resample_axis::along_x;
}
if (!correctAxes)
THROW_IE_EXCEPTION <<
IE_THROW() <<
"mode 'linear_onnx' supports only case when axes = {2, 3} or "
"axes = {0, 1} or axes = {0, 1, 2, 3}";
}

View File

@ -27,7 +27,7 @@ void CreateLRNOp(Program& p, const std::shared_ptr<ngraph::op::v0::LRN>& op) {
auto axis_const = std::dynamic_pointer_cast<ngraph::op::v0::Constant>(op->get_input_node_shared_ptr(1));
if (!axis_const) {
THROW_IE_EXCEPTION << "Unsupported axes node type in " << op->get_friendly_name() << " (" << op->get_type_name() << ")";
IE_THROW() << "Unsupported axes node type in " << op->get_friendly_name() << " (" << op->get_type_name() << ")";
}
auto axis_value = axis_const->cast_vector<int64_t>();
auto localSize = op->get_nsize();

View File

@ -43,7 +43,7 @@ static std::pair<ngraph::Shape, ngraph::Shape> get_aligned_shapes(const ngraph::
for (size_t i = 0; i < max_size - 2; ++i) {
if (shape_a_aligned[i] != shape_b_aligned[i] && shape_a_aligned[i] > 1 && shape_b_aligned[i] > 1) {
THROW_IE_EXCEPTION << "Shapes can't be aligned: " << shape_a_aligned << " " << shape_b_aligned;
IE_THROW() << "Shapes can't be aligned: " << shape_a_aligned << " " << shape_b_aligned;
}
size_t max_value = std::max(shape_a_aligned[i], shape_b_aligned[i]);
shape_a_aligned[i] = shape_b_aligned[i] = max_value;
@ -68,7 +68,7 @@ void CreateMatMulOp(Program& p, const std::shared_ptr<ngraph::op::v0::MatMul>& o
ngraph::Shape shape_a_aligned, shape_b_aligned;
std::tie(shape_a_aligned, shape_b_aligned) = get_aligned_shapes(shape_a, shape_b, op);
if (shape_a_aligned.size() < 2 || shape_b_aligned.size() < 2) {
THROW_IE_EXCEPTION << "MatMul " << op->get_friendly_name() << " shapes are inconsistent.";
IE_THROW() << "MatMul " << op->get_friendly_name() << " shapes are inconsistent.";
}
size_t K = *(shape_a_aligned.end() - 1);
@ -119,7 +119,7 @@ void CreateMatMulOp(Program& p, const std::shared_ptr<ngraph::op::v0::MatMul>& o
std::vector<size_t> reshapeSize = { total / features, features };
if (total != reshapeSize[0] * reshapeSize[1])
THROW_IE_EXCEPTION << "Inconsistent reshape in Matmul op: " << op->get_friendly_name();
IE_THROW() << "Inconsistent reshape in Matmul op: " << op->get_friendly_name();
auto reshapeInName = op->get_friendly_name() + suffix;
auto reshapeInPrim = cldnn::reshape(reshapeInName, inputName, CldnnTensorFromIEDims(reshapeSize));
@ -167,7 +167,7 @@ void CreateMatMulOp(Program& p, const std::shared_ptr<ngraph::op::v0::MatMul>& o
case 4: return cldnn::tensor(cldnn::batch(dims[0]), cldnn::feature(dims[1]), cldnn::spatial(dims[3], dims[2]));
case 5: return cldnn::tensor(cldnn::batch(dims[0]), cldnn::feature(dims[1]), cldnn::spatial(dims[4], dims[3], dims[2]));
case 6: return cldnn::tensor(cldnn::batch(dims[0]), cldnn::feature(dims[1]), cldnn::spatial(dims[5], dims[4], dims[3], dims[2]));
default: THROW_IE_EXCEPTION << "Invalid dimensions size(" << dims.size() << ") for Gemm layer";
default: IE_THROW() << "Invalid dimensions size(" << dims.size() << ") for Gemm layer";
}
};

View File

@ -44,7 +44,7 @@ void CreateMVNOp(Program& p, const std::shared_ptr<ngraph::op::v6::MVN>& op) {
auto inConst = std::dynamic_pointer_cast<ngraph::op::Constant>(op->get_input_node_shared_ptr(1));
if (!inConst)
THROW_IE_EXCEPTION << "Unsupported parameter nodes type in " << op->get_friendly_name() << " (" << op->get_type_name() << ")";
IE_THROW() << "Unsupported parameter nodes type in " << op->get_friendly_name() << " (" << op->get_type_name() << ")";
auto& mvnShape = op->get_output_shape(0);
std::vector<int32_t> axes = inConst->cast_vector<int32_t>();

View File

@ -19,7 +19,7 @@ static bool GetCenterPointBox(ngraph::op::v5::NonMaxSuppression::BoxEncodingType
switch (encoding) {
case ::ngraph::op::v5::NonMaxSuppression::BoxEncodingType::CENTER: return true;
case ::ngraph::op::v5::NonMaxSuppression::BoxEncodingType::CORNER: return false;
default: THROW_IE_EXCEPTION << "NonMaxSuppression layer has unsupported box encoding";
default: IE_THROW() << "NonMaxSuppression layer has unsupported box encoding";
}
return false;
}
@ -101,7 +101,7 @@ void CreateNonMaxSuppressionIEInternalOp(Program& p, const std::shared_ptr<ngrap
inputPrimitives.push_back(non_max_supression_mutable_id_w_first);
}
case 1: break;
default: THROW_IE_EXCEPTION << "Incorrect number of output for layer: " << op->get_friendly_name();
default: IE_THROW() << "Incorrect number of output for layer: " << op->get_friendly_name();
}
auto nonMaxSupressionLayerName = num_output > 1 ? layer_type_name_ID(op) + ".0" : layer_type_name_ID(op);
@ -121,7 +121,7 @@ void CreateNonMaxSuppressionIEInternalOp(Program& p, const std::shared_ptr<ngrap
case 4: prim.iou_threshold = reorderedInputs[3];
case 3: prim.num_select_per_class = reorderedInputs[2];
case 2: break;
default: THROW_IE_EXCEPTION << "Incorrect number of input primitives for layer: " << op->get_friendly_name();
default: IE_THROW() << "Incorrect number of input primitives for layer: " << op->get_friendly_name();
}
switch (num_output) {

View File

@ -21,7 +21,7 @@ void CreateNormalizeL2Op(Program& p, const std::shared_ptr<ngraph::op::v0::Norma
// params
auto const_axis = std::dynamic_pointer_cast<ngraph::op::v0::Constant>(op->get_input_node_shared_ptr(1));
if (!const_axis)
THROW_IE_EXCEPTION << "Unsupported axis node type in " << op->get_friendly_name() << " (" << op->get_type_name() << ")";
IE_THROW() << "Unsupported axis node type in " << op->get_friendly_name() << " (" << op->get_type_name() << ")";
auto axis = const_axis->cast_vector<size_t>();
bool across_spatial = !(axis.size() == 1 && axis[0] == 1);
@ -41,7 +41,7 @@ void CreateNormalizeL2Op(Program& p, const std::shared_ptr<ngraph::op::v0::Norma
auto bufSize = scale->get_output_tensor(0).size();
if (bufSize != constLayout.bytes_count())
THROW_IE_EXCEPTION << "Invalid scales buffer in NormalizeL2 op " << op->get_friendly_name();
IE_THROW() << "Invalid scales buffer in NormalizeL2 op " << op->get_friendly_name();
std::memcpy(&buf[0], scale->get_data_ptr(), bufSize);
auto scalesName = layerName + "_cldnn_input_scales";

View File

@ -22,20 +22,20 @@ void CreateOneHotOp(Program& p, const std::shared_ptr<ngraph::op::v1::OneHot>& o
auto off_value_node = std::dynamic_pointer_cast<ngraph::op::v0::Constant>(op->get_input_node_shared_ptr(3));
if (on_value_node == nullptr || off_value_node == nullptr)
THROW_IE_EXCEPTION << "Unsupported on/off node type in " << op->get_friendly_name() << " (" << op->get_type_name() << ")";
IE_THROW() << "Unsupported on/off node type in " << op->get_friendly_name() << " (" << op->get_type_name() << ")";
float on_value;
float off_value;
if (!ngraph::op::util::get_single_value(on_value_node, on_value) ||
!ngraph::op::util::get_single_value(off_value_node, off_value)) {
THROW_IE_EXCEPTION << "Unsupported parameter size in " << op->get_friendly_name() << " (" << op->get_type_name() << ")";
IE_THROW() << "Unsupported parameter size in " << op->get_friendly_name() << " (" << op->get_type_name() << ")";
}
auto dims = op->get_input_shape(0);
if (axis < -1 || axis > static_cast<int16_t>(dims.size()))
THROW_IE_EXCEPTION << op->get_friendly_name() << " Incorrect OneHot axis value: " << axis << ". Should be between -1 and " << dims.size();
IE_THROW() << op->get_friendly_name() << " Incorrect OneHot axis value: " << axis << ". Should be between -1 and " << dims.size();
if (axis == -1) {
axis = dims.size();

View File

@ -18,7 +18,7 @@ static cldnn::border_type GetBorderType(ngraph::op::PadMode mode) {
case ngraph::op::PadMode::EDGE: return cldnn::border_type::edge;
case ngraph::op::PadMode::REFLECT: return cldnn::border_type::mirror_101;
case ngraph::op::PadMode::SYMMETRIC: return cldnn::border_type::mirror;
default: THROW_IE_EXCEPTION << "Invalid border mode " << mode << " in layer ";
default: IE_THROW() << "Invalid border mode " << mode << " in layer ";
}
return cldnn::border_type::constant;
}
@ -50,10 +50,10 @@ void CreatePadOp(Program& p, const std::shared_ptr<ngraph::op::v1::Pad>& op) {
if (op->get_input_size() == 4) {
auto const_node = std::dynamic_pointer_cast<ngraph::op::v0::Constant>(op->get_input_node_shared_ptr(3));
if (!const_node) {
THROW_IE_EXCEPTION << "Unsupported const node type in " << op->get_friendly_name() << " (" << op->get_type_name() << ")";
IE_THROW() << "Unsupported const node type in " << op->get_friendly_name() << " (" << op->get_type_name() << ")";
}
if (!ngraph::op::util::get_single_value(const_node, pad_value)) {
THROW_IE_EXCEPTION << "Unsupported pad value in " << op->get_friendly_name() << " (" << op->get_type_name() << ")";
IE_THROW() << "Unsupported pad value in " << op->get_friendly_name() << " (" << op->get_type_name() << ")";
}
}

View File

@ -18,7 +18,7 @@ namespace CLDNNPlugin {
void CreateParameterOp(Program& p, const std::shared_ptr<ngraph::op::v0::Parameter>& op) {
auto networkInputs = p.GetNetworkInputs();
if (networkInputs.find(op->get_friendly_name()) == networkInputs.end()) {
THROW_IE_EXCEPTION << "Can't find input " << op->get_friendly_name() << " in InputsDataMap";
IE_THROW() << "Can't find input " << op->get_friendly_name() << " in InputsDataMap";
}
auto inputInfo = networkInputs.at(op->get_friendly_name());
@ -50,7 +50,7 @@ void CreateParameterOp(Program& p, const std::shared_ptr<ngraph::op::v0::Paramet
cldnn::feature(inputDims[1]),
cldnn::spatial(inputDims[4], inputDims[3], inputDims[2]));
} else {
THROW_IE_EXCEPTION << "Unsupported layout (" << l << ") in 5D input " << inputInfo->name();
IE_THROW() << "Unsupported layout (" << l << ") in 5D input " << inputInfo->name();
}
break;
case 4:
@ -61,21 +61,21 @@ void CreateParameterOp(Program& p, const std::shared_ptr<ngraph::op::v0::Paramet
dataTensor = cldnn::tensor(batch,
TensorValue(inputDims[1]), TensorValue(inputDims[3]), TensorValue(inputDims[2]));
} else {
THROW_IE_EXCEPTION << "Unsupported layout (" << l << ") in 4D input " + inputInfo->name();
IE_THROW() << "Unsupported layout (" << l << ") in 4D input " + inputInfo->name();
}
break;
case 3:
if (Layout::CHW == l) {
dataTensor = cldnn::tensor(TensorValue(inputDims[0]), TensorValue(inputDims[1]), 1, TensorValue(inputDims[2]));
} else {
THROW_IE_EXCEPTION << "Unsupported layout (" << l << ") in 3D input " + inputInfo->name();
IE_THROW() << "Unsupported layout (" << l << ") in 3D input " + inputInfo->name();
}
break;
case 2:
if (Layout::NCHW == l || NC == l) {
dataTensor = cldnn::tensor(batch, TensorValue(inputDims[1]), 1, 1);
} else {
THROW_IE_EXCEPTION << "Unsupported layout (" << l << ") in 2D input " << inputInfo->name();
IE_THROW() << "Unsupported layout (" << l << ") in 2D input " << inputInfo->name();
}
break;
case 1:
@ -84,7 +84,7 @@ void CreateParameterOp(Program& p, const std::shared_ptr<ngraph::op::v0::Paramet
case 0:
dataTensor = cldnn::tensor(1, 1, 1, 1);
break;
default: THROW_IE_EXCEPTION << "Invalid data dimensions";
default: IE_THROW() << "Invalid data dimensions";
}
cldnn::layout networkInputLayout(DataTypeFromPrecision(ip),
inputFormat,
@ -103,7 +103,7 @@ void CreateParameterOp(Program& p, const std::shared_ptr<ngraph::op::v0::Paramet
if ((meanChannels > 0) &&
(meanChannels != networkInputLayout.size.feature[0])) {
THROW_IE_EXCEPTION << "Mismatched mean values channels in input " << inputName;
IE_THROW() << "Mismatched mean values channels in input " << inputName;
}
switch (preProcess.getMeanVariant()) {
@ -112,7 +112,7 @@ void CreateParameterOp(Program& p, const std::shared_ptr<ngraph::op::v0::Paramet
if (meanChannels > 0) {
for (size_t c = 0; c < meanChannels; c++) {
if (fabs(preProcess[c]->stdScale - 1.0f) > 1e-10)
THROW_IE_EXCEPTION << "not supporting stdScale yet in input " << inputName;
IE_THROW() << "not supporting stdScale yet in input " << inputName;
meanValues.push_back(preProcess[c]->meanValue);
}
}
@ -128,7 +128,7 @@ void CreateParameterOp(Program& p, const std::shared_ptr<ngraph::op::v0::Paramet
case 4: meanDims[0] = 1;
break;
default:
THROW_IE_EXCEPTION << "Missing batch dimensions in input image";
IE_THROW() << "Missing batch dimensions in input image";
}
const TensorDesc desc(Precision::FP32, meanDims, TensorDesc::getLayoutByDims(meanDims));
TBlob<float> meanBlob(desc);
@ -136,7 +136,7 @@ void CreateParameterOp(Program& p, const std::shared_ptr<ngraph::op::v0::Paramet
auto meanBlobData = meanBlob.data();
for (size_t c = 0; c < meanChannels; c++) {
if (fabs(preProcess[c]->stdScale - 1.0f) > 1e-10)
THROW_IE_EXCEPTION << "not supporting stdScale yet in input " << inputName;
IE_THROW() << "not supporting stdScale yet in input " << inputName;
auto channelMeanBlob = std::dynamic_pointer_cast<TBlob<float>>(preProcess[c]->meanData);
auto channelSize = channelMeanBlob->size();
auto channelBlobData = channelMeanBlob->data();
@ -170,7 +170,7 @@ void CreateParameterOp(Program& p, const std::shared_ptr<ngraph::op::v0::Paramet
}
break;
}
default: THROW_IE_EXCEPTION << "Invalid mean variant in input " << inputName;
default: IE_THROW() << "Invalid mean variant in input " << inputName;
break;
}
@ -179,7 +179,7 @@ void CreateParameterOp(Program& p, const std::shared_ptr<ngraph::op::v0::Paramet
// and then would expect compound blob in inferRequest
if (Layout::NCHW != l &&
(Precision::I8 != ip || Precision::U8 != ip)) {
THROW_IE_EXCEPTION << "Unsupported layout (" << l << ") or precision "
IE_THROW() << "Unsupported layout (" << l << ") or precision "
<< ip.name() << ") for NV12 input " + inputInfo->name();
}
int height = inputDims[2];
@ -209,7 +209,7 @@ void CreateParameterOp(Program& p, const std::shared_ptr<ngraph::op::v0::Paramet
p.AddPrimitive(cldnn::reorder(preprocessPrimID, y_name, uv_name, networkInputLayout, meanBlobID));
break;
}
default: THROW_IE_EXCEPTION << "Invalid mean variant in input " + inputName;
default: IE_THROW() << "Invalid mean variant in input " + inputName;
break;
}
@ -239,7 +239,7 @@ void CreateParameterOp(Program& p, const std::shared_ptr<ngraph::op::v0::Paramet
meanBlobID));
break;
}
default: THROW_IE_EXCEPTION << "Invalid mean variant in input " << inputName;
default: IE_THROW() << "Invalid mean variant in input " << inputName;
break;
}
p.InitProfileInfo(preprocessPrimID, "reorder");

View File

@ -25,7 +25,7 @@ static PoolingParameters GetPoolingParameters(const ngraph::Shape& kernel,
const ngraph::Shape& pads_end) {
cldnn::tensor k, s, pb, pe;
if (pads_begin.size() != strides.size() || pads_end.size() != strides.size() || kernel.size() != strides.size())
THROW_IE_EXCEPTION << "Strides, KernelSizes and Pads are supposed to have the same elements count";
IE_THROW() << "Strides, KernelSizes and Pads are supposed to have the same elements count";
std::vector<cldnn::tensor::value_type> pb_casted(pads_begin.begin(), pads_begin.end());
std::vector<cldnn::tensor::value_type> pe_casted(pads_end.begin(), pads_end.end());
@ -51,7 +51,7 @@ static PoolingParameters GetPoolingParameters(const ngraph::Shape& kernel,
pe = cldnn::tensor(cldnn::batch(0), cldnn::feature(0), cldnn::spatial(-pe_casted[0], 0, 0));
break;
}
default: THROW_IE_EXCEPTION << "Unsupported pooling parameters size. Only 1d, 2d, and 3d cases are supported";
default: IE_THROW() << "Unsupported pooling parameters size. Only 1d, 2d, and 3d cases are supported";
}
return {k, s, pb, pe};

View File

@ -30,7 +30,7 @@ void CreateReduceOp(Program& p, const std::shared_ptr<ngraph::Node>& op, cldnn::
auto axes_constant = std::dynamic_pointer_cast<ngraph::op::Constant>(op->get_input_node_shared_ptr(1));
if (!axes_constant) {
THROW_IE_EXCEPTION << "Unsupported parameter nodes type in " << op->get_friendly_name() << " (" << op->get_type_name() << ")";
IE_THROW() << "Unsupported parameter nodes type in " << op->get_friendly_name() << " (" << op->get_type_name() << ")";
}
std::vector<int32_t> rawAxes = axes_constant->cast_vector<int32_t>();
@ -39,7 +39,7 @@ void CreateReduceOp(Program& p, const std::shared_ptr<ngraph::Node>& op, cldnn::
if (rawAxes[a] < 0)
rawAxes[a] = rawAxes[a] + rank;
if (rawAxes[a] < 0 || rawAxes[a] > rank - 1)
THROW_IE_EXCEPTION << op->get_friendly_name() << " Incorrect Reduce axis value: " << rawAxes[a];
IE_THROW() << op->get_friendly_name() << " Incorrect Reduce axis value: " << rawAxes[a];
if (rank == 6) {
switch (rawAxes[a]) {
case 0: axes.push_back(cldnn::reduce::along_b); break;

View File

@ -29,7 +29,7 @@ void CreateResultOp(Program& p, const std::shared_ptr<ngraph::op::v0::Result>& o
}
auto it = networkOutputs.find(inputID);
if (it == networkOutputs.end()) {
THROW_IE_EXCEPTION << "Can't find output " << inputID << " in OutputsDataMap";
IE_THROW() << "Can't find output " << inputID << " in OutputsDataMap";
}
std::string originalOutName = it->first;
DataPtr outputData = it->second;
@ -48,7 +48,7 @@ void CreateResultOp(Program& p, const std::shared_ptr<ngraph::op::v0::Result>& o
outputlayout != NC &&
outputlayout != C &&
outputlayout != SCALAR) {
THROW_IE_EXCEPTION << "Unsupported layout (" << outputlayout << ") in output: " << originalOutName;
IE_THROW() << "Unsupported layout (" << outputlayout << ") in output: " << originalOutName;
}
auto outLayerName = layer_type_name_ID(op);

View File

@ -40,11 +40,11 @@ void GetLSTMActivationParams(const std::shared_ptr<T>& op,
auto op_activations = op->get_activations();
if (!op_activations.empty()) {
if (op_activations.size() != 3)
THROW_IE_EXCEPTION << "Wrong number of activations for LSTMCell op " << op->get_friendly_name();
IE_THROW() << "Wrong number of activations for LSTMCell op " << op->get_friendly_name();
for (int i = 0; i < 3; i++) {
auto af = GetActivationFunc(op_activations[i]);
if (af == cldnn::activation_func::none)
THROW_IE_EXCEPTION << "Wrong or unsupported activation type " << op_activations[i]
IE_THROW() << "Wrong or unsupported activation type " << op_activations[i]
<< " for LSTMCell op " << op->get_friendly_name();
activations[i] = af;
}
@ -53,7 +53,7 @@ void GetLSTMActivationParams(const std::shared_ptr<T>& op,
auto op_b = op->get_activations_beta();
if (!op_a.empty()) {
if (op_a.size() != 3 || op_b.size() != 3)
THROW_IE_EXCEPTION << "Wrong number of activation parameters for LSTMCell op " << op->get_friendly_name();
IE_THROW() << "Wrong number of activation parameters for LSTMCell op " << op->get_friendly_name();
for (int i = 0; i < 3; i++) {
cldnn::activation_additional_params params = { op_a[i], op_b[i] };
activation_params.push_back(cldnn::activation_additional_params(params));
@ -80,7 +80,7 @@ void CreateLSTMCellOp(Program& p, const std::shared_ptr<ngraph::op::v4::LSTMCell
if (in_dims0.size() != 2 ||
op->get_input_shape(1).size() != 2 ||
op->get_input_shape(2).size() != 2)
THROW_IE_EXCEPTION << "Wrong input shapes for LSTMCell op " << op->get_friendly_name();
IE_THROW() << "Wrong input shapes for LSTMCell op " << op->get_friendly_name();
lstm_input_size = in_dims0.back();
lstm_batch_size = in_dims0.at(in_dims0.size()-2);
@ -186,7 +186,7 @@ void CreateLSTMSequenceOp(Program& p, const std::shared_ptr<ngraph::op::v5::LSTM
if (in_dims0.size() != 3 ||
op->get_input_shape(1).size() != 3 ||
op->get_input_shape(2).size() != 3)
THROW_IE_EXCEPTION << "Wrong input shapes for LSTMSequence op " << op->get_friendly_name();
IE_THROW() << "Wrong input shapes for LSTMSequence op " << op->get_friendly_name();
lstm_input_size = in_dims0.back();
lstm_sequence_len = in_dims0.at(in_dims0.size() - 2);

View File

@ -16,7 +16,7 @@ static inline cldnn::scatter_elements_update::scatter_elements_update_axis GetSc
if (axis < 0)
axis += rank;
if (axis < 0 || axis >= rank)
THROW_IE_EXCEPTION << "ScatterElementsUpdate axis is not correspond to number of dimensions";
IE_THROW() << "ScatterElementsUpdate axis is not correspond to number of dimensions";
// Difference in dimension ordering between IE and clDNN,
// reverse spatial dimensions after batch and feature.
@ -35,7 +35,7 @@ static inline cldnn::scatter_elements_update::scatter_elements_update_axis GetSc
case 3: return cldnn::scatter_elements_update::scatter_elements_update_axis::along_y;
case 4: return cldnn::scatter_elements_update::scatter_elements_update_axis::along_z;
case 5: return cldnn::scatter_elements_update::scatter_elements_update_axis::along_w;
default: THROW_IE_EXCEPTION << "Unsupported ScatterElementsUpdate axis: " << axis;
default: IE_THROW() << "Unsupported ScatterElementsUpdate axis: " << axis;
}
return cldnn::scatter_elements_update::scatter_elements_update_axis::along_f; // shouldn't get here
@ -49,7 +49,7 @@ void CreateScatterElementsUpdateOp(Program& p, const std::shared_ptr<ngraph::op:
size_t rank = op->get_input_shape(0).size();
auto axes_constant = std::dynamic_pointer_cast<ngraph::op::Constant>(op->get_input_node_shared_ptr(3));
if (!axes_constant) {
THROW_IE_EXCEPTION << "Unsupported parameter nodes type in " << op->get_friendly_name() << " (" << op->get_type_name() << ")";
IE_THROW() << "Unsupported parameter nodes type in " << op->get_friendly_name() << " (" << op->get_type_name() << ")";
}
int32_t axis = axes_constant->cast_vector<int32_t>()[0];

View File

@ -16,7 +16,7 @@ static inline cldnn::scatter_update::scatter_update_axis GetScatterUpdateAxis(in
if (axis < 0)
axis += rank;
if (axis < 0 || axis >= rank)
THROW_IE_EXCEPTION << "ScatterUpdate axis is not correspond to number of dimensions";
IE_THROW() << "ScatterUpdate axis is not correspond to number of dimensions";
// Difference in dimension ordering between IE and clDNN,
// reverse spatial dimensions after batch and feature.
@ -35,7 +35,7 @@ static inline cldnn::scatter_update::scatter_update_axis GetScatterUpdateAxis(in
case 3: return cldnn::scatter_update::scatter_update_axis::along_y;
case 4: return cldnn::scatter_update::scatter_update_axis::along_z;
case 5: return cldnn::scatter_update::scatter_update_axis::along_w;
default: THROW_IE_EXCEPTION << "Unsupported ScatterUpdate axis: " << axis;
default: IE_THROW() << "Unsupported ScatterUpdate axis: " << axis;
}
return cldnn::scatter_update::scatter_update_axis::along_f; // shouldn't get here
@ -49,7 +49,7 @@ void CreateScatterUpdateOp(Program& p, const std::shared_ptr<ngraph::op::v3::Sca
size_t rank = op->get_input_shape(0).size();
auto axes_constant = std::dynamic_pointer_cast<ngraph::op::Constant>(op->get_input_node_shared_ptr(3));
if (!axes_constant) {
THROW_IE_EXCEPTION << "Unsupported parameter nodes type in " << op->get_friendly_name() << " (" << op->get_type_name() << ")";
IE_THROW() << "Unsupported parameter nodes type in " << op->get_friendly_name() << " (" << op->get_type_name() << ")";
}
int32_t axis = axes_constant->cast_vector<int32_t>()[0];

View File

@ -25,7 +25,7 @@ void CreateSelectOp(Program& p, const std::shared_ptr<ngraph::op::v1::Select>& o
if (broadcast_type.m_type != ngraph::op::AutoBroadcastType::NONE &&
broadcast_type.m_type != ngraph::op::AutoBroadcastType::NUMPY) {
THROW_IE_EXCEPTION << "Unsupported broadcast type (" << broadcast_type.m_type << ") in layer " + op->get_friendly_name();
IE_THROW() << "Unsupported broadcast type (" << broadcast_type.m_type << ") in layer " + op->get_friendly_name();
}
if (broadcast_type.m_type == ngraph::op::AutoBroadcastType::NUMPY) {

View File

@ -25,13 +25,13 @@ void CreateShuffleChannelsOp(Program& p, const std::shared_ptr<ngraph::op::v0::S
axis += in_rank;
if (axis < 0 || axis >= in_rank)
THROW_IE_EXCEPTION << "Incorrect axis value! Actual axis is" + std::to_string(group);
IE_THROW() << "Incorrect axis value! Actual axis is" + std::to_string(group);
if (group < 1)
THROW_IE_EXCEPTION << "Invalid group size value (should equal at least one). Actual block size is" << std::to_string(group);
IE_THROW() << "Invalid group size value (should equal at least one). Actual block size is" << std::to_string(group);
if (op->get_input_shape(0)[axis] % group != 0)
THROW_IE_EXCEPTION << "Group parameter must evenly divide the channel dimension. Actual group size is " << std::to_string(axis);
IE_THROW() << "Group parameter must evenly divide the channel dimension. Actual group size is " << std::to_string(axis);
auto shuffleChannelsPrim = cldnn::shuffle_channels(layerName,
inputPrimitives[0],

View File

@ -30,7 +30,7 @@ static cldnn::softmax::dimension_t GetSoftmaxAxis(int64_t axis, size_t rank) {
return cldnn::softmax::normalize_x;
case 4:
return cldnn::softmax::normalize_x;
default: THROW_IE_EXCEPTION << "Invalid softmax axis " << axis;
default: IE_THROW() << "Invalid softmax axis " << axis;
}
return cldnn::softmax::normalize_fyx;
}

View File

@ -26,7 +26,7 @@ void CreateSpaceToBatchOp(Program& p, const std::shared_ptr<ngraph::op::v1::Spac
for (size_t i = 1; i < 4; ++i) {
auto inConst = std::dynamic_pointer_cast<ngraph::op::Constant>(op->get_input_node_shared_ptr(i));
if (!inConst)
THROW_IE_EXCEPTION << "Unsupported parameter nodes type in " << op->get_friendly_name() << " (" << op->get_type_name() << ")";
IE_THROW() << "Unsupported parameter nodes type in " << op->get_friendly_name() << " (" << op->get_type_name() << ")";
std::vector<int32_t> sizes = inConst->cast_vector<int32_t>();
int32_t default_size = i == 1 ? 1 : 0;

View File

@ -15,7 +15,7 @@ static cldnn::space_to_depth::depth_mode GetDepthMode(ngraph::op::v0::SpaceToDep
switch (mode) {
case ngraph::op::v0::SpaceToDepth::SpaceToDepthMode::BLOCKS_FIRST: return cldnn::space_to_depth::blocks_first;
case ngraph::op::v0::SpaceToDepth::SpaceToDepthMode::DEPTH_FIRST: return cldnn::space_to_depth::depth_first;
default: THROW_IE_EXCEPTION << "Unsupported SpaceToDepthMode value: " << static_cast<int>(mode);
default: IE_THROW() << "Unsupported SpaceToDepthMode value: " << static_cast<int>(mode);
}
return cldnn::space_to_depth::blocks_first;
}

View File

@ -26,12 +26,12 @@ void CreateCommonSplitOp(Program& p, const std::shared_ptr<ngraph::Node>& op) {
const auto outLayerDims = op->get_output_shape(i);
NGRAPH_SUPPRESS_DEPRECATED_START
if (outLayerDims.size() != startOffset.size()) {
THROW_IE_EXCEPTION << "Invalid dimesions in split layer: " << op->get_friendly_name()
IE_THROW() << "Invalid dimesions in split layer: " << op->get_friendly_name()
<< " output: " << op->get_output_tensor_name(i);
}
for (size_t i = 0; i < inputDims.size(); i++) {
if ((outLayerDims[i] + startOffset[i]) > inputDims[i]) {
THROW_IE_EXCEPTION << "Invalid dimesions in split layer: " << op->get_friendly_name()
IE_THROW() << "Invalid dimesions in split layer: " << op->get_friendly_name()
<< " output: " << op->get_output_tensor_name(i);
}
}

View File

@ -200,7 +200,7 @@ void CreateStridedSliceOp(Program& p, const std::shared_ptr<ngraph::op::v1::Stri
std::vector<cldnn::tensor::value_type> offset_tensor{ 0, 0, 0, 0 };
for (size_t i = 0; i < axes.size(); i++) {
if (axes[i] < 0 || axes[i] > 3) {
THROW_IE_EXCEPTION << "Invalid crop axis: " << std::to_string(axes[i]) << " in op " + op->get_friendly_name();
IE_THROW() << "Invalid crop axis: " << std::to_string(axes[i]) << " in op " + op->get_friendly_name();
}
offset_tensor[axes[i]] = offset[i];
}

View File

@ -114,7 +114,7 @@ void CreateTopKOp(Program& p, const std::shared_ptr<ngraph::op::v1::TopK>& op) {
p.AddPrimitive(argmaxPrim);
p.AddPrimitiveToProfiler(op);
} else {
THROW_IE_EXCEPTION << op->get_friendly_name() << " Incorrect TopK outputs number";
IE_THROW() << op->get_friendly_name() << " Incorrect TopK outputs number";
}
}

View File

@ -21,7 +21,7 @@ void CreateTransposeOp(Program& p, const std::shared_ptr<ngraph::op::v1::Transpo
if (op->get_input_size() == 2) {
auto order_constant = std::dynamic_pointer_cast<ngraph::op::Constant>(op->get_input_node_shared_ptr(1));
if (!order_constant) {
THROW_IE_EXCEPTION << "Unsupported parameter nodes type in " << op->get_friendly_name() << " (" << op->get_type_name() << ")";
IE_THROW() << "Unsupported parameter nodes type in " << op->get_friendly_name() << " (" << op->get_type_name() << ")";
}
ie_order = order_constant->cast_vector<uint16_t>();
}

View File

@ -81,7 +81,7 @@ void CreatePReluOp(Program& p, const std::shared_ptr<ngraph::op::v0::PRelu>& op)
if (slope_node && ngraph::shape_size(slope_shape) == 1) {
float slope;
if (!ngraph::op::util::get_single_value(slope_node, slope))
THROW_IE_EXCEPTION << "Unsupported parameter size in " << op->get_friendly_name() << " (" << op->get_type_name() << ")";
IE_THROW() << "Unsupported parameter size in " << op->get_friendly_name() << " (" << op->get_type_name() << ")";
CreateUnaryEltwiseOp(p, op, cldnn::activation_func::relu_negative_slope, {slope});
} else if (out_shape.size() >= 2 && ngraph::shape_size(slope_shape) == out_shape[1]) {
auto inputs = p.GetInputPrimitiveIDs(op);
@ -155,14 +155,14 @@ void CreateHardSigmoidOp(Program& p, const std::shared_ptr<ngraph::op::v0::HardS
auto alpha_node = std::dynamic_pointer_cast<ngraph::op::v0::Constant>(op->get_input_node_shared_ptr(1));
auto beta_node = std::dynamic_pointer_cast<ngraph::op::v0::Constant>(op->get_input_node_shared_ptr(2));
if (!alpha_node || !beta_node) {
THROW_IE_EXCEPTION << "Unsupported parameter nodes type in " << op->get_friendly_name() << " (" << op->get_type_name() << ")";
IE_THROW() << "Unsupported parameter nodes type in " << op->get_friendly_name() << " (" << op->get_type_name() << ")";
}
if (ngraph::shape_size(alpha_node->get_output_shape(0)) == 1 &&
ngraph::shape_size(beta_node->get_output_shape(0)) == 1) {
float alpha, beta;
if (!ngraph::op::util::get_single_value(alpha_node, alpha) || !ngraph::op::util::get_single_value(beta_node, beta)) {
THROW_IE_EXCEPTION << "Unsupported parameter size in " << op->get_friendly_name() << " (" << op->get_type_name() << ")";
IE_THROW() << "Unsupported parameter size in " << op->get_friendly_name() << " (" << op->get_type_name() << ")";
}
CreateUnaryEltwiseOp(p, op, cldnn::activation_func::hard_sigmoid, {alpha, beta});
}
@ -181,18 +181,18 @@ void CreateSeluOp(Program& p, const std::shared_ptr<ngraph::op::v0::Selu>& op) {
auto alpha_node = std::dynamic_pointer_cast<ngraph::op::v0::Constant>(op->get_input_node_shared_ptr(1));
auto lambda_node = std::dynamic_pointer_cast<ngraph::op::v0::Constant>(op->get_input_node_shared_ptr(2));
if (!alpha_node || !lambda_node) {
THROW_IE_EXCEPTION << "Unsupported parameter nodes type in " << op->get_friendly_name() << " (" << op->get_type_name() << ")";
IE_THROW() << "Unsupported parameter nodes type in " << op->get_friendly_name() << " (" << op->get_type_name() << ")";
}
if (ngraph::shape_size(alpha_node->get_output_shape(0)) == 1 &&
ngraph::shape_size(lambda_node->get_output_shape(0)) == 1) {
float alpha, lambda;
if (!ngraph::op::util::get_single_value(alpha_node, alpha) || !ngraph::op::util::get_single_value(lambda_node, lambda)) {
THROW_IE_EXCEPTION << "Unsupported parameter size in " << op->get_friendly_name() << " (" << op->get_type_name() << ")";
IE_THROW() << "Unsupported parameter size in " << op->get_friendly_name() << " (" << op->get_type_name() << ")";
}
CreateUnaryEltwiseOp(p, op, cldnn::activation_func::selu, {alpha, lambda});
} else {
THROW_IE_EXCEPTION << "Unsupported shapes of parameter nodes in " << op->get_friendly_name() << " (" << op->get_type_name() << ")";
IE_THROW() << "Unsupported shapes of parameter nodes in " << op->get_friendly_name() << " (" << op->get_type_name() << ")";
}
}
@ -228,14 +228,14 @@ void CreateSwishOp(Program& p, const std::shared_ptr<ngraph::op::v4::Swish>& op)
if (ngraph::shape_size(beta_node->get_output_shape(0)) == 1) {
float beta;
if (!ngraph::op::util::get_single_value(beta_node, beta)) {
THROW_IE_EXCEPTION << "Unsupported parameter size in " << op->get_friendly_name() << " (" << op->get_type_name() << ")";
IE_THROW() << "Unsupported parameter size in " << op->get_friendly_name() << " (" << op->get_type_name() << ")";
}
CreateUnaryEltwiseOp(p, op, cldnn::activation_func::swish, {beta});
} else {
THROW_IE_EXCEPTION << "Unsupported parameter size in " << op->get_friendly_name() << " (" << op->get_type_name() << ")";
IE_THROW() << "Unsupported parameter size in " << op->get_friendly_name() << " (" << op->get_type_name() << ")";
}
} else {
THROW_IE_EXCEPTION << "Unsupported parameter type in " << op->get_friendly_name() << " (" << op->get_type_name() << ")";
IE_THROW() << "Unsupported parameter type in " << op->get_friendly_name() << " (" << op->get_type_name() << ")";
}
} else {
CreateUnaryEltwiseOp(p, op, cldnn::activation_func::swish, {1.0f});
@ -267,7 +267,7 @@ void CreateRoundOp(Program& p, const std::shared_ptr<ngraph::op::v5::Round>& op)
switch (op->get_mode()) {
case ngraph::op::v5::Round::RoundMode::HALF_TO_EVEN : func = cldnn::activation_func::round_half_to_even; break;
case ngraph::op::v5::Round::RoundMode::HALF_AWAY_FROM_ZERO : func = cldnn::activation_func::round_half_away_from_zero; break;
default: THROW_IE_EXCEPTION << "Unsupported round mode in " << op->get_friendly_name() << ": " << static_cast<int>(op->get_mode());
default: IE_THROW() << "Unsupported round mode in " << op->get_friendly_name() << ": " << static_cast<int>(op->get_mode());
}
CreateUnaryEltwiseOp(p, op, func, {});
}

View File

@ -269,7 +269,7 @@ inline void quantizeWeightsBiases(const QuantDesc & quantDesc,
make_custom_blob<typename QuantDesc::WeightsPrecision>(InferenceEngine::C, InferenceEngine::SizeVector({wl->_weights->size()}));
intWeights->allocate();
if (intWeights->buffer() == nullptr) {
THROW_IE_EXCEPTION_WITH_STATUS(NotAllocated)
IE_THROW(NotAllocated)
<< "[GNAPlugin] in function " << __PRETTY_FUNCTION__<< ": "
<< "cannot copy weights for layer :"<< wl->name << " of size" << intWeights->byteSize();
}
@ -297,7 +297,7 @@ inline void quantizeWeightsBiases(const QuantDesc & quantDesc,
}));
bias->allocate();
if (bias->buffer() == nullptr) {
THROW_IE_EXCEPTION_WITH_STATUS(NotAllocated)
IE_THROW(NotAllocated)
<< "[GNAPlugin] in function " << __PRETTY_FUNCTION__<< ": "
<< "cannot copy bias for layer :"<< wl->name <<"of size" << bias->byteSize();
}
@ -315,14 +315,14 @@ inline void quantizeWeightsBiases(const QuantDesc & quantDesc,
input_scale_factor = quantDataForInputLayer->_dst_quant.GetScale();
if (std::isnan(input_scale_factor) ||
std::isinf(input_scale_factor)) {
THROW_IE_EXCEPTION << "Unsupported input scale factor value " << input_scale_factor;
IE_THROW() << "Unsupported input scale factor value " << input_scale_factor;
}
}
if (wl->outData[0]->getDims().size() < 2) {
THROW_IE_EXCEPTION << "Unsupported output dims size for " << wl->name <<", should be > 1, but " << wl->outData[0]->getDims().size();
IE_THROW() << "Unsupported output dims size for " << wl->name <<", should be > 1, but " << wl->outData[0]->getDims().size();
}
if (wl->insData[0].lock().get()->getDims().size() < 2) {
THROW_IE_EXCEPTION << "Unsupported input dims size for " << wl->name << ", should be > 1, but " << wl->insData[0].lock().get()->getDims().size();
IE_THROW() << "Unsupported input dims size for " << wl->name << ", should be > 1, but " << wl->insData[0].lock().get()->getDims().size();
}
uint32_t num_rows = isDiagonal ? 1 : wl->outData[0]->getDims()[oIdx];
uint32_t num_columns = isDiagonal ? wl->_weights->size() : wl->insData[0].lock().get()->getDims()[iIdx];
@ -388,7 +388,7 @@ inline void quantizeWeightsBiasesConv(const QuantDesc & quantDesc,
auto intWeights = make_custom_blob<typename QuantDesc::WeightsPrecision>(InferenceEngine::C, InferenceEngine::SizeVector({conv->_weights->size()}));
intWeights->allocate();
if (intWeights->buffer() == nullptr) {
THROW_IE_EXCEPTION_WITH_STATUS(NotAllocated)
IE_THROW(NotAllocated)
<< "[GNAPlugin] in function " << __PRETTY_FUNCTION__<< ": "
<< "cannot copy weights for layer :"<< conv->name << " of size" << intWeights->byteSize();
}
@ -413,7 +413,7 @@ inline void quantizeWeightsBiasesConv(const QuantDesc & quantDesc,
}));
bias->allocate();
if (bias->buffer() == nullptr) {
THROW_IE_EXCEPTION_WITH_STATUS(NotAllocated)
IE_THROW(NotAllocated)
<< "[GNAPlugin] in function " << __PRETTY_FUNCTION__<< ": "
<< "cannot copy bias for layer :"<< conv->name <<"of size" << bias->byteSize();
}
@ -430,14 +430,14 @@ inline void quantizeWeightsBiasesConv(const QuantDesc & quantDesc,
input_scale_factor = quantDataForInputLayer->_dst_quant.GetScale();
if (std::isnan(input_scale_factor) ||
std::isinf(input_scale_factor)) {
THROW_IE_EXCEPTION << "Unsupported input scale factor value " << input_scale_factor;
IE_THROW() << "Unsupported input scale factor value " << input_scale_factor;
}
}
if (conv->outData[0]->getDims().size() < 2) {
THROW_IE_EXCEPTION << "Unsupported output dims size for " << conv->name <<", should be > 1, but " << conv->outData[0]->getDims().size();
IE_THROW() << "Unsupported output dims size for " << conv->name <<", should be > 1, but " << conv->outData[0]->getDims().size();
}
if (conv->insData[0].lock().get()->getDims().size() < 2) {
THROW_IE_EXCEPTION << "Unsupported input dims size for " << conv->name << ", should be > 1, but " << conv->insData[0].lock().get()->getDims().size();
IE_THROW() << "Unsupported input dims size for " << conv->name << ", should be > 1, but " << conv->insData[0].lock().get()->getDims().size();
}
auto inputData = conv->insData[0].lock();

View File

@ -336,7 +336,7 @@ void QuantizationCallback<int8_t, gna_compound_bias_t>::runFakeQuantize() const
template<>
void QuantizationCallback<int8_t, gna_compound_bias_t>::runQuantize() const {
if (ptr_int_biases == nullptr) {
THROW_IE_EXCEPTION << "Int biases are empty";
IE_THROW() << "Int biases are empty";
}
uint32_t num_saturate = 0;

View File

@ -254,7 +254,7 @@ class ScaleFactorPerLayer<InferenceEngine::CNNLayer *> {
} else if (layer.isPower()) {
auto powerLayer = dynamic_cast<InferenceEngine::PowerLayer const*>(cnnLayer);
if (!powerLayer) {
THROW_IE_EXCEPTION << "Incorrect Power Layer pointer \n";
IE_THROW() << "Incorrect Power Layer pointer \n";
}
auto input_min_value = static_cast<double>(std::numeric_limits<int32_t>::min());
@ -413,7 +413,7 @@ class ScaleFactorPerLayer<InferenceEngine::CNNLayer *> {
public :
bool operator()(InferenceEngine::CNNLayer *cnnLayer, int weightsSize, ScaleFactorUpdateResult &result, const bool fakeQuantize) {
if ( !cnnLayer ) {
THROW_IE_EXCEPTION << "Incorrect Convolutional Layer pointer \n";
IE_THROW() << "Incorrect Convolutional Layer pointer \n";
}
LayerInfo layerInfo(*cnnLayer);
// TODO: current approach set input scale factor for true input layer(s) equals to provided factor,
@ -573,7 +573,7 @@ class ScaleFactorPerLayer<InferenceEngine::CNNLayer *> {
auto quant = InferenceEngine::getInjectedData<QuantizedLayerParams>(*cnnLayer);
auto powerLayer = dynamic_cast<InferenceEngine::PowerLayer const*>(cnnLayer);
if (!powerLayer) {
THROW_IE_EXCEPTION << "Incorrect Power Layer pointer \n";
IE_THROW() << "Incorrect Power Layer pointer \n";
}
auto powerScale = std::abs(powerLayer->scale);

View File

@ -81,11 +81,11 @@ class GNAExecutableNetwork : public InferenceEngine::ExecutableNetworkThreadSafe
void SetConfig(const std::map<std::string, InferenceEngine::Parameter>& config) override {
using namespace InferenceEngine::GNAConfigParams;
if (config.empty()) {
THROW_IE_EXCEPTION << "The list of configuration values is empty";
IE_THROW() << "The list of configuration values is empty";
}
for (auto&& item : config) {
if (item.first != KEY_GNA_DEVICE_MODE) {
THROW_IE_EXCEPTION << "The following config value cannot be changed dynamically for ExecutableNetwork in the GNA plugin: "
IE_THROW() << "The following config value cannot be changed dynamically for ExecutableNetwork in the GNA plugin: "
<< item.first << ". Only " << KEY_GNA_DEVICE_MODE << " is supported.";
}
}
@ -93,12 +93,12 @@ class GNAExecutableNetwork : public InferenceEngine::ExecutableNetworkThreadSafe
InferenceEngine::Parameter old_mode_parameter = GetConfig(KEY_GNA_DEVICE_MODE);
auto old_mode = old_mode_parameter.as<std::string>();
if (old_mode == InferenceEngine::GNAConfigParams::GNA_SW_FP32) {
THROW_IE_EXCEPTION << "Dynamic switching from GNA_SW_FP32 mode is not supported for ExecutableNetwork.";
IE_THROW() << "Dynamic switching from GNA_SW_FP32 mode is not supported for ExecutableNetwork.";
}
auto new_mode = config.begin()->second.as<std::string>();
if (new_mode == InferenceEngine::GNAConfigParams::GNA_SW_FP32) {
THROW_IE_EXCEPTION << "Dynamic switching to GNA_SW_FP32 mode is not supported for ExecutableNetwork.";
IE_THROW() << "Dynamic switching to GNA_SW_FP32 mode is not supported for ExecutableNetwork.";
}
std::map<std::string, std::string> configForPlugin;

View File

@ -691,7 +691,7 @@ void GNAGraphCompiler::PowerPrimitive(InferenceEngine::CNNLayerPtr layer) {
IE_ASSERT(gnaFlags->sw_fp32 ? (quantized == nullptr) : (quantized != nullptr));
if (power.power < 0.0f || power.power > 2.8f) {
THROW_IE_EXCEPTION << "[GNA plugin] unsupported power factor, expected be in <0, 2.8> range but was " << power.power;
IE_THROW() << "[GNA plugin] unsupported power factor, expected be in <0, 2.8> range but was " << power.power;
}
auto input = layer->insData[0].lock();
@ -1353,7 +1353,7 @@ void GNAGraphCompiler::AffinePrimitive(InferenceEngine::CNNLayerPtr layer, bool
// direct order is 0, 1, 2, 3, supported order is only 0,3,2,1 where dim 2 is usually equals to 1
auto permuteOrder = connectionInfo.permute->GetParamAsInts("order");
if (permuteOrder != vector<int>({ 0, 3, 2, 1 })) {
THROW_IE_EXCEPTION << "[GNA plugin] Unsupported permute order: was " << layer->GetParamAsString("order") <<
IE_THROW() << "[GNA plugin] Unsupported permute order: was " << layer->GetParamAsString("order") <<
", but only support 0, 3, 2, 1";
}
@ -1361,7 +1361,7 @@ void GNAGraphCompiler::AffinePrimitive(InferenceEngine::CNNLayerPtr layer, bool
* TODO: weights transpose happened after quantisation might result in poor quality for in 8 - move this to passes
*/
if (weightable._weights->getTensorDesc().getPrecision() == Precision::I8) {
THROW_IE_EXCEPTION << "[GNA plugin] Unsupported permute operation for 8 bit weights for layer: " << layer->name;
IE_THROW() << "[GNA plugin] Unsupported permute operation for 8 bit weights for layer: " << layer->name;
}
// this affine connected to convolution via pool or activation

View File

@ -69,7 +69,7 @@ inline InferenceEngine::CNNLayerPtr CNNNetPrevLayer(const InferenceEngine::CNNL
IE_ASSERT(prevData != nullptr);
return getCreatorLayer(prevData).lock();
} else {
THROW_IE_EXCEPTION << "Layer " << layer->name << " has no previous layer";
IE_THROW() << "Layer " << layer->name << " has no previous layer";
}
}
@ -84,7 +84,7 @@ inline InferenceEngine::CNNLayerPtr CNNNetPrevLayer(const InferenceEngine::CNNL
auto prevData = layer->insData[idx].lock();
return getCreatorLayer(prevData).lock();
} else {
THROW_IE_EXCEPTION << "Layer " << layer->name << " has no previous layer";
IE_THROW() << "Layer " << layer->name << " has no previous layer";
}
}
@ -301,16 +301,16 @@ inline std::pair<DataPtr, std::map<std::string, CNNLayerPtr>::iterator> CNNLayer
inline void CNNNetSwapLayers(InferenceEngine::CNNLayerPtr lhs,
InferenceEngine::CNNLayerPtr rhs) {
if (lhs == nullptr || rhs ==nullptr) {
THROW_IE_EXCEPTION << "CNNNetSwapLayers : nullptr";
IE_THROW() << "CNNNetSwapLayers : nullptr";
}
if (lhs.get() == rhs.get())
return;
if (lhs->outData.size() > 1) {
THROW_IE_EXCEPTION << "Unsupported layer for swap operation : " << lhs->name;
IE_THROW() << "Unsupported layer for swap operation : " << lhs->name;
}
if (rhs->outData.size() > 1) {
THROW_IE_EXCEPTION << "Unsupported layer for swap operation : " << rhs->name;
IE_THROW() << "Unsupported layer for swap operation : " << rhs->name;
}
auto &rhs_outputs = getInputTo(rhs->outData.front());
@ -513,7 +513,7 @@ inline void CNNNetworkInsertLayer(CNNLayerPtr after,
size_t outDataIndex = invalid_data_idx,
size_t inDataIndex = invalid_data_idx) {
if (after == nullptr && before == nullptr) {
THROW_IE_EXCEPTION << "Cannot Insert Layer: before or after layers should be valid layer pointers";
IE_THROW() << "Cannot Insert Layer: before or after layers should be valid layer pointers";
}
bool bLocated = false;
@ -624,7 +624,7 @@ inline void CNNNetworkInsertLayer(CNNLayerPtr after,
}
}
if (!bLocated) {
THROW_IE_EXCEPTION << "Cannot insert layer between: " <<
IE_THROW() << "Cannot insert layer between: " <<
((after == nullptr) ? std::string("nullptr") : after->name) << " and " <<
((before == nullptr) ? std::string("nullptr") : before->name);
}
@ -659,24 +659,24 @@ std::vector<std::pair<CNNLayerPtr, int> > CNNNetGetPrevLayersSkip(CNNLayerPtr or
*/
inline void CNNNetworkRemoveLayer(CNNLayerPtr layer, bool checkDims = true) {
if (!layer) {
THROW_IE_EXCEPTION << "Cannot remove layer pointed to NULL";
IE_THROW() << "Cannot remove layer pointed to NULL";
}
gnalog() << "Removing " << layer->name << " layer\n";
if (layer->insData.size() != 1) {
THROW_IE_EXCEPTION << "Cannot remove layer : "<< layer->name <<" that has different number of inputs than 1";
IE_THROW() << "Cannot remove layer : "<< layer->name <<" that has different number of inputs than 1";
}
if (layer->outData.size() != 1) {
THROW_IE_EXCEPTION << "Cannot remove layer : "<< layer->name <<" that has different number of outputs than 1";
IE_THROW() << "Cannot remove layer : "<< layer->name <<" that has different number of outputs than 1";
}
auto isp = layer->insData.front().lock();
if (!isp) {
THROW_IE_EXCEPTION << "Cannot remove layer : "<< layer->name <<" cannot get it's input";
IE_THROW() << "Cannot remove layer : "<< layer->name <<" cannot get it's input";
}
// if dimensions of input layer not equal target dimensions - shape infer or reshape layer required, so skipping those cases
auto osp = layer->outData.front();
if (checkDims && isp->getDims() != osp->getDims()) {
THROW_IE_EXCEPTION << "Cannot remove layer : "<< layer->name <<" its input layer("
IE_THROW() << "Cannot remove layer : "<< layer->name <<" its input layer("
<< isp->getName() << ") and output(" << osp->getName() << ") have incompatible dimensions";
}
@ -693,12 +693,12 @@ inline void CNNNetworkRemoveLayer(CNNLayerPtr layer, bool checkDims = true) {
for (int i = 0; i < outData.second->insData.size(); i++) {
auto insData = outData.second->insData[i].lock();
if (!insData) {
THROW_IE_EXCEPTION << "Cannot remove layer : "<< layer->name <<", its output layer(" <<
IE_THROW() << "Cannot remove layer : "<< layer->name <<", its output layer(" <<
outData.first << " has invalid input configuration";
}
auto creator = getCreatorLayer(insData).lock();
if (!creator) {
THROW_IE_EXCEPTION << "Cannot remove layer : "<< layer->name <<", its output layer(" <<
IE_THROW() << "Cannot remove layer : "<< layer->name <<", its output layer(" <<
outData.first << " has invalid input configuration";
}
@ -732,26 +732,26 @@ inline void CNNNetworkReconnectLayer(CNNLayerPtr old_prev_layer, CNNLayerPtr new
gnalog() << "Reconnecting " << old_prev_layer->name << " --> " << layer->name << " layer to "
<< new_prev_layer->name << " -- > " << layer->name << "layer\n";
if (!layer) {
THROW_IE_EXCEPTION << "Cannot reconnect layer pointed to NULL";
IE_THROW() << "Cannot reconnect layer pointed to NULL";
}
if (!old_prev_layer) {
THROW_IE_EXCEPTION << "Cannot reconnect layer old parent is NULL";
IE_THROW() << "Cannot reconnect layer old parent is NULL";
}
if (!new_prev_layer) {
THROW_IE_EXCEPTION << "Cannot reconnect layer new parent is NULL";
IE_THROW() << "Cannot reconnect layer new parent is NULL";
}
if (layer->insData.size() < 1) {
THROW_IE_EXCEPTION << "Cannot reconnect layer : " << layer->name
IE_THROW() << "Cannot reconnect layer : " << layer->name
<< " operation supports only layers with at least 1 incomming port";
}
if (old_prev_layer->outData.size() != 1) {
THROW_IE_EXCEPTION << "Cannot reconnect layer : " << old_prev_layer->name << " must have exactly 1 outgoing port";
IE_THROW() << "Cannot reconnect layer : " << old_prev_layer->name << " must have exactly 1 outgoing port";
}
if (new_prev_layer->outData.size() != 1) {
THROW_IE_EXCEPTION << "Cannot reconnect layer : " << new_prev_layer->name << " must have exactly 1 outgoing port";
IE_THROW() << "Cannot reconnect layer : " << new_prev_layer->name << " must have exactly 1 outgoing port";
}
// layer has ports
// each port has several layers connected to port
@ -760,7 +760,7 @@ inline void CNNNetworkReconnectLayer(CNNLayerPtr old_prev_layer, CNNLayerPtr new
auto new_prev_layer_out_port_0 = new_prev_layer->outData.front();
if (checkDims && old_prev_layer_out_port_0->getDims() != new_prev_layer_out_port_0->getDims()) {
THROW_IE_EXCEPTION << "Cannot reconnect layer : " << old_prev_layer->name << " as its output have different dims than"
IE_THROW() << "Cannot reconnect layer : " << old_prev_layer->name << " as its output have different dims than"
<< new_prev_layer->name;
}

View File

@ -90,7 +90,7 @@ class GNAInferRequest : public InferenceEngine::AsyncInferRequestInternal {
if (inferRequestIdx == -1) {
return InferenceEngine::INFER_NOT_STARTED;
} else if (millis_timeout < -1) {
THROW_IE_EXCEPTION_WITH_STATUS(ParameterMismatch);
IE_THROW(ParameterMismatch);
}
if (millis_timeout == InferenceEngine::IInferRequest::WaitMode::RESULT_READY) {

View File

@ -1109,7 +1109,7 @@ uint32_t GNAPlugin::QueueInference(const InferenceEngine::BlobMap &inputs, Infer
Wait(0);
freeNnet = nnets.begin();
} else {
THROW_IE_EXCEPTION_WITH_STATUS(RequestBusy)
IE_THROW(RequestBusy)
<< "GNA executable network has max of "
<< static_cast<uint32_t >(gnaFlags->gna_lib_async_threads_num)
<< " parallel infer requests, please sync one of already running";
@ -1590,7 +1590,7 @@ InferenceEngine::QueryNetworkResult GNAPlugin::QueryNetwork(const InferenceEngin
InferenceEngine::QueryNetworkResult res;
if (network.getFunction()) {
THROW_IE_EXCEPTION_WITH_STATUS(NotImplemented) << " ngraph::Function is not supported natively";
IE_THROW(NotImplemented) << " ngraph::Function is not supported natively";
}
std::unordered_set<CNNLayer *> allLayers;

View File

@ -211,7 +211,7 @@ void Config::UpdateFromMap(const std::map<std::string, std::string>& config) {
THROW_GNA_EXCEPTION << "EXCLUSIVE_ASYNC_REQUESTS should be YES/NO, but not" << value;
}
} else {
THROW_IE_EXCEPTION_WITH_STATUS(NotFound)
IE_THROW(NotFound)
<< "[GNAPlugin] in function " << __PRETTY_FUNCTION__<< ": "
<< "Incorrect GNA Plugin config. Key " << item.first << " not supported";
}

View File

@ -70,7 +70,7 @@ inline GnaLog & gnawarn() {
if (!(expr)) { \
THROW_GNA_LAYER_EXCEPTION(layer) << ": " << #expr; \
}
#define THROW_GNA_EXCEPTION THROW_IE_EXCEPTION << "[GNAPlugin] in function " << __PRETTY_FUNCTION__<< ": "
#define THROW_GNA_EXCEPTION IE_THROW() << "[GNAPlugin] in function " << __PRETTY_FUNCTION__<< ": "
#define THROW_GNA_LAYER_EXCEPTION(layer) THROW_GNA_EXCEPTION << LAYER_NAME(layer)
#define LAYER_NAME(layer) (layer)->type << " layer : \"" << (layer)->name << "\" "

View File

@ -1340,7 +1340,7 @@ static InferenceEngine::Blob::Ptr tileBlob(Blob::Ptr& blob, size_t TileTo) {
auto weightsElements = blob->size();
auto weightsBytes = blob->byteSize();
if (weightsElements == 0) {
THROW_IE_EXCEPTION << "Blob size is 0";
IE_THROW() << "Blob size is 0";
}
auto tiledBlob = make_plain_blob(blob->getTensorDesc().getPrecision(), { TileTo });

View File

@ -83,7 +83,7 @@ HeteroExecutableNetwork::HeteroExecutableNetwork(const InferenceEngine::CNNNetwo
if (it != _config.end()) {
queryNetworkResult = _heteroPlugin->QueryNetwork(network, _config);
} else {
THROW_IE_EXCEPTION << "The 'TARGET_FALLBACK' option was not defined for heterogeneous plugin";
IE_THROW() << "The 'TARGET_FALLBACK' option was not defined for heterogeneous plugin";
}
}
@ -104,7 +104,7 @@ HeteroExecutableNetwork::HeteroExecutableNetwork(const InferenceEngine::CNNNetwo
: node->output(0).get_target_inputs().begin()->get_node()->get_friendly_name();
auto itAffinity = queryNetworkResult.supportedLayersMap.find(nodeWithAffinityName);
if (itAffinity == queryNetworkResult.supportedLayersMap.end()) {
THROW_IE_EXCEPTION << "Node " << nodeWithAffinityName <<
IE_THROW() << "Node " << nodeWithAffinityName <<
" was not assigned on any pointed device.";
}
queryNetworkResult.supportedLayersMap.emplace(node->get_friendly_name(), itAffinity->second);
@ -121,13 +121,13 @@ HeteroExecutableNetwork::HeteroExecutableNetwork(const InferenceEngine::CNNNetwo
affinities[node.get()] = itAffinity->second;
devices.emplace(itAffinity->second);
} else if (allEmpty) {
THROW_IE_EXCEPTION << "Hetero plugin used default fallback policy, but some layers eg: \n(Name:" <<
IE_THROW() << "Hetero plugin used default fallback policy, but some layers eg: \n(Name:" <<
node->get_friendly_name() << ", Type: " << node->get_type_name() <<
") were not able to be assigned on any pointed device.\n" <<
"It happened because these layers are not supported in plugins by default.\n" <<
"You need to implement custom layers to support them.";
} else {
THROW_IE_EXCEPTION << "Network passed to LoadNetwork has affinity assigned, but some layers eg: \n(Name:" <<
IE_THROW() << "Network passed to LoadNetwork has affinity assigned, but some layers eg: \n(Name:" <<
node->get_friendly_name() << ", Type: " << node->get_type_name() <<
") were not assigned to any device.\n" <<
"It might happen if you assigned layers manually and missed some layers or\n" <<
@ -431,7 +431,7 @@ HeteroExecutableNetwork::HeteroExecutableNetwork(std::istream&
pugi::xml_parse_result res = heteroXmlDoc.load_string(heteroXmlStr.c_str());
if (res.status != pugi::status_ok) {
THROW_IE_EXCEPTION_WITH_STATUS(NetworkNotRead) << "Error reading HETERO plugin xml header";
IE_THROW(NetworkNotRead) << "Error reading HETERO plugin xml header";
}
using namespace XMLParseUtils;
@ -611,7 +611,7 @@ void HeteroExecutableNetwork::ExportImpl(std::ostream& heteroModel) {
} catch (const InferenceEngine::NotImplemented& ex) {
auto subnet = subnetwork._clonedNetwork;
if (!subnet.getFunction()) {
THROW_IE_EXCEPTION << "Hetero plugin supports only ngraph function representation";
IE_THROW() << "Hetero plugin supports only ngraph function representation";
}
// Note: custom ngraph extensions are not supported
@ -681,7 +681,7 @@ InferenceEngine::Parameter HeteroExecutableNetwork::GetConfig(const std::string
}
}
THROW_IE_EXCEPTION << "Unsupported ExecutableNetwork config key: " << name;
IE_THROW() << "Unsupported ExecutableNetwork config key: " << name;
}
return result;
@ -792,6 +792,6 @@ InferenceEngine::Parameter HeteroExecutableNetwork::GetMetric(const std::string
}
}
THROW_IE_EXCEPTION << "Unsupported ExecutableNetwork metric: " << name;
IE_THROW() << "Unsupported ExecutableNetwork metric: " << name;
}
}

View File

@ -23,7 +23,7 @@ HeteroInferRequest::HeteroInferRequest(InferenceEngine::InputsDataMap networkInp
InferRequestInternal(networkInputs, networkOutputs),
_inferRequests(inferRequests) {
if (_networkOutputs.empty() || _networkInputs.empty()) {
THROW_IE_EXCEPTION << "Internal error: no information about network's output/input";
IE_THROW() << "Internal error: no information about network's output/input";
}
auto requestBlob([&](const std::string& blobName, InferenceEngine::InferRequest::Ptr r) {

View File

@ -41,18 +41,18 @@ Engine::Configs mergeConfigs(Engine::Configs config, const Engine::Configs & loc
InferenceEngine::ExecutableNetworkInternal::Ptr Engine::LoadExeNetworkImpl(const InferenceEngine::CNNNetwork& network,
const Configs& config) {
if (GetCore() == nullptr) {
THROW_IE_EXCEPTION << "Please, work with HETERO device via InferencEngine::Core object";
IE_THROW() << "Please, work with HETERO device via InferencEngine::Core object";
}
auto tconfig = mergeConfigs(_config, config);
auto it = tconfig.find("TARGET_FALLBACK");
if (it == tconfig.end()) {
THROW_IE_EXCEPTION << "The 'TARGET_FALLBACK' option was not defined for heterogeneous plugin";
IE_THROW() << "The 'TARGET_FALLBACK' option was not defined for heterogeneous plugin";
}
DeviceMetaInformationMap metaDevices = GetDevicePlugins(it->second, tconfig);
auto function = network.getFunction();
if (function == nullptr) {
THROW_IE_EXCEPTION << "HETERO plugin supports just ngraph network representation";
IE_THROW() << "HETERO plugin supports just ngraph network representation";
}
return std::make_shared<HeteroExecutableNetwork>(network, mergeConfigs(_config, config), this);
@ -60,7 +60,7 @@ InferenceEngine::ExecutableNetworkInternal::Ptr Engine::LoadExeNetworkImpl(const
InferenceEngine::ExecutableNetwork Engine::ImportNetworkImpl(std::istream& heteroModel, const Configs& config) {
if (GetCore() == nullptr) {
THROW_IE_EXCEPTION << "Please, work with HETERO device via InferencEngine::Core object";
IE_THROW() << "Please, work with HETERO device via InferencEngine::Core object";
}
return make_executable_network(std::make_shared<HeteroExecutableNetwork>(heteroModel,
@ -121,13 +121,13 @@ QueryNetworkResult Engine::QueryNetwork(const CNNNetwork &network, const Configs
QueryNetworkResult qr;
if (GetCore() == nullptr) {
THROW_IE_EXCEPTION << "Please, work with HETERO device via InferencEngine::Core object";
IE_THROW() << "Please, work with HETERO device via InferencEngine::Core object";
}
auto tconfig = mergeConfigs(_config, config);
auto it = tconfig.find("TARGET_FALLBACK");
if (it == tconfig.end()) {
THROW_IE_EXCEPTION << "The 'TARGET_FALLBACK' option was not defined for heterogeneous plugin";
IE_THROW() << "The 'TARGET_FALLBACK' option was not defined for heterogeneous plugin";
}
std::string fallbackDevicesStr = it->second;
@ -135,7 +135,7 @@ QueryNetworkResult Engine::QueryNetwork(const CNNNetwork &network, const Configs
auto function = network.getFunction();
if (function == nullptr) {
THROW_IE_EXCEPTION << "HETERO plugin supports just ngraph network representation";
IE_THROW() << "HETERO plugin supports just ngraph network representation";
}
std::map<std::string, QueryNetworkResult> queryResults;
@ -174,7 +174,7 @@ Parameter Engine::GetMetric(const std::string& name, const std::map<std::string,
} else if (METRIC_KEY(FULL_DEVICE_NAME) == name) {
IE_SET_METRIC_RETURN(FULL_DEVICE_NAME, std::string{"HETERO"});
} else {
THROW_IE_EXCEPTION << "Unsupported Plugin metric: " << name;
IE_THROW() << "Unsupported Plugin metric: " << name;
}
}
@ -187,12 +187,12 @@ Parameter Engine::GetConfig(const std::string& name, const std::map<std::string,
} else if (name == "TARGET_FALLBACK") {
auto it = _config.find("TARGET_FALLBACK");
if (it == _config.end()) {
THROW_IE_EXCEPTION << "Value for TARGET_FALLBACK is not set";
IE_THROW() << "Value for TARGET_FALLBACK is not set";
} else {
return { it->second };
}
} else {
THROW_IE_EXCEPTION << "Unsupported config key: " << name;
IE_THROW() << "Unsupported config key: " << name;
}
}

View File

@ -144,7 +144,7 @@ static inline void blob_copy_4d(Blob::Ptr src, Blob::Ptr dst) {
break;
default:
THROW_IE_EXCEPTION << "Unsupported blob transformation for precision " << src->getTensorDesc().getPrecision();
IE_THROW() << "Unsupported blob transformation for precision " << src->getTensorDesc().getPrecision();
}
}
@ -284,28 +284,28 @@ static inline void blob_copy_5d(Blob::Ptr src, Blob::Ptr dst) {
break;
default:
THROW_IE_EXCEPTION << "Unsupported blob transformation for precision " << src->getTensorDesc().getPrecision();
IE_THROW() << "Unsupported blob transformation for precision " << src->getTensorDesc().getPrecision();
}
}
void blob_copy(Blob::Ptr src, Blob::Ptr dst) {
if (src->buffer() == nullptr) THROW_IE_EXCEPTION << "Cannot copy blob data. Source is not allocated.";
if (src->buffer() == nullptr) IE_THROW() << "Cannot copy blob data. Source is not allocated.";
if (dst->buffer() == nullptr) THROW_IE_EXCEPTION << "Cannot copy blob data. Destination is not allocated.";
if (dst->buffer() == nullptr) IE_THROW() << "Cannot copy blob data. Destination is not allocated.";
if (src->getTensorDesc().getPrecision() != dst->getTensorDesc().getPrecision())
THROW_IE_EXCEPTION << "Unimplemented blob transformation from precision " << src->getTensorDesc().getPrecision()
IE_THROW() << "Unimplemented blob transformation from precision " << src->getTensorDesc().getPrecision()
<< " to " << src->getTensorDesc().getPrecision();
if (src->getTensorDesc().getDims() != dst->getTensorDesc().getDims())
THROW_IE_EXCEPTION << "Unimplemented blob transformation from different shapes ";
IE_THROW() << "Unimplemented blob transformation from different shapes ";
if (src->getTensorDesc().getDims().size() == 4)
blob_copy_4d(src, dst);
else if (src->getTensorDesc().getDims().size() == 5)
blob_copy_5d(src, dst);
else
THROW_IE_EXCEPTION << "Unimplemented blob transformation. Only 4d or 5d supported.";
IE_THROW() << "Unimplemented blob transformation. Only 4d or 5d supported.";
}
} // namespace InferenceEngine

View File

@ -80,7 +80,7 @@ void CNNNetworkNGraphImpl::createDataForResult(const ::ngraph::Output<::ngraph::
}
for (const auto& dim : dims) {
if (!dim)
THROW_IE_EXCEPTION << outName << " has zero dimension which is not allowed";
IE_THROW() << outName << " has zero dimension which is not allowed";
}
if (ptr) {
@ -144,7 +144,7 @@ CNNNetworkNGraphImpl::CNNNetworkNGraphImpl(const CNNNetwork& network) {
const ICNNNetwork& iNetwork = network;
const auto net = dynamic_cast<const CNNNetworkNGraphImpl*>(&iNetwork);
if (network.getFunction() == nullptr || !net) {
THROW_IE_EXCEPTION << "Cannot create CNNNetwork with nGraph from legacy network format!";
IE_THROW() << "Cannot create CNNNetwork with nGraph from legacy network format!";
}
_ngraph_function = copyFunction(network.getFunction(), false);
@ -405,7 +405,7 @@ CNNNetworkNGraphImpl::reshape(const std::map<std::string, std::vector<size_t>>&
for (const auto &parameter : specialized_ngraph_function->get_parameters()) {
const auto &outName = parameter->get_friendly_name();
if (opName.find(outName) != opName.end()) {
THROW_IE_EXCEPTION << "All operations in nGraph function should have unique friendly names!";
IE_THROW() << "All operations in nGraph function should have unique friendly names!";
}
opName.insert(outName);
createDataForResult(parameter, outName, _data[outName]);

View File

@ -193,7 +193,7 @@ std::istream& operator >> (std::istream& stream, CompiledBlobHeader& header) {
pugi::xml_parse_result res = document.load_string(xmlStr.c_str());
if (res.status != pugi::status_ok) {
THROW_IE_EXCEPTION_WITH_STATUS(NetworkNotRead) << "Error reading compiled blob header";
IE_THROW(NetworkNotRead) << "Error reading compiled blob header";
}
pugi::xml_node compiledBlobNode = document.document_element();

View File

@ -17,7 +17,7 @@ CNNNetwork::CNNNetwork() :
CNNNetwork::CNNNetwork(std::shared_ptr<ICNNNetwork> network)
: network(network) {
actual = network.get();
if (actual == nullptr) THROW_IE_EXCEPTION << "CNNNetwork was not initialized.";
if (actual == nullptr) IE_THROW() << "CNNNetwork was not initialized.";
}
CNNNetwork::CNNNetwork(const std::shared_ptr<ngraph::Function>& graph,
@ -25,38 +25,38 @@ CNNNetwork::CNNNetwork(const std::shared_ptr<ngraph::Function>& graph,
OV_ITT_SCOPED_TASK(itt::domains::IE, "CNNNetwork::CNNNetwork");
if (graph == nullptr) {
THROW_IE_EXCEPTION << "CNNNetwork was not initialized: 'graph' object is empty";
IE_THROW() << "CNNNetwork was not initialized: 'graph' object is empty";
}
// Create CNNNetworkNGraphImpl
network = std::make_shared<details::CNNNetworkNGraphImpl>(graph, exts);
actual = network.get();
if (actual == nullptr) {
THROW_IE_EXCEPTION << "CNNNetwork was not initialized.";
IE_THROW() << "CNNNetwork was not initialized.";
}
}
OutputsDataMap CNNNetwork::getOutputsInfo() const {
if (actual == nullptr) THROW_IE_EXCEPTION << "CNNNetwork was not initialized.";
if (actual == nullptr) IE_THROW() << "CNNNetwork was not initialized.";
OutputsDataMap outputs;
actual->getOutputsInfo(outputs);
return outputs;
}
InputsDataMap CNNNetwork::getInputsInfo() const {
if (actual == nullptr) THROW_IE_EXCEPTION << "CNNNetwork was not initialized.";
if (actual == nullptr) IE_THROW() << "CNNNetwork was not initialized.";
InputsDataMap inputs;
actual->getInputsInfo(inputs);
return inputs;
}
size_t CNNNetwork::layerCount() const {
if (actual == nullptr) THROW_IE_EXCEPTION << "CNNNetwork was not initialized.";
if (actual == nullptr) IE_THROW() << "CNNNetwork was not initialized.";
return actual->layerCount();
}
const std::string& CNNNetwork::getName() const {
if (actual == nullptr) THROW_IE_EXCEPTION << "CNNNetwork was not initialized.";
if (actual == nullptr) IE_THROW() << "CNNNetwork was not initialized.";
return actual->getName();
}
@ -65,7 +65,7 @@ void CNNNetwork::setBatchSize(const size_t size) {
}
size_t CNNNetwork::getBatchSize() const {
if (actual == nullptr) THROW_IE_EXCEPTION << "CNNNetwork was not initialized.";
if (actual == nullptr) IE_THROW() << "CNNNetwork was not initialized.";
return actual->getBatchSize();
}
@ -75,22 +75,22 @@ CNNNetwork::operator ICNNNetwork::Ptr() {
}
CNNNetwork::operator ICNNNetwork&() {
if (actual == nullptr) THROW_IE_EXCEPTION << "CNNNetwork was not initialized.";
if (actual == nullptr) IE_THROW() << "CNNNetwork was not initialized.";
return *actual;
}
CNNNetwork::operator const ICNNNetwork&() const {
if (actual == nullptr) THROW_IE_EXCEPTION << "CNNNetwork was not initialized.";
if (actual == nullptr) IE_THROW() << "CNNNetwork was not initialized.";
return *actual;
}
std::shared_ptr<ngraph::Function> CNNNetwork::getFunction() {
if (actual == nullptr) THROW_IE_EXCEPTION << "CNNNetwork was not initialized.";
if (actual == nullptr) IE_THROW() << "CNNNetwork was not initialized.";
return actual->getFunction();
}
std::shared_ptr<const ngraph::Function> CNNNetwork::getFunction() const {
if (actual == nullptr) THROW_IE_EXCEPTION << "CNNNetwork was not initialized.";
if (actual == nullptr) IE_THROW() << "CNNNetwork was not initialized.";
return actual->getFunction();
}
@ -99,7 +99,7 @@ void CNNNetwork::addOutput(const std::string& layerName, size_t outputIndex) {
}
ICNNNetwork::InputShapes CNNNetwork::getInputShapes() const {
if (actual == nullptr) THROW_IE_EXCEPTION << "CNNNetwork was not initialized.";
if (actual == nullptr) IE_THROW() << "CNNNetwork was not initialized.";
ICNNNetwork::InputShapes shapes;
InputsDataMap inputs;
actual->getInputsInfo(inputs);

View File

@ -11,7 +11,7 @@ ExecutableNetwork::ExecutableNetwork(IExecutableNetwork::Ptr actual_, details::S
: actual(actual_), plg(plg) {
// plg can be null, but not the actual
if (actual == nullptr) {
THROW_IE_EXCEPTION << "ExecutableNetwork wrapper was not initialized.";
IE_THROW() << "ExecutableNetwork wrapper was not initialized.";
}
}
@ -33,10 +33,10 @@ ConstInputsDataMap ExecutableNetwork::GetInputsInfo() const {
void ExecutableNetwork::reset(IExecutableNetwork::Ptr newActual) {
if (actual == nullptr) {
THROW_IE_EXCEPTION << "ExecutableNetwork wrapper was not initialized.";
IE_THROW() << "ExecutableNetwork wrapper was not initialized.";
}
if (newActual == nullptr) {
THROW_IE_EXCEPTION << "ExecutableNetwork wrapper used for reset was not initialized.";
IE_THROW() << "ExecutableNetwork wrapper used for reset was not initialized.";
}
this->actual.swap(newActual);
}
@ -44,7 +44,7 @@ void ExecutableNetwork::reset(IExecutableNetwork::Ptr newActual) {
InferRequest ExecutableNetwork::CreateInferRequest() {
IInferRequest::Ptr req;
CALL_STATUS_FNC(CreateInferRequest, req);
if (req.get() == nullptr) THROW_IE_EXCEPTION << "Internal error: pointer to infer request is null";
if (req.get() == nullptr) IE_THROW() << "Internal error: pointer to infer request is null";
return InferRequest(req, plg);
}
@ -76,7 +76,7 @@ CNNNetwork ExecutableNetwork::GetExecGraphInfo() {
std::vector<VariableState> ExecutableNetwork::QueryState() {
if (actual == nullptr) THROW_IE_EXCEPTION << "ExecutableNetwork was not initialized.";
if (actual == nullptr) IE_THROW() << "ExecutableNetwork was not initialized.";
IVariableState::Ptr pState = nullptr;
auto res = OK;
std::vector<VariableState> controller;
@ -86,7 +86,7 @@ std::vector<VariableState> ExecutableNetwork::QueryState() {
res = actual->QueryState(pState, idx, &resp);
IE_SUPPRESS_DEPRECATED_END
if (res != OK && res != OUT_OF_BOUNDS) {
THROW_IE_EXCEPTION << resp.msg;
IE_THROW() << resp.msg;
}
if (res != OUT_OF_BOUNDS) {
controller.push_back(VariableState(pState, plg));

View File

@ -12,7 +12,7 @@ IE_SUPPRESS_DEPRECATED_START
VariableState::VariableState(IVariableState::Ptr pState, details::SharedObjectLoader::Ptr plg) : actual(pState), plugin(plg) {
if (actual == nullptr) {
THROW_IE_EXCEPTION << "VariableState wrapper was not initialized.";
IE_THROW() << "VariableState wrapper was not initialized.";
}
}

View File

@ -111,7 +111,7 @@ std::string FileUtils::absoluteFilePath(const std::string& filePath) {
absolutePath.resize(MAX_ABS_PATH);
auto absPath = get_absolute_path(&absolutePath[0], filePath);
if (!absPath) {
THROW_IE_EXCEPTION << "Can't get absolute file path for [" << filePath << "], err = " << strerror(errno);
IE_THROW() << "Can't get absolute file path for [" << filePath << "], err = " << strerror(errno);
}
absolutePath.resize(strlen(absPath));
return absolutePath;
@ -139,7 +139,7 @@ void FileUtils::createDirectoryRecursive(const std::string& dirPath) {
int err = makedir(dirPath.c_str());
if (err != 0 && errno != EEXIST) {
// TODO: in case of exception it may be needed to remove all created sub-directories
THROW_IE_EXCEPTION << "Couldn't create directory ["
IE_THROW() << "Couldn't create directory ["
<< dirPath << "], err=" << strerror(errno) << ")";
}
}
@ -166,7 +166,7 @@ static std::string getIELibraryPathA() {
HMODULE hm = NULL;
if (!GetModuleHandleExA(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS | GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT,
reinterpret_cast<LPSTR>(getIELibraryPath), &hm)) {
THROW_IE_EXCEPTION << "GetModuleHandle returned " << GetLastError();
IE_THROW() << "GetModuleHandle returned " << GetLastError();
}
GetModuleFileNameA(hm, (LPSTR)ie_library_path, sizeof(ie_library_path));
return getPathName(std::string(ie_library_path));
@ -200,7 +200,7 @@ std::wstring getIELibraryPathW() {
HMODULE hm = NULL;
if (!GetModuleHandleExW(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS | GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT,
reinterpret_cast<LPCWSTR>(getIELibraryPath), &hm)) {
THROW_IE_EXCEPTION << "GetModuleHandle returned " << GetLastError();
IE_THROW() << "GetModuleHandle returned " << GetLastError();
}
GetModuleFileNameW(hm, (LPWSTR)ie_library_path, sizeof(ie_library_path) / sizeof(ie_library_path[0]));
return getPathName(std::wstring(ie_library_path));

View File

@ -11,7 +11,7 @@
namespace InferenceEngine {
Blob::Ptr Blob::createROI(const ROI&) const {
THROW_IE_EXCEPTION_WITH_STATUS(NotImplemented) << "createROI is not implemented for current type of Blob";
IE_THROW(NotImplemented) << "createROI is not implemented for current type of Blob";
}
Blob::Ptr make_shared_blob(const Blob::Ptr& inputBlob, const ROI& roi) {

View File

@ -21,12 +21,12 @@ namespace {
TensorDesc verifyNV12BlobInput(const Blob::Ptr& y, const Blob::Ptr& uv) {
// Y and UV must be valid pointers
if (y == nullptr || uv == nullptr) {
THROW_IE_EXCEPTION << "Y and UV planes must be valid Blob objects";
IE_THROW() << "Y and UV planes must be valid Blob objects";
}
// both Y and UV must be MemoryBlob objects
if (!y->is<MemoryBlob>() || !uv->is<MemoryBlob>()) {
THROW_IE_EXCEPTION << "Y and UV planes must be MemoryBlob objects";
IE_THROW() << "Y and UV planes must be MemoryBlob objects";
}
// NOTE: having Blob::Ptr (shared_ptr) and checking Blob::is() status above ensures that the
@ -35,7 +35,7 @@ TensorDesc verifyNV12BlobInput(const Blob::Ptr& y, const Blob::Ptr& uv) {
auto uvMemoryBlob = uv->as<MemoryBlob>();
// check Blob element size
if (yMemoryBlob->element_size() != uvMemoryBlob->element_size()) {
THROW_IE_EXCEPTION << "Y and UV planes have different element sizes: " << yMemoryBlob->element_size()
IE_THROW() << "Y and UV planes have different element sizes: " << yMemoryBlob->element_size()
<< " != " << uvMemoryBlob->element_size();
}
@ -45,50 +45,50 @@ TensorDesc verifyNV12BlobInput(const Blob::Ptr& y, const Blob::Ptr& uv) {
// check precision
if (yDesc.getPrecision() != Precision::U8) {
THROW_IE_EXCEPTION << "Y plane precision must be U8, actual: " << yDesc.getPrecision();
IE_THROW() << "Y plane precision must be U8, actual: " << yDesc.getPrecision();
}
if (uvDesc.getPrecision() != Precision::U8) {
THROW_IE_EXCEPTION << "UV plane precision must be U8, actual: " << uvDesc.getPrecision();
IE_THROW() << "UV plane precision must be U8, actual: " << uvDesc.getPrecision();
}
// check layout
if (yDesc.getLayout() != Layout::NHWC) {
THROW_IE_EXCEPTION << "Y plane layout must be NHWC, actual: " << yDesc.getLayout();
IE_THROW() << "Y plane layout must be NHWC, actual: " << yDesc.getLayout();
}
if (uvDesc.getLayout() != Layout::NHWC) {
THROW_IE_EXCEPTION << "UV plane layout must be NHWC, actual: " << uvDesc.getLayout();
IE_THROW() << "UV plane layout must be NHWC, actual: " << uvDesc.getLayout();
}
// check dimensions
const auto& yDims = yDesc.getDims();
const auto& uvDims = uvDesc.getDims();
if (yDims.size() != 4 || uvDims.size() != 4) {
THROW_IE_EXCEPTION << "Y and UV planes dimension sizes must be 4, actual: " << yDims.size() << "(Y plane) and "
IE_THROW() << "Y and UV planes dimension sizes must be 4, actual: " << yDims.size() << "(Y plane) and "
<< uvDims.size() << "(UV plane)";
}
// check batch size
if (yDims[0] != uvDims[0]) {
THROW_IE_EXCEPTION << "Y and UV planes must have the same batch size";
IE_THROW() << "Y and UV planes must have the same batch size";
}
// check number of channels
if (yDims[1] != 1) {
THROW_IE_EXCEPTION << "Y plane must have 1 channel, actual: " << yDims[1];
IE_THROW() << "Y plane must have 1 channel, actual: " << yDims[1];
}
if (uvDims[1] != 2) {
THROW_IE_EXCEPTION << "UV plane must have 2 channels, actual: " << uvDims[1];
IE_THROW() << "UV plane must have 2 channels, actual: " << uvDims[1];
}
// check height
if (yDims[2] != 2 * uvDims[2]) {
THROW_IE_EXCEPTION << "The height of the Y plane must be equal to (2 * the height of the UV plane), actual: "
IE_THROW() << "The height of the Y plane must be equal to (2 * the height of the UV plane), actual: "
<< yDims[2] << "(Y plane) and " << uvDims[2] << "(UV plane)";
}
// check width
if (yDims[3] != 2 * uvDims[3]) {
THROW_IE_EXCEPTION << "The width of the Y plane must be equal to (2 * the width of the UV plane), actual: "
IE_THROW() << "The width of the Y plane must be equal to (2 * the width of the UV plane), actual: "
<< yDims[3] << "(Y plane) and " << uvDims[3] << "(UV plane)";
}
@ -98,12 +98,12 @@ TensorDesc verifyNV12BlobInput(const Blob::Ptr& y, const Blob::Ptr& uv) {
TensorDesc verifyI420BlobInput(const Blob::Ptr& y, const Blob::Ptr& u, const Blob::Ptr& v) {
// Y and UV must be valid pointers
if (y == nullptr || u == nullptr || v == nullptr) {
THROW_IE_EXCEPTION << "Y, U and V planes must be valid Blob objects";
IE_THROW() << "Y, U and V planes must be valid Blob objects";
}
// both Y and UV must be MemoryBlob objects
if (!y->is<MemoryBlob>() || !u->is<MemoryBlob>() || !v->is<MemoryBlob>()) {
THROW_IE_EXCEPTION << "Y, U and V planes must be MemoryBlob objects";
IE_THROW() << "Y, U and V planes must be MemoryBlob objects";
}
// NOTE: having Blob::Ptr (shared_ptr) and checking Blob::is() status above ensures that the
@ -113,7 +113,7 @@ TensorDesc verifyI420BlobInput(const Blob::Ptr& y, const Blob::Ptr& u, const Blo
auto vMemoryBlob = v->as<MemoryBlob>();
// check Blob element size
if (yMemoryBlob->element_size() != uMemoryBlob->element_size() || yMemoryBlob->element_size() != vMemoryBlob->element_size()) {
THROW_IE_EXCEPTION << "Y and UV planes have different element sizes: " << yMemoryBlob->element_size()
IE_THROW() << "Y and UV planes have different element sizes: " << yMemoryBlob->element_size()
<< " != " << uMemoryBlob->element_size()
<< " != " << vMemoryBlob->element_size();
}
@ -125,24 +125,24 @@ TensorDesc verifyI420BlobInput(const Blob::Ptr& y, const Blob::Ptr& u, const Blo
// check precision
if (yDesc.getPrecision() != Precision::U8) {
THROW_IE_EXCEPTION << "Y plane precision must be U8, actual: " << yDesc.getPrecision();
IE_THROW() << "Y plane precision must be U8, actual: " << yDesc.getPrecision();
}
if (uDesc.getPrecision() != Precision::U8) {
THROW_IE_EXCEPTION << "U plane precision must be U8, actual: " << uDesc.getPrecision();
IE_THROW() << "U plane precision must be U8, actual: " << uDesc.getPrecision();
}
if (vDesc.getPrecision() != Precision::U8) {
THROW_IE_EXCEPTION << "V plane precision must be U8, actual: " << vDesc.getPrecision();
IE_THROW() << "V plane precision must be U8, actual: " << vDesc.getPrecision();
}
// check layout
if (yDesc.getLayout() != Layout::NHWC) {
THROW_IE_EXCEPTION << "Y plane layout must be NHWC, actual: " << yDesc.getLayout();
IE_THROW() << "Y plane layout must be NHWC, actual: " << yDesc.getLayout();
}
if (uDesc.getLayout() != Layout::NHWC) {
THROW_IE_EXCEPTION << "U plane layout must be NHWC, actual: " << uDesc.getLayout();
IE_THROW() << "U plane layout must be NHWC, actual: " << uDesc.getLayout();
}
if (uDesc.getLayout() != Layout::NHWC) {
THROW_IE_EXCEPTION << "V plane layout must be NHWC, actual: " << vDesc.getLayout();
IE_THROW() << "V plane layout must be NHWC, actual: " << vDesc.getLayout();
}
// check dimensions
@ -151,45 +151,45 @@ TensorDesc verifyI420BlobInput(const Blob::Ptr& y, const Blob::Ptr& u, const Blo
const auto& vDims = vDesc.getDims();
if (yDims.size() != 4 || uDims.size() != 4 || vDims.size() != 4) {
THROW_IE_EXCEPTION << "Y,U and V planes dimension sizes must be 4, actual: " << yDims.size() << "(Y plane) and "
IE_THROW() << "Y,U and V planes dimension sizes must be 4, actual: " << yDims.size() << "(Y plane) and "
<< uDims.size() << "(U plane) "
<< vDims.size() << "(V plane)";
}
// check batch size
if (yDims[0] != uDims[0] || yDims[0] != vDims[0]) {
THROW_IE_EXCEPTION << "Y, U and U planes must have the same batch size";
IE_THROW() << "Y, U and U planes must have the same batch size";
}
// check number of channels
if (yDims[1] != 1) {
THROW_IE_EXCEPTION << "Y plane must have 1 channel, actual: " << yDims[1];
IE_THROW() << "Y plane must have 1 channel, actual: " << yDims[1];
}
if (uDims[1] != 1) {
THROW_IE_EXCEPTION << "U plane must have 1 channel, actual: " << uDims[1];
IE_THROW() << "U plane must have 1 channel, actual: " << uDims[1];
}
if (vDims[1] != 1) {
THROW_IE_EXCEPTION << "V plane must have 1 channel, actual: " << vDims[1];
IE_THROW() << "V plane must have 1 channel, actual: " << vDims[1];
}
// check height
if (yDims[2] != 2 * uDims[2]) {
THROW_IE_EXCEPTION << "The height of the Y plane must be equal to (2 * the height of the U plane), actual: "
IE_THROW() << "The height of the Y plane must be equal to (2 * the height of the U plane), actual: "
<< yDims[2] << "(Y plane) and " << uDims[2] << "(U plane)";
}
if (yDims[2] != 2 * vDims[2]) {
THROW_IE_EXCEPTION << "The height of the Y plane must be equal to (2 * the height of the UV plane), actual: "
IE_THROW() << "The height of the Y plane must be equal to (2 * the height of the UV plane), actual: "
<< yDims[2] << "(Y plane) and " << vDims[2] << "(V plane)";
}
// check width
if (yDims[3] != 2 * uDims[3]) {
THROW_IE_EXCEPTION << "The width of the Y plane must be equal to (2 * the width of the UV plane), actual: "
IE_THROW() << "The width of the Y plane must be equal to (2 * the width of the UV plane), actual: "
<< yDims[3] << "(Y plane) and " << uDims[3] << "(U plane)";
}
if (yDims[3] != 2 * vDims[3]) {
THROW_IE_EXCEPTION << "The width of the Y plane must be equal to (2 * the width of the UV plane), actual: "
IE_THROW() << "The width of the Y plane must be equal to (2 * the width of the UV plane), actual: "
<< yDims[3] << "(Y plane) and " << vDims[3] << "(V plane)";
}
@ -215,14 +215,14 @@ TensorDesc getBlobTensorDesc(const Blob::Ptr& blob) {
TensorDesc verifyBatchedBlobInput(const std::vector<Blob::Ptr>& blobs) {
// verify invariants
if (blobs.empty()) {
THROW_IE_EXCEPTION << "BatchedBlob cannot be created from empty vector of Blob, Please, make sure vector contains at least one Blob";
IE_THROW() << "BatchedBlob cannot be created from empty vector of Blob, Please, make sure vector contains at least one Blob";
}
// Cannot create a compound blob from nullptr Blob objects
if (std::any_of(blobs.begin(), blobs.end(), [](const Blob::Ptr& blob) {
return blob == nullptr;
})) {
THROW_IE_EXCEPTION << "Cannot create a compound blob from nullptr Blob objects";
IE_THROW() << "Cannot create a compound blob from nullptr Blob objects";
}
const auto subBlobDesc = getBlobTensorDesc(blobs[0]);
@ -231,7 +231,7 @@ TensorDesc verifyBatchedBlobInput(const std::vector<Blob::Ptr>& blobs) {
[&subBlobDesc](const Blob::Ptr& blob) {
return getBlobTensorDesc(blob) != subBlobDesc;
})) {
THROW_IE_EXCEPTION << "All blobs tensors should be equal";
IE_THROW() << "All blobs tensors should be equal";
}
auto subBlobLayout = subBlobDesc.getLayout();
@ -247,7 +247,7 @@ TensorDesc verifyBatchedBlobInput(const std::vector<Blob::Ptr>& blobs) {
case CN:
blobLayout = subBlobLayout;
if (blobDims[0] != 1) {
THROW_IE_EXCEPTION << "All blobs should be batch 1";
IE_THROW() << "All blobs should be batch 1";
}
blobDims[0] = blobs.size();
break;
@ -264,7 +264,7 @@ TensorDesc verifyBatchedBlobInput(const std::vector<Blob::Ptr>& blobs) {
blobDims.insert(blobDims.begin(), blobs.size());
break;
default:
THROW_IE_EXCEPTION << "Unsupported sub-blobs layout - to be one of: [NCHW, NHWC, NCDHW, NDHWC, NC, CN, C, CHW]";
IE_THROW() << "Unsupported sub-blobs layout - to be one of: [NCHW, NHWC, NCDHW, NDHWC, NC, CN, C, CHW]";
}
return TensorDesc{subBlobDesc.getPrecision(), blobDims, blobLayout};
@ -279,7 +279,7 @@ CompoundBlob::CompoundBlob(const std::vector<Blob::Ptr>& blobs): CompoundBlob(Te
if (std::any_of(blobs.begin(), blobs.end(), [](const Blob::Ptr& blob) {
return blob == nullptr;
})) {
THROW_IE_EXCEPTION << "Cannot create a compound blob from nullptr Blob objects";
IE_THROW() << "Cannot create a compound blob from nullptr Blob objects";
}
// Check that none of the blobs provided is compound. If at least one of them is compound, throw
@ -287,7 +287,7 @@ CompoundBlob::CompoundBlob(const std::vector<Blob::Ptr>& blobs): CompoundBlob(Te
if (std::any_of(blobs.begin(), blobs.end(), [](const Blob::Ptr& blob) {
return blob->is<CompoundBlob>();
})) {
THROW_IE_EXCEPTION << "Cannot create a compound blob from other compound blobs";
IE_THROW() << "Cannot create a compound blob from other compound blobs";
}
this->_blobs = blobs;
@ -298,7 +298,7 @@ CompoundBlob::CompoundBlob(std::vector<Blob::Ptr>&& blobs): CompoundBlob(TensorD
if (std::any_of(blobs.begin(), blobs.end(), [](const Blob::Ptr& blob) {
return blob == nullptr;
})) {
THROW_IE_EXCEPTION << "Cannot create a compound blob from nullptr Blob objects";
IE_THROW() << "Cannot create a compound blob from nullptr Blob objects";
}
// Check that none of the blobs provided is compound. If at least one of them is compound, throw
@ -306,7 +306,7 @@ CompoundBlob::CompoundBlob(std::vector<Blob::Ptr>&& blobs): CompoundBlob(TensorD
if (std::any_of(blobs.begin(), blobs.end(), [](const Blob::Ptr& blob) {
return blob->is<CompoundBlob>();
})) {
THROW_IE_EXCEPTION << "Cannot create a compound blob from other compound blobs";
IE_THROW() << "Cannot create a compound blob from other compound blobs";
}
this->_blobs = std::move(blobs);

Some files were not shown because too many files have changed in this diff Show More