diff options
author | SiCongLi <sicong.li@arm.com> | 2021-03-12 12:31:17 +0000 |
---|---|---|
committer | SiCong Li <sicong.li@arm.com> | 2021-04-07 17:38:16 +0000 |
commit | 3b5981ce898569aafa98abdf220c73f1a80685b9 (patch) | |
tree | 28aca1bea2e1a10e8f74f8ff79cabc99b3131319 /arm_compute/core | |
parent | db0e2c8de03eb78811be8b0b6e41d8c40dcd097e (diff) | |
download | ComputeLibrary-3b5981ce898569aafa98abdf220c73f1a80685b9.tar.gz |
Implement Fanout mode in CPPScheduler
This new scheduler mode is implemented to reduce runtime overhead on
high thread counts by distributing the scheduling work to all threads.
The fanout mode should only be enabled on high thread counts
(e.g. > 8 threads).
Alternatively the mode can be forced by setting the environment variable
ARM_COMPUTE_CPP_SCHEDULER_MODE to be either "linear" (default) or
"fanout". Note that on bare-metal this functionality is turned off but
it does not matter as only multi-threading is not supported on
bare-metal.
Resolves COMPMID-4349
Signed-off-by: SiCongLi <sicong.li@arm.com>
Change-Id: I46e2fab83ea24e616c82ae94dca7b2e72a73c7b8
Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/5352
Reviewed-by: Michele Di Giorgio <michele.digiorgio@arm.com>
Reviewed-by: Georgios Pinitas <georgios.pinitas@arm.com>
Tested-by: Arm Jenkins <bsgcomp@arm.com>
Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'arm_compute/core')
-rw-r--r-- | arm_compute/core/utils/misc/Utility.h | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/arm_compute/core/utils/misc/Utility.h b/arm_compute/core/utils/misc/Utility.h index 646d66567a..648758ca07 100644 --- a/arm_compute/core/utils/misc/Utility.h +++ b/arm_compute/core/utils/misc/Utility.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2019 Arm Limited. + * Copyright (c) 2017-2021 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -24,6 +24,8 @@ #ifndef ARM_COMPUTE_MISC_UTILITY_H #define ARM_COMPUTE_MISC_UTILITY_H +#include "arm_compute/core/Error.h" + #include <algorithm> #include <array> #include <limits> @@ -208,6 +210,25 @@ inline std::string tolower(std::string string) }); return string; } + +/** Get environment variable as a string + * + * @note Return empty string on bare-metal + * + * @param[in] env_name Name of the Environment variable to retrieve + * + * @return Environment variable content, or empty string if the variable is undefined or on bare-metal + */ +inline std::string getenv(const std::string &env_name) +{ +#ifdef BARE_METAL + ARM_COMPUTE_UNUSED(env_name); + return std::string{}; +#else // BARE_METAL + const auto env_chr = std::getenv(env_name.c_str()); + return env_chr == nullptr ? std::string{} : std::string{ env_chr }; +#endif // BARE_METAL +} } // namespace utility } // namespace arm_compute #endif /* ARM_COMPUTE_MISC_UTILITY_H */ |