blob: 17d1bdea63ea1861b17d7c33df53fc0dedb67bd2 [file] [log] [blame]
Anthony Barbier3762e742018-03-02 11:49:33 +00001namespace arm_compute
2{
Anthony Barbier6ff3b192017-09-04 18:44:23 +01003/** @mainpage Introduction
4
5@tableofcontents
6
7The Computer Vision and Machine Learning library is a set of functions optimised for both ARM CPUs and GPUs using SIMD technologies.
8
9Several builds of the library are available using various configurations:
10 - OS: Linux, Android or bare metal.
11 - Architecture: armv7a (32bit) or arm64-v8a (64bit)
Anthony Barbier20dbb822017-12-13 21:19:39 +000012 - Technology: NEON / OpenCL / GLES_COMPUTE / NEON and OpenCL and GLES_COMPUTE
Anthony Barbier6ff3b192017-09-04 18:44:23 +010013 - Debug / Asserts / Release: Use a build with asserts enabled to debug your application and enable extra validation. Once you are sure your application works as expected you can switch to a release build of the library for maximum performance.
14
15@section S0_1_contact Contact / Support
16
17Please email developer@arm.com
18
19In order to facilitate the work of the support team please provide the build information of the library you are using. To get the version of the library you are using simply run:
20
21 $ strings android-armv7a-cl-asserts/libarm_compute.so | grep arm_compute_version
22 arm_compute_version=v16.12 Build options: {'embed_kernels': '1', 'opencl': '1', 'arch': 'armv7a', 'neon': '0', 'asserts': '1', 'debug': '0', 'os': 'android', 'Werror': '1'} Git hash=f51a545d4ea12a9059fe4e598a092f1fd06dc858
23
Anthony Barbier14c86a92017-12-14 16:27:41 +000024@section S0_2_prebuilt_binaries Pre-built binaries
25
26For each release we provide some pre-built binaries of the library [here](https://github.com/ARM-software/ComputeLibrary/releases)
27
28These binaries have been built using the following toolchains:
29 - Linux armv7a: gcc-linaro-arm-linux-gnueabihf-4.9-2014.07_linux
30 - Linux arm64-v8a: gcc-linaro-4.9-2016.02-x86_64_aarch64-linux-gnu
Anthony Barbiera8a28f62018-02-26 19:16:32 +000031 - Android armv7a: clang++ / gnustl NDK r16b
32 - Android am64-v8a: clang++ / gnustl NDK r16b
Anthony Barbier14c86a92017-12-14 16:27:41 +000033
34@warning Make sure to use a compatible toolchain to build your application or you will get some std::bad_alloc errors at runtime.
35
Anthony Barbier6ff3b192017-09-04 18:44:23 +010036@section S1_file_organisation File organisation
37
38This archive contains:
39 - The arm_compute header and source files
40 - The latest Khronos OpenCL 1.2 C headers from the <a href="https://www.khronos.org/registry/cl/">Khronos OpenCL registry</a>
41 - The latest Khronos cl2.hpp from the <a href="https://www.khronos.org/registry/cl/">Khronos OpenCL registry</a> (API version 2.1 when this document was written)
Anthony Barbier20dbb822017-12-13 21:19:39 +000042 - The latest Khronos OpenGL ES 3.1 C headers from the <a href="https://www.khronos.org/registry/gles/">Khronos OpenGL ES registry</a>
43 - The latest Khronos EGL 1.5 C headers from the <a href="https://www.khronos.org/registry/gles/">Khronos EGL registry</a>
44 - The sources for a stub version of libOpenCL.so, libGLESv1_CM.so, libGLESv2.so and libEGL.so to help you build your application.
Anthony Barbier6ff3b192017-09-04 18:44:23 +010045 - An examples folder containing a few examples to compile and link against the library.
46 - A @ref utils folder containing headers with some boiler plate code used by the examples.
47 - This documentation.
48
49You should have the following file organisation:
50
51 .
52 ├── arm_compute --> All the arm_compute headers
53 │   ├── core
54 │   │   ├── CL
Anthony Barbier6a5627a2017-09-26 14:42:02 +010055 │   │   │   ├── CLKernelLibrary.h --> Manages all the OpenCL kernels compilation and caching, provides accessors for the OpenCL Context.
Anthony Barbier6ff3b192017-09-04 18:44:23 +010056 │   │   │   ├── CLKernels.h --> Includes all the OpenCL kernels at once
57 │   │   │   ├── CL specialisation of all the generic objects interfaces (ICLTensor, ICLImage, etc.)
58 │   │   │   ├── kernels --> Folder containing all the OpenCL kernels
59 │   │   │   │   └── CL*Kernel.h
60 │   │   │   └── OpenCL.h --> Wrapper to configure the Khronos OpenCL C++ header
61 │   │ ├── CPP
Anthony Barbier6a5627a2017-09-26 14:42:02 +010062 │   │   │   ├── CPPKernels.h --> Includes all the CPP kernels at once
Anthony Barbier6ff3b192017-09-04 18:44:23 +010063 │   │ │   └── kernels --> Folder containing all the CPP kernels
Anthony Barbier6a5627a2017-09-26 14:42:02 +010064 │   │   │      └── CPP*Kernel.h
Anthony Barbier20dbb822017-12-13 21:19:39 +000065 │   │   ├── GLES_COMPUTE
66 │   │   │   ├── GCKernelLibrary.h --> Manages all the GLES kernels compilation and caching, provides accessors for the GLES Context.
67 │   │   │   ├── GCKernels.h --> Includes all the GLES kernels at once
68 │   │   │   ├── GLES specialisation of all the generic objects interfaces (IGCTensor, IGCImage, etc.)
69 │   │   │   ├── kernels --> Folder containing all the GLES kernels
70 │   │   │   │   └── GC*Kernel.h
71 │   │   │   └── OpenGLES.h --> Wrapper to configure the Khronos EGL and OpenGL ES C header
Anthony Barbier6ff3b192017-09-04 18:44:23 +010072 │   │   ├── NEON
73 │   │   │   ├── kernels --> Folder containing all the NEON kernels
Anthony Barbier6a5627a2017-09-26 14:42:02 +010074 │   │   │   │ ├── arm64 --> Folder containing the interfaces for the assembly arm64 NEON kernels
75 │   │   │   │ ├── arm32 --> Folder containing the interfaces for the assembly arm32 NEON kernels
76 │   │   │   │ ├── assembly --> Folder containing the NEON assembly routines.
Anthony Barbier6ff3b192017-09-04 18:44:23 +010077 │   │   │   │   └── NE*Kernel.h
78 │   │   │   └── NEKernels.h --> Includes all the NEON kernels at once
79 │   │   ├── All common basic types (Types.h, Window, Coordinates, Iterator, etc.)
80 │   │   ├── All generic objects interfaces (ITensor, IImage, etc.)
81 │   │   └── Objects metadata classes (ImageInfo, TensorInfo, MultiImageInfo)
Anthony Barbier6a5627a2017-09-26 14:42:02 +010082 │   ├── graph
83 │   │   ├── CL --> OpenCL specific operations
84 │   │   │   └── CLMap.h / CLUnmap.h
85 │   │   ├── nodes
86 │   │   │   └── The various nodes supported by the graph API
87 │   │   ├── Nodes.h --> Includes all the Graph nodes at once.
88 │   │   └── Graph objects ( INode, ITensorAccessor, Graph, etc.)
Anthony Barbier6ff3b192017-09-04 18:44:23 +010089 │   └── runtime
90 │   ├── CL
91 │   │   ├── CL objects & allocators (CLArray, CLImage, CLTensor, etc.)
92 │   │   ├── functions --> Folder containing all the OpenCL functions
93 │   │   │   └── CL*.h
Anthony Barbier6a5627a2017-09-26 14:42:02 +010094 │   │   ├── CLScheduler.h --> Interface to enqueue OpenCL kernels and get/set the OpenCL CommandQueue and ICLTuner.
Anthony Barbier6ff3b192017-09-04 18:44:23 +010095 │   │   └── CLFunctions.h --> Includes all the OpenCL functions at once
96 │   ├── CPP
Anthony Barbier6a5627a2017-09-26 14:42:02 +010097 │      │   ├── CPPKernels.h --> Includes all the CPP functions at once.
98 │   │   └── CPPScheduler.h --> Basic pool of threads to execute CPP/NEON code on several cores in parallel
Anthony Barbier20dbb822017-12-13 21:19:39 +000099 │   ├── GLES_COMPUTE
100 │   │   ├── GLES objects & allocators (GCArray, GCImage, GCTensor, etc.)
101 │   │   ├── functions --> Folder containing all the GLES functions
102 │   │   │   └── GC*.h
103 │   │   ├── GCScheduler.h --> Interface to enqueue GLES kernels and get/set the GLES CommandQueue.
104 │   │   └── GCFunctions.h --> Includes all the GLES functions at once
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100105 │   ├── NEON
106 │   │ ├── functions --> Folder containing all the NEON functions
107 │   │ │   └── NE*.h
108 │   │ └── NEFunctions.h --> Includes all the NEON functions at once
Anthony Barbier6a5627a2017-09-26 14:42:02 +0100109 │   ├── OMP
110 │   │   └── OMPScheduler.h --> OpenMP scheduler (Alternative to the CPPScheduler)
111 │ ├── Memory manager files (LifetimeManager, PoolManager, etc.)
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100112 │   └── Basic implementations of the generic object interfaces (Array, Image, Tensor, etc.)
Anthony Barbiera8a28f62018-02-26 19:16:32 +0000113 ├── data -> Contains test images and reference data dumps used by validation tests
114 ├── docs -> Contains Doxyfile and Doxygen sources used to generate the HTML pages in the documentation folder.
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100115 ├── documentation
116 │   ├── index.xhtml
117 │   └── ...
118 ├── documentation.xhtml -> documentation/index.xhtml
119 ├── examples
Anthony Barbier20dbb822017-12-13 21:19:39 +0000120 │   ├── cl_*.cpp --> OpenCL examples
Anthony Barbier14c86a92017-12-14 16:27:41 +0000121 │   ├── gc_*.cpp --> GLES compute shaders examples
Anthony Barbier20dbb822017-12-13 21:19:39 +0000122 │   ├── graph_*.cpp --> Graph examples
123 │   ├── neoncl_*.cpp --> NEON / OpenCL interoperability examples
124 │   └── neon_*.cpp --> NEON examples
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100125 ├── include
Anthony Barbier6a5627a2017-09-26 14:42:02 +0100126 │   ├── CL
127 │   │ └── Khronos OpenCL C headers and C++ wrapper
128 │   ├── half --> FP16 library available from http://half.sourceforge.net
Anthony Barbier14c86a92017-12-14 16:27:41 +0000129 │   ├── libnpy --> Library to load / write npy buffers, available from https://github.com/llohse/libnpy
130 │  └── linux --> Headers only needed for Linux builds
131 │   └── Khronos EGL and OpenGLES headers
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100132 ├── opencl-1.2-stubs
Anthony Barbier14c86a92017-12-14 16:27:41 +0000133 │ └── opencl_stubs.c --> OpenCL stubs implementation
134 ├── opengles-3.1-stubs
135 │   ├── EGL.c --> EGL stubs implementation
136 │   └── GLESv2.c --> GLESv2 stubs implementation
Anthony Barbier6a5627a2017-09-26 14:42:02 +0100137 ├── scripts
138 │   ├── caffe_data_extractor.py --> Basic script to export weights from Caffe to npy files
139 │   └── tensorflow_data_extractor.py --> Basic script to export weights from Tensor Flow to npy files
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100140 ├── src
141 │   ├── core
142 │ │ └── ... (Same structure as headers)
Anthony Barbier20dbb822017-12-13 21:19:39 +0000143 │   │ ├── CL
144 │   │ │ └── cl_kernels --> All the OpenCL kernels
145 │   │ └── GLES_COMPUTE
146 │   │ └── cs_shaders --> All the OpenGL ES Compute Shaders
Anthony Barbier6a5627a2017-09-26 14:42:02 +0100147 │   ├── graph
148 │ │ └── ... (Same structure as headers)
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100149 │ └── runtime
150 │ └── ... (Same structure as headers)
Anthony Barbier6a5627a2017-09-26 14:42:02 +0100151 ├── support
152 │ └── Various headers to work around toolchains / platform issues.
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100153 ├── tests
154 │   ├── All test related files shared between validation and benchmark
Anthony Barbier6a5627a2017-09-26 14:42:02 +0100155 │   ├── CL --> OpenCL accessors
Anthony Barbier20dbb822017-12-13 21:19:39 +0000156 │   ├── GLES_COMPUTE --> GLES accessors
Anthony Barbier6a5627a2017-09-26 14:42:02 +0100157 │   ├── NEON --> NEON accessors
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100158 │   ├── benchmark --> Sources for benchmarking
159 │ │ ├── Benchmark specific files
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100160 │ │ ├── CL --> OpenCL benchmarking tests
Anthony Barbier20dbb822017-12-13 21:19:39 +0000161 │ │ ├── GLES_COMPUTE --> GLES benchmarking tests
Anthony Barbiera8a28f62018-02-26 19:16:32 +0000162 │   │ ├── fixtures
163 │ │ │ └── Fixtures to initialise and run the runtime Functions.
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100164 │ │ └── NEON --> NEON benchmarking tests
Anthony Barbier6a5627a2017-09-26 14:42:02 +0100165 │   ├── datasets
166 │ │ └── Datasets for all the validation / benchmark tests, layer configurations for various networks, etc.
167 │   ├── framework
168 │ │ └── Boiler plate code for both validation and benchmark test suites (Command line parsers, instruments, output loggers, etc.)
169 │   ├── networks
170 │ │ └── Examples of how to instantiate networks.
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100171 │   ├── validation --> Sources for validation
172 │ │ ├── Validation specific files
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100173 │ │ ├── CL --> OpenCL validation tests
Anthony Barbier20dbb822017-12-13 21:19:39 +0000174 │ │ ├── GLES_COMPUTE --> GLES validation tests
Anthony Barbier6a5627a2017-09-26 14:42:02 +0100175 │ │ ├── CPP --> C++ reference implementations
176 │   │ ├── fixtures
177 │ │ │ └── Fixtures to initialise and run the runtime Functions.
178 │ │ └── NEON --> NEON validation tests
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100179 │   └── dataset --> Datasets defining common sets of input parameters
180 └── utils --> Boiler plate code used by examples
Anthony Barbier20dbb822017-12-13 21:19:39 +0000181 └── Various utilities to print types, load / store assets, etc.
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100182
183@section S2_versions_changelog Release versions and changelog
184
185@subsection S2_1_versions Release versions
186
187All releases are numbered vYY.MM Where YY are the last two digits of the year, and MM the month number.
188If there is more than one release in a month then an extra sequential number is appended at the end:
189
190 v17.03 (First release of March 2017)
191 v17.03.1 (Second release of March 2017)
192 v17.04 (First release of April 2017)
193
194@note We're aiming at releasing one major public release with new features per quarter. All releases in between will only contain bug fixes.
195
196@subsection S2_2_changelog Changelog
197
Pablo Telloeb82fd22018-02-23 13:43:50 +0000198v18.05 Public maintenance release
199 - Major redesign in the interface for the neon kernels implemented in assembly.
200 - Removed arm_compute::NEGEMMLowpAArch64A53Kernel / arm_compute::NEGEMMLowpAArch64Kernel / arm_compute::NEGEMMLowpAArch64V8P4Kernel / arm_compute::NEGEMMInterleavedBlockedKernel / arm_compute::NEGEMMLowpAssemblyMatrixMultiplyCore / arm_compute::NEHGEMMAArch64FP16Kernel
201 - Added NEGEMMAssemblyWrapper and AssemblyKernelGlue which are used to execute assembly kernels in neon functions.
202 - Minor changes to the CPUInfo type to make it compatible with the new assembly gemm interface.
203
Anthony Barbier577fbdf2018-03-01 15:17:54 +0000204v18.03 Public maintenance release
205 - Various bug fixes.
Anthony Barbier3762e742018-03-02 11:49:33 +0000206 - Fixed bug in @ref NEActivationLayer
207 - Fix in @ref CLTuner when using batches.
Anthony Barbier577fbdf2018-03-01 15:17:54 +0000208 - Updated recommended NDK version to r16b (And fixed warnings).
209 - Fixed bug in validation code.
210 - Added Inception v4 graph example.
211
Anthony Barbier2d0ce772018-02-21 15:35:36 +0000212v18.02 Public major release
213 - Various NEON / OpenCL / GLES optimisations.
214 - Various bug fixes.
215 - Changed default number of threads on big LITTLE systems.
216 - Refactored examples and added:
217 - graph_mobilenet_qassym8
218 - graph_resnet
219 - graph_squeezenet_v1_1
Anthony Barbier3762e742018-03-02 11:49:33 +0000220 - Renamed @ref CLConvolutionLayer into @ref CLGEMMConvolutionLayer and created a new @ref CLConvolutionLayer to select the fastest convolution method.
221 - Renamed @ref NEConvolutionLayer into @ref NEGEMMConvolutionLayer and created a new @ref NEConvolutionLayer to select the fastest convolution method.
Anthony Barbier2d0ce772018-02-21 15:35:36 +0000222 - Added in place support to:
Anthony Barbier3762e742018-03-02 11:49:33 +0000223 - @ref CLActivationLayer
224 - @ref CLBatchNormalizationLayer
Anthony Barbier2d0ce772018-02-21 15:35:36 +0000225 - Added QASYMM8 support to:
Anthony Barbier3762e742018-03-02 11:49:33 +0000226 - @ref CLActivationLayer
227 - @ref CLDepthwiseConvolutionLayer
228 - @ref NEDepthwiseConvolutionLayer
229 - @ref NESoftmaxLayer
Anthony Barbier2d0ce772018-02-21 15:35:36 +0000230 - Added FP16 support to:
Anthony Barbier3762e742018-03-02 11:49:33 +0000231 - @ref CLDepthwiseConvolutionLayer3x3
232 - @ref CLDepthwiseConvolutionLayer
233 - Added broadcasting support to @ref NEArithmeticAddition / @ref CLArithmeticAddition / @ref CLPixelWiseMultiplication
234 - Added fused batched normalization and activation to @ref CLBatchNormalizationLayer and @ref NEBatchNormalizationLayer
235 - Added support for non-square pooling to @ref NEPoolingLayer and @ref CLPoolingLayer
Anthony Barbier2d0ce772018-02-21 15:35:36 +0000236 - New OpenCL kernels / functions:
Anthony Barbier3762e742018-03-02 11:49:33 +0000237 - @ref CLDirectConvolutionLayerOutputStageKernel
Pablo Tellof6c572c2018-02-14 12:47:30 +0000238 - New NEON kernels / functions
Anthony Barbier2d0ce772018-02-21 15:35:36 +0000239 - Added name() method to all kernels.
240 - Added support for Winograd 5x5.
Anthony Barbier3762e742018-03-02 11:49:33 +0000241 - @ref NEPermuteKernel / @ref NEPermute
242 - @ref NEWinogradLayerTransformInputKernel / @ref NEWinogradLayer
243 - @ref NEWinogradLayerTransformOutputKernel / @ref NEWinogradLayer
244 - @ref NEWinogradLayerTransformWeightsKernel / @ref NEWinogradLayer
245 - Renamed NEWinogradLayerKernel into @ref NEWinogradLayerBatchedGEMMKernel
Anthony Barbier2d0ce772018-02-21 15:35:36 +0000246 - New GLES kernels / functions:
Anthony Barbier3762e742018-03-02 11:49:33 +0000247 - @ref GCTensorShiftKernel / @ref GCTensorShift
Pablo Tellof6c572c2018-02-14 12:47:30 +0000248
Anthony Barbier64c95a02018-01-22 18:48:55 +0000249v18.01 Public maintenance release
250 - Various bug fixes
251 - Added some of the missing validate() methods
Anthony Barbier3762e742018-03-02 11:49:33 +0000252 - Added @ref CLDeconvolutionLayerUpsampleKernel / @ref CLDeconvolutionLayer @ref CLDeconvolutionLayerUpsample
253 - Added @ref CLPermuteKernel / @ref CLPermute
Anthony Barbier64c95a02018-01-22 18:48:55 +0000254 - Added method to clean the programs cache in the CL Kernel library.
Anthony Barbier3762e742018-03-02 11:49:33 +0000255 - Added @ref GCArithmeticAdditionKernel / @ref GCArithmeticAddition
256 - Added @ref GCDepthwiseConvolutionLayer3x3Kernel / @ref GCDepthwiseConvolutionLayer3x3
257 - Added @ref GCNormalizePlanarYUVLayerKernel / @ref GCNormalizePlanarYUVLayer
258 - Added @ref GCScaleKernel / @ref GCScale
259 - Added @ref GCWeightsReshapeKernel / @ref GCConvolutionLayer
Anthony Barbier64c95a02018-01-22 18:48:55 +0000260 - Added FP16 support to the following GLES compute kernels:
Anthony Barbier3762e742018-03-02 11:49:33 +0000261 - @ref GCCol2ImKernel
262 - @ref GCGEMMInterleave4x4Kernel
263 - @ref GCGEMMTranspose1xWKernel
264 - @ref GCIm2ColKernel
265 - Refactored NEON Winograd (NEWinogradLayerKernel)
266 - Added @ref NEDirectConvolutionLayerOutputStageKernel
Anthony Barbier64c95a02018-01-22 18:48:55 +0000267 - Added QASYMM8 support to the following NEON kernels:
Anthony Barbier3762e742018-03-02 11:49:33 +0000268 - @ref NEDepthwiseConvolutionLayer3x3Kernel
269 - @ref NEFillBorderKernel
270 - @ref NEPoolingLayerKernel
Anthony Barbier64c95a02018-01-22 18:48:55 +0000271 - Added new examples:
272 - graph_cl_mobilenet_qasymm8.cpp
273 - graph_inception_v3.cpp
274 - gc_dc.cpp
275 - More tests added to both validation and benchmarking suites.
276
Gian Marcoff850932017-12-11 12:37:17 +0000277v17.12 Public major release
278 - Most machine learning functions on OpenCL support the new data type QASYMM8
279 - Introduced logging interface
280 - Introduced opencl timer
281 - Reworked GEMMLowp interface
282 - Added new NEON assembly kernels for GEMMLowp, SGEMM and HGEMM
283 - Added validation method for most Machine Learning kernels / functions
284 - Added new graph examples such as googlenet, mobilenet, squeezenet, vgg16 and vgg19
285 - Added sgemm example for OpenCL
286 - Added absolute difference example for GLES compute
287 - Added new tests and benchmarks in validation and benchmark frameworks
288 - Added new kernels / functions for GLES compute
289
290 - New OpenGL ES kernels / functions
Anthony Barbier3762e742018-03-02 11:49:33 +0000291 - @ref GCAbsoluteDifferenceKernel / @ref GCAbsoluteDifference
292 - @ref GCActivationLayerKernel / @ref GCActivationLayer
293 - @ref GCBatchNormalizationLayerKernel / @ref GCBatchNormalizationLayer
294 - @ref GCCol2ImKernel
295 - @ref GCDepthConcatenateLayerKernel / @ref GCDepthConcatenateLayer
296 - @ref GCDirectConvolutionLayerKernel / @ref GCDirectConvolutionLayer
297 - @ref GCDropoutLayerKernel / @ref GCDropoutLayer
298 - @ref GCFillBorderKernel / @ref GCFillBorder
299 - @ref GCGEMMInterleave4x4Kernel / @ref GCGEMMInterleave4x4
300 - @ref GCGEMMMatrixAccumulateBiasesKernel / @ref GCGEMMMatrixAdditionKernel / @ref GCGEMMMatrixMultiplyKernel / @ref GCGEMM
301 - @ref GCGEMMTranspose1xWKernel / @ref GCGEMMTranspose1xW
302 - @ref GCIm2ColKernel
303 - @ref GCNormalizationLayerKernel / @ref GCNormalizationLayer
304 - @ref GCPixelWiseMultiplicationKernel / @ref GCPixelWiseMultiplication
305 - @ref GCPoolingLayerKernel / @ref GCPoolingLayer
306 - @ref GCLogits1DMaxKernel / @ref GCLogits1DShiftExpSumKernel / @ref GCLogits1DNormKernel / @ref GCSoftmaxLayer
307 - @ref GCTransposeKernel / @ref GCTranspose
Gian Marcoff850932017-12-11 12:37:17 +0000308
309 - New NEON kernels / functions
Pablo Telloeb82fd22018-02-23 13:43:50 +0000310 - arm_compute::NEGEMMLowpAArch64A53Kernel / arm_compute::NEGEMMLowpAArch64Kernel / arm_compute::NEGEMMLowpAArch64V8P4Kernel / arm_compute::NEGEMMInterleavedBlockedKernel / arm_compute::NEGEMMLowpAssemblyMatrixMultiplyCore
311 - arm_compute::NEHGEMMAArch64FP16Kernel
Anthony Barbier3762e742018-03-02 11:49:33 +0000312 - @ref NEDepthwiseConvolutionLayer3x3Kernel / @ref NEDepthwiseIm2ColKernel / @ref NEGEMMMatrixVectorMultiplyKernel / @ref NEDepthwiseVectorToTensorKernel / @ref NEDepthwiseConvolutionLayer
313 - @ref NEGEMMLowpOffsetContributionKernel / @ref NEGEMMLowpMatrixAReductionKernel / @ref NEGEMMLowpMatrixBReductionKernel / @ref NEGEMMLowpMatrixMultiplyCore
314 - @ref NEGEMMLowpQuantizeDownInt32ToUint8ScaleByFixedPointKernel / @ref NEGEMMLowpQuantizeDownInt32ToUint8ScaleByFixedPoint
315 - @ref NEGEMMLowpQuantizeDownInt32ToUint8ScaleKernel / @ref NEGEMMLowpQuantizeDownInt32ToUint8Scale
316 - @ref NEWinogradLayer / NEWinogradLayerKernel
Gian Marcoff850932017-12-11 12:37:17 +0000317
318 - New OpenCL kernels / functions
Anthony Barbier3762e742018-03-02 11:49:33 +0000319 - @ref CLGEMMLowpOffsetContributionKernel / @ref CLGEMMLowpMatrixAReductionKernel / @ref CLGEMMLowpMatrixBReductionKernel / @ref CLGEMMLowpMatrixMultiplyCore
320 - @ref CLGEMMLowpQuantizeDownInt32ToUint8ScaleByFixedPointKernel / @ref CLGEMMLowpQuantizeDownInt32ToUint8ScaleByFixedPoint
321 - @ref CLGEMMLowpQuantizeDownInt32ToUint8ScaleKernel / @ref CLGEMMLowpQuantizeDownInt32ToUint8Scale
Gian Marcoff850932017-12-11 12:37:17 +0000322
323 - New graph nodes for NEON and OpenCL
Georgios Pinitasd9eb2752018-04-03 13:44:29 +0100324 - graph::BranchLayer
325 - graph::DepthConvertLayer
326 - graph::DepthwiseConvolutionLayer
327 - graph::DequantizationLayer
328 - graph::FlattenLayer
329 - graph::QuantizationLayer
330 - graph::ReshapeLayer
Gian Marcoff850932017-12-11 12:37:17 +0000331
Anthony Barbier3c5b4ff2017-10-12 13:20:52 +0100332v17.10 Public maintenance release
333 - Bug fixes:
334 - Check the maximum local workgroup size supported by OpenCL devices
335 - Minor documentation updates (Fixed instructions to build the examples)
Anthony Barbier3762e742018-03-02 11:49:33 +0000336 - Introduced a graph::GraphContext
Anthony Barbier3c5b4ff2017-10-12 13:20:52 +0100337 - Added a few new Graph nodes, support for branches and grouping.
338 - Automatically enable cl_printf in debug builds
339 - Fixed bare metal builds for armv7a
340 - Added AlexNet and cartoon effect examples
341 - Fixed library builds: libraries are no longer built as supersets of each other.(It means application using the Runtime part of the library now need to link against both libarm_compute_core and libarm_compute)
342
Anthony Barbier6a5627a2017-09-26 14:42:02 +0100343v17.09 Public major release
344 - Experimental Graph support: initial implementation of a simple stream API to easily chain machine learning layers.
Anthony Barbier3762e742018-03-02 11:49:33 +0000345 - Memory Manager (@ref BlobLifetimeManager, @ref BlobMemoryPool, @ref ILifetimeManager, @ref IMemoryGroup, @ref IMemoryManager, @ref IMemoryPool, @ref IPoolManager, @ref MemoryManagerOnDemand, @ref PoolManager)
Anthony Barbier6a5627a2017-09-26 14:42:02 +0100346 - New validation and benchmark frameworks (Boost and Google frameworks replaced by homemade framework).
347 - Most machine learning functions support both fixed point 8 and 16 bit (QS8, QS16) for both NEON and OpenCL.
348 - New NEON kernels / functions:
Pablo Telloeb82fd22018-02-23 13:43:50 +0000349 - arm_compute::NEGEMMAssemblyBaseKernel arm_compute::NEGEMMAArch64Kernel
Anthony Barbier3762e742018-03-02 11:49:33 +0000350 - @ref NEDequantizationLayerKernel / @ref NEDequantizationLayer
351 - @ref NEFloorKernel / @ref NEFloor
352 - @ref NEL2NormalizeLayerKernel / @ref NEL2NormalizeLayer
353 - @ref NEQuantizationLayerKernel @ref NEMinMaxLayerKernel / @ref NEQuantizationLayer
354 - @ref NEROIPoolingLayerKernel / @ref NEROIPoolingLayer
355 - @ref NEReductionOperationKernel / @ref NEReductionOperation
356 - @ref NEReshapeLayerKernel / @ref NEReshapeLayer
Anthony Barbier6a5627a2017-09-26 14:42:02 +0100357
358 - New OpenCL kernels / functions:
Anthony Barbier3762e742018-03-02 11:49:33 +0000359 - @ref CLDepthwiseConvolutionLayer3x3Kernel @ref CLDepthwiseIm2ColKernel @ref CLDepthwiseVectorToTensorKernel @ref CLDepthwiseWeightsReshapeKernel / @ref CLDepthwiseConvolutionLayer3x3 @ref CLDepthwiseConvolutionLayer @ref CLDepthwiseSeparableConvolutionLayer
360 - @ref CLDequantizationLayerKernel / @ref CLDequantizationLayer
361 - @ref CLDirectConvolutionLayerKernel / @ref CLDirectConvolutionLayer
362 - @ref CLFlattenLayer
363 - @ref CLFloorKernel / @ref CLFloor
364 - @ref CLGEMMTranspose1xW
365 - @ref CLGEMMMatrixVectorMultiplyKernel
366 - @ref CLL2NormalizeLayerKernel / @ref CLL2NormalizeLayer
367 - @ref CLQuantizationLayerKernel @ref CLMinMaxLayerKernel / @ref CLQuantizationLayer
368 - @ref CLROIPoolingLayerKernel / @ref CLROIPoolingLayer
369 - @ref CLReductionOperationKernel / @ref CLReductionOperation
370 - @ref CLReshapeLayerKernel / @ref CLReshapeLayer
Anthony Barbier6a5627a2017-09-26 14:42:02 +0100371
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100372v17.06 Public major release
373 - Various bug fixes
374 - Added support for fixed point 8 bit (QS8) to the various NEON machine learning kernels.
375 - Added unit tests and benchmarks (AlexNet, LeNet)
376 - Added support for sub tensors.
377 - Added infrastructure to provide GPU specific optimisation for some OpenCL kernels.
Anthony Barbier3762e742018-03-02 11:49:33 +0000378 - Added @ref OMPScheduler (OpenMP) scheduler for NEON
379 - Added @ref SingleThreadScheduler scheduler for NEON (For bare metal)
380 - User can specify his own scheduler by implementing the @ref IScheduler interface.
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100381 - New OpenCL kernels / functions:
Anthony Barbier3762e742018-03-02 11:49:33 +0000382 - @ref CLBatchNormalizationLayerKernel / @ref CLBatchNormalizationLayer
383 - @ref CLDepthConcatenateLayerKernel / @ref CLDepthConcatenateLayer
384 - @ref CLHOGOrientationBinningKernel @ref CLHOGBlockNormalizationKernel, @ref CLHOGDetectorKernel / @ref CLHOGDescriptor @ref CLHOGDetector @ref CLHOGGradient @ref CLHOGMultiDetection
385 - @ref CLLocallyConnectedMatrixMultiplyKernel / @ref CLLocallyConnectedLayer
386 - @ref CLWeightsReshapeKernel / @ref CLConvolutionLayerReshapeWeights
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100387 - New C++ kernels:
Anthony Barbier3762e742018-03-02 11:49:33 +0000388 - @ref CPPDetectionWindowNonMaximaSuppressionKernel
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100389 - New NEON kernels / functions:
Anthony Barbier3762e742018-03-02 11:49:33 +0000390 - @ref NEBatchNormalizationLayerKernel / @ref NEBatchNormalizationLayer
391 - @ref NEDepthConcatenateLayerKernel / @ref NEDepthConcatenateLayer
392 - @ref NEDirectConvolutionLayerKernel / @ref NEDirectConvolutionLayer
393 - @ref NELocallyConnectedMatrixMultiplyKernel / @ref NELocallyConnectedLayer
394 - @ref NEWeightsReshapeKernel / @ref NEConvolutionLayerReshapeWeights
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100395
396v17.05 Public bug fixes release
397 - Various bug fixes
398 - Remaining of the functions ported to use accurate padding.
399 - Library does not link against OpenCL anymore (It uses dlopen / dlsym at runtime instead to determine whether or not OpenCL is available).
400 - Added "free" method to allocator.
401 - Minimum version of g++ required for armv7 Linux changed from 4.8 to 4.9
402
403v17.04 Public bug fixes release
404
405 The following functions have been ported to use the new accurate padding:
Anthony Barbier3762e742018-03-02 11:49:33 +0000406 - @ref CLColorConvertKernel
407 - @ref CLEdgeNonMaxSuppressionKernel
408 - @ref CLEdgeTraceKernel
409 - @ref CLGaussianPyramidHorKernel
410 - @ref CLGaussianPyramidVertKernel
411 - @ref CLGradientKernel
412 - @ref NEChannelCombineKernel
413 - @ref NEFillArrayKernel
414 - @ref NEGaussianPyramidHorKernel
415 - @ref NEGaussianPyramidVertKernel
416 - @ref NEHarrisScoreFP16Kernel
417 - @ref NEHarrisScoreKernel
418 - @ref NEHOGDetectorKernel
419 - @ref NELogits1DMaxKernel
420 - NELogits1DShiftExpSumKernel
421 - NELogits1DNormKernel
422 - @ref NENonMaximaSuppression3x3FP16Kernel
423 - @ref NENonMaximaSuppression3x3Kernel
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100424
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100425v17.03.1 First Major public release of the sources
426 - Renamed the library to arm_compute
427 - New CPP target introduced for C++ kernels shared between NEON and CL functions.
428 - New padding calculation interface introduced and ported most kernels / functions to use it.
429 - New OpenCL kernels / functions:
Anthony Barbier3762e742018-03-02 11:49:33 +0000430 - @ref CLGEMMLowpMatrixMultiplyKernel / CLGEMMLowp
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100431 - New NEON kernels / functions:
Anthony Barbier3762e742018-03-02 11:49:33 +0000432 - @ref NENormalizationLayerKernel / @ref NENormalizationLayer
433 - @ref NETransposeKernel / @ref NETranspose
434 - @ref NELogits1DMaxKernel, NELogits1DShiftExpSumKernel, NELogits1DNormKernel / @ref NESoftmaxLayer
435 - @ref NEIm2ColKernel, @ref NECol2ImKernel, NEConvolutionLayerWeightsReshapeKernel / @ref NEConvolutionLayer
436 - @ref NEGEMMMatrixAccumulateBiasesKernel / @ref NEFullyConnectedLayer
437 - @ref NEGEMMLowpMatrixMultiplyKernel / NEGEMMLowp
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100438
439v17.03 Sources preview
440 - New OpenCL kernels / functions:
Anthony Barbier3762e742018-03-02 11:49:33 +0000441 - @ref CLGradientKernel, @ref CLEdgeNonMaxSuppressionKernel, @ref CLEdgeTraceKernel / @ref CLCannyEdge
442 - GEMM refactoring + FP16 support: @ref CLGEMMInterleave4x4Kernel, @ref CLGEMMTranspose1xWKernel, @ref CLGEMMMatrixMultiplyKernel, @ref CLGEMMMatrixAdditionKernel / @ref CLGEMM
443 - @ref CLGEMMMatrixAccumulateBiasesKernel / @ref CLFullyConnectedLayer
444 - @ref CLTransposeKernel / @ref CLTranspose
445 - @ref CLLKTrackerInitKernel, @ref CLLKTrackerStage0Kernel, @ref CLLKTrackerStage1Kernel, @ref CLLKTrackerFinalizeKernel / @ref CLOpticalFlow
446 - @ref CLNormalizationLayerKernel / @ref CLNormalizationLayer
447 - @ref CLLaplacianPyramid, @ref CLLaplacianReconstruct
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100448 - New NEON kernels / functions:
Anthony Barbier3762e742018-03-02 11:49:33 +0000449 - @ref NEActivationLayerKernel / @ref NEActivationLayer
450 - GEMM refactoring + FP16 support (Requires armv8.2 CPU): @ref NEGEMMInterleave4x4Kernel, @ref NEGEMMTranspose1xWKernel, @ref NEGEMMMatrixMultiplyKernel, @ref NEGEMMMatrixAdditionKernel / @ref NEGEMM
451 - @ref NEPoolingLayerKernel / @ref NEPoolingLayer
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100452
453v17.02.1 Sources preview
454 - New OpenCL kernels / functions:
Anthony Barbier3762e742018-03-02 11:49:33 +0000455 - @ref CLLogits1DMaxKernel, @ref CLLogits1DShiftExpSumKernel, @ref CLLogits1DNormKernel / @ref CLSoftmaxLayer
456 - @ref CLPoolingLayerKernel / @ref CLPoolingLayer
457 - @ref CLIm2ColKernel, @ref CLCol2ImKernel, CLConvolutionLayerWeightsReshapeKernel / @ref CLConvolutionLayer
458 - @ref CLRemapKernel / @ref CLRemap
459 - @ref CLGaussianPyramidHorKernel, @ref CLGaussianPyramidVertKernel / @ref CLGaussianPyramid, @ref CLGaussianPyramidHalf, @ref CLGaussianPyramidOrb
460 - @ref CLMinMaxKernel, @ref CLMinMaxLocationKernel / @ref CLMinMaxLocation
461 - @ref CLNonLinearFilterKernel / @ref CLNonLinearFilter
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100462 - New NEON FP16 kernels (Requires armv8.2 CPU)
Anthony Barbier3762e742018-03-02 11:49:33 +0000463 - @ref NEAccumulateWeightedFP16Kernel
464 - @ref NEBox3x3FP16Kernel
465 - @ref NENonMaximaSuppression3x3FP16Kernel
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100466
467v17.02 Sources preview
468 - New OpenCL kernels / functions:
Anthony Barbier3762e742018-03-02 11:49:33 +0000469 - @ref CLActivationLayerKernel / @ref CLActivationLayer
470 - @ref CLChannelCombineKernel / @ref CLChannelCombine
471 - @ref CLDerivativeKernel / @ref CLChannelExtract
472 - @ref CLFastCornersKernel / @ref CLFastCorners
473 - @ref CLMeanStdDevKernel / @ref CLMeanStdDev
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100474 - New NEON kernels / functions:
Anthony Barbier3762e742018-03-02 11:49:33 +0000475 - HOG / SVM: @ref NEHOGOrientationBinningKernel, @ref NEHOGBlockNormalizationKernel, @ref NEHOGDetectorKernel, NEHOGNonMaximaSuppressionKernel / @ref NEHOGDescriptor, @ref NEHOGDetector, @ref NEHOGGradient, @ref NEHOGMultiDetection
476 - @ref NENonLinearFilterKernel / @ref NENonLinearFilter
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100477 - Introduced a CLScheduler to manage the default context and command queue used by the runtime library and create synchronisation events.
478 - Switched all the kernels / functions to use tensors instead of images.
479 - Updated documentation to include instructions to build the library from sources.
480
481v16.12 Binary preview release
482 - Original release
483
484@section S3_how_to_build How to build the library and the examples
485
486@subsection S3_1_build_options Build options
487
488scons 2.3 or above is required to build the library.
489To see the build options available simply run ```scons -h```:
490
Anthony Barbier79c61782017-06-23 11:48:24 +0100491 debug: Debug (yes|no)
492 default: False
493 actual: False
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100494
Anthony Barbier79c61782017-06-23 11:48:24 +0100495 asserts: Enable asserts (this flag is forced to 1 for debug=1) (yes|no)
496 default: False
497 actual: False
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100498
Anthony Barbier79c61782017-06-23 11:48:24 +0100499 arch: Target Architecture (armv7a|arm64-v8a|arm64-v8.2-a|x86_32|x86_64)
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100500 default: armv7a
501 actual: armv7a
502
Anthony Barbier79c61782017-06-23 11:48:24 +0100503 os: Target OS (linux|android|bare_metal)
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100504 default: linux
505 actual: linux
506
Anthony Barbier2d0ce772018-02-21 15:35:36 +0000507 build: Build type (native|cross_compile|embed_only)
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100508 default: cross_compile
509 actual: cross_compile
510
Anthony Barbier79c61782017-06-23 11:48:24 +0100511 examples: Build example programs (yes|no)
512 default: True
513 actual: True
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100514
Anthony Barbier79c61782017-06-23 11:48:24 +0100515 Werror: Enable/disable the -Werror compilation flag (yes|no)
516 default: True
517 actual: True
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100518
Anthony Barbier79c61782017-06-23 11:48:24 +0100519 opencl: Enable OpenCL support (yes|no)
520 default: True
521 actual: True
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100522
Anthony Barbier79c61782017-06-23 11:48:24 +0100523 neon: Enable Neon support (yes|no)
524 default: False
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100525 actual: False
526
Anthony Barbier20dbb822017-12-13 21:19:39 +0000527 gles_compute: Enable OpenGL ES Compute Shader support (yes|no)
528 default: False
529 actual: False
530
531 embed_kernels: Embed OpenCL kernels and OpenGL ES compute shader in library binary (yes|no)
Anthony Barbiercc0a80b2017-12-15 11:37:29 +0000532 default: True
533 actual: True
Anthony Barbier79c61782017-06-23 11:48:24 +0100534
535 set_soname: Set the library's soname and shlibversion (requires SCons 2.4 or above) (yes|no)
536 default: False
537 actual: False
538
539 openmp: Enable OpenMP backend (yes|no)
540 default: False
541 actual: False
542
543 cppthreads: Enable C++11 threads backend (yes|no)
544 default: True
545 actual: True
546
547 build_dir: Specify sub-folder for the build ( /path/to/build_dir )
548 default: .
549 actual: .
550
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100551 extra_cxx_flags: Extra CXX flags to be appended to the build command
552 default:
553 actual:
554
Anthony Barbier79c61782017-06-23 11:48:24 +0100555 pmu: Enable PMU counters (yes|no)
556 default: False
557 actual: False
558
Anthony Barbier6a5627a2017-09-26 14:42:02 +0100559 mali: Enable Mali hardware counters (yes|no)
560 default: False
561 actual: False
562
Anthony Barbier79c61782017-06-23 11:48:24 +0100563 validation_tests: Build validation test programs (yes|no)
564 default: False
565 actual: False
566
567 benchmark_tests: Build benchmark test programs (yes|no)
568 default: False
569 actual: False
570
571@b debug / @b asserts:
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100572 - With debug=1 asserts are enabled, and the library is built with symbols and no optimisations enabled.
573 - With debug=0 and asserts=1: Optimisations are enabled and symbols are removed, however all the asserts are still present (This is about 20% slower than the release build)
574 - With debug=0 and asserts=0: All optimisations are enable and no validation is performed, if the application misuses the library it is likely to result in a crash. (Only use this mode once you are sure your application is working as expected).
575
Anthony Barbier79c61782017-06-23 11:48:24 +0100576@b arch: The x86_32 and x86_64 targets can only be used with neon=0 and opencl=1.
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100577
Anthony Barbier79c61782017-06-23 11:48:24 +0100578@b os: Choose the operating system you are targeting: Linux, Android or bare metal.
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100579@note bare metal can only be used for NEON (not OpenCL), only static libraries get built and NEON's multi-threading support is disabled.
580
Anthony Barbier79c61782017-06-23 11:48:24 +0100581@b build: you can either build directly on your device (native) or cross compile from your desktop machine (cross-compile). In both cases make sure the compiler is available in your path.
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100582
Anthony Barbier79c61782017-06-23 11:48:24 +0100583@note If you want to natively compile for 32bit on a 64bit ARM device running a 64bit OS then you will have to use cross-compile too.
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100584
Anthony Barbier2d0ce772018-02-21 15:35:36 +0000585There is also an 'embed_only' option which will generate all the .embed files for the OpenCL kernels and / or OpenGLES compute shaders. This might be useful if using a different build system to compile the library.
586
Anthony Barbier79c61782017-06-23 11:48:24 +0100587@b Werror: If you are compiling using the same toolchains as the ones used in this guide then there shouldn't be any warning and therefore you should be able to keep Werror=1. If with a different compiler version the library fails to build because of warnings interpreted as errors then, if you are sure the warnings are not important, you might want to try to build with Werror=0 (But please do report the issue either on Github or by an email to developer@arm.com so that the issue can be addressed).
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100588
Anthony Barbier20dbb822017-12-13 21:19:39 +0000589@b opencl / @b neon / @b gles_compute: Choose which SIMD technology you want to target. (NEON for ARM Cortex-A CPUs or OpenCL / GLES_COMPUTE for ARM Mali GPUs)
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100590
Anthony Barbier20dbb822017-12-13 21:19:39 +0000591@b embed_kernels: For OpenCL / GLES_COMPUTE only: set embed_kernels=1 if you want the OpenCL / GLES_COMPUTE kernels to be built in the library's binaries instead of being read from separate ".cl" / ".cs" files. If embed_kernels is set to 0 then the application can set the path to the folder containing the OpenCL / GLES_COMPUTE kernel files by calling CLKernelLibrary::init() / GCKernelLibrary::init(). By default the path is set to "./cl_kernels" / "./cs_shaders".
Anthony Barbier79c61782017-06-23 11:48:24 +0100592
593@b set_soname: Do you want to build the versioned version of the library ?
594
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100595If enabled the library will contain a SONAME and SHLIBVERSION and some symlinks will automatically be created between the objects.
596Example:
597 libarm_compute_core.so -> libarm_compute_core.so.1.0.0
598 libarm_compute_core.so.1 -> libarm_compute_core.so.1.0.0
599 libarm_compute_core.so.1.0.0
600
601@note This options is disabled by default as it requires SCons version 2.4 or above.
602
Anthony Barbier79c61782017-06-23 11:48:24 +0100603@b extra_cxx_flags: Custom CXX flags which will be appended to the end of the build command.
604
605@b build_dir: Build the library in a subfolder of the "build" folder. (Allows to build several configurations in parallel).
606
607@b examples: Build or not the examples
608
609@b validation_tests: Enable the build of the validation suite.
610
Anthony Barbier79c61782017-06-23 11:48:24 +0100611@b benchmark_tests: Enable the build of the benchmark tests
612
613@b pmu: Enable the PMU cycle counter to measure execution time in benchmark tests. (Your device needs to support it)
614
Anthony Barbier6a5627a2017-09-26 14:42:02 +0100615@b mali: Enable the collection of Mali hardware counters to measure execution time in benchmark tests. (Your device needs to have a Mali driver that supports it)
616
Anthony Barbier79c61782017-06-23 11:48:24 +0100617@b openmp Build in the OpenMP scheduler for NEON.
618
619@note Only works when building with g++ not clang++
620
621@b cppthreads Build in the C++11 scheduler for NEON.
622
Anthony Barbier3762e742018-03-02 11:49:33 +0000623@sa Scheduler::set
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100624
Moritz Pflanzer07674de2017-07-21 09:39:36 +0100625@subsection S3_2_linux Building for Linux
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100626
627@subsubsection S3_2_1_library How to build the library ?
628
629For Linux, the library was successfully built and tested using the following Linaro GCC toolchain:
630
631 - gcc-linaro-arm-linux-gnueabihf-4.9-2014.07_linux
632 - gcc-linaro-4.9-2016.02-x86_64_aarch64-linux-gnu
633 - gcc-linaro-6.3.1-2017.02-i686_aarch64-linux-gnu
634
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100635To cross-compile the library in debug mode, with NEON only support, for Linux 32bit:
636
637 scons Werror=1 -j8 debug=1 neon=1 opencl=0 os=linux arch=armv7a
638
639To cross-compile the library in asserts mode, with OpenCL only support, for Linux 64bit:
640
641 scons Werror=1 -j8 debug=0 asserts=1 neon=0 opencl=1 embed_kernels=1 os=linux arch=arm64-v8a
642
Anthony Barbier20dbb822017-12-13 21:19:39 +0000643To cross-compile the library in asserts mode, with GLES_COMPUTE only support, for Linux 64bit:
644
645 scons Werror=1 -j8 debug=0 asserts=1 neon=0 opencl=0 gles_compute=1 embed_kernels=1 os=linux arch=arm64-v8a
646
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100647You can also compile the library natively on an ARM device by using <b>build=native</b>:
648
649 scons Werror=1 -j8 debug=0 neon=1 opencl=0 os=linux arch=arm64-v8a build=native
650 scons Werror=1 -j8 debug=0 neon=1 opencl=0 os=linux arch=armv7a build=native
651
652@note g++ for ARM is mono-arch, therefore if you want to compile for Linux 32bit on a Linux 64bit platform you will have to use a cross compiler.
653
654For example on a 64bit Debian based system you would have to install <b>g++-arm-linux-gnueabihf</b>
655
656 apt-get install g++-arm-linux-gnueabihf
657
658Then run
659
660 scons Werror=1 -j8 debug=0 neon=1 opencl=0 os=linux arch=armv7a build=cross_compile
661
662or simply remove the build parameter as build=cross_compile is the default value:
663
664 scons Werror=1 -j8 debug=0 neon=1 opencl=0 os=linux arch=armv7a
665
666@attention To cross compile with opencl=1 you need to make sure to have a version of libOpenCL matching your target architecture.
667
668@subsubsection S3_2_2_examples How to manually build the examples ?
669
670The examples get automatically built by scons as part of the build process of the library described above. This section just describes how you can build and link your own application against our library.
671
Georgios Pinitasd9eb2752018-04-03 13:44:29 +0100672@note The following command lines assume the arm_compute binaries are present in the current directory or in the system library path. If this is not the case you can specify the location of the pre-built library with the compiler option -L. When building the OpenCL example the commands below assume that the CL headers are located in the include folder where the command is executed.
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100673
674To cross compile a NEON example for Linux 32bit:
675
Anthony Barbierb2881fc2017-09-29 17:12:12 +0100676 arm-linux-gnueabihf-g++ examples/neon_convolution.cpp utils/Utils.cpp -I. -Iinclude -std=c++11 -mfpu=neon -L. -larm_compute -larm_compute_core -o neon_convolution
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100677
678To cross compile a NEON example for Linux 64bit:
679
Anthony Barbierb2881fc2017-09-29 17:12:12 +0100680 aarch64-linux-gnu-g++ examples/neon_convolution.cpp utils/Utils.cpp -I. -Iinclude -std=c++11 -L. -larm_compute -larm_compute_core -o neon_convolution
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100681
682(notice the only difference with the 32 bit command is that we don't need the -mfpu option and the compiler's name is different)
683
684To cross compile an OpenCL example for Linux 32bit:
685
Georgios Pinitasd9eb2752018-04-03 13:44:29 +0100686 arm-linux-gnueabihf-g++ examples/cl_convolution.cpp utils/Utils.cpp -I. -Iinclude -std=c++11 -mfpu=neon -L. -larm_compute -larm_compute_core -o cl_convolution -DARM_COMPUTE_CL
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100687
688To cross compile an OpenCL example for Linux 64bit:
689
Georgios Pinitasd9eb2752018-04-03 13:44:29 +0100690 aarch64-linux-gnu-g++ examples/cl_convolution.cpp utils/Utils.cpp -I. -Iinclude -std=c++11 -L. -larm_compute -larm_compute_core -o cl_convolution -DARM_COMPUTE_CL
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100691
Anthony Barbier14c86a92017-12-14 16:27:41 +0000692To cross compile a GLES example for Linux 32bit:
693
694 arm-linux-gnueabihf-g++ examples/gc_absdiff.cpp utils/Utils.cpp -I. -Iinclude/ -L. -larm_compute -larm_compute_core -std=c++11 -mfpu=neon -DARM_COMPUTE_GC -Iinclude/linux/ -o gc_absdiff
695
696To cross compile a GLES example for Linux 64bit:
697
698 aarch64-linux-gnu-g++ examples/gc_absdiff.cpp utils/Utils.cpp -I. -Iinclude/ -L. -larm_compute -larm_compute_core -std=c++11 -DARM_COMPUTE_GC -Iinclude/linux/ -o gc_absdiff
699
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100700(notice the only difference with the 32 bit command is that we don't need the -mfpu option and the compiler's name is different)
701
Anthony Barbier14c86a92017-12-14 16:27:41 +0000702To cross compile the examples with the Graph API, such as graph_lenet.cpp, you need to link the examples against arm_compute_graph.so too.
703
704@note The compute library must currently be built with both neon and opencl enabled - neon=1 and opencl=1
Gian Marco Iodicedaec1aa2017-09-29 12:03:18 +0100705
706i.e. to cross compile the "graph_lenet" example for Linux 32bit:
707
Anthony Barbier14c86a92017-12-14 16:27:41 +0000708 arm-linux-gnueabihf-g++ examples/graph_lenet.cpp utils/Utils.cpp utils/GraphUtils.cpp -I. -Iinclude -std=c++11 -mfpu=neon -L. -larm_compute_graph -larm_compute -larm_compute_core -Wl,--allow-shlib-undefined -o graph_lenet
Gian Marco Iodicedaec1aa2017-09-29 12:03:18 +0100709
710i.e. to cross compile the "graph_lenet" example for Linux 64bit:
711
Isabella Gottardib28f29d2017-11-09 17:05:07 +0000712 aarch64-linux-gnu-g++ examples/graph_lenet.cpp utils/Utils.cpp utils/GraphUtils.cpp -I. -Iinclude -std=c++11 -L. -larm_compute_graph -larm_compute -larm_compute_core -Wl,--allow-shlib-undefined -o graph_lenet
Gian Marco Iodicedaec1aa2017-09-29 12:03:18 +0100713
714(notice the only difference with the 32 bit command is that we don't need the -mfpu option and the compiler's name is different)
715
Anthony Barbiere5007472017-10-27 15:01:44 +0100716@note If compiling using static libraries, this order must be followed when linking: arm_compute_graph_static, arm_compute, arm_compute_core
717
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100718To compile natively (i.e directly on an ARM device) for NEON for Linux 32bit:
719
Anthony Barbierb2881fc2017-09-29 17:12:12 +0100720 g++ examples/neon_convolution.cpp utils/Utils.cpp -I. -Iinclude -std=c++11 -mfpu=neon -larm_compute -larm_compute_core -o neon_convolution
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100721
722To compile natively (i.e directly on an ARM device) for NEON for Linux 64bit:
723
Anthony Barbierb2881fc2017-09-29 17:12:12 +0100724 g++ examples/neon_convolution.cpp utils/Utils.cpp -I. -Iinclude -std=c++11 -larm_compute -larm_compute_core -o neon_convolution
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100725
726(notice the only difference with the 32 bit command is that we don't need the -mfpu option)
727
728To compile natively (i.e directly on an ARM device) for OpenCL for Linux 32bit or Linux 64bit:
729
Georgios Pinitasd9eb2752018-04-03 13:44:29 +0100730 g++ examples/cl_convolution.cpp utils/Utils.cpp -I. -Iinclude -std=c++11 -larm_compute -larm_compute_core -o cl_convolution -DARM_COMPUTE_CL
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100731
Anthony Barbier14c86a92017-12-14 16:27:41 +0000732To compile natively (i.e directly on an ARM device) for GLES for Linux 32bit or Linux 64bit:
Gian Marco Iodicedaec1aa2017-09-29 12:03:18 +0100733
Anthony Barbier14c86a92017-12-14 16:27:41 +0000734 g++ examples/gc_absdiff.cpp utils/Utils.cpp -I. -Iinclude/ -L. -larm_compute -larm_compute_core -std=c++11 -DARM_COMPUTE_GC -Iinclude/linux/ -o gc_absdiff
735
736To compile natively the examples with the Graph API, such as graph_lenet.cpp, you need to link the examples against arm_compute_graph.so too.
737@note The compute library must currently be built with both neon and opencl enabled - neon=1 and opencl=1
738
739i.e. to natively compile the "graph_lenet" example for Linux 32bit:
Gian Marco Iodicedaec1aa2017-09-29 12:03:18 +0100740
Isabella Gottardib28f29d2017-11-09 17:05:07 +0000741 g++ examples/graph_lenet.cpp utils/Utils.cpp utils/GraphUtils.cpp -I. -Iinclude -std=c++11 -mfpu=neon -L. -larm_compute_graph -larm_compute -larm_compute_core -Wl,--allow-shlib-undefined -o graph_lenet
Gian Marco Iodicedaec1aa2017-09-29 12:03:18 +0100742
Anthony Barbier14c86a92017-12-14 16:27:41 +0000743i.e. to natively compile the "graph_lenet" example for Linux 64bit:
Gian Marco Iodicedaec1aa2017-09-29 12:03:18 +0100744
Isabella Gottardib28f29d2017-11-09 17:05:07 +0000745 g++ examples/graph_lenet.cpp utils/Utils.cpp utils/GraphUtils.cpp -I. -Iinclude -std=c++11 L. -larm_compute_graph -larm_compute -larm_compute_core -Wl,--allow-shlib-undefined -o graph_lenet
Gian Marco Iodicedaec1aa2017-09-29 12:03:18 +0100746
747(notice the only difference with the 32 bit command is that we don't need the -mfpu option)
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100748
Anthony Barbiere5007472017-10-27 15:01:44 +0100749@note If compiling using static libraries, this order must be followed when linking: arm_compute_graph_static, arm_compute, arm_compute_core
750
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100751@note These two commands assume libarm_compute.so is available in your library path, if not add the path to it using -L
752
753To run the built executable simply run:
754
755 LD_LIBRARY_PATH=build ./neon_convolution
756
757or
758
759 LD_LIBRARY_PATH=build ./cl_convolution
760
Anthony Barbier3762e742018-03-02 11:49:33 +0000761@note Examples accept different types of arguments, to find out what they are run the example without any argument and the help will be displayed at the beginning of the run.
762
763For example:
764 LD_LIBRARY_PATH=. ./graph_lenet
765
766 ./graph_lenet
767
768 Usage: ./graph_lenet [target] [path_to_data] [batches]
769
770 No data folder provided: using random values
771
772 Test passed
773
774In this case the first argument of LeNet (like all the graph examples) is the target (i.e 0 to run on NEON, 1 to run on OpenCL if available, 2 to run on OpenCL using the CLTuner), the second argument is the path to the folder containing the npy files for the weights and finally the third argument is the number of batches to run.
775
Moritz Pflanzer07674de2017-07-21 09:39:36 +0100776@subsection S3_3_android Building for Android
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100777
778For Android, the library was successfully built and tested using Google's standalone toolchains:
Anthony Barbiera8a28f62018-02-26 19:16:32 +0000779 - clang++ from NDK r16b for armv7a
780 - clang++ from NDK r16b for arm64-v8a
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100781
782Here is a guide to <a href="https://developer.android.com/ndk/guides/standalone_toolchain.html">create your Android standalone toolchains from the NDK</a>
783
Anthony Barbiera8a28f62018-02-26 19:16:32 +0000784- Download the NDK r16b from here: https://developer.android.com/ndk/downloads/index.html
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100785- Make sure you have Python 2 installed on your machine.
786- Generate the 32 and/or 64 toolchains by running the following commands:
787
Anthony Barbiera8a28f62018-02-26 19:16:32 +0000788 $NDK/build/tools/make_standalone_toolchain.py --arch arm64 --install-dir $MY_TOOLCHAINS/aarch64-linux-android-ndk-r16b --stl gnustl --api 21
789 $NDK/build/tools/make_standalone_toolchain.py --arch arm --install-dir $MY_TOOLCHAINS/arm-linux-android-ndk-r16b --stl gnustl --api 21
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100790
Anthony Barbier14c86a92017-12-14 16:27:41 +0000791@attention Due to some NDK issues make sure you use clang++ & gnustl
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100792
793@note Make sure to add the toolchains to your PATH: export PATH=$PATH:$MY_TOOLCHAINS/aarch64-linux-android-4.9/bin:$MY_TOOLCHAINS/arm-linux-androideabi-4.9/bin
794
795@subsubsection S3_3_1_library How to build the library ?
796
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100797To cross-compile the library in debug mode, with NEON only support, for Android 32bit:
798
799 CXX=clang++ CC=clang scons Werror=1 -j8 debug=1 neon=1 opencl=0 os=android arch=armv7a
800
801To cross-compile the library in asserts mode, with OpenCL only support, for Android 64bit:
802
Anthony Barbier14c86a92017-12-14 16:27:41 +0000803 CXX=clang++ CC=clang scons Werror=1 -j8 debug=0 asserts=1 neon=0 opencl=1 embed_kernels=1 os=android arch=arm64-v8a
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100804
Anthony Barbier20dbb822017-12-13 21:19:39 +0000805To cross-compile the library in asserts mode, with GLES_COMPUTE only support, for Android 64bit:
806
Anthony Barbier14c86a92017-12-14 16:27:41 +0000807 CXX=clang++ CC=clang scons Werror=1 -j8 debug=0 asserts=1 neon=0 opencl=0 gles_compute=1 embed_kernels=1 os=android arch=arm64-v8a
Anthony Barbier20dbb822017-12-13 21:19:39 +0000808
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100809@subsubsection S3_3_2_examples How to manually build the examples ?
810
811The examples get automatically built by scons as part of the build process of the library described above. This section just describes how you can build and link your own application against our library.
812
Georgios Pinitasd9eb2752018-04-03 13:44:29 +0100813@note The following command lines assume the arm_compute binaries are present in the current directory or in the system library path. If this is not the case you can specify the location of the pre-built library with the compiler option -L. When building the OpenCL example the commands below assume that the CL headers are located in the include folder where the command is executed.
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100814
815Once you've got your Android standalone toolchain built and added to your path you can do the following:
816
817To cross compile a NEON example:
818
819 #32 bit:
Georgios Pinitas9873ea32017-12-05 15:28:55 +0000820 arm-linux-androideabi-clang++ examples/neon_convolution.cpp utils/Utils.cpp -I. -Iinclude -std=c++11 -larm_compute-static -larm_compute_core-static -L. -o neon_convolution_arm -static-libstdc++ -pie
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100821 #64 bit:
Anthony Barbier14c86a92017-12-14 16:27:41 +0000822 aarch64-linux-android-clang++ examples/neon_convolution.cpp utils/Utils.cpp -I. -Iinclude -std=c++11 -larm_compute-static -larm_compute_core-static -L. -o neon_convolution_aarch64 -static-libstdc++ -pie
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100823
824To cross compile an OpenCL example:
825
826 #32 bit:
Georgios Pinitasd9eb2752018-04-03 13:44:29 +0100827 arm-linux-androideabi-clang++ examples/cl_convolution.cpp utils/Utils.cpp -I. -Iinclude -std=c++11 -larm_compute-static -larm_compute_core-static -L. -o cl_convolution_arm -static-libstdc++ -pie -DARM_COMPUTE_CL
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100828 #64 bit:
Georgios Pinitasd9eb2752018-04-03 13:44:29 +0100829 aarch64-linux-android-clang++ examples/cl_convolution.cpp utils/Utils.cpp -I. -Iinclude -std=c++11 -larm_compute-static -larm_compute_core-static -L. -o cl_convolution_aarch64 -static-libstdc++ -pie -DARM_COMPUTE_CL
Anthony Barbier14c86a92017-12-14 16:27:41 +0000830
831To cross compile a GLES example:
Anthony Barbiercc0a80b2017-12-15 11:37:29 +0000832
Anthony Barbier14c86a92017-12-14 16:27:41 +0000833 #32 bit:
834 arm-linux-androideabi-clang++ examples/gc_absdiff.cpp utils/Utils.cpp -I. -Iinclude -std=c++11 -larm_compute-static -larm_compute_core-static -L. -o gc_absdiff_arm -static-libstdc++ -pie -DARM_COMPUTE_GC
835 #64 bit:
836 aarch64-linux-android-clang++ examples/gc_absdiff.cpp utils/Utils.cpp -I. -Iinclude -std=c++11 -larm_compute-static -larm_compute_core-static -L. -o gc_absdiff_aarch64 -static-libstdc++ -pie -DARM_COMPUTE_GC
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100837
Gian Marco Iodicedaec1aa2017-09-29 12:03:18 +0100838To cross compile the examples with the Graph API, such as graph_lenet.cpp, you need to link the library arm_compute_graph also.
839(notice the compute library has to be built with both neon and opencl enabled - neon=1 and opencl=1)
840
841 #32 bit:
Georgios Pinitasd9eb2752018-04-03 13:44:29 +0100842 arm-linux-androideabi-clang++ examples/graph_lenet.cpp utils/Utils.cpp utils/GraphUtils.cpp -I. -Iinclude -std=c++11 -Wl,--whole-archive -larm_compute_graph-static -Wl,--no-whole-archive -larm_compute-static -larm_compute_core-static -L. -o graph_lenet_arm -static-libstdc++ -pie -DARM_COMPUTE_CL
Gian Marco Iodicedaec1aa2017-09-29 12:03:18 +0100843 #64 bit:
Georgios Pinitasd9eb2752018-04-03 13:44:29 +0100844 aarch64-linux-android-clang++ examples/graph_lenet.cpp utils/Utils.cpp utils/GraphUtils.cpp -I. -Iinclude -std=c++11 -Wl,--whole-archive -larm_compute_graph-static -Wl,--no-whole-archive -larm_compute-static -larm_compute_core-static -L. -o graph_lenet_aarch64 -static-libstdc++ -pie -DARM_COMPUTE_CL
Gian Marco Iodicedaec1aa2017-09-29 12:03:18 +0100845
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100846@note Due to some issues in older versions of the Mali OpenCL DDK (<= r13p0), we recommend to link arm_compute statically on Android.
Anthony Barbier20dbb822017-12-13 21:19:39 +0000847@note When linked statically the arm_compute_graph library currently needs the --whole-archive linker flag in order to work properly
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100848
849Then you need to do is upload the executable and the shared library to the device using ADB:
850
851 adb push neon_convolution_arm /data/local/tmp/
852 adb push cl_convolution_arm /data/local/tmp/
Anthony Barbier14c86a92017-12-14 16:27:41 +0000853 adb push gc_absdiff_arm /data/local/tmp/
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100854 adb shell chmod 777 -R /data/local/tmp/
855
856And finally to run the example:
857
858 adb shell /data/local/tmp/neon_convolution_arm
859 adb shell /data/local/tmp/cl_convolution_arm
Anthony Barbier14c86a92017-12-14 16:27:41 +0000860 adb shell /data/local/tmp/gc_absdiff_arm
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100861
862For 64bit:
863
864 adb push neon_convolution_aarch64 /data/local/tmp/
865 adb push cl_convolution_aarch64 /data/local/tmp/
Anthony Barbier14c86a92017-12-14 16:27:41 +0000866 adb push gc_absdiff_aarch64 /data/local/tmp/
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100867 adb shell chmod 777 -R /data/local/tmp/
868
869And finally to run the example:
870
871 adb shell /data/local/tmp/neon_convolution_aarch64
872 adb shell /data/local/tmp/cl_convolution_aarch64
Anthony Barbier14c86a92017-12-14 16:27:41 +0000873 adb shell /data/local/tmp/gc_absdiff_aarch64
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100874
Anthony Barbier3762e742018-03-02 11:49:33 +0000875@note Examples accept different types of arguments, to find out what they are run the example without any argument and the help will be displayed at the beginning of the run.
876
877For example:
878 adb shell /data/local/tmp/graph_lenet
879
880 /data/local/tmp/graph_lenet
881
882 Usage: /data/local/tmp/graph_lenet [target] [path_to_data] [batches]
883
884 No data folder provided: using random values
885
886 Test passed
887
888In this case the first argument of LeNet (like all the graph examples) is the target (i.e 0 to run on NEON, 1 to run on OpenCL if available, 2 to run on OpenCL using the CLTuner), the second argument is the path to the folder containing the npy files for the weights and finally the third argument is the number of batches to run.
889
Michalis Spyrou6e52ba32017-10-04 15:40:38 +0100890@subsection S3_4_bare_metal Building for bare metal
891
892For bare metal, the library was successfully built using linaros's latest (gcc-linaro-6.3.1-2017.05) bare metal toolchains:
893 - arm-eabi for armv7a
894 - aarch64-elf for arm64-v8a
895
896Download linaro for <a href="https://releases.linaro.org/components/toolchain/binaries/6.3-2017.05/arm-eabi/">armv7a</a> and <a href="https://releases.linaro.org/components/toolchain/binaries/6.3-2017.05/aarch64-elf/">arm64-v8a</a>.
897
898@note Make sure to add the toolchains to your PATH: export PATH=$PATH:$MY_TOOLCHAINS/gcc-linaro-6.3.1-2017.05-x86_64_aarch64-elf/bin:$MY_TOOLCHAINS/gcc-linaro-6.3.1-2017.05-x86_64_arm-eabi/bin
899
900@subsubsection S3_4_1_library How to build the library ?
901
902To cross-compile the library with NEON support for baremetal arm64-v8a:
903
904 scons Werror=1 -j8 debug=0 neon=1 opencl=0 os=bare_metal arch=arm64-v8a build=cross_compile cppthreads=0 openmp=0 standalone=1
905
906@subsubsection S3_4_2_examples How to manually build the examples ?
907
908Examples are disabled when building for bare metal. If you want to build the examples you need to provide a custom bootcode depending on the target architecture and link against the compute library. More information about bare metal bootcode can be found <a href="http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dai0527a/index.html">here</a>.
909
910@subsection S3_5_windows_host Building on a Windows host system
Moritz Pflanzer07674de2017-07-21 09:39:36 +0100911
912Using `scons` directly from the Windows command line is known to cause
913problems. The reason seems to be that if `scons` is setup for cross-compilation
914it gets confused about Windows style paths (using backslashes). Thus it is
915recommended to follow one of the options outlined below.
916
Michalis Spyrou6e52ba32017-10-04 15:40:38 +0100917@subsubsection S3_5_1_ubuntu_on_windows Bash on Ubuntu on Windows
Moritz Pflanzer07674de2017-07-21 09:39:36 +0100918
919The best and easiest option is to use
920<a href="https://msdn.microsoft.com/en-gb/commandline/wsl/about">Ubuntu on Windows</a>.
921This feature is still marked as *beta* and thus might not be available.
922However, if it is building the library is as simple as opening a *Bash on
923Ubuntu on Windows* shell and following the general guidelines given above.
924
Michalis Spyrou6e52ba32017-10-04 15:40:38 +0100925@subsubsection S3_5_2_cygwin Cygwin
Moritz Pflanzer07674de2017-07-21 09:39:36 +0100926
927If the Windows subsystem for Linux is not available <a href="https://www.cygwin.com/">Cygwin</a>
928can be used to install and run `scons`. In addition to the default packages
929installed by Cygwin `scons` has to be selected in the installer. (`git` might
930also be useful but is not strictly required if you already have got the source
931code of the library.) Linaro provides pre-built versions of
932<a href="http://releases.linaro.org/components/toolchain/binaries/">GCC cross-compilers</a>
933that can be used from the Cygwin terminal. When building for Android the
934compiler is included in the Android standalone toolchain. After everything has
935been set up in the Cygwin terminal the general guide on building the library
936can be followed.
937
Michalis Spyrou6e52ba32017-10-04 15:40:38 +0100938@subsection S3_6_cl_stub_library The OpenCL stub library
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100939
940In the opencl-1.2-stubs folder you will find the sources to build a stub OpenCL library which then can be used to link your application or arm_compute against.
941
942If you preferred you could retrieve the OpenCL library from your device and link against this one but often this library will have dependencies on a range of system libraries forcing you to link your application against those too even though it is not using them.
943
944@warning This OpenCL library provided is a stub and *not* a real implementation. You can use it to resolve OpenCL's symbols in arm_compute while building the example but you must make sure the real libOpenCL.so is in your PATH when running the example or it will not work.
945
946To cross-compile the stub OpenCL library simply run:
947
948 <target-prefix>-gcc -o libOpenCL.so -Iinclude opencl-1.2-stubs/opencl_stubs.c -fPIC -shared
949
950For example:
951
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100952 #Linux 32bit
953 arm-linux-gnueabihf-gcc -o libOpenCL.so -Iinclude opencl-1.2-stubs/opencl_stubs.c -fPIC -shared
954 #Linux 64bit
955 aarch64-linux-gnu-gcc -o libOpenCL.so -Iinclude -shared opencl-1.2-stubs/opencl_stubs.c -fPIC
956 #Android 32bit
957 arm-linux-androideabi-clang -o libOpenCL.so -Iinclude -shared opencl-1.2-stubs/opencl_stubs.c -fPIC -shared
958 #Android 64bit
Anthony Barbier14c86a92017-12-14 16:27:41 +0000959 aarch64-linux-android-clang -o libOpenCL.so -Iinclude -shared opencl-1.2-stubs/opencl_stubs.c -fPIC -shared
960
961@subsection S3_7_gles_stub_library The Linux OpenGLES and EGL stub libraries
962
963In the opengles-3.1-stubs folder you will find the sources to build stub EGL and OpenGLES libraries which then can be used to link your Linux application of arm_compute against.
964
965@note The stub libraries are only needed on Linux. For Android, the NDK toolchains already provide the meta-EGL and meta-GLES libraries.
966
967To cross-compile the stub OpenGLES and EGL libraries simply run:
968
969 <target-prefix>-gcc -o libEGL.so -Iinclude/linux opengles-3.1-stubs/EGL.c -fPIC -shared
970 <target-prefix>-gcc -o libGLESv2.so -Iinclude/linux opengles-3.1-stubs/GLESv2.c -fPIC -shared
971
972 #Linux 32bit
973 arm-linux-gnueabihf-gcc -o libEGL.so -Iinclude/linux opengles-3.1-stubs/EGL.c -fPIC -shared
974 arm-linux-gnueabihf-gcc -o libGLESv2.so -Iinclude/linux opengles-3.1-stubs/GLESv2.c -fPIC -shared
975
976 #Linux 64bit
977 aarch64-linux-gnu-gcc -o libEGL.so -Iinclude/linux opengles-3.1-stubs/EGL.c -fPIC -shared
978 aarch64-linux-gnu-gcc -o libGLESv2.so -Iinclude/linux opengles-3.1-stubs/GLESv2.c -fPIC -shared
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100979*/
Anthony Barbier3762e742018-03-02 11:49:33 +0000980} // namespace arm_compute