Skip to content

Commit

Permalink
arm_compute v20.02
Browse files Browse the repository at this point in the history
  • Loading branch information
Jenkins committed Feb 21, 2020
1 parent 7f09cf7 commit 36ccc90
Show file tree
Hide file tree
Showing 11,734 changed files with 229,568 additions and 255,747 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
807 changes: 807 additions & 0 deletions Android.bp

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ Tutorials:

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

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

Binaries available here:

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

You must use your real name, no pseudonyms or anonymous contributions are accepted.

### Security Issues
If you believe you have discovered a security issue please contact [email protected]
23 changes: 18 additions & 5 deletions SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,21 @@ import os.path
import re
import subprocess

VERSION = "v19.11.1"
SONAME_VERSION="17.1.0"
VERSION = "v20.02"
SONAME_VERSION="1.0.0"

Import('env')
Import('vars')
Import('install_lib')

def build_bootcode_objs(sources):

arm_compute_env.Append(ASFLAGS = "-I bootcode/")
obj = arm_compute_env.Object(sources)
obj = install_lib(obj)
Default(obj)
return obj

def build_library(name, sources, static=False, libs=[]):
if static:
obj = arm_compute_env.StaticLibrary(name, source=sources, LIBS = arm_compute_env["LIBS"] + libs)
Expand Down Expand Up @@ -216,11 +224,10 @@ if env['neon']:

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

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


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

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

bootcode_o = []
if env['os'] == 'bare_metal':
bootcode_files = Glob('bootcode/*.s')
bootcode_o = build_bootcode_objs(bootcode_files)
Export('bootcode_o')

arm_compute_core_a = build_library('arm_compute_core-static', core_files, static=True)
Export('arm_compute_core_a')

