diff --git a/include/onnxruntime/core/common/parse_string.h b/include/onnxruntime/core/common/parse_string.h index 6345b2a55490d..8de9f5b467c4b 100644 --- a/include/onnxruntime/core/common/parse_string.h +++ b/include/onnxruntime/core/common/parse_string.h @@ -16,7 +16,7 @@ namespace onnxruntime { namespace detail { // Whether we will use std::from_chars() to parse to `T`. -#if defined(_LIBCPP_VERSION) +#if defined(_LIBCPP_VERSION) || defined(__GNUC__) && __GNUC__ < 12 // Note: Currently (e.g., in LLVM 19), libc++'s std::from_chars() doesn't support floating point types yet. template constexpr bool ParseWithFromChars = !std::is_same_v && std::is_integral_v; diff --git a/onnxruntime/contrib_ops/cpu/sparse/sparse_attention_base.h b/onnxruntime/contrib_ops/cpu/sparse/sparse_attention_base.h index cccaec0b16ce5..4ef3a4cbe50b6 100644 --- a/onnxruntime/contrib_ops/cpu/sparse/sparse_attention_base.h +++ b/onnxruntime/contrib_ops/cpu/sparse/sparse_attention_base.h @@ -448,6 +448,7 @@ class SparseAttentionBase { v, head_size, output_current, hidden_size, MLFloat16(1.0f).val, static_cast(0) /*beta*/, nullptr); } else { + (void) output_current; // Silence gcc 9. size_t bytes = static_cast(head_size) * total_seq_len * sizeof(float); auto v_fp32 = allocator->Alloc(bytes); BufferUniquePtr scratch_buffer(v_fp32, BufferDeleter(allocator));