diff options
author | Chunseok Lee <chunseok.lee@samsung.com> | 2020-10-28 12:16:55 +0900 |
---|---|---|
committer | Chunseok Lee <chunseok.lee@samsung.com> | 2020-10-28 12:16:55 +0900 |
commit | c55f8a6db48cda9d3a78048338b7f18c4cca62b8 (patch) | |
tree | 761ee8e171e5203f5c598ad93b2e7e0bc2e31aa2 /infra/cmake | |
parent | 74476a2d0296bdad70a2f7f90bc7419a8b05bffd (diff) | |
download | nnfw-c55f8a6db48cda9d3a78048338b7f18c4cca62b8.tar.gz nnfw-c55f8a6db48cda9d3a78048338b7f18c4cca62b8.tar.bz2 nnfw-c55f8a6db48cda9d3a78048338b7f18c4cca62b8.zip |
Imported Upstream version 1.10.0upstream/1.10.0submit/tizen/20201028.104702submit/tizen/20201028.031836accepted/tizen/unified/20201029.124827
Diffstat (limited to 'infra/cmake')
13 files changed, 65 insertions, 146 deletions
diff --git a/infra/cmake/packages/ARMComputeSourceConfig.cmake b/infra/cmake/packages/ARMComputeSourceConfig.cmake index adec1f91b..0ffa0cd35 100644 --- a/infra/cmake/packages/ARMComputeSourceConfig.cmake +++ b/infra/cmake/packages/ARMComputeSourceConfig.cmake @@ -12,7 +12,7 @@ function(_ARMComputeSource_import) ExternalSource_Download(ARMCOMPUTE ${ARMCOMPUTE_URL}) set(ARMComputeSource_DIR ${ARMCOMPUTE_SOURCE_DIR} PARENT_SCOPE) - set(ARMComputeSource_FOUND ${ARMCOMPUTE_SOURCE_GET} PARENT_SCOPE) + set(ARMComputeSource_FOUND TRUE PARENT_SCOPE) endfunction(_ARMComputeSource_import) _ARMComputeSource_import() diff --git a/infra/cmake/packages/BoostConfig.cmake b/infra/cmake/packages/BoostConfig.cmake index c4d7d5857..e72f742f3 100644 --- a/infra/cmake/packages/BoostConfig.cmake +++ b/infra/cmake/packages/BoostConfig.cmake @@ -25,6 +25,17 @@ function(_Boost_Build Boost_PREFIX) list(APPEND Boost_Options --with-system) list(APPEND Boost_Options --with-filesystem) + if(DEFINED EXTERNALS_BUILD_THREADS) + set(N ${EXTERNALS_BUILD_THREADS}) + else(DEFINED EXTERNALS_BUILD_THREADS) + include(ProcessorCount) + ProcessorCount(N) + endif(DEFINED EXTERNALS_BUILD_THREADS) + + if((NOT N EQUAL 0) AND BUILD_EXT_MULTITHREAD) + list(APPEND Boost_Options -j${N}) + endif() + set(JAM_FILENAME ${BoostBuild_DIR}/user-config.jam) if(ANDROID) diff --git a/infra/cmake/packages/BoostSourceConfig.cmake b/infra/cmake/packages/BoostSourceConfig.cmake index 52cda7c7d..2477a4857 100644 --- a/infra/cmake/packages/BoostSourceConfig.cmake +++ b/infra/cmake/packages/BoostSourceConfig.cmake @@ -13,7 +13,7 @@ function(_BoostSource_import) ExternalSource_Download(BOOST ${BOOST_URL}) set(BoostSource_DIR ${BOOST_SOURCE_DIR} PARENT_SCOPE) - set(BoostSource_FOUND ${BOOST_SOURCE_GET} PARENT_SCOPE) + set(BoostSource_FOUND TRUE PARENT_SCOPE) endfunction(_BoostSource_import) _BoostSource_import() diff --git a/infra/cmake/packages/CpuInfoSourceConfig.cmake b/infra/cmake/packages/CpuInfoSourceConfig.cmake new file mode 100644 index 000000000..60419ad9f --- /dev/null +++ b/infra/cmake/packages/CpuInfoSourceConfig.cmake @@ -0,0 +1,21 @@ +function(_CpuInfoSource_import) + if(NOT ${DOWNLOAD_CPUINFO}) + set(CpuInfoSource_FOUND FALSE PARENT_SCOPE) + return() + endif(NOT ${DOWNLOAD_CPUINFO}) + + nnas_include(ExternalSourceTools) + nnas_include(OptionTools) + + envoption(EXTERNAL_DOWNLOAD_SERVER "https://github.com") + # CPUINFO commit including patch from tflite v2.3 + envoption(CPUINFO_URL ${EXTERNAL_DOWNLOAD_SERVER}/pytorch/cpuinfo/archive/63b254577ed77a8004a9be6ac707f3dccc4e1fd9.tar.gz) + ExternalSource_Download(CPUINFO + DIRNAME CPUINFO + URL ${CPUINFO_URL}) + + set(CpuInfoSource_DIR ${CPUINFO_SOURCE_DIR} PARENT_SCOPE) + set(CpuInfoSource_FOUND TRUE PARENT_SCOPE) +endfunction(_CpuInfoSource_import) + +_CpuInfoSource_import() diff --git a/infra/cmake/packages/FlatBuffersSource-1.11/FlatBuffersSourceConfig.cmake b/infra/cmake/packages/FlatBuffersSource-1.12/FlatBuffersSourceConfig.cmake index 92efbf97e..9ee2c49f7 100644 --- a/infra/cmake/packages/FlatBuffersSource-1.11/FlatBuffersSourceConfig.cmake +++ b/infra/cmake/packages/FlatBuffersSource-1.12/FlatBuffersSourceConfig.cmake @@ -7,11 +7,11 @@ function(_FlatBuffersSource_import) nnas_include(ExternalSourceTools) nnas_include(OptionTools) - envoption(FLATBUFFERS_1_11_URL https://github.com/google/flatbuffers/archive/v1.11.0.tar.gz) + envoption(FLATBUFFERS_1_12_URL https://github.com/google/flatbuffers/archive/v1.12.0.tar.gz) ExternalSource_Download(FLATBUFFERS - DIRNAME FLATBUFFERS-1.11 - CHECKSUM MD5=02c64880acb89dbd57eebacfd67200d8 - URL ${FLATBUFFERS_1_11_URL} + DIRNAME FLATBUFFERS-1.12 + CHECKSUM MD5=c62ffefb3d4548b127cca14ce047f16c + URL ${FLATBUFFERS_1_12_URL} ) set(FlatBuffersSource_DIR ${FLATBUFFERS_SOURCE_DIR} PARENT_SCOPE) diff --git a/infra/cmake/packages/FlatBuffersSource-1.11/FlatBuffersSourceConfigVersion.cmake b/infra/cmake/packages/FlatBuffersSource-1.12/FlatBuffersSourceConfigVersion.cmake index f008e0528..8cfdbf8e5 100644 --- a/infra/cmake/packages/FlatBuffersSource-1.11/FlatBuffersSourceConfigVersion.cmake +++ b/infra/cmake/packages/FlatBuffersSource-1.12/FlatBuffersSourceConfigVersion.cmake @@ -1,4 +1,4 @@ -set(PACKAGE_VERSION "1.11") +set(PACKAGE_VERSION "1.12") set(PACKAGE_VERSION_EXACT FALSE) set(PACKAGE_VERSION_COMPATIBLE FALSE) set(PACKAGE_VERSION_UNSUITABLE TRUE) diff --git a/infra/cmake/packages/NEON2SSESourceConfig.cmake b/infra/cmake/packages/NEON2SSESourceConfig.cmake index 5970ec73e..bd40267a5 100644 --- a/infra/cmake/packages/NEON2SSESourceConfig.cmake +++ b/infra/cmake/packages/NEON2SSESourceConfig.cmake @@ -7,12 +7,13 @@ function(_NEON2SSESource_import) nnas_include(ExternalSourceTools) nnas_include(OptionTools) - # NOTE TensorFlow 1.12 downloads NEON2SSE from the following URL # NOTE TensorFlow 1.13.1 downloads NEON2SSE from the following URL + # NOTE TensorFlow 2.1 downloads NEON2SSE from the following URL # NOTE TensorFlow 2.2 downloads NEON2SSE from the following URL - envoption(NEON2SSE_1_12_URL https://github.com/intel/ARM_NEON_2_x86_SSE/archive/1200fe90bb174a6224a525ee60148671a786a71f.tar.gz) + # NOTE TensorFlow 2.3 downloads NEON2SSE from the following URL + envoption(NEON2SSE_URL https://github.com/intel/ARM_NEON_2_x86_SSE/archive/1200fe90bb174a6224a525ee60148671a786a71f.tar.gz) - ExternalSource_Download(NEON2SSE ${NEON2SSE_1_12_URL}) + ExternalSource_Download(NEON2SSE ${NEON2SSE_URL}) set(NEON2SSESource_DIR ${NEON2SSE_SOURCE_DIR} PARENT_SCOPE) set(NEON2SSESource_FOUND TRUE PARENT_SCOPE) diff --git a/infra/cmake/packages/NoniusSourceConfig.cmake b/infra/cmake/packages/NoniusSourceConfig.cmake index 0af23ef0e..17965f1eb 100644 --- a/infra/cmake/packages/NoniusSourceConfig.cmake +++ b/infra/cmake/packages/NoniusSourceConfig.cmake @@ -20,7 +20,7 @@ function(_NoniusSource_import) endif(BUILD_KBENCHMARK) set(NoniusSource_DIR ${NONIUS_SOURCE_DIR} PARENT_SCOPE) - set(NoniusSource_FOUND ${NONIUS_SOURCE_GET} PARENT_SCOPE) + set(NoniusSource_FOUND TRUE PARENT_SCOPE) endfunction(_NoniusSource_import) _NoniusSource_import() diff --git a/infra/cmake/packages/RuySourceConfig.cmake b/infra/cmake/packages/RuySourceConfig.cmake new file mode 100644 index 000000000..4faf0bb9f --- /dev/null +++ b/infra/cmake/packages/RuySourceConfig.cmake @@ -0,0 +1,21 @@ +function(_RuySource_import) + if(NOT ${DOWNLOAD_RUY}) + set(RuySource_FOUND FALSE PARENT_SCOPE) + return() + endif(NOT ${DOWNLOAD_RUY}) + + nnas_include(ExternalSourceTools) + nnas_include(OptionTools) + + # NOTE Downloads ruy source used by tensorflow v2.3.0 + envoption(EXTERNAL_DOWNLOAD_SERVER "https://github.com") + envoption(RUY_URL ${EXTERNAL_DOWNLOAD_SERVER}/google/ruy/archive/34ea9f4993955fa1ff4eb58e504421806b7f2e8f.tar.gz) + ExternalSource_Download(RUY + DIRNAME RUY + URL ${RUY_URL}) + + set(RuySource_DIR ${RUY_SOURCE_DIR} PARENT_SCOPE) + set(RuySource_FOUND TRUE PARENT_SCOPE) +endfunction(_RuySource_import) + +_RuySource_import() diff --git a/infra/cmake/packages/TensorFlowEigenSource-2.3.0-rc0Config.cmake b/infra/cmake/packages/TensorFlowEigenSource-2.3.0-rc0Config.cmake deleted file mode 100644 index 207f7b5bd..000000000 --- a/infra/cmake/packages/TensorFlowEigenSource-2.3.0-rc0Config.cmake +++ /dev/null @@ -1,23 +0,0 @@ -function(_TensorFlowEigenSource_import) - if(NOT DOWNLOAD_EIGEN) - set(TensorFlowEigenSource_FOUND FALSE PARENT_SCOPE) - return() - endif(NOT DOWNLOAD_EIGEN) - - nnas_include(ExternalSourceTools) - nnas_include(OptionTools) - - # NOTE TensorFlow 2.3.0-rc0 uses the following URL - envoption(EXTERNAL_DOWNLOAD_SERVER "https://gitlab.com") - envoption(TENSORFLOW_2_3_0_EIGEN_URL ${EXTERNAL_DOWNLOAD_SERVER}/libeigen/eigen/-/archive/386d809bde475c65b7940f290efe80e6a05878c4/eigen-386d809bde475c65b7940f290efe80e6a05878c4.tar.gz) - - ExternalSource_Download(EIGEN - DIRNAME TENSORFLOW-2.3.0-EIGEN - URL ${TENSORFLOW_2_3_0_EIGEN_URL} -) - - set(TensorFlowEigenSource_DIR ${EIGEN_SOURCE_DIR} PARENT_SCOPE) - set(TensorFlowEigenSource_FOUND TRUE PARENT_SCOPE) -endfunction(_TensorFlowEigenSource_import) - -_TensorFlowEigenSource_import() diff --git a/infra/cmake/packages/TensorFlowLite-1.12/Lite/CMakeLists.txt b/infra/cmake/packages/TensorFlowLite-1.12/Lite/CMakeLists.txt deleted file mode 100644 index 337d6b24f..000000000 --- a/infra/cmake/packages/TensorFlowLite-1.12/Lite/CMakeLists.txt +++ /dev/null @@ -1,41 +0,0 @@ -# NOTE The followings SHOULD be defined before using this CMakeLists.txt -# -# 'TensorFlowSource_DIR' variable -# 'FlatBuffersSource_DIR' variable -# 'eigen' target -# 'gemmlowp' target -# 'neon2sse' target -# 'farmhash' target -# 'abseil' target -# -message(STATUS "Build TensorFlow Lite from ${TensorFlowSource_DIR}") - -set(TensorFlowLiteSource_DIR ${TensorFlowSource_DIR}/tensorflow/contrib/lite) - -file(GLOB CORE_SRCS "${TensorFlowLiteSource_DIR}/*.c" "${TensorFlowLiteSource_DIR}/*.cc" "${TensorFlowLiteSource_DIR}/c/*.c" "${TensorFlowLiteSource_DIR}/core/api/*.cc") -file(GLOB_RECURSE CORE_TESTS "${TensorFlowLiteSource_DIR}/*test*.cc") -list(REMOVE_ITEM CORE_SRCS ${CORE_TESTS}) - -file(GLOB_RECURSE KERNEL_SRCS "${TensorFlowLiteSource_DIR}/kernels/*.cc") -file(GLOB_RECURSE KERNEL_TESTS "${TensorFlowLiteSource_DIR}/kernels/*test*.cc") -list(REMOVE_ITEM KERNEL_SRCS ${KERNEL_TESTS}) -# Exclude buggy kernel(s) from the build -#list(REMOVE_ITEM KERNEL_SRCS "${TensorFlowLiteSource_DIR}/kernels/internal/spectrogram.cc") - -list(APPEND SRCS ${CORE_SRCS}) -list(APPEND SRCS ${KERNEL_SRCS}) - -include(CheckCXXCompilerFlag) - -CHECK_CXX_COMPILER_FLAG(-Wno-extern-c-compat COMPILER_SUPPORT_EXTERN_C_COMPAT_WARNING) - -add_library(tensorflowlite-1.12 ${SRCS}) -set_target_properties(tensorflowlite-1.12 PROPERTIES POSITION_INDEPENDENT_CODE ON) -target_include_directories(tensorflowlite-1.12 PUBLIC ${TensorFlowSource_DIR}) -target_include_directories(tensorflowlite-1.12 PUBLIC ${FlatBuffersSource_DIR}/include) -target_compile_options(tensorflowlite-1.12 PUBLIC -Wno-ignored-attributes) -if(COMPILER_SUPPORT_EXTERN_C_COMPAT_WARNING) - target_compile_options(tensorflowlite-1.12 PUBLIC -Wno-extern-c-compat) -endif(COMPILER_SUPPORT_EXTERN_C_COMPAT_WARNING) -target_compile_definitions(tensorflowlite-1.12 PUBLIC "GEMMLOWP_ALLOW_SLOW_SCALAR_FALLBACK") -target_link_libraries(tensorflowlite-1.12 eigen-fd6845384b86 gemmlowp neon2sse farmhash abseil dl) diff --git a/infra/cmake/packages/TensorFlowLite-1.12/TensorFlowLiteConfig.cmake b/infra/cmake/packages/TensorFlowLite-1.12/TensorFlowLiteConfig.cmake deleted file mode 100644 index ff15d8576..000000000 --- a/infra/cmake/packages/TensorFlowLite-1.12/TensorFlowLiteConfig.cmake +++ /dev/null @@ -1,62 +0,0 @@ -function(_TensorFlowLite_import) - nnas_find_package(TensorFlowSource EXACT 1.12 QUIET) - - if(NOT TensorFlowSource_FOUND) - set(TensorFlowLite_FOUND FALSE PARENT_SCOPE) - return() - endif(NOT TensorFlowSource_FOUND) - - # TensorFlow 1.12 downloads FlatBuffers from https://github.com/google/flatbuffers/archive/1f5eae5d6a1.tar.gz - # - # Let's use 1.10 released in 2018.10 (compatible with 1f5eae5d6a1). - nnas_find_package(FlatBuffersSource EXACT 1.10 QUIET) - - if(NOT FlatBuffersSource_FOUND) - set(TensorFlowLite_FOUND FALSE PARENT_SCOPE) - return() - endif(NOT FlatBuffersSource_FOUND) - - nnas_find_package(Farmhash QUIET) - - if(NOT Farmhash_FOUND) - set(TensorFlowLite_FOUND FALSE PARENT_SCOPE) - return() - endif(NOT Farmhash_FOUND) - - nnas_find_package(Eigen-fd6845384b86 QUIET) - - if(NOT Eigen-fd6845384b86_FOUND) - set(TensorFlowLite_FOUND FALSE PARENT_SCOPE) - return() - endif(NOT Eigen-fd6845384b86_FOUND) - - nnas_find_package(GEMMLowp QUIET) - - if(NOT GEMMLowp_FOUND) - set(TensorFlowLite_FOUND FALSE PARENT_SCOPE) - return() - endif(NOT GEMMLowp_FOUND) - - nnas_find_package(NEON2SSE QUIET) - - if(NOT NEON2SSE_FOUND) - set(TensorFlowLite_FOUND FALSE PARENT_SCOPE) - return() - endif(NOT NEON2SSE_FOUND) - - nnas_find_package(Abseil QUIET) - - if(NOT Abseil_FOUND) - set(TensorFlowLite_FOUND FALSE PARENT_SCOPE) - return() - endif(NOT Abseil_FOUND) - - if(NOT TARGET tensorflowlite-1.12) - nnas_include(ExternalProjectTools) - add_extdirectory("${CMAKE_CURRENT_LIST_DIR}/Lite" tflite-1.12) - endif(NOT TARGET tensorflowlite-1.12) - - set(TensorFlowLite_FOUND TRUE PARENT_SCOPE) -endfunction(_TensorFlowLite_import) - -_TensorFlowLite_import() diff --git a/infra/cmake/packages/TensorFlowLite-1.12/TensorFlowLiteConfigVersion.cmake b/infra/cmake/packages/TensorFlowLite-1.12/TensorFlowLiteConfigVersion.cmake deleted file mode 100644 index 4a57b655b..000000000 --- a/infra/cmake/packages/TensorFlowLite-1.12/TensorFlowLiteConfigVersion.cmake +++ /dev/null @@ -1,9 +0,0 @@ -set(PACKAGE_VERSION "1.12") -set(PACKAGE_VERSION_EXACT FALSE) -set(PACKAGE_VERSION_COMPATIBLE FALSE) -set(PACKAGE_VERSION_UNSUITABLE TRUE) - -if(PACKAGE_FIND_VERSION VERSION_EQUAL PACKAGE_VERSION) - set(PACKAGE_VERSION_EXACT TRUE) - set(PACKAGE_VERSION_UNSUITABLE FALSE) -endif(PACKAGE_FIND_VERSION VERSION_EQUAL PACKAGE_VERSION) |