blob: a831d114c047245113102e81033b85020298ca50 [file] [log] [blame]
Anthony Barbier871448e2017-03-24 14:54:29 +00001<!-- HTML header for doxygen 1.8.9.1-->
2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3<html xmlns="http://www.w3.org/1999/xhtml">
4<head>
5<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
6<meta http-equiv="X-UA-Compatible" content="IE=9"/>
7<meta name="generator" content="Doxygen 1.8.11"/>
8<meta name="robots" content="NOINDEX, NOFOLLOW" /> <!-- Prevent indexing by search engines -->
Anthony Barbierdbdab852017-06-23 15:42:00 +01009<title>Compute Library: Introduction</title>
Anthony Barbier871448e2017-03-24 14:54:29 +000010<link href="tabs.css" rel="stylesheet" type="text/css"/>
11<script type="text/javascript" src="jquery.js"></script>
12<script type="text/javascript" src="dynsections.js"></script>
13<link href="navtree.css" rel="stylesheet" type="text/css"/>
14<script type="text/javascript" src="resize.js"></script>
15<script type="text/javascript" src="navtreedata.js"></script>
16<script type="text/javascript" src="navtree.js"></script>
17<script type="text/javascript">
18 $(document).ready(initResizable);
19 $(window).load(resizeHeight);
20</script>
21<link href="search/search.css" rel="stylesheet" type="text/css"/>
22<script type="text/javascript" src="search/searchdata.js"></script>
23<script type="text/javascript" src="search/search.js"></script>
24<script type="text/javascript">
25 $(document).ready(function() { init_search(); });
26</script>
27<script type="text/x-mathjax-config">
28 MathJax.Hub.Config({
29 extensions: ["tex2jax.js"],
30 jax: ["input/TeX","output/HTML-CSS"],
31});
32</script><script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js"></script>
33<link href="doxygen.css" rel="stylesheet" type="text/css" />
34</head>
35<body>
36<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
37<div id="titlearea">
38<table cellspacing="0" cellpadding="0">
39 <tbody>
40 <tr style="height: 56px;">
41 <td style="padding-left: 0.5em;">
Anthony Barbierdbdab852017-06-23 15:42:00 +010042 <div id="projectname">Compute Library
43 &#160;<span id="projectnumber">v17.06</span>
Anthony Barbier871448e2017-03-24 14:54:29 +000044 </div>
45 </td>
46 </tr>
47 </tbody>
48</table>
49</div>
50<!-- end header part -->
51<!-- Generated by Doxygen 1.8.11 -->
52<script type="text/javascript">
53var searchBox = new SearchBox("searchBox", "search",false,'Search');
54</script>
55 <div id="navrow1" class="tabs">
56 <ul class="tablist">
57 <li class="current"><a href="index.xhtml"><span>Main&#160;Page</span></a></li>
Anthony Barbierdbdab852017-06-23 15:42:00 +010058 <li><a href="pages.xhtml"><span>Related&#160;Pages</span></a></li>
Anthony Barbier871448e2017-03-24 14:54:29 +000059 <li><a href="namespaces.xhtml"><span>Namespaces</span></a></li>
60 <li><a href="annotated.xhtml"><span>Data&#160;Structures</span></a></li>
61 <li><a href="files.xhtml"><span>Files</span></a></li>
62 <li>
63 <div id="MSearchBox" class="MSearchBoxInactive">
64 <span class="left">
65 <img id="MSearchSelect" src="search/mag_sel.png"
66 onmouseover="return searchBox.OnSearchSelectShow()"
67 onmouseout="return searchBox.OnSearchSelectHide()"
68 alt=""/>
69 <input type="text" id="MSearchField" value="Search" accesskey="S"
70 onfocus="searchBox.OnSearchFieldFocus(true)"
71 onblur="searchBox.OnSearchFieldFocus(false)"
72 onkeyup="searchBox.OnSearchFieldChange(event)"/>
73 </span><span class="right">
74 <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
75 </span>
76 </div>
77 </li>
78 </ul>
79 </div>
80</div><!-- top -->
81<div id="side-nav" class="ui-resizable side-nav-resizable">
82 <div id="nav-tree">
83 <div id="nav-tree-contents">
84 <div id="nav-sync" class="sync"></div>
85 </div>
86 </div>
87 <div id="splitbar" style="-moz-user-select:none;"
88 class="ui-resizable-handle">
89 </div>
90</div>
91<script type="text/javascript">
92$(document).ready(function(){initNavTree('index.xhtml','');});
93</script>
94<div id="doc-content">
95<!-- window showing the filter options -->
96<div id="MSearchSelectWindow"
97 onmouseover="return searchBox.OnSearchSelectShow()"
98 onmouseout="return searchBox.OnSearchSelectHide()"
99 onkeydown="return searchBox.OnSearchSelectKey(event)">
100</div>
101
102<!-- iframe showing the search results (closed by default) -->
103<div id="MSearchResultsWindow">
104<iframe src="javascript:void(0)" frameborder="0"
105 name="MSearchResults" id="MSearchResults">
106</iframe>
107</div>
108
109<div class="header">
110 <div class="headertitle">
Anthony Barbierdbdab852017-06-23 15:42:00 +0100111<div class="title">Introduction </div> </div>
Anthony Barbier871448e2017-03-24 14:54:29 +0000112</div><!--header-->
113<div class="contents">
114<div class="toc"><h3>Table of Contents</h3>
Anthony Barbierdbdab852017-06-23 15:42:00 +0100115<ul><li class="level1"><a href="#S0_1_contact">Contact / Support</a></li>
Anthony Barbier871448e2017-03-24 14:54:29 +0000116<li class="level1"><a href="#S1_file_organisation">File organisation</a></li>
Anthony Barbiera4376382017-04-12 15:12:46 +0100117<li class="level1"><a href="#S2_versions_changelog">Release versions and changelog</a><ul><li class="level2"><a href="#S2_1_versions">Release versions</a></li>
118<li class="level2"><a href="#S2_2_changelog">Changelog</a></li>
119</ul>
120</li>
Anthony Barbier871448e2017-03-24 14:54:29 +0000121<li class="level1"><a href="#S3_how_to_build">How to build the library and the examples</a><ul><li class="level2"><a href="#S3_1_build_options">Build options</a></li>
122<li class="level2"><a href="#S3_2_linux">Linux</a><ul><li class="level3"><a href="#S3_2_1_library">How to build the library ?</a></li>
123<li class="level3"><a href="#S3_2_2_examples">How to manually build the examples ?</a></li>
124</ul>
125</li>
126<li class="level2"><a href="#S3_3_android">Android</a><ul><li class="level3"><a href="#S3_3_1_library">How to build the library ?</a></li>
127<li class="level3"><a href="#S3_3_2_examples">How to manually build the examples ?</a></li>
128</ul>
129</li>
130<li class="level2"><a href="#S3_4_cl_stub_library">The OpenCL stub library</a></li>
131</ul>
132</li>
Anthony Barbier871448e2017-03-24 14:54:29 +0000133</ul>
134</div>
Anthony Barbierdbdab852017-06-23 15:42:00 +0100135<div class="textblock"><p>The Computer Vision and Machine Learning library is a set of functions optimised for both ARM CPUs and GPUs using SIMD technologies.Several builds of the library are available using various configurations:</p><ul>
Anthony Barbier871448e2017-03-24 14:54:29 +0000136<li>OS: Linux, Android or bare metal.</li>
137<li>Architecture: armv7a (32bit) or arm64-v8a (64bit)</li>
138<li>Technology: NEON / OpenCL / NEON and OpenCL</li>
139<li>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.</li>
140</ul>
Anthony Barbierdbdab852017-06-23 15:42:00 +0100141<h1><a class="anchor" id="S0_1_contact"></a>
142Contact / Support</h1>
Anthony Barbier871448e2017-03-24 14:54:29 +0000143<p>Please email <a href="#" onclick="location.href='mai'+'lto:'+'dev'+'el'+'ope'+'r@'+'arm'+'.c'+'om'; return false;">devel<span style="display: none;">.nosp@m.</span>oper<span style="display: none;">.nosp@m.</span>@arm.<span style="display: none;">.nosp@m.</span>com</a></p>
144<p>In 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: </p><pre class="fragment">$ strings android-armv7a-cl-asserts/libarm_compute.so | grep arm_compute_version
145arm_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
146</pre><h1><a class="anchor" id="S1_file_organisation"></a>
147File organisation</h1>
148<p>This archive contains:</p><ul>
149<li>The <a class="el" href="namespacearm__compute.xhtml">arm_compute</a> header and source files</li>
150<li>The latest Khronos OpenCL 1.2 C headers from the <a href="https://www.khronos.org/registry/cl/">Khronos OpenCL registry</a></li>
151<li>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)</li>
152<li>The sources for a stub version of libOpenCL.so to help you build your application.</li>
153<li>An examples folder containing a few examples to compile and link against the library.</li>
Anthony Barbierdbdab852017-06-23 15:42:00 +0100154<li>A <a class="el" href="dir_cbdb8362360e11eafe2fa3bc74cf0ffd.xhtml">utils</a> folder containing headers with some boiler plate code used by the examples.</li>
Anthony Barbier871448e2017-03-24 14:54:29 +0000155<li>This documentation.</li>
156</ul>
157<p>You should have the following file organisation: </p><pre class="fragment">.
158├── arm_compute --&gt; All the arm_compute headers
159│   ├── core
160│   │   ├── CL
161│   │   │   ├── CLKernels.h --&gt; Includes all the OpenCL kernels at once
162│   │   │   ├── CL specialisation of all the generic objects interfaces (ICLTensor, ICLImage, etc.)
163│   │   │   ├── kernels --&gt; Folder containing all the OpenCL kernels
164│   │   │   │   └── CL*Kernel.h
165│   │   │   └── OpenCL.h --&gt; Wrapper to configure the Khronos OpenCL C++ header
166│   │ ├── CPP
167│   │ │   └── kernels --&gt; Folder containing all the CPP kernels
168│   │   │   │   └── CPP*Kernel.h
169│   │   ├── NEON
170│   │   │   ├── kernels --&gt; Folder containing all the NEON kernels
171│   │   │   │   └── NE*Kernel.h
172│   │   │   └── NEKernels.h --&gt; Includes all the NEON kernels at once
173│   │   ├── All common basic types (Types.h, Window, Coordinates, Iterator, etc.)
174│   │   ├── All generic objects interfaces (ITensor, IImage, etc.)
175│   │   └── Objects metadata classes (ImageInfo, TensorInfo, MultiImageInfo)
176│   └── runtime
177│   ├── CL
178│   │   ├── CL objects &amp; allocators (CLArray, CLImage, CLTensor, etc.)
179│   │   ├── functions --&gt; Folder containing all the OpenCL functions
180│   │   │   └── CL*.h
181│   │   └── CLFunctions.h --&gt; Includes all the OpenCL functions at once
182│   ├── CPP
Anthony Barbierdbdab852017-06-23 15:42:00 +0100183│   │   └── Scheduler.h --&gt; Basic pool of threads to execute CPP/NEON code on several cores in parallel
Anthony Barbier871448e2017-03-24 14:54:29 +0000184│   ├── NEON
185│   │ ├── functions --&gt; Folder containing all the NEON functions
186│   │ │   └── NE*.h
187│   │ └── NEFunctions.h --&gt; Includes all the NEON functions at once
188│   └── Basic implementations of the generic object interfaces (Array, Image, Tensor, etc.)
189├── documentation
190│   ├── index.xhtml
191│   └── ...
192├── documentation.xhtml -&gt; documentation/index.xhtml
193├── examples
194│   ├── cl_convolution.cpp
195│   ├── neoncl_scale_median_gaussian.cpp
196│   ├── neon_convolution.cpp
197│   └── neon_scale.cpp
198├── include
199│   └── CL
200│   └── Khronos OpenCL C headers and C++ wrapper
201├── opencl-1.2-stubs
202│ └── opencl_stubs.c
203├── src
204│   ├── core
205│ │ └── ... (Same structure as headers)
206│   │ └── CL
207│   │ └── cl_kernels --&gt; All the OpenCL kernels
208│ └── runtime
209│ └── ... (Same structure as headers)
Anthony Barbierdbdab852017-06-23 15:42:00 +0100210├── tests
211│   ├── All test related files shared between validation and benchmark
212│   ├── CL --&gt; OpenCL specific files (shared)
213│   ├── NEON --&gt; NEON specific files (shared)
214│   ├── benchmark --&gt; Sources for benchmarking
215│ │ ├── Benchmark specific files
216│ │ ├── main.cpp --&gt; Entry point for benchmark test framework
217│ │ ├── CL --&gt; OpenCL benchmarking tests
218│ │ └── NEON --&gt; NEON benchmarking tests
219│   ├── validation --&gt; Sources for validation
220│ │ ├── Validation specific files
221│ │ ├── main.cpp --&gt; Entry point for validation test framework
222│ │ ├── CL --&gt; OpenCL validation tests
223│ │ ├── NEON --&gt; NEON validation tests
224│ │ └── UNIT --&gt; Library validation tests
225│   └── dataset --&gt; Datasets defining common sets of input parameters
226└── utils --&gt; Boiler plate code used by examples
Anthony Barbier871448e2017-03-24 14:54:29 +0000227 └── Utils.h
228</pre><h1><a class="anchor" id="S2_versions_changelog"></a>
Anthony Barbiera4376382017-04-12 15:12:46 +0100229Release versions and changelog</h1>
230<h2><a class="anchor" id="S2_1_versions"></a>
231Release versions</h2>
232<p>All releases are numbered vYY.MM Where YY are the last two digits of the year, and MM the month number. If there is more than one release in a month then an extra sequential number is appended at the end: </p><pre class="fragment">v17.03 (First release of March 2017)
233v17.03.1 (Second release of March 2017)
234v17.04 (First release of April 2017)
235</pre><dl class="section note"><dt>Note</dt><dd>We're aiming at releasing one major public release with new features per quarter. All releases in between will only contain bug fixes.</dd></dl>
236<h2><a class="anchor" id="S2_2_changelog"></a>
237Changelog</h2>
Anthony Barbierdbdab852017-06-23 15:42:00 +0100238<p>v17.06 Public major release</p><ul>
239<li>Various bug fixes</li>
240<li>Added support for fixed point 8 bit (QS8) to the various NEON machine learning kernels.</li>
241<li>Added unit tests and benchmarks (AlexNet, LeNet)</li>
242<li>Added support for sub tensors.</li>
243<li>Added infrastructure to provide GPU specific optimisation for some OpenCL kernels.</li>
244<li>Added <a class="el" href="classarm__compute_1_1_o_m_p_scheduler.xhtml">arm_compute::OMPScheduler</a> (OpenMP) scheduler for NEON</li>
245<li>Added <a class="el" href="classarm__compute_1_1_single_thread_scheduler.xhtml">arm_compute::SingleThreadScheduler</a> scheduler for NEON (For bare metal)</li>
246<li>User can specify his own scheduler by implementing the <a class="el" href="classarm__compute_1_1_i_scheduler.xhtml">arm_compute::IScheduler</a> interface.</li>
247<li>New OpenCL kernels / functions:<ul>
248<li><a class="el" href="classarm__compute_1_1_c_l_batch_normalization_layer_kernel.xhtml">arm_compute::CLBatchNormalizationLayerKernel</a> / <a class="el" href="classarm__compute_1_1_c_l_batch_normalization_layer.xhtml">arm_compute::CLBatchNormalizationLayer</a></li>
249<li><a class="el" href="classarm__compute_1_1_c_l_depth_concatenate_kernel.xhtml">arm_compute::CLDepthConcatenateKernel</a> / <a class="el" href="classarm__compute_1_1_c_l_depth_concatenate.xhtml">arm_compute::CLDepthConcatenate</a></li>
250<li><a class="el" href="classarm__compute_1_1_c_l_h_o_g_orientation_binning_kernel.xhtml">arm_compute::CLHOGOrientationBinningKernel</a> <a class="el" href="classarm__compute_1_1_c_l_h_o_g_block_normalization_kernel.xhtml">arm_compute::CLHOGBlockNormalizationKernel</a>, <a class="el" href="classarm__compute_1_1_c_l_h_o_g_detector_kernel.xhtml">arm_compute::CLHOGDetectorKernel</a> / <a class="el" href="classarm__compute_1_1_c_l_h_o_g_descriptor.xhtml">arm_compute::CLHOGDescriptor</a> <a class="el" href="classarm__compute_1_1_c_l_h_o_g_detector.xhtml">arm_compute::CLHOGDetector</a> <a class="el" href="classarm__compute_1_1_c_l_h_o_g_gradient.xhtml">arm_compute::CLHOGGradient</a> <a class="el" href="classarm__compute_1_1_c_l_h_o_g_multi_detection.xhtml">arm_compute::CLHOGMultiDetection</a></li>
251<li><a class="el" href="classarm__compute_1_1_c_l_locally_connected_matrix_multiply_kernel.xhtml">arm_compute::CLLocallyConnectedMatrixMultiplyKernel</a> / <a class="el" href="classarm__compute_1_1_c_l_locally_connected_layer.xhtml">arm_compute::CLLocallyConnectedLayer</a></li>
252<li><a class="el" href="classarm__compute_1_1_c_l_weights_reshape_kernel.xhtml">arm_compute::CLWeightsReshapeKernel</a> / <a class="el" href="classarm__compute_1_1_c_l_convolution_layer_reshape_weights.xhtml">arm_compute::CLConvolutionLayerReshapeWeights</a></li>
253</ul>
254</li>
255<li>New C++ kernels:<ul>
256<li><a class="el" href="classarm__compute_1_1_c_p_p_detection_window_non_maxima_suppression_kernel.xhtml">arm_compute::CPPDetectionWindowNonMaximaSuppressionKernel</a></li>
257</ul>
258</li>
259<li>New NEON kernels / functions:<ul>
260<li><a class="el" href="classarm__compute_1_1_n_e_batch_normalization_layer_kernel.xhtml">arm_compute::NEBatchNormalizationLayerKernel</a> / <a class="el" href="classarm__compute_1_1_n_e_batch_normalization_layer.xhtml">arm_compute::NEBatchNormalizationLayer</a></li>
261<li><a class="el" href="classarm__compute_1_1_n_e_depth_concatenate_kernel.xhtml">arm_compute::NEDepthConcatenateKernel</a> / <a class="el" href="classarm__compute_1_1_n_e_depth_concatenate.xhtml">arm_compute::NEDepthConcatenate</a></li>
262<li><a class="el" href="classarm__compute_1_1_n_e_direct_convolution_layer_kernel.xhtml">arm_compute::NEDirectConvolutionLayerKernel</a> / <a class="el" href="classarm__compute_1_1_n_e_direct_convolution_layer.xhtml">arm_compute::NEDirectConvolutionLayer</a></li>
263<li><a class="el" href="classarm__compute_1_1_n_e_locally_connected_matrix_multiply_kernel.xhtml">arm_compute::NELocallyConnectedMatrixMultiplyKernel</a> / <a class="el" href="classarm__compute_1_1_n_e_locally_connected_layer.xhtml">arm_compute::NELocallyConnectedLayer</a></li>
264<li><a class="el" href="classarm__compute_1_1_n_e_weights_reshape_kernel.xhtml">arm_compute::NEWeightsReshapeKernel</a> / <a class="el" href="classarm__compute_1_1_n_e_convolution_layer_reshape_weights.xhtml">arm_compute::NEConvolutionLayerReshapeWeights</a></li>
265</ul>
266</li>
267</ul>
Anthony Barbier46d59272017-05-04 09:15:15 +0100268<p>v17.05 Public bug fixes release</p><ul>
269<li>Various bug fixes</li>
270<li>Remaining of the functions ported to use accurate padding.</li>
271<li>Library does not link against OpenCL anymore (It uses dlopen / dlsym at runtime instead to determine whether or not OpenCL is available).</li>
272<li>Added "free" method to allocator.</li>
Anthony Barbierdbdab852017-06-23 15:42:00 +0100273<li>Minimum version of g++ required for armv7 Linux changed from 4.8 to 4.9</li>
Anthony Barbier46d59272017-05-04 09:15:15 +0100274</ul>
Anthony Barbierdbdab852017-06-23 15:42:00 +0100275<p>v17.04 Public bug fixes release</p>
276<p>The following functions have been ported to use the new accurate padding:</p><ul>
277<li><a class="el" href="classarm__compute_1_1_c_l_color_convert_kernel.xhtml">arm_compute::CLColorConvertKernel</a></li>
278<li><a class="el" href="classarm__compute_1_1_c_l_edge_non_max_suppression_kernel.xhtml">arm_compute::CLEdgeNonMaxSuppressionKernel</a></li>
279<li><a class="el" href="classarm__compute_1_1_c_l_edge_trace_kernel.xhtml">arm_compute::CLEdgeTraceKernel</a></li>
280<li><a class="el" href="classarm__compute_1_1_c_l_gaussian_pyramid_hor_kernel.xhtml">arm_compute::CLGaussianPyramidHorKernel</a></li>
281<li><a class="el" href="classarm__compute_1_1_c_l_gaussian_pyramid_vert_kernel.xhtml">arm_compute::CLGaussianPyramidVertKernel</a></li>
282<li><a class="el" href="classarm__compute_1_1_c_l_gradient_kernel.xhtml">arm_compute::CLGradientKernel</a></li>
283<li><a class="el" href="classarm__compute_1_1_n_e_channel_combine_kernel.xhtml">arm_compute::NEChannelCombineKernel</a></li>
284<li><a class="el" href="classarm__compute_1_1_n_e_fill_array_kernel.xhtml">arm_compute::NEFillArrayKernel</a></li>
285<li><a class="el" href="classarm__compute_1_1_n_e_gaussian_pyramid_hor_kernel.xhtml">arm_compute::NEGaussianPyramidHorKernel</a></li>
286<li><a class="el" href="classarm__compute_1_1_n_e_gaussian_pyramid_vert_kernel.xhtml">arm_compute::NEGaussianPyramidVertKernel</a></li>
287<li><a class="el" href="classarm__compute_1_1_n_e_harris_score_f_p16_kernel.xhtml">arm_compute::NEHarrisScoreFP16Kernel</a></li>
288<li><a class="el" href="classarm__compute_1_1_n_e_harris_score_kernel.xhtml">arm_compute::NEHarrisScoreKernel</a></li>
289<li><a class="el" href="classarm__compute_1_1_n_e_h_o_g_detector_kernel.xhtml">arm_compute::NEHOGDetectorKernel</a></li>
290<li><a class="el" href="classarm__compute_1_1_n_e_logits1_d_max_kernel.xhtml">arm_compute::NELogits1DMaxKernel</a></li>
291<li><a class="el" href="classarm__compute_1_1_n_e_logits1_d_shift_exp_sum_kernel.xhtml">arm_compute::NELogits1DShiftExpSumKernel</a></li>
292<li><a class="el" href="classarm__compute_1_1_n_e_logits1_d_norm_kernel.xhtml">arm_compute::NELogits1DNormKernel</a></li>
293<li><a class="el" href="classarm__compute_1_1_n_e_non_maxima_suppression3x3_f_p16_kernel.xhtml">arm_compute::NENonMaximaSuppression3x3FP16Kernel</a></li>
294<li><a class="el" href="classarm__compute_1_1_n_e_non_maxima_suppression3x3_kernel.xhtml">arm_compute::NENonMaximaSuppression3x3Kernel</a></li>
Anthony Barbier871448e2017-03-24 14:54:29 +0000295</ul>
Anthony Barbiera4376382017-04-12 15:12:46 +0100296<p>v17.03.1 First Major public release of the sources</p><ul>
Anthony Barbier871448e2017-03-24 14:54:29 +0000297<li>Renamed the library to <a class="el" href="namespacearm__compute.xhtml">arm_compute</a></li>
298<li>New CPP target introduced for C++ kernels shared between NEON and CL functions.</li>
299<li>New padding calculation interface introduced and ported most kernels / functions to use it.</li>
300<li>New OpenCL kernels / functions:<ul>
Anthony Barbierdbdab852017-06-23 15:42:00 +0100301<li><a class="el" href="classarm__compute_1_1_c_l_g_e_m_m_lowp_matrix_multiply_kernel.xhtml">arm_compute::CLGEMMLowpMatrixMultiplyKernel</a> / <a class="el" href="classarm__compute_1_1_c_l_g_e_m_m_lowp.xhtml">arm_compute::CLGEMMLowp</a></li>
Anthony Barbier871448e2017-03-24 14:54:29 +0000302</ul>
303</li>
304<li>New NEON kernels / functions:<ul>
Anthony Barbierdbdab852017-06-23 15:42:00 +0100305<li><a class="el" href="classarm__compute_1_1_n_e_normalization_layer_kernel.xhtml">arm_compute::NENormalizationLayerKernel</a> / <a class="el" href="classarm__compute_1_1_n_e_normalization_layer.xhtml">arm_compute::NENormalizationLayer</a></li>
306<li><a class="el" href="classarm__compute_1_1_n_e_transpose_kernel.xhtml">arm_compute::NETransposeKernel</a> / <a class="el" href="classarm__compute_1_1_n_e_transpose.xhtml">arm_compute::NETranspose</a></li>
307<li><a class="el" href="classarm__compute_1_1_n_e_logits1_d_max_kernel.xhtml">arm_compute::NELogits1DMaxKernel</a>, <a class="el" href="classarm__compute_1_1_n_e_logits1_d_shift_exp_sum_kernel.xhtml">arm_compute::NELogits1DShiftExpSumKernel</a>, <a class="el" href="classarm__compute_1_1_n_e_logits1_d_norm_kernel.xhtml">arm_compute::NELogits1DNormKernel</a> / <a class="el" href="classarm__compute_1_1_n_e_softmax_layer.xhtml">arm_compute::NESoftmaxLayer</a></li>
308<li><a class="el" href="classarm__compute_1_1_n_e_im2_col_kernel.xhtml">arm_compute::NEIm2ColKernel</a>, <a class="el" href="classarm__compute_1_1_n_e_col2_im_kernel.xhtml">arm_compute::NECol2ImKernel</a>, arm_compute::NEConvolutionLayerWeightsReshapeKernel / <a class="el" href="classarm__compute_1_1_n_e_convolution_layer.xhtml">arm_compute::NEConvolutionLayer</a></li>
309<li><a class="el" href="classarm__compute_1_1_n_e_g_e_m_m_matrix_accumulate_biases_kernel.xhtml">arm_compute::NEGEMMMatrixAccumulateBiasesKernel</a> / <a class="el" href="classarm__compute_1_1_n_e_fully_connected_layer.xhtml">arm_compute::NEFullyConnectedLayer</a></li>
310<li><a class="el" href="classarm__compute_1_1_n_e_g_e_m_m_lowp_matrix_multiply_kernel.xhtml">arm_compute::NEGEMMLowpMatrixMultiplyKernel</a> / <a class="el" href="classarm__compute_1_1_n_e_g_e_m_m_lowp.xhtml">arm_compute::NEGEMMLowp</a></li>
Anthony Barbier871448e2017-03-24 14:54:29 +0000311</ul>
312</li>
313</ul>
Anthony Barbiera4376382017-04-12 15:12:46 +0100314<p>v17.03 Sources preview</p><ul>
315<li>New OpenCL kernels / functions:<ul>
Anthony Barbierdbdab852017-06-23 15:42:00 +0100316<li><a class="el" href="classarm__compute_1_1_c_l_gradient_kernel.xhtml">arm_compute::CLGradientKernel</a>, <a class="el" href="classarm__compute_1_1_c_l_edge_non_max_suppression_kernel.xhtml">arm_compute::CLEdgeNonMaxSuppressionKernel</a>, <a class="el" href="classarm__compute_1_1_c_l_edge_trace_kernel.xhtml">arm_compute::CLEdgeTraceKernel</a> / <a class="el" href="classarm__compute_1_1_c_l_canny_edge.xhtml">arm_compute::CLCannyEdge</a></li>
317<li>GEMM refactoring + FP16 support: <a class="el" href="classarm__compute_1_1_c_l_g_e_m_m_interleave4x4_kernel.xhtml">arm_compute::CLGEMMInterleave4x4Kernel</a>, <a class="el" href="classarm__compute_1_1_c_l_g_e_m_m_transpose1x_w_kernel.xhtml">arm_compute::CLGEMMTranspose1xWKernel</a>, <a class="el" href="classarm__compute_1_1_c_l_g_e_m_m_matrix_multiply_kernel.xhtml">arm_compute::CLGEMMMatrixMultiplyKernel</a>, <a class="el" href="classarm__compute_1_1_c_l_g_e_m_m_matrix_addition_kernel.xhtml">arm_compute::CLGEMMMatrixAdditionKernel</a> / <a class="el" href="classarm__compute_1_1_c_l_g_e_m_m.xhtml">arm_compute::CLGEMM</a></li>
318<li><a class="el" href="classarm__compute_1_1_c_l_g_e_m_m_matrix_accumulate_biases_kernel.xhtml">arm_compute::CLGEMMMatrixAccumulateBiasesKernel</a> / <a class="el" href="classarm__compute_1_1_c_l_fully_connected_layer.xhtml">arm_compute::CLFullyConnectedLayer</a></li>
319<li><a class="el" href="classarm__compute_1_1_c_l_transpose_kernel.xhtml">arm_compute::CLTransposeKernel</a> / <a class="el" href="classarm__compute_1_1_c_l_transpose.xhtml">arm_compute::CLTranspose</a></li>
320<li><a class="el" href="classarm__compute_1_1_c_l_l_k_tracker_init_kernel.xhtml">arm_compute::CLLKTrackerInitKernel</a>, <a class="el" href="classarm__compute_1_1_c_l_l_k_tracker_stage0_kernel.xhtml">arm_compute::CLLKTrackerStage0Kernel</a>, <a class="el" href="classarm__compute_1_1_c_l_l_k_tracker_stage1_kernel.xhtml">arm_compute::CLLKTrackerStage1Kernel</a>, <a class="el" href="classarm__compute_1_1_c_l_l_k_tracker_finalize_kernel.xhtml">arm_compute::CLLKTrackerFinalizeKernel</a> / <a class="el" href="classarm__compute_1_1_c_l_optical_flow.xhtml">arm_compute::CLOpticalFlow</a></li>
321<li><a class="el" href="classarm__compute_1_1_c_l_normalization_layer_kernel.xhtml">arm_compute::CLNormalizationLayerKernel</a> / <a class="el" href="classarm__compute_1_1_c_l_normalization_layer.xhtml">arm_compute::CLNormalizationLayer</a></li>
322<li><a class="el" href="classarm__compute_1_1_c_l_laplacian_pyramid.xhtml">arm_compute::CLLaplacianPyramid</a>, <a class="el" href="classarm__compute_1_1_c_l_laplacian_reconstruct.xhtml">arm_compute::CLLaplacianReconstruct</a></li>
Anthony Barbiera4376382017-04-12 15:12:46 +0100323</ul>
324</li>
325<li>New NEON kernels / functions:<ul>
Anthony Barbierdbdab852017-06-23 15:42:00 +0100326<li><a class="el" href="classarm__compute_1_1_n_e_activation_layer_kernel.xhtml">arm_compute::NEActivationLayerKernel</a> / <a class="el" href="classarm__compute_1_1_n_e_activation_layer.xhtml">arm_compute::NEActivationLayer</a></li>
327<li>GEMM refactoring + FP16 support (Requires armv8.2 CPU): <a class="el" href="classarm__compute_1_1_n_e_g_e_m_m_interleave4x4_kernel.xhtml">arm_compute::NEGEMMInterleave4x4Kernel</a>, <a class="el" href="classarm__compute_1_1_n_e_g_e_m_m_transpose1x_w_kernel.xhtml">arm_compute::NEGEMMTranspose1xWKernel</a>, <a class="el" href="classarm__compute_1_1_n_e_g_e_m_m_matrix_multiply_kernel.xhtml">arm_compute::NEGEMMMatrixMultiplyKernel</a>, <a class="el" href="classarm__compute_1_1_n_e_g_e_m_m_matrix_addition_kernel.xhtml">arm_compute::NEGEMMMatrixAdditionKernel</a> / <a class="el" href="classarm__compute_1_1_n_e_g_e_m_m.xhtml">arm_compute::NEGEMM</a></li>
328<li><a class="el" href="classarm__compute_1_1_n_e_pooling_layer_kernel.xhtml">arm_compute::NEPoolingLayerKernel</a> / <a class="el" href="classarm__compute_1_1_n_e_pooling_layer.xhtml">arm_compute::NEPoolingLayer</a></li>
Anthony Barbiera4376382017-04-12 15:12:46 +0100329</ul>
330</li>
331</ul>
332<p>v17.02.1 Sources preview</p><ul>
333<li>New OpenCL kernels / functions:<ul>
Anthony Barbierdbdab852017-06-23 15:42:00 +0100334<li><a class="el" href="classarm__compute_1_1_c_l_logits1_d_max_kernel.xhtml">arm_compute::CLLogits1DMaxKernel</a>, <a class="el" href="classarm__compute_1_1_c_l_logits1_d_shift_exp_sum_kernel.xhtml">arm_compute::CLLogits1DShiftExpSumKernel</a>, <a class="el" href="classarm__compute_1_1_c_l_logits1_d_norm_kernel.xhtml">arm_compute::CLLogits1DNormKernel</a> / <a class="el" href="classarm__compute_1_1_c_l_softmax_layer.xhtml">arm_compute::CLSoftmaxLayer</a></li>
335<li><a class="el" href="classarm__compute_1_1_c_l_pooling_layer_kernel.xhtml">arm_compute::CLPoolingLayerKernel</a> / <a class="el" href="classarm__compute_1_1_c_l_pooling_layer.xhtml">arm_compute::CLPoolingLayer</a></li>
336<li><a class="el" href="classarm__compute_1_1_c_l_im2_col_kernel.xhtml">arm_compute::CLIm2ColKernel</a>, <a class="el" href="classarm__compute_1_1_c_l_col2_im_kernel.xhtml">arm_compute::CLCol2ImKernel</a>, <a class="el" href="classarm__compute_1_1_c_l_convolution_layer_weights_reshape_kernel.xhtml">arm_compute::CLConvolutionLayerWeightsReshapeKernel</a> / <a class="el" href="classarm__compute_1_1_c_l_convolution_layer.xhtml">arm_compute::CLConvolutionLayer</a></li>
337<li><a class="el" href="classarm__compute_1_1_c_l_remap_kernel.xhtml">arm_compute::CLRemapKernel</a> / <a class="el" href="classarm__compute_1_1_c_l_remap.xhtml">arm_compute::CLRemap</a></li>
338<li><a class="el" href="classarm__compute_1_1_c_l_gaussian_pyramid_hor_kernel.xhtml">arm_compute::CLGaussianPyramidHorKernel</a>, <a class="el" href="classarm__compute_1_1_c_l_gaussian_pyramid_vert_kernel.xhtml">arm_compute::CLGaussianPyramidVertKernel</a> / <a class="el" href="classarm__compute_1_1_c_l_gaussian_pyramid.xhtml">arm_compute::CLGaussianPyramid</a>, <a class="el" href="classarm__compute_1_1_c_l_gaussian_pyramid_half.xhtml">arm_compute::CLGaussianPyramidHalf</a>, <a class="el" href="classarm__compute_1_1_c_l_gaussian_pyramid_orb.xhtml">arm_compute::CLGaussianPyramidOrb</a></li>
339<li><a class="el" href="classarm__compute_1_1_c_l_min_max_kernel.xhtml">arm_compute::CLMinMaxKernel</a>, <a class="el" href="classarm__compute_1_1_c_l_min_max_location_kernel.xhtml">arm_compute::CLMinMaxLocationKernel</a> / <a class="el" href="classarm__compute_1_1_c_l_min_max_location.xhtml">arm_compute::CLMinMaxLocation</a></li>
340<li><a class="el" href="classarm__compute_1_1_c_l_non_linear_filter_kernel.xhtml">arm_compute::CLNonLinearFilterKernel</a> / <a class="el" href="classarm__compute_1_1_c_l_non_linear_filter.xhtml">arm_compute::CLNonLinearFilter</a></li>
Anthony Barbiera4376382017-04-12 15:12:46 +0100341</ul>
342</li>
343<li>New NEON FP16 kernels (Requires armv8.2 CPU)<ul>
Anthony Barbierdbdab852017-06-23 15:42:00 +0100344<li><a class="el" href="classarm__compute_1_1_n_e_accumulate_weighted_f_p16_kernel.xhtml">arm_compute::NEAccumulateWeightedFP16Kernel</a></li>
345<li><a class="el" href="classarm__compute_1_1_n_e_box3x3_f_p16_kernel.xhtml">arm_compute::NEBox3x3FP16Kernel</a></li>
346<li><a class="el" href="classarm__compute_1_1_n_e_non_maxima_suppression3x3_f_p16_kernel.xhtml">arm_compute::NENonMaximaSuppression3x3FP16Kernel</a></li>
Anthony Barbiera4376382017-04-12 15:12:46 +0100347</ul>
348</li>
349</ul>
350<p>v17.02 Sources preview</p><ul>
351<li>New OpenCL kernels / functions:<ul>
Anthony Barbierdbdab852017-06-23 15:42:00 +0100352<li><a class="el" href="classarm__compute_1_1_c_l_activation_layer_kernel.xhtml">arm_compute::CLActivationLayerKernel</a> / <a class="el" href="classarm__compute_1_1_c_l_activation_layer.xhtml">arm_compute::CLActivationLayer</a></li>
353<li><a class="el" href="classarm__compute_1_1_c_l_channel_combine_kernel.xhtml">arm_compute::CLChannelCombineKernel</a> / <a class="el" href="classarm__compute_1_1_c_l_channel_combine.xhtml">arm_compute::CLChannelCombine</a></li>
354<li><a class="el" href="classarm__compute_1_1_c_l_derivative_kernel.xhtml">arm_compute::CLDerivativeKernel</a> / <a class="el" href="classarm__compute_1_1_c_l_channel_extract.xhtml">arm_compute::CLChannelExtract</a></li>
355<li><a class="el" href="classarm__compute_1_1_c_l_fast_corners_kernel.xhtml">arm_compute::CLFastCornersKernel</a> / <a class="el" href="classarm__compute_1_1_c_l_fast_corners.xhtml">arm_compute::CLFastCorners</a></li>
356<li><a class="el" href="classarm__compute_1_1_c_l_mean_std_dev_kernel.xhtml">arm_compute::CLMeanStdDevKernel</a> / <a class="el" href="classarm__compute_1_1_c_l_mean_std_dev.xhtml">arm_compute::CLMeanStdDev</a></li>
Anthony Barbiera4376382017-04-12 15:12:46 +0100357</ul>
358</li>
359<li>New NEON kernels / functions:<ul>
Anthony Barbierdbdab852017-06-23 15:42:00 +0100360<li>HOG / SVM: <a class="el" href="classarm__compute_1_1_n_e_h_o_g_orientation_binning_kernel.xhtml">arm_compute::NEHOGOrientationBinningKernel</a>, <a class="el" href="classarm__compute_1_1_n_e_h_o_g_block_normalization_kernel.xhtml">arm_compute::NEHOGBlockNormalizationKernel</a>, <a class="el" href="classarm__compute_1_1_n_e_h_o_g_detector_kernel.xhtml">arm_compute::NEHOGDetectorKernel</a>, arm_compute::NEHOGNonMaximaSuppressionKernel / <a class="el" href="classarm__compute_1_1_n_e_h_o_g_descriptor.xhtml">arm_compute::NEHOGDescriptor</a>, <a class="el" href="classarm__compute_1_1_n_e_h_o_g_detector.xhtml">arm_compute::NEHOGDetector</a>, <a class="el" href="classarm__compute_1_1_n_e_h_o_g_gradient.xhtml">arm_compute::NEHOGGradient</a>, <a class="el" href="classarm__compute_1_1_n_e_h_o_g_multi_detection.xhtml">arm_compute::NEHOGMultiDetection</a></li>
361<li><a class="el" href="classarm__compute_1_1_n_e_non_linear_filter_kernel.xhtml">arm_compute::NENonLinearFilterKernel</a> / <a class="el" href="classarm__compute_1_1_n_e_non_linear_filter.xhtml">arm_compute::NENonLinearFilter</a></li>
Anthony Barbiera4376382017-04-12 15:12:46 +0100362</ul>
363</li>
Anthony Barbierdbdab852017-06-23 15:42:00 +0100364<li>Introduced a CLScheduler to manage the default context and command queue used by the runtime library and create synchronisation events.</li>
Anthony Barbiera4376382017-04-12 15:12:46 +0100365<li>Switched all the kernels / functions to use tensors instead of images.</li>
366<li>Updated documentation to include instructions to build the library from sources.</li>
367</ul>
368<p>v16.12 Binary preview release</p><ul>
369<li>Original release</li>
370</ul>
Anthony Barbier871448e2017-03-24 14:54:29 +0000371<h1><a class="anchor" id="S3_how_to_build"></a>
372How to build the library and the examples</h1>
373<h2><a class="anchor" id="S3_1_build_options"></a>
374Build options</h2>
Anthony Barbierdbdab852017-06-23 15:42:00 +0100375<p>scons 2.3 or above is required to build the library. To see the build options available simply run <code>scons -h</code>: </p><pre class="fragment">debug: Debug (yes|no)
376 default: False
377 actual: False
Anthony Barbier871448e2017-03-24 14:54:29 +0000378
Anthony Barbierdbdab852017-06-23 15:42:00 +0100379asserts: Enable asserts (this flag is forced to 1 for debug=1) (yes|no)
380 default: False
381 actual: False
Anthony Barbier871448e2017-03-24 14:54:29 +0000382
Anthony Barbierdbdab852017-06-23 15:42:00 +0100383arch: Target Architecture (armv7a|arm64-v8a|arm64-v8.2-a|x86_32|x86_64)
Anthony Barbier871448e2017-03-24 14:54:29 +0000384 default: armv7a
385 actual: armv7a
386
Anthony Barbierdbdab852017-06-23 15:42:00 +0100387os: Target OS (linux|android|bare_metal)
Anthony Barbier871448e2017-03-24 14:54:29 +0000388 default: linux
389 actual: linux
390
Anthony Barbierdbdab852017-06-23 15:42:00 +0100391build: Build type (native|cross_compile)
Anthony Barbier871448e2017-03-24 14:54:29 +0000392 default: cross_compile
393 actual: cross_compile
394
Anthony Barbierdbdab852017-06-23 15:42:00 +0100395examples: Build example programs (yes|no)
396 default: True
397 actual: True
Anthony Barbier871448e2017-03-24 14:54:29 +0000398
Anthony Barbierdbdab852017-06-23 15:42:00 +0100399Werror: Enable/disable the -Werror compilation flag (yes|no)
400 default: True
401 actual: True
Anthony Barbier871448e2017-03-24 14:54:29 +0000402
Anthony Barbierdbdab852017-06-23 15:42:00 +0100403opencl: Enable OpenCL support (yes|no)
404 default: True
405 actual: True
Anthony Barbier871448e2017-03-24 14:54:29 +0000406
Anthony Barbierdbdab852017-06-23 15:42:00 +0100407neon: Enable Neon support (yes|no)
408 default: False
Anthony Barbiera4376382017-04-12 15:12:46 +0100409 actual: False
410
Anthony Barbierdbdab852017-06-23 15:42:00 +0100411embed_kernels: Embed OpenCL kernels in library binary (yes|no)
412 default: False
413 actual: False
414
415set_soname: Set the library's soname and shlibversion (requires SCons 2.4 or above) (yes|no)
416 default: False
417 actual: False
418
419openmp: Enable OpenMP backend (yes|no)
420 default: False
421 actual: False
422
423cppthreads: Enable C++11 threads backend (yes|no)
424 default: True
425 actual: True
426
427build_dir: Specify sub-folder for the build ( /path/to/build_dir )
428 default: .
429 actual: .
430
Anthony Barbiera4376382017-04-12 15:12:46 +0100431extra_cxx_flags: Extra CXX flags to be appended to the build command
432 default:
433 actual:
Anthony Barbierdbdab852017-06-23 15:42:00 +0100434
435pmu: Enable PMU counters (yes|no)
436 default: False
437 actual: False
438
439validation_tests: Build validation test programs (yes|no)
440 default: False
441 actual: False
442
443benchmark_tests: Build benchmark test programs (yes|no)
444 default: False
445 actual: False
446</pre><p><b>debug</b> / <b>asserts:</b> </p><ul>
Anthony Barbier871448e2017-03-24 14:54:29 +0000447<li>With debug=1 asserts are enabled, and the library is built with symbols and no optimisations enabled.</li>
448<li>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)</li>
449<li>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).</li>
450</ul>
Anthony Barbierdbdab852017-06-23 15:42:00 +0100451<p><b>arch:</b> The x86_32 and x86_64 targets can only be used with neon=0 and opencl=1.</p>
452<p><b>os:</b> Choose the operating system you are targeting: Linux, Android or bare metal. </p><dl class="section note"><dt>Note</dt><dd>bare metal can only be used for NEON (not OpenCL), only static libraries get built and NEON's multi-threading support is disabled.</dd></dl>
453<p><b>build:</b> 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.</p>
454<dl class="section note"><dt>Note</dt><dd>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.</dd></dl>
455<p><b>Werror:</b> 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 <a href="#" onclick="location.href='mai'+'lto:'+'dev'+'el'+'ope'+'r@'+'arm'+'.c'+'om'; return false;">devel<span style="display: none;">.nosp@m.</span>oper<span style="display: none;">.nosp@m.</span>@arm.<span style="display: none;">.nosp@m.</span>com</a> so that the issue can be addressed).</p>
456<p><b>opencl</b> / <b>neon:</b> Choose which SIMD technology you want to target. (NEON for ARM Cortex-A CPUs or OpenCL for ARM Mali GPUs)</p>
457<p><b>embed_kernels:</b> 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".</p>
458<p><b>set_soname:</b> Do you want to build the versioned version of the library ?</p>
459<p>If enabled the library will contain a SONAME and SHLIBVERSION and some symlinks will automatically be created between the objects. Example: libarm_compute_core.so -&gt; libarm_compute_core.so.1.0.0 libarm_compute_core.so.1 -&gt; libarm_compute_core.so.1.0.0 libarm_compute_core.so.1.0.0</p>
Anthony Barbiera4376382017-04-12 15:12:46 +0100460<dl class="section note"><dt>Note</dt><dd>This options is disabled by default as it requires SCons version 2.4 or above.</dd></dl>
Anthony Barbierdbdab852017-06-23 15:42:00 +0100461<p><b>extra_cxx_flags:</b> Custom CXX flags which will be appended to the end of the build command.</p>
462<p><b>build_dir:</b> Build the library in a subfolder of the "build" folder. (Allows to build several configurations in parallel).</p>
463<p><b>examples:</b> Build or not the examples</p>
464<p><b>validation_tests:</b> Enable the build of the validation suite.</p>
465<dl class="section note"><dt>Note</dt><dd>You will need the Boost Test and Program options headers and libraries to build the validation tests. See <a class="el" href="tests.xhtml#building_boost">Building Boost</a> for more information.</dd></dl>
466<p><b>benchmark_tests:</b> Enable the build of the benchmark tests</p>
467<p><b>pmu:</b> Enable the PMU cycle counter to measure execution time in benchmark tests. (Your device needs to support it)</p>
468<dl class="section note"><dt>Note</dt><dd>You will need the Boost Program options and Google Benchmark headers and libraries to build the benchmark tests. See <a class="el" href="tests.xhtml#building_google_benchmark">Building Google Benchmark</a> for more information.</dd></dl>
469<p><b>openmp</b> Build in the OpenMP scheduler for NEON.</p>
470<dl class="section note"><dt>Note</dt><dd>Only works when building with g++ not clang++</dd></dl>
471<p><b>cppthreads</b> Build in the C++11 scheduler for NEON.</p>
472<dl class="section see"><dt>See also</dt><dd><a class="el" href="classarm__compute_1_1_scheduler.xhtml#aa35fa7aa123444c798c28d4ac8fe7546" title="Sets the user defined scheduler and makes it the active scheduler. ">arm_compute::Scheduler::set</a></dd></dl>
Anthony Barbier871448e2017-03-24 14:54:29 +0000473<h2><a class="anchor" id="S3_2_linux"></a>
474Linux</h2>
475<h3><a class="anchor" id="S3_2_1_library"></a>
476How to build the library ?</h3>
Anthony Barbier46d59272017-05-04 09:15:15 +0100477<p>For Linux, the library was successfully built and tested using the following Linaro GCC toolchain:</p>
478<ul>
479<li>gcc-linaro-arm-linux-gnueabihf-4.9-2014.07_linux</li>
480<li>gcc-linaro-4.9-2016.02-x86_64_aarch64-linux-gnu</li>
481<li>gcc-linaro-6.3.1-2017.02-i686_aarch64-linux-gnu</li>
482</ul>
Anthony Barbier871448e2017-03-24 14:54:29 +0000483<dl class="section note"><dt>Note</dt><dd>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)</dd></dl>
484<p>To cross-compile the library in debug mode, with NEON only support, for Linux 32bit: </p><pre class="fragment">scons Werror=1 -j8 debug=1 neon=1 opencl=0 os=linux arch=armv7a
485</pre><p>To cross-compile the library in asserts mode, with OpenCL only support, for Linux 64bit: </p><pre class="fragment">scons Werror=1 -j8 debug=0 asserts=1 neon=0 opencl=1 embed_kernels=1 os=linux arch=arm64-v8a
Anthony Barbiera4376382017-04-12 15:12:46 +0100486</pre><p>You can also compile the library natively on an ARM device by using <b>build=native</b>: </p><pre class="fragment">scons Werror=1 -j8 debug=0 neon=1 opencl=0 os=linux arch=arm64-v8a build=native
487scons Werror=1 -j8 debug=0 neon=1 opencl=0 os=linux arch=armv7a build=native
Anthony Barbierdbdab852017-06-23 15:42:00 +0100488</pre><dl class="section note"><dt>Note</dt><dd>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.</dd></dl>
Anthony Barbiera4376382017-04-12 15:12:46 +0100489<p>For example on a 64bit Debian based system you would have to install <b>g++-arm-linux-gnueabihf</b> </p><pre class="fragment">apt-get install g++-arm-linux-gnueabihf
490</pre><p>Then run </p><pre class="fragment">scons Werror=1 -j8 debug=0 neon=1 opencl=0 os=linux arch=armv7a build=cross_compile
491</pre><p>or simply remove the build parameter as build=cross_compile is the default value: </p><pre class="fragment">scons Werror=1 -j8 debug=0 neon=1 opencl=0 os=linux arch=armv7a
492</pre><dl class="section attention"><dt>Attention</dt><dd>To cross compile with opencl=1 you need to make sure to have a version of libOpenCL matching your target architecture.</dd></dl>
493<h3><a class="anchor" id="S3_2_2_examples"></a>
Anthony Barbier871448e2017-03-24 14:54:29 +0000494How to manually build the examples ?</h3>
495<p>The 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.</p>
Anthony Barbier46d59272017-05-04 09:15:15 +0100496<dl class="section note"><dt>Note</dt><dd>The following command lines assume the <a class="el" href="namespacearm__compute.xhtml">arm_compute</a> 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.</dd></dl>
Anthony Barbierdbdab852017-06-23 15:42:00 +0100497<p>To cross compile a NEON example for Linux 32bit: </p><pre class="fragment">arm-linux-gnueabihf-g++ examples/neon_convolution.cpp utils/Utils.cpp -I. -std=c++11 -mfpu=neon -L. -larm_compute -o neon_convolution
498</pre><p>To cross compile a NEON example for Linux 64bit: </p><pre class="fragment">aarch64-linux-gnu-g++ examples/neon_convolution.cpp utils/Utils.cpp -I. -std=c++11 -L. -larm_compute -o neon_convolution
Anthony Barbier46d59272017-05-04 09:15:15 +0100499</pre><p>(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)</p>
Anthony Barbierdbdab852017-06-23 15:42:00 +0100500<p>To cross compile an OpenCL example for Linux 32bit: </p><pre class="fragment">arm-linux-gnueabihf-g++ examples/cl_convolution.cpp utils/Utils.cpp -I. -Iinclude -std=c++11 -mfpu=neon -L. -larm_compute -lOpenCL -o cl_convolution
501</pre><p>To cross compile an OpenCL example for Linux 64bit: </p><pre class="fragment">aarch64-linux-gnu-g++ examples/cl_convolution.cpp utils/Utils.cpp -I. -Iinclude -std=c++11 -L. -larm_compute -lOpenCL -o cl_convolution
Anthony Barbier46d59272017-05-04 09:15:15 +0100502</pre><p>(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)</p>
Anthony Barbierdbdab852017-06-23 15:42:00 +0100503<p>To compile natively (i.e directly on an ARM device) for NEON for Linux 32bit: </p><pre class="fragment">g++ examples/neon_convolution.cpp utils/Utils.cpp -I. -std=c++11 -mfpu=neon -larm_compute -o neon_convolution
504</pre><p>To compile natively (i.e directly on an ARM device) for NEON for Linux 64bit: </p><pre class="fragment">g++ examples/neon_convolution.cpp utils/Utils.cpp -I. -std=c++11 -larm_compute -o neon_convolution
Anthony Barbier46d59272017-05-04 09:15:15 +0100505</pre><p>(notice the only difference with the 32 bit command is that we don't need the -mfpu option)</p>
Anthony Barbierdbdab852017-06-23 15:42:00 +0100506<p>To compile natively (i.e directly on an ARM device) for OpenCL for Linux 32bit or Linux 64bit: </p><pre class="fragment">g++ examples/cl_convolution.cpp utils/Utils.cpp -I. -Iinclude -std=c++11 -larm_compute -lOpenCL -o cl_convolution
Anthony Barbier871448e2017-03-24 14:54:29 +0000507</pre><dl class="section note"><dt>Note</dt><dd>These two commands assume libarm_compute.so is available in your library path, if not add the path to it using -L</dd></dl>
508<p>To run the built executable simply run: </p><pre class="fragment">LD_LIBRARY_PATH=build ./neon_convolution
509</pre><p>or </p><pre class="fragment">LD_LIBRARY_PATH=build ./cl_convolution
510</pre><dl class="section note"><dt>Note</dt><dd>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.</dd></dl>
511<h2><a class="anchor" id="S3_3_android"></a>
512Android</h2>
513<p>For Android, the library was successfully built and tested using Google's standalone toolchains:</p><ul>
514<li>arm-linux-androideabi-4.9 for armv7a (clang++)</li>
515<li>aarch64-linux-android-4.9 for arm64-v8a (g++)</li>
516</ul>
517<p>Here is a guide to <a href="https://developer.android.com/ndk/guides/standalone_toolchain.html">create your Android standalone toolchains from the NDK</a></p>
518<ul>
Anthony Barbierdbdab852017-06-23 15:42:00 +0100519<li>Download the NDK r14 from here: <a href="https://developer.android.com/ndk/downloads/index.html">https://developer.android.com/ndk/downloads/index.html</a></li>
Anthony Barbier871448e2017-03-24 14:54:29 +0000520<li>Make sure you have Python 2 installed on your machine.</li>
521<li>Generate the 32 and/or 64 toolchains by running the following commands:</li>
522</ul>
523<pre class="fragment">$NDK/build/tools/make_standalone_toolchain.py --arch arm64 --install-dir $MY_TOOLCHAINS/aarch64-linux-android-4.9 --stl gnustl
524$NDK/build/tools/make_standalone_toolchain.py --arch arm --install-dir $MY_TOOLCHAINS/arm-linux-androideabi-4.9 --stl gnustl
525</pre><dl class="section attention"><dt>Attention</dt><dd>Due to some NDK issues make sure you use g++ &amp; gnustl for aarch64 and clang++ &amp; gnustl for armv7</dd></dl>
526<dl class="section note"><dt>Note</dt><dd>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</dd></dl>
527<h3><a class="anchor" id="S3_3_1_library"></a>
528How to build the library ?</h3>
529<dl class="section note"><dt>Note</dt><dd>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)</dd></dl>
530<p>To cross-compile the library in debug mode, with NEON only support, for Android 32bit: </p><pre class="fragment">CXX=clang++ CC=clang scons Werror=1 -j8 debug=1 neon=1 opencl=0 os=android arch=armv7a
Anthony Barbierdbdab852017-06-23 15:42:00 +0100531</pre><p>To cross-compile the library in asserts mode, with OpenCL only support, for Android 64bit: </p><pre class="fragment">scons Werror=1 -j8 debug=0 asserts=1 neon=0 opencl=1 embed_kernels=1 os=android arch=arm64-v8a
Anthony Barbier871448e2017-03-24 14:54:29 +0000532</pre><h3><a class="anchor" id="S3_3_2_examples"></a>
533How to manually build the examples ?</h3>
534<p>The 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.</p>
Anthony Barbierdbdab852017-06-23 15:42:00 +0100535<dl class="section note"><dt>Note</dt><dd>The following command lines assume the <a class="el" href="namespacearm__compute.xhtml">arm_compute</a> 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.</dd></dl>
Anthony Barbier871448e2017-03-24 14:54:29 +0000536<p>Once you've got your Android standalone toolchain built and added to your path you can do the following:</p>
537<p>To cross compile a NEON example: </p><pre class="fragment">#32 bit:
Anthony Barbierdbdab852017-06-23 15:42:00 +0100538arm-linux-androideabi-clang++ examples/neon_convolution.cpp utils/Utils.cpp -I. -Iinclude -std=c++11 -larm_compute-static -L. -o neon_convolution_arm -static-libstdc++ -pie
Anthony Barbier871448e2017-03-24 14:54:29 +0000539#64 bit:
Anthony Barbierdbdab852017-06-23 15:42:00 +0100540aarch64-linux-android-g++ examples/neon_convolution.cpp utils/Utils.cpp -I. -Iinclude -std=c++11 -larm_compute-static -L. -o neon_convolution_aarch64 -static-libstdc++ -pie
Anthony Barbier871448e2017-03-24 14:54:29 +0000541</pre><p>To cross compile an OpenCL example: </p><pre class="fragment">#32 bit:
Anthony Barbierdbdab852017-06-23 15:42:00 +0100542arm-linux-androideabi-clang++ examples/cl_convolution.cpp utils/Utils.cpp -I. -Iinclude -std=c++11 -larm_compute-static -L. -o cl_convolution_arm -static-libstdc++ -pie -lOpenCL
Anthony Barbier871448e2017-03-24 14:54:29 +0000543#64 bit:
Anthony Barbierdbdab852017-06-23 15:42:00 +0100544aarch64-linux-android-g++ examples/cl_convolution.cpp utils/Utils.cpp -I. -Iinclude -std=c++11 -larm_compute-static -L. -o cl_convolution_aarch64 -static-libstdc++ -pie -lOpenCL
Anthony Barbier871448e2017-03-24 14:54:29 +0000545</pre><dl class="section note"><dt>Note</dt><dd>Due to some issues in older versions of the Mali OpenCL DDK (&lt;= r13p0), we recommend to link <a class="el" href="namespacearm__compute.xhtml">arm_compute</a> statically on Android.</dd></dl>
546<p>Then you need to do is upload the executable and the shared library to the device using ADB: </p><pre class="fragment">adb push neon_convolution_arm /data/local/tmp/
547adb push cl_convolution_arm /data/local/tmp/
548adb shell chmod 777 -R /data/local/tmp/
549</pre><p>And finally to run the example: </p><pre class="fragment">adb shell /data/local/tmp/neon_convolution_arm
550adb shell /data/local/tmp/cl_convolution_arm
551</pre><p>For 64bit: </p><pre class="fragment">adb push neon_convolution_aarch64 /data/local/tmp/
552adb push cl_convolution_aarch64 /data/local/tmp/
553adb shell chmod 777 -R /data/local/tmp/
554</pre><p>And finally to run the example: </p><pre class="fragment">adb shell /data/local/tmp/neon_convolution_aarch64
555adb shell /data/local/tmp/cl_convolution_aarch64
556</pre><h2><a class="anchor" id="S3_4_cl_stub_library"></a>
557The OpenCL stub library</h2>
558<p>In 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 <a class="el" href="namespacearm__compute.xhtml">arm_compute</a> against.</p>
559<p>If 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.</p>
560<dl class="section warning"><dt>Warning</dt><dd>This OpenCL library provided is a stub and <em>not</em> a real implementation. You can use it to resolve OpenCL's symbols in <a class="el" href="namespacearm__compute.xhtml">arm_compute</a> 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.</dd></dl>
561<p>To cross-compile the stub OpenCL library simply run: </p><pre class="fragment">&lt;target-prefix&gt;-gcc -o libOpenCL.so -Iinclude opencl-1.2-stubs/opencl_stubs.c -fPIC -shared
562</pre><p>For example: </p><pre class="fragment">&lt;target-prefix&gt;-gcc -o libOpenCL.so -Iinclude opencl-1.2-stubs/opencl_stubs.c -fPIC -shared
563#Linux 32bit
564arm-linux-gnueabihf-gcc -o libOpenCL.so -Iinclude opencl-1.2-stubs/opencl_stubs.c -fPIC -shared
565#Linux 64bit
566aarch64-linux-gnu-gcc -o libOpenCL.so -Iinclude -shared opencl-1.2-stubs/opencl_stubs.c -fPIC
567#Android 32bit
568arm-linux-androideabi-clang -o libOpenCL.so -Iinclude -shared opencl-1.2-stubs/opencl_stubs.c -fPIC -shared
569#Android 64bit
Anthony Barbierdbdab852017-06-23 15:42:00 +0100570aarch64-linux-android-gcc -o libOpenCL.so -Iinclude -shared opencl-1.2-stubs/opencl_stubs.c -fPIC -shared</pre> </div></div><!-- contents -->
Anthony Barbier871448e2017-03-24 14:54:29 +0000571</div><!-- doc-content -->
572<!-- start footer part -->
573<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
574 <ul>
Anthony Barbierdbdab852017-06-23 15:42:00 +0100575 <li class="footer">Generated on Fri Jun 23 2017 15:44:36 for Compute Library by
Anthony Barbier871448e2017-03-24 14:54:29 +0000576 <a href="http://www.doxygen.org/index.html">
577 <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.11 </li>
578 </ul>
579</div>
580</body>
581</html>