From fbd44cee42a6f0213bda3135fec159718ac5906f Mon Sep 17 00:00:00 2001 From: Jan Wassenberg Date: Mon, 2 Mar 2026 04:53:02 -0800 Subject: [PATCH] Fix Windows warnings PiperOrigin-RevId: 877338937 --- ops/ops-inl.h | 1 - util/mat.h | 8 ++++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/ops/ops-inl.h b/ops/ops-inl.h index affde22..387b2d6 100644 --- a/ops/ops-inl.h +++ b/ops/ops-inl.h @@ -1328,7 +1328,6 @@ HWY_INLINE HWY_MAYBE_UNUSED void MulByConstAndAddTileUpTo8_BF16( if constexpr (N >= 8) { Compress2(df, c7_p0, c7_p1, cs_span, 7 * kMaxLanes * 2); } - VF zero = hn::Zero(df); size_t i = 0; HWY_DASSERT(qkv_dim % (NF * 2) == 0); while (i + NF * 2 <= qkv_dim) { diff --git a/util/mat.h b/util/mat.h index 25f2cb2..ab2df33 100644 --- a/util/mat.h +++ b/util/mat.h @@ -481,8 +481,8 @@ decltype(auto) CallUpcastedKVs(hwy::Span base, const Func& func, for ([[maybe_unused]] auto&& mat : base) { HWY_DASSERT(mat.GetType() == type); } - auto convert_to_matptr_t = [&base]() { - std::vector> matptrs; + auto make_matptr_vec = [&base](auto element) { + std::vector> matptrs; matptrs.reserve(base.size()); for (auto&& mat : base) { matptrs.emplace_back(mat); @@ -490,12 +490,12 @@ decltype(auto) CallUpcastedKVs(hwy::Span base, const Func& func, return matptrs; }; if (type == Type::kF32) { - auto matptrs = convert_to_matptr_t.template operator()(); + auto matptrs = make_matptr_vec(float{}); hwy::Span> matptrs_span(matptrs.data(), matptrs.size()); return func(matptrs_span, std::forward(args)...); } else if (type == Type::kBF16) { - auto matptrs = convert_to_matptr_t.template operator()(); + auto matptrs = make_matptr_vec(BF16{}); hwy::Span> matptrs_span(matptrs.data(), matptrs.size()); return func(matptrs_span, std::forward(args)...); } else {