]> granicus.if.org Git - clang/commit
[OpenMP][Clang] Support for target math functions
authorGheorghe-Teodor Bercea <gheorghe-teod.bercea@ibm.com>
Wed, 8 May 2019 15:52:33 +0000 (15:52 +0000)
committerGheorghe-Teodor Bercea <gheorghe-teod.bercea@ibm.com>
Wed, 8 May 2019 15:52:33 +0000 (15:52 +0000)
commit2dffffc4ea20d6f292d86d29f3767fdc1ea63910
tree49f1462cf12880ec60aaabc4aa82cffc773057ed
parent1cba198da9e5c6a3f9763cf2fbe642508a68c922
[OpenMP][Clang] Support for target math functions

Summary:
In this patch we propose a temporary solution to resolving math functions for the NVPTX toolchain, temporary until OpenMP variant is supported by Clang.

We intercept the inclusion of math.h and cmath headers and if we are in the OpenMP-NVPTX case, we re-use CUDA's math function resolution mechanism.

Authors:
@gtbercea
@jdoerfert

Reviewers: hfinkel, caomhin, ABataev, tra

Reviewed By: hfinkel, ABataev, tra

Subscribers: JDevlieghere, mgorny, guansong, cfe-commits, jdoerfert

Tags: #clang

Differential Revision: https://reviews.llvm.org/D61399

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@360265 91177308-0d34-0410-b5e6-96231b3b80d8
18 files changed:
lib/Driver/ToolChain.cpp
lib/Driver/ToolChains/Clang.cpp
lib/Headers/CMakeLists.txt
lib/Headers/__clang_cuda_cmath.h
lib/Headers/__clang_cuda_device_functions.h
lib/Headers/__clang_cuda_libdevice_declares.h
lib/Headers/__clang_cuda_math_forward_declares.h
lib/Headers/openmp_wrappers/__clang_openmp_math.h [new file with mode: 0644]
lib/Headers/openmp_wrappers/cmath [new file with mode: 0644]
lib/Headers/openmp_wrappers/math.h [new file with mode: 0644]
test/Driver/openmp-offload-gpu.c
test/Headers/Inputs/include/cmath [new file with mode: 0644]
test/Headers/Inputs/include/limits [new file with mode: 0644]
test/Headers/Inputs/include/math.h
test/Headers/nvptx_device_cmath_functions.c [new file with mode: 0644]
test/Headers/nvptx_device_cmath_functions.cpp [new file with mode: 0644]
test/Headers/nvptx_device_math_functions.c [new file with mode: 0644]
test/Headers/nvptx_device_math_functions.cpp [new file with mode: 0644]