Update to arm-compute-library 22.02

ok sthen@
This commit is contained in:
kevlo 2022-03-29 08:06:01 +00:00
parent e1fb7b759d
commit 131fc817e1
12 changed files with 32 additions and 232 deletions

View File

@ -2,7 +2,7 @@ ONLY_FOR_ARCHS = aarch64
COMMENT = Arm compute library
V = 21.11
V = 22.02
PKGNAME = arm-compute-library-${V}
GH_ACCOUNT = ARM-software
@ -15,7 +15,7 @@ HOMEPAGE = https://github.com/ARM-software/ComputeLibrary
MAINTAINER = Kevin Lo <kevlo@openbsd.org>
SO_VERSION = 1.0
SO_VERSION = 2.0
ACL_LIBS = arm_compute \
arm_compute_core \
arm_compute_graph
@ -33,14 +33,16 @@ COMPILER = base-clang ports-gcc
# "build=native" here just means "not cross-compiled"
MODSCONS_FLAGS = Werror=0 neon=1 opencl=0 embed_kernels=0 examples=0 \
os=openbsd arch=arm64-v8a build=native \
extra_cxx_flags=-fPIC
os=openbsd arch=arm64-v8a build=native
MODULES = devel/scons
MAKE_ENV = CC="${CC}" \
CXX="${CXX}"
do-build:
cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${MODSCONS_BIN} ${MODSCONS_FLAGS}
do-install:
.for dir in arm_compute support utils
cp -R ${WRKSRC}/${dir} ${PREFIX}/include

View File

@ -1,2 +1,2 @@
SHA256 (ComputeLibrary-21.11.tar.gz) = gyLtLhNZmVaQgqlef7svqHeG/7HGeTWz73HgC1PyyIc=
SIZE (ComputeLibrary-21.11.tar.gz) = 12987341
SHA256 (ComputeLibrary-22.02.tar.gz) = ESRLBSWfscSvc4TQwzka6t3siqwUR3QgdYLbSEJyZUA=
SIZE (ComputeLibrary-22.02.tar.gz) = 12990648

View File

@ -1,40 +1,30 @@
Index: SConscript
--- SConscript.orig
+++ SConscript
@@ -422,7 +422,8 @@ undefined_flag = '-Wl,-undefined,error' if 'macos' in
arm_compute_env.Append(LINKFLAGS=[undefined_flag])
arm_compute_env.Append(CPPPATH =[Dir("./src/core/").path] )
@@ -610,7 +610,7 @@ else:
elif 'sve' in env['arch']:
lib_files += lib_files_sve
-arm_compute_env.Append(LIBS = ['dl'])
+if env['os'] != 'openbsd':
+ arm_compute_env.Append(LIBS = ['dl'])
- arm_compute_a = build_library('arm_compute-static', arm_compute_env, lib_files, static=True)
+ arm_compute_a = build_library('arm_compute', arm_compute_env, lib_files, static=True)
with (open(Dir('#').path + '/filelist.json')) as fp:
filelist = json.load(fp)
@@ -526,7 +527,7 @@ if (env['fat_binary']):
sve_o = build_sve_objs(lib_files_sve)
arm_compute_a = build_library('arm_compute-static', arm_compute_env, lib_files + sve_o, static=True)
else:
- arm_compute_a = build_library('arm_compute-static', arm_compute_env, lib_files + lib_files_sve, static=True)
+ arm_compute_a = build_library('arm_compute', arm_compute_env, lib_files + lib_files_sve, static=True)
Export('arm_compute_a')
# Build shared libraries
@@ -539,7 +540,7 @@ if env['os'] != 'bare_metal' and not env['standalone']
Export('arm_compute_so')
@@ -629,7 +629,7 @@ if env['os'] == 'macos':
# macos static library archiver fails if given an empty list of files
arm_compute_core_a = build_library('arm_compute_core-static', arm_compute_env, lib_files, static=True)
else:
- arm_compute_core_a = build_library('arm_compute_core-static', arm_compute_env, [], static=True)
+ arm_compute_core_a = build_library('arm_compute_core', arm_compute_env, [], static=True)
# Generate dummy core lib for backwards compatibility
-arm_compute_core_a = build_library('arm_compute_core-static', arm_compute_env, [], static=True)
+arm_compute_core_a = build_library('arm_compute_core', arm_compute_env, [], static=True)
Export('arm_compute_core_a')
if env['os'] != 'bare_metal' and not env['standalone']:
@@ -551,7 +552,7 @@ arm_compute_graph_env = arm_compute_env.Clone()
@@ -642,7 +642,7 @@ arm_compute_graph_env = arm_compute_env.Clone()
# Build graph libraries
arm_compute_graph_env.Append(CXXFLAGS = ['-Wno-redundant-move', '-Wno-pessimizing-move'])
-arm_compute_graph_a = build_library('arm_compute_graph-static', arm_compute_graph_env, graph_files, static=True, libs = [ arm_compute_a])
+arm_compute_graph_a = build_library('arm_compute_graph', arm_compute_graph_env, graph_files, static=True, libs = [ arm_compute_a])
-arm_compute_graph_a = build_library('arm_compute_graph-static', arm_compute_graph_env, graph_files, static=True, libs = [ arm_compute_a ])
+arm_compute_graph_a = build_library('arm_compute_graph', arm_compute_graph_env, graph_files, static=True, libs = [ arm_compute_a ])
Export('arm_compute_graph_a')
if env['os'] != 'bare_metal' and not env['standalone']:

