summaryrefslogtreecommitdiffstats
path: root/lib/Headers/__clang_cuda_math_forward_declares.h
Commit message (Collapse)AuthorAgeFilesLines
* [CUDA] Declare our __device__ math functions in the same inline namespace as ↵Justin Lebar2016-10-081-0/+20
| | | | | | | | | | | | | | | | | | | our standard library. Summary: Currently we declare our inline __device__ math functions in namespace std. But libstdc++ and libc++ declare these functions in an inline namespace inside namespace std. We need to match this because, in a later patch, we want to get e.g. <complex> to use our device overloads, and it only will if those overloads are in the right inline namespace. Reviewers: tra Subscribers: cfe-commits, jhen Differential Revision: https://reviews.llvm.org/D24977 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@283678 91177308-0d34-0410-b5e6-96231b3b80d8
* [CUDA] Improve handling of math functions.Justin Lebar2016-08-181-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@279140 91177308-0d34-0410-b5e6-96231b3b80d8
* [CUDA] Tweak math forward declares so we're compatible with libstdc++4.9.Justin Lebar2016-04-071-90/+162
| | | | | | | | | | | | | | | | | | Summary: See comments in patch; we were assuming that some stdlib math functions would be defined in namespace std, when in fact the spec says they should be defined in the global namespace. libstdc++4.9 became more conforming and broke us. This new implementation seems to cover the known knowns. Reviewers: rsmith Subscribers: cfe-commits, tra Differential Revision: http://reviews.llvm.org/D18882 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@265751 91177308-0d34-0410-b5e6-96231b3b80d8
* [CUDA] Add math forward declares to CUDA header wrapper.Justin Lebar2016-03-301-0/+191
Summary: This is necessary for a future patch which will make all constexpr functions implicitly host+device. cmath may declare constexpr functions, but these we do *not* want to be host+device. The forward declares added in this patch prevent this (because the rule will be, constexpr functions become implicitly host+device unless they're preceeded by a decl with __device__). Reviewers: tra Subscribers: cfe-commits, rnk, rsmith Differential Revision: http://reviews.llvm.org/D18539 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@264963 91177308-0d34-0410-b5e6-96231b3b80d8