Fix warnings spotted by cl compiler (#4793)
* Fix warnings spotted by cl compiler * Use inline instead of anonymous namespace * Review comments
This commit is contained in:
parent
cc718f5602
commit
2a19fc2d8a
@ -99,7 +99,7 @@ InferenceEngine::StatusCode OpImplementation::init(InferenceEngine::LayerConfig
|
||||
config.inConfs[0].desc.getPrecision() != InferenceEngine::Precision::FP32) {
|
||||
THROW_IE_EXCEPTION << "Operation supports only FP32 precisions!";
|
||||
}
|
||||
} catch (InferenceEngine::details::InferenceEngineException& ex) {
|
||||
} catch (InferenceEngine::details::InferenceEngineException&) {
|
||||
if (resp) {
|
||||
strncpy(resp->msg, error.c_str(), sizeof(resp->msg) - 1);
|
||||
resp->msg[sizeof(resp->msg)-1] = 0;
|
||||
|
@ -65,7 +65,7 @@ InferenceEngine::StatusCode FFTImpl::init(InferenceEngine::LayerConfig &config,
|
||||
config.inConfs[0].desc.getPrecision() != InferenceEngine::Precision::FP32) {
|
||||
THROW_IE_EXCEPTION << "Operation supports only FP32 precisions!";
|
||||
}
|
||||
} catch (InferenceEngine::details::InferenceEngineException& ex) {
|
||||
} catch (InferenceEngine::details::InferenceEngineException&) {
|
||||
if (resp) {
|
||||
strncpy(resp->msg, error.c_str(), sizeof(resp->msg) - 1);
|
||||
resp->msg[sizeof(resp->msg)-1] = 0;
|
||||
|
@ -524,7 +524,7 @@ IEStatusCode ie_core_get_available_devices(const ie_core_t *core, ie_available_d
|
||||
avai_devices->devices = dev_ptrs.release();
|
||||
} catch (const IE::details::InferenceEngineException& e) {
|
||||
return e.hasStatus() ? status_map[e.getStatus()] : IEStatusCode::UNEXPECTED;
|
||||
} catch (const std::exception& e) {
|
||||
} catch (const std::exception&) {
|
||||
return IEStatusCode::UNEXPECTED;
|
||||
} catch (...) {
|
||||
return IEStatusCode::UNEXPECTED;
|
||||
|
@ -27,7 +27,9 @@ std::ostream & operator << (std::ostream & stream, const std::vector<T> & v) {
|
||||
}
|
||||
|
||||
void printParameterValue(const Parameter & value) {
|
||||
if (value.is<bool>()) {
|
||||
if (value.empty()) {
|
||||
std::cout << "EMPTY VALUE" << std::endl;
|
||||
} else if (value.is<bool>()) {
|
||||
std::cout << std::boolalpha << value.as<bool>() << std::noboolalpha << std::endl;
|
||||
} else if (value.is<int>()) {
|
||||
std::cout << value.as<int>() << std::endl;
|
||||
@ -112,7 +114,7 @@ int main(int argc, char *argv[]) {
|
||||
std::cout << std::endl;
|
||||
}
|
||||
} catch (const std::exception & ex) {
|
||||
std::cerr << ex.what() << std::endl;
|
||||
std::cerr << std::endl << "Exception occurred: " << ex.what() << std::endl << std::flush;
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
return EXIT_SUCCESS;
|
||||
|
@ -215,7 +215,7 @@ bool Program::IsOpSupported(const InferenceEngine::CNNNetwork& network, const st
|
||||
CreateSingleLayerPrimitive(topology, op);
|
||||
CleanupBuild();
|
||||
DisableQueryMode();
|
||||
} catch (std::exception& ex) {
|
||||
} catch (std::exception&) {
|
||||
// Exception means that an operation or some of it's parameters are not supported
|
||||
CleanupBuild();
|
||||
return false;
|
||||
|
@ -1267,19 +1267,19 @@ void GNAPluginNS::backend::AMIntelDNN::WriteDnnText(const char *filename, intel_
|
||||
<< GNAPluginNS::memory::MemoryOffset(component[i].op.pwl.ptr_segments, ptr_dnn_memory_) << "\n";
|
||||
if (compute_precision_ == kDnnInt) {
|
||||
out_file << "<slope> ";
|
||||
for (int segment = 0; segment < num_segments; segment++) {
|
||||
for (uint32_t segment = 0; segment < num_segments; segment++) {
|
||||
out_file << "0x" << std::setfill('0') << std::setw(4) << std::hex
|
||||
<< ptr_segment[segment].slope << " ";
|
||||
}
|
||||
out_file << "\n";
|
||||
out_file << "<intercept> ";
|
||||
for (int segment = 0; segment < component[i].op.pwl.num_segments; segment++) {
|
||||
for (uint32_t segment = 0; segment < component[i].op.pwl.num_segments; segment++) {
|
||||
out_file << "0x" << std::setfill('0') << std::setw(4) << std::hex
|
||||
<< ptr_segment[segment].yBase << " ";
|
||||
}
|
||||
out_file << "\n";
|
||||
out_file << "<offset> ";
|
||||
for (int segment = 0; segment < component[i].op.pwl.num_segments; segment++) {
|
||||
for (uint32_t segment = 0; segment < component[i].op.pwl.num_segments; segment++) {
|
||||
out_file << "0x" << std::setfill('0') << std::setw(8) << std::hex
|
||||
<< ptr_segment[segment].xBase << " ";
|
||||
}
|
||||
|
@ -257,7 +257,7 @@ static std::string OvGnaModeToString(OvGnaMode mode) {
|
||||
}
|
||||
#endif
|
||||
|
||||
typedef struct {
|
||||
struct intel_dnn_component_t {
|
||||
#if GNA_LIB_VER == 2
|
||||
std::vector < OvGnaTensor > tensors;
|
||||
#endif
|
||||
@ -287,9 +287,9 @@ typedef struct {
|
||||
float output_scale_factor;
|
||||
float input_scale_factor;
|
||||
const char * original_layer_name = nullptr;
|
||||
} intel_dnn_component_t;
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
struct intel_score_error_t {
|
||||
uint32_t num_scores;
|
||||
uint32_t num_errors;
|
||||
float threshold;
|
||||
@ -301,4 +301,4 @@ typedef struct {
|
||||
float max_rel_error;
|
||||
float sum_rel_error;
|
||||
float sum_squared_rel_error;
|
||||
} intel_score_error_t;
|
||||
};
|
||||
|
@ -72,7 +72,7 @@ static float selectBestOutputScaleFactors(float inScale, std::vector<float> outS
|
||||
for (size_t j = 0; j < slopes.size(); ++j) {
|
||||
auto s = gna_slope(slopes[j], inScale, outScale);
|
||||
auto slope = static_cast<uint32_t>(s.slope * s.slope_scale);
|
||||
if (slope < std::numeric_limits<int16_t>::min() && slope > std::numeric_limits<int16_t>::max()) {
|
||||
if (slope < static_cast<uint32_t>(std::numeric_limits<int16_t>::min()) && slope > static_cast<uint32_t>(std::numeric_limits<int16_t>::max())) {
|
||||
sd += std::numeric_limits<int8_t>::max();
|
||||
continue;
|
||||
}
|
||||
@ -119,7 +119,7 @@ static float selectBestWeightsScaleFactors(float inScale, float outScale, std::v
|
||||
for (size_t j = 0; j < slopes.size(); ++j) {
|
||||
auto s = gna_slope(slopes[j], inScale * weightScale, outScale);
|
||||
auto slope = static_cast<uint32_t>(s.slope * s.slope_scale);
|
||||
if (slope < std::numeric_limits<int16_t>::min() && slope > std::numeric_limits<int16_t>::max()) {
|
||||
if (slope < static_cast<uint32_t>(std::numeric_limits<int16_t>::min()) && slope > static_cast<uint32_t>(std::numeric_limits<int16_t>::max())) {
|
||||
sd += std::numeric_limits<int8_t>::max();
|
||||
continue;
|
||||
}
|
||||
|
@ -156,7 +156,7 @@ Gna2Shape* create_shape2D_parameter(uint32_t x, uint32_t y) {
|
||||
|
||||
void freeGna2Operation(Gna2Operation& operation) {
|
||||
if (operation.Operands != nullptr) {
|
||||
for (auto i = 0; i < operation.NumberOfOperands; i++) {
|
||||
for (uint32_t i = 0; i < operation.NumberOfOperands; i++) {
|
||||
if (operation.Operands[i] != nullptr) {
|
||||
gnaUserFree(const_cast<Gna2Tensor*>(operation.Operands[i]));
|
||||
operation.Operands[i] = nullptr;
|
||||
@ -167,7 +167,7 @@ void freeGna2Operation(Gna2Operation& operation) {
|
||||
operation.NumberOfOperands = 0;
|
||||
}
|
||||
if (operation.Parameters != nullptr) {
|
||||
for (auto i = 0; i < operation.NumberOfParameters; i++) {
|
||||
for (uint32_t i = 0; i < operation.NumberOfParameters; i++) {
|
||||
if (operation.Parameters[i] != nullptr) {
|
||||
gnaUserFree(operation.Parameters[i]);
|
||||
operation.Parameters[i] = nullptr;
|
||||
|
@ -51,7 +51,7 @@ class CPPWrapper<Gna2Model> {
|
||||
THROW_GNA_EXCEPTION << "out of memory in while allocating "<< n << " GNA layers";
|
||||
}
|
||||
obj.NumberOfOperations = n;
|
||||
for (int i = 0; i < obj.NumberOfOperations; i++) {
|
||||
for (uint32_t i = 0; i < obj.NumberOfOperations; i++) {
|
||||
obj.Operations[i].Type = Gna2OperationTypeNone;
|
||||
obj.Operations[i].Operands = nullptr;
|
||||
obj.Operations[i].NumberOfOperands = 0;
|
||||
@ -61,7 +61,7 @@ class CPPWrapper<Gna2Model> {
|
||||
}
|
||||
~CPPWrapper() {
|
||||
if (obj.Operations != nullptr) {
|
||||
for (int i = 0; i < obj.NumberOfOperations; i++) {
|
||||
for (uint32_t i = 0; i < obj.NumberOfOperations; i++) {
|
||||
freeGna2Operation(obj.Operations[i]);
|
||||
}
|
||||
gnaUserFree(obj.Operations);
|
||||
|
@ -1380,7 +1380,7 @@ void GNAGraphCompiler::AffinePrimitive(InferenceEngine::CNNLayerPtr layer, bool
|
||||
64);
|
||||
} else {
|
||||
gnamem->readonly().push_initializer(ptr_weights, weightable._weights->byteSize(), [=](void* data, size_t size) {
|
||||
for (int k = 0; k < (isDiag ? 1 : num_rows_out); k++) {
|
||||
for (uint32_t k = 0; k < (isDiag ? 1 : num_rows_out); k++) {
|
||||
auto rowOffset = k * transposedRows * transposedCols * weightable.precision.size();
|
||||
auto cbuffer = weightable._weights->cbuffer().as<const uint8_t*>() + rowOffset;
|
||||
auto u8Data = reinterpret_cast<uint8_t*>(data) + rowOffset;
|
||||
@ -1409,7 +1409,7 @@ void GNAGraphCompiler::AffinePrimitive(InferenceEngine::CNNLayerPtr layer, bool
|
||||
auto paddedWeightsSize = paddedWeights * weightable.precision.size();
|
||||
|
||||
gnamem->readonly().push_initializer(ptr_weights, paddedWeightsSize, [=](void* data, size_t size) {
|
||||
for (int i = 0; i < (isDiag ? 1 : num_rows_out); i++) {
|
||||
for (uint32_t i = 0; i < (isDiag ? 1 : num_rows_out); i++) {
|
||||
ie_memcpy(data, size,
|
||||
weightable._weights->cbuffer().as<const uint8_t*>() + num_rows_in * i * weightable.precision.size(),
|
||||
num_rows_in * weightable.precision.size());
|
||||
@ -1663,7 +1663,7 @@ void GNAGraphCompiler::AffineFilterPrimitive(InferenceEngine::CNNLayerPtr layer)
|
||||
|
||||
gnamem->readonly().push_initializer(ptr_weights, paddedWeightsSize, [=](void* data, size_t size) {
|
||||
size_t offset = 0;
|
||||
for (int i = 0; i < num_rows_out && size >= offset; i++) {
|
||||
for (uint32_t i = 0; i < num_rows_out && size >= offset; i++) {
|
||||
ie_memcpy(reinterpret_cast<uint8_t*>(data) + offset, size - offset,
|
||||
filterLayer->_weights->cbuffer().as<const uint8_t*>() + num_rows_in * i * filterLayer->precision.size(),
|
||||
num_rows_in* filterLayer->precision.size());
|
||||
|
@ -837,7 +837,7 @@ void GNAModelSerial::ImportInputs(std::istream &is,
|
||||
InferenceEngine::InputsDataMap& dataMap) {
|
||||
dataMap.clear();
|
||||
|
||||
for (auto inputIndex = 0; inputIndex < modelHeader.nInputs; inputIndex++) {
|
||||
for (uint32_t inputIndex = 0; inputIndex < modelHeader.nInputs; inputIndex++) {
|
||||
const std::string& name = (modelHeader.version.major == 2 && modelHeader.version.minor >= 3)
|
||||
? inputNames.at(inputIndex) : std::string("input" + std::to_string(inputIndex));
|
||||
HeaderLatest::RuntimeEndPoint input;
|
||||
@ -866,7 +866,7 @@ void GNAModelSerial::ImportOutputs(std::istream &is,
|
||||
dataMap.clear();
|
||||
desc.resize(modelHeader.nOutputs);
|
||||
|
||||
for (auto outputIndex = 0; outputIndex < modelHeader.nOutputs; outputIndex++) {
|
||||
for (uint32_t outputIndex = 0; outputIndex < modelHeader.nOutputs; outputIndex++) {
|
||||
const std::string& name = (modelHeader.version.major == 2 && modelHeader.version.minor >= 3)
|
||||
? outputNames.at(outputIndex) : std::string("output" + std::to_string(outputIndex));
|
||||
HeaderLatest::RuntimeEndPoint output;
|
||||
|
@ -129,7 +129,7 @@ void GNAPlugin::copyInputData(T *dst,
|
||||
T *ptr_dst_vec = reinterpret_cast<T *>(dst) + i * num_vector_stride;
|
||||
const U *ptr_src_vec = reinterpret_cast<const U *>(src) + i * num_vector_elements;
|
||||
std::memset(ptr_dst_vec, 0, num_vector_stride * sizeof(T));
|
||||
for (int j=0; j < num_vector_elements; j++) {
|
||||
for (uint32_t j=0; j < num_vector_elements; j++) {
|
||||
ptr_dst_vec[j] = GNAPluginNS::ConvertFloatToInt16(ptr_src_vec[j] * scaleFactor);
|
||||
}
|
||||
}
|
||||
@ -1271,9 +1271,9 @@ GnaWaitStatus GNAPlugin::WaitFor(uint32_t request_idx, int64_t millisTimeout) {
|
||||
for (auto && outputBlobIt : request) {
|
||||
auto & outputBlob = outputBlobIt.second;
|
||||
auto & outputDesc = outputsDesc[output_idx];
|
||||
if (!outputBlob->getTensorDesc().getLayout() == Layout::C && !outputBlob->getTensorDesc().getLayout() == Layout::NC &&
|
||||
!outputBlob->getTensorDesc().getLayout() == Layout::CN && !outputBlob->getTensorDesc().getLayout() == Layout::NCHW &&
|
||||
!outputBlob->getTensorDesc().getLayout() == Layout::CHW) {
|
||||
if (outputBlob->getTensorDesc().getLayout() != Layout::C && outputBlob->getTensorDesc().getLayout() != Layout::NC &&
|
||||
outputBlob->getTensorDesc().getLayout() != Layout::CN && outputBlob->getTensorDesc().getLayout() != Layout::NCHW &&
|
||||
outputBlob->getTensorDesc().getLayout() != Layout::CHW) {
|
||||
THROW_GNA_EXCEPTION << "Expected output blob to have Layout::C, Layout::NC, Layout::CN, Layout::NCHW or Layout::CHW. But was "
|
||||
<< outputBlob->getTensorDesc().getLayout();
|
||||
}
|
||||
|
@ -41,7 +41,7 @@ struct Config {
|
||||
#endif
|
||||
inputScaleFactors = r.inputScaleFactors;
|
||||
gnaFlags = r.gnaFlags;
|
||||
std::lock_guard<std::mutex>(r.mtx4keyConfigMap);
|
||||
std::lock_guard<std::mutex> lock(r.mtx4keyConfigMap);
|
||||
keyConfigMap = r.keyConfigMap;
|
||||
}
|
||||
void UpdateFromMap(const std::map<std::string, std::string>& configMap);
|
||||
|
@ -6,10 +6,10 @@
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
typedef struct {
|
||||
struct pwl_gna_slope_scale_t {
|
||||
double slope {};
|
||||
uint64_t slope_scale = 0;
|
||||
uint32_t slope_scale_index {};
|
||||
} pwl_gna_slope_scale_t;
|
||||
};
|
||||
|
||||
pwl_gna_slope_scale_t gna_slope(const double slope, const double in_scale, const double out_scale);
|
||||
|
@ -975,7 +975,7 @@ void FlattenTrivialConcatPass::run() {
|
||||
|
||||
auto axis = concatLayer->_axis;
|
||||
bool skip_layer = false;
|
||||
for (int i = 0; i < axis; i++) {
|
||||
for (unsigned int i = 0; i < axis; i++) {
|
||||
if (concatLayer->insData[0].lock()->getDims()[i] != 1) skip_layer = true;
|
||||
}
|
||||
if (skip_layer) continue;
|
||||
|
@ -93,7 +93,7 @@ template <typename F>
|
||||
void allowNotImplemented(F && f) {
|
||||
try {
|
||||
f();
|
||||
} catch (const NotImplemented & ex) { }
|
||||
} catch (const NotImplemented&) { }
|
||||
}
|
||||
|
||||
} // namespace
|
||||
@ -993,7 +993,7 @@ std::vector<std::string> Core::GetAvailableDevices() const {
|
||||
try {
|
||||
Parameter p = GetMetric(deviceName, propertyName);
|
||||
devicesIDs = p.as<std::vector<std::string>>();
|
||||
} catch (details::InferenceEngineException& e) {
|
||||
} catch (details::InferenceEngineException&) {
|
||||
// plugin is not created by e.g. invalid env
|
||||
} catch (const std::exception& ex) {
|
||||
THROW_IE_EXCEPTION << "An exception is thrown while trying to create the " << deviceName
|
||||
|
@ -168,7 +168,7 @@ RemoteContext::Ptr MultiDeviceExecutableNetwork::GetContext() const {
|
||||
const auto& n = _networksPerDevice.at(device.deviceName);
|
||||
try {
|
||||
return n.GetContext();
|
||||
} catch (const NotImplemented& ex) {
|
||||
} catch (const NotImplemented&) {
|
||||
}
|
||||
}
|
||||
THROW_IE_EXCEPTION_WITH_STATUS(NOT_IMPLEMENTED) << "None of the devices in the MULTI has an associated remote context."
|
||||
|
@ -276,7 +276,7 @@ protected:
|
||||
INFERENCE_PLUGIN_API(void) CreatePluginEngine(::std::shared_ptr<::InferenceEngine::IInferencePlugin>& plugin) { \
|
||||
try { \
|
||||
plugin = ::std::make_shared<PluginType>(__VA_ARGS__); \
|
||||
} catch (const InferenceEngine::details::InferenceEngineException& e) { \
|
||||
} catch (const InferenceEngine::details::InferenceEngineException&) { \
|
||||
throw; \
|
||||
} catch (const std::exception& ex) { \
|
||||
THROW_IE_EXCEPTION << ex.what(); \
|
||||
|
@ -73,7 +73,7 @@ TEST(ConvertFunctionToCNNNetworkTests, ConvertConvolutionNetwork) {
|
||||
InferenceEngine::CNNNetwork nGraphImpl(f);
|
||||
try {
|
||||
auto net = std::make_shared<InferenceEngine::details::CNNNetworkImpl>(nGraphImpl);
|
||||
} catch (InferenceEngine::details::InferenceEngineException &err) {
|
||||
} catch (InferenceEngine::details::InferenceEngineException&) {
|
||||
FAIL();
|
||||
}
|
||||
}
|
||||
|
@ -109,7 +109,7 @@ TEST_F(CoreThreadingTests, RegisterPlugins) {
|
||||
|
||||
runParallel([&] () {
|
||||
std::string fileName, deviceName;
|
||||
std:tie(fileName, deviceName) = getPluginXml();
|
||||
std::tie(fileName, deviceName) = getPluginXml();
|
||||
ie.RegisterPlugins(fileName);
|
||||
ie.GetVersions(deviceName);
|
||||
ASSERT_EQ(0, std::remove(fileName.c_str()));
|
||||
|
@ -42,7 +42,7 @@ protected:
|
||||
TEST_P(DynamicShapeResolverTests, CanValidateAndInferTypes) {
|
||||
std::shared_ptr<ngraph::vpu::op::DynamicShapeResolver> dynamicShapeResolver;
|
||||
ASSERT_NO_THROW(dynamicShapeResolver = std::make_shared<ngraph::vpu::op::DynamicShapeResolver>(data, dims));
|
||||
ASSERT_NO_THROW(std::make_shared<ngraph::Function>(ngraph::NodeVector{dynamicShapeResolver}, ngraph::ParameterVector{data, dims}));
|
||||
ASSERT_NO_THROW(auto fun = std::make_shared<ngraph::Function>(ngraph::NodeVector{dynamicShapeResolver}, ngraph::ParameterVector{data, dims}));
|
||||
}
|
||||
|
||||
std::set<ngraph::element::Type_t> allNGraphTypes() {
|
||||
@ -117,7 +117,7 @@ protected:
|
||||
|
||||
using DynamicShapeResolverNegativeTestsDataType = DynamicShapeResolverNegativeTests;
|
||||
TEST_P(DynamicShapeResolverNegativeTestsDataType, ThrowsOnInvalidDimsType) {
|
||||
ASSERT_THROW(std::make_shared<ngraph::vpu::op::DynamicShapeResolver>(data, dims), ngraph::ngraph_error);
|
||||
ASSERT_THROW(auto dynamicShapeResolver = std::make_shared<ngraph::vpu::op::DynamicShapeResolver>(data, dims), ngraph::ngraph_error);
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(smoke_NGraph, DynamicShapeResolverNegativeTestsDataType, testing::Combine(
|
||||
@ -128,7 +128,7 @@ INSTANTIATE_TEST_CASE_P(smoke_NGraph, DynamicShapeResolverNegativeTestsDataType,
|
||||
|
||||
using DynamicShapeResolverNegativeTestsDimsType = DynamicShapeResolverNegativeTests;
|
||||
TEST_P(DynamicShapeResolverNegativeTestsDimsType, ThrowsOnInvalidDimsType) {
|
||||
ASSERT_THROW(std::make_shared<ngraph::vpu::op::DynamicShapeResolver>(data, dims), ngraph::ngraph_error);
|
||||
ASSERT_THROW(auto dynamicShapeResolver = std::make_shared<ngraph::vpu::op::DynamicShapeResolver>(data, dims), ngraph::ngraph_error);
|
||||
}
|
||||
|
||||
std::set<ngraph::element::Type_t> allNGraphNotIntegralTypes() {
|
||||
@ -148,7 +148,7 @@ INSTANTIATE_TEST_CASE_P(smoke_NGraph, DynamicShapeResolverNegativeTestsDimsType,
|
||||
|
||||
using DynamicShapeResolverNegativeTestsDataShape = DynamicShapeResolverNegativeTests;
|
||||
TEST_P(DynamicShapeResolverNegativeTestsDataShape, ThrowsOnInvalidDimsType) {
|
||||
ASSERT_THROW(std::make_shared<ngraph::vpu::op::DynamicShapeResolver>(data, dims), ngraph::ngraph_error);
|
||||
ASSERT_THROW(auto dynamicShapeResolver = std::make_shared<ngraph::vpu::op::DynamicShapeResolver>(data, dims), ngraph::ngraph_error);
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(smoke_NGraph, DynamicShapeResolverNegativeTestsDataShape, testing::Combine(
|
||||
@ -163,7 +163,7 @@ INSTANTIATE_TEST_CASE_P(smoke_NGraph, DynamicShapeResolverNegativeTestsDataShape
|
||||
|
||||
using DynamicShapeResolverNegativeTestsDimsShape = DynamicShapeResolverNegativeTests;
|
||||
TEST_P(DynamicShapeResolverNegativeTestsDimsShape, ThrowsOnInvalidDimsType) {
|
||||
ASSERT_THROW(std::make_shared<ngraph::vpu::op::DynamicShapeResolver>(data, dims), ngraph::ngraph_error);
|
||||
ASSERT_THROW(auto dynamicShapeResolver = std::make_shared<ngraph::vpu::op::DynamicShapeResolver>(data, dims), ngraph::ngraph_error);
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(smoke_NGraph, DynamicShapeResolverNegativeTestsDimsShape, testing::Combine(
|
||||
|
@ -94,7 +94,7 @@ TEST_P(OutShapeOfReshapeTests, CanValidateAndInferTypes) {
|
||||
std::shared_ptr<ngraph::vpu::op::OutShapeOfReshape> op;
|
||||
ASSERT_NO_THROW(op = std::make_shared<ngraph::vpu::op::OutShapeOfReshape>(
|
||||
m_inDataShapeParam, m_outShapeDescriptorParam, true));
|
||||
ASSERT_NO_THROW(std::make_shared<ngraph::Function>(
|
||||
ASSERT_NO_THROW(auto fun = std::make_shared<ngraph::Function>(
|
||||
ngraph::OutputVector{op->output(0)},
|
||||
ngraph::ParameterVector{m_inDataShapeParam, m_outShapeDescriptorParam}));
|
||||
}
|
||||
|
@ -146,7 +146,7 @@ TEST_P(StaticShapeBroadcastNumpyTests, CanValidateAndInferTypes) {
|
||||
std::shared_ptr<ngraph::vpu::op::StaticShapeBroadcast> op;
|
||||
ASSERT_NO_THROW(op = std::make_shared<ngraph::vpu::op::StaticShapeBroadcast>(
|
||||
m_tensor, shapeOf));
|
||||
ASSERT_NO_THROW(std::make_shared<ngraph::Function>(
|
||||
ASSERT_NO_THROW(auto fun = std::make_shared<ngraph::Function>(
|
||||
ngraph::OutputVector{op->output(0)},
|
||||
ngraph::ParameterVector{m_tensor, m_tensorWithTargetShape}));
|
||||
ASSERT_EQ(m_tensorWithTargetShape->get_shape(), op->output(0).get_shape());
|
||||
@ -162,7 +162,7 @@ TEST_P(StaticShapeBroadcastExplicitTests, CanValidateAndInferTypes) {
|
||||
std::shared_ptr<ngraph::vpu::op::StaticShapeBroadcast> op;
|
||||
ASSERT_NO_THROW(op = std::make_shared<ngraph::vpu::op::StaticShapeBroadcast>(
|
||||
m_tensor, shapeOf, m_axesMapping));
|
||||
ASSERT_NO_THROW(std::make_shared<ngraph::Function>(
|
||||
ASSERT_NO_THROW(auto fun = std::make_shared<ngraph::Function>(
|
||||
ngraph::OutputVector{op->output(0)},
|
||||
ngraph::ParameterVector{m_tensor, m_tensorWithTargetShape}));
|
||||
ASSERT_EQ(m_tensorWithTargetShape->get_shape(), op->get_output_shape(0));
|
||||
@ -178,7 +178,7 @@ TEST_P(StaticShapeBroadcastBidirectionalTests, CanValidateAndInferTypes) {
|
||||
std::shared_ptr<ngraph::vpu::op::StaticShapeBroadcast> op;
|
||||
ASSERT_NO_THROW(op = std::make_shared<ngraph::vpu::op::StaticShapeBroadcast>(
|
||||
m_tensor, shapeOf, ngraph::op::BroadcastType::BIDIRECTIONAL));
|
||||
ASSERT_NO_THROW(std::make_shared<ngraph::Function>(
|
||||
ASSERT_NO_THROW(auto fun = std::make_shared<ngraph::Function>(
|
||||
ngraph::OutputVector{op->output(0)},
|
||||
ngraph::ParameterVector{m_tensor, m_tensorWithTargetShape}));
|
||||
ASSERT_EQ(m_tensorWithOutput->get_shape(), op->output(0).get_shape());
|
||||
|
@ -84,7 +84,7 @@ std::vector<ngraph::element::Type> outputTypes {
|
||||
TEST_P(StaticShapeNonZeroTests, CanValidateAndInferTypes) {
|
||||
std::shared_ptr<ngraph::vpu::op::StaticShapeNonZero> op;
|
||||
ASSERT_NO_THROW(op = std::make_shared<ngraph::vpu::op::StaticShapeNonZero>(m_param, m_outputType));
|
||||
ASSERT_NO_THROW(std::make_shared<ngraph::Function>(
|
||||
ASSERT_NO_THROW(auto fun = std::make_shared<ngraph::Function>(
|
||||
ngraph::OutputVector{op->output(0), op->output(1)},
|
||||
ngraph::ParameterVector{m_param}));
|
||||
}
|
||||
|
@ -46,7 +46,7 @@ TEST_P(CancellationTests, canCancelAsyncRequest) {
|
||||
ASSERT_NO_THROW(req.Cancel());
|
||||
try {
|
||||
req.Wait(InferenceEngine::IInferRequest::WaitMode::RESULT_READY);
|
||||
} catch (const InferenceEngine::InferCancelled& ex) {
|
||||
} catch (const InferenceEngine::InferCancelled&) {
|
||||
SUCCEED();
|
||||
}
|
||||
}
|
||||
@ -65,7 +65,7 @@ TEST_P(CancellationTests, canResetAfterCancelAsyncRequest) {
|
||||
ASSERT_NO_THROW(req.Cancel());
|
||||
try {
|
||||
req.Wait(InferenceEngine::IInferRequest::WaitMode::RESULT_READY);
|
||||
} catch (const InferenceEngine::InferCancelled& ex) {
|
||||
} catch (const InferenceEngine::InferCancelled&) {
|
||||
SUCCEED();
|
||||
}
|
||||
|
||||
@ -107,7 +107,7 @@ TEST_P(CancellationTests, canCancelInferRequest) {
|
||||
ASSERT_NO_THROW(req.Cancel());
|
||||
try {
|
||||
infer.get();
|
||||
} catch (const InferenceEngine::InferCancelled& ex) {
|
||||
} catch (const InferenceEngine::InferCancelled&) {
|
||||
SUCCEED();
|
||||
}
|
||||
}
|
||||
|
@ -255,7 +255,7 @@ void ExecGraphSerializationTest::SetUp() {
|
||||
const std::string BIN_EXT = ".bin";
|
||||
|
||||
std::string test_name = ::testing::UnitTest::GetInstance()->current_test_info()->name();
|
||||
std::remove(test_name.begin(), test_name.end(), '/');
|
||||
test_name.erase(std::remove(test_name.begin(), test_name.end(), '/'), test_name.end());
|
||||
test_name += getTimestamp();
|
||||
|
||||
m_out_xml_path = test_name + XML_EXT;
|
||||
|
@ -12,19 +12,14 @@
|
||||
#include <ie_preprocess.hpp>
|
||||
#include <ie_icnn_network.hpp>
|
||||
|
||||
namespace {
|
||||
|
||||
bool strContains(const std::string & str, const std::string & substr) {
|
||||
inline bool strContains(const std::string & str, const std::string & substr) {
|
||||
return str.find(substr) != std::string::npos;
|
||||
}
|
||||
|
||||
bool strDoesnotContain(const std::string & str, const std::string & substr) {
|
||||
(void)strDoesnotContain; // to overcome unused warning
|
||||
inline bool strDoesnotContain(const std::string & str, const std::string & substr) {
|
||||
return !strContains(str, substr);
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
#define ASSERT_STR_CONTAINS(str, substr) \
|
||||
ASSERT_PRED2(&strContains, str, substr)
|
||||
|
||||
|
@ -51,14 +51,14 @@ typedef std::chrono::duration<float> fsec;
|
||||
|
||||
class BitMap {
|
||||
private:
|
||||
typedef struct {
|
||||
struct BmpHeader {
|
||||
unsigned short type = 0u; /* Magic identifier */
|
||||
unsigned int size = 0u; /* File size in bytes */
|
||||
unsigned int reserved = 0u;
|
||||
unsigned int offset = 0u; /* Offset to image data, bytes */
|
||||
} BmpHeader;
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
struct BmpInfoHeader {
|
||||
unsigned int size = 0u; /* Header size in bytes */
|
||||
int width = 0, height = 0; /* Width and height of image */
|
||||
unsigned short planes = 0u; /* Number of colour planes */
|
||||
@ -68,7 +68,7 @@ private:
|
||||
int xresolution = 0, yresolution = 0; /* Pixels per meter */
|
||||
unsigned int ncolours = 0u; /* Number of colours */
|
||||
unsigned int importantcolours = 0u; /* Important colours */
|
||||
} BmpInfoHeader;
|
||||
};
|
||||
|
||||
public:
|
||||
explicit BitMap(const std::string &filename) {
|
||||
|
Loading…
Reference in New Issue
Block a user