From: Ye Luo Date: Tue, 30 Jun 2020 02:32:43 +0000 (-0400) Subject: [OpenMP] fix clang warning about printf format in CUDA plugin X-Git-Tag: llvmorg-12-init~1534 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=45bb073da8efc8652f7b8b351709ce0c838ed4b0;p=platform%2Fupstream%2Fllvm.git [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 --- diff --git a/openmp/libomptarget/plugins/cuda/src/rtl.cpp b/openmp/libomptarget/plugins/cuda/src/rtl.cpp index b877a63..290fe7b 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 @@ public: 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 @@ public: // 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 {