Skip to content

Commit 26ed1ad

Browse files
committed
Pass frontend info to gen_call_handling
1 parent b153d0a commit 26ed1ad

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

compiler/rustc_codegen_llvm/src/builder/gpu_offload.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,7 @@ pub(crate) fn gen_call_handling<'ll>(
368368
memtransfer_types: &[&'ll llvm::Value],
369369
region_ids: &[&'ll llvm::Value],
370370
llfn: &'ll Value,
371+
metadata: Vec<OffloadMetadata>,
371372
) {
372373
let (tgt_decl, tgt_target_kernel_ty) = generate_launcher(&cx);
373374
// %struct.__tgt_bin_desc = type { i32, ptr, ptr, ptr }
@@ -438,7 +439,7 @@ pub(crate) fn gen_call_handling<'ll>(
438439
// As mentioned above, we don't use Rust type information yet. So for now we will just
439440
// assume that we have 1024 bytes, 256 f32 values.
440441
// FIXME(offload): write an offload frontend and handle arbitrary types.
441-
builder.store(cx.get_const_i64(1024), gep3, Align::EIGHT);
442+
builder.store(cx.get_const_i64(metadata[i].payload_size), gep3, Align::EIGHT);
442443
}
443444

444445
// For now we have a very simplistic indexing scheme into our

compiler/rustc_codegen_llvm/src/intrinsic.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1295,6 +1295,7 @@ fn codegen_offload<'ll, 'tcx>(
12951295
&[memtransfer_type],
12961296
&[region_id],
12971297
llfn,
1298+
metadata,
12981299
);
12991300
}
13001301

0 commit comments

Comments
 (0)