diff mbox series

[1/2] util/bufferiszero: assign length_to_accel value for each accelerator case

Message ID 1585119021-46593-1-git-send-email-robert.hu@linux.intel.com (mailing list archive)
State New, archived
Headers show
Series [1/2] util/bufferiszero: assign length_to_accel value for each accelerator case | expand

Commit Message

Robert Hoo March 25, 2020, 6:50 a.m. UTC
Because in unit test, init_accel() will be called several times, each with
different accelerator type.

Signed-off-by: Robert Hoo <robert.hu@linux.intel.com>
---
 util/bufferiszero.c | 3 +++
 1 file changed, 3 insertions(+)
diff mbox series

Patch

diff --git a/util/bufferiszero.c b/util/bufferiszero.c
index 6639035..b801253 100644
--- a/util/bufferiszero.c
+++ b/util/bufferiszero.c
@@ -254,13 +254,16 @@  static void init_accel(unsigned cache)
     bool (*fn)(const void *, size_t) = buffer_zero_int;
     if (cache & CACHE_SSE2) {
         fn = buffer_zero_sse2;
+        length_to_accel = 64;
     }
 #ifdef CONFIG_AVX2_OPT
     if (cache & CACHE_SSE4) {
         fn = buffer_zero_sse4;
+        length_to_accel = 64;
     }
     if (cache & CACHE_AVX2) {
         fn = buffer_zero_avx2;
+        length_to_accel = 64;
     }
 #endif
 #ifdef CONFIG_AVX512F_OPT