Expand Down
126 changes: 80 additions & 46 deletions SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,10 @@ vars.AddVariables(
BoolVariable("debug", "Debug", False),
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", "x86_32", "x86_64")),
EnumVariable("arch", "Target Architecture", "armv7a",
allowed_values=("armv7a", "arm64-v8a", "arm64-v8.2-a", "arm64-v8.2-a-sve", "x86_32", "x86_64",
"armv8a", "armv8.2-a", "armv8.2-a-sve", "armv8.6-a", "x86")),
EnumVariable("estate", "Execution State", "auto", allowed_values=("auto", "32", "64")),
EnumVariable("os", "Target OS", "linux", allowed_values=("linux", "android", "bare_metal")),
EnumVariable("build", "Build type", "cross_compile", allowed_values=("native", "cross_compile", "embed_only")),
BoolVariable("examples", "Build example programs", True),
Expand All @@ -57,7 +60,9 @@ vars.AddVariables(
PathVariable("build_dir", "Specify sub-folder for the build", ".", PathVariable.PathAccept),
PathVariable("install_dir", "Specify sub-folder for the install", "", PathVariable.PathAccept),
BoolVariable("exceptions", "Enable/disable C++ exception support", True),
PathVariable("linker_script", "Use an external linker script", "", PathVariable.PathAccept),
("toolchain_prefix", "Override the toolchain prefix", ""),
("compiler_prefix", "Override the compiler prefix", ""),
("extra_cxx_flags", "Extra CXX flags to be appended to the build command", ""),
("extra_link_flags", "Extra LD flags to be appended to the build command", ""),
("compiler_cache", "Command to prefix to the C and C++ compiler (e.g ccache)", "")
Expand Down Expand Up @@ -101,6 +106,10 @@ Export('install_bin')

Help(vars.GenerateHelpText(env))

if env['linker_script'] and env['os'] != 'bare_metal':
print("Linker script is only supported for bare_metal builds")
Exit(1)

if env['build'] == "embed_only":
SConscript('./SConscript', variant_dir=build_path, duplicate=0)
Return()
Expand Down Expand Up @@ -130,7 +139,7 @@ if not env['exceptions']:
env.Append(CXXFLAGS = ['-Wall','-DARCH_ARM',
'-Wextra','-pedantic','-Wdisabled-optimization','-Wformat=2',
'-Winit-self','-Wstrict-overflow=2','-Wswitch-default',
'-fpermissive','-std=gnu++11','-Woverloaded-virtual', '-Wformat-security',
'-std=gnu++11','-Woverloaded-virtual', '-Wformat-security',
'-Wctor-dtor-privacy','-Wsign-promo','-Weffc++','-Wno-overlength-strings'])

env.Append(CPPDEFINES = ['_GLIBCXX_USE_NANOSLEEP'])
Expand Down Expand Up @@ -162,57 +171,79 @@ if env['openmp']:
env.Append(CXXFLAGS = ['-fopenmp'])
env.Append(LINKFLAGS = ['-fopenmp'])

# Validate and define state
if env['estate'] == 'auto':
if 'v7a' in env['arch']:
env['estate'] = '32'
else:
env['estate'] = '64'

# Map legacy arch
if 'arm64' in env['arch']:
env['estate'] = '64'

if 'v7a' in env['estate'] and env['estate'] == '64':
print("ERROR: armv7a architecture has only 32-bit execution state")
Exit(1)

# Add architecture specific flags
prefix = ""
if env['arch'] == 'armv7a':
if 'v7a' in env['arch']:
env.Append(CXXFLAGS = ['-march=armv7-a', '-mthumb', '-mfpu=neon'])

if env['os'] == 'linux':
prefix = "arm-linux-gnueabihf-"
env.Append(CXXFLAGS = ['-mfloat-abi=hard'])
elif env['os'] == 'bare_metal':
prefix = "arm-eabi-"
env.Append(CXXFLAGS = ['-mfloat-abi=hard'])
elif env['os'] == 'android':
prefix = "arm-linux-androideabi-"
if env['os'] == 'android':
env.Append(CXXFLAGS = ['-mfloat-abi=softfp'])
elif env['arch'] == 'arm64-v8a':
env.Append(CXXFLAGS = ['-march=armv8-a'])
env.Append(CPPDEFINES = ['ARM_COMPUTE_AARCH64_V8A'])
if env['os'] == 'linux':
prefix = "aarch64-linux-gnu-"
elif env['os'] == 'bare_metal':
prefix = "aarch64-elf-"
elif env['os'] == 'android':
prefix = "aarch64-linux-android-"
elif 'arm64-v8.2-a' in env['arch']:
if env['arch'] == 'arm64-v8.2-a-sve':
env.Append(CXXFLAGS = ['-march=armv8.2-a+sve+fp16+dotprod'])
else:
env.Append(CXXFLAGS = ['-mfloat-abi=hard'])
elif 'v8' in env['arch']:
if 'sve' in env['arch']:
env.Append(CXXFLAGS = ['-march=armv8.2-a+sve+fp16+dotprod'])
elif 'v8.2-a' in env['arch']:
env.Append(CXXFLAGS = ['-march=armv8.2-a+fp16']) # explicitly enable fp16 extension otherwise __ARM_FEATURE_FP16_VECTOR_ARITHMETIC is undefined
if env['os'] == 'linux':
prefix = "aarch64-linux-gnu-"
elif env['os'] == 'bare_metal':
prefix = "aarch64-elf-"
elif env['os'] == 'android':
prefix = "aarch64-linux-android-"
env.Append(CPPDEFINES = ['ARM_COMPUTE_AARCH64_V8_2'])
elif env['arch'] == 'x86_32':
env.Append(CCFLAGS = ['-m32'])
env.Append(LINKFLAGS = ['-m32'])
elif env['arch'] == 'x86_64':
env.Append(CXXFLAGS = ['-fPIC'])
env.Append(CCFLAGS = ['-m64'])
env.Append(LINKFLAGS = ['-m64'])
else:
env.Append(CXXFLAGS = ['-march=armv8-a'])

if 'v8.6-a' in env['arch']:
env.Append(CXXFLAGS = ['-DV8P6'])

elif 'x86' in env['arch']:
if env['estate'] == '32':
env.Append(CCFLAGS = ['-m32'])
env.Append(LINKFLAGS = ['-m32'])
else:
env.Append(CXXFLAGS = ['-fPIC'])
env.Append(CCFLAGS = ['-m64'])
env.Append(LINKFLAGS = ['-m64'])

# Define toolchain
prefix = ""
if 'x86' not in env['arch']:
if env['estate'] == '32':
if env['os'] == 'linux':
prefix = "arm-linux-gnueabihf-" if 'v7' in env['arch'] else "armv8l-linux-gnueabihf-"
elif env['os'] == 'bare_metal':
prefix = "arm-eabi-"
elif env['os'] == 'android':
prefix = "arm-linux-androideabi-"
elif env['estate'] == '64' and 'v8' in env['arch']:
if env['os'] == 'linux':
prefix = "aarch64-linux-gnu-"
elif env['os'] == 'bare_metal':
prefix = "aarch64-elf-"
elif env['os'] == 'android':
prefix = "aarch64-linux-android-"

if env['build'] == 'native':
prefix = ""

if env["toolchain_prefix"] != "":
prefix = env["toolchain_prefix"]

env['CC'] = env['compiler_cache']+" "+prefix + c_compiler
env['CXX'] = env['compiler_cache']+" "+prefix + cpp_compiler
compiler_prefix = prefix
if env["compiler_prefix"] != "":
compiler_prefix = env["compiler_prefix"]

env['CC'] = env['compiler_cache']+ " " + compiler_prefix + c_compiler
env['CXX'] = env['compiler_cache']+ " " + compiler_prefix + cpp_compiler
env['LD'] = prefix + "ld"
env['AS'] = prefix + "as"
env['AR'] = prefix + "ar"
Expand Down Expand Up @@ -250,7 +281,7 @@ if env['Werror']:

if env['os'] == 'android':
env.Append(CPPDEFINES = ['ANDROID'])
env.Append(LINKFLAGS = ['-pie', '-static-libstdc++'])
env.Append(LINKFLAGS = ['-pie', '-static-libstdc++', '-ldl'])
elif env['os'] == 'bare_metal':
env.Append(LINKFLAGS = ['-static'])
env.Append(LINKFLAGS = ['-specs=rdimon.specs'])
Expand Down Expand Up @@ -302,17 +333,20 @@ for dirname in os.listdir("./include"):

Export('version_at_least')

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

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

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

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

if env['os'] != 'bare_metal' and env['exceptions']:
if env['exceptions']:
if env['os'] == 'bare_metal' and env['arch'] == 'armv7a':
print("WARNING: Building tests for bare metal and armv7a is not supported")
Return()
SConscript('./tests/SConscript', variant_dir='%s/tests' % build_path, duplicate=0)
8 changes: 4 additions & 4 deletions arm_compute/core/AccessWindowAutoPadding.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017-2018 ARM Limited.
* Copyright (c) 2017-2019 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
Expand All @@ -21,8 +21,8 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
#ifndef __ARM_COMPUTE_ACCESS_WINDOW_AUTO_PADDING_H__
#define __ARM_COMPUTE_ACCESS_WINDOW_AUTO_PADDING_H__
#ifndef ARM_COMPUTE_ACCESS_WINDOW_AUTO_PADDING_H
#define ARM_COMPUTE_ACCESS_WINDOW_AUTO_PADDING_H

#include "arm_compute/core/Coordinates.h"
#include "arm_compute/core/IAccessWindow.h"
Expand Down Expand Up @@ -82,4 +82,4 @@ class AccessWindowAutoPadding : public IAccessWindow
ITensorInfo *_info;
};
} // namespace arm_compute
#endif /*__ARM_COMPUTE_ACCESS_WINDOW_AUTO_PADDING_H__*/
#endif /*ARM_COMPUTE_ACCESS_WINDOW_AUTO_PADDING_H*/
8 changes: 4 additions & 4 deletions arm_compute/core/AccessWindowStatic.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017-2018 ARM Limited.
* Copyright (c) 2017-2019 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
Expand All @@ -21,8 +21,8 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
#ifndef __ARM_COMPUTE_IACCESS_WINDOW_STATIC_H__
#define __ARM_COMPUTE_IACCESS_WINDOW_STATIC_H__
#ifndef ARM_COMPUTE_IACCESS_WINDOW_STATIC_H
#define ARM_COMPUTE_IACCESS_WINDOW_STATIC_H

