[Openmp-commits] [openmp] Fixing LIBOMPTARGET_INFO message, for Copying data from device to host (PR #85444)

Felipe Cabarcas via Openmp-commits openmp-commits at lists.llvm.org
Fri Mar 15 11:42:13 PDT 2024


https://github.com/fel-cab updated https://github.com/llvm/llvm-project/pull/85444

>From 38b3bfd8d74256c48c8e8070775160d08a174f03 Mon Sep 17 00:00:00 2001
From: fel-cab <fel-cab at github.com>
Date: Fri, 15 Mar 2024 14:31:39 +0000
Subject: [PATCH 1/2] Fixing LIBOMPTARGET_INFO message, Hst and Tgt pointers
 were mixed on the printCopyInfoImpl when the copy was from the device to the
 host

---
 openmp/libomptarget/src/OpenMP/Mapping.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/openmp/libomptarget/src/OpenMP/Mapping.cpp b/openmp/libomptarget/src/OpenMP/Mapping.cpp
index 9c0b219b6f15f1..1f784b9b90f020 100644
--- a/openmp/libomptarget/src/OpenMP/Mapping.cpp
+++ b/openmp/libomptarget/src/OpenMP/Mapping.cpp
@@ -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");
 }

>From 2ec2695fa51ea2159f7fd41ea3f50e3f7fe1b28b Mon Sep 17 00:00:00 2001
From: fel-cab <fel-cab at github.com>
Date: Fri, 15 Mar 2024 18:41:44 +0000
Subject: [PATCH 2/2] Fixing format

---
 openmp/libomptarget/src/OpenMP/Mapping.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/openmp/libomptarget/src/OpenMP/Mapping.cpp b/openmp/libomptarget/src/OpenMP/Mapping.cpp
index 1f784b9b90f020..6157626f6e0e2f 100644
--- a/openmp/libomptarget/src/OpenMP/Mapping.cpp
+++ b/openmp/libomptarget/src/OpenMP/Mapping.cpp
@@ -511,8 +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(H2D ? SrcPtrBegin:DstPtrBegin), H2D ? "Tgt" : "Hst", 
-       DPxPTR(H2D ? DstPtrBegin:SrcPtrBegin), Size,
+       DPxPTR(H2D ? SrcPtrBegin : DstPtrBegin), H2D ? "Tgt" : "Hst",
+       DPxPTR(H2D ? DstPtrBegin : SrcPtrBegin), Size,
        (HT && HT->HstPtrName) ? getNameFromMapping(HT->HstPtrName).c_str()
                               : "unknown");
 }



More information about the Openmp-commits mailing list