[Openmp-commits] [PATCH] D31206: [OpenMP] CUDA plugin: More descriptive error messages

George Rokos via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Wed Mar 22 10:19:22 PDT 2017


grokos updated this revision to Diff 92655.
grokos marked an inline comment as done.
grokos added a comment.

Updated diff.


https://reviews.llvm.org/D31206

Files:
  libomptarget/plugins/cuda/src/rtl.cpp


Index: libomptarget/plugins/cuda/src/rtl.cpp
===================================================================
--- libomptarget/plugins/cuda/src/rtl.cpp
+++ libomptarget/plugins/cuda/src/rtl.cpp
@@ -646,8 +646,10 @@
   DP("Launch of entry point at " DPxMOD " successful!\n",
       DPxPTR(tgt_entry_ptr));
 
-  if (cudaDeviceSynchronize() != cudaSuccess) {
-    DP("Kernel execution error at " DPxMOD ".\n", DPxPTR(tgt_entry_ptr));
+  cudaError_t sync_error = cudaDeviceSynchronize();
+  if (sync_error != cudaSuccess) {
+  DP("Kernel execution error at " DPxMOD ", %s.\n", DPxPTR(tgt_entry_ptr),
+      cudaGetErrorString(sync_error));
     return OFFLOAD_FAIL;
   } else {
     DP("Kernel execution at " DPxMOD " successful!\n", DPxPTR(tgt_entry_ptr));


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D31206.92655.patch
Type: text/x-patch
Size: 757 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20170322/39caa57a/attachment-0001.bin>


More information about the Openmp-commits mailing list