[PATCH] D48613: [CUDA] Use atexit() to call module destructor.

2018-06-27 Thread Artem Belevich via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC335763: [CUDA] Use atexit() to call module destructor. (authored by tra, committed by ). Changed prior to commit: https://reviews.llvm.org/D48613?vs=153138&id=153144#toc Repository: rC Clang https:/

[PATCH] D48613: [CUDA] Use atexit() to call module destructor.

2018-06-27 Thread Artem Belevich via Phabricator via cfe-commits
tra updated this revision to Diff 153138. tra added a comment. Make destructor registration conditional -- we generate no destructor with -fcuda-rdc. Updated the test to reflect changes in destructor registration. https://reviews.llvm.org/D48613 Files: clang/lib/CodeGen/CGCUDANV.cpp clang/

[PATCH] D48613: [CUDA] Use atexit() to call module destructor.

2018-06-26 Thread Artem Belevich via Phabricator via cfe-commits
tra created this revision. tra added a reviewer: jlebar. Herald added subscribers: bixia, sanjoy. 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.