This is an archive of the discontinued LLVM Phabricator instance.

[CUDA] Use atexit() to call module destructor.
ClosedPublic

Authored by tra on Jun 26 2018, 3:09 PM.

Details

Summary

This matches the way NVCC does it. Doing module cleanup at global
destructor phase used to work, but is, apparently, too late for
the CUDA runtime in CUDA-9.2, which ends up crashing with double-free.

Event Timeline

tra created this revision.Jun 26 2018, 3:09 PM
jlebar accepted this revision.Jun 26 2018, 3:10 PM
This revision is now accepted and ready to land.Jun 26 2018, 3:10 PM
tra updated this revision to Diff 153138.Jun 27 2018, 11:23 AM

Make destructor registration conditional -- we generate no destructor with -fcuda-rdc.
Updated the test to reflect changes in destructor registration.

This revision was automatically updated to reflect the committed changes.