[PATCH] D155775: [Clang][Driver][RFC] Add driver support for C++ Parallel Algorithm Offload

Alex Voicu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 19 20:20:49 PDT 2023


AlexVlx created this revision.
AlexVlx added reviewers: jansvoboda11, arsenm, yaxunl, MaskRay.
AlexVlx added a project: clang.
Herald added subscribers: cmtice, kerbowa, ormris, hiraditya, tpr, jvesely.
Herald added a reviewer: jhenderson.
Herald added a project: All.
AlexVlx requested review of this revision.
Herald added subscribers: llvm-commits, cfe-commits, wdng.
Herald added a project: LLVM.

This patch adds the Driver changes needed by the standard algorithm offload feature being proposed here: https://discourse.llvm.org/t/rfc-adding-c-parallel-algorithm-offload-support-to-clang-llvm/72159/1. The verbose documentation is included in its parent patch. What this change does can be summed up as follows:

1. add two flags, one for enabling `stdpar` compilation, the second enabling the optional allocation interposition mode;
2. the flags correspond to new LangOpt members;
3. if we are compiling or linking with `-stdpar`, we enable HIP; in the compilation case C and C++ inputs are treated as HIP inputs;
4. the ROCm / AMDGPU driver is augmented to look for and include an implementation detail forwarding header, which is provided here https://github.com/ROCmSoftwarePlatform/roc-stdpar/blob/main/include/stdpar_lib.hpp; we error out if the user requested `stdpar` but the header or its dependencies cannot be found (it is plausible that in the future we'll move the check for the dependencies to the header itself in order to reduce the compiler footprint).

Tests for the behaviour described above are also added.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D155775

Files:
  clang/include/clang/Basic/DiagnosticDriverKinds.td
  clang/include/clang/Basic/LangOptions.def
  clang/include/clang/Driver/Options.td
  clang/lib/Driver/Driver.cpp
  clang/lib/Driver/ToolChains/AMDGPU.cpp
  clang/lib/Driver/ToolChains/Clang.cpp
  clang/lib/Driver/ToolChains/ROCm.h
  clang/test/Driver/Inputs/stdpar/stdpar_lib.hpp
  clang/test/Driver/stdpar.c
  llvm/include/llvm/CodeGen/AccelTable.h
  llvm/lib/CodeGen/AsmPrinter/AccelTable.cpp
  llvm/test/DebugInfo/Generic/accel-table-hash-collisions.ll
  llvm/test/DebugInfo/Generic/apple-names-hash-collisions.ll
  llvm/test/DebugInfo/Generic/debug-names-hash-collisions.ll
  llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp
  llvm/utils/gn/secondary/clang/lib/Headers/BUILD.gn

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D155775.542284.patch
Type: text/x-patch
Size: 19606 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230720/e12844ad/attachment-0001.bin>


More information about the cfe-commits mailing list