From a50f19346c5b79e2743f882ce0c691c07076f207 Mon Sep 17 00:00:00 2001 From: Pablo Marquez Tello Date: Mon, 8 Mar 2021 17:27:05 +0000 Subject: Updated cpu detection * Added the case in the cpu detection code for Klein cores * Added has_sve() and set_sve() methods in CpuInfo * Detection code checks for presence of SVE via HWCAP_SVE * Updated the heuristic in sve kernels to check for the absence of Klein * Resolves: COMPMID-4085 Change-Id: I0b8c72ff19dc5a3a81628d121a1afa836e724b4f Signed-off-by: Pablo Marquez Tello Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/5257 Reviewed-by: Georgios Pinitas Tested-by: Arm Jenkins Comments-Addressed: Arm Jenkins --- arm_compute/core/CPP/CPPTypes.h | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'arm_compute/core/CPP/CPPTypes.h') diff --git a/arm_compute/core/CPP/CPPTypes.h b/arm_compute/core/CPP/CPPTypes.h index fd6bfc3907..2de73acaa2 100644 --- a/arm_compute/core/CPP/CPPTypes.h +++ b/arm_compute/core/CPP/CPPTypes.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2020 Arm Limited. + * Copyright (c) 2017-2021 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -45,6 +45,7 @@ enum class CPUModel A53, A55r0, A55r1, + KLEIN, X1, A73 }; @@ -76,6 +77,10 @@ inline std::string cpu_model_to_string(CPUModel val) { return std::string("GENERIC"); } + case CPUModel::KLEIN: + { + return std::string("KLEIN"); + } case CPUModel::GENERIC_FP16: { return std::string("GENERIC_FP16"); @@ -136,6 +141,11 @@ public: * @return true of the cpu supports dot product, false otherwise */ bool has_dotprod() const; + /** Checks if the cpu model supports sve. + * + * @return true of the cpu supports sve, false otherwise + */ + bool has_sve() const; /** Gets the cpu model for a given cpuid. * * @param[in] cpuid the id of the cpu core to be retrieved, @@ -178,6 +188,11 @@ public: * @param[in] dotprod whether the cpu supports dot product. */ void set_dotprod(const bool dotprod); + /** Set sve support + * + * @param[in] sve whether the cpu supports sve. + */ + void set_sve(const bool sve); /** Set the cpumodel for a given cpu core * * @param[in] cpuid the id of the core to be set. @@ -200,6 +215,7 @@ private: std::vector _percpu = {}; bool _fp16 = false; bool _dotprod = false; + bool _sve = false; unsigned int _L1_cache_size = 32768; unsigned int _L2_cache_size = 262144; }; -- cgit v1.2.1