[Openmp-commits] [PATCH] D65687: [libomptarget] Harmonize emitting CUDA errors and general debug messages.
Michael Kruse via Phabricator via Openmp-commits
openmp-commits at lists.llvm.org
Mon Aug 5 12:12:20 PDT 2019
This revision was automatically updated to reflect the committed changes.
Closed by commit rL367910: [libomptarget] Harmonize emitting CUDA errors and general debug messages. (authored by Meinersbur, committed by ).
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
Changed prior to commit:
https://reviews.llvm.org/D65687?vs=213149&id=213429#toc
Repository:
rL LLVM
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D65687/new/
https://reviews.llvm.org/D65687
Files:
openmp/trunk/libomptarget/plugins/cuda/CMakeLists.txt
openmp/trunk/libomptarget/plugins/cuda/src/rtl.cpp
Index: openmp/trunk/libomptarget/plugins/cuda/CMakeLists.txt
===================================================================
--- openmp/trunk/libomptarget/plugins/cuda/CMakeLists.txt
+++ openmp/trunk/libomptarget/plugins/cuda/CMakeLists.txt
@@ -28,10 +28,6 @@
# Define the suffix for the runtime messaging dumps.
add_definitions(-DTARGET_NAME=CUDA)
-if(LIBOMPTARGET_CMAKE_BUILD_TYPE MATCHES debug)
- add_definitions(-DCUDA_ERROR_REPORT)
-endif()
-
include_directories(${LIBOMPTARGET_DEP_CUDA_INCLUDE_DIRS})
include_directories(${LIBOMPTARGET_DEP_LIBELF_INCLUDE_DIRS})
Index: openmp/trunk/libomptarget/plugins/cuda/src/rtl.cpp
===================================================================
--- openmp/trunk/libomptarget/plugins/cuda/src/rtl.cpp
+++ openmp/trunk/libomptarget/plugins/cuda/src/rtl.cpp
@@ -34,25 +34,23 @@
DEBUGP("Target " GETNAME(TARGET_NAME) " RTL", __VA_ARGS__); \
} \
} while (false)
+
+// Utility for retrieving and printing CUDA error string.
+#define CUDA_ERR_STRING(err) \
+ do { \
+ if (DebugLevel > 0) { \
+ const char *errStr; \
+ cuGetErrorString(err, &errStr); \
+ DEBUGP("Target " GETNAME(TARGET_NAME) " RTL", "CUDA error is: %s\n", errStr); \
+ } \
+ } while (false)
#else // OMPTARGET_DEBUG
#define DP(...) {}
+#define CUDA_ERR_STRING(err) {}
#endif // OMPTARGET_DEBUG
#include "../../common/elf_common.c"
-// Utility for retrieving and printing CUDA error string.
-#ifdef CUDA_ERROR_REPORT
-#define CUDA_ERR_STRING(err) \
- do { \
- const char *errStr; \
- cuGetErrorString(err, &errStr); \
- DP("CUDA error is: %s\n", errStr); \
- } while (0)
-#else
-#define CUDA_ERR_STRING(err) \
- {}
-#endif
-
/// Keep entries table per device.
struct FuncOrGblEntryTy {
__tgt_target_table Table;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D65687.213429.patch
Type: text/x-patch
Size: 2108 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20190805/ed3dbd9d/attachment-0001.bin>
More information about the Openmp-commits
mailing list