2 # Copyright © 2020 Arm Ltd. All rights reserved.
4 # SPDX-License-Identifier: MIT
6 cmake_minimum_required (VERSION 3.0.2) # 3.0.2 required for return() statement used in AddDllCopyCommands.cmake
9 set(additional_cmake_files)
10 list(APPEND additional_cmake_files
11 cmake/ArmnnVersion.cmake
13 cmake/GlobalConfig.cmake
14 cmake/AddDllCopyCommands.cmake)
16 foreach(cmake_file ${additional_cmake_files})
17 include(${cmake_file})
20 if (DYNAMIC_BACKEND_PATHS)
21 # It's expected to have the format: DYNAMIC_BACKEND_PATHS="PATH_1:PATH_2...:PATH_N"
22 add_definitions('-DDYNAMIC_BACKEND_PATHS="${DYNAMIC_BACKEND_PATHS}"')
25 include(GNUInstallDirs)
27 add_subdirectory(samples)
28 add_subdirectory(src/armnnTfLiteParser)
29 add_subdirectory(src/armnnSerializer)
32 add_subdirectory(tests)
35 # Include the additional cmake files in their own target so that they will appear nicely in IDEs
36 add_custom_target(AdditionalCMakeFiles SOURCES ${additional_cmake_files})
38 set(armnnUtils_sources)
39 list(APPEND armnnUtils_sources
40 include/armnnUtils/DataLayoutIndexed.hpp
41 include/armnnUtils/Permute.hpp
42 include/armnnUtils/FloatingPointConverter.hpp
43 include/armnnUtils/TensorUtils.hpp
44 include/armnnUtils/Transpose.hpp
45 src/armnnUtils/BFloat16.hpp
46 src/armnnUtils/Filesystem.hpp
47 src/armnnUtils/Filesystem.cpp
48 src/armnnUtils/Processes.hpp
49 src/armnnUtils/Processes.cpp
50 src/armnnUtils/GraphTopologicalSort.hpp
51 src/armnnUtils/Half.hpp
52 src/armnnUtils/Permute.cpp
53 src/armnnUtils/DataLayoutIndexed.cpp
54 src/armnnUtils/DotSerializer.cpp
55 src/armnnUtils/DotSerializer.hpp
56 src/armnnUtils/HeapProfiling.cpp
57 src/armnnUtils/HeapProfiling.hpp
58 src/armnnUtils/LeakChecking.cpp
59 src/armnnUtils/LeakChecking.hpp
60 src/armnnUtils/ModelAccuracyChecker.cpp
61 src/armnnUtils/ModelAccuracyChecker.hpp
62 src/armnnUtils/CsvReader.cpp
63 src/armnnUtils/CsvReader.hpp
64 src/armnnUtils/FloatingPointConverter.cpp
65 src/armnnUtils/VerificationHelpers.hpp
66 src/armnnUtils/VerificationHelpers.cpp
67 src/armnnUtils/ParserHelper.hpp
68 src/armnnUtils/ParserHelper.cpp
69 src/armnnUtils/ParserPrototxtFixture.hpp
70 src/armnnUtils/PrototxtConversions.hpp
71 src/armnnUtils/PrototxtConversions.cpp
72 src/armnnUtils/QuantizeHelper.hpp
73 src/armnnUtils/TensorIOUtils.hpp
74 src/armnnUtils/TensorUtils.cpp
75 src/armnnUtils/Transpose.cpp
78 add_library_ex(armnnUtils STATIC ${armnnUtils_sources})
79 target_include_directories(armnnUtils PRIVATE src/backends)
81 if(BUILD_CAFFE_PARSER)
82 # ArmNN Parser source files required for all build options
83 set(armnn_caffe_parser_sources)
84 list(APPEND armnn_caffe_parser_sources
85 include/armnnCaffeParser/ICaffeParser.hpp
86 src/armnnCaffeParser/RecordByRecordCaffeParser.hpp
87 src/armnnCaffeParser/RecordByRecordCaffeParser.cpp
88 src/armnnCaffeParser/CaffeParser.hpp
89 src/armnnCaffeParser/CaffeParser.cpp
90 ${CAFFE_GENERATED_SOURCES}/caffe/proto/caffe.pb.cc
92 # The generated Caffe protobuf .cc file is not warning clean and we can't fix them.
93 if(COMPILER_IS_GNU_LIKE)
94 set_source_files_properties(${CAFFE_GENERATED_SOURCES}/caffe/proto/caffe.pb.cc PROPERTIES COMPILE_FLAGS "-Wno-unused-variable -Wno-unused-parameter -Wno-conversion -Wno-sign-conversion")
97 add_library_ex(armnnCaffeParser SHARED ${armnn_caffe_parser_sources})
98 set_target_properties(armnnCaffeParser PROPERTIES COMPILE_FLAGS "${CAFFE_PARSER_ADDITIONAL_COMPILE_FLAGS}")
100 target_include_directories(armnnCaffeParser PRIVATE src/armnnUtils)
102 target_link_libraries(armnnCaffeParser ${Boost_THREAD_LIBRARY} ${Boost_SYSTEM_LIBRARY})
104 target_link_libraries(armnnCaffeParser armnn)
105 target_link_libraries(armnnCaffeParser ${PROTOBUF_LIBRARIES})
106 set_target_properties(armnnCaffeParser PROPERTIES VERSION ${GENERIC_LIB_VERSION} SOVERSION ${GENERIC_LIB_SOVERSION})
110 if(BUILD_ONNX_PARSER)
111 set(armnn_onnx_parser_sources)
112 list(APPEND armnn_onnx_parser_sources
113 include/armnnOnnxParser/IOnnxParser.hpp
114 src/armnnOnnxParser/OnnxParser.hpp
115 src/armnnOnnxParser/OnnxParser.cpp
116 ${ONNX_GENERATED_SOURCES}/onnx/onnx.pb.cc
118 # The generated onnx protobuf .cc files are not warning clean and we can't fix them.
119 if(COMPILER_IS_GNU_LIKE)
120 set_source_files_properties(${ONNX_GENERATED_SOURCES}/onnx/onnx.pb.cc PROPERTIES COMPILE_FLAGS "-Wno-conversion -Wno-sign-conversion")
123 add_library_ex(armnnOnnxParser SHARED ${armnn_onnx_parser_sources})
125 target_include_directories(armnnOnnxParser PRIVATE src/armnnUtils)
127 target_link_libraries(armnnOnnxParser armnn)
130 target_link_libraries(armnnOnnxParser ${PROTOBUF_LIBRARIES})
131 set_target_properties(armnnOnnxParser PROPERTIES VERSION ${GENERIC_LIB_VERSION} SOVERSION ${GENERIC_LIB_SOVERSION})
135 set(armnn_tf_parser_sources)
136 list(APPEND armnn_tf_parser_sources
137 include/armnnTfParser/ITfParser.hpp
138 src/armnnTfParser/TfParser.hpp
139 src/armnnTfParser/TfParser.cpp
142 # The generated tensorflow protobuf .cc files are not warning clean and we can't fix them.
143 if(COMPILER_IS_GNU_LIKE)
144 set_source_files_properties(${TF_PROTOBUFS} PROPERTIES COMPILE_FLAGS "-Wno-unused-variable -Wno-unused-parameter -Wno-conversion -Wno-sign-conversion")
147 add_library_ex(armnnTfParser SHARED ${armnn_tf_parser_sources})
149 target_include_directories(armnnTfParser PRIVATE src/armnnUtils)
151 target_link_libraries(armnnTfParser armnn)
153 # Protobuf (use the specific version tensorflow wants)
154 target_link_libraries(armnnTfParser ${PROTOBUF_LIBRARIES})
155 set_target_properties(armnnTfParser PROPERTIES VERSION ${GENERIC_LIB_VERSION} SOVERSION ${GENERIC_LIB_SOVERSION})
158 if(BUILD_ARMNN_QUANTIZER AND ARMNNREF)
159 if(NOT BUILD_ARMNN_SERIALIZER)
160 message(ERROR, "In order to build the ArmNN Quantization Tool you must set BUILD_ARMNN_SERIALIZER = YES")
163 set(armnn_quantizer_sources)
164 list(APPEND armnn_quantizer_sources
165 src/armnnQuantizer/QuantizationDataSet.hpp
166 src/armnnQuantizer/QuantizationDataSet.cpp
167 src/armnnQuantizer/QuantizationInput.hpp
168 src/armnnQuantizer/QuantizationInput.cpp
169 src/armnnQuantizer/CommandLineProcessor.hpp
170 src/armnnQuantizer/CommandLineProcessor.cpp
173 add_library_ex(armnnQuantizer SHARED ${armnn_quantizer_sources})
175 target_include_directories(armnnQuantizer PRIVATE include/armnnDeserializer)
176 target_include_directories(armnnQuantizer PRIVATE src/armnnUtils)
177 target_include_directories(armnnQuantizer PRIVATE src/armnn)
179 include_directories(SYSTEM "${FLATBUFFERS_INCLUDE_PATH}")
180 set_target_properties(armnnQuantizer PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR})
182 target_link_libraries(armnnQuantizer
184 ${Boost_SYSTEM_LIBRARY}
185 ${Boost_PROGRAM_OPTIONS_LIBRARY}
186 ${Boost_FILESYSTEM_LIBRARY}
187 ${Boost_THREAD_LIBRARY} )
189 add_executable_ex(ArmnnQuantizer
190 src/armnnQuantizer/ArmNNQuantizerMain.cpp)
192 target_include_directories(ArmnnQuantizer PRIVATE include/armnnDeserializer)
193 target_include_directories(ArmnnQuantizer PRIVATE src/armnn)
195 target_link_libraries(ArmnnQuantizer
196 ${Boost_SYSTEM_LIBRARY}
197 ${Boost_PROGRAM_OPTIONS_LIBRARY}
198 ${Boost_FILESYSTEM_LIBRARY}
199 ${Boost_THREAD_LIBRARY} )
201 target_link_libraries(ArmnnQuantizer
206 ${FLATBUFFERS_LIBRARY})
208 if(Threads_FOUND AND (NOT ("${CMAKE_SYSTEM_NAME}" STREQUAL Android)))
209 target_link_libraries(ArmnnQuantizer pthread)
212 set_target_properties(armnnQuantizer PROPERTIES VERSION ${GENERIC_LIB_VERSION} SOVERSION ${GENERIC_LIB_SOVERSION})
217 list(APPEND armnn_sources
218 include/armnn/ArmNN.hpp
219 include/armnn/BackendHelper.hpp
220 include/armnn/BackendId.hpp
221 include/armnn/BackendOptions.hpp
222 include/armnn/BackendRegistry.hpp
223 include/armnn/Conversion.hpp
224 include/armnn/Deprecated.hpp
225 include/armnn/Descriptors.hpp
226 include/armnn/DescriptorsFwd.hpp
227 include/armnn/Exceptions.hpp
228 include/armnn/ILayerSupport.hpp
229 include/armnn/ILayerVisitor.hpp
230 include/armnn/INetwork.hpp
231 include/armnn/IProfiler.hpp
232 include/armnn/IRuntime.hpp
233 include/armnn/LayerSupport.hpp
234 include/armnn/LayerVisitorBase.hpp
235 include/armnn/Logging.hpp
236 include/armnn/LstmParams.hpp
237 include/armnn/MemorySources.hpp
238 include/armnn/NetworkFwd.hpp
239 include/armnn/Optional.hpp
240 include/armnn/QuantizedLstmParams.hpp
241 include/armnn/Tensor.hpp
242 include/armnn/TensorFwd.hpp
243 include/armnn/Types.hpp
244 include/armnn/TypesUtils.hpp
245 include/armnn/Utils.hpp
246 include/armnn/Version.hpp
247 include/armnn/profiling/IProfilingGuidGenerator.hpp
248 include/armnn/profiling/ISendTimelinePacket.hpp
249 include/armnn/utility/Assert.hpp
250 include/armnn/utility/IgnoreUnused.hpp
251 include/armnn/utility/NumericCast.hpp
252 include/armnn/utility/PolymorphicDowncast.hpp
253 include/armnn/utility/StringUtils.hpp
254 profiling/common/include/Packet.hpp
255 profiling/common/include/ProfilingException.hpp
256 profiling/common/include/SocketConnectionException.hpp
257 profiling/common/include/Constants.hpp
258 profiling/common/src/NetworkSockets.cpp
259 src/armnn/layers/LayerCloneBase.hpp
260 src/armnn/layers/LayerWithParameters.hpp
261 src/armnn/layers/ActivationLayer.hpp
262 src/armnn/layers/ActivationLayer.cpp
263 src/armnn/layers/AdditionLayer.hpp
264 src/armnn/layers/AdditionLayer.cpp
265 src/armnn/layers/ArgMinMaxLayer.hpp
266 src/armnn/layers/ArgMinMaxLayer.cpp
267 src/armnn/layers/BatchNormalizationLayer.hpp
268 src/armnn/layers/BatchNormalizationLayer.cpp
269 src/armnn/layers/BatchToSpaceNdLayer.hpp
270 src/armnn/layers/BatchToSpaceNdLayer.cpp
271 src/armnn/layers/ComparisonLayer.hpp
272 src/armnn/layers/ComparisonLayer.cpp
273 src/armnn/layers/ConcatLayer.hpp
274 src/armnn/layers/ConcatLayer.cpp
275 src/armnn/layers/ConstantLayer.hpp
276 src/armnn/layers/ConstantLayer.cpp
277 src/armnn/layers/Convolution2dLayer.hpp
278 src/armnn/layers/Convolution2dLayer.cpp
279 src/armnn/layers/ConvertBf16ToFp32Layer.cpp
280 src/armnn/layers/ConvertBf16ToFp32Layer.hpp
281 src/armnn/layers/ConvertFp16ToFp32Layer.hpp
282 src/armnn/layers/ConvertFp16ToFp32Layer.cpp
283 src/armnn/layers/ConvertFp32ToBf16Layer.hpp
284 src/armnn/layers/ConvertFp32ToBf16Layer.cpp
285 src/armnn/layers/ConvertFp32ToFp16Layer.hpp
286 src/armnn/layers/ConvertFp32ToFp16Layer.cpp
287 src/armnn/layers/DebugLayer.hpp
288 src/armnn/layers/DebugLayer.cpp
289 src/armnn/layers/DepthToSpaceLayer.hpp
290 src/armnn/layers/DepthToSpaceLayer.cpp
291 src/armnn/layers/DepthwiseConvolution2dLayer.hpp
292 src/armnn/layers/DepthwiseConvolution2dLayer.cpp
293 src/armnn/layers/DequantizeLayer.hpp
294 src/armnn/layers/DequantizeLayer.cpp
295 src/armnn/layers/DetectionPostProcessLayer.hpp
296 src/armnn/layers/DetectionPostProcessLayer.cpp
297 src/armnn/layers/ElementwiseBaseLayer.hpp
298 src/armnn/layers/ElementwiseBaseLayer.cpp
299 src/armnn/layers/ElementwiseUnaryLayer.hpp
300 src/armnn/layers/ElementwiseUnaryLayer.cpp
301 src/armnn/layers/FakeQuantizationLayer.hpp
302 src/armnn/layers/FakeQuantizationLayer.cpp
303 src/armnn/layers/FloorLayer.hpp
304 src/armnn/layers/FloorLayer.cpp
305 src/armnn/layers/FullyConnectedLayer.hpp
306 src/armnn/layers/FullyConnectedLayer.cpp
307 src/armnn/layers/GatherLayer.cpp
308 src/armnn/layers/GatherLayer.hpp
309 src/armnn/layers/InputLayer.hpp
310 src/armnn/layers/InputLayer.cpp
311 src/armnn/layers/InstanceNormalizationLayer.hpp
312 src/armnn/layers/InstanceNormalizationLayer.cpp
313 src/armnn/layers/L2NormalizationLayer.hpp
314 src/armnn/layers/L2NormalizationLayer.cpp
315 src/armnn/layers/LogSoftmaxLayer.hpp
316 src/armnn/layers/LogSoftmaxLayer.cpp
317 src/armnn/layers/LstmLayer.cpp
318 src/armnn/layers/LstmLayer.hpp
319 src/armnn/layers/MaximumLayer.cpp
320 src/armnn/layers/MaximumLayer.hpp
321 src/armnn/layers/MeanLayer.hpp
322 src/armnn/layers/MeanLayer.cpp
323 src/armnn/layers/MemCopyLayer.hpp
324 src/armnn/layers/MemCopyLayer.cpp
325 src/armnn/layers/MemImportLayer.hpp
326 src/armnn/layers/MemImportLayer.cpp
327 src/armnn/layers/MergeLayer.hpp
328 src/armnn/layers/MergeLayer.cpp
329 src/armnn/layers/MinimumLayer.cpp
330 src/armnn/layers/MinimumLayer.hpp
331 src/armnn/layers/MultiplicationLayer.hpp
332 src/armnn/layers/MultiplicationLayer.cpp
333 src/armnn/layers/NormalizationLayer.hpp
334 src/armnn/layers/NormalizationLayer.cpp
335 src/armnn/layers/OutputLayer.hpp
336 src/armnn/layers/OutputLayer.cpp
337 src/armnn/layers/PadLayer.hpp
338 src/armnn/layers/PadLayer.cpp
339 src/armnn/layers/PermuteLayer.hpp
340 src/armnn/layers/PermuteLayer.cpp
341 src/armnn/layers/Pooling2dLayer.hpp
342 src/armnn/layers/Pooling2dLayer.cpp
343 src/armnn/layers/QuantizeLayer.cpp
344 src/armnn/layers/QuantizeLayer.hpp
345 src/armnn/layers/QLstmLayer.hpp
346 src/armnn/layers/QLstmLayer.cpp
347 src/armnn/layers/QuantizedLstmLayer.hpp
348 src/armnn/layers/QuantizedLstmLayer.cpp
349 src/armnn/layers/DivisionLayer.cpp
350 src/armnn/layers/DivisionLayer.hpp
351 src/armnn/layers/PreCompiledLayer.hpp
352 src/armnn/layers/PreCompiledLayer.cpp
353 src/armnn/layers/PreluLayer.hpp
354 src/armnn/layers/PreluLayer.cpp
355 src/armnn/layers/ReshapeLayer.hpp
356 src/armnn/layers/ReshapeLayer.cpp
357 src/armnn/layers/ResizeLayer.hpp
358 src/armnn/layers/ResizeLayer.cpp
359 src/armnn/layers/SliceLayer.cpp
360 src/armnn/layers/SliceLayer.hpp
361 src/armnn/layers/SoftmaxLayer.hpp
362 src/armnn/layers/SoftmaxLayer.cpp
363 src/armnn/layers/SpaceToBatchNdLayer.hpp
364 src/armnn/layers/SpaceToBatchNdLayer.cpp
365 src/armnn/layers/SpaceToDepthLayer.hpp
366 src/armnn/layers/SpaceToDepthLayer.cpp
367 src/armnn/layers/SplitterLayer.hpp
368 src/armnn/layers/SplitterLayer.cpp
369 src/armnn/layers/StackLayer.hpp
370 src/armnn/layers/StackLayer.cpp
371 src/armnn/layers/StandInLayer.cpp
372 src/armnn/layers/StandInLayer.hpp
373 src/armnn/layers/StridedSliceLayer.cpp
374 src/armnn/layers/StridedSliceLayer.hpp
375 src/armnn/layers/SubtractionLayer.cpp
376 src/armnn/layers/SubtractionLayer.hpp
377 src/armnn/layers/SwitchLayer.cpp
378 src/armnn/layers/SwitchLayer.hpp
379 src/armnn/layers/TransposeConvolution2dLayer.cpp
380 src/armnn/layers/TransposeConvolution2dLayer.hpp
381 src/armnn/layers/TransposeLayer.hpp
382 src/armnn/layers/TransposeLayer.cpp
383 src/armnn/BackendRegistry.cpp
384 src/armnn/BackendSettings.hpp
385 src/armnn/BackendHelper.cpp
386 src/armnn/CompatibleTypes.hpp
387 src/armnn/Descriptors.cpp
388 src/armnn/DeviceSpec.hpp
389 src/armnn/DllExport.hpp
390 src/armnn/DynamicQuantizationVisitor.cpp
391 src/armnn/DynamicQuantizationVisitor.hpp
392 src/armnn/Exceptions.cpp
393 src/armnn/ExecutionFrame.cpp
394 src/armnn/ExecutionFrame.hpp
397 src/armnn/IGraphObservable.hpp
398 src/armnn/Instrument.hpp
399 src/armnn/InternalTypes.cpp
400 src/armnn/InternalTypes.hpp
401 src/armnn/ISubgraphViewConverter.hpp
402 src/armnn/JsonPrinter.cpp
403 src/armnn/JsonPrinter.hpp
405 src/armnn/LayerFwd.hpp
407 src/armnn/LayersFwd.hpp
408 src/armnn/LayerSupportCommon.hpp
409 src/armnn/LayerSupport.cpp
410 src/armnn/LoadedNetwork.cpp
411 src/armnn/LoadedNetwork.hpp
412 src/armnn/Logging.cpp
413 src/armnn/Network.cpp
414 src/armnn/Network.hpp
415 src/armnn/NetworkQuantizationScheme.hpp
416 src/armnn/NetworkQuantizer.cpp
417 src/armnn/NetworkQuantizer.hpp
418 src/armnn/NetworkQuantizerUtils.cpp
419 src/armnn/NetworkQuantizerUtils.hpp
420 src/armnn/NetworkUtils.cpp
421 src/armnn/NetworkUtils.hpp
422 src/armnn/Observable.cpp
423 src/armnn/Observable.hpp
424 src/armnn/Optimizer.cpp
425 src/armnn/Optimizer.hpp
426 src/armnn/OutputHandler.cpp
427 src/armnn/OutputHandler.hpp
428 src/armnn/OverrideInputRangeVisitor.cpp
429 src/armnn/OverrideInputRangeVisitor.hpp
430 src/armnn/Profiling.cpp
431 src/armnn/ProfilingEvent.cpp
432 src/armnn/ProfilingEvent.hpp
433 src/armnn/Profiling.hpp
434 src/armnn/QuantizerVisitor.cpp
435 src/armnn/QuantizerVisitor.hpp
436 src/armnn/Runtime.cpp
437 src/armnn/Runtime.hpp
438 src/armnn/RangeTracker.cpp
439 src/armnn/RangeTracker.hpp
440 src/armnn/ResolveType.hpp
441 src/armnn/SerializeLayerParameters.cpp
442 src/armnn/SerializeLayerParameters.hpp
443 src/armnn/StaticRangeVisitor.cpp
444 src/armnn/StaticRangeVisitor.hpp
445 src/armnn/SubgraphView.cpp
446 src/armnn/SubgraphView.hpp
447 src/armnn/SubgraphViewSelector.cpp
448 src/armnn/SubgraphViewSelector.hpp
450 src/armnn/TypesUtils.cpp
452 src/armnn/WallClockTimer.cpp
453 src/armnn/WallClockTimer.hpp
454 src/armnn/optimizations/AddDebug.hpp
455 src/armnn/optimizations/All.hpp
456 src/armnn/optimizations/ConvertConstants.hpp
457 src/armnn/optimizations/ConvertFp32NetworkToBf16.hpp
458 src/armnn/optimizations/ConvertFp32NetworkToFp16.hpp
459 src/armnn/optimizations/FoldPadIntoConvolution2d.hpp
460 src/armnn/optimizations/MovePermuteUp.hpp
461 src/armnn/optimizations/MoveTransposeUp.hpp
462 src/armnn/optimizations/Optimization.hpp
463 src/armnn/optimizations/OptimizeConsecutiveReshapes.hpp
464 src/armnn/optimizations/OptimizeInverseConversions.hpp
465 src/armnn/optimizations/OptimizeInversePermutes.hpp
466 src/armnn/optimizations/PermuteAndBatchToSpaceAsDepthToSpace.hpp
467 src/armnn/optimizations/PermuteAsReshape.hpp
468 src/armnn/optimizations/SquashEqualSiblings.hpp
469 src/profiling/ActivateTimelineReportingCommandHandler.cpp
470 src/profiling/ActivateTimelineReportingCommandHandler.hpp
471 src/profiling/BufferManager.cpp
472 src/profiling/BufferManager.hpp
473 src/profiling/CommandHandler.cpp
474 src/profiling/CommandHandler.hpp
475 src/profiling/CommandHandlerFunctor.cpp
476 src/profiling/CommandHandlerFunctor.hpp
477 src/profiling/CommandHandlerKey.cpp
478 src/profiling/CommandHandlerKey.hpp
479 src/profiling/CommandHandlerRegistry.cpp
480 src/profiling/CommandHandlerRegistry.hpp
481 src/profiling/ConnectionAcknowledgedCommandHandler.cpp
482 src/profiling/ConnectionAcknowledgedCommandHandler.hpp
483 src/profiling/CounterDirectory.cpp
484 src/profiling/CounterDirectory.hpp
485 src/profiling/CounterIdMap.cpp
486 src/profiling/CounterIdMap.hpp
487 src/profiling/DeactivateTimelineReportingCommandHandler.cpp
488 src/profiling/DeactivateTimelineReportingCommandHandler.hpp
489 src/profiling/DirectoryCaptureCommandHandler.cpp
490 src/profiling/DirectoryCaptureCommandHandler.hpp
491 src/profiling/EncodeVersion.hpp
492 src/profiling/FileOnlyProfilingConnection.cpp
493 src/profiling/FileOnlyProfilingConnection.hpp
494 src/profiling/Holder.cpp
495 src/profiling/Holder.hpp
496 src/profiling/IBufferManager.hpp
497 src/profiling/IConsumer.hpp
498 src/profiling/ICounterDirectory.hpp
499 src/profiling/ICounterRegistry.hpp
500 src/profiling/ICounterValues.hpp
501 src/profiling/INotifyBackends.hpp
502 src/profiling/IReportStructure.hpp
503 src/profiling/ISendCounterPacket.hpp
504 src/profiling/ISendThread.hpp
505 src/profiling/IPacketBuffer.hpp
506 src/profiling/IPeriodicCounterCapture.hpp
507 src/profiling/IProfilingConnection.hpp
508 src/profiling/IProfilingConnectionFactory.hpp
509 src/profiling/LabelsAndEventClasses.cpp
510 src/profiling/LabelsAndEventClasses.hpp
511 src/profiling/NullProfilingConnection.hpp
512 src/profiling/PacketBuffer.cpp
513 src/profiling/PacketBuffer.hpp
514 src/profiling/PacketVersionResolver.cpp
515 src/profiling/PacketVersionResolver.hpp
516 src/profiling/PeriodicCounterCapture.hpp
517 src/profiling/PeriodicCounterCapture.cpp
518 src/profiling/PeriodicCounterSelectionCommandHandler.cpp
519 src/profiling/PeriodicCounterSelectionCommandHandler.hpp
520 src/profiling/PerJobCounterSelectionCommandHandler.cpp
521 src/profiling/PerJobCounterSelectionCommandHandler.hpp
522 src/profiling/ProfilingConnectionDumpToFileDecorator.cpp
523 src/profiling/ProfilingConnectionDumpToFileDecorator.hpp
524 src/profiling/ProfilingConnectionFactory.cpp
525 src/profiling/ProfilingConnectionFactory.hpp
526 src/profiling/ProfilingGuidGenerator.hpp
527 src/profiling/ProfilingService.cpp
528 src/profiling/ProfilingService.hpp
529 src/profiling/ProfilingStateMachine.cpp
530 src/profiling/ProfilingStateMachine.hpp
531 src/profiling/ProfilingUtils.cpp
532 src/profiling/ProfilingUtils.hpp
533 src/profiling/RegisterBackendCounters.cpp
534 src/profiling/RegisterBackendCounters.hpp
535 src/profiling/RequestCounterDirectoryCommandHandler.cpp
536 src/profiling/RequestCounterDirectoryCommandHandler.hpp
537 src/profiling/SendCounterPacket.cpp
538 src/profiling/SendCounterPacket.hpp
539 src/profiling/SendThread.cpp
540 src/profiling/SendThread.hpp
541 src/profiling/SendTimelinePacket.cpp
542 src/profiling/SendTimelinePacket.hpp
543 src/profiling/SocketProfilingConnection.cpp
544 src/profiling/SocketProfilingConnection.hpp
545 src/profiling/TimelinePacketWriterFactory.cpp
546 src/profiling/TimelinePacketWriterFactory.hpp
547 src/profiling/TimelineUtilityMethods.cpp
548 src/profiling/TimelineUtilityMethods.hpp
549 src/profiling/backends/BackendProfiling.cpp
550 src/profiling/backends/BackendProfiling.hpp
551 third-party/half/half.hpp
554 # Files used for Streamline-based profiling backend
555 if(PROFILING_BACKEND_STREAMLINE)
556 list(APPEND armnn_sources
557 ${GATOR_ROOT}/annotate/streamline_annotate.h
558 ${GATOR_ROOT}/annotate/streamline_annotate.c)
561 # the backends under src/backends extend the list of
562 # object libs armnn to include in the build
563 include(src/backends/backends.cmake)
564 foreach(lib ${armnnLibraries})
565 message(STATUS "Adding object library dependency to armnn: ${lib}")
566 list(APPEND armnn_sources $<TARGET_OBJECTS:${lib}>)
569 add_library_ex(armnn SHARED ${armnn_sources})
571 target_compile_definitions(armnn PRIVATE "ARMNN_COMPILING_DLL")
573 target_include_directories(armnn PRIVATE src/armnn)
574 target_include_directories(armnn PRIVATE src/armnnUtils)
575 target_include_directories(armnn PRIVATE src/backends)
576 target_include_directories(armnn PRIVATE src/profiling)
577 target_include_directories(armnn PRIVATE profiling/common/include)
579 target_link_libraries(armnn armnnUtils)
581 target_link_libraries(armnn ${CMAKE_DL_LIBS})
582 if ("${CMAKE_SYSTEM_NAME}" STREQUAL Windows)
583 target_link_libraries(armnn Ws2_32.lib)
586 install(TARGETS armnn
587 LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
588 RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
589 if(BUILD_CAFFE_PARSER)
590 install(TARGETS armnnCaffeParser
591 LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
592 RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
594 if(BUILD_ONNX_PARSER)
595 install(TARGETS armnnOnnxParser
596 LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
597 RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
600 install(TARGETS armnnTfParser
601 LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
602 RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
605 install(DIRECTORY include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
607 target_link_libraries(armnn ${Boost_THREAD_LIBRARY}
608 ${Boost_SYSTEM_LIBRARY} ${Boost_FILESYSTEM_LIBRARY})
610 if(ARMCOMPUTENEON OR ARMCOMPUTECL)
611 target_link_libraries(armnn ${ARMCOMPUTE_LIBRARIES})
614 if(PROFILING_BACKEND_STREAMLINE AND (NOT ("${CMAKE_SYSTEM_NAME}" STREQUAL Android)))
615 target_link_libraries(armnn pthread)
618 set_target_properties(armnn PROPERTIES VERSION ${GENERIC_LIB_VERSION} SOVERSION ${GENERIC_LIB_SOVERSION})
621 set(unittest_sources)
622 list(APPEND unittest_sources
623 src/armnn/test/ConstTensorLayerVisitor.hpp
624 src/armnn/test/ConstTensorLayerVisitor.cpp
625 src/armnn/test/CreateWorkload.hpp
626 src/armnn/test/CsvReaderTest.cpp
627 src/armnn/test/EndToEndTest.cpp
628 src/armnn/test/ExecutionFrameTest.cpp
629 src/armnn/test/FloatingPointConverterTest.cpp
630 src/armnn/test/FlowControl.cpp
631 src/armnn/test/GraphTests.cpp
632 src/armnn/test/GraphUtils.cpp
633 src/armnn/test/GraphUtils.hpp
634 src/armnn/test/InstrumentTests.cpp
635 src/armnn/test/InferOutputTests.cpp
636 src/armnn/test/InferOutputTests.hpp
637 src/armnn/test/ModelAccuracyCheckerTest.cpp
638 src/armnn/test/NetworkTests.cpp
639 src/armnn/test/ObservableTest.cpp
640 src/armnn/test/OptimizerTests.cpp
641 src/armnn/test/optimizations/ConvertConstantsBFloatTests.cpp
642 src/armnn/test/optimizations/ConvertConstantsFloatToHalfTests.cpp
643 src/armnn/test/optimizations/ConvertConstantsHalfToFloatTests.cpp
644 src/armnn/test/optimizations/Fp32NetworkToBf16ConverterTests.cpp
645 src/armnn/test/optimizations/Fp32NetworkToFp16ConverterTests.cpp
646 src/armnn/test/optimizations/InsertDebugLayerTests.cpp
647 src/armnn/test/optimizations/MovePermuteUpTests.cpp
648 src/armnn/test/optimizations/MoveTransposeUpTests.cpp
649 src/armnn/test/optimizations/OptimizeConsecutiveReshapesTests.cpp
650 src/armnn/test/optimizations/OptimizeInverseConversionsTests.cpp
651 src/armnn/test/optimizations/OptimizeInversePermutesTests.cpp
652 src/armnn/test/optimizations/PermuteAndBatchToSpaceAsDepthToSpaceTests.cpp
653 src/armnn/test/optimizations/PermuteAsReshapeTests.cpp
654 src/armnn/test/optimizations/SquashEqualSiblingsTests.cpp
655 src/armnn/test/optimizations/TransposeAsReshapeTests.cpp
656 src/armnn/test/OptionalTest.cpp
657 src/armnn/test/ProfilerTests.cpp
658 src/armnn/test/ProfilingEventTest.cpp
659 src/armnn/test/SubgraphViewTests.cpp
660 src/armnn/test/TensorHandleStrategyTest.cpp
661 src/armnn/test/TensorHelpers.hpp
662 src/armnn/test/TensorTest.cpp
663 src/armnn/test/TestInputOutputLayerVisitor.cpp
664 src/armnn/test/TestInputOutputLayerVisitor.hpp
665 src/armnn/test/TestLayerVisitor.cpp
666 src/armnn/test/TestLayerVisitor.hpp
667 src/armnn/test/TestNameOnlyLayerVisitor.cpp
668 src/armnn/test/TestNameOnlyLayerVisitor.hpp
669 src/armnn/test/TestNameAndDescriptorLayerVisitor.hpp
670 src/armnn/test/TestNameAndDescriptorLayerVisitor.cpp
671 src/armnn/test/TestUtils.cpp
672 src/armnn/test/TestUtils.hpp
673 src/armnn/test/UtilityTests.cpp
674 src/armnn/test/UnitTests.cpp
675 src/armnn/test/UnitTests.hpp
676 src/armnn/test/UtilsTests.cpp
677 src/armnnUtils/test/QuantizeHelperTest.cpp
678 src/armnnUtils/test/PrototxtConversionsTest.cpp
679 src/armnnUtils/test/ParserHelperTest.cpp
680 src/armnnUtils/test/TensorUtilsTest.cpp
681 src/profiling/test/BufferTests.cpp
682 src/profiling/test/FileOnlyProfilingDecoratorTests.cpp
683 src/profiling/test/PrintPacketHeaderHandler.cpp
684 src/profiling/test/PrintPacketHeaderHandler.hpp
685 src/profiling/test/ProfilingConnectionDumpToFileDecoratorTests.cpp
686 src/profiling/test/ProfilingGuidTest.cpp
687 src/profiling/test/ProfilingMocks.hpp
688 src/profiling/test/ProfilingTests.cpp
689 src/profiling/test/ProfilingTests.hpp
690 src/profiling/test/ProfilingTestUtils.cpp
691 src/profiling/test/ProfilingTestUtils.hpp
692 src/profiling/test/SendCounterPacketTests.cpp
693 src/profiling/test/SendCounterPacketTests.hpp
694 src/profiling/test/TestTimelinePacketHandler.cpp
695 src/profiling/test/TestTimelinePacketHandler.hpp
696 src/profiling/test/TimelineModel.cpp
697 src/profiling/test/TimelineModel.hpp
698 src/profiling/test/SendTimelinePacketTests.cpp
699 src/profiling/test/TimelinePacketTests.cpp
700 src/profiling/test/TimelineUtilityMethodsTests.cpp
704 list(APPEND unittest_sources
705 src/armnn/test/DebugCallbackTest.cpp
706 src/armnn/test/QuantizerTest.cpp
707 src/armnn/test/RuntimeTests.cpp
708 src/armnn/test/RuntimeTests.hpp
712 if(BUILD_TF_PARSER AND ARMNNREF)
713 list(APPEND unittest_sources
714 src/armnnTfParser/test/Activations.cpp
715 src/armnnTfParser/test/Addition.cpp
716 src/armnnTfParser/test/AddN.cpp
717 src/armnnTfParser/test/Assert.cpp
718 src/armnnTfParser/test/BiasAdd.cpp
719 src/armnnTfParser/test/BroadcastForAdd.cpp
720 src/armnnTfParser/test/Convolution2d.cpp
721 src/armnnTfParser/test/Concat.cpp
722 src/armnnTfParser/test/ConcatOfConcats.cpp
723 src/armnnTfParser/test/DepthwiseConvolution2d.cpp
724 src/armnnTfParser/test/Equal.cpp
725 src/armnnTfParser/test/ExpandDims.cpp
726 src/armnnTfParser/test/FusedBatchNorm.cpp
727 src/armnnTfParser/test/Gather.cpp
728 src/armnnTfParser/test/Greater.cpp
729 src/armnnTfParser/test/Identity.cpp
730 src/armnnTfParser/test/LocalResponseNormalization.cpp
731 src/armnnTfParser/test/Maximum.cpp
732 src/armnnTfParser/test/MaximumForLeakyRelu.cpp
733 src/armnnTfParser/test/Mean.cpp
734 src/armnnTfParser/test/Minimum.cpp
735 src/armnnTfParser/test/Multiplication.cpp
736 src/armnnTfParser/test/Pad.cpp
737 src/armnnTfParser/test/MultiOutput.cpp
738 src/armnnTfParser/test/PassThru.cpp
739 src/armnnTfParser/test/Pooling.cpp
740 src/armnnTfParser/test/RealDiv.cpp
741 src/armnnTfParser/test/Reshape.cpp
742 src/armnnTfParser/test/ResizeBilinear.cpp
743 src/armnnTfParser/test/Rsqrt.cpp
744 src/armnnTfParser/test/Shape.cpp
745 src/armnnTfParser/test/Softmax.cpp
746 src/armnnTfParser/test/TestDependencies.cpp
747 src/armnnTfParser/test/FullyConnected.cpp
748 src/armnnTfParser/test/Constant.cpp
749 src/armnnTfParser/test/TestMultiInputsOutputs.cpp
750 src/armnnTfParser/test/Split.cpp
751 src/armnnTfParser/test/Squeeze.cpp
752 src/armnnTfParser/test/Stack.cpp
753 src/armnnTfParser/test/Sub.cpp
754 src/armnnTfParser/test/StridedSlice.cpp
755 src/armnnTfParser/test/Transpose.cpp
760 if(BUILD_TF_LITE_PARSER AND ARMNNREF)
761 list(APPEND unittest_sources
762 src/armnnTfLiteParser/test/Activations.cpp
763 src/armnnTfLiteParser/test/Addition.cpp
764 src/armnnTfLiteParser/test/AvgPool2D.cpp
765 src/armnnTfLiteParser/test/BatchToSpaceND.cpp
766 src/armnnTfLiteParser/test/Concatenation.cpp
767 src/armnnTfLiteParser/test/Constant.cpp
768 src/armnnTfLiteParser/test/Conv2D.cpp
769 src/armnnTfLiteParser/test/DepthwiseConvolution2D.cpp
770 src/armnnTfLiteParser/test/Dequantize.cpp
771 src/armnnTfLiteParser/test/DetectionPostProcess.cpp
772 src/armnnTfLiteParser/test/FullyConnected.cpp
773 src/armnnTfLiteParser/test/L2Normalization.cpp
774 src/armnnTfLiteParser/test/Maximum.cpp
775 src/armnnTfLiteParser/test/MaxPool2D.cpp
776 src/armnnTfLiteParser/test/Mean.cpp
777 src/armnnTfLiteParser/test/Minimum.cpp
778 src/armnnTfLiteParser/test/Multiplication.cpp
779 src/armnnTfLiteParser/test/Pack.cpp
780 src/armnnTfLiteParser/test/Pad.cpp
781 src/armnnTfLiteParser/test/Reshape.cpp
782 src/armnnTfLiteParser/test/ResizeBilinear.cpp
783 src/armnnTfLiteParser/test/ResizeNearestNeighbor.cpp
784 src/armnnTfLiteParser/test/Softmax.cpp
785 src/armnnTfLiteParser/test/SpaceToBatchND.cpp
786 src/armnnTfLiteParser/test/Slice.cpp
787 src/armnnTfLiteParser/test/Split.cpp
788 src/armnnTfLiteParser/test/Squeeze.cpp
789 src/armnnTfLiteParser/test/StridedSlice.cpp
790 src/armnnTfLiteParser/test/Sub.cpp
791 src/armnnTfLiteParser/test/TransposeConv.cpp
792 src/armnnTfLiteParser/test/Transpose.cpp
793 src/armnnTfLiteParser/test/Unpack.cpp
794 src/armnnTfLiteParser/test/Unsupported.cpp
795 src/armnnTfLiteParser/test/LoadModel.cpp
796 src/armnnTfLiteParser/test/GetBuffer.cpp
797 src/armnnTfLiteParser/test/OutputShapeOfSqueeze.cpp
798 src/armnnTfLiteParser/test/InputOutputTensorNames.cpp
799 src/armnnTfLiteParser/test/GetTensorIds.cpp
800 src/armnnTfLiteParser/test/GetSubgraphInputsOutputs.cpp
801 src/armnnTfLiteParser/test/GetInputsOutputs.cpp
804 # Generate SchemaText.cpp file which contains the TfLite schema text as a
805 # static C-array of bytes. This is needed at runtime for TfLite parser tests.
807 OUTPUT SchemaText.cpp
808 COMMAND cp ${TF_LITE_SCHEMA_INCLUDE_PATH}/schema.fbs g_TfLiteSchemaText
809 COMMAND xxd -i g_TfLiteSchemaText SchemaText.cpp
810 WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
811 DEPENDS ${TF_LITE_SCHEMA_INCLUDE_PATH}/schema.fbs
813 list(APPEND unittest_sources ${CMAKE_CURRENT_BINARY_DIR}/SchemaText.cpp)
816 if(BUILD_CAFFE_PARSER AND ARMNNREF)
817 list(APPEND unittest_sources
818 src/armnnCaffeParser/test/TestAdd.cpp
819 src/armnnCaffeParser/test/TestConcat.cpp
820 src/armnnCaffeParser/test/TestConvolution.cpp
821 src/armnnCaffeParser/test/TestDropout.cpp
822 src/armnnCaffeParser/test/TestInputs.cpp
823 src/armnnCaffeParser/test/TestMul.cpp
824 src/armnnCaffeParser/test/TestPooling2d.cpp
825 src/armnnCaffeParser/test/TestInPlace.cpp
826 src/armnnCaffeParser/test/TestMultiInputsOutputs.cpp
827 src/armnnCaffeParser/test/TestSplit.cpp
831 if(BUILD_ONNX_PARSER AND ARMNNREF)
832 list(APPEND unittest_sources
833 src/armnnOnnxParser/test/Addition.cpp
834 src/armnnOnnxParser/test/BatchNorm.cpp
835 src/armnnOnnxParser/test/Clip.cpp
836 src/armnnOnnxParser/test/Const.cpp
837 src/armnnOnnxParser/test/Constructor.cpp
838 src/armnnOnnxParser/test/Conv2D.cpp
839 src/armnnOnnxParser/test/CreateNetwork.cpp
840 src/armnnOnnxParser/test/DepthConv.cpp
841 src/armnnOnnxParser/test/Flatten.cpp
842 src/armnnOnnxParser/test/FullyConnected.cpp
843 src/armnnOnnxParser/test/GetInputsOutputs.cpp
844 src/armnnOnnxParser/test/Pooling.cpp
845 src/armnnOnnxParser/test/ProtoxtFixture.cpp
846 src/armnnOnnxParser/test/Relu.cpp
847 src/armnnOnnxParser/test/Reshape.cpp
851 if(BUILD_ARMNN_QUANTIZER AND ARMNNREF)
852 list(APPEND unittest_sources
853 src/armnnQuantizer/test/QuantizationDataSetTests.cpp
857 if(BUILD_ARMNN_SERIALIZER AND ARMNNREF)
859 list(APPEND unittest_sources
860 src/armnnSerializer/test/ActivationSerializationTests.cpp
861 src/armnnSerializer/test/SerializerTests.cpp
862 src/armnnDeserializer/test/DeserializeAbs.cpp
863 src/armnnDeserializer/test/DeserializeActivation.cpp
864 src/armnnDeserializer/test/DeserializeAdd.cpp
865 src/armnnDeserializer/test/DeserializeBatchToSpaceNd.cpp
866 src/armnnDeserializer/test/DeserializeBatchNormalization.cpp
867 src/armnnDeserializer/test/DeserializeComparison.cpp
868 src/armnnDeserializer/test/DeserializeConstant.cpp
869 src/armnnDeserializer/test/DeserializeConvolution2d.cpp
870 src/armnnDeserializer/test/DeserializeDepthToSpace.cpp
871 src/armnnDeserializer/test/DeserializeDivision.cpp
872 src/armnnDeserializer/test/DeserializeFloor.cpp
873 src/armnnDeserializer/test/DeserializeFullyConnected.cpp
874 src/armnnDeserializer/test/DeserializeGather.cpp
875 src/armnnDeserializer/test/DeserializeInstanceNormalization.cpp
876 src/armnnDeserializer/test/DeserializeL2Normalization.cpp
877 src/armnnDeserializer/test/DeserializeLogSoftmax.cpp
878 src/armnnDeserializer/test/DeserializeMean.cpp
879 src/armnnDeserializer/test/DeserializeMultiplication.cpp
880 src/armnnDeserializer/test/DeserializeNormalization.cpp
881 src/armnnDeserializer/test/DeserializePad.cpp
882 src/armnnDeserializer/test/DeserializePermute.cpp
883 src/armnnDeserializer/test/DeserializePooling2d.cpp
884 src/armnnDeserializer/test/DeserializeReshape.cpp
885 src/armnnDeserializer/test/DeserializeResizeBilinear.cpp
886 src/armnnDeserializer/test/DeserializeRsqrt.cpp
887 src/armnnDeserializer/test/DeserializeSlice.cpp
888 src/armnnDeserializer/test/DeserializeSpaceToBatchNd.cpp
889 src/armnnDeserializer/test/DeserializeStridedSlice.cpp
890 src/armnnDeserializer/test/DeserializeSubtraction.cpp
891 src/armnnDeserializer/test/ParserFlatbuffersSerializeFixture.hpp
892 src/armnnDeserializer/test/SchemaSerialize.s
894 set_source_files_properties(src/armnnDeserializer/test/SchemaSerialize.s PROPERTIES COMPILE_FLAGS "-x assembler-with-cpp")
897 if(BUILD_GATORD_MOCK)
898 list(APPEND unittest_sources
899 tests/profiling/gatordmock/tests/GatordMockTests.cpp
903 if(BUILD_TIMELINE_DECODER)
904 list(APPEND unittest_sources
905 src/timelineDecoder/tests/JSONTimelineDecoderTests.cpp
906 src/timelineDecoder/tests/TimelineTests.cpp
910 if(BUILD_BASE_PIPE_SERVER)
911 list(APPEND unittest_sources
912 profiling/server/src/basePipeServer/tests/BasePipeServerTests.cpp
916 foreach(lib ${armnnUnitTestLibraries})
917 message(STATUS "Adding object library dependency to UnitTests: ${lib}")
918 list(APPEND unittest_sources $<TARGET_OBJECTS:${lib}>)
921 add_executable(UnitTests ${unittest_sources})
922 target_include_directories(UnitTests PRIVATE src/armnn)
923 target_include_directories(UnitTests PRIVATE src/armnnUtils)
924 target_include_directories(UnitTests PRIVATE src/backends)
925 target_include_directories(UnitTests PRIVATE src/profiling)
928 if(HEAP_PROFILING OR LEAK_CHECKING)
929 message(STATUS "Valgrind is disabled for heap profiling and leak checking builds.")
931 # Valgrind works with gperftools version number <= 2.4
932 target_compile_definitions(UnitTests PRIVATE "WITH_VALGRIND=1")
936 target_link_libraries(UnitTests ${CMAKE_THREAD_LIBS_INIT})
937 target_link_libraries(UnitTests ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY} ${Boost_SYSTEM_LIBRARY} ${Boost_FILESYSTEM_LIBRARY})
939 target_link_libraries(UnitTests armnn)
940 target_link_libraries(UnitTests armnnUtils)
943 target_link_libraries(UnitTests armnnTfParser)
946 if(BUILD_GATORD_MOCK)
947 target_link_libraries(UnitTests gatordMockService)
950 if(BUILD_TIMELINE_DECODER)
951 target_link_libraries(UnitTests timelineDecoder)
954 if(BUILD_TF_LITE_PARSER)
955 target_include_directories(UnitTests SYSTEM PRIVATE "${TF_LITE_SCHEMA_INCLUDE_PATH}")
956 target_include_directories(UnitTests SYSTEM PRIVATE "${FLATBUFFERS_INCLUDE_PATH}")
957 target_link_libraries(UnitTests armnnTfLiteParser)
960 if(BUILD_CAFFE_PARSER)
961 target_link_libraries(UnitTests armnnCaffeParser)
964 if(BUILD_ARMNN_SERIALIZER AND ARMNNREF)
965 target_include_directories(UnitTests SYSTEM PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/src/armnnSerializer)
966 target_include_directories(UnitTests SYSTEM PRIVATE "${FLATBUFFERS_INCLUDE_PATH}")
967 target_link_libraries(UnitTests armnnSerializer)
970 if(BUILD_ARMNN_QUANTIZER AND ARMNNREF)
971 target_include_directories(UnitTests SYSTEM PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/src/armnnQuantizer)
972 target_include_directories(UnitTests SYSTEM PRIVATE "${FLATBUFFERS_INCLUDE_PATH}")
973 target_link_libraries(UnitTests armnnQuantizer armnnSerializer)
976 if(BUILD_ONNX_PARSER)
977 target_link_libraries(UnitTests armnnOnnxParser)
980 if(BUILD_BASE_PIPE_SERVER)
981 target_link_libraries(UnitTests armnnBasePipeServer)
984 addDllCopyCommands(UnitTests)
987 if (BUILD_ARMNN_SERIALIZER AND (BUILD_TF_PARSER OR BUILD_TF_LITE_PARSER OR BUILD_ONNX_PARSER OR BUILD_CAFFE_PARSER) AND ARMNNREF)
988 set(ArmnnConverter_sources
989 src/armnnConverter/ArmnnConverter.cpp)
991 add_executable_ex(ArmnnConverter ${ArmnnConverter_sources})
992 target_include_directories(ArmnnConverter PRIVATE src/armnn)
993 target_include_directories(ArmnnConverter PRIVATE src/armnnUtils)
995 if(BUILD_CAFFE_PARSER)
996 target_link_libraries(ArmnnConverter armnnCaffeParser)
999 if(BUILD_ONNX_PARSER)
1000 target_link_libraries(ArmnnConverter armnnOnnxParser)
1004 target_link_libraries(ArmnnConverter armnnTfParser)
1007 if(BUILD_TF_LITE_PARSER)
1008 target_link_libraries(ArmnnConverter armnnTfLiteParser)
1011 target_link_libraries(ArmnnConverter armnnSerializer)
1013 target_link_libraries(ArmnnConverter armnn)
1014 target_link_libraries(ArmnnConverter ${CMAKE_THREAD_LIBS_INIT})
1015 target_link_libraries(ArmnnConverter
1016 ${Boost_SYSTEM_LIBRARY}
1017 ${Boost_FILESYSTEM_LIBRARY}
1018 ${Boost_PROGRAM_OPTIONS_LIBRARY})
1019 addDllCopyCommands(ArmnnConverter)
1022 if(BUILD_BASE_PIPE_SERVER)
1023 add_subdirectory(profiling/server/src/basePipeServer)
1026 if(BUILD_TIMELINE_DECODER)
1027 add_subdirectory(src/timelineDecoder)
1030 if(BUILD_GATORD_MOCK AND NOT BUILD_BASE_PIPE_SERVER)
1031 message(ERROR, "In order to build GatordMock you must set BUILD_BASE_PIPE_SERVER = YES")
1034 if(BUILD_GATORD_MOCK AND NOT BUILD_TIMELINE_DECODER)
1035 message(ERROR, "In order to build GatordMock you must set BUILD_TIMELINE_DECODER = YES")
1038 if(BUILD_GATORD_MOCK)
1039 set(gatord_mock_sources)
1040 list(APPEND gatord_mock_sources
1041 tests/profiling/gatordmock/CommandFileParser.hpp
1042 tests/profiling/gatordmock/CommandFileParser.cpp
1043 tests/profiling/gatordmock/CommandLineProcessor.hpp
1044 tests/profiling/gatordmock/CommandLineProcessor.cpp
1045 tests/profiling/gatordmock/GatordMockService.hpp
1046 tests/profiling/gatordmock/GatordMockService.cpp
1047 tests/profiling/gatordmock/PeriodicCounterCaptureCommandHandler.cpp
1048 tests/profiling/gatordmock/PeriodicCounterCaptureCommandHandler.hpp
1049 tests/profiling/gatordmock/PeriodicCounterSelectionResponseHandler.cpp
1050 tests/profiling/gatordmock/PeriodicCounterSelectionResponseHandler.hpp
1051 tests/profiling/gatordmock/StreamMetadataCommandHandler.cpp
1052 tests/profiling/gatordmock/StreamMetadataCommandHandler.hpp
1053 tests/profiling/gatordmock/StubCommandHandler.hpp
1056 add_library_ex(gatordMockService STATIC ${gatord_mock_sources})
1058 target_include_directories(gatordMockService PRIVATE profiling/common/include
1059 profiling/server/src/basePipeServer
1062 src/timelineDecoder)
1064 if(BUILD_UNIT_TESTS)
1065 target_include_directories(UnitTests PRIVATE tests/profiling/gatordmock)
1066 target_include_directories(UnitTests PRIVATE src/backends/backendsCommon/test)
1069 add_executable_ex(GatordMock tests/profiling/gatordmock/GatordMockMain.cpp)
1071 target_include_directories(GatordMock PRIVATE profiling/common/include
1072 profiling/server/src/basePipeServer
1074 src/timelineDecoder)
1076 target_link_libraries(GatordMock
1081 ${Boost_PROGRAM_OPTIONS_LIBRARY}
1082 ${Boost_SYSTEM_LIBRARY})
1084 if(Threads_FOUND AND (NOT ("${CMAKE_SYSTEM_NAME}" STREQUAL Android)))
1085 target_link_libraries(GatordMock ${CMAKE_THREAD_LIBS_INIT})
1090 if (BUILD_PYTHON_WHL OR BUILD_PYTHON_SRC)
1091 add_subdirectory(python/pyarmnn)