diff options
Diffstat (limited to 'src/runtime')
-rw-r--r-- | src/runtime/CPP/CPPScheduler.cpp | 7 | ||||
-rw-r--r-- | src/runtime/CPUUtils.cpp | 20 |
2 files changed, 14 insertions, 13 deletions
diff --git a/src/runtime/CPP/CPPScheduler.cpp b/src/runtime/CPP/CPPScheduler.cpp index 663cde7a21..e084cc6494 100644 --- a/src/runtime/CPP/CPPScheduler.cpp +++ b/src/runtime/CPP/CPPScheduler.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2020 Arm Limited. + * Copyright (c) 2016-2021 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -98,11 +98,12 @@ void set_thread_affinity(int core_id) return; } +#if !defined(__APPLE__) 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"); + ARM_COMPUTE_EXIT_ON_MSG(sched_setaffinity(0, sizeof(set), &set), "Error setting thread affinity"); +#endif /* !defined(__APPLE__) */ } class Thread final 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() |