From 8e90abb24322a1073375049c6c7ceff9c35d5e52 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=EC=98=A4=ED=98=95=EC=84=9D/On-Device=20Lab=28SR=29/Staff?= =?utf8?q?=20Engineer/=EC=82=BC=EC=84=B1=EC=A0=84=EC=9E=90?= Date: Thu, 11 Apr 2019 16:36:05 +0900 Subject: [PATCH] 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 --- runtimes/neurun/CMakeLists.txt | 16 ---------------- runtimes/neurun/backend/CMakeLists.txt | 2 ++ runtimes/neurun/backend/acl_cl/CMakeLists.txt | 3 +++ runtimes/neurun/backend/acl_common/CMakeLists.txt | 6 ++++-- runtimes/neurun/backend/acl_neon/CMakeLists.txt | 8 ++++++-- runtimes/neurun/backend/acl_neon/kernel/CMakeLists.txt | 5 +++-- runtimes/neurun/backend/cpu/CMakeLists.txt | 3 +++ 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") -- 2.7.4