[all-commits] [llvm/llvm-project] 11d06b: [HIP] Add default header and include path

Yaxun (Sam) Liu via All-commits all-commits at lists.llvm.org
Fri Jun 5 09:45:37 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 11d06b9511bd25aabbfad10dff548b0ce29135a5
      https://github.com/llvm/llvm-project/commit/11d06b9511bd25aabbfad10dff548b0ce29135a5
  Author: Yaxun (Sam) Liu <yaxun.liu at amd.com>
  Date:   2020-06-05 (Fri, 05 Jun 2020)

  Changed paths:
    M clang/include/clang/Basic/DiagnosticDriverKinds.td
    M clang/include/clang/Driver/Options.td
    M clang/include/clang/Driver/ToolChain.h
    M clang/lib/Driver/ToolChain.cpp
    M clang/lib/Driver/ToolChains/AMDGPU.cpp
    M clang/lib/Driver/ToolChains/AMDGPU.h
    M clang/lib/Driver/ToolChains/Clang.cpp
    M clang/lib/Driver/ToolChains/Cuda.cpp
    M clang/lib/Driver/ToolChains/Gnu.cpp
    M clang/lib/Driver/ToolChains/Gnu.h
    M clang/lib/Driver/ToolChains/HIP.cpp
    M clang/lib/Driver/ToolChains/HIP.h
    M clang/lib/Driver/ToolChains/Linux.cpp
    M clang/lib/Driver/ToolChains/Linux.h
    M clang/lib/Driver/ToolChains/MSVC.cpp
    M clang/lib/Driver/ToolChains/MSVC.h
    A clang/lib/Driver/ToolChains/ROCm.h
    M clang/lib/Headers/CMakeLists.txt
    M clang/lib/Headers/__clang_cuda_math_forward_declares.h
    A clang/lib/Headers/__clang_hip_libdevice_declares.h
    A clang/lib/Headers/__clang_hip_math.h
    A clang/lib/Headers/__clang_hip_runtime_wrapper.h
    R clang/test/Driver/Inputs/rocm-device-libs/amdgcn/bitcode/hip.bc
    R clang/test/Driver/Inputs/rocm-device-libs/amdgcn/bitcode/ockl.bc
    R clang/test/Driver/Inputs/rocm-device-libs/amdgcn/bitcode/oclc_correctly_rounded_sqrt_off.bc
    R clang/test/Driver/Inputs/rocm-device-libs/amdgcn/bitcode/oclc_correctly_rounded_sqrt_on.bc
    R clang/test/Driver/Inputs/rocm-device-libs/amdgcn/bitcode/oclc_daz_opt_off.bc
    R clang/test/Driver/Inputs/rocm-device-libs/amdgcn/bitcode/oclc_daz_opt_on.bc
    R clang/test/Driver/Inputs/rocm-device-libs/amdgcn/bitcode/oclc_finite_only_off.bc
    R clang/test/Driver/Inputs/rocm-device-libs/amdgcn/bitcode/oclc_finite_only_on.bc
    R clang/test/Driver/Inputs/rocm-device-libs/amdgcn/bitcode/oclc_isa_version_1010.bc
    R clang/test/Driver/Inputs/rocm-device-libs/amdgcn/bitcode/oclc_isa_version_1011.bc
    R clang/test/Driver/Inputs/rocm-device-libs/amdgcn/bitcode/oclc_isa_version_1012.bc
    R clang/test/Driver/Inputs/rocm-device-libs/amdgcn/bitcode/oclc_isa_version_803.bc
    R clang/test/Driver/Inputs/rocm-device-libs/amdgcn/bitcode/oclc_isa_version_900.bc
    R clang/test/Driver/Inputs/rocm-device-libs/amdgcn/bitcode/oclc_unsafe_math_off.bc
    R clang/test/Driver/Inputs/rocm-device-libs/amdgcn/bitcode/oclc_unsafe_math_on.bc
    R clang/test/Driver/Inputs/rocm-device-libs/amdgcn/bitcode/oclc_wavefrontsize64_off.bc
    R clang/test/Driver/Inputs/rocm-device-libs/amdgcn/bitcode/oclc_wavefrontsize64_on.bc
    R clang/test/Driver/Inputs/rocm-device-libs/amdgcn/bitcode/ocml.bc
    R clang/test/Driver/Inputs/rocm-device-libs/amdgcn/bitcode/opencl.bc
    A clang/test/Driver/Inputs/rocm/amdgcn/bitcode/hip.bc
    A clang/test/Driver/Inputs/rocm/amdgcn/bitcode/ockl.bc
    A clang/test/Driver/Inputs/rocm/amdgcn/bitcode/oclc_correctly_rounded_sqrt_off.bc
    A clang/test/Driver/Inputs/rocm/amdgcn/bitcode/oclc_correctly_rounded_sqrt_on.bc
    A clang/test/Driver/Inputs/rocm/amdgcn/bitcode/oclc_daz_opt_off.bc
    A clang/test/Driver/Inputs/rocm/amdgcn/bitcode/oclc_daz_opt_on.bc
    A clang/test/Driver/Inputs/rocm/amdgcn/bitcode/oclc_finite_only_off.bc
    A clang/test/Driver/Inputs/rocm/amdgcn/bitcode/oclc_finite_only_on.bc
    A clang/test/Driver/Inputs/rocm/amdgcn/bitcode/oclc_isa_version_1010.bc
    A clang/test/Driver/Inputs/rocm/amdgcn/bitcode/oclc_isa_version_1011.bc
    A clang/test/Driver/Inputs/rocm/amdgcn/bitcode/oclc_isa_version_1012.bc
    A clang/test/Driver/Inputs/rocm/amdgcn/bitcode/oclc_isa_version_803.bc
    A clang/test/Driver/Inputs/rocm/amdgcn/bitcode/oclc_isa_version_900.bc
    A clang/test/Driver/Inputs/rocm/amdgcn/bitcode/oclc_unsafe_math_off.bc
    A clang/test/Driver/Inputs/rocm/amdgcn/bitcode/oclc_unsafe_math_on.bc
    A clang/test/Driver/Inputs/rocm/amdgcn/bitcode/oclc_wavefrontsize64_off.bc
    A clang/test/Driver/Inputs/rocm/amdgcn/bitcode/oclc_wavefrontsize64_on.bc
    A clang/test/Driver/Inputs/rocm/amdgcn/bitcode/ocml.bc
    A clang/test/Driver/Inputs/rocm/amdgcn/bitcode/opencl.bc
    A clang/test/Driver/Inputs/rocm/include/hip/hip_runtime.h
    M clang/test/Driver/hip-device-libs.hip
    A clang/test/Driver/hip-include-path.hip
    M clang/test/Driver/rocm-detect.cl
    M clang/test/Driver/rocm-detect.hip
    M clang/test/Driver/rocm-device-libs.cl
    M clang/test/Driver/rocm-not-found.cl

  Log Message:
  -----------
  [HIP] Add default header and include path

To support std::complex and some other standard C/C++ functions in HIP device code,
they need to be forced to be __host__ __device__ functions by pragmas. This is done
by some clang standard C++ wrapper headers which are shared between cuda-clang and hip-Clang.

For these standard C++ wapper headers to work properly, specific include path order
has to be enforced:

  clang C++ wrapper include path
  standard C++ include path
  clang include path

Also, these C++ wrapper headers require device version of some standard C/C++ functions
must be declared before including them. This needs to be done by including a default
header which declares or defines these device functions. The default header is always
included before any other headers are included by users.

This patch adds the the default header and include path for HIP.

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




More information about the All-commits mailing list