Skip to content

Commit 36ccc90

Browse files
author
Jenkins
committed
arm_compute v20.02
1 parent 7f09cf7 commit 36ccc90

File tree

11,734 files changed

+229568
-255747
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

11,734 files changed

+229568
-255747
lines changed

Android.bp

Lines changed: 807 additions & 0 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ Tutorials:
2727

2828
Documentation (API, changelogs, build guide, contribution guide, errata, etc.) available here:
2929

30+
- [v20.02](https://arm-software.github.io/ComputeLibrary/v20.02/)
3031
- [v19.11.1](https://arm-software.github.io/ComputeLibrary/v19.11.1/)
3132
- [v19.11](https://arm-software.github.io/ComputeLibrary/v19.11/)
3233
- [v19.08.1](https://arm-software.github.io/ComputeLibrary/v19.08.1/)
@@ -49,6 +50,8 @@ Documentation (API, changelogs, build guide, contribution guide, errata, etc.) a
4950

5051
Binaries available here:
5152

53+
- [v20.02-linux](https://github.com/ARM-software/ComputeLibrary/releases/download/v20.02/arm_compute-v20.02-bin-linux.tar.gz)
54+
- [v20.02-android](https://github.com/ARM-software/ComputeLibrary/releases/download/v20.02/arm_compute-v20.02-bin-android.tar.gz)
5255
- [v19.11.1-linux](https://github.com/ARM-software/ComputeLibrary/releases/download/v19.11.1/arm_compute-v19.11.1-bin-linux.tar.gz)
5356
- [v19.11.1-android](https://github.com/ARM-software/ComputeLibrary/releases/download/v19.11.1/arm_compute-v19.11.1-bin-android.tar.gz)
5457
- [v19.11-linux](https://github.com/ARM-software/ComputeLibrary/releases/download/v19.11/arm_compute-v19.11-bin-linux.tar.gz)
@@ -95,3 +98,6 @@ To indicate that you agree to the the terms of the DCO, you "sign off" your cont
9598
```Signed-off-by: John Doe <[email protected]>```
9699

97100
You must use your real name, no pseudonyms or anonymous contributions are accepted.
101+
102+
### Security Issues
103+
If you believe you have discovered a security issue please contact [email protected]

SConscript

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,21 @@ import os.path
2424
import re
2525
import subprocess
2626

27-
VERSION = "v19.11.1"
28-
SONAME_VERSION="17.1.0"
27+
VERSION = "v20.02"
28+
SONAME_VERSION="1.0.0"
2929

3030
Import('env')
3131
Import('vars')
3232
Import('install_lib')
3333

34+
def build_bootcode_objs(sources):
35+
36+
arm_compute_env.Append(ASFLAGS = "-I bootcode/")
37+
obj = arm_compute_env.Object(sources)
38+
obj = install_lib(obj)
39+
Default(obj)
40+
return obj
41+
3442
def build_library(name, sources, static=False, libs=[]):
3543
if static:
3644
obj = arm_compute_env.StaticLibrary(name, source=sources, LIBS = arm_compute_env["LIBS"] + libs)
@@ -216,11 +224,10 @@ if env['neon']:
216224

217225
graph_files += Glob('src/graph/backends/NEON/*.cpp')
218226

219-
if env['arch'] == "armv7a":
227+
if env['estate'] == '32':
220228
core_files += Glob('src/core/NEON/kernels/arm_gemm/kernels/a32_*/*.cpp')
221229

222-
223-
if "arm64-v8" in env['arch']:
230+
if env['estate'] == '64':
224231
core_files += Glob('src/core/NEON/kernels/arm_gemm/kernels/a64_*/*.cpp')
225232
if "sve" in env['arch']:
226233
core_files += Glob('src/core/NEON/kernels/arm_gemm/kernels/sve_*/*.cpp')
@@ -241,6 +248,12 @@ if env['gles_compute']:
241248

242249
graph_files += Glob('src/graph/backends/GLES/*.cpp')
243250

251+
bootcode_o = []
252+
if env['os'] == 'bare_metal':
253+
bootcode_files = Glob('bootcode/*.s')
254+
bootcode_o = build_bootcode_objs(bootcode_files)
255+
Export('bootcode_o')
256+
244257
arm_compute_core_a = build_library('arm_compute_core-static', core_files, static=True)
245258
Export('arm_compute_core_a')
246259

SConstruct

Lines changed: 80 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,10 @@ vars.AddVariables(
4040
BoolVariable("debug", "Debug", False),
4141
BoolVariable("asserts", "Enable asserts (this flag is forced to 1 for debug=1)", False),
4242
BoolVariable("logging", "Logging (this flag is forced to 1 for debug=1)", False),
43-
EnumVariable("arch", "Target Architecture", "armv7a", allowed_values=("armv7a", "arm64-v8a", "arm64-v8.2-a", "arm64-v8.2-a-sve", "x86_32", "x86_64")),
43+
EnumVariable("arch", "Target Architecture", "armv7a",
44+
allowed_values=("armv7a", "arm64-v8a", "arm64-v8.2-a", "arm64-v8.2-a-sve", "x86_32", "x86_64",
45+
"armv8a", "armv8.2-a", "armv8.2-a-sve", "armv8.6-a", "x86")),
46+
EnumVariable("estate", "Execution State", "auto", allowed_values=("auto", "32", "64")),
4447
EnumVariable("os", "Target OS", "linux", allowed_values=("linux", "android", "bare_metal")),
4548
EnumVariable("build", "Build type", "cross_compile", allowed_values=("native", "cross_compile", "embed_only")),
4649
BoolVariable("examples", "Build example programs", True),
@@ -57,7 +60,9 @@ vars.AddVariables(
5760
PathVariable("build_dir", "Specify sub-folder for the build", ".", PathVariable.PathAccept),
5861
PathVariable("install_dir", "Specify sub-folder for the install", "", PathVariable.PathAccept),
5962
BoolVariable("exceptions", "Enable/disable C++ exception support", True),
63+
PathVariable("linker_script", "Use an external linker script", "", PathVariable.PathAccept),
6064
("toolchain_prefix", "Override the toolchain prefix", ""),
65+
("compiler_prefix", "Override the compiler prefix", ""),
6166
("extra_cxx_flags", "Extra CXX flags to be appended to the build command", ""),
6267
("extra_link_flags", "Extra LD flags to be appended to the build command", ""),
6368
("compiler_cache", "Command to prefix to the C and C++ compiler (e.g ccache)", "")
@@ -101,6 +106,10 @@ Export('install_bin')
101106

102107
Help(vars.GenerateHelpText(env))
103108

109+
if env['linker_script'] and env['os'] != 'bare_metal':
110+
print("Linker script is only supported for bare_metal builds")
111+
Exit(1)
112+
104113
if env['build'] == "embed_only":
105114
SConscript('./SConscript', variant_dir=build_path, duplicate=0)
106115
Return()
@@ -130,7 +139,7 @@ if not env['exceptions']:
130139
env.Append(CXXFLAGS = ['-Wall','-DARCH_ARM',
131140
'-Wextra','-pedantic','-Wdisabled-optimization','-Wformat=2',
132141
'-Winit-self','-Wstrict-overflow=2','-Wswitch-default',
133-
'-fpermissive','-std=gnu++11','-Woverloaded-virtual', '-Wformat-security',
142+
'-std=gnu++11','-Woverloaded-virtual', '-Wformat-security',
134143
'-Wctor-dtor-privacy','-Wsign-promo','-Weffc++','-Wno-overlength-strings'])
135144

136145
env.Append(CPPDEFINES = ['_GLIBCXX_USE_NANOSLEEP'])
@@ -162,57 +171,79 @@ if env['openmp']:
162171
env.Append(CXXFLAGS = ['-fopenmp'])
163172
env.Append(LINKFLAGS = ['-fopenmp'])
164173

174+
# Validate and define state
175+
if env['estate'] == 'auto':
176+
if 'v7a' in env['arch']:
177+
env['estate'] = '32'
178+
else:
179+
env['estate'] = '64'
180+
181+
# Map legacy arch
182+
if 'arm64' in env['arch']:
183+
env['estate'] = '64'
184+
185+
if 'v7a' in env['estate'] and env['estate'] == '64':
186+
print("ERROR: armv7a architecture has only 32-bit execution state")
187+
Exit(1)
188+
165189
# Add architecture specific flags
166190
prefix = ""
167-
if env['arch'] == 'armv7a':
191+
if 'v7a' in env['arch']:
168192
env.Append(CXXFLAGS = ['-march=armv7-a', '-mthumb', '-mfpu=neon'])
169-
170-
if env['os'] == 'linux':
171-
prefix = "arm-linux-gnueabihf-"
172-
env.Append(CXXFLAGS = ['-mfloat-abi=hard'])
173-
elif env['os'] == 'bare_metal':
174-
prefix = "arm-eabi-"
175-
env.Append(CXXFLAGS = ['-mfloat-abi=hard'])
176-
elif env['os'] == 'android':
177-
prefix = "arm-linux-androideabi-"
193+
if env['os'] == 'android':
178194
env.Append(CXXFLAGS = ['-mfloat-abi=softfp'])
179-
elif env['arch'] == 'arm64-v8a':
180-
env.Append(CXXFLAGS = ['-march=armv8-a'])
181-
env.Append(CPPDEFINES = ['ARM_COMPUTE_AARCH64_V8A'])
182-
if env['os'] == 'linux':
183-
prefix = "aarch64-linux-gnu-"
184-
elif env['os'] == 'bare_metal':
185-
prefix = "aarch64-elf-"
186-
elif env['os'] == 'android':
187-
prefix = "aarch64-linux-android-"
188-
elif 'arm64-v8.2-a' in env['arch']:
189-
if env['arch'] == 'arm64-v8.2-a-sve':
190-
env.Append(CXXFLAGS = ['-march=armv8.2-a+sve+fp16+dotprod'])
191195
else:
196+
env.Append(CXXFLAGS = ['-mfloat-abi=hard'])
197+
elif 'v8' in env['arch']:
198+
if 'sve' in env['arch']:
199+
env.Append(CXXFLAGS = ['-march=armv8.2-a+sve+fp16+dotprod'])
200+
elif 'v8.2-a' in env['arch']:
192201
env.Append(CXXFLAGS = ['-march=armv8.2-a+fp16']) # explicitly enable fp16 extension otherwise __ARM_FEATURE_FP16_VECTOR_ARITHMETIC is undefined
193-
if env['os'] == 'linux':
194-
prefix = "aarch64-linux-gnu-"
195-
elif env['os'] == 'bare_metal':
196-
prefix = "aarch64-elf-"
197-
elif env['os'] == 'android':
198-
prefix = "aarch64-linux-android-"
199-
env.Append(CPPDEFINES = ['ARM_COMPUTE_AARCH64_V8_2'])
200-
elif env['arch'] == 'x86_32':
201-
env.Append(CCFLAGS = ['-m32'])
202-
env.Append(LINKFLAGS = ['-m32'])
203-
elif env['arch'] == 'x86_64':
204-
env.Append(CXXFLAGS = ['-fPIC'])
205-
env.Append(CCFLAGS = ['-m64'])
206-
env.Append(LINKFLAGS = ['-m64'])
202+
else:
203+
env.Append(CXXFLAGS = ['-march=armv8-a'])
204+
205+
if 'v8.6-a' in env['arch']:
206+
env.Append(CXXFLAGS = ['-DV8P6'])
207+
208+
elif 'x86' in env['arch']:
209+
if env['estate'] == '32':
210+
env.Append(CCFLAGS = ['-m32'])
211+
env.Append(LINKFLAGS = ['-m32'])
212+
else:
213+
env.Append(CXXFLAGS = ['-fPIC'])
214+
env.Append(CCFLAGS = ['-m64'])
215+
env.Append(LINKFLAGS = ['-m64'])
216+
217+
# Define toolchain
218+
prefix = ""
219+
if 'x86' not in env['arch']:
220+
if env['estate'] == '32':
221+
if env['os'] == 'linux':
222+
prefix = "arm-linux-gnueabihf-" if 'v7' in env['arch'] else "armv8l-linux-gnueabihf-"
223+
elif env['os'] == 'bare_metal':
224+
prefix = "arm-eabi-"
225+
elif env['os'] == 'android':
226+
prefix = "arm-linux-androideabi-"
227+
elif env['estate'] == '64' and 'v8' in env['arch']:
228+
if env['os'] == 'linux':
229+
prefix = "aarch64-linux-gnu-"
230+
elif env['os'] == 'bare_metal':
231+
prefix = "aarch64-elf-"
232+
elif env['os'] == 'android':
233+
prefix = "aarch64-linux-android-"
207234

208235
if env['build'] == 'native':
209236
prefix = ""
210237

211238
if env["toolchain_prefix"] != "":
212239
prefix = env["toolchain_prefix"]
213240

214-
env['CC'] = env['compiler_cache']+" "+prefix + c_compiler
215-
env['CXX'] = env['compiler_cache']+" "+prefix + cpp_compiler
241+
compiler_prefix = prefix
242+
if env["compiler_prefix"] != "":
243+
compiler_prefix = env["compiler_prefix"]
244+
245+
env['CC'] = env['compiler_cache']+ " " + compiler_prefix + c_compiler
246+
env['CXX'] = env['compiler_cache']+ " " + compiler_prefix + cpp_compiler
216247
env['LD'] = prefix + "ld"
217248
env['AS'] = prefix + "as"
218249
env['AR'] = prefix + "ar"
@@ -250,7 +281,7 @@ if env['Werror']:
250281

251282
if env['os'] == 'android':
252283
env.Append(CPPDEFINES = ['ANDROID'])
253-
env.Append(LINKFLAGS = ['-pie', '-static-libstdc++'])
284+
env.Append(LINKFLAGS = ['-pie', '-static-libstdc++', '-ldl'])
254285
elif env['os'] == 'bare_metal':
255286
env.Append(LINKFLAGS = ['-static'])
256287
env.Append(LINKFLAGS = ['-specs=rdimon.specs'])
@@ -302,17 +333,20 @@ for dirname in os.listdir("./include"):
302333

303334
Export('version_at_least')
304335

305-
if env['opencl']:
306-
SConscript("./opencl-1.2-stubs/SConscript", variant_dir="%s/opencl-1.2-stubs" % build_path, duplicate=0)
307336

308337
if env['gles_compute'] and env['os'] != 'android':
309338
env.Append(CPPPATH = ['#/include/linux'])
310-
SConscript("./opengles-3.1-stubs/SConscript", variant_dir="%s/opengles-3.1-stubs" % build_path, duplicate=0)
311339

312340
SConscript('./SConscript', variant_dir=build_path, duplicate=0)
313341

314-
if env['examples'] and env['os'] != 'bare_metal' and env['exceptions']:
342+
if env['examples'] and env['exceptions']:
343+
if env['os'] == 'bare_metal' and env['arch'] == 'armv7a':
344+
print("WARNING: Building examples for bare metal and armv7a is not supported. Use examples=0")
345+
Return()
315346
SConscript('./examples/SConscript', variant_dir='%s/examples' % build_path, duplicate=0)
316347

317-
if env['os'] != 'bare_metal' and env['exceptions']:
348+
if env['exceptions']:
349+
if env['os'] == 'bare_metal' and env['arch'] == 'armv7a':
350+
print("WARNING: Building tests for bare metal and armv7a is not supported")
351+
Return()
318352
SConscript('./tests/SConscript', variant_dir='%s/tests' % build_path, duplicate=0)

arm_compute/core/AccessWindowAutoPadding.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2017-2018 ARM Limited.
2+
* Copyright (c) 2017-2019 ARM Limited.
33
*
44
* SPDX-License-Identifier: MIT
55
*
@@ -21,8 +21,8 @@
2121
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2222
* SOFTWARE.
2323
*/
24-
#ifndef __ARM_COMPUTE_ACCESS_WINDOW_AUTO_PADDING_H__
25-
#define __ARM_COMPUTE_ACCESS_WINDOW_AUTO_PADDING_H__
24+
#ifndef ARM_COMPUTE_ACCESS_WINDOW_AUTO_PADDING_H
25+
#define ARM_COMPUTE_ACCESS_WINDOW_AUTO_PADDING_H
2626

2727
#include "arm_compute/core/Coordinates.h"
2828
#include "arm_compute/core/IAccessWindow.h"
@@ -82,4 +82,4 @@ class AccessWindowAutoPadding : public IAccessWindow
8282
ITensorInfo *_info;
8383
};
8484
} // namespace arm_compute
85-
#endif /*__ARM_COMPUTE_ACCESS_WINDOW_AUTO_PADDING_H__*/
85+
#endif /*ARM_COMPUTE_ACCESS_WINDOW_AUTO_PADDING_H*/

arm_compute/core/AccessWindowStatic.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2017-2018 ARM Limited.
2+
* Copyright (c) 2017-2019 ARM Limited.
33
*
44
* SPDX-License-Identifier: MIT
55
*
@@ -21,8 +21,8 @@
2121
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2222
* SOFTWARE.
2323
*/
24-
#ifndef __ARM_COMPUTE_IACCESS_WINDOW_STATIC_H__
25-
#define __ARM_COMPUTE_IACCESS_WINDOW_STATIC_H__
24+
#ifndef ARM_COMPUTE_IACCESS_WINDOW_STATIC_H
25+
#define ARM_COMPUTE_IACCESS_WINDOW_STATIC_H
2626

2727
#include "arm_compute/core/Coordinates.h"
2828
#include "arm_compute/core/IAccessWindow.h"
@@ -98,4 +98,4 @@ class AccessWindowStatic : public IAccessWindow
9898
int _end_y;
9999
};
100100
} // namespace arm_compute
101-
#endif /*__ARM_COMPUTE_IACCESS_WINDOW_STATIC_H__*/
101+
#endif /*ARM_COMPUTE_IACCESS_WINDOW_STATIC_H*/

arm_compute/core/AccessWindowTranspose.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2017-2018 ARM Limited.
2+
* Copyright (c) 2017-2019 ARM Limited.
33
*
44
* SPDX-License-Identifier: MIT
55
*
@@ -21,8 +21,8 @@
2121
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2222
* SOFTWARE.
2323
*/
24-
#ifndef __ARM_COMPUTE_IACCESS_WINDOW_TRANSPOSE_H__
25-
#define __ARM_COMPUTE_IACCESS_WINDOW_TRANSPOSE_H__
24+
#ifndef ARM_COMPUTE_IACCESS_WINDOW_TRANSPOSE_H
25+
#define ARM_COMPUTE_IACCESS_WINDOW_TRANSPOSE_H
2626

2727
#include "arm_compute/core/Coordinates.h"
2828
#include "arm_compute/core/IAccessWindow.h"
@@ -45,4 +45,4 @@ class AccessWindowTranspose : public AccessWindowRectangle
4545
ValidRegion compute_valid_region(const Window &window, ValidRegion input_valid_region, bool border_undefined, BorderSize border_size) const override;
4646
};
4747
} // namespace arm_compute
48-
#endif /*__ARM_COMPUTE_IACCESS_WINDOW_TRANSPOSE_H__*/
48+
#endif /*ARM_COMPUTE_IACCESS_WINDOW_TRANSPOSE_H*/

arm_compute/core/CL/CLCoreRuntimeContext.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2222
* SOFTWARE.
2323
*/
24-
#ifndef __ARM_COMPUTE_CLCORERUNTIME_CONTEXT_H__
25-
#define __ARM_COMPUTE_CLCORERUNTIME_CONTEXT_H__
24+
#ifndef ARM_COMPUTE_CLCORERUNTIME_CONTEXT_H
25+
#define ARM_COMPUTE_CLCORERUNTIME_CONTEXT_H
2626

2727
#include "arm_compute/core/CL/OpenCL.h"
2828

@@ -72,4 +72,4 @@ class CLCoreRuntimeContext final
7272
cl::CommandQueue _queue{};
7373
};
7474
} // namespace arm_compute
75-
#endif /*__ARM_COMPUTE_CLCORERUNTIME_CONTEXT_H__ */
75+
#endif /*ARM_COMPUTE_CLCORERUNTIME_CONTEXT_H */

0 commit comments

Comments
 (0)