From 01954092d0aafe3bbf36ee882c69e39a72dea518 Mon Sep 17 00:00:00 2001 From: George Rokos Date: Wed, 22 Mar 2017 17:36:22 +0000 Subject: [PATCH] [OpenMP] CUDA plugin: More descriptive error messages Differential Revision: https://reviews.llvm.org/D31206 llvm-svn: 298527 --- openmp/libomptarget/plugins/cuda/src/rtl.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/openmp/libomptarget/plugins/cuda/src/rtl.cpp b/openmp/libomptarget/plugins/cuda/src/rtl.cpp index 01786ad6cc50..cbca72bcd22b 100644 --- a/openmp/libomptarget/plugins/cuda/src/rtl.cpp +++ b/openmp/libomptarget/plugins/cuda/src/rtl.cpp @@ -646,8 +646,10 @@ int32_t __tgt_rtl_run_target_team_region(int32_t device_id, void *tgt_entry_ptr, 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));