Skip to content

Commit f7399fd

Browse files
author
Jenkins
committed
arm_compute v21.05
1 parent 7dcb9fa commit f7399fd

File tree

1,797 files changed

+88484
-160330
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,797 files changed

+88484
-160330
lines changed

Android.bp

Lines changed: 79 additions & 219 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ Binaries available at https://github.com/ARM-software/ComputeLibrary/releases.
4242

4343
- x86
4444

45-
### Supported OS
45+
### Supported Systems
4646

4747
- Android™
4848
- Bare Metal
@@ -72,7 +72,7 @@ You must use your real name, no pseudonyms or anonymous contributions are accept
7272

7373
Android is a trademark of Google LLC.
7474

75-
Arm, Cortex and Mali are registered trademarks or trademarks of Arm Limited (or its subsidiaries) in the US and/or elsewhere.
75+
Arm, Cortex, Mali and Neon are registered trademarks or trademarks of Arm Limited (or its subsidiaries) in the US and/or elsewhere.
7676

7777
Linux® is the registered trademark of Linus Torvalds in the U.S. and other countries.
7878

SConscript

Lines changed: 84 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ import zlib
2727
import base64
2828
import string
2929

30-
VERSION = "v21.02"
31-
LIBRARY_VERSION_MAJOR = 22
30+
VERSION = "v21.05"
31+
LIBRARY_VERSION_MAJOR = 23
3232
LIBRARY_VERSION_MINOR = 0
3333
LIBRARY_VERSION_PATCH = 0
3434
SONAME_VERSION = str(LIBRARY_VERSION_MAJOR) + "." + str(LIBRARY_VERSION_MINOR) + "." + str(LIBRARY_VERSION_PATCH)
@@ -156,15 +156,6 @@ if env['opencl'] and env['embed_kernels']:
156156

157157
generate_embed.append(arm_compute_env.Command(embed_files, cl_files, action=resolve_includes))
158158

