[PATCH] D151349: [HIP] emit macro `__HIP_NO_IMAGE_SUPPORT`

Yaxun Liu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed May 24 10:08:44 PDT 2023


yaxunl created this revision.
yaxunl added reviewers: b-sumner, arsenm, tra.
Herald added subscribers: kerbowa, hiraditya, jvesely.
Herald added a project: All.
yaxunl requested review of this revision.
Herald added subscribers: llvm-commits, wdng.
Herald added a project: LLVM.

HIP texture/image support is optional as some devices
do not have image instructions. A macro `__HIP_NO_IMAGE_SUPPORT`
is defined for device not supporting images (https://github.com/ROCm-Developer-Tools/HIP/blob/d0448aa4c4dd0f4b29ccf6a663b7f5ad9f5183e0/docs/reference/kernel_language.md?plain=1#L426 )

Currently the macro is defined by HIP header based on predefined macros
for GPU, e.g `__gfx*__` , which is error prone. This patch let clang
emit the predefined macro.


https://reviews.llvm.org/D151349

Files:
  clang/include/clang/Basic/TargetInfo.h
  clang/lib/Basic/Targets/AMDGPU.h
  clang/lib/Frontend/InitPreprocessor.cpp
  clang/test/Driver/hip-macros.hip
  llvm/lib/TargetParser/TargetParser.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D151349.525236.patch
Type: text/x-patch
Size: 6407 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230524/d854925c/attachment-0001.bin>


More information about the cfe-commits mailing list