Skip to content

Commit

Permalink
Fixing LIBOMPTARGET_INFO message, for Copying data from device to host (
Browse files Browse the repository at this point in the history
#85444)

When running OpenMP offloading application with LIBOMPTARGET_INFO=-1,
the addresses of the Copying data from **device** to **host**, the
address are swap.
As an example, Currently the address would be
```
omptarget device 0 info: Mapping exists with HstPtrBegin=0x00007ffddaf0fb90, TgtPtrBegin=0x00007fb385404000, Size=8000, DynRefCount=0 (decremented, delayed deletion), HoldRefCount=0
omptarget device 0 info: Copying data from device to host, TgtPtr=0x00007ffddaf0fb90, HstPtr=0x00007fb385404000, Size=8000, Name=d
```
And it should be
```
omptarget device 0 info: Copying data from device to host, TgtPtr=0x00007fb385404000, HstPtr=0x00007ffddaf0fb90, Size=8000, Name=d
```

---------

Co-authored-by: fel-cab <fel-cab@github.com>
  • Loading branch information
fel-cab and fel-cab committed Mar 15, 2024
1 parent 89b7b3b commit 0e21672
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion openmp/libomptarget/src/OpenMP/Mapping.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,8 @@ static void printCopyInfoImpl(int DeviceId, bool H2D, void *SrcPtrBegin,
"Copying data from %s to %s, %sPtr=" DPxMOD ", %sPtr=" DPxMOD
", Size=%" PRId64 ", Name=%s\n",
H2D ? "host" : "device", H2D ? "device" : "host", H2D ? "Hst" : "Tgt",
DPxPTR(SrcPtrBegin), H2D ? "Tgt" : "Hst", DPxPTR(DstPtrBegin), Size,
DPxPTR(H2D ? SrcPtrBegin : DstPtrBegin), H2D ? "Tgt" : "Hst",
DPxPTR(H2D ? DstPtrBegin : SrcPtrBegin), Size,
(HT && HT->HstPtrName) ? getNameFromMapping(HT->HstPtrName).c_str()
: "unknown");
}
Expand Down

0 comments on commit 0e21672

Please sign in to comment.