[all-commits] [llvm/llvm-project] 9a4085: [HIP][Clang][Driver] Add Driver support for `hipst...

Alex Voicu via All-commits all-commits at lists.llvm.org
Tue Oct 3 05:15:09 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 9a408588d1b8b7899eff593c537de539a4a12651
      https://github.com/llvm/llvm-project/commit/9a408588d1b8b7899eff593c537de539a4a12651
  Author: Alex Voicu <alexandru.voicu at amd.com>
  Date:   2023-10-03 (Tue, 03 Oct 2023)

  Changed paths:
    M clang/include/clang/Basic/DiagnosticDriverKinds.td
    M clang/include/clang/Basic/LangOptions.def
    M clang/include/clang/Driver/Options.td
    M clang/lib/Driver/Driver.cpp
    M clang/lib/Driver/ToolChains/AMDGPU.cpp
    M clang/lib/Driver/ToolChains/Clang.cpp
    M clang/lib/Driver/ToolChains/HIPAMD.cpp
    M clang/lib/Driver/ToolChains/ROCm.h
    A clang/test/Driver/Inputs/hipstdpar/hipstdpar_lib.hpp
    A clang/test/Driver/Inputs/hipstdpar/rocprim/.keep
    A clang/test/Driver/Inputs/hipstdpar/thrust/.keep
    A clang/test/Driver/hipstdpar.c

  Log Message:
  -----------
  [HIP][Clang][Driver] Add Driver support for `hipstdpar`

This patch adds the Driver changes needed for enabling HIP parallel algorithm offload on AMDGPU targets. What this change does can be summed up as follows:

- add two flags, one for enabling `hipstdpar` compilation, the second enabling the optional allocation interposition mode;
- the flags correspond to new LangOpt members;
- if we are compiling or linking with --hipstdpar, we enable HIP; in the compilation case C and C++ inputs are treated as HIP inputs;
- the ROCm / AMDGPU driver is augmented to look for and include an implementation detail forwarding header; we error out if the user requested `hipstdpar` but the header or its dependencies cannot be found.

Tests for the behaviour described above are also added.

Reviewed by: MaskRay, yaxunl

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




More information about the All-commits mailing list