summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author오형석/On-Device Lab(SR)/Staff Engineer/삼성전자 <hseok82.oh@samsung.com>2019-04-11 07:36:05 (GMT)
committer이춘석/On-Device Lab(SR)/Staff Engineer/삼성전자 <chunseok.lee@samsung.com>2019-04-11 07:36:05 (GMT)
commit8e90abb24322a1073375049c6c7ceff9c35d5e52 (patch)
tree8b064febe0483f8a3daf66b160d312cdd3e3bd0a
parenteaa17c3dd65f9959cedf6283d8d28171cfdcace0 (diff)
downloadnnfw-8e90abb24322a1073375049c6c7ceff9c35d5e52.zip
nnfw-8e90abb24322a1073375049c6c7ceff9c35d5e52.tar.gz
nnfw-8e90abb24322a1073375049c6c7ceff9c35d5e52.tar.bz2
Move backend cmake setting into each backend (#4976)
Move backend cmake variable setting into each backend Remove target check in backend Signed-off-by: Hyeongseok Oh <hseok82.oh@samsung.com>
-rw-r--r--runtimes/neurun/CMakeLists.txt16
-rw-r--r--runtimes/neurun/backend/CMakeLists.txt2
-rw-r--r--runtimes/neurun/backend/acl_cl/CMakeLists.txt3
-rw-r--r--runtimes/neurun/backend/acl_common/CMakeLists.txt6
-rw-r--r--runtimes/neurun/backend/acl_neon/CMakeLists.txt8
-rw-r--r--runtimes/neurun/backend/acl_neon/kernel/CMakeLists.txt5
-rw-r--r--runtimes/neurun/backend/cpu/CMakeLists.txt3
7 files changed, 21 insertions, 22 deletions
diff --git a/runtimes/neurun/CMakeLists.txt b/runtimes/neurun/CMakeLists.txt
index 1966bfa..af44f1c 100644
--- a/runtimes/neurun/CMakeLists.txt
+++ b/runtimes/neurun/CMakeLists.txt
@@ -4,26 +4,10 @@
# (currently used by cpu/acl_cl kernel module which is not proper)
set(NEURUN_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/core/include)
-# Build backends and their kernels
-set(LIB_NEURUN_KERNEL_CPU neurun_kernel_cpu)
-if(NOT "${TARGET_ARCH}" STREQUAL "x86_64")
- set(LIB_NEURUN_KERNEL_ACL_CL neurun_kernel_acl_cl)
- set(LIB_NEURUN_KERNEL_ACL_NEON neurun_kernel_acl_neon)
-endif(NOT "${TARGET_ARCH}" STREQUAL "x86_64")
-
-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)
- set(LIB_NEURUN_BACKEND_ACL_NEON neurun_backend_acl_neon)
- set(LIB_NEURUN_BACKEND_ACL_COMMON neurun_backend_acl_common)
-endif(NOT "${TARGET_ARCH}" STREQUAL "x86_64")
add_subdirectory(backend)
-
add_subdirectory(frontend)
-
add_subdirectory(core)
-
# TODO Extract this to `test/CMakeLists.txt`
# Unit Tests
diff --git a/runtimes/neurun/backend/CMakeLists.txt b/runtimes/neurun/backend/CMakeLists.txt
index 2b39b2e..648f410 100644
--- a/runtimes/neurun/backend/CMakeLists.txt
+++ b/runtimes/neurun/backend/CMakeLists.txt
@@ -1,3 +1,5 @@
+set(LIB_NEURUN_BACKEND_ACL_COMMON neurun_backend_acl_common)
+
add_subdirectory(cpu)
add_subdirectory(acl_cl)
add_subdirectory(acl_neon)
diff --git a/runtimes/neurun/backend/acl_cl/CMakeLists.txt b/runtimes/neurun/backend/acl_cl/CMakeLists.txt
index b636c7a..c9a7d51 100644
--- a/runtimes/neurun/backend/acl_cl/CMakeLists.txt
+++ b/runtimes/neurun/backend/acl_cl/CMakeLists.txt
@@ -4,6 +4,9 @@ if(NOT ARMCompute_FOUND)
return()
endif(NOT ARMCompute_FOUND)
+set(LIB_NEURUN_BACKEND_ACL_CL neurun_backend_acl_cl)
+set(LIB_NEURUN_KERNEL_ACL_CL neurun_kernel_acl_cl)
+
add_subdirectory(kernel)
file(GLOB_RECURSE SOURCES "*.cc")
diff --git a/runtimes/neurun/backend/acl_common/CMakeLists.txt b/runtimes/neurun/backend/acl_common/CMakeLists.txt
index 6ecd356..845ca9d 100644
--- a/runtimes/neurun/backend/acl_common/CMakeLists.txt
+++ b/runtimes/neurun/backend/acl_common/CMakeLists.txt
@@ -1,7 +1,9 @@
# Unsupported architecture
-if("${TARGET_ARCH}" STREQUAL "x86_64")
+nnfw_find_package(ARMCompute QUIET)
+if(NOT ARMCompute_FOUND)
return()
-endif("${TARGET_ARCH}" STREQUAL "x86_64")
+endif(NOT ARMCompute_FOUND)
+
file(GLOB SOURCES "*.cc")
diff --git a/runtimes/neurun/backend/acl_neon/CMakeLists.txt b/runtimes/neurun/backend/acl_neon/CMakeLists.txt
index e90f198..5d33ea1 100644
--- a/runtimes/neurun/backend/acl_neon/CMakeLists.txt
+++ b/runtimes/neurun/backend/acl_neon/CMakeLists.txt
@@ -1,7 +1,11 @@
# Unsupported architecture
-if("${TARGET_ARCH}" STREQUAL "x86_64")
+nnfw_find_package(ARMCompute QUIET)
+if(NOT ARMCompute_FOUND)
return()
-endif("${TARGET_ARCH}" STREQUAL "x86_64")
+endif(NOT ARMCompute_FOUND)
+
+set(LIB_NEURUN_BACKEND_ACL_NEON neurun_backend_acl_neon)
+set(LIB_NEURUN_KERNEL_ACL_NEON neurun_kernel_acl_neon)
add_subdirectory(kernel)
file(GLOB_RECURSE SOURCES "*.cc")
diff --git a/runtimes/neurun/backend/acl_neon/kernel/CMakeLists.txt b/runtimes/neurun/backend/acl_neon/kernel/CMakeLists.txt
index e7bc0e4..e6f8a0a 100644
--- a/runtimes/neurun/backend/acl_neon/kernel/CMakeLists.txt
+++ b/runtimes/neurun/backend/acl_neon/kernel/CMakeLists.txt
@@ -1,7 +1,8 @@
# Unsupported architecture
-if("${TARGET_ARCH}" STREQUAL "x86_64")
+nnfw_find_package(ARMCompute QUIET)
+if(NOT ARMCompute_FOUND)
return()
-endif("${TARGET_ARCH}" STREQUAL "x86_64")
+endif(NOT ARMCompute_FOUND)
file(GLOB SOURCES "*.cc")
diff --git a/runtimes/neurun/backend/cpu/CMakeLists.txt b/runtimes/neurun/backend/cpu/CMakeLists.txt
index fac5abe..b03b927 100644
--- a/runtimes/neurun/backend/cpu/CMakeLists.txt
+++ b/runtimes/neurun/backend/cpu/CMakeLists.txt
@@ -1,3 +1,6 @@
+set(LIB_NEURUN_BACKEND_CPU neurun_backend_cpu)
+set(LIB_NEURUN_KERNEL_CPU neurun_kernel_cpu)
+
add_subdirectory(kernel)
file(GLOB_RECURSE SOURCES "*.cc")