[neurun] Define default value in constructor (#2567)
author오형석/동작제어Lab(SR)/Staff Engineer/삼성전자 <hseok82.oh@samsung.com>
Tue, 4 Sep 2018 04:54:08 +0000 (13:54 +0900)
committerGitHub Enterprise <noreply-CODE@samsung.com>
Tue, 4 Sep 2018 04:54:08 +0000 (13:54 +0900)
Define default value in constructor for kernel

Signed-off-by: Hyeongseok Oh <hseok82.oh@samsung.com>
16 files changed:
runtimes/neurun/src/kernel/acl_cl/ConcatLayer.cc
runtimes/neurun/src/kernel/acl_cl/ConcatLayer.h
runtimes/neurun/src/kernel/cpu/AvgPoolLayer.cc
runtimes/neurun/src/kernel/cpu/AvgPoolLayer.h
runtimes/neurun/src/kernel/cpu/ConcatLayer.cc
runtimes/neurun/src/kernel/cpu/ConcatLayer.h
runtimes/neurun/src/kernel/cpu/ConvolutionLayer.cc
runtimes/neurun/src/kernel/cpu/ConvolutionLayer.h
runtimes/neurun/src/kernel/cpu/FullyConnectedLayer.cc
runtimes/neurun/src/kernel/cpu/FullyConnectedLayer.h
runtimes/neurun/src/kernel/cpu/MaxPoolLayer.cc
runtimes/neurun/src/kernel/cpu/MaxPoolLayer.h
runtimes/neurun/src/kernel/cpu/ReshapeLayer.cc
runtimes/neurun/src/kernel/cpu/ReshapeLayer.h
runtimes/neurun/src/kernel/cpu/SoftMaxLayer.cc
runtimes/neurun/src/kernel/cpu/SoftMaxLayer.h

index f71c8af..f2a8dae 100644 (file)
@@ -49,6 +49,12 @@ namespace kernel
 namespace acl_cl
 {
 
+ConcatLayer::ConcatLayer()
+    : _input_allocs(), _output_alloc(nullptr), _axis(0), _input_type(OperandType::FLOAT32)
+{
+  // DO NOTHING
+}
+
 bool ConcatLayer::concatenationFloat32()
 {
   // Input and output size check
index 1341832..d6e7d7d 100644 (file)
@@ -43,7 +43,7 @@ namespace acl_cl
 class ConcatLayer : public ::arm_compute::IFunction
 {
 public:
-  ConcatLayer() {}
+  ConcatLayer();
 
 public:
   void configure(const std::vector<::arm_compute::ICLTensor *> &input_allocs,
index e5e118c..b11fc3b 100644 (file)
@@ -36,6 +36,15 @@ namespace cpu
   uint32_t paddingHeight = (uint32_t)_paddingTop;           \
   uint32_t paddingWidth = (uint32_t)_paddingLeft;
 
+AvgPoolLayer::AvgPoolLayer()
+    : _inputData(nullptr), _outputData(nullptr), _inputShape(), _outputShape(), _paddingLeft(0),
+      _paddingTop(0), _paddingRight(0), _paddingBottom(0), _strideWidth(0), _strideHeight(0),
+      _kernelWidth(0), _kernelHeight(0), _activation(ANEURALNETWORKS_FUSED_NONE),
+      _inputType(OperandType::FLOAT32)
+{
+  // DO NOTHING
+}
+
 bool AvgPoolLayer::averagePoolFloat32()
 {
 
index 5d2540c..2d74eeb 100644 (file)
@@ -19,7 +19,7 @@ namespace cpu
 class AvgPoolLayer : public ::arm_compute::IFunction
 {
 public:
-  AvgPoolLayer() {}
+  AvgPoolLayer();
 
 public:
   bool averagePoolFloat32();
index 5c2c207..4514d5d 100644 (file)
@@ -27,6 +27,13 @@ namespace kernel
 namespace cpu
 {
 
+ConcatLayer::ConcatLayer()
+    : _inputDataPtrs(), _outputData(nullptr), _axis(0), _inputShapes(), _outputShape(),
+      _inputType(OperandType::FLOAT32)
+{
+  // DO NOTHING
+}
+
 bool ConcatLayer::concatenationFloat32()
 {
   int num_inputs = _inputShapes.size();
index a209de0..6c02172 100644 (file)
@@ -36,7 +36,7 @@ namespace cpu
 class ConcatLayer : public ::arm_compute::IFunction
 {
 public:
-  ConcatLayer() {}
+  ConcatLayer();
 
 public:
   bool concatenationFloat32();
index 8524eee..b84b545 100644 (file)
@@ -68,6 +68,15 @@ static std::mutex executionMutex;
     im2colGuard.reset(im2colData);                                            \
   }
 
+ConvolutionLayer::ConvolutionLayer()
+    : _inputData(nullptr), _kernelData(nullptr), _outputData(nullptr), _biasData(nullptr),
+      _inputShape(), _kernelShape(), _outputShape(), _biasShape(), _paddingLeft(0), _paddingTop(0),
+      _paddingRight(0), _paddingBottom(0), _strideWidth(0), _strideHeight(0),
+      _activation(ANEURALNETWORKS_FUSED_NONE), _inputType(OperandType::FLOAT32)
+{
+  // DO NOTHING
+}
+
 bool ConvolutionLayer::convFloat32()
 {
   ANDROID_NN_CONV_PARAMETERS(float)
index 44ffc3e..8b07286 100644 (file)
@@ -19,7 +19,7 @@ namespace cpu
 class ConvolutionLayer : public ::arm_compute::IFunction
 {
 public:
-  ConvolutionLayer() {}
+  ConvolutionLayer();
 
 public:
   bool convFloat32();
index a43811e..cbd2ef8 100644 (file)
@@ -30,6 +30,14 @@ namespace kernel
 namespace cpu
 {
 
+FullyConnectedLayer::FullyConnectedLayer()
+    : _inputData(nullptr), _weightsData(nullptr), _biasData(nullptr), _outputData(nullptr),
+      _inputShape(), _weightsShape(), _biasShape(), _outputShape(),
+      _activation(ANEURALNETWORKS_FUSED_NONE), _inputType(OperandType::FLOAT32)
+{
+  // DO NOTHING
+}
+
 // executionMutex is used to protect concurrent access of non-threadsafe resources
 // like gemmlowp::GemmContext.
 // std::mutex is safe for pthreads on Android.
index 637cf54..d91dc0f 100644 (file)
@@ -19,7 +19,7 @@ namespace cpu
 class FullyConnectedLayer : public ::arm_compute::IFunction
 {
 public:
-  FullyConnectedLayer() {}
+  FullyConnectedLayer();
 
 public:
   bool fullyConnectedFloat32();
index e40974e..79af572 100644 (file)
@@ -19,6 +19,15 @@ namespace cpu
   uint32_t paddingHeight = (uint32_t)_paddingTop;           \
   uint32_t paddingWidth = (uint32_t)_paddingLeft;
 
+MaxPoolLayer::MaxPoolLayer()
+    : _inputData(nullptr), _outputData(nullptr), _inputShape(), _outputShape(), _paddingLeft(0),
+      _paddingTop(0), _paddingRight(0), _paddingBottom(0), _strideWidth(0), _strideHeight(0),
+      _kernelWidth(0), _kernelHeight(0), _activation(ANEURALNETWORKS_FUSED_NONE),
+      _inputType(OperandType::FLOAT32)
+{
+  // DO NOTHING
+}
+
 bool MaxPoolLayer::maxPoolFloat32()
 {
 
index 60d15f9..57652cf 100644 (file)
@@ -19,7 +19,7 @@ namespace cpu
 class MaxPoolLayer : public ::arm_compute::IFunction
 {
 public:
-  MaxPoolLayer() {}
+  MaxPoolLayer();
 
 public:
   bool maxPoolFloat32();
index 3e5b442..377f783 100644 (file)
@@ -28,6 +28,12 @@ namespace kernel
 namespace cpu
 {
 
+ReshapeLayer::ReshapeLayer()
+    : _inputData(nullptr), _outputData(nullptr), _inputShape(), _outputShape()
+{
+  // DO NOTHING
+}
+
 bool ReshapeLayer::reshapeGeneric()
 {
   size_t count = sizeOfData(_inputShape.type, _inputShape.dimensions);
index 23ac710..7da7217 100644 (file)
@@ -19,7 +19,7 @@ namespace cpu
 class ReshapeLayer : public ::arm_compute::IFunction
 {
 public:
-  ReshapeLayer() {}
+  ReshapeLayer();
 
 public:
   bool reshapeGeneric();
index 5c3e82e..af2c944 100644 (file)
@@ -10,6 +10,13 @@ namespace kernel
 namespace cpu
 {
 
+SoftMaxLayer::SoftMaxLayer()
+    : _inputData(nullptr), _outputData(nullptr), _beta(0.0), _inputShape(), _outputShape(),
+      _inputType(OperandType::FLOAT32)
+{
+  // DO NOTHING
+}
+
 bool SoftMaxLayer::softmaxFloat32()
 {
   ::tflite::Dims<4> dim;
index 0008ba4..c8838ab 100644 (file)
@@ -19,7 +19,7 @@ namespace cpu
 class SoftMaxLayer : public ::arm_compute::IFunction
 {
 public:
-  SoftMaxLayer() {}
+  SoftMaxLayer();
 
 public:
   bool softmaxFloat32();