[Openmp-commits] [openmp] 45bb073 - [OpenMP] fix clang warning about printf format in CUDA plugin
Shilei Tian via Openmp-commits
openmp-commits at lists.llvm.org
Mon Jun 29 19:35:45 PDT 2020
Author: Ye Luo
Date: 2020-06-29T22:35:39-04:00
New Revision: 45bb073da8efc8652f7b8b351709ce0c838ed4b0
URL: https://github.com/llvm/llvm-project/commit/45bb073da8efc8652f7b8b351709ce0c838ed4b0
DIFF: https://github.com/llvm/llvm-project/commit/45bb073da8efc8652f7b8b351709ce0c838ed4b0.diff
LOG: [OpenMP] fix clang warning about printf format in CUDA plugin
Summary: Warnings are printed by clang when building LIBOMPTARGET_ENABLE_DEBUG=ON due incorrect format string.
Reviewers: tianshilei1992, jdoerfert
Reviewed By: tianshilei1992
Subscribers: yaxunl, guansong, sstefan1, openmp-commits
Tags: #openmp
Differential Revision: https://reviews.llvm.org/D82789
Added:
Modified:
openmp/libomptarget/plugins/cuda/src/rtl.cpp
Removed:
################################################################################
diff --git a/openmp/libomptarget/plugins/cuda/src/rtl.cpp b/openmp/libomptarget/plugins/cuda/src/rtl.cpp
index b877a6361824..290fe7b02be6 100644
--- a/openmp/libomptarget/plugins/cuda/src/rtl.cpp
+++ b/openmp/libomptarget/plugins/cuda/src/rtl.cpp
@@ -95,7 +95,7 @@ bool checkResult(CUresult Err, const char *ErrMsg) {
if (Err == CUDA_SUCCESS)
return true;
- DP(ErrMsg);
+ DP("%s", ErrMsg);
CUDA_ERR_STRING(Err);
return false;
}
@@ -795,8 +795,8 @@ class DeviceRTLTy {
return OFFLOAD_SUCCESS;
DP("Error returned from cuMemcpyPeerAsync. src_ptr = " DPxMOD
- ", src_id =%" PRId32 ", dst_ptr = %" DPxMOD ", dst_id =%" PRId32 "\n",
- SrcPtr, SrcDevId, DstPtr, DstDevId);
+ ", src_id =%" PRId32 ", dst_ptr = " DPxMOD ", dst_id =%" PRId32 "\n",
+ DPxPTR(SrcPtr), SrcDevId, DPxPTR(DstPtr), DstDevId);
CUDA_ERR_STRING(Err);
}
@@ -891,7 +891,7 @@ class DeviceRTLTy {
// loop.
CudaBlocksPerGrid = LoopTripCount;
}
- DP("Using %d teams due to loop trip count %" PRIu64
+ DP("Using %d teams due to loop trip count %" PRIu32
" and number of threads per block %d\n",
CudaBlocksPerGrid, LoopTripCount, CudaThreadsPerBlock);
} else {
More information about the Openmp-commits
mailing list