From 91c89e77d85c3f4bfc4035866fa68a9903211c20 Mon Sep 17 00:00:00 2001 From: Dmitrii Khurtin Date: Tue, 11 Jan 2022 19:01:34 +0300 Subject: [PATCH] Removed noexcept specifier; removed dead code and restored ostream format (#9563) --- src/plugins/intel_gna/backend/make_pwl.cpp | 8 -------- src/plugins/intel_gna/gna2_model_export_helper.cpp | 6 ++++-- src/plugins/intel_gna/layers/gna_layer_info.hpp | 4 ++-- 3 files changed, 6 insertions(+), 12 deletions(-) diff --git a/src/plugins/intel_gna/backend/make_pwl.cpp b/src/plugins/intel_gna/backend/make_pwl.cpp index 5f171c83743..ff9152209a9 100644 --- a/src/plugins/intel_gna/backend/make_pwl.cpp +++ b/src/plugins/intel_gna/backend/make_pwl.cpp @@ -387,14 +387,6 @@ void make_gna_pwl(const DnnActivation& fun, gna_pwl[1].slope = FLOAT_TO_INT16(s.slope * s.slope_scale); gna_pwl[1].xBase = gna_pwl[1].xBase | s.slope_scale_index; print_segment((int32_t)(gna_pwl[1].xBase & XBASEMASK) / in_scale, gna_pwl[1].yBase / out_scale, 1.0); - if (INT32_MAX > x_upper) { // need a right segment - gna_pwl.push_back({ - static_cast(x_upper & XBASEMASK), // zero out the 2 lsb - y_upper, - 0 }); - - print_segment((x_upper & XBASEMASK) / in_scale, gna_pwl[2].yBase / out_scale, 0.0); - } } else { double min_x_val = -pwl[0].b / pwl[0].m; double max_x_val = (y_max/out_scale - pwl[pwl_size - 2].b) / pwl[pwl_size - 2].m; diff --git a/src/plugins/intel_gna/gna2_model_export_helper.cpp b/src/plugins/intel_gna/gna2_model_export_helper.cpp index dc922cb8e4a..5b2fd20f35e 100644 --- a/src/plugins/intel_gna/gna2_model_export_helper.cpp +++ b/src/plugins/intel_gna/gna2_model_export_helper.cpp @@ -96,7 +96,9 @@ void ExportGnaDescriptorPartiallyFilled(uint32_t number_of_layers, std::ostream& outStream.write(gd, sizeof(gd)); outStream.write(gd2, sizeof(gd2)); // TODO: GNA2: Scratchpad - outStream.fill(constScratchFill); - outStream.width(scratchPadSize); + auto previousCharacter = outStream.fill(constScratchFill); + auto previousWidth = outStream.width(scratchPadSize); outStream << constScratchFill; + outStream.width(previousWidth); + outStream.fill(previousCharacter); } diff --git a/src/plugins/intel_gna/layers/gna_layer_info.hpp b/src/plugins/intel_gna/layers/gna_layer_info.hpp index ed6962b0a59..1d744eabc17 100644 --- a/src/plugins/intel_gna/layers/gna_layer_info.hpp +++ b/src/plugins/intel_gna/layers/gna_layer_info.hpp @@ -262,7 +262,7 @@ class LayerInfo { bool isFakeQuantize() const noexcept { return isOfType("FakeQuantize"); } - bool isNonFunctional() const noexcept { + bool isNonFunctional() const { return isOfType("reshape") || isOfType("squeeze") || isOfType("unsqueeze") || isTrivialPermute(); } bool isReshape() const noexcept { @@ -272,7 +272,7 @@ class LayerInfo { return isOfType("permute"); } // @brief this not only mathematically trivial, has some WA for kaldi case - bool isTrivialPermute() const noexcept { + bool isTrivialPermute() const { if (!isPermute()) return false; auto layerOrder = layer->GetParamAsInts("order");