diff options
| author | Manuel Drehwald <git@manuel.drehwald.info> | 2025-06-18 15:29:43 -0700 |
|---|---|---|
| committer | Manuel Drehwald <git@manuel.drehwald.info> | 2025-07-18 16:24:00 -0700 |
| commit | 634016478ec95c6ff933d32789e663ace78e8f82 (patch) | |
| tree | c77b4ad839173bce2f3911cc860238323f7fb8d4 /compiler/rustc_codegen_llvm/src/back/lto.rs | |
| parent | 42d6b0d8bcdc5a0dfd77fe2daac6f8a8f67ac6cd (diff) | |
| download | rust-634016478ec95c6ff933d32789e663ace78e8f82.tar.gz rust-634016478ec95c6ff933d32789e663ace78e8f82.zip | |
add -Zoffload=Enable flag behind -Zunstable-options, to enable gpu (host) code generation
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/back/lto.rs')
| -rw-r--r-- | compiler/rustc_codegen_llvm/src/back/lto.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/compiler/rustc_codegen_llvm/src/back/lto.rs b/compiler/rustc_codegen_llvm/src/back/lto.rs index 655e1c95373..b050a69eece 100644 --- a/compiler/rustc_codegen_llvm/src/back/lto.rs +++ b/compiler/rustc_codegen_llvm/src/back/lto.rs @@ -668,6 +668,12 @@ pub(crate) fn run_pass_manager( write::llvm_optimize(cgcx, dcx, module, None, config, opt_level, opt_stage, stage)?; } + if enable_gpu && !thin { + let cx = + SimpleCx::new(module.module_llvm.llmod(), &module.module_llvm.llcx, cgcx.pointer_size); + crate::builder::gpu_offload::handle_gpu_code(cgcx, &cx); + } + if cfg!(llvm_enzyme) && enable_ad && !thin { let cx = SimpleCx::new(module.module_llvm.llmod(), &module.module_llvm.llcx, cgcx.pointer_size); |
