You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
rustbot
added
A-LLVM
Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.
S-waiting-on-author
Status: This is awaiting some action (such as code changes or more information) from the author.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
labels
Jun 17, 2026
Does it actually need to be a rust intrinsic? Does LLVM give omp_get_num_devices any special behavior or is it just a regular runtime call that we could directly call from rust code too?
@bjorn3 Yes, you could call all of our openmp/offload libraries directly, especially here it's easy enough. Some of the other ones we use for data transfer and kernel launches are just a bit more involved to set up, so we do it in the compiler.
The two problems of exposing it are that you'd need to link in the GCC or LLVM libraries yourself, if you build and use the Offload setup, we do it for users. Also cranelift doesn't provide it, with an intrinsic we could have better fallback behaviour.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.S-waiting-on-authorStatus: This is awaiting some action (such as code changes or more information) from the author.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.T-libsRelevant to the library team, which will review and decide on the PR/issue.
5 participants
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
get amount of available devices with
omp_get_num_devicesr? @ZuseZ4