[nnc] Fix svace error (#2982)
authorДилшоджон Умронхонович Пошшоев/AI Tools Lab /SRR/Engineer/삼성전자 <d.poshshoev@samsung.com>
Thu, 31 Jan 2019 15:52:16 +0000 (18:52 +0300)
committerEfimov Alexander/AI Tools Lab/./Samsung Electronics <a.efimov@samsung.com>
Thu, 31 Jan 2019 15:52:16 +0000 (18:52 +0300)
Fixed "Major" and "Critical" errors of svace

Signed-off-by: Dilshodzhon Poshshoev <d.poshshoev@samsung.com>
contrib/nnc/include/ADT/SmallVector.h
contrib/nnc/passes/interpreter/interpreter_pass.cpp
contrib/nnc/passes/soft_backend/SequencedIR.h

index 3f09ad7..17fb565 100644 (file)
@@ -86,7 +86,7 @@ public:
    * @return reference to the element at position idx
    */
   inline reference operator[](size_t idx) noexcept {
-    assert(idx >= 0 && idx < _size);
+    assert(idx < _size);
     return _storage[idx];
   }
 
@@ -95,7 +95,7 @@ public:
    */
   inline constexpr value_type operator[](size_t idx) const noexcept {
     //assert on the same line since c++11 does not allow multi-line constexpr functions
-    return assert(idx >= 0 && idx < _size), _storage[idx];
+    return assert(idx < _size), _storage[idx];
   }
 
   inline iterator begin() noexcept {
index a8edcd5..aab24e9 100644 (file)
@@ -63,7 +63,7 @@ static void writeTensorToHDF5File(const TensorVariant& tensor,
   const int32_t rank = shape.rank();
   hsize_t dims[rank];
   for (int32_t axis = 0; axis < rank; ++axis) {
-    dims[axis] = shape.dim(axis);
+    dims[axis] = static_cast<hsize_t>(shape.dim(axis));
   }
 
   // Create float array from tensor
index f27f02f..4db16b2 100644 (file)
@@ -121,7 +121,7 @@ struct CallFunction : public Action {
       outputs(outputs),
       paramStartOffset(0) {}
 
-  CallFunction() : Action(Type::callFunction) {}
+  CallFunction() : Action(Type::callFunction), mirOp(nullptr), paramStartOffset(0) {}
 
   mir::Operation* mirOp;
   std::string funcName;