Skip to content

Commit

Permalink
arm_compute v21.05
Browse files Browse the repository at this point in the history
  • Loading branch information
Jenkins committed May 18, 2021
1 parent 7dcb9fa commit f7399fd
Show file tree
Hide file tree
Showing 1,797 changed files with 88,484 additions and 160,330 deletions.
298 changes: 79 additions & 219 deletions Android.bp

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Binaries available at https://github.com/ARM-software/ComputeLibrary/releases.

- x86

### Supported OS
### Supported Systems

- Android™
- Bare Metal
Expand Down Expand Up @@ -72,7 +72,7 @@ You must use your real name, no pseudonyms or anonymous contributions are accept

Android is a trademark of Google LLC.

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

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

Expand Down
119 changes: 84 additions & 35 deletions SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ import zlib
import base64
import string

VERSION = "v21.02"
LIBRARY_VERSION_MAJOR = 22
VERSION = "v21.05"
LIBRARY_VERSION_MAJOR = 23
LIBRARY_VERSION_MINOR = 0
LIBRARY_VERSION_PATCH = 0
SONAME_VERSION = str(LIBRARY_VERSION_MAJOR) + "." + str(LIBRARY_VERSION_MINOR) + "." + str(LIBRARY_VERSION_PATCH)
Expand Down Expand Up @@ -156,15 +156,6 @@ if env['opencl'] and env['embed_kernels']:

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

if env['gles_compute'] and env['embed_kernels']:
cs_files = Glob('src/core/GLES_COMPUTE/cs_shaders/*.cs')
cs_files += Glob('src/core/GLES_COMPUTE/cs_shaders/*.h')

embed_files = [ f.get_path()+"embed" for f in cs_files ]
arm_compute_env.Append(CPPPATH =[Dir("./src/core/GLES_COMPUTE/").path] )

generate_embed.append(arm_compute_env.Command(embed_files, cs_files, action=resolve_includes))

