[neurun] Move Convert to backend/acl_cl (#3778)
author이한종/동작제어Lab(SR)/Engineer/삼성전자 <hanjoung.lee@samsung.com>
Mon, 3 Dec 2018 01:27:19 +0000 (10:27 +0900)
committer오형석/동작제어Lab(SR)/Staff Engineer/삼성전자 <hseok82.oh@samsung.com>
Mon, 3 Dec 2018 01:27:19 +0000 (10:27 +0900)
internal/Convert.h and the source file is acl_cl dependent, so it is
moved to `backend/acl_cl` dir.

Signed-off-by: Hanjoung Lee <hanjoung.lee@samsung.com>
runtimes/neurun/src/backend/acl_cl/Convert.cc [moved from runtimes/neurun/src/internal/Convert.cc with 92% similarity]
runtimes/neurun/src/backend/acl_cl/Convert.h [moved from runtimes/neurun/src/internal/Convert.h with 92% similarity]
runtimes/neurun/src/backend/acl_cl/TensorBuilder.cc
runtimes/neurun/src/backend/acl_cl/operand/CLTensor.cc
runtimes/neurun/src/backend/acl_cl/operand/CLTensor.h
runtimes/neurun/src/backend/cpu/TensorBuilder.cc
runtimes/neurun/src/compiler/OperationValidator.cc
runtimes/neurun/src/compiler/SubTensorAnalyzer.cc
runtimes/neurun/src/frontend/execution.cc
runtimes/neurun/src/linear/Linear.cc

similarity index 92%
rename from runtimes/neurun/src/internal/Convert.cc
rename to runtimes/neurun/src/backend/acl_cl/Convert.cc
index 73112cf..a75cc0d 100644 (file)
 #include "internal/Swizzle.h"
 #include "graph/operand/DataType.h"
 
-namespace internal
+namespace neurun
+{
+namespace backend
+{
+namespace acl_cl
 {
 
 ::arm_compute::TensorShape asTensorShape(const ::neurun::graph::operand::Shape &shape,
@@ -40,7 +44,8 @@ namespace internal
     // However, if the dimension correction is applied to input_to_input_weights with input_size
     // equal to 1, it will be changed to 1-D.
     // So input_to_input_weights is not used by the weight of FullyConnected.
-    res.set(ToARMComputeAxis(rank, axis).value(), shape.dim(axis), apply_dim_correction);
+    res.set(::internal::ToARMComputeAxis(rank, axis).value(), shape.dim(axis),
+            apply_dim_correction);
   }
 
   return res;
@@ -78,4 +83,6 @@ namespace internal
                                    asQuantizationInfo(typeInfo.scale(), typeInfo.offset()));
 }
 
-} // namespace internal
+} // namespace acl_cl
+} // namespace backend
+} // namespace neurun
similarity index 92%
rename from runtimes/neurun/src/internal/Convert.h
rename to runtimes/neurun/src/backend/acl_cl/Convert.h
index ad6e903..706e67c 100644 (file)
 #include "util/feature/Shape.h"
 #include "util/kernel/Shape.h"
 
-namespace internal
+namespace neurun
+{
+namespace backend
+{
+namespace acl_cl
 {
 
 ::arm_compute::TensorShape asTensorShape(const ::neurun::graph::operand::Shape &shape,
@@ -36,6 +40,8 @@ namespace internal
 ::arm_compute::TensorInfo asTensorInfo(const ::neurun::graph::operand::Shape &shape,
                                        const ::neurun::graph::operand::TypeInfo &typeInfo);
 
-} // namespace internal
+} // namespace acl_cl
+} // namespace backend
+} // namespace neurun
 
 #endif // __INTERNAL_CONVERT_H__
index 71d3590..e902071 100644 (file)
@@ -20,7 +20,7 @@
 #include <stack>
 
 #include "operand/Object.h"
-#include "internal/Convert.h"
+#include "Convert.h"
 
 #include "logging.h"
 
@@ -133,8 +133,8 @@ void TensorBuilder::prepare(void)
       // Child's type should be same with parent
       assert(info.type().offset() == parent_tensor->info()->quantization_info().offset);
       assert(info.type().scale() == parent_tensor->info()->quantization_info().scale);
-      assert(::internal::asDataType(info.type().type()) == parent_tensor->info()->data_type());
-      auto shape = ::internal::asTensorShape(info.shape());
+      assert(asDataType(info.type().type()) == parent_tensor->info()->data_type());
+      auto shape = asTensorShape(info.shape());
 
       // Only support axis: 3 (channel)
       ::arm_compute::Coordinates coordinates;
index 7889882..2a65d5a 100644 (file)
@@ -16,6 +16,8 @@
 
 #include "CLTensor.h"
 
+#include "backend/acl_cl/Convert.h"
+
 namespace neurun
 {
 namespace backend
@@ -28,7 +30,7 @@ namespace operand
 CLTensor::CLTensor(const compiler::TensorInfo &info)
     : _cl_tensor(std::make_shared<arm_compute::CLTensor>())
 {
-  auto acl_cl_info = ::internal::asTensorInfo(info.shape(), info.typeInfo());
+  auto acl_cl_info = asTensorInfo(info.shape(), info.typeInfo());
   allocator()->init(acl_cl_info);
 }
 
index 7b329a8..11a9e3f 100644 (file)
@@ -22,7 +22,6 @@
 #include <arm_compute/runtime/CL/CLScheduler.h>
 #include "arm_compute/runtime/CL/CLTensorAllocator.h"
 #include "ICLTensor.h"
-#include "internal/Convert.h"
 #include "compiler/TensorInfo.h"
 
 namespace neurun
index a6fb782..a9fb3c0 100644 (file)
@@ -21,8 +21,6 @@
 #include "operand/Object.h"
 #include "logging.h"
 
-#include "internal/Convert.h"
-
 namespace neurun
 {
 namespace backend
index d778b33..68a170e 100644 (file)
@@ -18,7 +18,6 @@
 
 #include <typeinfo>
 
-#include "internal/Convert.h"
 #include "graph/operand/Set.h"
 #include "graph/operation/LowerInfo.h"
 
index 39d6bbd..f75d61b 100644 (file)
@@ -19,7 +19,6 @@
 #include <typeinfo>
 
 #include "nnfw/std/memory.h"
-#include "internal/Convert.h"
 #include "graph/operand/Set.h"
 #include "graph/operation/LowerInfo.h"
 #include "logging.h"
index db5ee35..4cc7bb9 100644 (file)
@@ -26,7 +26,6 @@
 #include "graph/operand/Index.h"
 #include "kernel/cpu/PermuteLayer.h"
 #include "backend/cpu/operand/Tensor.h"
-#include "internal/Convert.h"
 #include "graph/operand/Layout.h"
 #include "backend/BackendManager.h"
 #include "backend/interface/IConfig.h"
index 986a337..7d1b7d0 100644 (file)
@@ -22,7 +22,6 @@
 
 #include "graph/operation/LowerInfo.h"
 #include "backend/interface/IStageGenerator.h"
-#include "internal/Convert.h"
 #include "backend/interface/IConfig.h"
 #include "compiler/SubTensorInfo.h"
 #include "compiler/TensorInfo.h"