Skip to content

Commit 06c8ab6

Browse files
committed
fix rustc to run kernels!
1 parent 129c176 commit 06c8ab6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-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
@@ -224,8 +224,9 @@ fn gen_define_handling<'ll>(
224224
// or both to and from the gpu (=3). Other values shouldn't affect us for now.
225225
// A non-mutable reference or pointer will be 1, an array that's not read, but fully overwritten
226226
// will be 2. For now, everything is 3, until we have our frontend set up.
227+
// 1+2+32: 1 (MapTo), 2 (MapFrom), 32 (Add extra input ptr once, idk, figure out later)
227228
let o_types =
228-
add_priv_unnamed_arr(&cx, &format!(".offload_maptypes.{num}"), &vec![3; num_ptr_types]);
229+
add_priv_unnamed_arr(&cx, &format!(".offload_maptypes.{num}"), &vec![1+2+32; num_ptr_types]);
229230
// Next: For each function, generate these three entries. A weak constant,
230231
// the llvm.rodata entry name, and the llvm_offload_entries value
231232

0 commit comments

Comments
 (0)