159-
if env['gles_compute'] and env['embed_kernels']:
160-
cs_files = Glob('src/core/GLES_COMPUTE/cs_shaders/*.cs')
161-
cs_files += Glob('src/core/GLES_COMPUTE/cs_shaders/*.h')
162-
163-
embed_files = [ f.get_path()+"embed" for f in cs_files ]
164-
arm_compute_env.Append(CPPPATH =[Dir("./src/core/GLES_COMPUTE/").path] )
165-
166-
generate_embed.append(arm_compute_env.Command(embed_files, cs_files, action=resolve_includes))
167-
168159
Default(generate_embed)
169160
if env["build"] == "embed_only":
170161
Return()
@@ -174,7 +165,6 @@ arm_compute_env.Append(CPPDEFINES = [('ARM_COMPUTE_VERSION_MAJOR', LIBRARY_VERSI
174165
('ARM_COMPUTE_VERSION_MINOR', LIBRARY_VERSION_MINOR),
175166
('ARM_COMPUTE_VERSION_PATCH', LIBRARY_VERSION_PATCH)])
176167

177-
178168
# Don't allow undefined references in the libraries:
179169
undefined_flag = '-Wl,-undefined,error' if 'macos' in arm_compute_env["os"] else '-Wl,--no-undefined'
180170
arm_compute_env.Append(LINKFLAGS=[undefined_flag])
@@ -198,6 +188,25 @@ runtime_files = Glob('src/runtime/*.cpp')
198188
runtime_files += Glob('src/runtime/CPP/ICPPSimpleFunction.cpp')
199189
runtime_files += Glob('src/runtime/CPP/functions/*.cpp')
200190

191+
# C API files
192+
c_api_files = ['src/c/AclContext.cpp',
193+
'src/c/AclQueue.cpp',
194+
'src/c/AclTensor.cpp',
195+
'src/c/AclTensorPack.cpp',
196+
'src/c/AclVersion.cpp',
197+
]
198+
if env['opencl']:
199+
c_api_files += ['src/c/cl/AclOpenClExt.cpp']
200+
201+
# Common backend files
202+
common_backend_files = ['src/common/utils/LegacySupport.cpp',
203+
'src/common/AllocatorWrapper.cpp',
204+
'src/common/ITensorV2.cpp',
205+
'src/common/TensorPack.cpp',
206+
]
207+
208+
core_files += common_backend_files
209+
runtime_files += c_api_files
201210
# CLHarrisCorners uses the Scheduler to run CPP kernels
202211
runtime_files += Glob('src/runtime/CPP/SingleThreadScheduler.cpp')
203212

@@ -229,6 +238,8 @@ if env['opencl']:
229238
runtime_files += Glob('src/runtime/CL/mlgo/*.cpp')
230239
runtime_files += Glob('src/runtime/CL/gemm_auto_heuristics/*.cpp')
231240

241+
runtime_files += Glob('src/gpu/cl/*.cpp')
242+
232243
graph_files += Glob('src/graph/backends/CL/*.cpp')
233244

234245

@@ -280,8 +291,36 @@ if env['neon']:
280291
runtime_files += Glob('src/runtime/NEON/functions/*.cpp')
281292
runtime_files += Glob('src/runtime/NEON/functions/assembly/*.cpp')
282293

283-
core_files += Glob('src/core/cpu/*.cpp')
284-
core_files += Glob('src/core/cpu/kernels/*.cpp')
294+
cpu_kernel_hp_files = ['src/core/cpu/kernels/CpuActivationKernel.cpp',
295+
'src/core/cpu/kernels/CpuDepthwiseConvolutionNativeKernel.cpp',
296+
'src/core/cpu/kernels/CpuDirectConvolutionKernel.cpp',
297+
'src/core/cpu/kernels/CpuDirectConvolutionOutputStageKernel.cpp',
298+
'src/core/cpu/kernels/CpuPermuteKernel.cpp',
299+
'src/core/cpu/kernels/CpuPoolingAssemblyWrapperKernel.cpp',
300+
'src/core/cpu/kernels/CpuPoolingKernel.cpp',
301+
'src/core/cpu/kernels/CpuReshapeKernel.cpp',
302+
]
303+
cpu_kernel_files = ['src/core/cpu/kernels/CpuAddKernel.cpp',
304+
'src/core/cpu/kernels/CpuConcatenateBatchKernel.cpp',
305+
'src/core/cpu/kernels/CpuConcatenateDepthKernel.cpp',
306+
'src/core/cpu/kernels/CpuConcatenateHeightKernel.cpp',
307+
'src/core/cpu/kernels/CpuConcatenateWidthKernel.cpp',
308+
'src/core/cpu/kernels/CpuConvertFullyConnectedWeightsKernel.cpp',
309+
'src/core/cpu/kernels/CpuCopyKernel.cpp',
310+
'src/core/cpu/kernels/CpuDequantizationKernel.cpp',
311+
'src/core/cpu/kernels/CpuElementwiseKernel.cpp',
312+
'src/core/cpu/kernels/CpuElementwiseUnaryKernel.cpp',
313+
'src/core/cpu/kernels/CpuFillKernel.cpp',
314+
'src/core/cpu/kernels/CpuFloorKernel.cpp',
315+
'src/core/cpu/kernels/CpuMulKernel.cpp',
316+
'src/core/cpu/kernels/CpuQuantizationKernel.cpp',
317+
'src/core/cpu/kernels/CpuScaleKernel.cpp',
318+
'src/core/cpu/kernels/CpuSoftmaxKernel.cpp',
319+
'src/core/cpu/kernels/CpuSubKernel.cpp',
320+
'src/core/cpu/kernels/CpuTransposeKernel.cpp',
321+
]
322+
core_files += [cpu_kernel_hp_files, cpu_kernel_files]
323+
285324
core_files += Glob('src/core/cpu/kernels/*/*.cpp')
286325
if any(i in env['data_type_support'] for i in ['all', 'fp16']):
287326
core_files += Glob('src/core/cpu/kernels/*/*/fp16.cpp')
@@ -295,30 +334,40 @@ if env['neon']:
295334
core_files += Glob('src/core/cpu/kernels/*/*/qsymm16.cpp')
296335
if any(i in env['data_type_support'] for i in ['all', 'integer']):
297336
core_files += Glob('src/core/cpu/kernels/*/*/integer.cpp')
298-
337+
299338
if any(i in env['data_layout_support'] for i in ['all', 'nchw']):
300339
core_files += Glob('src/core/cpu/kernels/*/*/nchw/all.cpp')
301340

302-
runtime_files += Glob('src/runtime/cpu/*.cpp')
303-
runtime_files += Glob('src/runtime/cpu/operators/*.cpp')
304-
305-
if env['gles_compute']:
306-
if env['os'] != 'android':
307-
arm_compute_env.Append(CPPPATH = ["#opengles-3.1/include", "#opengles-3.1/mali_include"])
308-
309-
core_files += Glob('src/core/GLES_COMPUTE/*.cpp')
310-
core_files += Glob('src/core/GLES_COMPUTE/kernels/*.cpp')
311-
312-
runtime_files += Glob('src/runtime/GLES_COMPUTE/*.cpp')
313-
runtime_files += Glob('src/runtime/GLES_COMPUTE/functions/*.cpp')
314-
315-
graph_files += Glob('src/graph/backends/GLES/*.cpp')
316-
if env['tracing']:
317-
arm_compute_env.Append(CPPDEFINES = ['ARM_COMPUTE_TRACING_ENABLED'])
318-
else:
319-
# Remove TracePoint files if tracing is disabled:
320-
core_files = [ f for f in core_files if not "TracePoint" in str(f)]
321-
runtime_files = [ f for f in runtime_files if not "TracePoint" in str(f)]
341+
cpu_rt_files = ['src/cpu/CpuContext.cpp',
342+
'src/cpu/CpuQueue.cpp',
343+
'src/cpu/CpuTensor.cpp'
344+
]
345+
cpu_operator_hp_files = ['src/runtime/cpu/operators/CpuActivation.cpp',
346+
'src/runtime/cpu/operators/CpuDepthwiseConvolution.cpp',
347+
'src/runtime/cpu/operators/CpuDepthwiseConvolutionAssemblyDispatch.cpp',
348+
'src/runtime/cpu/operators/CpuDirectConvolution.cpp',
349+
'src/runtime/cpu/operators/CpuPermute.cpp',
350+
'src/runtime/cpu/operators/CpuPooling.cpp',
351+
'src/runtime/cpu/operators/CpuPoolingAssemblyDispatch.cpp',
352+
]
353+
cpu_operator_files = ['src/runtime/cpu/operators/CpuAdd.cpp',
354+
'src/runtime/cpu/operators/CpuConcatenate.cpp',
355+
'src/runtime/cpu/operators/CpuConvertFullyConnectedWeights.cpp',
356+
'src/runtime/cpu/operators/CpuCopy.cpp',
357+
'src/runtime/cpu/operators/CpuDequantization.cpp',
358+
'src/runtime/cpu/operators/CpuElementwise.cpp',
359+
'src/runtime/cpu/operators/CpuElementwiseUnary.cpp',
360+
'src/runtime/cpu/operators/CpuFill.cpp',
361+
'src/runtime/cpu/operators/CpuFloor.cpp',
362+
'src/runtime/cpu/operators/CpuMul.cpp',
363+
'src/runtime/cpu/operators/CpuQuantization.cpp',
364+
'src/runtime/cpu/operators/CpuReshape.cpp',
365+
'src/runtime/cpu/operators/CpuScale.cpp',
366+
'src/runtime/cpu/operators/CpuSoftmax.cpp',
367+
'src/runtime/cpu/operators/CpuSub.cpp',
368+
'src/runtime/cpu/operators/CpuTranspose.cpp',
369+
]
370+
runtime_files += [ cpu_rt_files, cpu_operator_hp_files, cpu_operator_files ]
322371

323372
bootcode_o = []
324373
if env['os'] == 'bare_metal':

SConstruct

Lines changed: 15 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
# Copyright (c) 2016, 2017 Arm Limited.
1+
# -*- coding: utf-8 -*-
2+
3+
# Copyright (c) 2016-2021 Arm Limited.
24
#
35
# SPDX-License-Identifier: MIT
46
#
@@ -43,7 +45,7 @@ vars.AddVariables(
4345
BoolVariable("asserts", "Enable asserts (this flag is forced to 1 for debug=1)", False),
4446
BoolVariable("logging", "Logging (this flag is forced to 1 for debug=1)", False),
4547
EnumVariable("arch", "Target Architecture", "armv7a",
46-
allowed_values=("armv7a", "arm64-v8a", "arm64-v8.2-a", "arm64-v8.2-a-sve", "arm64-v8.2-a-sve2", "x86_32", "x86_64",
48+
allowed_values=("armv7a", "armv7a-hf", "arm64-v8a", "arm64-v8.2-a", "arm64-v8.2-a-sve", "arm64-v8.2-a-sve2", "x86_32", "x86_64",
4749
"armv8a", "armv8.2-a", "armv8.2-a-sve", "armv8.6-a", "armv8.6-a-sve", "armv8.6-a-sve2", "armv8r64", "x86")),
4850
EnumVariable("estate", "Execution State", "auto", allowed_values=("auto", "32", "64")),
4951
EnumVariable("os", "Target OS", "linux", allowed_values=("linux", "android", "tizen", "macos", "bare_metal")),
@@ -53,12 +55,10 @@ vars.AddVariables(
5355
BoolVariable("Werror", "Enable/disable the -Werror compilation flag", True),
5456
BoolVariable("standalone", "Builds the tests as standalone executables, links statically with libgcc, libstdc++ and libarm_compute", False),
5557
BoolVariable("opencl", "Enable OpenCL support", True),
56-
BoolVariable("neon", "Enable Neon support", False),
57-
BoolVariable("gles_compute", "Enable OpenGL ES Compute Shader support", False),
58+
BoolVariable("neon", "Enable Arm® Neon™ support", False),
5859
BoolVariable("embed_kernels", "Embed OpenCL kernels and OpenGL ES compute shaders in library binary", True),
5960
BoolVariable("compress_kernels", "Compress embedded OpenCL kernels in library binary. Note embed_kernels should be enabled", False),
6061
BoolVariable("set_soname", "Set the library's soname and shlibversion (requires SCons 2.4 or above)", False),
61-
BoolVariable("tracing", "Enable runtime tracing", False),
6262
BoolVariable("openmp", "Enable OpenMP backend", False),
6363
BoolVariable("cppthreads", "Enable C++11 threads backend", True),
6464
PathVariable("build_dir", "Specify sub-folder for the build", ".", PathVariable.PathAccept),
@@ -124,7 +124,7 @@ if env['build'] == "embed_only":
124124
Return()
125125

126126
if env['neon'] and 'x86' in env['arch']:
127-
print("Cannot compile Neon for x86")
127+
print("Cannot compile Arm® Neon for x86")
128128
Exit(1)
129129

130130
if env['set_soname'] and not version_at_least(SCons.__version__, "2.4"):
@@ -142,8 +142,8 @@ if env['opencl'] and env['embed_kernels'] and env['compress_kernels'] and env['o
142142
Exit(1)
143143

144144
if not env['exceptions']:
145-
if env['opencl'] or env['gles_compute']:
146-
print("ERROR: OpenCL and GLES are not supported when building without exceptions. Use opencl=0 gles_compute=0")
145+
if env['opencl']:
146+
print("ERROR: OpenCL is not supported when building without exceptions. Use opencl=0")
147147
Exit(1)
148148

149149
env.Append(CPPDEFINES = ['ARM_COMPUTE_EXCEPTIONS_DISABLED'])
@@ -180,10 +180,6 @@ if env['cppthreads']:
180180
env.Append(CPPDEFINES = [('ARM_COMPUTE_CPP_SCHEDULER', 1)])
181181

182182
if env['openmp']:
183-
if 'clang++' in cpp_compiler:
184-
print( "Clang does not support OpenMP. Use scheduler=cpp.")
185-
Exit(1)
186-
187183
env.Append(CPPDEFINES = [('ARM_COMPUTE_OPENMP_SCHEDULER', 1)])
188184
env.Append(CXXFLAGS = ['-fopenmp'])
189185
env.Append(LINKFLAGS = ['-fopenmp'])
@@ -207,7 +203,7 @@ if 'v7a' in env['estate'] and env['estate'] == '64':
207203
prefix = ""
208204
if 'v7a' in env['arch']:
209205
env.Append(CXXFLAGS = ['-march=armv7-a', '-mthumb', '-mfpu=neon'])
210-
if env['os'] == 'android' or env['os'] == 'tizen':
206+
if (env['os'] == 'android' or env['os'] == 'tizen') and not 'hf' in env['arch']:
211207
env.Append(CXXFLAGS = ['-mfloat-abi=softfp'])
212208
else:
213209
env.Append(CXXFLAGS = ['-mfloat-abi=hard'])
@@ -290,7 +286,7 @@ if not GetOption("help"):
290286
print("GCC 6.2.1 or newer is required to compile armv8.2-a code")
291287
Exit(1)
292288
elif env['arch'] == 'arm64-v8a' and not version_at_least(compiler_ver, '4.9'):
293-
print("GCC 4.9 or newer is required to compile Neon code for AArch64")
289+
print("GCC 4.9 or newer is required to compile Arm® Neon code for AArch64")
294290
Exit(1)
295291

296292
if version_at_least(compiler_ver, '6.1'):
@@ -345,20 +341,19 @@ if env['os'] == 'linux' and env['arch'] == 'armv7a':
345341
if env['specs_file'] != "":
346342
env.Append(LINKFLAGS = ['-specs='+env['specs_file']])
347343

344+
if env['neon']:
345+
env.Append(CPPDEFINES = ['ARM_COMPUTE_CPU_ENABLED'])
346+
348347
if env['opencl']:
348+
env.Append(CPPDEFINES = ['ARM_COMPUTE_OPENCL_ENABLED'])
349349
if env['os'] in ['bare_metal'] or env['standalone']:
350350
print("Cannot link OpenCL statically, which is required for bare metal / standalone builds")
351351
Exit(1)
352352

353-
if env['gles_compute']:
354-
if env['os'] in ['bare_metal'] or env['standalone']:
355-
print("Cannot link OpenGLES statically, which is required for bare metal / standalone builds")
356-
Exit(1)
357-
358353
if env["os"] not in ["android", "bare_metal"] and (env['opencl'] or env['cppthreads']):
359354
env.Append(LIBS = ['pthread'])
360355

361-
if env['opencl'] or env['gles_compute']:
356+
if env['opencl']:
362357
if env['embed_kernels']:
363358
env.Append(CPPDEFINES = ['EMBEDDED_KERNELS'])
364359
if env['compress_kernels']:
@@ -392,9 +387,6 @@ for dirname in os.listdir("./include"):
392387

393388
Export('version_at_least')
394389

395-
if env['gles_compute'] and env['os'] != 'android':
396-
env.Append(CPPPATH = ['#/include/linux'])
397-
398390
SConscript('./SConscript', variant_dir=build_path, duplicate=0)
399391

400392
if env['examples'] and env['exceptions']:
Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2016, 2017 Arm Limited.
2+
* Copyright (c) 2021 Arm Limited.
33
*
44
* SPDX-License-Identifier: MIT
55
*
@@ -21,19 +21,20 @@
2121
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2222
* SOFTWARE.
2323
*/
24-
#include "arm_compute/core/CL/ICLMultiImage.h"
24+
#ifndef ARM_COMPUTE_ACL_H_
25+
#define ARM_COMPUTE_ACL_H_
2526

26-
#include "arm_compute/core/CL/ICLTensor.h"
27-
#include "arm_compute/core/ITensor.h"
27+
#ifdef __cplusplus
28+
extern "C" {
29+
#endif /* __cplusplus */
2830

29-
using namespace arm_compute;
31+
/* Core headers */
32+
#include "arm_compute/AclEntrypoints.h"
33+
#include "arm_compute/AclTypes.h"
34+
#include "arm_compute/AclUtils.h"
35+
#include "arm_compute/AclVersion.h"
3036

31-
IImage *ICLMultiImage::plane(unsigned int index)
32-
{
33-
return cl_plane(index);
34-
}
35-
36-
const IImage *ICLMultiImage::plane(unsigned int index) const
37-
{
38-
return cl_plane(index);
37+
#ifdef __cplusplus
3938
}
39+
#endif /* __cplusplus */
40+
#endif /* ARM_COMPUTE_ACL_H_ */

0 commit comments

Comments
 (0)