Skip to content

Commit 7dcb9fa

Browse files
Jenkinsmdigiorgio
authored andcommitted
arm_compute v21.02
1 parent 49b8f90 commit 7dcb9fa

File tree

1,472 files changed

+55933
-29186
lines changed

Some content is hidden

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

1,472 files changed

+55933
-29186
lines changed

Android.bp

Lines changed: 164 additions & 76 deletions
Large diffs are not rendered by default.

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2017-2020 Arm Limited
3+
Copyright (c) 2017-2021 Arm Limited
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 37 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@ Please report issues here: https://github.com/ARM-software/ComputeLibrary/issues
1010

1111
**Make sure you are using the latest version of the library before opening an issue. Thanks**
1212

13-
Deprecation notice:
14-
- We have deprecated the GLES backend and it will be removed from the library in the release 21.05
15-
- We have deprecated the NEON and OpenCL computer vision functions and they will be removed in 21.05
16-
1713
News:
1814

1915
- [Gian Marco's talk on Performance Analysis for Optimizing Embedded Deep Learning Inference Software](https://www.embedded-vision.com/platinum-members/arm/embedded-vision-training/videos/pages/may-2019-embedded-vision-summit)
@@ -33,7 +29,30 @@ Documentation (API, changelogs, build guide, contribution guide, errata, etc.) a
3329

3430
Binaries available at https://github.com/ARM-software/ComputeLibrary/releases.
3531

36-
License & Contributions: The software is provided under MIT license. Contributions to this project are accepted under the same license.
32+
### Supported Architectures/Technologies
33+
34+
- Arm® CPUs:
35+
- Arm® Cortex®-A processor family using Arm® Neon™ technology
36+
- Arm® Cortex®-R processor family with Armv8-R AArch64 architecture using Arm® Neon™ technology
37+
- Arm® Cortex®-X1 processor using Arm® Neon™ technology
38+
39+
- Arm® Mali™ GPUs:
40+
- Arm® Mali™-G processor family
41+
- Arm® Mali™-T processor family
42+
43+
- x86
44+
45+
### Supported OS
46+
47+
- Android™
48+
- Bare Metal
49+
- Linux®
50+
- macOS®
51+
- Tizen™
52+
53+
## License and Contributions
54+
55+
The software is provided under MIT license. Contributions to this project are accepted under the same license.
3756

3857
### Public mailing list
3958
For technical discussion, the ComputeLibrary project has a public mailing list: [email protected]
@@ -48,3 +67,16 @@ To indicate that you agree to the the terms of the DCO, you "sign off" your cont
4867
```Signed-off-by: John Doe <[email protected]>```
4968

5069
You must use your real name, no pseudonyms or anonymous contributions are accepted.
70+
71+
## Trademarks and Copyrights
72+
73+
Android is a trademark of Google LLC.
74+
75+
Arm, Cortex and Mali are registered trademarks or trademarks of Arm Limited (or its subsidiaries) in the US and/or elsewhere.
76+
77+
Linux® is the registered trademark of Linus Torvalds in the U.S. and other countries.
78+
79+
Mac and macOS are trademarks of Apple Inc., registered in the U.S. and other
80+
countries.
81+
82+
Tizen is a registered trademark of The Linux Foundation.

SConscript

Lines changed: 82 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,12 @@ import collections
2323
import os.path
2424
import re
2525
import subprocess
26+
import zlib
27+
import base64
28+
import string
2629

27-
VERSION = "v20.11"
28-
LIBRARY_VERSION_MAJOR = 21
30+
VERSION = "v21.02"
31+
LIBRARY_VERSION_MAJOR = 22
2932
LIBRARY_VERSION_MINOR = 0
3033
LIBRARY_VERSION_PATCH = 0
3134
SONAME_VERSION = str(LIBRARY_VERSION_MAJOR) + "." + str(LIBRARY_VERSION_MINOR) + "." + str(LIBRARY_VERSION_PATCH)
@@ -42,19 +45,30 @@ def build_bootcode_objs(sources):
4245
Default(obj)
4346
return obj
4447

45-
def build_library(name, sources, static=False, libs=[]):
48+
def build_library(name, build_env, sources, static=False, libs=[]):
4649
if static:
47-
obj = arm_compute_env.StaticLibrary(name, source=sources, LIBS = arm_compute_env["LIBS"] + libs)
50+
obj = build_env.StaticLibrary(name, source=sources, LIBS = arm_compute_env["LIBS"] + libs)
4851
else:
4952
if env['set_soname']:
50-
obj = arm_compute_env.SharedLibrary(name, source=sources, SHLIBVERSION = SONAME_VERSION, LIBS = arm_compute_env["LIBS"] + libs)
53+
obj = build_env.SharedLibrary(name, source=sources, SHLIBVERSION = SONAME_VERSION, LIBS = arm_compute_env["LIBS"] + libs)
5154
else:
52-
obj = arm_compute_env.SharedLibrary(name, source=sources, LIBS = arm_compute_env["LIBS"] + libs)
55+
obj = build_env.SharedLibrary(name, source=sources, LIBS = arm_compute_env["LIBS"] + libs)
5356

5457
obj = install_lib(obj)
5558
Default(obj)
5659
return obj
5760

61+
def remove_incode_comments(code):
62+
def replace_with_empty(match):
63+
s = match.group(0)
64+
if s.startswith('/'):
65+
return " "
66+
else:
67+
return s
68+
69+
comment_regex = re.compile(r'//.*?$|/\*.*?\*/|\'(?:\\.|[^\\\'])*\'|"(?:\\.|[^\\"])*"', re.DOTALL | re.MULTILINE)
70+
return re.sub(comment_regex, replace_with_empty, code)
71+
5872
def resolve_includes(target, source, env):
5973
# File collection
6074
FileEntry = collections.namedtuple('FileEntry', 'target_name file_contents')
@@ -67,7 +81,8 @@ def resolve_includes(target, source, env):
6781
for i in range(len(source)):
6882
src = source[i]
6983
dst = target[i]
70-
contents = src.get_contents().decode('utf-8').splitlines()
84+
contents = src.get_contents().decode('utf-8')
85+
contents = remove_incode_comments(contents).splitlines()
7186
entry = FileEntry(target_name=dst, file_contents=contents)
7287
files.append((os.path.basename(src.get_path()),entry))
7388

@@ -100,15 +115,17 @@ def resolve_includes(target, source, env):
100115
tmp_file = updated_file
101116

102117
# Append and prepend string literal identifiers and add expanded file to final list
103-
tmp_file.insert(0, "R\"(\n")
104-
tmp_file.append("\n)\"")
105118
entry = FileEntry(target_name=file[1].target_name, file_contents=tmp_file)
106119
final_files.append((file[0], entry))
107120

108121
# Write output files
109122
for file in final_files:
110123
with open(file[1].target_name.get_path(), 'w+') as out_file:
111-
out_file.write( "\n".join( file[1].file_contents ))
124+
file_to_write = "\n".join( file[1].file_contents )
125+
if env['compress_kernels']:
126+
file_to_write = zlib.compress(file_to_write, 9).encode("base64").replace("\n", "")
127+
file_to_write = "R\"(" + file_to_write + ")\""
128+
out_file.write(file_to_write)
112129

113130
def create_version_file(target, source, env):
114131
# Generate string with build options library version to embed in the library:
@@ -125,6 +142,9 @@ arm_compute_env = env.Clone()
125142
version_file = arm_compute_env.Command("src/core/arm_compute_version.embed", "", action=create_version_file)
126143
arm_compute_env.AlwaysBuild(version_file)
127144

145+
default_cpp_compiler = 'g++' if env['os'] not in ['android', 'macos'] else 'clang++'
146+
cpp_compiler = os.environ.get('CXX', default_cpp_compiler)
147+
128148
# Generate embed files
129149
generate_embed = [ version_file ]
130150
if env['opencl'] and env['embed_kernels']:
@@ -156,7 +176,8 @@ arm_compute_env.Append(CPPDEFINES = [('ARM_COMPUTE_VERSION_MAJOR', LIBRARY_VERSI
156176

157177

158178
# Don't allow undefined references in the libraries:
159-
arm_compute_env.Append(LINKFLAGS=['-Wl,--no-undefined'])
179+
undefined_flag = '-Wl,-undefined,error' if 'macos' in arm_compute_env["os"] else '-Wl,--no-undefined'
180+
arm_compute_env.Append(LINKFLAGS=[undefined_flag])
160181
arm_compute_env.Append(CPPPATH =[Dir("./src/core/").path] )
161182

162183
arm_compute_env.Append(LIBS = ['dl'])
@@ -196,11 +217,17 @@ if env['opencl']:
196217
core_files += Glob('src/core/CL/gemm/native/*.cpp')
197218
core_files += Glob('src/core/CL/gemm/reshaped/*.cpp')
198219
core_files += Glob('src/core/CL/gemm/reshaped_only_rhs/*.cpp')
220+
core_files += Glob('src/core/gpu/cl/*.cpp')
221+
core_files += Glob('src/core/gpu/cl/kernels/*.cpp')
199222

200223
runtime_files += Glob('src/runtime/CL/*.cpp')
201224
runtime_files += Glob('src/runtime/CL/functions/*.cpp')
202225
runtime_files += Glob('src/runtime/CL/gemm/*.cpp')
203226
runtime_files += Glob('src/runtime/CL/tuners/*.cpp')
227+
runtime_files += Glob('src/runtime/gpu/cl/*.cpp')
228+
runtime_files += Glob('src/runtime/gpu/cl/operators/*.cpp')
229+
runtime_files += Glob('src/runtime/CL/mlgo/*.cpp')
230+
runtime_files += Glob('src/runtime/CL/gemm_auto_heuristics/*.cpp')
204231

205232
graph_files += Glob('src/graph/backends/CL/*.cpp')
206233

@@ -211,6 +238,9 @@ if env['neon']:
211238
core_files += Glob('src/core/NEON/kernels/assembly/*.cpp')
212239

213240
core_files += Glob('src/core/NEON/kernels/arm_gemm/*.cpp')
241+
core_files += Glob('src/core/NEON/kernels/arm_conv/*.cpp')
242+
core_files += Glob('src/core/NEON/kernels/arm_conv/pooling/*.cpp')
243+
core_files += Glob('src/core/NEON/kernels/arm_conv/pooling/kernels/cpp_*/*.cpp')
214244

215245
# build winograd/depthwise sources for either v7a / v8a
216246
core_files += Glob('src/core/NEON/kernels/convolution/*/*.cpp')
@@ -228,24 +258,50 @@ if env['neon']:
228258

229259
if env['estate'] == '64':
230260
core_files += Glob('src/core/NEON/kernels/arm_gemm/kernels/a64_*/*.cpp')
261+
core_files += Glob('src/core/NEON/kernels/arm_conv/pooling/kernels/a64_*/*.cpp')
231262
if "sve" in env['arch']:
232263
core_files += Glob('src/core/NEON/kernels/arm_gemm/kernels/sve_*/*.cpp')
264+
core_files += Glob('src/core/NEON/kernels/arm_conv/pooling/kernels/sve_*/*.cpp')
233265

234266
if any(i in env['data_type_support'] for i in ['all', 'fp16']):
235-
core_files += Glob('src/core/NEON/kernels/*/impl/fp16_*.cpp')
267+
core_files += Glob('src/core/NEON/kernels/*/impl/*/fp16.cpp')
236268
if any(i in env['data_type_support'] for i in ['all', 'fp32']):
237-
core_files += Glob('src/core/NEON/kernels/*/impl/fp32_*.cpp')
269+
core_files += Glob('src/core/NEON/kernels/*/impl/*/fp32.cpp')
238270
if any(i in env['data_type_support'] for i in ['all', 'qasymm8']):
239-
core_files += Glob('src/core/NEON/kernels/*/impl/qasymm8_neon*.cpp')
271+
core_files += Glob('src/core/NEON/kernels/*/impl/*/qasymm8.cpp')
240272
if any(i in env['data_type_support'] for i in ['all', 'qasymm8_signed']):
241-
core_files += Glob('src/core/NEON/kernels/*/impl/qasymm8_signed_*.cpp')
273+
core_files += Glob('src/core/NEON/kernels/*/impl/*/qasymm8_signed.cpp')
242274
if any(i in env['data_type_support'] for i in ['all', 'qsymm16']):
243-
core_files += Glob('src/core/NEON/kernels/*/impl/qsymm16_*.cpp')
275+
core_files += Glob('src/core/NEON/kernels/*/impl/*/qsymm16.cpp')
276+
if any(i in env['data_type_support'] for i in ['all', 'integer']):
277+
core_files += Glob('src/core/NEON/kernels/*/impl/*/integer.cpp')
244278

245279
runtime_files += Glob('src/runtime/NEON/*.cpp')
246280
runtime_files += Glob('src/runtime/NEON/functions/*.cpp')
247281
runtime_files += Glob('src/runtime/NEON/functions/assembly/*.cpp')
248282

283+
core_files += Glob('src/core/cpu/*.cpp')
284+
core_files += Glob('src/core/cpu/kernels/*.cpp')
285+
core_files += Glob('src/core/cpu/kernels/*/*.cpp')
286+
if any(i in env['data_type_support'] for i in ['all', 'fp16']):
287+
core_files += Glob('src/core/cpu/kernels/*/*/fp16.cpp')
288+
if any(i in env['data_type_support'] for i in ['all', 'fp32']):
289+
core_files += Glob('src/core/cpu/kernels/*/*/fp32.cpp')
290+
if any(i in env['data_type_support'] for i in ['all', 'qasymm8']):
291+
core_files += Glob('src/core/cpu/kernels/*/*/qasymm8.cpp')
292+
if any(i in env['data_type_support'] for i in ['all', 'qasymm8_signed']):
293+
core_files += Glob('src/core/cpu/kernels/*/*/qasymm8_signed.cpp')
294+
if any(i in env['data_type_support'] for i in ['all', 'qsymm16']):
295+
core_files += Glob('src/core/cpu/kernels/*/*/qsymm16.cpp')
296+
if any(i in env['data_type_support'] for i in ['all', 'integer']):
297+
core_files += Glob('src/core/cpu/kernels/*/*/integer.cpp')
298+
299+
if any(i in env['data_layout_support'] for i in ['all', 'nchw']):
300+
core_files += Glob('src/core/cpu/kernels/*/*/nchw/all.cpp')
301+
302+
runtime_files += Glob('src/runtime/cpu/*.cpp')
303+
runtime_files += Glob('src/runtime/cpu/operators/*.cpp')
304+
249305
if env['gles_compute']:
250306
if env['os'] != 'android':
251307
arm_compute_env.Append(CPPPATH = ["#opengles-3.1/include", "#opengles-3.1/mali_include"])
@@ -270,26 +326,30 @@ if env['os'] == 'bare_metal':
270326
bootcode_o = build_bootcode_objs(bootcode_files)
271327
Export('bootcode_o')
272328

273-
arm_compute_core_a = build_library('arm_compute_core-static', core_files, static=True)
329+
arm_compute_core_a = build_library('arm_compute_core-static', arm_compute_env, core_files, static=True)
274330
Export('arm_compute_core_a')
275331

276332
if env['os'] != 'bare_metal' and not env['standalone']:
277-
arm_compute_core_so = build_library('arm_compute_core', core_files, static=False)
333+
arm_compute_core_so = build_library('arm_compute_core', arm_compute_env, core_files, static=False)
278334
Export('arm_compute_core_so')
279335

280-
arm_compute_a = build_library('arm_compute-static', runtime_files, static=True, libs = [ arm_compute_core_a ])
336+
arm_compute_a = build_library('arm_compute-static', arm_compute_env, runtime_files, static=True, libs = [ arm_compute_core_a ])
281337
Export('arm_compute_a')
282338

283339
if env['os'] != 'bare_metal' and not env['standalone']:
284-
arm_compute_so = build_library('arm_compute', runtime_files, static=False, libs = [ "arm_compute_core" ])
340+
arm_compute_so = build_library('arm_compute', arm_compute_env, runtime_files, static=False, libs = [ "arm_compute_core" ])
285341
Depends(arm_compute_so, arm_compute_core_so)
286342
Export('arm_compute_so')
287343

288-
arm_compute_graph_a = build_library('arm_compute_graph-static', graph_files, static=True, libs = [ arm_compute_a])
344+
arm_compute_graph_env = arm_compute_env.Clone()
345+
346+
arm_compute_graph_env.Append(CXXFLAGS = ['-Wno-redundant-move', '-Wno-pessimizing-move'])
347+
348+
arm_compute_graph_a = build_library('arm_compute_graph-static', arm_compute_graph_env, graph_files, static=True, libs = [ arm_compute_a])
289349
Export('arm_compute_graph_a')
290350

291351
if env['os'] != 'bare_metal' and not env['standalone']:
292-
arm_compute_graph_so = build_library('arm_compute_graph', graph_files, static=False, libs = [ "arm_compute" , "arm_compute_core"])
352+
arm_compute_graph_so = build_library('arm_compute_graph', arm_compute_graph_env, graph_files, static=False, libs = [ "arm_compute" , "arm_compute_core"])
293353
Depends(arm_compute_graph_so, arm_compute_so)
294354
Export('arm_compute_graph_so')
295355

0 commit comments

Comments
 (0)