This is an archive of the discontinued LLVM Phabricator instance.

[Polly] [GPUJIT] Teach GPUJIT to use a pre-existing CUDA context if available.
ClosedPublic

Authored by bollu on Aug 1 2017, 10:49 AM.

Details

Summary

On mixing the driver and runtime APIs, it is quite possible that a
context already exists due to runtime API usage. In this case, we should
try to use the same context.

Teach GPUJIT to detect that a context exists and how to pick up this context.

This is a part of (https://reviews.llvm.org/D35991) that was extracted
out.

Diff Detail

Repository
rL LLVM

Event Timeline

bollu created this revision.Aug 1 2017, 10:49 AM
grosser accepted this revision.Aug 1 2017, 10:57 AM

LGTM.

tools/GPURuntime/GPUJIT.c
29 ↗(On Diff #109156)

Not needed?

This revision is now accepted and ready to land.Aug 1 2017, 10:57 AM
bollu updated this revision to Diff 109299.Aug 2 2017, 2:07 AM

[NFC] remove assert, add error checking.

bollu updated this revision to Diff 109300.Aug 2 2017, 2:09 AM
  • [NFC] remove assert & add error checking. For some reason, this did not show up with the previous diff.
bollu updated this revision to Diff 109301.Aug 2 2017, 2:10 AM
bollu marked an inline comment as done.
  • [NFC] ran through update-format
This revision was automatically updated to reflect the committed changes.