[Openmp-commits] [openmp] r305090 - [OpenMP] Prevent unused-variable warning in libomptarget when compiling in Release mode.
Samuel Antao via Openmp-commits
openmp-commits at lists.llvm.org
Fri Jun 9 09:46:07 PDT 2017
Author: sfantao
Date: Fri Jun 9 11:46:07 2017
New Revision: 305090
URL: http://llvm.org/viewvc/llvm-project?rev=305090&view=rev
Log:
[OpenMP] Prevent unused-variable warning in libomptarget when compiling in Release mode.
Modified:
openmp/trunk/libomptarget/src/omptarget.cpp
Modified: openmp/trunk/libomptarget/src/omptarget.cpp
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/libomptarget/src/omptarget.cpp?rev=305090&r1=305089&r2=305090&view=diff
==============================================================================
--- openmp/trunk/libomptarget/src/omptarget.cpp (original)
+++ openmp/trunk/libomptarget/src/omptarget.cpp Fri Jun 9 11:46:07 2017
@@ -2144,12 +2144,14 @@ static int target(int32_t device_id, voi
} else {
fpArrays.push_back(TgtPtrBegin);
TgtBaseOffset = (intptr_t)HstPtrBase - (intptr_t)HstPtrBegin;
+#ifdef OMPTARGET_DEBUG
void *TgtPtrBase = (void *)((intptr_t)TgtPtrBegin + TgtBaseOffset);
DP("Allocated %" PRId64 " bytes of target memory at " DPxMOD " for "
"%sprivate array " DPxMOD " - pushing target argument " DPxMOD "\n",
arg_sizes[i], DPxPTR(TgtPtrBegin),
(arg_types[i] & OMP_TGT_MAPTYPE_TO ? "first-" : ""),
DPxPTR(HstPtrBegin), DPxPTR(TgtPtrBase));
+#endif
// If first-private, copy data from host
if (arg_types[i] & OMP_TGT_MAPTYPE_TO) {
int rt = Device.data_submit(TgtPtrBegin, HstPtrBegin, arg_sizes[i]);
@@ -2171,9 +2173,11 @@ static int target(int32_t device_id, voi
TgtPtrBegin = Device.getTgtPtrBegin(HstPtrBegin, arg_sizes[i], IsLast,
false);
TgtBaseOffset = (intptr_t)HstPtrBase - (intptr_t)HstPtrBegin;
+#ifdef OMPTARGET_DEBUG
void *TgtPtrBase = (void *)((intptr_t)TgtPtrBegin + TgtBaseOffset);
DP("Obtained target argument " DPxMOD " from host pointer " DPxMOD "\n",
DPxPTR(TgtPtrBase), DPxPTR(HstPtrBegin));
+#endif
}
tgt_args.push_back(TgtPtrBegin);
tgt_offsets.push_back(TgtBaseOffset);
More information about the Openmp-commits
mailing list