Skip to content

[NFC][SYCL] Speed up device_impl::CallOnceCache on fast path for libstdc++ #18597

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

Merged
merged 3 commits into from
May 22, 2025

Conversation

aelovikov-intel
Copy link
Contributor

libstdc++ implementation of std::call_once isn't as performant as it could be due to ABI compatibility reasons (see
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66146#c53).

We can optimize fast path but paying some price for less important memory usage/slow path performance.

Based on generated code (https://godbolt.org/z/1YaW5xozY) I wouldn't be surprised if the same would help on Windows, but I'd prefer to investigate/implement in a separate PR if necessary.

…bstdc++

libstdc++ implementation of `std::call_once` isn't as performant as it
could be due to ABI compatibility reasons (see
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66146#c53).

We can optimize fast path but paying some price for less important
memory usage/slow path performance.

Bassed on generated code (https://godbolt.org/z/1YaW5xozY) I wouldn't be
surprised if the same would help on Windows, but I'd prefer to
investigate/implement in a separate PR if necessary.
@aelovikov-intel
Copy link
Contributor Author

@Alexandr-Konovalov could you review this too, please? I think it's similar enough to the check-lock-check PR.

@Alexandr-Konovalov
Copy link
Contributor

@Alexandr-Konovalov could you review this too, please? I think it's similar enough to the check-lock-check PR.

Sure, I read the fix and it looks good to me.

@aelovikov-intel aelovikov-intel merged commit 79e7db7 into intel:sycl May 22, 2025
25 of 26 checks passed
@aelovikov-intel aelovikov-intel deleted the guard-call-once branch May 22, 2025 17:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants