diff options
author | Georgios Pinitas <georgios.pinitas@arm.com> | 2020-12-30 00:03:09 +0000 |
---|---|---|
committer | Georgios Pinitas <georgios.pinitas@arm.com> | 2021-01-13 17:00:15 +0000 |
commit | 45514031440880a9eecd2a8461e6741569d8119a (patch) | |
tree | cb1ade8c6d87a5092bdba66161350a5f5ccf286d /src/runtime/CPUUtils.cpp | |
parent | fefd16acf472dc7fddc57aab3773f2dec6602b20 (diff) | |
download | ComputeLibrary-45514031440880a9eecd2a8461e6741569d8119a.tar.gz |
Add support for macOS
* Add 'macos' as an additional OS build option
* Guard unsupported paths like thread scheduling control and hwcaps
checking with the __APPLE__ macro
* Map linker options to respective Mach-O linker options
Change-Id: I67bd9fa3c20831427b218ca7d3b4b9d454ab4fec
Signed-off-by: Georgios Pinitas <georgios.pinitas@arm.com>
Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/4788
Reviewed-by: Sang-Hoon Park <sang-hoon.park@arm.com>
Reviewed-by: Giorgio Arena <giorgio.arena@arm.com>
Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Tested-by: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'src/runtime/CPUUtils.cpp')
-rw-r--r-- | src/runtime/CPUUtils.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/runtime/CPUUtils.cpp b/src/runtime/CPUUtils.cpp index a7dd464540..74f0f58248 100644 --- a/src/runtime/CPUUtils.cpp +++ b/src/runtime/CPUUtils.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2020 Arm Limited. + * Copyright (c) 2018-2021 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -34,18 +34,18 @@ #include <fstream> #include <map> -#ifndef BARE_METAL +#if !defined(BARE_METAL) /* C++ std::regex takes up a lot of space in the standalone builds */ #include <regex.h> #include <thread> -#endif /* BARE_METAL */ +#endif /* !defined(BARE_METAL) */ -#if !defined(BARE_METAL) && (defined(__arm__) || defined(__aarch64__)) +#if !defined(BARE_METAL) && !defined(__APPLE__) && (defined(__arm__) || defined(__aarch64__)) #include <sys/auxv.h> /* Get HWCAP bits from asm/hwcap.h */ #include <asm/hwcap.h> -#endif /* !BARE_METAL */ +#endif /* !defined(BARE_METAL) && !defined(__APPLE__) && (defined(__arm__) || defined(__aarch64__)) */ /* Make sure the bits we care about are defined, just in case asm/hwcap.h is * out of date (or for bare metal mode) */ @@ -65,7 +65,7 @@ namespace { using namespace arm_compute; -#if !defined(BARE_METAL) && (defined(__arm__) || defined(__aarch64__)) +#if !defined(BARE_METAL) && !defined(__APPLE__) && (defined(__arm__) || defined(__aarch64__)) bool model_supports_dot(CPUModel model) { @@ -346,7 +346,7 @@ int get_max_cpus() } return max_cpus; } -#endif /* !defined(BARE_METAL) && (defined(__arm__) || defined(__aarch64__)) */ +#endif /* !defined(BARE_METAL) && !defined(__APPLE__) && (defined(__arm__) || defined(__aarch64__)) */ } // namespace @@ -358,7 +358,7 @@ namespace cpu { void get_cpu_configuration(CPUInfo &cpuinfo) { -#if !defined(BARE_METAL) && (defined(__arm__) || defined(__aarch64__)) +#if !defined(BARE_METAL) && !defined(__APPLE__) && (defined(__arm__) || defined(__aarch64__)) bool cpuid = false; bool hwcaps_fp16_support = false; bool hwcaps_dot_support = false; @@ -406,9 +406,9 @@ void get_cpu_configuration(CPUInfo &cpuinfo) } cpuinfo.set_dotprod(one_supports_dot || hwcaps_dot_support); cpuinfo.set_fp16(one_supports_fp16 || hwcaps_fp16_support); -#else /* !defined(BARE_METAL) && (defined(__arm__) || defined(__aarch64__)) */ +#else /* !defined(BARE_METAL) && !defined(__APPLE__) && (defined(__arm__) || defined(__aarch64__)) */ ARM_COMPUTE_UNUSED(cpuinfo); -#endif /* !defined(BARE_METAL) && (defined(__arm__) || defined(__aarch64__)) */ +#endif /* !defined(BARE_METAL) && !defined(__APPLE__) && (defined(__arm__) || defined(__aarch64__)) */ } unsigned int get_threads_hint() |