From 634016478ec95c6ff933d32789e663ace78e8f82 Mon Sep 17 00:00:00 2001 From: Manuel Drehwald Date: Wed, 18 Jun 2025 15:29:43 -0700 Subject: add -Zoffload=Enable flag behind -Zunstable-options, to enable gpu (host) code generation --- compiler/rustc_codegen_llvm/src/back/lto.rs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'compiler/rustc_codegen_llvm/src') 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); -- cgit 1.4.1-3-g733a5