[PATCH] D125050: [OpenMP] Try to Infer target triples using the offloading architecture

Joseph Huber via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu May 5 15:15:29 PDT 2022


jhuber6 created this revision.
jhuber6 added reviewers: jdoerfert, yaxunl, JonChesterfield, saiislam, ronlieb.
Herald added a subscriber: guansong.
Herald added a project: All.
jhuber6 requested review of this revision.
Herald added subscribers: cfe-commits, sstefan1, MaskRay.
Herald added a project: clang.

Currently we require the `-fopenmp-targets=` option to specify the
triple to use for the offloading toolchains, and the `-Xopenmp-target=`
option to specify architectures to a specific toolchain. The changes
made in D124721 <https://reviews.llvm.org/D124721> allowed us to use `--offload-arch=` to specify multiple
target architectures. However, this can become combersome with many
different architectures. This patch introduces functinality that
attempts to deduce the target triple and architectures from the
offloading action. Currently we will deduce known GPU architectures when
only `-fopenmp` is specified.

This required a bit of a hack to cache the deduced architectures,
without this we would've just thrown an error when we tried to look up
the architecture again when generating the job. Normally we require the
user to manually specify the toolchain arguments, but here they would
confict unless we overrode them.

Depends on: D124721 <https://reviews.llvm.org/D124721>


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D125050

Files:
  clang/include/clang/Basic/DiagnosticDriverKinds.td
  clang/include/clang/Driver/Driver.h
  clang/lib/Driver/Driver.cpp
  clang/lib/Driver/ToolChains/Clang.cpp
  clang/test/Driver/openmp-offload-infer.c

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D125050.427474.patch
Type: text/x-patch
Size: 21463 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220505/fb92d73a/attachment-0001.bin>


More information about the cfe-commits mailing list