diff options
author | Per Åstrand <per.astrand@arm.com> | 2020-06-30 10:33:58 +0200 |
---|---|---|
committer | Per Åstrand <per.astrand@arm.com> | 2020-07-02 13:57:39 +0200 |
commit | 94ca3558d648c69ee1b5d7771247763a9fdd9514 (patch) | |
tree | 0de9596e346ff446a214d2798b49cc9972df58ff /CMakeLists.txt | |
parent | 3f6e07ac33c7bd320527e556d8a9fdbd343c1a91 (diff) | |
download | ethos-u-core-software-94ca3558d648c69ee1b5d7771247763a9fdd9514.tar.gz |
MLBEDSW-2059 Add option for accelerator
Add cmake option to select which accelerator backend is to be built for
tensorflow.
Change-Id: Ice06317e1f8b8601f3f077da9d2ef2625b6b2909
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 90f4319..22a039b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -29,8 +29,9 @@ set(CMSIS_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmsis" CACHE PATH "Path to CMSIS.") set(CORE_DRIVER_PATH "${CMAKE_CURRENT_SOURCE_DIR}/core_driver" CACHE PATH "Path to core driver.") set(TENSORFLOW_PATH "${CMAKE_CURRENT_SOURCE_DIR}/tensorflow" CACHE PATH "Path to Tensorflow.") -# Enable NPU backend -set(CORE_SOFTWARE_BACKEND "NPU" CACHE STRING "Enable NPU backend. (None, NPU)") +# Select accelerator for tensorflow +set(CORE_SOFTWARE_ACCELERATOR "NPU" CACHE STRING "Set NPU backend for TFLU") +set_property(CACHE CORE_SOFTWARE_ACCELERATOR PROPERTY STRINGS CPU CMSIS-NN NPU) # Define build options set(CORE_SOFTWARE_RTOS "None" CACHE STRING "Select RTOS to include. (None, MbedOS, FreeRTOS, Zephyr)") @@ -38,17 +39,20 @@ set(CORE_SOFTWARE_RTOS "None" CACHE STRING "Select RTOS to include. (None, MbedO # # Build # +add_library(ethosu_core INTERFACE) # Build CMSIS include(cmsis.cmake) # Build core driver -set(ETHOSU_PMU_INTERACTIVE OFF) -add_subdirectory(${CORE_DRIVER_PATH} core_driver) +if (CORE_SOFTWARE_ACCELERATOR STREQUAL "NPU") + set(ETHOSU_PMU_INTERACTIVE OFF) + add_subdirectory(${CORE_DRIVER_PATH} core_driver) + target_link_libraries(ethosu_core INTERFACE ethosu_core_driver) +endif() # Build Tensorflow library include(tensorflow.cmake) # Merge libraries into static library -add_library(ethosu_core INTERFACE) -target_link_libraries(ethosu_core INTERFACE tflu cmsis_device ethosu_core_driver) +target_link_libraries(ethosu_core INTERFACE tflu cmsis_device) |