diff --git a/modules/dnn/src/layers/cpu_kernels/fast_attn.cpp b/modules/dnn/src/layers/cpu_kernels/fast_attn.cpp index 37a294ef91..665b03be75 100644 --- a/modules/dnn/src/layers/cpu_kernels/fast_attn.cpp +++ b/modules/dnn/src/layers/cpu_kernels/fast_attn.cpp @@ -102,7 +102,7 @@ void run_fused_softmax( const int tmax = is_causal ? std::min(past_seq_len + tq + 1, seq_len_kv) : seq_len_kv; float maxVal = -FLT_MAX; int tk = 0; -#if CV_SIMD +#if (CV_SIMD || CV_SIMD_SCALABLE) const int w = VTraits::vlanes(); v_float32 v_max_val = vx_setall_f32(maxVal); v_float32 v_softcap = vx_setall_f32(softcap); @@ -173,7 +173,7 @@ void run_fused_softmax( if (do_softmax) { float sum = 0.f; tk = 0; -#if CV_SIMD +#if (CV_SIMD || CV_SIMD_SCALABLE) v_float32 v_sum = vx_setzero_f32(); v_float32 v_max_val_shift = vx_setall_f32(maxVal); for (; tk <= seq_len_kv - w; tk += w) { @@ -192,7 +192,7 @@ void run_fused_softmax( float inv_sum = 1.f / sum; tk = 0; -#if CV_SIMD +#if (CV_SIMD || CV_SIMD_SCALABLE) v_float32 v_inv_sum = vx_setall_f32(inv_sum); for (; tk <= seq_len_kv - w; tk += w) { v_float32 v_val = vx_load(&data[offset + tk]);