[all-commits] [llvm/llvm-project] 6823af: [HIP] Support hipRTC in header

Yaxun (Sam) Liu via All-commits all-commits at lists.llvm.org
Sat Apr 17 08:35:42 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 6823af0ca858b54e09e5be61a19d067ccd0bd6b7
      https://github.com/llvm/llvm-project/commit/6823af0ca858b54e09e5be61a19d067ccd0bd6b7
  Author: Yaxun (Sam) Liu <yaxun.liu at amd.com>
  Date:   2021-04-17 (Sat, 17 Apr 2021)

  Changed paths:
    M clang/lib/Headers/__clang_hip_cmath.h
    M clang/lib/Headers/__clang_hip_math.h
    M clang/lib/Headers/__clang_hip_runtime_wrapper.h
    A clang/test/Headers/hip-header.hip
    M clang/test/lit.cfg.py

  Log Message:
  -----------
  [HIP] Support hipRTC in header

hipRTC compiles HIP device code at run time. Since the system may not
have development tools installed, when a HIP program is compiled through
hipRTC, there is no standard C or C++ header available. As such, the HIP
headers should not depend on standard C or C++ headers when used
with hipRTC. Basically when hipRTC is used, HIP headers only provides
definitions of HIP device API functions. This is in line with what nvRTC does.

This patch adds support of hipRTC to HIP headers in clang. Basically hipRTC
defines a macro __HIPCC_RTC__ when compile HIP code at run time. When
this macro is defined, HIP headers do not include standard C/C++ headers.

Reviewed by: Artem Belevich

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




More information about the All-commits mailing list