diff options
author | Matthew Sloyan <matthew.sloyan@arm.com> | 2023-01-23 10:20:04 +0000 |
---|---|---|
committer | Matthew Sloyan <matthew.sloyan@arm.com> | 2023-01-23 14:51:11 +0000 |
commit | c01da459e63461dc0ecfe855fd3254c938689386 (patch) | |
tree | de12240bac086b5ec751c3f76a2f64340b2e082a /cmake/GlobalConfig.cmake | |
parent | 6b74da0d8bca1d51c520bea275df1cc5560c0c96 (diff) | |
download | armnn-c01da459e63461dc0ecfe855fd3254c938689386.tar.gz |
Refactor TOSA Common to be built without enabling the TOSA Reference backend
* The only way to build TOSA common was to enable ARMNNTOSAREF.
* Only include and link the required headers/libraries for TOSA Common.
* Remove duplicate include_directories calls.
Signed-off-by: Matthew Sloyan <matthew.sloyan@arm.com>
Change-Id: Ia5a19bf5b0bb903be0248ac550439df1e8ac5aa7
Diffstat (limited to 'cmake/GlobalConfig.cmake')
-rw-r--r-- | cmake/GlobalConfig.cmake | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/cmake/GlobalConfig.cmake b/cmake/GlobalConfig.cmake index e9eb0a9757..0c35422544 100644 --- a/cmake/GlobalConfig.cmake +++ b/cmake/GlobalConfig.cmake @@ -376,9 +376,13 @@ if(ARMNNREF) add_definitions(-DARMNNREF_ENABLED) endif() -# ArmNN TOSA reference backend +# If a backend requires TOSA common, add it here. if(ARMNNTOSAREF) - # Locate the includes for the TOSA serialization library. + set(ARMNNTOSACOMMON ON) +endif() + +if(ARMNNTOSACOMMON) + # Locate the includes for the TOSA serialization library as it is needed for TOSA common and TOSA backends. message(STATUS "TOSA serialization library root set to ${TOSA_SERIALIZATION_LIB_ROOT}") find_path(TOSA_SERIALIZATION_LIB_INCLUDE tosa_serialization_handler.h @@ -390,13 +394,23 @@ if(ARMNNTOSAREF) HINTS ${TOSA_SERIALIZATION_LIB_ROOT}/lib /usr/local/lib /usr/lib) message(STATUS "TOSA serialization library set to ${TOSA_SERIALIZATION_LIB}") - # Next, locate the includes for the TOSA Reference Model. + # Include required headers for TOSA Serialization Library + include_directories(SYSTEM ${FLATBUFFERS_INCLUDE_PATH}) + include_directories(SYSTEM ${PROJECT_SOURCE_DIR}/third-party/half) + include_directories(SYSTEM ${TOSA_SERIALIZATION_LIB_INCLUDE}) +endif() + +# ArmNN TOSA reference backend +if(ARMNNTOSAREF) + # Locate the includes for the TOSA Reference Model, which is specific to the TOSA Reference Backend. message(STATUS "TOSA Reference Model root set to ${TOSA_REFERENCE_MODEL_ROOT}") find_path(TOSA_REFERENCE_MODEL_INCLUDE model_runner.h HINTS ${TOSA_REFERENCE_MODEL_ROOT}/include) message(STATUS "TOSA Reference Model include directory located at: ${TOSA_REFERENCE_MODEL_INCLUDE}") + include_directories(SYSTEM ${TOSA_REFERENCE_MODEL_INCLUDE}) + find_library(TOSA_REFERENCE_MODEL_LIB NAMES tosa_reference_model_lib.a tosa_reference_model_lib HINTS ${TOSA_REFERENCE_MODEL_ROOT}/lib /usr/local/lib /usr/lib) |