Skip to content

Commit 3632e16

Browse files
committed
broken
1 parent 8fd6beb commit 3632e16

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

compiler/rustc_codegen_llvm/src/back/write.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -773,18 +773,18 @@ pub(crate) unsafe fn llvm_optimize(
773773
)
774774
};
775775

776-
if cgcx.target_is_like_gpu && config.offload.contains(&config::Offload::Enable) {
776+
if cgcx.target_is_like_gpu && config.offload.contains(&config::Offload::Device(mypath)) {
777777
if cgcx.save_temps {
778778
// TODO.
779779
}
780-
//let out_dir = &cgcx.output_filenames;
781780
dbg!(&cgcx.output_filenames.out());
782-
let host_obj_c = &cgcx.output_filenames.with_extension("host.out");
783-
let out_obj_c = &cgcx.output_filenames.with_extension("host.o");
784-
// &out_dir = "/p/lustre1/drehwald1/prog/offload/r/target/amdgcn-amd-amdhsa/release/deps/libr.rs"
781+
let host_obj_c = &cgcx.output_filenames.out().join("host.out");
782+
let host_out_c = CString::new(format!("{}", host_obj_c.display())).unwrap();
783+
let out_obj_c = &cgcx.output_filenames.out().join("host.o");
784+
let out_obj_c = CString::new(format!("{}", out_obj_c.display())).unwrap();
785+
dbg!(&host_obj_c);
786+
dbg!(&out_obj_c);
785787
let lib_bc_c = CString::new("/p/lustre1/drehwald1/prog/offload/r/lib.bc").unwrap();
786-
let host_out_c = CString::new("/p/lustre1/drehwald1/prog/offload/r/host.out").unwrap();
787-
let out_obj_c = CString::new("/p/lustre1/drehwald1/prog/offload/r/host.o").unwrap();
788788

789789
unsafe {
790790
// 1) Bundle device module into offload image host.out (device TM)

compiler/rustc_session/src/config.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,10 +193,11 @@ pub enum CoverageLevel {
193193
}
194194

195195
// The different settings that the `-Z offload` flag can have.
196-
#[derive(Clone, Copy, PartialEq, Hash, Debug)]
196+
#[derive(Clone, PartialEq, Hash, Debug)]
197197
pub enum Offload {
198198
/// Enable the llvm offload pipeline
199199
Enable,
200+
Device(PathBuf),
200201
}
201202

202203
/// The different settings that the `-Z autodiff` flag can have.

0 commit comments

Comments
 (0)