[neurun] Organize directories of backend impls (#4773)
author이한종/On-Device Lab(SR)/Engineer/삼성전자 <hanjoung.lee@samsung.com>
Mon, 18 Mar 2019 08:24:31 +0000 (17:24 +0900)
committer오형석/On-Device Lab(SR)/Staff Engineer/삼성전자 <hseok82.oh@samsung.com>
Mon, 18 Mar 2019 08:24:31 +0000 (17:24 +0900)
Extract backend implementations outside of `src` directory.

Now the directory structure is:

```
- neurun
  - frontend
    - nnapi
  - backend
    - acl_cl
    - cpu
  - src (will be `core`)
```

Signed-off-by: Hanjoung Lee <hanjoung.lee@samsung.com>
63 files changed:
runtimes/neurun/CMakeLists.txt
runtimes/neurun/backend/CMakeLists.txt [moved from runtimes/neurun/src/backend/CMakeLists.txt with 100% similarity]
runtimes/neurun/backend/acl_cl/CMakeLists.txt [moved from runtimes/neurun/src/backend/acl_cl/CMakeLists.txt with 91% similarity]
runtimes/neurun/backend/acl_cl/Config.cc [moved from runtimes/neurun/src/backend/acl_cl/Config.cc with 97% similarity]
runtimes/neurun/backend/acl_cl/Config.h [moved from runtimes/neurun/src/backend/acl_cl/Config.h with 100% similarity]
runtimes/neurun/backend/acl_cl/Convert.cc [moved from runtimes/neurun/src/backend/acl_cl/Convert.cc with 100% similarity]
runtimes/neurun/backend/acl_cl/Convert.h [moved from runtimes/neurun/src/backend/acl_cl/Convert.h with 100% similarity]
runtimes/neurun/backend/acl_cl/PluginClassesAllocator.cc [moved from runtimes/neurun/src/backend/acl_cl/PluginClassesAllocator.cc with 100% similarity]
runtimes/neurun/backend/acl_cl/StageGenerator.cc [moved from runtimes/neurun/src/backend/acl_cl/StageGenerator.cc with 99% similarity]
runtimes/neurun/backend/acl_cl/StageGenerator.h [moved from runtimes/neurun/src/backend/acl_cl/StageGenerator.h with 98% similarity]
runtimes/neurun/backend/acl_cl/Swizzle.h [moved from runtimes/neurun/src/backend/acl_cl/Swizzle.h with 100% similarity]
runtimes/neurun/backend/acl_cl/TensorBuilder.cc [moved from runtimes/neurun/src/backend/acl_cl/TensorBuilder.cc with 99% similarity]
runtimes/neurun/backend/acl_cl/TensorBuilder.h [moved from runtimes/neurun/src/backend/acl_cl/TensorBuilder.h with 95% similarity]
runtimes/neurun/backend/acl_cl/kernel/CLFunction.h [moved from runtimes/neurun/src/backend/acl_cl/kernel/CLFunction.h with 100% similarity]
runtimes/neurun/backend/acl_cl/kernel/CMakeLists.txt [moved from runtimes/neurun/src/backend/acl_cl/kernel/CMakeLists.txt with 88% similarity]
runtimes/neurun/backend/acl_cl/kernel/ConcatLayer.cc [moved from runtimes/neurun/src/backend/acl_cl/kernel/ConcatLayer.cc with 99% similarity]
runtimes/neurun/backend/acl_cl/kernel/ConcatLayer.h [moved from runtimes/neurun/src/backend/acl_cl/kernel/ConcatLayer.h with 97% similarity]
runtimes/neurun/backend/acl_cl/operand/CLSubTensor.cc [moved from runtimes/neurun/src/backend/acl_cl/operand/CLSubTensor.cc with 100% similarity]
runtimes/neurun/backend/acl_cl/operand/CLSubTensor.h [moved from runtimes/neurun/src/backend/acl_cl/operand/CLSubTensor.h with 100% similarity]
runtimes/neurun/backend/acl_cl/operand/CLTensor.cc [moved from runtimes/neurun/src/backend/acl_cl/operand/CLTensor.cc with 98% similarity]
runtimes/neurun/backend/acl_cl/operand/CLTensor.h [moved from runtimes/neurun/src/backend/acl_cl/operand/CLTensor.h with 100% similarity]
runtimes/neurun/backend/acl_cl/operand/ICLTensor.cc [moved from runtimes/neurun/src/backend/acl_cl/operand/ICLTensor.cc with 100% similarity]
runtimes/neurun/backend/acl_cl/operand/ICLTensor.h [moved from runtimes/neurun/src/backend/acl_cl/operand/ICLTensor.h with 100% similarity]
runtimes/neurun/backend/acl_cl/operand/Object.cc [moved from runtimes/neurun/src/backend/acl_cl/operand/Object.cc with 100% similarity]
runtimes/neurun/backend/acl_cl/operand/Object.h [moved from runtimes/neurun/src/backend/acl_cl/operand/Object.h with 97% similarity]
runtimes/neurun/backend/cpu/CMakeLists.txt [moved from runtimes/neurun/src/backend/cpu/CMakeLists.txt with 100% similarity]
runtimes/neurun/backend/cpu/Config.cc [moved from runtimes/neurun/src/backend/cpu/Config.cc with 96% similarity]
runtimes/neurun/backend/cpu/Config.h [moved from runtimes/neurun/src/backend/cpu/Config.h with 100% similarity]
runtimes/neurun/backend/cpu/MemoryPlanner.cc [moved from runtimes/neurun/src/backend/cpu/MemoryPlanner.cc with 100% similarity]
runtimes/neurun/backend/cpu/MemoryPlanner.h [moved from runtimes/neurun/src/backend/cpu/MemoryPlanner.h with 100% similarity]
runtimes/neurun/backend/cpu/MemoryPlannerFactory.cc [moved from runtimes/neurun/src/backend/cpu/MemoryPlannerFactory.cc with 100% similarity]
runtimes/neurun/backend/cpu/MemoryPlannerFactory.h [moved from runtimes/neurun/src/backend/cpu/MemoryPlannerFactory.h with 100% similarity]
runtimes/neurun/backend/cpu/PluginClassesAllocator.cc [moved from runtimes/neurun/src/backend/cpu/PluginClassesAllocator.cc with 100% similarity]
runtimes/neurun/backend/cpu/StageGenerator.cc [moved from runtimes/neurun/src/backend/cpu/StageGenerator.cc with 100% similarity]
runtimes/neurun/backend/cpu/StageGenerator.h [moved from runtimes/neurun/src/backend/cpu/StageGenerator.h with 98% similarity]
runtimes/neurun/backend/cpu/TensorBuilder.cc [moved from runtimes/neurun/src/backend/cpu/TensorBuilder.cc with 100% similarity]
runtimes/neurun/backend/cpu/TensorBuilder.h [moved from runtimes/neurun/src/backend/cpu/TensorBuilder.h with 97% similarity]
runtimes/neurun/backend/cpu/kernel/AvgPoolLayer.cc [moved from runtimes/neurun/src/backend/cpu/kernel/AvgPoolLayer.cc with 100% similarity]
runtimes/neurun/backend/cpu/kernel/AvgPoolLayer.h [moved from runtimes/neurun/src/backend/cpu/kernel/AvgPoolLayer.h with 100% similarity]
runtimes/neurun/backend/cpu/kernel/CMakeLists.txt [moved from runtimes/neurun/src/backend/cpu/kernel/CMakeLists.txt with 100% similarity]
runtimes/neurun/backend/cpu/kernel/ConcatLayer.cc [moved from runtimes/neurun/src/backend/cpu/kernel/ConcatLayer.cc with 100% similarity]
runtimes/neurun/backend/cpu/kernel/ConcatLayer.h [moved from runtimes/neurun/src/backend/cpu/kernel/ConcatLayer.h with 100% similarity]
runtimes/neurun/backend/cpu/kernel/ConvolutionLayer.cc [moved from runtimes/neurun/src/backend/cpu/kernel/ConvolutionLayer.cc with 100% similarity]
runtimes/neurun/backend/cpu/kernel/ConvolutionLayer.h [moved from runtimes/neurun/src/backend/cpu/kernel/ConvolutionLayer.h with 100% similarity]
runtimes/neurun/backend/cpu/kernel/DepthwiseConvolutionLayer.cc [moved from runtimes/neurun/src/backend/cpu/kernel/DepthwiseConvolutionLayer.cc with 100% similarity]
runtimes/neurun/backend/cpu/kernel/DepthwiseConvolutionLayer.h [moved from runtimes/neurun/src/backend/cpu/kernel/DepthwiseConvolutionLayer.h with 100% similarity]
runtimes/neurun/backend/cpu/kernel/FullyConnectedLayer.cc [moved from runtimes/neurun/src/backend/cpu/kernel/FullyConnectedLayer.cc with 100% similarity]
runtimes/neurun/backend/cpu/kernel/FullyConnectedLayer.h [moved from runtimes/neurun/src/backend/cpu/kernel/FullyConnectedLayer.h with 100% similarity]
runtimes/neurun/backend/cpu/kernel/MaxPoolLayer.cc [moved from runtimes/neurun/src/backend/cpu/kernel/MaxPoolLayer.cc with 100% similarity]
runtimes/neurun/backend/cpu/kernel/MaxPoolLayer.h [moved from runtimes/neurun/src/backend/cpu/kernel/MaxPoolLayer.h with 100% similarity]
runtimes/neurun/backend/cpu/kernel/OperationUtils.cc [moved from runtimes/neurun/src/backend/cpu/kernel/OperationUtils.cc with 100% similarity]
runtimes/neurun/backend/cpu/kernel/OperationUtils.h [moved from runtimes/neurun/src/backend/cpu/kernel/OperationUtils.h with 100% similarity]
runtimes/neurun/backend/cpu/kernel/PermuteLayer.cc [moved from runtimes/neurun/src/backend/cpu/kernel/PermuteLayer.cc with 100% similarity]
runtimes/neurun/backend/cpu/kernel/PermuteLayer.h [moved from runtimes/neurun/src/backend/cpu/kernel/PermuteLayer.h with 100% similarity]
runtimes/neurun/backend/cpu/kernel/ReshapeLayer.cc [moved from runtimes/neurun/src/backend/cpu/kernel/ReshapeLayer.cc with 100% similarity]
runtimes/neurun/backend/cpu/kernel/ReshapeLayer.h [moved from runtimes/neurun/src/backend/cpu/kernel/ReshapeLayer.h with 100% similarity]
runtimes/neurun/backend/cpu/kernel/SoftMaxLayer.cc [moved from runtimes/neurun/src/backend/cpu/kernel/SoftMaxLayer.cc with 100% similarity]
runtimes/neurun/backend/cpu/kernel/SoftMaxLayer.h [moved from runtimes/neurun/src/backend/cpu/kernel/SoftMaxLayer.h with 100% similarity]
runtimes/neurun/backend/cpu/operand/Object.cc [moved from runtimes/neurun/src/backend/cpu/operand/Object.cc with 100% similarity]
runtimes/neurun/backend/cpu/operand/Object.h [moved from runtimes/neurun/src/backend/cpu/operand/Object.h with 100% similarity]
runtimes/neurun/backend/cpu/operand/Tensor.cc [moved from runtimes/neurun/src/backend/cpu/operand/Tensor.cc with 100% similarity]
runtimes/neurun/backend/cpu/operand/Tensor.h [moved from runtimes/neurun/src/backend/cpu/operand/Tensor.h with 100% similarity]
runtimes/neurun/test/backend/cpu/MemoryPlanner.cc

index cc0d2f7..689d0b0 100644 (file)
@@ -12,7 +12,7 @@ set(LIB_NEURUN_BACKEND_CPU neurun_backend_cpu)
 if(NOT "${TARGET_ARCH}" STREQUAL "x86_64")
   set(LIB_NEURUN_BACKEND_ACL_CL neurun_backend_acl_cl)
 endif(NOT "${TARGET_ARCH}" STREQUAL "x86_64")
-add_subdirectory(src/backend)
+add_subdirectory(backend)
 
 add_subdirectory(frontend)
 
@@ -47,8 +47,11 @@ set(TEST_NEURUN test_neurun)
 file(GLOB_RECURSE TESTS "test/*.cc")
 
 add_executable(${TEST_NEURUN} ${TESTS})
+
 # NOTE This line is a workaround to resolve compilation error
 target_include_directories(${TEST_NEURUN} PRIVATE frontend/nnapi)
+target_include_directories(${TEST_NEURUN} PRIVATE backend/cpu)
+
 target_link_libraries(${TEST_NEURUN} ${LIB_NEURUN})
 target_link_libraries(${TEST_NEURUN} gtest)
 target_link_libraries(${TEST_NEURUN} gtest_main)
@@ -11,6 +11,7 @@ list(REMOVE_ITEM SOURCES ${REMOVE_KERNEL_SOURCES})
 add_library(${LIB_NEURUN_BACKEND_ACL_CL} SHARED ${SOURCES})
 
 target_include_directories(${LIB_NEURUN_BACKEND_ACL_CL} PUBLIC ${NEURUN_INCLUDE_DIR})
+target_include_directories(${LIB_NEURUN_BACKEND_ACL_CL} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
 
 target_link_libraries(${LIB_NEURUN_BACKEND_ACL_CL} nnapi-header)
 target_link_libraries(${LIB_NEURUN_BACKEND_ACL_CL} arm_compute)
similarity index 97%
rename from runtimes/neurun/src/backend/acl_cl/Config.cc
rename to runtimes/neurun/backend/acl_cl/Config.cc
index 5d80a4f..0c07691 100644 (file)
@@ -21,7 +21,7 @@
 
 #include <arm_compute/runtime/CL/CLScheduler.h>
 
-#include "backend/acl_cl/Config.h"
+#include "Config.h"
 
 namespace neurun
 {
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-#include "backend/acl_cl/StageGenerator.h"
+#include "StageGenerator.h"
 
 #include "kernel/CLFunction.h"
 
@@ -20,7 +20,7 @@
 #include "backend/interface/IStageGenerator.h"
 
 #include "model/operand/Set.h"
-#include "backend/acl_cl/TensorBuilder.h"
+#include "TensorBuilder.h"
 
 namespace neurun
 {
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-#include "backend/acl_cl/TensorBuilder.h"
+#include "TensorBuilder.h"
 
 #include <cassert>
 #include <stack>
@@ -18,9 +18,9 @@
 #define __NEURUN_BACKEND_ACL_CL_TENSOR_BUILDER_H__
 
 #include "backend/interface/ITensorBuilder.h"
-#include "backend/acl_cl/operand/CLTensor.h"
-#include "backend/acl_cl/operand/CLSubTensor.h"
-#include "backend/acl_cl/operand/Object.h"
+#include "operand/CLTensor.h"
+#include "operand/CLSubTensor.h"
+#include "operand/Object.h"
 #include "model/operand/IndexMap.h"
 
 namespace neurun
@@ -8,6 +8,7 @@ file(GLOB SOURCES "*.cc")
 add_library(${LIB_NEURUN_KERNEL_ACL_CL} STATIC ${SOURCES})
 
 target_include_directories(${LIB_NEURUN_KERNEL_ACL_CL} PUBLIC ${NEURUN_INCLUDE_DIR})
+target_include_directories(${LIB_NEURUN_KERNEL_ACL_CL} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/..)
 
 target_link_libraries(${LIB_NEURUN_KERNEL_ACL_CL} nnapi-header)
 target_link_libraries(${LIB_NEURUN_KERNEL_ACL_CL} arm_compute)
@@ -19,7 +19,7 @@
 #include <arm_compute/runtime/CL/CLScheduler.h>
 
 #include "util/feature/nchw/View.h"
-#include "backend/acl_cl/Swizzle.h"
+#include "Swizzle.h"
 #include "util/logging.h"
 
 namespace
@@ -22,7 +22,7 @@
 #include <arm_compute/runtime/IFunction.h>
 #include <arm_compute/core/Types.h>
 
-#include "backend/acl_cl/operand/ICLTensor.h"
+#include "operand/ICLTensor.h"
 
 namespace neurun
 {
@@ -19,7 +19,7 @@
 #include <arm_compute/runtime/CL/CLMemoryRegion.h>
 #include "CLTensor.h"
 
-#include "backend/acl_cl/Convert.h"
+#include "Convert.h"
 
 namespace neurun
 {
@@ -20,7 +20,7 @@
 #include <memory>
 
 #include "backend/interface/operand/IObject.h"
-#include "backend/acl_cl/operand/ICLTensor.h"
+#include "operand/ICLTensor.h"
 
 namespace neurun
 {
similarity index 96%
rename from runtimes/neurun/src/backend/cpu/Config.cc
rename to runtimes/neurun/backend/cpu/Config.cc
index 001ba9d..1a487f7 100644 (file)
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-#include "backend/cpu/Config.h"
+#include "Config.h"
 
 namespace neurun
 {
@@ -20,7 +20,7 @@
 #include "backend/interface/IStageGenerator.h"
 
 #include "model/operand/Set.h"
-#include "backend/cpu/operand/Tensor.h"
+#include "operand/Tensor.h"
 #include "TensorBuilder.h"
 
 namespace neurun
@@ -20,8 +20,8 @@
 #include <unordered_map>
 
 #include "backend/interface/ITensorBuilder.h"
-#include "backend/cpu/operand/Tensor.h"
-#include "backend/cpu/operand/Object.h"
+#include "operand/Tensor.h"
+#include "operand/Object.h"
 #include "model/operand/IndexMap.h"
 #include "MemoryPlanner.h"
 
index 04f2e5d..0fabb80 100644 (file)
@@ -16,7 +16,7 @@
 
 #include <gtest/gtest.h>
 
-#include "backend/cpu/MemoryPlanner.h"
+#include "MemoryPlanner.h"
 #include "model/operand/Index.h"
 
 TEST(Allocator, allocate_test)