From d04ca585947743568fa0f47b6ff769faa8f0406a 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: Fri, 6 Sep 2019 12:40:17 +0900 Subject: [PATCH] Use option for srcn kernel build (#7222) Change to use srcn kernel build option BUILD_SRCN_KERNEL Signed-off-by: Hyeongseok Oh --- infra/nnfw/cmake/CfgOptionFlags.cmake | 1 + infra/nnfw/cmake/options/options_aarch64-linux.cmake | 1 + infra/nnfw/cmake/options/options_aarch64-tizen.cmake | 1 + infra/nnfw/cmake/options/options_armv7l-linux.cmake | 1 + infra/nnfw/cmake/options/options_armv7l-tizen.cmake | 1 + runtimes/libs/srcn/CMakeLists.txt | 17 +++++++---------- runtimes/neurun/backend/srcn/CMakeLists.txt | 4 ++-- 7 files changed, 14 insertions(+), 12 deletions(-) diff --git a/infra/nnfw/cmake/CfgOptionFlags.cmake b/infra/nnfw/cmake/CfgOptionFlags.cmake index 9bc7276..3917ee8 100644 --- a/infra/nnfw/cmake/CfgOptionFlags.cmake +++ b/infra/nnfw/cmake/CfgOptionFlags.cmake @@ -26,6 +26,7 @@ option(BUILD_NNAPI_QUICKCHECK "Build NN API Quickcheck tools" OFF) option(BUILD_TOOLS "Bulid nnfw projects under tools/" ON) option(BUILD_TFLITE_ACCURACY "Build tflite accuracy tool" OFF) option(BUILD_NNPACKAGE_RUN "Build nnpackge_run" ON) +option(BUILD_SRCN_KERNEL "Build srcn kernel" OFF) # # Build configuration for contrib # diff --git a/infra/nnfw/cmake/options/options_aarch64-linux.cmake b/infra/nnfw/cmake/options/options_aarch64-linux.cmake index c5e3995..fbe49d4 100644 --- a/infra/nnfw/cmake/options/options_aarch64-linux.cmake +++ b/infra/nnfw/cmake/options/options_aarch64-linux.cmake @@ -5,3 +5,4 @@ option(BUILD_ARMCOMPUTE "Build ARM Compute from the downloaded source" ON) option(BUILD_ANDROID_TFLITE "Enable android support for TensorFlow Lite" OFF) option(DOWNLOAD_ARMCOMPUTE "Download ARM Compute source" ON) option(DOWNLOAD_NEON2SSE "Download NEON2SSE library source" OFF) +option(BUILD_SRCN_KERNEL "Build srcn kernel" ON) diff --git a/infra/nnfw/cmake/options/options_aarch64-tizen.cmake b/infra/nnfw/cmake/options/options_aarch64-tizen.cmake index 40209e4..039eade 100644 --- a/infra/nnfw/cmake/options/options_aarch64-tizen.cmake +++ b/infra/nnfw/cmake/options/options_aarch64-tizen.cmake @@ -6,3 +6,4 @@ option(BUILD_ANDROID_TFLITE "Enable android support for TensorFlow Lite" OFF) option(DOWNLOAD_ARMCOMPUTE "Download ARM Compute source" ON) option(DOWNLOAD_NEON2SSE "Download NEON2SSE library source" OFF) option(DOWNLOAD_NNPACK "Download NNPACK library source" OFF) +option(BUILD_SRCN_KERNEL "Build srcn kernel" ON) diff --git a/infra/nnfw/cmake/options/options_armv7l-linux.cmake b/infra/nnfw/cmake/options/options_armv7l-linux.cmake index 5c62933..f06f998 100644 --- a/infra/nnfw/cmake/options/options_armv7l-linux.cmake +++ b/infra/nnfw/cmake/options/options_armv7l-linux.cmake @@ -5,3 +5,4 @@ option(BUILD_ARMCOMPUTE "Build ARM Compute from the downloaded source" ON) option(BUILD_ANDROID_TFLITE "Enable android support for TensorFlow Lite" OFF) option(DOWNLOAD_ARMCOMPUTE "Download ARM Compute source" ON) option(DOWNLOAD_NEON2SSE "Download NEON2SSE library source" OFF) +option(BUILD_SRCN_KERNEL "Build srcn kernel" ON) diff --git a/infra/nnfw/cmake/options/options_armv7l-tizen.cmake b/infra/nnfw/cmake/options/options_armv7l-tizen.cmake index ca35126..a1d6cd0 100644 --- a/infra/nnfw/cmake/options/options_armv7l-tizen.cmake +++ b/infra/nnfw/cmake/options/options_armv7l-tizen.cmake @@ -8,3 +8,4 @@ option(DOWNLOAD_NEON2SSE "Download NEON2SSE library source" OFF) option(DOWNLOAD_NNPACK "Download NNPACK library source" OFF) option(BUILD_TFLITE_LOADER "Build tensorflow lite file loader" ON) option(BUILD_TFLITE_LOADER_TEST_TOOL "Build tflite loader testing tool" OFF) +option(BUILD_SRCN_KERNEL "Build srcn kernel" ON) diff --git a/runtimes/libs/srcn/CMakeLists.txt b/runtimes/libs/srcn/CMakeLists.txt index 3ec5225..f622667 100644 --- a/runtimes/libs/srcn/CMakeLists.txt +++ b/runtimes/libs/srcn/CMakeLists.txt @@ -1,19 +1,16 @@ +if(NOT BUILD_SRCN_KERNEL) + message(STATUS "SRCN kernel library build: disabled") + return() +else(NOT BUILD_SRCN_KERNEL) + message(STATUS "SRCN kernel library build: OK") +endif() + # Find and use pre-installed OpenMP find_package(OpenMP QUIET) if(NOT OpenMP_FOUND) return() endif(NOT OpenMP_FOUND) -# Include arm_neon.h in src/common.h -# TODO Find the way to find arm_neon.h file without specifying the location explicitly -find_path(TARGET_HEADER arm_neon.h PATHS "/usr/lib/gcc/arm-linux-gnueabihf/5/include") -if(NOT TARGET_HEADER) - message(STATUS "Check for SRCN kernel library build: need arm_neon header") - return() -else(NOT TARGET_HEADER) - message(STATUS "Check for SRCN kernel library build: OK") -endif(NOT TARGET_HEADER) - file(GLOB_RECURSE SOURCES "*.cc") file(GLOB_RECURSE TESTS "*_test.cc") list(REMOVE_ITEM SOURCES ${TESTS}) diff --git a/runtimes/neurun/backend/srcn/CMakeLists.txt b/runtimes/neurun/backend/srcn/CMakeLists.txt index 4429c4f..b51b951 100644 --- a/runtimes/neurun/backend/srcn/CMakeLists.txt +++ b/runtimes/neurun/backend/srcn/CMakeLists.txt @@ -1,5 +1,5 @@ -# Unsupported architecture -if("${TARGET_ARCH}" STREQUAL "x86_64") +if(NOT BUILD_SRCN_KERNEL) + message(STATUS "Skip building SRCN backend: SRCN kernel library is not build") return() endif() -- 2.7.4