rust/compiler/rustc_interface/src
许杰友 Jieyou Xu (Joe) 5e3eb25125
Rollup merge of #142097 - ZuseZ4:offload-host1, r=oli-obk
gpu offload host code generation

r? ghost

This will generate most of the host side code to use llvm's offload feature.
The first PR will only handle automatic mem-transfers to and from the device.
So if a user calls a kernel, we will copy inputs back and forth, but we won't do the actual kernel launch.
Before merging, we will use LLVM's Info infrastructure to verify that the memcopies match what openmp offloa generates in C++. `LIBOMPTARGET_INFO=-1 ./my_rust_binary` should print that a memcpy to and later from the device is happening.

A follow-up PR will generate the actual device-side kernel which will then do computations on the GPU.
A third PR will implement manual host2device and device2host functionality, but the goal is to minimize cases where a user has to overwrite our default handling due to performance issues.

I'm trying to get a full MVP out first, so this just recognizes GPU functions based on magic names. The final frontend will obviously move this over to use proper macros, like I'm already doing it for the autodiff work.
This work will also be compatible with std::autodiff, so one can differentiate GPU kernels.

Tracking:
- https://github.com/rust-lang/rust/issues/131513
2025-07-22 00:54:24 +08:00
..
callbacks.rs Represent diagnostic side effects as dep nodes 2025-03-14 16:01:58 +01:00
errors.rs Remove attribute #[rustc_error] 2025-03-30 01:32:21 +03:00
interface.rs rustc_session: Add a structure for keeping both explicit and default sysroots 2025-06-24 16:00:04 +03:00
lib.rs update cfg(bootstrap) 2025-05-12 15:33:37 +02:00
limits.rs Move methods from Map to TyCtxt, part 2. 2025-02-18 10:17:44 +11:00
passes.rs Integrate stable feature checking into a query. 2025-07-17 23:19:12 +00:00
proc_macro_decls.rs Move methods from Map to TyCtxt, part 4. 2025-03-12 08:55:37 +11:00
queries.rs Save metadata among work products. 2025-07-04 14:02:17 +00:00
tests.rs add -Zoffload=Enable flag behind -Zunstable-options, to enable gpu (host) code generation 2025-07-18 16:24:00 -07:00
util.rs rustc_session: Add a structure for keeping both explicit and default sysroots 2025-06-24 16:00:04 +03:00