<div dir="ltr">From d76788127f6a142ff41a8df19a0f9e74290689a8 Mon Sep 17 00:00:00 2001<br>From: Ponsanthini <<a href="mailto:ponsanthini.arunachalam@muticorewareinc.com">ponsanthini.arunachalam@muticorewareinc.com</a>><br>Date: Mon, 30 Sep 2024 07:29:25 +0000<br>Subject: [PATCH] Fix cpu capability issue<br><br>---<br> source/CMakeLists.txt |  4 ++++<br> source/common/cpu.cpp | 30 ++++++++++++++++--------------<br> 2 files changed, 20 insertions(+), 14 deletions(-)<br><br>diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt<br>index d1fe38559..3ec82c810 100755<br>--- a/source/CMakeLists.txt<br>+++ b/source/CMakeLists.txt<br>@@ -479,6 +479,10 @@ else()<br>     option(ENABLE_ASSEMBLY "Enable use of assembly coded primitives" OFF)<br> endif()<br> <br>+if(ENABLE_ASSEMBLY)<br>+    add_definitions(-DENABLE_ASSEMBLY)<br>+endif()<br>+<br> option(CHECKED_BUILD "Enable run-time sanity checks (debugging)" OFF)<br> if(CHECKED_BUILD)<br>     add_definitions(-DCHECKED_BUILD=1)<br>diff --git a/source/common/cpu.cpp b/source/common/cpu.cpp<br>index 4f4376184..e31647293 100644<br>--- a/source/common/cpu.cpp<br>+++ b/source/common/cpu.cpp<br>@@ -455,20 +455,22 @@ uint32_t cpu_detect(bool benableavx512)<br> <br>     int flags = 0;<br> <br>-    #if HAVE_NEON<br>-         flags |= X265_CPU_NEON;    // All of ARM64 has NEON<br>-    #endif<br>-    #if HAVE_NEON_DOTPROD<br>-         flags |= (hwcaps & HWCAP_ASIMDDP ? X265_CPU_NEON_DOTPROD : 0);<br>-    #endif<br>-    #if HAVE_NEON_I8MM<br>-         flags |= (hwcaps2 & HWCAP2_I8MM ? X265_CPU_NEON_I8MM : 0);<br>-    #endif<br>-    #if HAVE_SVE<br>-         flags |= (hwcaps & HWCAP_SVE ? X265_CPU_SVE : 0);<br>-    #endif<br>-    #if HAVE_SVE2<br>-         flags |= (hwcaps2 & HWCAP2_SVE2 ? X265_CPU_SVE2 : 0);<br>+    #ifdef ENABLE_ASSEMBLY<br>+        #if HAVE_NEON<br>+             flags |= X265_CPU_NEON;<br>+        #endif<br>+        #if HAVE_NEON_DOTPROD<br>+             flags |= X265_CPU_NEON_DOTPROD;<br>+        #endif<br>+        #if HAVE_NEON_I8MM<br>+             flags |= X265_CPU_NEON_I8MM;<br>+        #endif<br>+        #if HAVE_SVE<br>+             flags |= X265_CPU_SVE;<br>+        #endif<br>+        #if HAVE_SVE2<br>+             flags |= X265_CPU_SVE2;<br>+        #endif<br>     #endif<br> <br>     return flags;<br>-- <br>2.34.1<br><br></div>