View File

@ -1,16 +1,7 @@
Index: SConstruct
--- SConstruct.orig
+++ SConstruct
@@ -94,7 +94,7 @@ vars.AddVariables(
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")),
+ EnumVariable("os", "Target OS", "linux", allowed_values=("linux", "android", "tizen", "macos", "bare_metal", "openbsd")),
EnumVariable("build", "Build type", "cross_compile", allowed_values=("native", "cross_compile", "embed_only")),
BoolVariable("examples", "Build example programs", True),
BoolVariable("gemm_tuner", "Build gemm_tuner programs", True),
@@ -214,17 +214,8 @@ c_compiler = os.environ.get('CC', default_c_compiler)
@@ -215,17 +215,8 @@ c_compiler = os.environ.get('CC', default_c_compiler)
if env['os'] == 'android' and ( 'clang++' not in cpp_compiler or 'clang' not in c_compiler ):
print( "WARNING: Only clang is officially supported to build the Compute Library for Android")
@ -19,7 +10,7 @@ Index: SConstruct
-elif 'armclang' in cpp_compiler:
- pass
-else:
- env.Append(CXXFLAGS = ['-Wlogical-op','-Wnoexcept','-Wstrict-null-sentinel'])
- env.Append(CXXFLAGS = ['-Wlogical-op','-Wnoexcept','-Wstrict-null-sentinel', '-Wno-misleading-indentation'])
+env.Append(CXXFLAGS = ['-Wno-vla-extension'])
-if cpp_compiler == 'g++':
@ -29,10 +20,11 @@ Index: SConstruct
if env['cppthreads']:
env.Append(CPPDEFINES = [('ARM_COMPUTE_CPP_SCHEDULER', 1)])
@@ -336,25 +327,6 @@ if not GetOption("help"):
@@ -352,25 +343,6 @@ if not GetOption("help"):
except OSError:
print("ERROR: Compiler '%s' not found" % env['CXX'])
Exit(1)
-
- if 'armclang' in cpp_compiler:
- pass
- elif 'clang++' not in cpp_compiler:
@ -51,17 +43,6 @@ Index: SConstruct
-
- if not version_at_least(compiler_ver, '7.0.0') and env['os'] == 'bare_metal':
- env.Append(LINKFLAGS = ['-fstack-protector-strong'])
-
if env['fat_binary']:
if env['arch'] != 'armv8.2-a':
print("Currently fat binary is only supported with armv8.2-a")
@@ -420,6 +392,9 @@ if env['opencl']:
if env["os"] not in ["android", "bare_metal"] and (env['opencl'] or env['cppthreads']):
env.Append(LIBS = ['pthread'])
+
+if env['os'] == 'openbsd':
+ env.Append(LIBS = ['c'])
if env['opencl']:
if env['embed_kernels']:
if env['high_priority'] and env['build_config']:
print("The high priority library cannot be built in conjunction with a user-specified build configuration")

View File

@ -1,83 +0,0 @@
Index: src/common/cpuinfo/CpuInfo.cpp
--- src/common/cpuinfo/CpuInfo.cpp.orig
+++ src/common/cpuinfo/CpuInfo.cpp
@@ -40,10 +40,10 @@
#include <unordered_map>
#endif /* !defined(BARE_METAL) */
-#if !defined(BARE_METAL) && !defined(__APPLE__) && (defined(__arm__) || defined(__aarch64__))
+#if !defined(BARE_METAL) && !defined(__APPLE__) && !defined(__OpenBSD__) && (defined(__arm__) || defined(__aarch64__))
#include <asm/hwcap.h> /* Get HWCAP bits from asm/hwcap.h */
#include <sys/auxv.h>
-#endif /* !defined(BARE_METAL) && !defined(__APPLE__) && (defined(__arm__) || defined(__aarch64__)) */
+#endif /* !defined(BARE_METAL) && !defined(__APPLE__) && !defined(__OpenBSD__) && (defined(__arm__) || defined(__aarch64__)) */
#define ARM_COMPUTE_CPU_FEATURE_HWCAP_CPUID (1 << 11)
#define ARM_COMPUTE_GET_FEATURE_REG(var, freg) __asm __volatile("MRS %0, " #freg \
@@ -54,7 +54,7 @@ namespace cpuinfo
{
namespace
{
-#if !defined(BARE_METAL) && !defined(__APPLE__) && (defined(__arm__) || defined(__aarch64__))
+#if !defined(BARE_METAL) && !defined(__APPLE__) && !defined(__OpenBSD__) && (defined(__arm__) || defined(__aarch64__))
/** Extract MIDR using CPUID information that are exposed to user-space
*
* @param[in] max_num_cpus Maximum number of possible CPUs
@@ -258,7 +258,7 @@ int get_max_cpus()
}
return max_cpus;
}
-#endif /* !defined(BARE_METAL) && !defined(__APPLE__) && (defined(__arm__) || defined(__aarch64__)) */
+#endif /* !defined(BARE_METAL) && !defined(__APPLE__) && !defined(__OpenBSD__) && (defined(__arm__) || defined(__aarch64__)) */
#if defined(BARE_METAL) && defined(__aarch64__)
uint64_t get_sve_feature_reg()
@@ -282,7 +282,7 @@ CpuInfo::CpuInfo(CpuIsaInfo isa, std::vector<CpuModel>
CpuInfo CpuInfo::build()
{
-#if !defined(BARE_METAL) && !defined(__APPLE__) && (defined(__arm__) || defined(__aarch64__))
+#if !defined(BARE_METAL) && !defined(__APPLE__) && !defined(__OpenBSD__) && (defined(__arm__) || defined(__aarch64__))
const uint32_t hwcaps = getauxval(AT_HWCAP);
const uint32_t hwcaps2 = getauxval(AT_HWCAP2);
const uint32_t max_cpus = get_max_cpus();
@@ -313,7 +313,7 @@ CpuInfo CpuInfo::build()
CpuInfo info(isa, cpus_model);
return info;
-#elif(BARE_METAL) && defined(__aarch64__) /* !defined(BARE_METAL) && !defined(__APPLE__) && (defined(__arm__) || defined(__aarch64__)) */
+#elif(BARE_METAL) && defined(__aarch64__) /* !defined(BARE_METAL) && !defined(__APPLE__) && !defined(__OpenBSD__) && (defined(__arm__) || defined(__aarch64__)) */
// Assume single CPU in bare metal mode. Just read the ID register and feature bits directly.
uint64_t isar0 = 0, isar1 = 0, pfr0 = 0, svefr0 = 0, midr = 0;
@@ -333,7 +333,7 @@ CpuInfo CpuInfo::build()
#else /* #elif(BARE_METAL) && defined(__aarch64__) */
CpuInfo info(CpuIsaInfo(), { CpuModel::GENERIC });
return info;
-#endif /* !defined(BARE_METAL) && !defined(__APPLE__) && (defined(__arm__) || defined(__aarch64__)) */
+#endif /* !defined(BARE_METAL) && !defined(__APPLE__) && !defined(__OpenBSD__) && (defined(__arm__) || defined(__aarch64__)) */
}
CpuModel CpuInfo::cpu_model(uint32_t cpuid) const
@@ -347,11 +347,11 @@ CpuModel CpuInfo::cpu_model(uint32_t cpuid) const
CpuModel CpuInfo::cpu_model() const
{
-#if defined(BARE_METAL) || defined(__APPLE__) || (!defined(__arm__) && !defined(__aarch64__))
+#if defined(BARE_METAL) || defined(__APPLE__) || defined(__OpenBSD__) || (!defined(__arm__) && !defined(__aarch64__))
return cpu_model(0);
-#else /* defined(BARE_METAL) || defined(__APPLE__) || (!defined(__arm__) && !defined(__aarch64__)) */
+#else /* defined(BARE_METAL) || defined(__APPLE__) || defined(__OpenBSD__) || (!defined(__arm__) && !defined(__aarch64__)) */
return cpu_model(sched_getcpu());
-#endif /* defined(BARE_METAL) || defined(__APPLE__) || (!defined(__arm__) && !defined(__aarch64__)) */
+#endif /* defined(BARE_METAL) || defined(__APPLE__) || defined(__OpenBSD__) || (!defined(__arm__) && !defined(__aarch64__)) */
}
uint32_t CpuInfo::num_cpus() const
@@ -415,4 +415,4 @@ uint32_t num_threads_hint()
return num_threads_hint;
}
} // namespace cpuinfo
-} // namespace arm_compute
\ No newline at end of file
+} // namespace arm_compute

