From 6bac5453d1643f98922e131068c391c22ff92480 Mon Sep 17 00:00:00 2001 From: zihaomu Date: Wed, 15 Mar 2023 08:24:55 +0800 Subject: [PATCH] fix bug in 32 bit cpu --- modules/dnn/src/layers/cpu_kernels/convolution.cpp | 6 +++--- modules/dnn/src/layers/cpu_kernels/convolution.hpp | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/dnn/src/layers/cpu_kernels/convolution.cpp b/modules/dnn/src/layers/cpu_kernels/convolution.cpp index 0f0da11ec7..6b0f9c865e 100644 --- a/modules/dnn/src/layers/cpu_kernels/convolution.cpp +++ b/modules/dnn/src/layers/cpu_kernels/convolution.cpp @@ -103,13 +103,13 @@ Ptr initFastConv( } conv->conv_type = ifRunDepthWise && conv_dim != CONV_3D ? CONV_TYPE_DEPTHWISE : - useWinograd && (conv_dim == CONV_2D && (conv->useSIMD128 || conv->useAVX2 || conv->useNEON) && + useWinograd && (conv_dim == CONV_2D && (conv->useSIMD128 || conv->useAVX || conv->useAVX2 || conv->useNEON) && Hk == 3 && Wk == 3 && dilation_h == 1 && dilation_w == 1 && stride_h == 1 && stride_w == 1) ? CONV_TYPE_WINOGRAD3X3 : (ifRunDepthWiseRemain ? CONV_TYPE_DEPTHWISE_REMAIN : CONV_TYPE_GENERIC); -#if !(CV_NEON || CV_SIMD128 || CV_TRY_AVX2) - if (conv->conv_type == CONV_TYPE_WINOGRAD3X3) // Disabel Winograd when CV_NEON, CV_SIMD128 and CV_TRY_AVX2 are not available. +#if !(CV_NEON || CV_SIMD128 || CV_TRY_AVX || CV_TRY_AVX2) + if (conv->conv_type == CONV_TYPE_WINOGRAD3X3) // Disabel Winograd when CV_NEON, CV_SIMD128 ,CV_TRY_AVX and CV_TRY_AVX2 are not available. conv->conv_type = CONV_TYPE_GENERIC; #endif diff --git a/modules/dnn/src/layers/cpu_kernels/convolution.hpp b/modules/dnn/src/layers/cpu_kernels/convolution.hpp index 0a077bf800..3d44c3189b 100644 --- a/modules/dnn/src/layers/cpu_kernels/convolution.hpp +++ b/modules/dnn/src/layers/cpu_kernels/convolution.hpp @@ -28,13 +28,13 @@ enum { CONV_WINO_AREA=CONV_WINO_SIZE*CONV_WINO_SIZE, CONV_WINO_KBLOCK = 4, -#if (CV_NEON && CV_NEON_AARCH64) || CV_TRY_AVX2 +#if (CV_NEON && CV_NEON_AARCH64) || CV_TRY_AVX || CV_TRY_AVX2 CONV_WINO_IBLOCK = 6, #else CONV_WINO_IBLOCK = 3, #endif -#if CV_TRY_AVX2 +#if CV_TRY_AVX || CV_TRY_AVX2 CONV_WINO_ATOM_F32 = 8, #else CONV_WINO_ATOM_F32 = 4,