This is an archive of the discontinued LLVM Phabricator instance.

[OpenMP] Use LIBOMPTARGET_DEVICE_RTL_DEBUG env var to control debug messages on the device side
ClosedPublic

Authored by guansong on Apr 27 2018, 2:22 PM.

Details

Summary

Enable the device side debug messages at compile time, use env var to control at runtime.

To achieve this, an environment data block is passed to the device lib when it is loaded.

By default, the message is off, to enable it, a user need to set LIBOMPDEVICE_DEBUG=1.

Diff Detail

Repository
rL LLVM

Event Timeline

guansong created this revision.Apr 27 2018, 2:22 PM
grokos added a comment.May 2 2018, 8:02 AM

May I suggest that we use something like LIBOMPTARGET_DEVICE_RTL_DEBUG instead of LIBOMPDEVICE_DEBUG? I think this name is more descriptive of what the env var does.

May I suggest that we use something like LIBOMPTARGET_DEVICE_RTL_DEBUG instead of LIBOMPDEVICE_DEBUG? I think this name is more descriptive of what the env var does.

It's kind of long, but I am ok also if you do not want to shorten it.

grokos added a comment.May 2 2018, 9:23 AM

May I suggest that we use something like LIBOMPTARGET_DEVICE_RTL_DEBUG instead of LIBOMPDEVICE_DEBUG? I think this name is more descriptive of what the env var does.

It's kind of long, but I am ok also if you do not want to shorten it.

I think it's more important to have a clear name than a short one. Let's change it.

guansong updated this revision to Diff 145138.May 3 2018, 8:03 PM

Update name as suggested.

grokos added inline comments.May 4 2018, 8:52 AM
libomptarget/plugins/cuda/src/rtl.cpp
533 ↗(On Diff #145138)

continue --> Continue

534–535 ↗(On Diff #145138)

Remove dead code.

guansong updated this revision to Diff 145217.May 4 2018, 10:06 AM

Update as suggested.

guansong marked 2 inline comments as done.May 4 2018, 10:07 AM
This comment was removed by guansong.
grokos accepted this revision.May 4 2018, 12:04 PM

LGTM

This revision is now accepted and ready to land.May 4 2018, 12:04 PM
grokos retitled this revision from [OpenMP] Use LIBOMPDEVICE_DEBUG env var to control debug messages on the device side to [OpenMP] Use LIBOMPTARGET_DEVICE_RTL_DEBUG env var to control debug messages on the device side.May 4 2018, 12:05 PM
This revision was automatically updated to reflect the committed changes.