Skip to content

Commit 0e21672

Browse files
fel-cabfel-cab
and
fel-cab
authored
Fixing LIBOMPTARGET_INFO message, for Copying data from device to host (llvm#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 <[email protected]>
1 parent 89b7b3b commit 0e21672

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

openmp/libomptarget/src/OpenMP/Mapping.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -511,7 +511,8 @@ static void printCopyInfoImpl(int DeviceId, bool H2D, void *SrcPtrBegin,
511511
"Copying data from %s to %s, %sPtr=" DPxMOD ", %sPtr=" DPxMOD
512512
", Size=%" PRId64 ", Name=%s\n",
513513
H2D ? "host" : "device", H2D ? "device" : "host", H2D ? "Hst" : "Tgt",
514-
DPxPTR(SrcPtrBegin), H2D ? "Tgt" : "Hst", DPxPTR(DstPtrBegin), Size,
514+
DPxPTR(H2D ? SrcPtrBegin : DstPtrBegin), H2D ? "Tgt" : "Hst",
515+
DPxPTR(H2D ? DstPtrBegin : SrcPtrBegin), Size,
515516
(HT && HT->HstPtrName) ? getNameFromMapping(HT->HstPtrName).c_str()
516517
: "unknown");
517518
}

0 commit comments

Comments
 (0)