Add arm64 support
This patch adds `--config=arm64` and `--cpu=arm64` flags for users to
compile for the 64-bit version of the Raspberry Pi.
The existing 32-bit ARM build should still work. This patch only adds
additional 64-bit capabilities. Future patches can remove 32-bit
support.
Eigen needed some tweaks because we have `LDBL_MANT_DIG` of 113 on
arm64. None of the code paths that used the parameters `U` and `V`
actually gets compiled in. Adding `[[maybe_unused]]` fixed the error.
Signed-off-by: Philipp Schrader <philipp.schrader@gmail.com>
Change-Id: Ibf919b2964fe971769449a1c556c13e3bf1d48e9
diff --git a/y2020/vision/sift/fast_gaussian.bzl b/y2020/vision/sift/fast_gaussian.bzl
index fdf5afe..1560f6a 100644
--- a/y2020/vision/sift/fast_gaussian.bzl
+++ b/y2020/vision/sift/fast_gaussian.bzl
@@ -38,15 +38,16 @@
"amd64": "k8",
"roborio": "roborio",
"armhf": "armv7",
+ "arm64": "aarch64",
"cortex-m": "cortex-m",
"cortex-m0plus": "cortex-m0plus",
}),
outs = headers + objects + htmls,
- # The tool doesn't support anything other than k8 and armv7.
- # right now.
+ # The tool doesn't support everything right now.
target_compatible_with = platforms.any_of([
+ "@platforms//cpu:arm64",
"@platforms//cpu:x86_64",
- "//tools/platforms/hardware:raspberry_pi",
+ "//tools:cpu_armhf",
]),
)
diff --git a/y2020/vision/sift/fast_gaussian_runner.py b/y2020/vision/sift/fast_gaussian_runner.py
index cc45208..d812f3f 100755
--- a/y2020/vision/sift/fast_gaussian_runner.py
+++ b/y2020/vision/sift/fast_gaussian_runner.py
@@ -16,6 +16,7 @@
target_cpu = sys.argv[3]
target = {
+ 'aarch64': 'arm-64-linux-no_asserts',
'armv7': 'arm-32-linux-no_asserts',
'k8': 'x86-64-linux-no_asserts',
}[target_cpu]