[Openmp-commits] [openmp] r298527 - [OpenMP] CUDA plugin: More descriptive error messages

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


Author: grokos
Date: Wed Mar 22 12:36:22 2017
New Revision: 298527

URL: http://llvm.org/viewvc/llvm-project?rev=298527&view=rev
Log:
[OpenMP] CUDA plugin: More descriptive error messages

Differential Revision: https://reviews.llvm.org/D31206


Modified:
    openmp/trunk/libomptarget/plugins/cuda/src/rtl.cpp

Modified: openmp/trunk/libomptarget/plugins/cuda/src/rtl.cpp
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/libomptarget/plugins/cuda/src/rtl.cpp?rev=298527&r1=298526&r2=298527&view=diff
==============================================================================
--- openmp/trunk/libomptarget/plugins/cuda/src/rtl.cpp (original)
+++ openmp/trunk/libomptarget/plugins/cuda/src/rtl.cpp Wed Mar 22 12:36:22 2017
@@ -646,8 +646,10 @@ int32_t __tgt_rtl_run_target_team_region
   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));




More information about the Openmp-commits mailing list