Fix uninitialized field (#7089)
author오형석/On-Device Lab(SR)/Staff Engineer/삼성전자 <hseok82.oh@samsung.com>
Mon, 2 Sep 2019 06:54:24 +0000 (15:54 +0900)
committer이춘석/On-Device Lab(SR)/Staff Engineer/삼성전자 <chunseok.lee@samsung.com>
Mon, 2 Sep 2019 06:54:24 +0000 (15:54 +0900)
Fix uninitialized field contructor warning in neurun core and backend

Signed-off-by: Hyeongseok Oh <hseok82.oh@samsung.com>
runtimes/neurun/backend/acl_cl/KernelGenerator.cc
runtimes/neurun/backend/acl_neon/KernelGenerator.cc
runtimes/neurun/backend/cpu/KernelGenerator.cc
runtimes/neurun/backend/cpu/kernel/PermuteLayer.h
runtimes/neurun/core/include/graph/operand/PermuteFactor.h
runtimes/neurun/core/src/compiler/OperationValidator.h

index 2b0d901..05f3600 100644 (file)
@@ -147,7 +147,7 @@ void ActivationBuilder::append(model::Activation code, ::arm_compute::ICLTensor
 //
 KernelGenerator::KernelGenerator(const neurun::model::Operands &ctx,
                                  const std::shared_ptr<TensorBuilder> &tensor_builder)
-    : _ctx(ctx), _tensor_builder(tensor_builder)
+    : _ctx(ctx), _tensor_builder(tensor_builder), _current_subg_layout(model::Layout::UNKNOWN)
 {
   // DO NOTHING
 }
index be93fed..d2cd2e5 100644 (file)
@@ -158,7 +158,7 @@ void ActivationBuilder::append(model::Activation act, ::arm_compute::ITensor *if
 //
 KernelGenerator::KernelGenerator(const neurun::model::Operands &ctx,
                                  const std::shared_ptr<TensorBuilder> &tensor_builder)
-    : _ctx(ctx), _tensor_builder(tensor_builder)
+    : _ctx(ctx), _tensor_builder(tensor_builder), _current_subg_layout(model::Layout::UNKNOWN)
 {
   // DO NOTHING
 }
index b7ce8a2..f92e5dc 100644 (file)
@@ -49,7 +49,8 @@ namespace cpu
 KernelGenerator::KernelGenerator(const neurun::model::Operands &operand_ctx,
                                  const std::shared_ptr<TensorBuilder> &tensor_builder,
                                  const std::shared_ptr<custom::KernelRegistry> &kernel_registry)
-    : _ctx(operand_ctx), _tensor_builder(tensor_builder), _kernel_registry(kernel_registry)
+    : _ctx(operand_ctx), _tensor_builder(tensor_builder), _kernel_registry(kernel_registry),
+      _current_subg_layout(model::Layout::UNKNOWN)
 {
   // DO NOTHING
 }
index a3cca0c..3acb2cc 100644 (file)
@@ -196,11 +196,11 @@ private:
   }
 
 private:
-  std::shared_ptr<::neurun::backend::operand::IObject> _input;
-  std::shared_ptr<::neurun::backend::operand::IObject> _output;
-  model::Shape _output_shape;
+  std::shared_ptr<::neurun::backend::operand::IObject> _input{nullptr};
+  std::shared_ptr<::neurun::backend::operand::IObject> _output{nullptr};
+  model::Shape _output_shape{};
   model::operation::PermuteNode::Type _type{model::operation::PermuteNode::Type::COPY};
-  model::DataType _dataType;
+  model::DataType _dataType{model::DataType::FLOAT32};
 };
 
 } // namespace kernel
index da9a8c1..8e69892 100644 (file)
@@ -99,8 +99,8 @@ public:
   bool operator!=(const PermuteFactor &other) const { return !(*this == other); }
 
 private:
-  const backend::Backend *_backend;
-  model::Layout _layout;
+  const backend::Backend *_backend{nullptr};
+  model::Layout _layout{model::Layout::UNKNOWN};
 };
 
 } // namespace operand
index 96dc1b8..f9a96a3 100644 (file)
@@ -36,7 +36,10 @@ namespace compiler
 class OperationValidator : public model::OperationVisitor
 {
 public:
-  OperationValidator(const neurun::model::Operands &ctx) : _ctx{ctx} {}
+  OperationValidator(const neurun::model::Operands &ctx)
+      : _ctx{ctx}, _current_subg_layout{model::Layout::UNKNOWN}
+  {
+  }
 
 public:
   void visit(const model::Subgraph &node) override;