[neurun] Separate CMakeLists for frontend/nnapi (#4760)
author이한종/On-Device Lab(SR)/Engineer/삼성전자 <hanjoung.lee@samsung.com>
Mon, 18 Mar 2019 01:06:00 +0000 (10:06 +0900)
committer오형석/On-Device Lab(SR)/Staff Engineer/삼성전자 <hseok82.oh@samsung.com>
Mon, 18 Mar 2019 01:06:00 +0000 (10:06 +0900)
Separate CMakeLists for frontend/nnapi. And corresponding inclusion path
fixes.

Signed-off-by: Hanjoung Lee <hanjoung.lee@samsung.com>
runtimes/neurun/CMakeLists.txt
runtimes/neurun/frontend/CMakeLists.txt [new file with mode: 0644]
runtimes/neurun/frontend/nnapi/CMakeLists.txt [new file with mode: 0644]
runtimes/neurun/frontend/nnapi/frontend/compilation.cc
runtimes/neurun/frontend/nnapi/frontend/event.cc
runtimes/neurun/frontend/nnapi/frontend/execution.cc
runtimes/neurun/frontend/nnapi/frontend/memory.cc
runtimes/neurun/frontend/nnapi/frontend/model.cc

index d8bacef..cc0d2f7 100644 (file)
@@ -14,6 +14,8 @@ if(NOT "${TARGET_ARCH}" STREQUAL "x86_64")
 endif(NOT "${TARGET_ARCH}" STREQUAL "x86_64")
 add_subdirectory(src/backend)
 
+add_subdirectory(frontend)
+
 file(GLOB SOURCES "src/*.cc")
 file(GLOB SOURCES_BACKEND "src/backend/*.cc")
 file(GLOB_RECURSE SOURCES_GRAPH "src/graph/*.cc")
@@ -37,20 +39,6 @@ target_link_libraries(neurun-core nnfw_lib_misc)
 target_link_libraries(neurun-core nnfw_lib_cpp14)
 target_compile_options(neurun-core PRIVATE -Wall -Wextra -Werror)
 
-file(GLOB_RECURSE SOURCES_FRONTEND "frontend/nnapi/*.cc")
-
-add_library(${LIB_NEURUN} SHARED ${SOURCES_FRONTEND})
-target_include_directories(${LIB_NEURUN} PRIVATE frontend/nnapi)
-target_include_directories(${LIB_NEURUN} PUBLIC ${NEURUN_INCLUDE_DIR})
-target_include_directories(${LIB_NEURUN} PUBLIC ${CMAKE_SOURCE_DIR}/externals/tensorflow)
-target_link_libraries(${LIB_NEURUN} neurun-core)
-
-target_compile_options(${LIB_NEURUN} PRIVATE -Wall -Wextra -Werror)
-
-set_target_properties(${LIB_NEURUN} PROPERTIES OUTPUT_NAME neuralnetworks)
-
-install(TARGETS ${LIB_NEURUN} DESTINATION lib/neurun)
-
 
 # Unit Tests
 
diff --git a/runtimes/neurun/frontend/CMakeLists.txt b/runtimes/neurun/frontend/CMakeLists.txt
new file mode 100644 (file)
index 0000000..5ea6cda
--- /dev/null
@@ -0,0 +1 @@
+add_subdirectories()
diff --git a/runtimes/neurun/frontend/nnapi/CMakeLists.txt b/runtimes/neurun/frontend/nnapi/CMakeLists.txt
new file mode 100644 (file)
index 0000000..b372da1
--- /dev/null
@@ -0,0 +1,13 @@
+file(GLOB_RECURSE SOURCES_FRONTEND "*.cc")
+
+add_library(${LIB_NEURUN} SHARED ${SOURCES_FRONTEND})
+target_include_directories(${LIB_NEURUN} PUBLIC ${NEURUN_INCLUDE_DIR})
+target_include_directories(${LIB_NEURUN} PUBLIC ${CMAKE_SOURCE_DIR}/externals/tensorflow)
+target_link_libraries(${LIB_NEURUN} neurun-core)
+
+target_compile_options(${LIB_NEURUN} PRIVATE -Wall -Wextra -Werror)
+
+set_target_properties(${LIB_NEURUN} PROPERTIES OUTPUT_NAME neuralnetworks)
+
+install(TARGETS ${LIB_NEURUN} DESTINATION lib/neurun)
+
index 07d9b13..a79bc1c 100644 (file)
@@ -18,8 +18,8 @@
 
 #include <new>
 
-#include "frontend/wrapper/model.h"
-#include "frontend/wrapper/compilation.h"
+#include "wrapper/model.h"
+#include "wrapper/compilation.h"
 #include "util/logging.h"
 
 //
index cd47cc6..7c2836d 100644 (file)
@@ -16,7 +16,7 @@
 
 #include <NeuralNetworks.h>
 
-#include "frontend/wrapper/event.h"
+#include "wrapper/event.h"
 
 int ANeuralNetworksEvent_wait(ANeuralNetworksEvent *event)
 {
index 6a89f89..4463c8e 100644 (file)
@@ -18,9 +18,9 @@
 
 #include <new>
 
-#include "frontend/wrapper/compilation.h"
-#include "frontend/wrapper/execution.h"
-#include "frontend/wrapper/event.h"
+#include "wrapper/compilation.h"
+#include "wrapper/execution.h"
+#include "wrapper/event.h"
 #include "util/logging.h"
 
 //
index b2f6ab2..e28d1df 100644 (file)
@@ -20,7 +20,7 @@
 #include <memory>
 
 #include "cpp14/memory.h"
-#include "frontend/wrapper/memory.h"
+#include "wrapper/memory.h"
 
 int ANeuralNetworksMemory_createFromFd(size_t size, int protect, int fd, size_t offset,
                                        ANeuralNetworksMemory **memory)
index a3b5dd8..89a54f3 100644 (file)
@@ -19,8 +19,8 @@
 
 #include <new>
 
-#include "frontend/wrapper/model.h"
-#include "frontend/wrapper/memory.h"
+#include "wrapper/model.h"
+#include "wrapper/memory.h"
 #include "util/logging.h"
 
 int ANeuralNetworksModel_create(ANeuralNetworksModel **model)