View File

@ -1,13 +0,0 @@
Index: src/core/NEON/kernels/arm_gemm/gemm_hybrid_indirect.hpp
--- src/core/NEON/kernels/arm_gemm/gemm_hybrid_indirect.hpp.orig
+++ src/core/NEON/kernels/arm_gemm/gemm_hybrid_indirect.hpp
@@ -23,7 +23,9 @@
*/
#pragma once
+#if !defined(__OpenBSD__)
#include <alloca.h>
+#endif /* !defined(__OpenBSD__) */
#include <algorithm>
#include <cassert>

View File

@ -1,13 +0,0 @@
Index: src/core/NEON/kernels/arm_gemm/interleave_indirect.cpp
--- src/core/NEON/kernels/arm_gemm/interleave_indirect.cpp.orig
+++ src/core/NEON/kernels/arm_gemm/interleave_indirect.cpp
@@ -28,7 +28,9 @@
#include "interleave_indirect.hpp"
#include "bfloat.hpp"
+#if !defined(__OpenBSD__)
#include <alloca.h>
+#endif /* !defined(__OpenBSD__) */
#include <algorithm>
#include <cstddef>

View File

@ -1,13 +0,0 @@
Index: src/core/NEON/kernels/arm_gemm/transform.cpp
--- src/core/NEON/kernels/arm_gemm/transform.cpp.orig
+++ src/core/NEON/kernels/arm_gemm/transform.cpp
@@ -25,7 +25,9 @@
#include "bfloat.hpp"
+#if !defined(__OpenBSD__)
#include <alloca.h>
+#endif /* !defined(__OpenBSD__) */
namespace arm_gemm {

View File

@ -1,15 +0,0 @@
Index: src/cpu/CpuContext.cpp
--- src/cpu/CpuContext.cpp.orig
+++ src/cpu/CpuContext.cpp
@@ -28,7 +28,11 @@
#include "src/cpu/CpuTensor.h"
#include <cstdlib>
+#if !defined(__OpenBSD__)
#include <malloc.h>
+#else /* !defined(__OpenBSD__) */
+#include <stdlib.h>
+#endif /* !defined(__OpenBSD__) */
namespace arm_compute
{

View File

@ -1,18 +0,0 @@
Index: src/runtime/CPP/CPPScheduler.cpp
--- src/runtime/CPP/CPPScheduler.cpp.orig
+++ src/runtime/CPP/CPPScheduler.cpp
@@ -104,12 +104,12 @@ void set_thread_affinity(int core_id)
return;
}
-#if !defined(__APPLE__)
+#if !defined(__APPLE__) && !defined(__OpenBSD__)
cpu_set_t set;
CPU_ZERO(&set);
CPU_SET(core_id, &set);
ARM_COMPUTE_EXIT_ON_MSG(sched_setaffinity(0, sizeof(set), &set), "Error setting thread affinity");
-#endif /* !defined(__APPLE__) */
+#endif /* !defined(__APPLE__) && !defined(__OpenBSD__) */
}
/** There are currently 2 scheduling modes supported by CPPScheduler

View File

@ -1,18 +0,0 @@
Index: tests/framework/instruments/Instruments.h
--- tests/framework/instruments/Instruments.h.orig
+++ tests/framework/instruments/Instruments.h
@@ -24,12 +24,12 @@
#ifndef ARM_COMPUTE_TEST_INSTRUMENTS
#define ARM_COMPUTE_TEST_INSTRUMENTS
-#if !defined(BARE_METAL) && !defined(__APPLE__)
+#if !defined(BARE_METAL) && !defined(__APPLE__) && !defined(__OpenBSD__)
#include "MaliCounter.h"
#include "OpenCLMemoryUsage.h"
#include "OpenCLTimer.h"
#include "PMUCounter.h"
-#endif /* !defined(BARE_METAL) && !defined(__APPLE__) */
+#endif /* !defined(BARE_METAL) && !defined(__APPLE__) && !defined(__OpenBSD__) */
#include "SchedulerTimer.h"
#include "WallClockTimer.h"

