[PATCH] D78155: [OpenMP] Use __OPENMP_NVPTX__ instead of _OPENMP in wrapper headers

Johannes Doerfert via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 14 14:05:24 PDT 2020


jdoerfert created this revision.
jdoerfert added reviewers: tra, hfinkel.
Herald added subscribers: guansong, bollu, yaxunl.
Herald added a project: clang.

Due to recent changes we cannot use OpenMP in CUDA files anymore
(PR45533) as the math handling of CUDA is different when _OPENMP is
defined. We actually want this different behavior only if we are
offloading with OpenMP to NVIDIA, thus generating NVPTX. With this patch
we do not interfere with the CUDA math handling except if we are in
NVPTX offloading mode, as indicated by the presence of __OPENMP_NVPTX__.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D78155

Files:
  clang/lib/Headers/__clang_cuda_cmath.h
  clang/lib/Headers/__clang_cuda_device_functions.h
  clang/lib/Headers/__clang_cuda_libdevice_declares.h
  clang/lib/Headers/__clang_cuda_math.h
  clang/lib/Headers/openmp_wrappers/__clang_openmp_device_functions.h
  clang/lib/Headers/openmp_wrappers/cmath
  clang/lib/Headers/openmp_wrappers/math.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D78155.257493.patch
Type: text/x-patch
Size: 6366 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200414/0062c3c3/attachment.bin>


More information about the cfe-commits mailing list