dlopen offload - #160335
Conversation
|
This PR changes how LLVM is built. Consider updating src/bootstrap/download-ci-llvm-stamp. |
1bb876b to
3eee4fe
Compare
This comment has been minimized.
This comment has been minimized.
| impl KernelArgsTy { | ||
| const OFFLOAD_VERSION: u64 = 3; | ||
| const FLAGS: u64 = 0; | ||
| const FLAGS: u64 = 1 << 6; // Enable StrictBlocksAndThreads |
There was a problem hiding this comment.
There was a problem hiding this comment.
cc @kevinsala
@Sa4dUs I vaguely remember you ran into this when trying LLVM 23 patches, right? Was this the right solution?
4011977 to
94f5d55
Compare
94f5d55 to
48ede5a
Compare
|
The job Click to see the possible cause of the failure (guessed by this bot) |
|
The LLVM 23 update unfortunately takes a little longer than expected, but glad to hear you got it to work with both 22 and 23. In that case I'd just merge it once it's ready and not wait, since it seems unlikely that we'll break the LLVM 23 update PR with this work here. Worst case, It's a bit unfortunate that we need a new cmake file for the offload wrapper. Hopefully I'll find time to upstream our wrappers into LLVM, so we won't need that in the future. But it would probably be part of llvm 24, so we shouldn't wait for that. |
| unsafe { | ||
| llvm::LLVMRustOffloadMapper(old_fn, new_fn, old_args_rebuilt.as_ptr()); | ||
| } | ||
| llvm::RustOffloadWrapper::get_instance().llvm_rust_offload_wrapper( |
There was a problem hiding this comment.
We don't really have any new safety checks in place ,or? So I'd leave those three fucntions marked as unsafe.

dlopen offload to dist it in dist-x86_64-linux without enabling llvm.offload=true in CI (#159064 (comment))
I tested that this works by following steps at https://rustc-dev-guide.rust-lang.org/offload/usage.html for both LLVM22 and 23(by switch base branch to #158734 temporarily), though It might be better to land this after LLVM 23.
r? @ZuseZ4