#include "arm_compute/core/Coordinates.h"
#include "arm_compute/core/IAccessWindow.h"
Expand Down Expand Up @@ -98,4 +98,4 @@ class AccessWindowStatic : public IAccessWindow
int _end_y;
};
} // namespace arm_compute
#endif /*__ARM_COMPUTE_IACCESS_WINDOW_STATIC_H__*/
#endif /*ARM_COMPUTE_IACCESS_WINDOW_STATIC_H*/
8 changes: 4 additions & 4 deletions arm_compute/core/AccessWindowTranspose.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017-2018 ARM Limited.
* Copyright (c) 2017-2019 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
Expand All @@ -21,8 +21,8 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
#ifndef __ARM_COMPUTE_IACCESS_WINDOW_TRANSPOSE_H__
#define __ARM_COMPUTE_IACCESS_WINDOW_TRANSPOSE_H__
#ifndef ARM_COMPUTE_IACCESS_WINDOW_TRANSPOSE_H
#define ARM_COMPUTE_IACCESS_WINDOW_TRANSPOSE_H

#include "arm_compute/core/Coordinates.h"
#include "arm_compute/core/IAccessWindow.h"
Expand All @@ -45,4 +45,4 @@ class AccessWindowTranspose : public AccessWindowRectangle
ValidRegion compute_valid_region(const Window &window, ValidRegion input_valid_region, bool border_undefined, BorderSize border_size) const override;
};
} // namespace arm_compute
#endif /*__ARM_COMPUTE_IACCESS_WINDOW_TRANSPOSE_H__*/
#endif /*ARM_COMPUTE_IACCESS_WINDOW_TRANSPOSE_H*/
6 changes: 3 additions & 3 deletions arm_compute/core/CL/CLCoreRuntimeContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
#ifndef __ARM_COMPUTE_CLCORERUNTIME_CONTEXT_H__
#define __ARM_COMPUTE_CLCORERUNTIME_CONTEXT_H__
#ifndef ARM_COMPUTE_CLCORERUNTIME_CONTEXT_H
#define ARM_COMPUTE_CLCORERUNTIME_CONTEXT_H

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

Expand Down Expand Up @@ -72,4 +72,4 @@ class CLCoreRuntimeContext final
cl::CommandQueue _queue{};
};
} // namespace arm_compute
#endif /*__ARM_COMPUTE_CLCORERUNTIME_CONTEXT_H__ */
#endif /*ARM_COMPUTE_CLCORERUNTIME_CONTEXT_H */
Loading

0 comments on commit 36ccc90

Please sign in to comment.