IVGCVSW-7555 Restructure Delegate
* New folders created:
* common is for common code where TfLite API is not used
* classic is for existing delegate implementations
* opaque is for new opaque delegate implementation,
* tests is for shared between existing Delegate and Opaque Delegate which have test utils to work which delegate to use.
* Existing delegate is built to libarmnnDelegate.so and opaque delegate is built as libarmnnOpaqueDelegate.so
* Opaque structure is introduced but no API is added yet.
* CmakeList.txt and delegate/CMakeList.txt have been modified and 2 new CmakeList.txt added
* Rename BUILD_ARMNN_TFLITE_DELEGATE as BUILD_CLASSIC_DELEGATE
* Rename BUILD_ARMNN_TFLITE_OPAQUE_DELEGATE as BUILD_OPAQUE_DELEGATE
Signed-off-by: Teresa Charlin <teresa.charlinreyes@arm.com>
Change-Id: Ib682b9ad0ac8d8acdc4ec6d9099bb0008a9fe8ed
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2bdab04..37dba7c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -11,7 +11,8 @@
set(additional_cmake_files)
list(APPEND additional_cmake_files
cmake/ArmnnVersion.cmake
- cmake/DelegateVersion.cmake
+ cmake/ClassicDelegateVersion.cmake
+ cmake/OpaqueDelegateVersion.cmake
cmake/ParserVersion.cmake
cmake/Utils.cmake
cmake/GlobalConfig.cmake
@@ -443,12 +444,17 @@
# Because backends are added as object libraries they won't be linked to armnn when building armnn statically.
# A target that uses a static armnn library has to link to the object libraries in the variable armnnLibraries
# manually to include all symbols from backends.
-if (BUILD_ARMNN_TFLITE_DELEGATE)
+if (BUILD_CLASSIC_DELEGATE OR BUILD_OPAQUE_DELEGATE)
set(ARMNN_SUB_PROJECT ON)
set(ARMNN_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
add_subdirectory(delegate)
+endif()
+if (BUILD_CLASSIC_DELEGATE)
add_definitions(-DARMNN_TFLITE_DELEGATE)
endif()
+if (BUILD_OPAQUE_DELEGATE)
+ add_definitions(-DARMNN_TFLITE_OPAQUE_DELEGATE)
+endif()
if(BUILD_BARE_METAL OR EXECUTE_NETWORK_STATIC)
add_library_ex(armnn STATIC ${armnn_sources})