Always require NEON2SSESource for TFLITE build (#4620)
author박종현/On-Device Lab(SR)/Staff Engineer/삼성전자 <jh1302.park@samsung.com>
Thu, 7 Mar 2019 03:31:52 +0000 (12:31 +0900)
committer박세희/On-Device Lab(SR)/Principal Engineer/삼성전자 <saehie.park@samsung.com>
Thu, 7 Mar 2019 03:31:51 +0000 (12:31 +0900)
* Always require NEON2SSESource for TFLITE build

NEON2SSE is a header-only library, and thus there is no need to exclude
it for cross or arm native build.

Signed-off-by: Jonghyun Park <jh1302.park@samsung.com>
* Check TARGET_ARCH in NEON2SSESource package

cmake/packages/NEON2SSESourceConfig.cmake
externals/CMakeLists.txt

index b656f57..f39e842 100644 (file)
@@ -4,6 +4,12 @@ function(_NEON2SSESource_import)
     return()
   endif(NOT DOWNLOAD_NEON2SSE)
 
+  # TODO Remove this workaround once target preset is ready
+  if(NOT (TARGET_ARCH_BASE STREQUAL "x86_64"))
+    set(NEON2SSESource_FOUND FALSE PARENT_SCOPE)
+    return()
+  endif(NOT (TARGET_ARCH_BASE STREQUAL "x86_64"))
+
   nnfw_include(ExternalSourceTools)
   nnfw_include(OptionTools)
 
index b51aa45..a63c072 100644 (file)
@@ -50,11 +50,11 @@ list(APPEND TFLITE_INCLUDES "${TFLITE_DEPEND_DIR}/gemmlowp")
 list(APPEND TFLITE_INCLUDES "${TFLITE_DEPEND_DIR}/farmhash/src")
 list(APPEND TFLITE_INCLUDES "${TFLITE_DEPEND_DIR}/flatbuffers/include")
 
-if(BUILD_IS_NATIVE AND NOT HOST_ARCH_BASE STREQUAL "arm")
-  # Required external sourcefor x86-64 build
-  nnfw_find_package(NEON2SSESource REQUIRED)
-  list(APPEND TFLITE_INCLUDES "${TFLITE_DEPEND_DIR}/neon_2_sse")
-endif()
+nnfw_find_package(NEON2SSESource QUIET)
+
+if(NEON2SSESource_FOUND)
+  list(APPEND TFLITE_INCLUDES "${NEON2SSESource_DIR}")
+endif(NEON2SSESource_FOUND)
 
 # This kernels are not used on nnfw
 ## spectrogram