We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 23803a3 commit 3868f6eCopy full SHA for 3868f6e
nncf/common/utils/cpu_info.py
@@ -9,15 +9,26 @@
9
# See the License for the specific language governing permissions and
10
# limitations under the License.
11
12
+import platform
13
import re
14
15
import cpuinfo # type: ignore
16
17
+_IS_ARM_CPU = None
18
_IS_LNL_CPU = None
19
20
21
+def is_arm_cpu() -> bool:
22
+ global _IS_ARM_CPU
23
+ if _IS_ARM_CPU is None:
24
+ _IS_ARM_CPU = platform.processor().lower() == "arm"
25
+ return _IS_ARM_CPU
26
+
27
28
def is_lnl_cpu() -> bool:
29
global _IS_LNL_CPU
30
if _IS_LNL_CPU is None:
- _IS_LNL_CPU = re.search(r"Ultra \d 2\d{2}", cpuinfo.get_cpu_info()["brand_raw"]) is not None
31
+ _IS_LNL_CPU = (
32
+ not is_arm_cpu() and re.search(r"Ultra \d 2\d{2}", cpuinfo.get_cpu_info()["brand_raw"]) is not None
33
+ )
34
return _IS_LNL_CPU
0 commit comments