diff options
author | Justin Lebar <jlebar@google.com> | 2016-08-18 20:43:13 +0000 |
---|---|---|
committer | Justin Lebar <jlebar@google.com> | 2016-08-18 20:43:13 +0000 |
commit | cb20a09f54efc4dc90852365f4301785ffab4c56 (patch) | |
tree | 27fe34a6c7fcaa583fc87b8605b610a57237f52b /clang/unittests/libclang/LibclangTest.cpp | |
parent | 40e8ca46ad4a02c3cd2b29347ae340e7fd1be1aa (diff) | |
download | llvm-cb20a09f54efc4dc90852365f4301785ffab4c56.zip llvm-cb20a09f54efc4dc90852365f4301785ffab4c56.tar.gz llvm-cb20a09f54efc4dc90852365f4301785ffab4c56.tar.bz2 |
[CUDA] Improve handling of math functions.
Summary:
A bunch of related changes here to our CUDA math headers.
- The second arg to nexttoward is a double (well, technically, long
double, but we don't have that), not a float.
- Add a forward-declare of llround(float), which is defined in the CUDA
headers. We need this for the same reason we need most of the other
forward-declares: To prevent a constexpr function in our standard
library from becoming host+device.
- Add nexttowardf implementation.
- Pull "foobarf" functions defined by the CUDA headers in the global
namespace into namespace std. This lets you do e.g. std::sinf.
- Add overloads for math functions accepting integer types. This lets
you do e.g. std::sin(0) without having an ambiguity between the
overload that takes a float and the one that takes a double.
With these changes, we pass testcases derived from libc++ for cmath and
math.h. We can check these testcases in to the test-suite once support
for CUDA lands there.
Reviewers: tra
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D23627
llvm-svn: 279140
Diffstat (limited to 'clang/unittests/libclang/LibclangTest.cpp')
0 files changed, 0 insertions, 0 deletions