Skip to content

No float from chars on gcc9 #24393

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion include/onnxruntime/core/common/parse_string.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 <typename T>
constexpr bool ParseWithFromChars = !std::is_same_v<bool, T> && std::is_integral_v<T>;
Expand Down
1 change: 1 addition & 0 deletions onnxruntime/contrib_ops/cpu/sparse/sparse_attention_base.h
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,7 @@ class SparseAttentionBase {
v, head_size, output_current, hidden_size,
MLFloat16(1.0f).val, static_cast<uint16_t>(0) /*beta*/, nullptr);
} else {
(void) output_current; // Silence gcc 9.
size_t bytes = static_cast<size_t>(head_size) * total_seq_len * sizeof(float);
auto v_fp32 = allocator->Alloc(bytes);
BufferUniquePtr scratch_buffer(v_fp32, BufferDeleter(allocator));
Expand Down