diff --git a/src/llama-quant.cpp b/src/llama-quant.cpp index e6c9bfa7f0..08f1b30293 100644 --- a/src/llama-quant.cpp +++ b/src/llama-quant.cpp @@ -690,7 +690,7 @@ static std::unordered_map target_bpw_type( #endif }; - constexpr double epsilon = 1e-12; + const double epsilon = 1e-12; constexpr double infinity = std::numeric_limits::infinity(); constexpr uint32_t file_magic = 0x42505731; // BPW1 const char * func = __func__; @@ -1118,7 +1118,7 @@ static std::unordered_map target_bpw_type( }; // Returns lambda per slice or 0.0 if no activations - auto estimate_lambda = [](const float * values, const float * activations, const int64_t n_per_row, const int64_t ne2) -> std::vector { + auto estimate_lambda = [&](const float * values, const float * activations, const int64_t n_per_row, const int64_t ne2) -> std::vector { const int64_t ns = std::max(1, ne2); std::vector lambdas(ns, 0.0f); if (!activations) { return lambdas; } @@ -1421,7 +1421,7 @@ static std::unordered_map target_bpw_type( } // Keep only the pareto‑optimal candidates and enforce convexity in (bytes, error) curve - auto pareto_convex = [epsilon](std::vector & candidates) { + auto pareto_convex = [&](std::vector & candidates) { if (candidates.empty()) { return; } std::sort(candidates.begin(), candidates.end(), [](const candidate_types & a, const candidate_types & b) {