View File

@ -1,6 +1,5 @@
include/CL/
include/CL/cl.h
include/CL/cl2.hpp
include/CL/cl_d3d10.h
include/CL/cl_d3d11.h
include/CL/cl_dx9_media_sharing.h
@ -16,6 +15,7 @@ include/CL/cl_platform.h
include/CL/cl_va_api_media_sharing_intel.h
include/CL/cl_version.h
include/CL/opencl.h
include/CL/opencl.hpp
include/arm_compute/
include/arm_compute/Acl.h
include/arm_compute/Acl.hpp
@ -148,6 +148,7 @@ include/arm_compute/graph/backends/CL/CLSubTensorHandle.h
include/arm_compute/graph/backends/CL/CLTensorHandle.h
include/arm_compute/graph/backends/FunctionHelpers.h
include/arm_compute/graph/backends/FusedConvolutionBatchNormalizationFunction.h
include/arm_compute/graph/backends/FusedConvolutionBatchNormalizationWithPostOpsFunction.h
include/arm_compute/graph/backends/FusedDepthwiseConvolutionBatchNormalizationFunction.h
include/arm_compute/graph/backends/NEON/
include/arm_compute/graph/backends/NEON/NEDeviceBackend.h
@ -197,6 +198,7 @@ include/arm_compute/graph/nodes/EltwiseLayerNode.h
include/arm_compute/graph/nodes/FlattenLayerNode.h
include/arm_compute/graph/nodes/FullyConnectedLayerNode.h
include/arm_compute/graph/nodes/FusedConvolutionBatchNormalizationNode.h
include/arm_compute/graph/nodes/FusedConvolutionBatchNormalizationWithPostOpsNode.h
include/arm_compute/graph/nodes/FusedConvolutionWithPostOpNode.h
include/arm_compute/graph/nodes/FusedDepthwiseConvolutionBatchNormalizationNode.h
include/arm_compute/graph/nodes/GenerateProposalsLayerNode.h
@ -324,7 +326,6 @@ include/arm_compute/runtime/CL/functions/CLROIPoolingLayer.h
include/arm_compute/runtime/CL/functions/CLRange.h
include/arm_compute/runtime/CL/functions/CLReduceMean.h
include/arm_compute/runtime/CL/functions/CLReductionOperation.h
include/arm_compute/runtime/CL/functions/CLRemap.h
include/arm_compute/runtime/CL/functions/CLReorgLayer.h
include/arm_compute/runtime/CL/functions/CLReshapeLayer.h
include/arm_compute/runtime/CL/functions/CLReverse.h
@ -451,7 +452,6 @@ include/arm_compute/runtime/NEON/functions/NEROIPoolingLayer.h
include/arm_compute/runtime/NEON/functions/NERange.h
include/arm_compute/runtime/NEON/functions/NEReduceMean.h
include/arm_compute/runtime/NEON/functions/NEReductionOperation.h
include/arm_compute/runtime/NEON/functions/NERemap.h
include/arm_compute/runtime/NEON/functions/NEReorgLayer.h
include/arm_compute/runtime/NEON/functions/NEReshapeLayer.h
include/arm_compute/runtime/NEON/functions/NEReverse.h