[PATCH] D84743: [Clang][AMDGCN] Universal device offloading macros header

Saiyedul Islam via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 28 05:23:36 PDT 2020


saiislam created this revision.
saiislam added reviewers: jdoerfert, ABataev, JonChesterfield.
Herald added subscribers: cfe-commits, Anastasia.
Herald added a project: clang.
Harbormaster failed remote builds in B65994: Diff 281183!
Harbormaster returned this revision to the author for changes because remote builds failed.
saiislam updated this revision to Diff 281189.
saiislam added a comment.
saiislam requested review of this revision.
Herald added a subscriber: sstefan1.

Fixed clang-tidy warnings.


This header creates macros  _DEVICE_ARCH and _DEVICE_GPU with values. This
header exists because compiler macros are inconsistent in specifying if a
compiliation is a device pass or a host pass. There is also inconsistency in
how the device architecture and type are specified during a device pass. The
inconsistencies are between OpenMP, CUDA, HIP, and OpenCL. The macro logic
in this header is aware of these inconsistencies and sets useful values for
_DEVICE_ARCH and _DEVICE_GPU during a device compilation. The macros will
not be defined during a host compilation pass. So "#ifndef _DEVICE_ARCH" can
be used by users to imply a host compilation. This header must remain a
preprocessing header only because it is intended to be used by different
languages.

Originally authored by Greg Rodgers (@gregrodgers).


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D84743

Files:
  clang/lib/Headers/offload_macros.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D84743.281189.patch
Type: text/x-patch
Size: 4223 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200728/12fa3df9/attachment.bin>


More information about the cfe-commits mailing list