Sadik Armagan | 3c24f43 | 2020-10-19 17:35:30 +0100 | [diff] [blame] | 1 | # |
Ryan OShea | b554054 | 2022-07-06 09:52:52 +0100 | [diff] [blame] | 2 | # Copyright © 2022-2023 Arm Ltd and Contributors. All rights reserved. |
Sadik Armagan | 3c24f43 | 2020-10-19 17:35:30 +0100 | [diff] [blame] | 3 | # SPDX-License-Identifier: MIT |
| 4 | # |
| 5 | |
Jan Eilers | b968a4f | 2020-11-15 14:44:43 +0000 | [diff] [blame] | 6 | cmake_minimum_required (VERSION 3.7.0) |
Sadik Armagan | 3c24f43 | 2020-10-19 17:35:30 +0100 | [diff] [blame] | 7 | project(armnnDelegate) |
Ryan OShea | 238ecd9 | 2023-03-07 11:44:23 +0000 | [diff] [blame] | 8 | set(CMAKE_CXX_STANDARD 17) |
| 9 | set(CMAKE_CXX_STANDARD_REQUIRED ON) |
Ryan OShea | 238ecd9 | 2023-03-07 11:44:23 +0000 | [diff] [blame] | 10 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17 -Wall -Wextra -Werror -Wold-style-cast -Wno-missing-braces -Wconversion -Wsign-conversion -Wno-comment") |
Finn Williams | bbbefec | 2020-11-25 14:32:42 +0000 | [diff] [blame] | 11 | set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/cmake/Modules/") |
Sadik Armagan | 3c24f43 | 2020-10-19 17:35:30 +0100 | [diff] [blame] | 12 | |
Teresa Charlin | ad1b3d7 | 2023-03-14 12:10:28 +0000 | [diff] [blame] | 13 | option(BUILD_UNIT_TESTS "Build unit tests" ON) |
| 14 | option(BUILD_CLASSIC_DELEGATE "Build classic delegate" ON) |
| 15 | option(BUILD_OPAQUE_DELEGATE "Build opaque delegate" OFF) |
| 16 | option(BUILD_SHARED_LIBS "Build share libs" ON) |
| 17 | option(BUILD_DELEGATE_JNI_INTERFACE "Builds a library to allow accessing the Arm NN delegate from Java code. |
| 18 | This is an experimental feature." ON) |
| 19 | |
Sadik Armagan | 3c24f43 | 2020-10-19 17:35:30 +0100 | [diff] [blame] | 20 | set(armnnDelegate_sources) |
| 21 | list(APPEND armnnDelegate_sources |
Teresa Charlin | ad1b3d7 | 2023-03-14 12:10:28 +0000 | [diff] [blame] | 22 | common/include/DelegateOptions.hpp |
| 23 | common/src/DelegateOptions.cpp |
David Monahan | 6c53f9f | 2023-04-27 15:21:19 +0100 | [diff] [blame] | 24 | common/src/DelegateUtils.hpp |
| 25 | common/src/MultiLayerFacade.hpp) |
Sadik Armagan | 3c24f43 | 2020-10-19 17:35:30 +0100 | [diff] [blame] | 26 | |
| 27 | ## Add Armnn as a Dependency |
Finn Williams | bbbefec | 2020-11-25 14:32:42 +0000 | [diff] [blame] | 28 | if(NOT ARMNN_SUB_PROJECT) |
| 29 | find_package(Armnn REQUIRED CONFIG HINTS ${Armnn_DIR}) |
| 30 | endif() |
Teresa Charlin | ad1b3d7 | 2023-03-14 12:10:28 +0000 | [diff] [blame] | 31 | |
| 32 | if (BUILD_CLASSIC_DELEGATE) |
| 33 | add_subdirectory(classic) |
| 34 | add_library(armnnDelegate ${armnnDelegate_sources}) |
| 35 | |
| 36 | target_include_directories(armnnDelegate |
| 37 | PUBLIC |
| 38 | $<INSTALL_INTERFACE:include> |
| 39 | $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/common/include> |
| 40 | PRIVATE |
| 41 | ${CMAKE_CURRENT_SOURCE_DIR}/common/src) |
| 42 | endif() |
| 43 | if (BUILD_OPAQUE_DELEGATE) |
| 44 | add_subdirectory(opaque) |
| 45 | add_library(armnnOpaqueDelegate ${armnnDelegate_sources}) |
| 46 | |
| 47 | target_include_directories(armnnOpaqueDelegate |
| 48 | PUBLIC |
| 49 | $<INSTALL_INTERFACE:include> |
| 50 | $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/common/include> |
| 51 | PRIVATE |
| 52 | ${CMAKE_CURRENT_SOURCE_DIR}/common/src) |
| 53 | endif() |
| 54 | |
| 55 | include(GNUInstallDirs) |
| 56 | |
| 57 | if (BUILD_CLASSIC_DELEGATE) |
| 58 | target_link_libraries(armnnDelegate PUBLIC Armnn::Armnn) |
| 59 | |
| 60 | ## Add armnnClassicDelegateObject as a Dependency |
| 61 | target_link_libraries(armnnDelegate PUBLIC armnnClassicDelegateObject) |
| 62 | endif() |
| 63 | if (BUILD_OPAQUE_DELEGATE) |
| 64 | target_link_libraries(armnnOpaqueDelegate PUBLIC Armnn::Armnn) |
| 65 | |
| 66 | ## Add armnnOpaqueDelegateObject as a Dependency |
| 67 | target_link_libraries(armnnOpaqueDelegate PUBLIC armnnOpaqueDelegateObject) |
| 68 | endif() |
Sadik Armagan | 3c24f43 | 2020-10-19 17:35:30 +0100 | [diff] [blame] | 69 | |
Keith Davis | 9a701c8 | 2021-09-28 16:43:24 +0100 | [diff] [blame] | 70 | ## Add TfLite dependency |
Jim Flynn | fca233e | 2021-09-23 12:16:53 +0100 | [diff] [blame] | 71 | find_package(TfLiteSrc REQUIRED MODULE) |
Sadik Armagan | 3c24f43 | 2020-10-19 17:35:30 +0100 | [diff] [blame] | 72 | find_package(TfLite REQUIRED MODULE) |
Teresa Charlin | ad1b3d7 | 2023-03-14 12:10:28 +0000 | [diff] [blame] | 73 | if (BUILD_CLASSIC_DELEGATE) |
| 74 | target_link_libraries(armnnDelegate PUBLIC ${TfLite_LIB}) |
Sadik Armagan | 3c24f43 | 2020-10-19 17:35:30 +0100 | [diff] [blame] | 75 | |
Teresa Charlin | ad1b3d7 | 2023-03-14 12:10:28 +0000 | [diff] [blame] | 76 | # lpthread and ldl are not required for Android |
| 77 | if(NOT "${CMAKE_SYSTEM_NAME}" STREQUAL Android) |
| 78 | target_link_libraries(armnnDelegate PUBLIC -lpthread) |
| 79 | target_link_libraries(armnnDelegate PUBLIC -ldl) |
| 80 | endif() |
Keith Davis | d62eef9 | 2021-09-20 18:17:33 +0100 | [diff] [blame] | 81 | endif() |
Teresa Charlin | ad1b3d7 | 2023-03-14 12:10:28 +0000 | [diff] [blame] | 82 | if (BUILD_OPAQUE_DELEGATE) |
| 83 | target_link_libraries(armnnOpaqueDelegate PUBLIC ${TfLite_LIB}) |
Keith Davis | d62eef9 | 2021-09-20 18:17:33 +0100 | [diff] [blame] | 84 | |
Teresa Charlin | ad1b3d7 | 2023-03-14 12:10:28 +0000 | [diff] [blame] | 85 | # lpthread and ldl are not required for Android |
| 86 | if(NOT "${CMAKE_SYSTEM_NAME}" STREQUAL Android) |
| 87 | target_link_libraries(armnnOpaqueDelegate PUBLIC -lpthread) |
| 88 | target_link_libraries(armnnOpaqueDelegate PUBLIC -ldl) |
| 89 | endif() |
| 90 | endif() |
Sadik Armagan | 3c24f43 | 2020-10-19 17:35:30 +0100 | [diff] [blame] | 91 | |
Narumol Prangnawarat | 4cf0fe3 | 2020-12-18 16:13:06 +0000 | [diff] [blame] | 92 | # Add libraries from armnn third-party libraries |
| 93 | # Third-party header files are not warning clean |
| 94 | # We can't change compilation flags on header files directly, so we need to add them to an interface library first |
| 95 | add_library(thirdparty_headers INTERFACE) |
| 96 | target_include_directories(thirdparty_headers INTERFACE $<BUILD_INTERFACE:${ARMNN_SOURCE_DIR}/third-party> |
| 97 | $<INSTALL_INTERFACE:include/thirdparty_headers>) |
| 98 | |
| 99 | target_compile_options(thirdparty_headers INTERFACE -Wno-old-style-cast) |
Teresa Charlin | ad1b3d7 | 2023-03-14 12:10:28 +0000 | [diff] [blame] | 100 | if (BUILD_CLASSIC_DELEGATE) |
| 101 | target_link_libraries(armnnDelegate PUBLIC thirdparty_headers) |
| 102 | endif() |
| 103 | if (BUILD_OPAQUE_DELEGATE) |
| 104 | target_link_libraries(armnnOpaqueDelegate PUBLIC thirdparty_headers) |
| 105 | endif() |
Narumol Prangnawarat | 4cf0fe3 | 2020-12-18 16:13:06 +0000 | [diff] [blame] | 106 | |
Jim Flynn | fca233e | 2021-09-23 12:16:53 +0100 | [diff] [blame] | 107 | add_library(profiling_library_headers INTERFACE) |
| 108 | target_include_directories(profiling_library_headers INTERFACE $<BUILD_INTERFACE:${ARMNN_SOURCE_DIR}/profiling> |
| 109 | $<INSTALL_INTERFACE:include/profiling_library_headers>) |
Jim Flynn | fca233e | 2021-09-23 12:16:53 +0100 | [diff] [blame] | 110 | |
Teresa Charlin | ad1b3d7 | 2023-03-14 12:10:28 +0000 | [diff] [blame] | 111 | if (BUILD_CLASSIC_DELEGATE) |
| 112 | target_link_libraries(armnnDelegate PUBLIC profiling_library_headers) |
| 113 | target_link_libraries(armnnDelegate PUBLIC Armnn::armnnUtils) |
Matthew Sloyan | ac001ee | 2021-02-03 10:43:04 +0000 | [diff] [blame] | 114 | |
Teresa Charlin | ad1b3d7 | 2023-03-14 12:10:28 +0000 | [diff] [blame] | 115 | set_target_properties(armnnDelegate PROPERTIES VERSION ${DELEGATE_LIB_VERSION} SOVERSION ${DELEGATE_LIB_SOVERSION}) |
| 116 | endif() |
| 117 | if (BUILD_OPAQUE_DELEGATE) |
| 118 | target_link_libraries(armnnOpaqueDelegate PUBLIC profiling_library_headers) |
| 119 | target_link_libraries(armnnOpaqueDelegate PUBLIC Armnn::armnnUtils) |
| 120 | |
| 121 | set_target_properties(armnnOpaqueDelegate PROPERTIES VERSION ${OPAQUE_DELEGATE_LIB_VERSION} SOVERSION ${OPAQUE_DELEGATE_LIB_SOVERSION}) |
| 122 | endif() |
| 123 | |
Matthew Sloyan | 65c21a1 | 2023-04-04 12:06:14 +0100 | [diff] [blame] | 124 | if(BUILD_UNIT_TESTS) |
| 125 | set(commonDelegate_unittest_sources) |
| 126 | list(APPEND commonDelegate_unittest_sources |
| 127 | common/src/test/DelegateTestInterpreter.hpp |
| 128 | common/src/test/DelegateTestInterpreterUtils.hpp |
Teresa Charlin | ad1b3d7 | 2023-03-14 12:10:28 +0000 | [diff] [blame] | 129 | test/ActivationTest.cpp |
| 130 | test/ActivationTestHelper.hpp |
| 131 | test/ArgMinMaxTest.cpp |
| 132 | test/ArgMinMaxTestHelper.hpp |
Teresa Charlin | ad1b3d7 | 2023-03-14 12:10:28 +0000 | [diff] [blame] | 133 | test/BatchMatMulTest.cpp |
| 134 | test/BatchMatMulTestHelper.hpp |
| 135 | test/BatchSpaceTest.cpp |
| 136 | test/BatchSpaceTestHelper.hpp |
| 137 | test/CastTest.cpp |
| 138 | test/CastTestHelper.hpp |
| 139 | test/ComparisonTest.cpp |
| 140 | test/ComparisonTestHelper.hpp |
| 141 | test/ControlTest.cpp |
| 142 | test/ControlTestHelper.hpp |
| 143 | test/Convolution2dTest.cpp |
| 144 | test/Convolution3dTest.cpp |
| 145 | test/ConvolutionTestHelper.hpp |
| 146 | test/DelegateOptionsTest.cpp |
| 147 | test/DelegateOptionsTestHelper.hpp |
| 148 | test/DepthwiseConvolution2dTest.cpp |
| 149 | test/ElementwiseBinaryTest.cpp |
| 150 | test/ElementwiseBinaryTestHelper.hpp |
| 151 | test/ElementwiseUnaryTest.cpp |
| 152 | test/ElementwiseUnaryTestHelper.hpp |
| 153 | test/FillTest.cpp |
| 154 | test/FillTestHelper.hpp |
| 155 | test/FullyConnectedTest.cpp |
| 156 | test/FullyConnectedTestHelper.hpp |
| 157 | test/GatherTest.cpp |
| 158 | test/GatherTestHelper.hpp |
| 159 | test/GatherNdTest.cpp |
| 160 | test/GatherNdTestHelper.hpp |
| 161 | test/LogicalTest.cpp |
| 162 | test/LogicalTestHelper.hpp |
| 163 | test/LstmTest.cpp |
| 164 | test/LstmTestHelper.hpp |
| 165 | test/MirrorPadTest.cpp |
| 166 | test/NormalizationTest.cpp |
| 167 | test/NormalizationTestHelper.hpp |
| 168 | test/PackTest.cpp |
| 169 | test/PackTestHelper.hpp |
| 170 | test/PadTest.cpp |
| 171 | test/PadTestHelper.hpp |
| 172 | test/Pooling2dTest.cpp |
| 173 | test/Pooling2dTestHelper.hpp |
| 174 | test/Pooling3dTest.cpp |
| 175 | test/Pooling3dTestHelper.hpp |
| 176 | test/PreluTest.cpp |
| 177 | test/PreluTestHelper.hpp |
| 178 | test/QuantizationTest.cpp |
| 179 | test/QuantizationTestHelper.hpp |
| 180 | test/RedefineTestHelper.hpp |
| 181 | test/ReduceTest.cpp |
| 182 | test/ReduceTestHelper.hpp |
| 183 | test/ReshapeTest.cpp |
| 184 | test/ResizeTest.cpp |
| 185 | test/ResizeTestHelper.hpp |
| 186 | test/RoundTest.cpp |
| 187 | test/RoundTestHelper.hpp |
| 188 | test/SoftmaxTest.cpp |
| 189 | test/SoftmaxTestHelper.hpp |
| 190 | test/SpaceDepthTest.cpp |
| 191 | test/SpaceDepthTestHelper.hpp |
| 192 | test/ShapeTest.cpp |
| 193 | test/ShapeTestHelper.hpp |
| 194 | test/SliceTest.cpp |
| 195 | test/SliceTestHelper.hpp |
| 196 | test/StridedSliceTest.cpp |
| 197 | test/StridedSliceTestHelper.hpp |
| 198 | test/SplitTest.cpp |
| 199 | test/SplitTestHelper.hpp |
| 200 | test/TestUtils.hpp |
| 201 | test/TestUtils.cpp |
Matthew Sloyan | 080ffd8 | 2023-04-24 12:53:04 +0100 | [diff] [blame] | 202 | test/TransposeConvolution2dTest.cpp |
Teresa Charlin | ad1b3d7 | 2023-03-14 12:10:28 +0000 | [diff] [blame] | 203 | test/TransposeTest.cpp |
| 204 | test/TransposeTestHelper.hpp |
| 205 | test/UnidirectionalSequenceLstmTest.cpp |
| 206 | test/UnidirectionalSequenceLstmTestHelper.hpp |
| 207 | test/UnpackTest.cpp |
| 208 | test/UnpackTestHelper.hpp) |
Sadik Armagan | 3c24f43 | 2020-10-19 17:35:30 +0100 | [diff] [blame] | 209 | |
Matthew Sloyan | 65c21a1 | 2023-04-04 12:06:14 +0100 | [diff] [blame] | 210 | # There's a known Android NDK bug which causes a subset of NeonLayerTests to |
| 211 | # fail. We'll exclude these tests in NeonLayerTests_NDK_Bug.cpp if we're doing |
| 212 | # a debug build and NDK is less than r21. |
| 213 | # https://github.com/android/ndk/issues/1135 |
Keith Davis | 7c67fab | 2021-04-08 11:47:23 +0100 | [diff] [blame] | 214 | |
Matthew Sloyan | 65c21a1 | 2023-04-04 12:06:14 +0100 | [diff] [blame] | 215 | # Default to always including these tests. |
| 216 | set(INCLUDE_NDK_BUG_TESTS "ON") |
| 217 | # Reconsider if we in a debug build. |
| 218 | string( TOLOWER ${CMAKE_BUILD_TYPE} BUILD_TYPE_LOWERCASE ) |
| 219 | if ( NOT BUILD_TYPE_LOWERCASE STREQUAL "release" ) |
| 220 | message("CMAKE:: BUILD TYPE IS ${CMAKE_BUILD_TYPE}") |
| 221 | # And NDK_VERSION has been set. |
| 222 | if ( DEFINED NDK_VERSION ) |
| 223 | message("CMAKE:: NDK DEFINED") |
| 224 | # And the version is less than r21. |
| 225 | if ( ${NDK_VERSION} STRLESS "r21" ) |
| 226 | message("CMAKE:: BUG TESTS OFF") |
| 227 | set(INCLUDE_NDK_BUG_TESTS "OFF") |
Keith Davis | 7c67fab | 2021-04-08 11:47:23 +0100 | [diff] [blame] | 228 | endif() |
| 229 | endif() |
Matthew Sloyan | 65c21a1 | 2023-04-04 12:06:14 +0100 | [diff] [blame] | 230 | endif() |
Keith Davis | 7c67fab | 2021-04-08 11:47:23 +0100 | [diff] [blame] | 231 | |
Matthew Sloyan | 65c21a1 | 2023-04-04 12:06:14 +0100 | [diff] [blame] | 232 | if ( INCLUDE_NDK_BUG_TESTS STREQUAL "ON" ) |
| 233 | list(APPEND commonDelegate_unittest_sources |
| 234 | test/NeonDelegateTests_NDK_Issue.cpp) |
| 235 | endif() |
Keith Davis | 7c67fab | 2021-04-08 11:47:23 +0100 | [diff] [blame] | 236 | |
Matthew Sloyan | 65c21a1 | 2023-04-04 12:06:14 +0100 | [diff] [blame] | 237 | if (BUILD_CLASSIC_DELEGATE) |
| 238 | set(classicDelegate_unittest_sources) |
| 239 | list(APPEND classicDelegate_unittest_sources |
| 240 | classic/src/test/ArmnnClassicDelegateTest.cpp |
| 241 | classic/src/test/DelegateTestInterpreter.cpp) |
| 242 | |
| 243 | add_executable(DelegateUnitTests ${commonDelegate_unittest_sources} ${classicDelegate_unittest_sources}) |
Keith Davis | 7c67fab | 2021-04-08 11:47:23 +0100 | [diff] [blame] | 244 | |
Teresa Charlin | ad1b3d7 | 2023-03-14 12:10:28 +0000 | [diff] [blame] | 245 | target_include_directories(DelegateUnitTests SYSTEM PRIVATE "${TF_LITE_SCHEMA_INCLUDE_PATH}") |
Matthew Sloyan | ebe392d | 2023-03-30 10:12:08 +0100 | [diff] [blame] | 246 | target_include_directories(DelegateUnitTests SYSTEM PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/common/src/test") |
Matthew Sloyan | 65c21a1 | 2023-04-04 12:06:14 +0100 | [diff] [blame] | 247 | target_include_directories(DelegateUnitTests PUBLIC ${PROJECT_SOURCE_DIR}) |
Sadik Armagan | 3c24f43 | 2020-10-19 17:35:30 +0100 | [diff] [blame] | 248 | |
Teresa Charlin | ad1b3d7 | 2023-03-14 12:10:28 +0000 | [diff] [blame] | 249 | # Add half library from armnn third-party libraries |
| 250 | target_link_libraries(DelegateUnitTests PRIVATE thirdparty_headers) |
Ryan OShea | ac9607f | 2023-04-03 11:33:33 +0100 | [diff] [blame] | 251 | target_link_libraries(DelegateUnitTests PRIVATE armnnDelegate) |
Teresa Charlin | ad1b3d7 | 2023-03-14 12:10:28 +0000 | [diff] [blame] | 252 | target_link_libraries(DelegateUnitTests PRIVATE Armnn::armnnUtils) |
Teresa Charlin | ad1b3d7 | 2023-03-14 12:10:28 +0000 | [diff] [blame] | 253 | target_link_libraries(DelegateUnitTests PRIVATE profiling_library_headers) |
Matthew Sloyan | 65c21a1 | 2023-04-04 12:06:14 +0100 | [diff] [blame] | 254 | endif() |
| 255 | |
| 256 | if (BUILD_OPAQUE_DELEGATE) |
| 257 | set(opaqueDelegate_unittest_sources) |
| 258 | list(APPEND opaqueDelegate_unittest_sources |
| 259 | common/src/test/DelegateTestInterpreter.hpp |
| 260 | common/src/test/DelegateTestInterpreterUtils.hpp |
| 261 | opaque/src/test/ArmnnOpaqueDelegateTest.cpp |
| 262 | opaque/src/test/DelegateTestInterpreter.cpp |
Matthew Sloyan | 0bd4c62 | 2023-04-27 11:48:26 +0100 | [diff] [blame] | 263 | test/ActivationTest.cpp |
| 264 | test/ActivationTestHelper.hpp |
John Mcloughlin | 559d909 | 2023-04-26 20:14:47 +0100 | [diff] [blame] | 265 | test/ArgMinMaxTest.cpp |
| 266 | test/ArgMinMaxTestHelper.hpp |
John Mcloughlin | 0422cf2 | 2023-04-27 16:55:00 +0100 | [diff] [blame] | 267 | test/BatchMatMulTest.cpp |
| 268 | test/BatchMatMulTestHelper.hpp |
Kevin May | 81b66f3 | 2023-04-26 14:55:36 +0100 | [diff] [blame] | 269 | test/BatchSpaceTest.cpp |
| 270 | test/BatchSpaceTestHelper.hpp |
Ryan OShea | a37ccb0 | 2023-04-11 10:54:07 +0100 | [diff] [blame] | 271 | test/CastTest.cpp |
Matthew Sloyan | 080ffd8 | 2023-04-24 12:53:04 +0100 | [diff] [blame] | 272 | test/CastTestHelper.hpp |
Matthew Sloyan | 2b04ec3 | 2023-04-26 11:42:46 +0100 | [diff] [blame] | 273 | test/ComparisonTest.cpp |
| 274 | test/ComparisonTestHelper.hpp |
| 275 | test/ControlTest.cpp |
| 276 | test/ControlTestHelper.hpp |
Matthew Sloyan | 080ffd8 | 2023-04-24 12:53:04 +0100 | [diff] [blame] | 277 | test/Convolution2dTest.cpp |
Francis Murtagh | 3a9e7ba | 2023-04-26 15:58:39 +0100 | [diff] [blame] | 278 | test/Convolution3dTest.cpp |
Matthew Sloyan | 080ffd8 | 2023-04-24 12:53:04 +0100 | [diff] [blame] | 279 | test/ConvolutionTestHelper.hpp |
| 280 | test/DepthwiseConvolution2dTest.cpp |
Teresa Charlin | f69ae56 | 2023-04-27 14:42:23 +0100 | [diff] [blame] | 281 | test/ElementwiseUnaryTestHelper.hpp |
| 282 | test/ElementwiseUnaryTest.cpp |
Matthew Sloyan | 0bd4c62 | 2023-04-27 11:48:26 +0100 | [diff] [blame] | 283 | test/FullyConnectedTest.cpp |
| 284 | test/FullyConnectedTestHelper.hpp |
Kevin May | b2831c5 | 2023-04-26 17:27:24 +0100 | [diff] [blame] | 285 | test/GatherTest.cpp |
| 286 | test/GatherTestHelper.hpp |
| 287 | test/GatherNdTest.cpp |
| 288 | test/GatherNdTestHelper.hpp |
Matthew Sloyan | 48ec813 | 2023-04-27 17:04:47 +0100 | [diff] [blame] | 289 | test/LstmTest.cpp |
| 290 | test/LstmTestHelper.hpp |
Teresa Charlin | f69ae56 | 2023-04-27 14:42:23 +0100 | [diff] [blame] | 291 | test/LogicalTest.cpp |
| 292 | test/LogicalTestHelper.hpp |
| 293 | test/NormalizationTest.cpp |
| 294 | test/NormalizationTestHelper.hpp |
Teresa Charlin | ecebb0f | 2023-04-27 21:37:56 +0100 | [diff] [blame] | 295 | test/PackTest.cpp |
| 296 | test/PackTestHelper.hpp |
| 297 | test/PadTest.cpp |
| 298 | test/PadTestHelper.hpp |
Matthew Sloyan | 48ec813 | 2023-04-27 17:04:47 +0100 | [diff] [blame] | 299 | test/Pooling2dTest.cpp |
| 300 | test/Pooling2dTestHelper.hpp |
| 301 | test/Pooling3dTest.cpp |
| 302 | test/Pooling3dTestHelper.hpp |
Matthew Sloyan | 0bd4c62 | 2023-04-27 11:48:26 +0100 | [diff] [blame] | 303 | test/PreluTest.cpp |
| 304 | test/PreluTestHelper.hpp |
John Mcloughlin | 083586d | 2023-04-28 18:36:52 +0100 | [diff] [blame] | 305 | test/ReduceTest.cpp |
| 306 | test/ReduceTestHelper.hpp |
| 307 | test/ResizeTest.cpp |
| 308 | test/ResizeTestHelper.hpp |
Matthew Sloyan | 48ec813 | 2023-04-27 17:04:47 +0100 | [diff] [blame] | 309 | test/RoundTest.cpp |
| 310 | test/RoundTestHelper.hpp |
Francis Murtagh | 36d94ef | 2023-04-28 14:05:43 +0100 | [diff] [blame] | 311 | test/QuantizationTest.cpp |
| 312 | test/QuantizationTestHelper.hpp |
John Mcloughlin | 0422cf2 | 2023-04-27 16:55:00 +0100 | [diff] [blame] | 313 | test/ShapeTest.cpp |
| 314 | test/ShapeTestHelper.hpp |
Teresa Charlin | 86b0357 | 2023-04-28 13:19:12 +0100 | [diff] [blame] | 315 | test/SliceTest.cpp |
| 316 | test/SliceTestHelper.hpp |
Teresa Charlin | 4236296 | 2023-04-28 14:23:33 +0100 | [diff] [blame] | 317 | test/SoftmaxTest.cpp |
| 318 | test/SoftmaxTestHelper.hpp |
| 319 | test/SpaceDepthTest.cpp |
| 320 | test/SpaceDepthTestHelper.hpp |
Teresa Charlin | 86b0357 | 2023-04-28 13:19:12 +0100 | [diff] [blame] | 321 | test/StridedSliceTest.cpp |
| 322 | test/StridedSliceTestHelper.hpp |
Matthew Sloyan | 080ffd8 | 2023-04-24 12:53:04 +0100 | [diff] [blame] | 323 | test/TestUtils.hpp |
Francis Murtagh | 3a9e7ba | 2023-04-26 15:58:39 +0100 | [diff] [blame] | 324 | test/TestUtils.cpp |
Teresa Charlin | ecebb0f | 2023-04-27 21:37:56 +0100 | [diff] [blame] | 325 | test/TransposeConvolution2dTest.cpp |
Teresa Charlin | 4236296 | 2023-04-28 14:23:33 +0100 | [diff] [blame] | 326 | test/TransposeTest.cpp |
| 327 | test/TransposeTestHelper.hpp |
Teresa Charlin | ecebb0f | 2023-04-27 21:37:56 +0100 | [diff] [blame] | 328 | test/UnpackTest.cpp |
| 329 | test/UnpackTestHelper.hpp) |
Matthew Sloyan | 65c21a1 | 2023-04-04 12:06:14 +0100 | [diff] [blame] | 330 | |
| 331 | # Until all operators are supported, we have to add tests one by one above to opaqueDelegate_unittest_sources. |
| 332 | # After we add can add commonDelegate_unittest_sources to the add_executable below. |
| 333 | add_executable(OpaqueDelegateUnitTests ${opaqueDelegate_unittest_sources}) |
| 334 | |
| 335 | target_include_directories(OpaqueDelegateUnitTests SYSTEM PRIVATE "${TF_LITE_SCHEMA_INCLUDE_PATH}") |
| 336 | target_include_directories(OpaqueDelegateUnitTests SYSTEM PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/common/src/test") |
| 337 | target_include_directories(OpaqueDelegateUnitTests PUBLIC ${PROJECT_SOURCE_DIR}) |
| 338 | |
| 339 | # Add half library from armnn third-party libraries |
| 340 | target_link_libraries(OpaqueDelegateUnitTests PRIVATE thirdparty_headers) |
| 341 | target_link_libraries(OpaqueDelegateUnitTests PRIVATE armnnOpaqueDelegate) |
| 342 | target_link_libraries(OpaqueDelegateUnitTests PRIVATE Armnn::armnnUtils) |
| 343 | target_link_libraries(OpaqueDelegateUnitTests PRIVATE profiling_library_headers) |
| 344 | endif() |
Sadik Armagan | 4189cc5 | 2020-11-11 18:01:48 +0000 | [diff] [blame] | 345 | endif() |
Sadik Armagan | 3c24f43 | 2020-10-19 17:35:30 +0100 | [diff] [blame] | 346 | |
Jan Eilers | a96489a | 2021-12-08 10:05:47 +0000 | [diff] [blame] | 347 | if(BUILD_DELEGATE_JNI_INTERFACE) |
| 348 | add_subdirectory(armnnDelegateJNI) |
| 349 | endif() |
| 350 | |
Sadik Armagan | 3c24f43 | 2020-10-19 17:35:30 +0100 | [diff] [blame] | 351 | #################################################### |
| 352 | ## Export targets |
| 353 | set(armnn_delegate_export_targets) |
| 354 | list(APPEND armnn_delegate_export_targets |
Teresa Charlin | ad1b3d7 | 2023-03-14 12:10:28 +0000 | [diff] [blame] | 355 | armnnClassicDelegateObject |
Finn Williams | 6f9f990 | 2020-11-13 13:23:15 +0000 | [diff] [blame] | 356 | armnnDelegate |
| 357 | tflite_headers |
Jan Eilers | c837f1e | 2021-11-08 10:19:31 +0000 | [diff] [blame] | 358 | flatbuffer_headers |
| 359 | profiling_library_headers |
| 360 | thirdparty_headers) |
Sadik Armagan | 3c24f43 | 2020-10-19 17:35:30 +0100 | [diff] [blame] | 361 | |
| 362 | install( |
| 363 | TARGETS ${armnn_delegate_export_targets} |
| 364 | EXPORT armnn-delegate-targets |
| 365 | LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} |
| 366 | ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} |
| 367 | RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) |
| 368 | |
| 369 | ## Set export alias |
| 370 | set_target_properties(armnnDelegate |
| 371 | PROPERTIES |
| 372 | EXPORT_NAME ArmnnDelegate) |
| 373 | |
| 374 | ## Export target scrips |
| 375 | install( |
| 376 | EXPORT armnn-delegate-targets |
| 377 | FILE ArmnnDelegateTargets.cmake |
| 378 | NAMESPACE ArmnnDelegate:: |
| 379 | DESTINATION ${CMAKE_INSTALL_LIBDIR}) |
| 380 | |
| 381 | ## Create ArmnnDelegateConfig.cmake |
| 382 | include(CMakePackageConfigHelpers) |
| 383 | set(INSTALL_CONFIGDIR ${CMAKE_INSTALL_LIBDIR}) |
| 384 | message(STATUS "CMAKE_CURRENT_LIST_DIR ${CMAKE_CURRENT_LIST_DIR}" ) |
| 385 | message(STATUS "CMAKE_CURRENT_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}" ) |
Finn Williams | bbbefec | 2020-11-25 14:32:42 +0000 | [diff] [blame] | 386 | SET(Armnn_DIR "${Armnn_DIR}") |
| 387 | |
Sadik Armagan | 3c24f43 | 2020-10-19 17:35:30 +0100 | [diff] [blame] | 388 | configure_package_config_file( |
| 389 | ${CMAKE_CURRENT_LIST_DIR}/cmake/Modules/ArmnnDelegateConfig.cmake.in |
| 390 | ${CMAKE_CURRENT_BINARY_DIR}/ArmnnDelegateConfig.cmake |
Finn Williams | bbbefec | 2020-11-25 14:32:42 +0000 | [diff] [blame] | 391 | INSTALL_DESTINATION ${INSTALL_CONFIGDIR} |
| 392 | PATH_VARS Armnn_DIR) |
Sadik Armagan | 3c24f43 | 2020-10-19 17:35:30 +0100 | [diff] [blame] | 393 | |
| 394 | ## Install ArmNN Delegate config file |
| 395 | install( |
| 396 | FILES |
| 397 | ${CMAKE_CURRENT_BINARY_DIR}/ArmnnDelegateConfig.cmake |
| 398 | DESTINATION ${INSTALL_CONFIGDIR}) |
| 399 | |
| 400 | ## Export from build tree |
| 401 | export( |
| 402 | EXPORT armnn-delegate-targets |
| 403 | FILE ${CMAKE_CURRENT_BINARY_DIR}/ArmnnDelegateTargets.cmake |
| 404 | NAMESPACE ArmnnDelegate::) |
Sadik Armagan | 5d03e31 | 2020-11-17 16:43:56 +0000 | [diff] [blame] | 405 | add_library(ArmnnDelegate::ArmnnDelegate ALIAS armnnDelegate) |
| 406 | |
Sadik Armagan | 3c24f43 | 2020-10-19 17:35:30 +0100 | [diff] [blame] | 407 | |
Narumol Prangnawarat | 50c87d3 | 2020-11-09 18:42:11 +0000 | [diff] [blame] | 408 | #################################################### |