blob: a418ac28bf5ea12a29af409dc1553d83bca5190a [file] [log] [blame]
Anthony Barbier6ff3b192017-09-04 18:44:23 +01001/** @mainpage Introduction
2
3@tableofcontents
4
5The Computer Vision and Machine Learning library is a set of functions optimised for both ARM CPUs and GPUs using SIMD technologies.
6
7Several builds of the library are available using various configurations:
8 - OS: Linux, Android or bare metal.
9 - Architecture: armv7a (32bit) or arm64-v8a (64bit)
10 - Technology: NEON / OpenCL / NEON and OpenCL
11 - 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.
12
13@section S0_1_contact Contact / Support
14
15Please email developer@arm.com
16
17In 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:
18
19 $ strings android-armv7a-cl-asserts/libarm_compute.so | grep arm_compute_version
20 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
21
22@section S1_file_organisation File organisation
23
24This archive contains:
25 - The arm_compute header and source files
26 - The latest Khronos OpenCL 1.2 C headers from the <a href="https://www.khronos.org/registry/cl/">Khronos OpenCL registry</a>
27 - 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)
28 - The sources for a stub version of libOpenCL.so to help you build your application.
29 - An examples folder containing a few examples to compile and link against the library.
30 - A @ref utils folder containing headers with some boiler plate code used by the examples.
31 - This documentation.
32
33You should have the following file organisation:
34
35 .
36 ├── arm_compute --> All the arm_compute headers
37 │   ├── core
38 │   │   ├── CL
Anthony Barbier6a5627a2017-09-26 14:42:02 +010039 │   │   │   ├── CLKernelLibrary.h --> Manages all the OpenCL kernels compilation and caching, provides accessors for the OpenCL Context.
Anthony Barbier6ff3b192017-09-04 18:44:23 +010040 │   │   │   ├── CLKernels.h --> Includes all the OpenCL kernels at once
41 │   │   │   ├── CL specialisation of all the generic objects interfaces (ICLTensor, ICLImage, etc.)
42 │   │   │   ├── kernels --> Folder containing all the OpenCL kernels
43 │   │   │   │   └── CL*Kernel.h
44 │   │   │   └── OpenCL.h --> Wrapper to configure the Khronos OpenCL C++ header
45 │   │ ├── CPP
Anthony Barbier6a5627a2017-09-26 14:42:02 +010046 │   │   │   ├── CPPKernels.h --> Includes all the CPP kernels at once
Anthony Barbier6ff3b192017-09-04 18:44:23 +010047 │   │ │   └── kernels --> Folder containing all the CPP kernels
Anthony Barbier6a5627a2017-09-26 14:42:02 +010048 │   │   │      └── CPP*Kernel.h
Anthony Barbier6ff3b192017-09-04 18:44:23 +010049 │   │   ├── NEON
50 │   │   │   ├── kernels --> Folder containing all the NEON kernels
Anthony Barbier6a5627a2017-09-26 14:42:02 +010051 │   │   │   │ ├── arm64 --> Folder containing the interfaces for the assembly arm64 NEON kernels
52 │   │   │   │ ├── arm32 --> Folder containing the interfaces for the assembly arm32 NEON kernels
53 │   │   │   │ ├── assembly --> Folder containing the NEON assembly routines.
Anthony Barbier6ff3b192017-09-04 18:44:23 +010054 │   │   │   │   └── NE*Kernel.h
55 │   │   │   └── NEKernels.h --> Includes all the NEON kernels at once
56 │   │   ├── All common basic types (Types.h, Window, Coordinates, Iterator, etc.)
57 │   │   ├── All generic objects interfaces (ITensor, IImage, etc.)
58 │   │   └── Objects metadata classes (ImageInfo, TensorInfo, MultiImageInfo)
Anthony Barbier6a5627a2017-09-26 14:42:02 +010059 │   ├── graph
60 │   │   ├── CL --> OpenCL specific operations
61 │   │   │   └── CLMap.h / CLUnmap.h
62 │   │   ├── nodes
63 │   │   │   └── The various nodes supported by the graph API
64 │   │   ├── Nodes.h --> Includes all the Graph nodes at once.
65 │   │   └── Graph objects ( INode, ITensorAccessor, Graph, etc.)
Anthony Barbier6ff3b192017-09-04 18:44:23 +010066 │   └── runtime
67 │   ├── CL
68 │   │   ├── CL objects & allocators (CLArray, CLImage, CLTensor, etc.)
69 │   │   ├── functions --> Folder containing all the OpenCL functions
70 │   │   │   └── CL*.h
Anthony Barbier6a5627a2017-09-26 14:42:02 +010071 │   │   ├── CLScheduler.h --> Interface to enqueue OpenCL kernels and get/set the OpenCL CommandQueue and ICLTuner.
Anthony Barbier6ff3b192017-09-04 18:44:23 +010072 │   │   └── CLFunctions.h --> Includes all the OpenCL functions at once
73 │   ├── CPP
Anthony Barbier6a5627a2017-09-26 14:42:02 +010074 │      │   ├── CPPKernels.h --> Includes all the CPP functions at once.
75 │   │   └── CPPScheduler.h --> Basic pool of threads to execute CPP/NEON code on several cores in parallel
Anthony Barbier6ff3b192017-09-04 18:44:23 +010076 │   ├── NEON
77 │   │ ├── functions --> Folder containing all the NEON functions
78 │   │ │   └── NE*.h
79 │   │ └── NEFunctions.h --> Includes all the NEON functions at once
Anthony Barbier6a5627a2017-09-26 14:42:02 +010080 │   ├── OMP
81 │   │   └── OMPScheduler.h --> OpenMP scheduler (Alternative to the CPPScheduler)
82 │ ├── Memory manager files (LifetimeManager, PoolManager, etc.)
Anthony Barbier6ff3b192017-09-04 18:44:23 +010083 │   └── Basic implementations of the generic object interfaces (Array, Image, Tensor, etc.)
84 ├── documentation
85 │   ├── index.xhtml
86 │   └── ...
87 ├── documentation.xhtml -> documentation/index.xhtml
88 ├── examples
89 │   ├── cl_convolution.cpp
Anthony Barbierab60fe82017-09-26 16:15:23 +010090 │   ├── cl_events.cpp
91 │   ├── graph_lenet.cpp
Anthony Barbier6ff3b192017-09-04 18:44:23 +010092 │   ├── neoncl_scale_median_gaussian.cpp
Anthony Barbierab60fe82017-09-26 16:15:23 +010093 │   ├── neon_cnn.cpp
94 │   ├── neon_copy_objects.cpp
Anthony Barbier6ff3b192017-09-04 18:44:23 +010095 │   ├── neon_convolution.cpp
96 │   └── neon_scale.cpp
97 ├── include
Anthony Barbier6a5627a2017-09-26 14:42:02 +010098 │   ├── CL
99 │   │ └── Khronos OpenCL C headers and C++ wrapper
100 │   ├── half --> FP16 library available from http://half.sourceforge.net
101 │  └── libnpy --> Library to load / write npy buffers, available from https://github.com/llohse/libnpy
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100102 ├── opencl-1.2-stubs
103 │ └── opencl_stubs.c
Anthony Barbier6a5627a2017-09-26 14:42:02 +0100104 ├── scripts
105 │   ├── caffe_data_extractor.py --> Basic script to export weights from Caffe to npy files
106 │   └── tensorflow_data_extractor.py --> Basic script to export weights from Tensor Flow to npy files
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100107 ├── src
108 │   ├── core
109 │ │ └── ... (Same structure as headers)
110 │   │ └── CL
111 │   │ └── cl_kernels --> All the OpenCL kernels
Anthony Barbier6a5627a2017-09-26 14:42:02 +0100112 │   ├── graph
113 │ │ └── ... (Same structure as headers)
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100114 │ └── runtime
115 │ └── ... (Same structure as headers)
Anthony Barbier6a5627a2017-09-26 14:42:02 +0100116 ├── support
117 │ └── Various headers to work around toolchains / platform issues.
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100118 ├── tests
119 │   ├── All test related files shared between validation and benchmark
Anthony Barbier6a5627a2017-09-26 14:42:02 +0100120 │   ├── CL --> OpenCL accessors
121 │   ├── NEON --> NEON accessors
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100122 │   ├── benchmark --> Sources for benchmarking
123 │ │ ├── Benchmark specific files
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100124 │ │ ├── CL --> OpenCL benchmarking tests
125 │ │ └── NEON --> NEON benchmarking tests
Anthony Barbier6a5627a2017-09-26 14:42:02 +0100126 │   ├── datasets
127 │ │ └── Datasets for all the validation / benchmark tests, layer configurations for various networks, etc.
128 │   ├── framework
129 │ │ └── Boiler plate code for both validation and benchmark test suites (Command line parsers, instruments, output loggers, etc.)
130 │   ├── networks
131 │ │ └── Examples of how to instantiate networks.
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100132 │   ├── validation --> Sources for validation
133 │ │ ├── Validation specific files
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100134 │ │ ├── CL --> OpenCL validation tests
Anthony Barbier6a5627a2017-09-26 14:42:02 +0100135 │ │ ├── CPP --> C++ reference implementations
136 │   │ ├── fixtures
137 │ │ │ └── Fixtures to initialise and run the runtime Functions.
138 │ │ └── NEON --> NEON validation tests
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100139 │   └── dataset --> Datasets defining common sets of input parameters
140 └── utils --> Boiler plate code used by examples
141 └── Utils.h
142
143@section S2_versions_changelog Release versions and changelog
144
145@subsection S2_1_versions Release versions
146
147All releases are numbered vYY.MM Where YY are the last two digits of the year, and MM the month number.
148If there is more than one release in a month then an extra sequential number is appended at the end:
149
150 v17.03 (First release of March 2017)
151 v17.03.1 (Second release of March 2017)
152 v17.04 (First release of April 2017)
153
154@note We're aiming at releasing one major public release with new features per quarter. All releases in between will only contain bug fixes.
155
156@subsection S2_2_changelog Changelog
157
Anthony Barbier6a5627a2017-09-26 14:42:02 +0100158v17.09 Public major release
159 - Experimental Graph support: initial implementation of a simple stream API to easily chain machine learning layers.
160 - Memory Manager (@ref arm_compute::BlobLifetimeManager, @ref arm_compute::BlobMemoryPool, @ref arm_compute::ILifetimeManager, @ref arm_compute::IMemoryGroup, @ref arm_compute::IMemoryManager, @ref arm_compute::IMemoryPool, @ref arm_compute::IPoolManager, @ref arm_compute::MemoryManagerOnDemand, @ref arm_compute::PoolManager)
161 - New validation and benchmark frameworks (Boost and Google frameworks replaced by homemade framework).
162 - Most machine learning functions support both fixed point 8 and 16 bit (QS8, QS16) for both NEON and OpenCL.
163 - New NEON kernels / functions:
164 - @ref arm_compute::NEGEMMAssemblyBaseKernel @ref arm_compute::NEGEMMAArch64Kernel
165 - @ref arm_compute::NEDequantizationLayerKernel / @ref arm_compute::NEDequantizationLayer
166 - @ref arm_compute::NEFloorKernel / @ref arm_compute::NEFloor
167 - @ref arm_compute::NEL2NormalizeKernel / @ref arm_compute::NEL2Normalize
168 - @ref arm_compute::NEQuantizationLayerKernel @ref arm_compute::NEMinMaxLayerKernel / @ref arm_compute::NEQuantizationLayer
169 - @ref arm_compute::NEROIPoolingLayerKernel / @ref arm_compute::NEROIPoolingLayer
170 - @ref arm_compute::NEReductionOperationKernel / @ref arm_compute::NEReductionOperation
171 - @ref arm_compute::NEReshapeLayerKernel / @ref arm_compute::NEReshapeLayer
172
173 - New OpenCL kernels / functions:
174 - @ref arm_compute::CLDepthwiseConvolution3x3Kernel @ref arm_compute::CLDepthwiseIm2ColKernel @ref arm_compute::CLDepthwiseVectorToTensorKernel @ref arm_compute::CLDepthwiseWeightsReshapeKernel / @ref arm_compute::CLDepthwiseConvolution3x3 @ref arm_compute::CLDepthwiseConvolution @ref arm_compute::CLDepthwiseSeparableConvolutionLayer
175 - @ref arm_compute::CLDequantizationLayerKernel / @ref arm_compute::CLDequantizationLayer
176 - @ref arm_compute::CLDirectConvolutionLayerKernel / @ref arm_compute::CLDirectConvolutionLayer
177 - @ref arm_compute::CLFlattenLayer
178 - @ref arm_compute::CLFloorKernel / @ref arm_compute::CLFloor
179 - @ref arm_compute::CLGEMMTranspose1xW
180 - @ref arm_compute::CLGEMMMatrixVectorMultiplyKernel
181 - @ref arm_compute::CLL2NormalizeKernel / @ref arm_compute::CLL2Normalize
182 - @ref arm_compute::CLQuantizationLayerKernel @ref arm_compute::CLMinMaxLayerKernel / @ref arm_compute::CLQuantizationLayer
183 - @ref arm_compute::CLROIPoolingLayerKernel / @ref arm_compute::CLROIPoolingLayer
184 - @ref arm_compute::CLReductionOperationKernel / @ref arm_compute::CLReductionOperation
185 - @ref arm_compute::CLReshapeLayerKernel / @ref arm_compute::CLReshapeLayer
186
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100187v17.06 Public major release
188 - Various bug fixes
189 - Added support for fixed point 8 bit (QS8) to the various NEON machine learning kernels.
190 - Added unit tests and benchmarks (AlexNet, LeNet)
191 - Added support for sub tensors.
192 - Added infrastructure to provide GPU specific optimisation for some OpenCL kernels.
193 - Added @ref arm_compute::OMPScheduler (OpenMP) scheduler for NEON
194 - Added @ref arm_compute::SingleThreadScheduler scheduler for NEON (For bare metal)
195 - User can specify his own scheduler by implementing the @ref arm_compute::IScheduler interface.
196 - New OpenCL kernels / functions:
197 - @ref arm_compute::CLBatchNormalizationLayerKernel / @ref arm_compute::CLBatchNormalizationLayer
198 - @ref arm_compute::CLDepthConcatenateKernel / @ref arm_compute::CLDepthConcatenate
199 - @ref arm_compute::CLHOGOrientationBinningKernel @ref arm_compute::CLHOGBlockNormalizationKernel, @ref arm_compute::CLHOGDetectorKernel / @ref arm_compute::CLHOGDescriptor @ref arm_compute::CLHOGDetector @ref arm_compute::CLHOGGradient @ref arm_compute::CLHOGMultiDetection
200 - @ref arm_compute::CLLocallyConnectedMatrixMultiplyKernel / @ref arm_compute::CLLocallyConnectedLayer
201 - @ref arm_compute::CLWeightsReshapeKernel / @ref arm_compute::CLConvolutionLayerReshapeWeights
202 - New C++ kernels:
203 - @ref arm_compute::CPPDetectionWindowNonMaximaSuppressionKernel
204 - New NEON kernels / functions:
205 - @ref arm_compute::NEBatchNormalizationLayerKernel / @ref arm_compute::NEBatchNormalizationLayer
206 - @ref arm_compute::NEDepthConcatenateKernel / @ref arm_compute::NEDepthConcatenate
207 - @ref arm_compute::NEDirectConvolutionLayerKernel / @ref arm_compute::NEDirectConvolutionLayer
208 - @ref arm_compute::NELocallyConnectedMatrixMultiplyKernel / @ref arm_compute::NELocallyConnectedLayer
209 - @ref arm_compute::NEWeightsReshapeKernel / @ref arm_compute::NEConvolutionLayerReshapeWeights
210
211v17.05 Public bug fixes release
212 - Various bug fixes
213 - Remaining of the functions ported to use accurate padding.
214 - Library does not link against OpenCL anymore (It uses dlopen / dlsym at runtime instead to determine whether or not OpenCL is available).
215 - Added "free" method to allocator.
216 - Minimum version of g++ required for armv7 Linux changed from 4.8 to 4.9
217
218v17.04 Public bug fixes release
219
220 The following functions have been ported to use the new accurate padding:
221 - @ref arm_compute::CLColorConvertKernel
222 - @ref arm_compute::CLEdgeNonMaxSuppressionKernel
223 - @ref arm_compute::CLEdgeTraceKernel
224 - @ref arm_compute::CLGaussianPyramidHorKernel
225 - @ref arm_compute::CLGaussianPyramidVertKernel
226 - @ref arm_compute::CLGradientKernel
227 - @ref arm_compute::NEChannelCombineKernel
228 - @ref arm_compute::NEFillArrayKernel
229 - @ref arm_compute::NEGaussianPyramidHorKernel
230 - @ref arm_compute::NEGaussianPyramidVertKernel
231 - @ref arm_compute::NEHarrisScoreFP16Kernel
232 - @ref arm_compute::NEHarrisScoreKernel
233 - @ref arm_compute::NEHOGDetectorKernel
234 - @ref arm_compute::NELogits1DMaxKernel
235 - @ref arm_compute::NELogits1DShiftExpSumKernel
236 - @ref arm_compute::NELogits1DNormKernel
237 - @ref arm_compute::NENonMaximaSuppression3x3FP16Kernel
238 - @ref arm_compute::NENonMaximaSuppression3x3Kernel
239
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100240v17.03.1 First Major public release of the sources
241 - Renamed the library to arm_compute
242 - New CPP target introduced for C++ kernels shared between NEON and CL functions.
243 - New padding calculation interface introduced and ported most kernels / functions to use it.
244 - New OpenCL kernels / functions:
245 - @ref arm_compute::CLGEMMLowpMatrixMultiplyKernel / @ref arm_compute::CLGEMMLowp
246 - New NEON kernels / functions:
247 - @ref arm_compute::NENormalizationLayerKernel / @ref arm_compute::NENormalizationLayer
248 - @ref arm_compute::NETransposeKernel / @ref arm_compute::NETranspose
249 - @ref arm_compute::NELogits1DMaxKernel, @ref arm_compute::NELogits1DShiftExpSumKernel, @ref arm_compute::NELogits1DNormKernel / @ref arm_compute::NESoftmaxLayer
250 - @ref arm_compute::NEIm2ColKernel, @ref arm_compute::NECol2ImKernel, arm_compute::NEConvolutionLayerWeightsReshapeKernel / @ref arm_compute::NEConvolutionLayer
251 - @ref arm_compute::NEGEMMMatrixAccumulateBiasesKernel / @ref arm_compute::NEFullyConnectedLayer
252 - @ref arm_compute::NEGEMMLowpMatrixMultiplyKernel / @ref arm_compute::NEGEMMLowp
253
254v17.03 Sources preview
255 - New OpenCL kernels / functions:
256 - @ref arm_compute::CLGradientKernel, @ref arm_compute::CLEdgeNonMaxSuppressionKernel, @ref arm_compute::CLEdgeTraceKernel / @ref arm_compute::CLCannyEdge
257 - GEMM refactoring + FP16 support: @ref arm_compute::CLGEMMInterleave4x4Kernel, @ref arm_compute::CLGEMMTranspose1xWKernel, @ref arm_compute::CLGEMMMatrixMultiplyKernel, @ref arm_compute::CLGEMMMatrixAdditionKernel / @ref arm_compute::CLGEMM
258 - @ref arm_compute::CLGEMMMatrixAccumulateBiasesKernel / @ref arm_compute::CLFullyConnectedLayer
259 - @ref arm_compute::CLTransposeKernel / @ref arm_compute::CLTranspose
260 - @ref arm_compute::CLLKTrackerInitKernel, @ref arm_compute::CLLKTrackerStage0Kernel, @ref arm_compute::CLLKTrackerStage1Kernel, @ref arm_compute::CLLKTrackerFinalizeKernel / @ref arm_compute::CLOpticalFlow
261 - @ref arm_compute::CLNormalizationLayerKernel / @ref arm_compute::CLNormalizationLayer
262 - @ref arm_compute::CLLaplacianPyramid, @ref arm_compute::CLLaplacianReconstruct
263 - New NEON kernels / functions:
264 - @ref arm_compute::NEActivationLayerKernel / @ref arm_compute::NEActivationLayer
265 - GEMM refactoring + FP16 support (Requires armv8.2 CPU): @ref arm_compute::NEGEMMInterleave4x4Kernel, @ref arm_compute::NEGEMMTranspose1xWKernel, @ref arm_compute::NEGEMMMatrixMultiplyKernel, @ref arm_compute::NEGEMMMatrixAdditionKernel / @ref arm_compute::NEGEMM
266 - @ref arm_compute::NEPoolingLayerKernel / @ref arm_compute::NEPoolingLayer
267
268v17.02.1 Sources preview
269 - New OpenCL kernels / functions:
270 - @ref arm_compute::CLLogits1DMaxKernel, @ref arm_compute::CLLogits1DShiftExpSumKernel, @ref arm_compute::CLLogits1DNormKernel / @ref arm_compute::CLSoftmaxLayer
271 - @ref arm_compute::CLPoolingLayerKernel / @ref arm_compute::CLPoolingLayer
Gian Marco Iodice5cb4c422017-06-23 10:38:25 +0100272 - @ref arm_compute::CLIm2ColKernel, @ref arm_compute::CLCol2ImKernel, arm_compute::CLConvolutionLayerWeightsReshapeKernel / @ref arm_compute::CLConvolutionLayer
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100273 - @ref arm_compute::CLRemapKernel / @ref arm_compute::CLRemap
274 - @ref arm_compute::CLGaussianPyramidHorKernel, @ref arm_compute::CLGaussianPyramidVertKernel / @ref arm_compute::CLGaussianPyramid, @ref arm_compute::CLGaussianPyramidHalf, @ref arm_compute::CLGaussianPyramidOrb
275 - @ref arm_compute::CLMinMaxKernel, @ref arm_compute::CLMinMaxLocationKernel / @ref arm_compute::CLMinMaxLocation
276 - @ref arm_compute::CLNonLinearFilterKernel / @ref arm_compute::CLNonLinearFilter
277 - New NEON FP16 kernels (Requires armv8.2 CPU)
278 - @ref arm_compute::NEAccumulateWeightedFP16Kernel
279 - @ref arm_compute::NEBox3x3FP16Kernel
280 - @ref arm_compute::NENonMaximaSuppression3x3FP16Kernel
281
282v17.02 Sources preview
283 - New OpenCL kernels / functions:
284 - @ref arm_compute::CLActivationLayerKernel / @ref arm_compute::CLActivationLayer
285 - @ref arm_compute::CLChannelCombineKernel / @ref arm_compute::CLChannelCombine
286 - @ref arm_compute::CLDerivativeKernel / @ref arm_compute::CLChannelExtract
287 - @ref arm_compute::CLFastCornersKernel / @ref arm_compute::CLFastCorners
288 - @ref arm_compute::CLMeanStdDevKernel / @ref arm_compute::CLMeanStdDev
289 - New NEON kernels / functions:
290 - HOG / SVM: @ref arm_compute::NEHOGOrientationBinningKernel, @ref arm_compute::NEHOGBlockNormalizationKernel, @ref arm_compute::NEHOGDetectorKernel, arm_compute::NEHOGNonMaximaSuppressionKernel / @ref arm_compute::NEHOGDescriptor, @ref arm_compute::NEHOGDetector, @ref arm_compute::NEHOGGradient, @ref arm_compute::NEHOGMultiDetection
291 - @ref arm_compute::NENonLinearFilterKernel / @ref arm_compute::NENonLinearFilter
292 - Introduced a CLScheduler to manage the default context and command queue used by the runtime library and create synchronisation events.
293 - Switched all the kernels / functions to use tensors instead of images.
294 - Updated documentation to include instructions to build the library from sources.
295
296v16.12 Binary preview release
297 - Original release
298
299@section S3_how_to_build How to build the library and the examples
300
301@subsection S3_1_build_options Build options
302
303scons 2.3 or above is required to build the library.
304To see the build options available simply run ```scons -h```:
305
Anthony Barbier79c61782017-06-23 11:48:24 +0100306 debug: Debug (yes|no)
307 default: False
308 actual: False
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100309
Anthony Barbier79c61782017-06-23 11:48:24 +0100310 asserts: Enable asserts (this flag is forced to 1 for debug=1) (yes|no)
311 default: False
312 actual: False
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100313
Anthony Barbier79c61782017-06-23 11:48:24 +0100314 arch: Target Architecture (armv7a|arm64-v8a|arm64-v8.2-a|x86_32|x86_64)
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100315 default: armv7a
316 actual: armv7a
317
Anthony Barbier79c61782017-06-23 11:48:24 +0100318 os: Target OS (linux|android|bare_metal)
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100319 default: linux
320 actual: linux
321
Anthony Barbier79c61782017-06-23 11:48:24 +0100322 build: Build type (native|cross_compile)
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100323 default: cross_compile
324 actual: cross_compile
325
Anthony Barbier79c61782017-06-23 11:48:24 +0100326 examples: Build example programs (yes|no)
327 default: True
328 actual: True
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100329
Anthony Barbier79c61782017-06-23 11:48:24 +0100330 Werror: Enable/disable the -Werror compilation flag (yes|no)
331 default: True
332 actual: True
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100333
Anthony Barbier79c61782017-06-23 11:48:24 +0100334 opencl: Enable OpenCL support (yes|no)
335 default: True
336 actual: True
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100337
Anthony Barbier79c61782017-06-23 11:48:24 +0100338 neon: Enable Neon support (yes|no)
339 default: False
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100340 actual: False
341
Anthony Barbier79c61782017-06-23 11:48:24 +0100342 embed_kernels: Embed OpenCL kernels in library binary (yes|no)
343 default: False
344 actual: False
345
346 set_soname: Set the library's soname and shlibversion (requires SCons 2.4 or above) (yes|no)
347 default: False
348 actual: False
349
350 openmp: Enable OpenMP backend (yes|no)
351 default: False
352 actual: False
353
354 cppthreads: Enable C++11 threads backend (yes|no)
355 default: True
356 actual: True
357
358 build_dir: Specify sub-folder for the build ( /path/to/build_dir )
359 default: .
360 actual: .
361
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100362 extra_cxx_flags: Extra CXX flags to be appended to the build command
363 default:
364 actual:
365
Anthony Barbier79c61782017-06-23 11:48:24 +0100366 pmu: Enable PMU counters (yes|no)
367 default: False
368 actual: False
369
Anthony Barbier6a5627a2017-09-26 14:42:02 +0100370 mali: Enable Mali hardware counters (yes|no)
371 default: False
372 actual: False
373
Anthony Barbier79c61782017-06-23 11:48:24 +0100374 validation_tests: Build validation test programs (yes|no)
375 default: False
376 actual: False
377
378 benchmark_tests: Build benchmark test programs (yes|no)
379 default: False
380 actual: False
381
382@b debug / @b asserts:
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100383 - With debug=1 asserts are enabled, and the library is built with symbols and no optimisations enabled.
384 - 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)
385 - 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).
386
Anthony Barbier79c61782017-06-23 11:48:24 +0100387@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 +0100388
Anthony Barbier79c61782017-06-23 11:48:24 +0100389@b os: Choose the operating system you are targeting: Linux, Android or bare metal.
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100390@note bare metal can only be used for NEON (not OpenCL), only static libraries get built and NEON's multi-threading support is disabled.
391
Anthony Barbier79c61782017-06-23 11:48:24 +0100392@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 +0100393
Anthony Barbier79c61782017-06-23 11:48:24 +0100394@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 +0100395
Anthony Barbier79c61782017-06-23 11:48:24 +0100396@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 +0100397
Anthony Barbier79c61782017-06-23 11:48:24 +0100398@b opencl / @b neon: Choose which SIMD technology you want to target. (NEON for ARM Cortex-A CPUs or OpenCL for ARM Mali GPUs)
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100399
Anthony Barbier79c61782017-06-23 11:48:24 +0100400@b embed_kernels: For OpenCL only: set embed_kernels=1 if you want the OpenCL kernels to be built in the library's binaries instead of being read from separate ".cl" files. If embed_kernels is set to 0 then the application can set the path to the folder containing the OpenCL kernel files by calling CLKernelLibrary::init(). By default the path is set to "./cl_kernels".
401
402@b set_soname: Do you want to build the versioned version of the library ?
403
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100404If enabled the library will contain a SONAME and SHLIBVERSION and some symlinks will automatically be created between the objects.
405Example:
406 libarm_compute_core.so -> libarm_compute_core.so.1.0.0
407 libarm_compute_core.so.1 -> libarm_compute_core.so.1.0.0
408 libarm_compute_core.so.1.0.0
409
410@note This options is disabled by default as it requires SCons version 2.4 or above.
411
Anthony Barbier79c61782017-06-23 11:48:24 +0100412@b extra_cxx_flags: Custom CXX flags which will be appended to the end of the build command.
413
414@b build_dir: Build the library in a subfolder of the "build" folder. (Allows to build several configurations in parallel).
415
416@b examples: Build or not the examples
417
418@b validation_tests: Enable the build of the validation suite.
419
Anthony Barbier79c61782017-06-23 11:48:24 +0100420@b benchmark_tests: Enable the build of the benchmark tests
421
422@b pmu: Enable the PMU cycle counter to measure execution time in benchmark tests. (Your device needs to support it)
423
Anthony Barbier6a5627a2017-09-26 14:42:02 +0100424@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)
425
Anthony Barbier79c61782017-06-23 11:48:24 +0100426@b openmp Build in the OpenMP scheduler for NEON.
427
428@note Only works when building with g++ not clang++
429
430@b cppthreads Build in the C++11 scheduler for NEON.
431
432@sa arm_compute::Scheduler::set
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100433
Moritz Pflanzer07674de2017-07-21 09:39:36 +0100434@subsection S3_2_linux Building for Linux
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100435
436@subsubsection S3_2_1_library How to build the library ?
437
438For Linux, the library was successfully built and tested using the following Linaro GCC toolchain:
439
440 - gcc-linaro-arm-linux-gnueabihf-4.9-2014.07_linux
441 - gcc-linaro-4.9-2016.02-x86_64_aarch64-linux-gnu
442 - gcc-linaro-6.3.1-2017.02-i686_aarch64-linux-gnu
443
444@note If you are building with opencl=1 then scons will expect to find libOpenCL.so either in the current directory or in "build" (See the section below if you need a stub OpenCL library to link against)
445
446To cross-compile the library in debug mode, with NEON only support, for Linux 32bit:
447
448 scons Werror=1 -j8 debug=1 neon=1 opencl=0 os=linux arch=armv7a
449
450To cross-compile the library in asserts mode, with OpenCL only support, for Linux 64bit:
451
452 scons Werror=1 -j8 debug=0 asserts=1 neon=0 opencl=1 embed_kernels=1 os=linux arch=arm64-v8a
453
454You can also compile the library natively on an ARM device by using <b>build=native</b>:
455
456 scons Werror=1 -j8 debug=0 neon=1 opencl=0 os=linux arch=arm64-v8a build=native
457 scons Werror=1 -j8 debug=0 neon=1 opencl=0 os=linux arch=armv7a build=native
458
459@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.
460
461For example on a 64bit Debian based system you would have to install <b>g++-arm-linux-gnueabihf</b>
462
463 apt-get install g++-arm-linux-gnueabihf
464
465Then run
466
467 scons Werror=1 -j8 debug=0 neon=1 opencl=0 os=linux arch=armv7a build=cross_compile
468
469or simply remove the build parameter as build=cross_compile is the default value:
470
471 scons Werror=1 -j8 debug=0 neon=1 opencl=0 os=linux arch=armv7a
472
473@attention To cross compile with opencl=1 you need to make sure to have a version of libOpenCL matching your target architecture.
474
475@subsubsection S3_2_2_examples How to manually build the examples ?
476
477The 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.
478
479@note The following command lines assume the arm_compute and libOpenCL 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.
480
481To cross compile a NEON example for Linux 32bit:
482
Anthony Barbierb2881fc2017-09-29 17:12:12 +0100483 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 +0100484
485To cross compile a NEON example for Linux 64bit:
486
Anthony Barbierb2881fc2017-09-29 17:12:12 +0100487 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 +0100488
489(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)
490
491To cross compile an OpenCL example for Linux 32bit:
492
Anthony Barbierb2881fc2017-09-29 17:12:12 +0100493 arm-linux-gnueabihf-g++ examples/cl_convolution.cpp utils/Utils.cpp -I. -Iinclude -std=c++11 -mfpu=neon -L. -larm_compute -larm_compute_core -lOpenCL -o cl_convolution -DARM_COMPUTE_CL
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100494
495To cross compile an OpenCL example for Linux 64bit:
496
Anthony Barbierb2881fc2017-09-29 17:12:12 +0100497 aarch64-linux-gnu-g++ examples/cl_convolution.cpp utils/Utils.cpp -I. -Iinclude -std=c++11 -L. -larm_compute -larm_compute_core -lOpenCL -o cl_convolution -DARM_COMPUTE_CL
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100498
499(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)
500
Gian Marco Iodicedaec1aa2017-09-29 12:03:18 +0100501To cross compile the examples with the Graph API, such as graph_lenet.cpp, you need to link the library arm_compute_graph.so also.
502(notice the compute library has to be built with both neon and opencl enabled - neon=1 and opencl=1)
503
504i.e. to cross compile the "graph_lenet" example for Linux 32bit:
505
Anthony Barbierb2881fc2017-09-29 17:12:12 +0100506 arm-linux-gnueabihf-g++ examples/graph_lenet.cpp utils/Utils.cpp -I. -Iinclude -std=c++11 -mfpu=neon -L. -larm_compute_graph -larm_compute -larm_compute_core -lOpenCL -o graph_lenet -DARM_COMPUTE_CL
Gian Marco Iodicedaec1aa2017-09-29 12:03:18 +0100507
508i.e. to cross compile the "graph_lenet" example for Linux 64bit:
509
Anthony Barbierb2881fc2017-09-29 17:12:12 +0100510 aarch64-linux-gnu-g++ examples/graph_lenet.cpp utils/Utils.cpp -I. -Iinclude -std=c++11 -L. -larm_compute_graph -larm_compute -larm_compute_core -lOpenCL -o graph_lenet -DARM_COMPUTE_CL
Gian Marco Iodicedaec1aa2017-09-29 12:03:18 +0100511
512(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)
513
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100514To compile natively (i.e directly on an ARM device) for NEON for Linux 32bit:
515
Anthony Barbierb2881fc2017-09-29 17:12:12 +0100516 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 +0100517
518To compile natively (i.e directly on an ARM device) for NEON for Linux 64bit:
519
Anthony Barbierb2881fc2017-09-29 17:12:12 +0100520 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 +0100521
522(notice the only difference with the 32 bit command is that we don't need the -mfpu option)
523
524To compile natively (i.e directly on an ARM device) for OpenCL for Linux 32bit or Linux 64bit:
525
Anthony Barbierb2881fc2017-09-29 17:12:12 +0100526 g++ examples/cl_convolution.cpp utils/Utils.cpp -I. -Iinclude -std=c++11 -larm_compute -larm_compute_core -lOpenCL -o cl_convolution -DARM_COMPUTE_CL
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100527
Gian Marco Iodicedaec1aa2017-09-29 12:03:18 +0100528To compile natively (i.e directly on an ARM device) the examples with the Graph API, such as graph_lenet.cpp, you need to link the library arm_compute_graph.so also.
529(notice the compute library has to be built with both neon and opencl enabled - neon=1 and opencl=1)
530
531i.e. to cross compile the "graph_lenet" example for Linux 32bit:
532
Anthony Barbierb2881fc2017-09-29 17:12:12 +0100533 g++ examples/graph_lenet.cpp utils/Utils.cpp -I. -Iinclude -std=c++11 -mfpu=neon -L. -larm_compute_graph -larm_compute -larm_compute_core -lOpenCL -o graph_lenet -DARM_COMPUTE_CL
Gian Marco Iodicedaec1aa2017-09-29 12:03:18 +0100534
535i.e. to cross compile the "graph_lenet" example for Linux 64bit:
536
Anthony Barbierb2881fc2017-09-29 17:12:12 +0100537 g++ examples/graph_lenet.cpp utils/Utils.cpp -I. -Iinclude -std=c++11 L. -larm_compute_graph -larm_compute -larm_compute_core -lOpenCL -o graph_lenet -DARM_COMPUTE_CL
Gian Marco Iodicedaec1aa2017-09-29 12:03:18 +0100538
539(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 +0100540
541@note These two commands assume libarm_compute.so is available in your library path, if not add the path to it using -L
542
543To run the built executable simply run:
544
545 LD_LIBRARY_PATH=build ./neon_convolution
546
547or
548
549 LD_LIBRARY_PATH=build ./cl_convolution
550
551@note If you built the library with support for both OpenCL and NEON you will need to link against OpenCL even if your application only uses NEON.
552
Moritz Pflanzer07674de2017-07-21 09:39:36 +0100553@subsection S3_3_android Building for Android
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100554
555For Android, the library was successfully built and tested using Google's standalone toolchains:
556 - arm-linux-androideabi-4.9 for armv7a (clang++)
557 - aarch64-linux-android-4.9 for arm64-v8a (g++)
558
559Here is a guide to <a href="https://developer.android.com/ndk/guides/standalone_toolchain.html">create your Android standalone toolchains from the NDK</a>
560
561- Download the NDK r14 from here: https://developer.android.com/ndk/downloads/index.html
562- Make sure you have Python 2 installed on your machine.
563- Generate the 32 and/or 64 toolchains by running the following commands:
564
565
566 $NDK/build/tools/make_standalone_toolchain.py --arch arm64 --install-dir $MY_TOOLCHAINS/aarch64-linux-android-4.9 --stl gnustl
567 $NDK/build/tools/make_standalone_toolchain.py --arch arm --install-dir $MY_TOOLCHAINS/arm-linux-androideabi-4.9 --stl gnustl
568
569@attention Due to some NDK issues make sure you use g++ & gnustl for aarch64 and clang++ & gnustl for armv7
570
571@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
572
573@subsubsection S3_3_1_library How to build the library ?
574
575@note If you are building with opencl=1 then scons will expect to find libOpenCL.so either in the current directory or in "build" (See the section below if you need a stub OpenCL library to link against)
576
577To cross-compile the library in debug mode, with NEON only support, for Android 32bit:
578
579 CXX=clang++ CC=clang scons Werror=1 -j8 debug=1 neon=1 opencl=0 os=android arch=armv7a
580
581To cross-compile the library in asserts mode, with OpenCL only support, for Android 64bit:
582
583 scons Werror=1 -j8 debug=0 asserts=1 neon=0 opencl=1 embed_kernels=1 os=android arch=arm64-v8a
584
585@subsubsection S3_3_2_examples How to manually build the examples ?
586
587The 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.
588
Anthony Barbierfabb0382017-06-23 14:42:52 +0100589@note The following command lines assume the arm_compute and libOpenCL 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 +0100590
591Once you've got your Android standalone toolchain built and added to your path you can do the following:
592
593To cross compile a NEON example:
594
595 #32 bit:
Anthony Barbierb2881fc2017-09-29 17:12:12 +0100596 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 +0100597 #64 bit:
Anthony Barbierb2881fc2017-09-29 17:12:12 +0100598 aarch64-linux-android-g++ 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 +0100599
600To cross compile an OpenCL example:
601
602 #32 bit:
Anthony Barbierb2881fc2017-09-29 17:12:12 +0100603 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 -lOpenCL -DARM_COMPUTE_CL
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100604 #64 bit:
Anthony Barbierb2881fc2017-09-29 17:12:12 +0100605 aarch64-linux-android-g++ 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 -lOpenCL -DARM_COMPUTE_CL
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100606
Gian Marco Iodicedaec1aa2017-09-29 12:03:18 +0100607To cross compile the examples with the Graph API, such as graph_lenet.cpp, you need to link the library arm_compute_graph also.
608(notice the compute library has to be built with both neon and opencl enabled - neon=1 and opencl=1)
609
610 #32 bit:
Anthony Barbierb2881fc2017-09-29 17:12:12 +0100611 arm-linux-androideabi-clang++ examples/graph_lenet.cpp utils/Utils.cpp -I. -Iinclude -std=c++11 -larm_compute_graph-static -larm_compute-static -larm_compute_core-static -L. -o graph_lenet_arm -static-libstdc++ -pie -lOpenCL -DARM_COMPUTE_CL
Gian Marco Iodicedaec1aa2017-09-29 12:03:18 +0100612 #64 bit:
Anthony Barbierb2881fc2017-09-29 17:12:12 +0100613 aarch64-linux-android-g++ examples/graph_lenet.cpp utils/Utils.cpp -I. -Iinclude -std=c++11 -larm_compute_graph-static -larm_compute-static -larm_compute_core-static -L. -o graph_lenet_aarch64 -static-libstdc++ -pie -lOpenCL -DARM_COMPUTE_CL
Gian Marco Iodicedaec1aa2017-09-29 12:03:18 +0100614
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100615@note Due to some issues in older versions of the Mali OpenCL DDK (<= r13p0), we recommend to link arm_compute statically on Android.
616
617Then you need to do is upload the executable and the shared library to the device using ADB:
618
619 adb push neon_convolution_arm /data/local/tmp/
620 adb push cl_convolution_arm /data/local/tmp/
621 adb shell chmod 777 -R /data/local/tmp/
622
623And finally to run the example:
624
625 adb shell /data/local/tmp/neon_convolution_arm
626 adb shell /data/local/tmp/cl_convolution_arm
627
628For 64bit:
629
630 adb push neon_convolution_aarch64 /data/local/tmp/
631 adb push cl_convolution_aarch64 /data/local/tmp/
632 adb shell chmod 777 -R /data/local/tmp/
633
634And finally to run the example:
635
636 adb shell /data/local/tmp/neon_convolution_aarch64
637 adb shell /data/local/tmp/cl_convolution_aarch64
638
Michalis Spyrou6e52ba32017-10-04 15:40:38 +0100639@subsection S3_4_bare_metal Building for bare metal
640
641For bare metal, the library was successfully built using linaros's latest (gcc-linaro-6.3.1-2017.05) bare metal toolchains:
642 - arm-eabi for armv7a
643 - aarch64-elf for arm64-v8a
644
645Download 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>.
646
647@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
648
649@subsubsection S3_4_1_library How to build the library ?
650
651To cross-compile the library with NEON support for baremetal arm64-v8a:
652
653 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
654
655@subsubsection S3_4_2_examples How to manually build the examples ?
656
657Examples 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>.
658
659@subsection S3_5_windows_host Building on a Windows host system
Moritz Pflanzer07674de2017-07-21 09:39:36 +0100660
661Using `scons` directly from the Windows command line is known to cause
662problems. The reason seems to be that if `scons` is setup for cross-compilation
663it gets confused about Windows style paths (using backslashes). Thus it is
664recommended to follow one of the options outlined below.
665
Michalis Spyrou6e52ba32017-10-04 15:40:38 +0100666@subsubsection S3_5_1_ubuntu_on_windows Bash on Ubuntu on Windows
Moritz Pflanzer07674de2017-07-21 09:39:36 +0100667
668The best and easiest option is to use
669<a href="https://msdn.microsoft.com/en-gb/commandline/wsl/about">Ubuntu on Windows</a>.
670This feature is still marked as *beta* and thus might not be available.
671However, if it is building the library is as simple as opening a *Bash on
672Ubuntu on Windows* shell and following the general guidelines given above.
673
Michalis Spyrou6e52ba32017-10-04 15:40:38 +0100674@subsubsection S3_5_2_cygwin Cygwin
Moritz Pflanzer07674de2017-07-21 09:39:36 +0100675
676If the Windows subsystem for Linux is not available <a href="https://www.cygwin.com/">Cygwin</a>
677can be used to install and run `scons`. In addition to the default packages
678installed by Cygwin `scons` has to be selected in the installer. (`git` might
679also be useful but is not strictly required if you already have got the source
680code of the library.) Linaro provides pre-built versions of
681<a href="http://releases.linaro.org/components/toolchain/binaries/">GCC cross-compilers</a>
682that can be used from the Cygwin terminal. When building for Android the
683compiler is included in the Android standalone toolchain. After everything has
684been set up in the Cygwin terminal the general guide on building the library
685can be followed.
686
Michalis Spyrou6e52ba32017-10-04 15:40:38 +0100687@subsection S3_6_cl_stub_library The OpenCL stub library
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100688
689In 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.
690
691If 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.
692
693@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.
694
695To cross-compile the stub OpenCL library simply run:
696
697 <target-prefix>-gcc -o libOpenCL.so -Iinclude opencl-1.2-stubs/opencl_stubs.c -fPIC -shared
698
699For example:
700
701 <target-prefix>-gcc -o libOpenCL.so -Iinclude opencl-1.2-stubs/opencl_stubs.c -fPIC -shared
702 #Linux 32bit
703 arm-linux-gnueabihf-gcc -o libOpenCL.so -Iinclude opencl-1.2-stubs/opencl_stubs.c -fPIC -shared
704 #Linux 64bit
705 aarch64-linux-gnu-gcc -o libOpenCL.so -Iinclude -shared opencl-1.2-stubs/opencl_stubs.c -fPIC
706 #Android 32bit
707 arm-linux-androideabi-clang -o libOpenCL.so -Iinclude -shared opencl-1.2-stubs/opencl_stubs.c -fPIC -shared
708 #Android 64bit
709 aarch64-linux-android-gcc -o libOpenCL.so -Iinclude -shared opencl-1.2-stubs/opencl_stubs.c -fPIC -shared
710*/