+# set target platform to run
+if(NOT TARGET_ARCH OR "${TARGET_ARCH}" STREQUAL "")
+ string(TOLOWER ${CMAKE_SYSTEM_PROCESSOR} TARGET_ARCH)
+else()
+ string(TOLOWER ${TARGET_ARCH} TARGET_ARCH)
+endif()
+
+# If TARGET_ARCH is arm64 change ARCH name to aarch64
+if("${TARGET_ARCH}" STREQUAL "arm64")
+ set(TARGET_ARCH "aarch64")
+endif()
+
+if("${TARGET_ARCH}" STREQUAL "armv8-m")
+ set(TARGET_ARCH_BASE "arm")
+elseif("${TARGET_ARCH}" STREQUAL "armv7-r")
+ set(TARGET_ARCH_BASE "arm")
+elseif("${TARGET_ARCH}" STREQUAL "armv7em")
+ set(TARGET_ARCH_BASE "arm")
+elseif("${TARGET_ARCH}" STREQUAL "armv7l")
+ set(TARGET_ARCH_BASE "arm")
+elseif("${TARGET_ARCH}" STREQUAL "armv7hl")
+ set(TARGET_ARCH_BASE "arm")
+elseif("${TARGET_ARCH}" STREQUAL "aarch64")
+ set(TARGET_ARCH_BASE "aarch64")
+endif()
+
macro(initialize_pal)
- nnas_find_package(TensorFlowSource EXACT 2.6.0 QUIET)
- nnas_find_package(TensorFlowGEMMLowpSource EXACT 2.6.0 QUIET)
- nnas_find_package(TensorFlowEigenSource EXACT 2.6.0 QUIET)
- nnas_find_package(TensorFlowRuySource EXACT 2.6.0 QUIET)
+ nnas_find_package(TensorFlowSource EXACT 2.8.0 QUIET)
+ nnas_find_package(TensorFlowGEMMLowpSource EXACT 2.8.0 QUIET)
+ nnas_find_package(TensorFlowEigenSource EXACT 2.8.0 QUIET)
+ nnas_find_package(TensorFlowRuySource EXACT 2.8.0 QUIET)
if (NOT TensorFlowSource_FOUND)
message(STATUS "Skipping luci-interpreter: TensorFlow not found")
${TensorFlowSource_DIR}/tensorflow/lite/kernels/internal/reference/portable_tensor_utils.cc
${TensorFlowSource_DIR}/tensorflow/lite/kernels/internal/quantization_util.cc)
- if(BUILD_ARM32_NEON)
+ if(TARGET_ARCH_BASE STREQUAL "arm")
# NOTE may need to revise this list for version upgrade
set(PAL_SOURCES ${PAL_SOURCES}
${TensorFlowSource_DIR}/tensorflow/lite/kernels/internal/optimized/neon_tensor_utils.cc
${TensorFlowRuySource_DIR}/ruy/wait.cc
${TensorFlowRuySource_DIR}/ruy/kernel_arm32.cc
)
- endif(BUILD_ARM32_NEON)
+ endif(TARGET_ARCH_BASE STREQUAL "arm")
+
+ if(TARGET_ARCH_BASE STREQUAL "aarch64")
+ # NOTE may need to revise this list for version upgrade
+ set(PAL_SOURCES ${PAL_SOURCES}
+ ${TensorFlowSource_DIR}/tensorflow/lite/kernels/internal/optimized/neon_tensor_utils.cc
+ ${TensorFlowSource_DIR}/tensorflow/lite/kernels/internal/optimized/cpu_check.cc
+ ${TensorFlowRuySource_DIR}/ruy/allocator.cc
+ ${TensorFlowRuySource_DIR}/ruy/block_map.cc
+ ${TensorFlowRuySource_DIR}/ruy/blocking_counter.cc
+ ${TensorFlowRuySource_DIR}/ruy/context_get_ctx.cc
+ ${TensorFlowRuySource_DIR}/ruy/cpuinfo.cc
+ ${TensorFlowRuySource_DIR}/ruy/ctx.cc
+ ${TensorFlowRuySource_DIR}/ruy/denormal.cc
+ ${TensorFlowRuySource_DIR}/ruy/frontend.cc
+ ${TensorFlowRuySource_DIR}/ruy/pack_arm.cc
+ ${TensorFlowRuySource_DIR}/ruy/prepacked_cache.cc
+ ${TensorFlowRuySource_DIR}/ruy/prepare_packed_matrices.cc
+ ${TensorFlowRuySource_DIR}/ruy/system_aligned_alloc.cc
+ ${TensorFlowRuySource_DIR}/ruy/thread_pool.cc
+ ${TensorFlowRuySource_DIR}/ruy/trmul.cc
+ ${TensorFlowRuySource_DIR}/ruy/tune.cc
+ ${TensorFlowRuySource_DIR}/ruy/wait.cc
+ ${TensorFlowRuySource_DIR}/ruy/kernel_arm64.cc
+ )
+ endif(TARGET_ARCH_BASE STREQUAL "aarch64")
add_library(luci_interpreter_linux_pal STATIC ${PAL_SOURCES})
set_target_properties(luci_interpreter_linux_pal PROPERTIES POSITION_INDEPENDENT_CODE ON)