This is an archive of the discontinued LLVM Phabricator instance.

Add -cuda-relaxed-constexpr, which lets CUDA device code call constexpr functions.
AbandonedPublic

Authored by jlebar on Mar 16 2016, 1:16 PM.

Details

Reviewers
None
Summary

In particular, this lets device code call most std::complex functions.

Diff Detail

Event Timeline

jlebar updated this revision to Diff 50851.Mar 16 2016, 1:16 PM
jlebar retitled this revision from to Add -cuda-relaxed-constexpr, which lets CUDA device code call constexpr functions..
jlebar updated this object.
jlebar added a reviewer: tra.
jlebar added a subscriber: cfe-commits.

Actually, this isn't enough. It works fine for std::complex, but it screws with our existing std math business, because some of the host functions that we're trying to override are constexpr, and now they're treated as constexpr host-device.

jlebar removed a reviewer: tra.Mar 16 2016, 1:34 PM

Abandoning this for now -- it is a maze of twisty passages all alike. Some std math functions are constexpr, and making them host+device affects all our existing math overloads in fun and exciting ways.

We may need this at some point, but for now I'm going to try something more finely targeted specifically at std::complex.

jlebar abandoned this revision.Mar 16 2016, 8:35 PM