Rename OPENVINO_UNREACHABLE to OPENVINO_THROW (#16201)

* Changed some exceptions to OPENVINO_THROW

* Changed samples throw exception

* Fixed some comments

* Remove OPENVINO_UNREACHABLE
This commit is contained in:
Ilya Churaev authored and GitHub committed 2023-03-10 20:23:13 +04:00
1 parent 4e89150a7c
commit 75314c2c53
71 files changed
+246 -255

No files matched your search

+6 -6
View File
@@ -229,7 +229,7 @@ ov::Tensor create_tensor_from_binary(const std::vector<std::string>& files,
" bytes, but the model expects ",
inputSize);
} else {
throw ov::Exception("Unsupported binary file type: " + extension);
OPENVINO_THROW("Unsupported binary file type: " + extension);
}
if (inputInfo.layout != "CN") {
@@ -352,7 +352,7 @@ ov::Tensor get_image_tensor(const std::vector<std::string>& files,
inputInfo.first,
filenames_used);
} else {
throw ov::Exception("Input type is not supported for " + inputInfo.first);
OPENVINO_THROW("Input type is not supported for " + inputInfo.first);
}
}
@@ -383,7 +383,7 @@ ov::Tensor get_im_info_tensor(const std::pair<size_t, size_t>& image_size,
} else if (type == ov::element::u64) {
return create_tensor_im_info<uint64_t>(image_size, batchSize, inputInfo.second, inputInfo.first);
} else {
throw ov::Exception("Input type is not supported for " + inputInfo.first);
OPENVINO_THROW("Input type is not supported for " + inputInfo.first);
}
}
@@ -471,7 +471,7 @@ ov::Tensor get_numpy_tensor(const std::vector<std::string>& files,
inputInfo.first,
filenames_used);
} else {
throw ov::Exception("Input type is not supported for " + inputInfo.first);
OPENVINO_THROW("Input type is not supported for " + inputInfo.first);
}
}
@@ -559,7 +559,7 @@ ov::Tensor get_binary_tensor(const std::vector<std::string>& files,
inputInfo.first,
filenames_used);
} else {
throw ov::Exception("Input type is not supported for " + inputInfo.first);
OPENVINO_THROW("Input type is not supported for " + inputInfo.first);
}
}
@@ -592,7 +592,7 @@ ov::Tensor get_random_tensor(const std::pair<std::string, benchmark_app::InputIn
} else if (type == ov::element::boolean) {
return create_tensor_random<uint8_t, uint32_t>(inputInfo.second, 0, 1);
} else {
throw ov::Exception("Input type is not supported for " + inputInfo.first);
OPENVINO_THROW("Input type is not supported for " + inputInfo.first);
}
}
@@ -61,7 +61,7 @@ void fill_buffer(void* inputBuffer, size_t elementsNum, const ov::element::Type&
} else if (type == ov::element::boolean) {
fill_buffer_random<uint8_t, uint32_t>(inputBuffer, elementsNum, 0, 1);
} else {
throw ov::Exception("Requested type is not supported");
OPENVINO_THROW("Requested type is not supported");
}
}
@@ -124,7 +124,7 @@ std::map<std::string, ov::TensorVector> get_remote_input_tensors(
}
return remoteTensors;
#else
throw ov::Exception("Device memory requested for GPU device, but OpenCL was not linked");
OPENVINO_THROW("Device memory requested for GPU device, but OpenCL was not linked");
#endif
}
@@ -136,19 +136,18 @@ ov::Shape get_static_shape(const ov::Output<const ov::Node>& compiled_output) {
if (compiled_pshape.is_static())
return compiled_pshape.to_shape();
else if (compiled_pshape.rank().is_dynamic())
OPENVINO_UNREACHABLE(
"Benchmark App - NOT IMPLEMENTED - Output of dynamic rank is not supported for remote tensor. ",
"Output: ",
compiled_output);
OPENVINO_THROW("Benchmark App - NOT IMPLEMENTED - Output of dynamic rank is not supported for remote tensor. ",
"Output: ",
compiled_output);
ov::Shape shape;
for (const auto& dimension : compiled_pshape) {
if (dimension.get_interval().has_upper_bound())
shape.push_back(static_cast<ov::Shape::value_type>(dimension.get_max_length()));
else
OPENVINO_UNREACHABLE("Benchmark App - NOT IMPLEMENTED - Fully dynamic output dimensions are not supported "
"for remote tensor. ",
"Output: ",
compiled_output);
OPENVINO_THROW("Benchmark App - NOT IMPLEMENTED - Fully dynamic output dimensions are not supported "
"for remote tensor. ",
"Output: ",
compiled_output);
}
return shape;
}
@@ -184,7 +183,7 @@ std::map<std::string, ov::Tensor> get_remote_output_tensors(const ov::CompiledMo
return outputTensors;
#else
throw ov::Exception("Device memory requested for GPU device, but OpenCL was not linked");
OPENVINO_THROW("Device memory requested for GPU device, but OpenCL was not linked");
#endif
}
} // namespace gpu