aboutsummaryrefslogtreecommitdiff
path: root/SConstruct
diff options
context:
space:
mode:
authorGeorgios Pinitas <georgios.pinitas@arm.com>2021-04-22 16:42:03 +0100
committerMichalis Spyrou <michalis.spyrou@arm.com>2021-06-07 13:21:17 +0000
commitbdcdc39d89b6a6556f5c0483af5379f75eae0c55 (patch)
tree454cd50afa81da3ca3382701619fef023911e3f7 /SConstruct
parent5a643320b79f15a5d09b5366c4744579cf71e303 (diff)
downloadComputeLibrary-bdcdc39d89b6a6556f5c0483af5379f75eae0c55.tar.gz
Enable fat binary support
Changes our build system to allow building both Neon(TM) and SVE kernels and package them in the same binary. This will allow runtime selection of the underlying architecture. Adds new build option, fat_binary, for enabling this feature. Change-Id: I8e8386149773ce28e071a2fb7ddd8c8ae0f28a4a Signed-off-by: Michalis Spyrou <michalis.spyrou@arm.com> Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/5704 Tested-by: Arm Jenkins <bsgcomp@arm.com> Reviewed-by: Georgios Pinitas <georgios.pinitas@arm.com> Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'SConstruct')
-rw-r--r--SConstruct13
1 files changed, 13 insertions, 0 deletions
diff --git a/SConstruct b/SConstruct
index d36fbab275..f800d9d105 100644
--- a/SConstruct
+++ b/SConstruct
@@ -53,6 +53,7 @@ vars.AddVariables(
BoolVariable("examples", "Build example programs", True),
BoolVariable("gemm_tuner", "Build gemm_tuner programs", True),
BoolVariable("Werror", "Enable/disable the -Werror compilation flag", True),
+ BoolVariable("fat_binary", "Build fat binary version of library. Note works only for armv8.2-a", False),
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 Arm® Neon™ support", False),
@@ -255,6 +256,11 @@ if 'x86' not in env['arch']:
elif env['os'] == 'tizen':
prefix = "aarch64-tizen-linux-gnu-"
+if 'sve' in env['arch']:
+ env.Append(CXXFLAGS = ['-DENABLE_SVE'])
+else:
+ env.Append(CXXFLAGS = ['-DENABLE_NEON'])
+
if env['build'] == 'native':
prefix = ""
@@ -298,6 +304,13 @@ if not GetOption("help"):
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")
+ Exit(1)
+ env.Append(CXXFLAGS = ['-DENABLE_SVE'])
+ env.Append(CXXFLAGS = ['-DENABLE_NEON'])
+
if env['data_type_support']:
if any(i in env['data_type_support'] for i in ['all', 'fp16']):
env.Append(CXXFLAGS = ['-DENABLE_FP16_KERNELS'])