Skip to content

Commit 5e02ffe

Browse files
committed
Pass frontend info to gen_call_handling
1 parent 0915824 commit 5e02ffe

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
@@ -371,6 +371,7 @@ pub(crate) fn gen_call_handling<'ll>(
371371
memtransfer_types: &[&'ll llvm::Value],
372372
region_ids: &[&'ll llvm::Value],
373373
llfn: &'ll Value,
374+
metadata: Vec<OffloadMetadata>,
374375
) {
375376
let (tgt_decl, tgt_target_kernel_ty) = generate_launcher(&cx);
376377
// %struct.__tgt_bin_desc = type { i32, ptr, ptr, ptr }
@@ -441,7 +442,7 @@ pub(crate) fn gen_call_handling<'ll>(
441442
// As mentioned above, we don't use Rust type information yet. So for now we will just
442443
// assume that we have 1024 bytes, 256 f32 values.
443444
// FIXME(offload): write an offload frontend and handle arbitrary types.
444-
builder.store(cx.get_const_i64(1024), gep3, Align::EIGHT);
445+
builder.store(cx.get_const_i64(metadata[i].payload_size), gep3, Align::EIGHT);
445446
}
446447

447448
// 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)