Skip to content

Commit

Permalink
hero: Added printf during offload
Browse files Browse the repository at this point in the history
  • Loading branch information
CyrilKoe committed May 13, 2024
1 parent df91a5e commit a55c3e2
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion openmp/libomptarget/plugins/hero/rtl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,14 @@ int32_t __tgt_rtl_run_target_team_region(int32_t device_id, void *tgt_entry_ptr,
hero_dev_mbox_write(hd, num_miss_handler_threads);

uint32_t ret[2];
while (hero_dev_mbox_read(hd, (unsigned int *)&ret[0], 1));
ret[0] = 0;
while(ret[0] != MBOX_DEVICE_DONE) {
while (hero_dev_mbox_read(hd, (unsigned int *)&ret[0], 1));
if(ret[0] == MBOX_DEVICE_PRINT) {
while (hero_dev_mbox_read(hd, (unsigned int *)&ret[0], 1));
printf("%c", ret[0]);
}
}
assert(ret[0] == MBOX_DEVICE_DONE &&
"Software mailbox protocol failure: Expected MBOX_DEVICE_DONE.");
while (hero_dev_mbox_read(hd, (unsigned int *)&ret[1], 1));
Expand Down

0 comments on commit a55c3e2

Please sign in to comment.