[CUDA] Implemented device-side support functions in <cmath>.
authorArtem Belevich <tra@google.com>
Tue, 26 Jan 2016 23:37:29 +0000 (23:37 +0000)
committerArtem Belevich <tra@google.com>
Tue, 26 Jan 2016 23:37:29 +0000 (23:37 +0000)
commitc5f41a34e505230ada3602e40626915a11a93a75
treeba339d5ae1c212f4c3cc18e177e236716203e1b5
parent40d7d02d3d5c629f5d8af916aabb2e836cc078bd
[CUDA] Implemented device-side support functions in <cmath>.

CUDA expects math functions in std:: namespace to work on device side.
In order to make it work with clang without allowing device-side code
generation for functions w/o appropriate target attributes, this patch
provides device-side implementations for <cmath> functions. Most of
them call global-scope math functions provided by CUDA headers. In few
cases we use clang builtins.

Tested out-of tree by compiling and running thrust's unit_tests.
https://github.com/thrust/thrust/tree/master/testing

Differential Revision: http://reviews.llvm.org/D16593

llvm-svn: 258880
clang/lib/Headers/CMakeLists.txt
clang/lib/Headers/__clang_cuda_cmath.h [new file with mode: 0644]
clang/lib/Headers/__clang_cuda_runtime_wrapper.h