Default(generate_embed)
if env["build"] == "embed_only":
Return()
Expand All @@ -174,7 +165,6 @@ arm_compute_env.Append(CPPDEFINES = [('ARM_COMPUTE_VERSION_MAJOR', LIBRARY_VERSI
('ARM_COMPUTE_VERSION_MINOR', LIBRARY_VERSION_MINOR),
('ARM_COMPUTE_VERSION_PATCH', LIBRARY_VERSION_PATCH)])


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

# C API files
c_api_files = ['src/c/AclContext.cpp',
'src/c/AclQueue.cpp',
'src/c/AclTensor.cpp',
'src/c/AclTensorPack.cpp',
'src/c/AclVersion.cpp',
]
if env['opencl']:
c_api_files += ['src/c/cl/AclOpenClExt.cpp']

# Common backend files
common_backend_files = ['src/common/utils/LegacySupport.cpp',
'src/common/AllocatorWrapper.cpp',
'src/common/ITensorV2.cpp',
'src/common/TensorPack.cpp',
]

core_files += common_backend_files
runtime_files += c_api_files
# CLHarrisCorners uses the Scheduler to run CPP kernels
runtime_files += Glob('src/runtime/CPP/SingleThreadScheduler.cpp')

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

runtime_files += Glob('src/gpu/cl/*.cpp')

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


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

core_files += Glob('src/core/cpu/*.cpp')
core_files += Glob('src/core/cpu/kernels/*.cpp')
cpu_kernel_hp_files = ['src/core/cpu/kernels/CpuActivationKernel.cpp',
'src/core/cpu/kernels/CpuDepthwiseConvolutionNativeKernel.cpp',
'src/core/cpu/kernels/CpuDirectConvolutionKernel.cpp',
'src/core/cpu/kernels/CpuDirectConvolutionOutputStageKernel.cpp',
'src/core/cpu/kernels/CpuPermuteKernel.cpp',
'src/core/cpu/kernels/CpuPoolingAssemblyWrapperKernel.cpp',
'src/core/cpu/kernels/CpuPoolingKernel.cpp',
'src/core/cpu/kernels/CpuReshapeKernel.cpp',
]
cpu_kernel_files = ['src/core/cpu/kernels/CpuAddKernel.cpp',
'src/core/cpu/kernels/CpuConcatenateBatchKernel.cpp',
'src/core/cpu/kernels/CpuConcatenateDepthKernel.cpp',
'src/core/cpu/kernels/CpuConcatenateHeightKernel.cpp',
'src/core/cpu/kernels/CpuConcatenateWidthKernel.cpp',
'src/core/cpu/kernels/CpuConvertFullyConnectedWeightsKernel.cpp',
'src/core/cpu/kernels/CpuCopyKernel.cpp',
'src/core/cpu/kernels/CpuDequantizationKernel.cpp',
'src/core/cpu/kernels/CpuElementwiseKernel.cpp',
'src/core/cpu/kernels/CpuElementwiseUnaryKernel.cpp',
'src/core/cpu/kernels/CpuFillKernel.cpp',
'src/core/cpu/kernels/CpuFloorKernel.cpp',
'src/core/cpu/kernels/CpuMulKernel.cpp',
'src/core/cpu/kernels/CpuQuantizationKernel.cpp',
'src/core/cpu/kernels/CpuScaleKernel.cpp',
'src/core/cpu/kernels/CpuSoftmaxKernel.cpp',
'src/core/cpu/kernels/CpuSubKernel.cpp',
'src/core/cpu/kernels/CpuTransposeKernel.cpp',
]
core_files += [cpu_kernel_hp_files, cpu_kernel_files]

core_files += Glob('src/core/cpu/kernels/*/*.cpp')
if any(i in env['data_type_support'] for i in ['all', 'fp16']):
core_files += Glob('src/core/cpu/kernels/*/*/fp16.cpp')
Expand All @@ -295,30 +334,40 @@ if env['neon']:
core_files += Glob('src/core/cpu/kernels/*/*/qsymm16.cpp')
if any(i in env['data_type_support'] for i in ['all', 'integer']):
core_files += Glob('src/core/cpu/kernels/*/*/integer.cpp')

if any(i in env['data_layout_support'] for i in ['all', 'nchw']):
core_files += Glob('src/core/cpu/kernels/*/*/nchw/all.cpp')

runtime_files += Glob('src/runtime/cpu/*.cpp')
runtime_files += Glob('src/runtime/cpu/operators/*.cpp')

if env['gles_compute']:
if env['os'] != 'android':
arm_compute_env.Append(CPPPATH = ["#opengles-3.1/include", "#opengles-3.1/mali_include"])

core_files += Glob('src/core/GLES_COMPUTE/*.cpp')
core_files += Glob('src/core/GLES_COMPUTE/kernels/*.cpp')

runtime_files += Glob('src/runtime/GLES_COMPUTE/*.cpp')
runtime_files += Glob('src/runtime/GLES_COMPUTE/functions/*.cpp')

graph_files += Glob('src/graph/backends/GLES/*.cpp')
if env['tracing']:
arm_compute_env.Append(CPPDEFINES = ['ARM_COMPUTE_TRACING_ENABLED'])
else:
# Remove TracePoint files if tracing is disabled:
core_files = [ f for f in core_files if not "TracePoint" in str(f)]
runtime_files = [ f for f in runtime_files if not "TracePoint" in str(f)]
cpu_rt_files = ['src/cpu/CpuContext.cpp',
'src/cpu/CpuQueue.cpp',
'src/cpu/CpuTensor.cpp'
]
cpu_operator_hp_files = ['src/runtime/cpu/operators/CpuActivation.cpp',
'src/runtime/cpu/operators/CpuDepthwiseConvolution.cpp',
'src/runtime/cpu/operators/CpuDepthwiseConvolutionAssemblyDispatch.cpp',
'src/runtime/cpu/operators/CpuDirectConvolution.cpp',
'src/runtime/cpu/operators/CpuPermute.cpp',
'src/runtime/cpu/operators/CpuPooling.cpp',
'src/runtime/cpu/operators/CpuPoolingAssemblyDispatch.cpp',
]
cpu_operator_files = ['src/runtime/cpu/operators/CpuAdd.cpp',
'src/runtime/cpu/operators/CpuConcatenate.cpp',
'src/runtime/cpu/operators/CpuConvertFullyConnectedWeights.cpp',
'src/runtime/cpu/operators/CpuCopy.cpp',
'src/runtime/cpu/operators/CpuDequantization.cpp',
'src/runtime/cpu/operators/CpuElementwise.cpp',
'src/runtime/cpu/operators/CpuElementwiseUnary.cpp',
'src/runtime/cpu/operators/CpuFill.cpp',
'src/runtime/cpu/operators/CpuFloor.cpp',
'src/runtime/cpu/operators/CpuMul.cpp',
'src/runtime/cpu/operators/CpuQuantization.cpp',
'src/runtime/cpu/operators/CpuReshape.cpp',
'src/runtime/cpu/operators/CpuScale.cpp',
'src/runtime/cpu/operators/CpuSoftmax.cpp',
'src/runtime/cpu/operators/CpuSub.cpp',
'src/runtime/cpu/operators/CpuTranspose.cpp',
]
runtime_files += [ cpu_rt_files, cpu_operator_hp_files, cpu_operator_files ]

bootcode_o = []
if env['os'] == 'bare_metal':
Expand Down
38 changes: 15 additions & 23 deletions SConstruct
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Copyright (c) 2016, 2017 Arm Limited.
# -*- coding: utf-8 -*-

# Copyright (c) 2016-2021 Arm Limited.
#
# SPDX-License-Identifier: MIT
#
Expand Down Expand Up @@ -43,7 +45,7 @@ vars.AddVariables(
BoolVariable("asserts", "Enable asserts (this flag is forced to 1 for debug=1)", False),
BoolVariable("logging", "Logging (this flag is forced to 1 for debug=1)", False),
EnumVariable("arch", "Target Architecture", "armv7a",
allowed_values=("armv7a", "arm64-v8a", "arm64-v8.2-a", "arm64-v8.2-a-sve", "arm64-v8.2-a-sve2", "x86_32", "x86_64",
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",
"armv8a", "armv8.2-a", "armv8.2-a-sve", "armv8.6-a", "armv8.6-a-sve", "armv8.6-a-sve2", "armv8r64", "x86")),
EnumVariable("estate", "Execution State", "auto", allowed_values=("auto", "32", "64")),
EnumVariable("os", "Target OS", "linux", allowed_values=("linux", "android", "tizen", "macos", "bare_metal")),
Expand All @@ -53,12 +55,10 @@ vars.AddVariables(
BoolVariable("Werror", "Enable/disable the -Werror compilation flag", True),
BoolVariable("standalone", "Builds the tests as standalone executables, links statically with libgcc, libstdc++ and libarm_compute", False),
BoolVariable("opencl", "Enable OpenCL support", True),
BoolVariable("neon", "Enable Neon support", False),
BoolVariable("gles_compute", "Enable OpenGL ES Compute Shader support", False),
BoolVariable("neon", "Enable Arm® Neon™ support", False),
BoolVariable("embed_kernels", "Embed OpenCL kernels and OpenGL ES compute shaders in library binary", True),
BoolVariable("compress_kernels", "Compress embedded OpenCL kernels in library binary. Note embed_kernels should be enabled", False),
BoolVariable("set_soname", "Set the library's soname and shlibversion (requires SCons 2.4 or above)", False),
BoolVariable("tracing", "Enable runtime tracing", False),
BoolVariable("openmp", "Enable OpenMP backend", False),
BoolVariable("cppthreads", "Enable C++11 threads backend", True),
PathVariable("build_dir", "Specify sub-folder for the build", ".", PathVariable.PathAccept),
Expand Down Expand Up @@ -124,7 +124,7 @@ if env['build'] == "embed_only":
Return()

if env['neon'] and 'x86' in env['arch']:
print("Cannot compile Neon for x86")
print("Cannot compile Arm® Neon for x86")
Exit(1)

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

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

env.Append(CPPDEFINES = ['ARM_COMPUTE_EXCEPTIONS_DISABLED'])
Expand Down Expand Up @@ -180,10 +180,6 @@ if env['cppthreads']:
env.Append(CPPDEFINES = [('ARM_COMPUTE_CPP_SCHEDULER', 1)])

if env['openmp']:
if 'clang++' in cpp_compiler:
print( "Clang does not support OpenMP. Use scheduler=cpp.")
Exit(1)

env.Append(CPPDEFINES = [('ARM_COMPUTE_OPENMP_SCHEDULER', 1)])
env.Append(CXXFLAGS = ['-fopenmp'])
env.Append(LINKFLAGS = ['-fopenmp'])
Expand All @@ -207,7 +203,7 @@ if 'v7a' in env['estate'] and env['estate'] == '64':
prefix = ""
if 'v7a' in env['arch']:
env.Append(CXXFLAGS = ['-march=armv7-a', '-mthumb', '-mfpu=neon'])
if env['os'] == 'android' or env['os'] == 'tizen':
if (env['os'] == 'android' or env['os'] == 'tizen') and not 'hf' in env['arch']:
env.Append(CXXFLAGS = ['-mfloat-abi=softfp'])
else:
env.Append(CXXFLAGS = ['-mfloat-abi=hard'])
Expand Down Expand Up @@ -290,7 +286,7 @@ if not GetOption("help"):
print("GCC 6.2.1 or newer is required to compile armv8.2-a code")
Exit(1)
elif env['arch'] == 'arm64-v8a' and not version_at_least(compiler_ver, '4.9'):
print("GCC 4.9 or newer is required to compile Neon code for AArch64")
print("GCC 4.9 or newer is required to compile Arm® Neon code for AArch64")
Exit(1)

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

if env['neon']:
env.Append(CPPDEFINES = ['ARM_COMPUTE_CPU_ENABLED'])

if env['opencl']:
env.Append(CPPDEFINES = ['ARM_COMPUTE_OPENCL_ENABLED'])
if env['os'] in ['bare_metal'] or env['standalone']:
print("Cannot link OpenCL statically, which is required for bare metal / standalone builds")
Exit(1)

if env['gles_compute']:
if env['os'] in ['bare_metal'] or env['standalone']:
print("Cannot link OpenGLES statically, which is required for bare metal / standalone builds")
Exit(1)

if env["os"] not in ["android", "bare_metal"] and (env['opencl'] or env['cppthreads']):
env.Append(LIBS = ['pthread'])

if env['opencl'] or env['gles_compute']:
if env['opencl']:
if env['embed_kernels']:
env.Append(CPPDEFINES = ['EMBEDDED_KERNELS'])
if env['compress_kernels']:
Expand Down Expand Up @@ -392,9 +387,6 @@ for dirname in os.listdir("./include"):

Export('version_at_least')

if env['gles_compute'] and env['os'] != 'android':
env.Append(CPPPATH = ['#/include/linux'])

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

if env['examples'] and env['exceptions']:
Expand Down
27 changes: 14 additions & 13 deletions src/core/CL/ICLMultiImage.cpp → arm_compute/Acl.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2016, 2017 Arm Limited.
* Copyright (c) 2021 Arm Limited.
*
* SPDX-License-Identifier: MIT
*
Expand All @@ -21,19 +21,20 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
#include "arm_compute/core/CL/ICLMultiImage.h"
#ifndef ARM_COMPUTE_ACL_H_
#define ARM_COMPUTE_ACL_H_

#include "arm_compute/core/CL/ICLTensor.h"
#include "arm_compute/core/ITensor.h"
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */

using namespace arm_compute;
/* Core headers */
#include "arm_compute/AclEntrypoints.h"
#include "arm_compute/AclTypes.h"
#include "arm_compute/AclUtils.h"
#include "arm_compute/AclVersion.h"

IImage *ICLMultiImage::plane(unsigned int index)
{
return cl_plane(index);
}

const IImage *ICLMultiImage::plane(unsigned int index) const
{
return cl_plane(index);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* ARM_COMPUTE_ACL_H_ */
Loading

0 comments on commit f7399fd

Please sign in to comment.