]> granicus.if.org Git - clang/commit
[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)
commit8379dbf80c66539b0fbd09752b38348d17065b2f
tree8446ff4483a4b61d1d4ea016ab54bbd489707851
parent9200182f8f5511fe3faa58cc0f758c8316691453
[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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@258880 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Headers/CMakeLists.txt
lib/Headers/__clang_cuda_cmath.h [new file with mode: 0644]
lib/Headers/__clang_cuda_runtime_wrapper.h