This is an archive of the discontinued LLVM Phabricator instance.

[libomptarget] Harmonize emitting CUDA errors and general debug messages.
ClosedPublic

Authored by Meinersbur on Aug 2 2019, 5:43 PM.

Details

Summary

Ensures that CUDA fail reasons (such as "No CUDA-capable device detected") are printed together with libomptarget's debug message (e.g. "Error when setting CUDA context"). Previously, the former was printed only in CMAKE_BUILD_TYPE=Debug builds while the latter was enabled by LIBOMPTARGET_ENABLE_DEBUG,

With this change, also only call cuGetErrorString when the error will be printed.

Suggested-by: Ye Luo

Diff Detail

Repository
rL LLVM

Event Timeline

Meinersbur created this revision.Aug 2 2019, 5:43 PM
Herald added a project: Restricted Project. · View Herald Transcript
grokos accepted this revision.Aug 2 2019, 6:56 PM

This patch makes debug output more consistent, thanks!

This revision is now accepted and ready to land.Aug 2 2019, 6:56 PM
ye-luo accepted this revision.Aug 2 2019, 7:13 PM

LGTM. One fewer hidden knob!

This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptAug 5 2019, 12:12 PM