[Openmp-commits] [PATCH] D106870: [OpenMP] Multi architecture compilation support

Saiyedul Islam via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Tue Jul 27 06:00:29 PDT 2021


saiislam created this revision.
saiislam added reviewers: jdoerfert, yaxunl, JonChesterfield, RaviNarayanaswamy.
Herald added subscribers: kerbowa, pengfei, guansong, nhaehnle, jvesely.
saiislam requested review of this revision.
Herald added subscribers: openmp-commits, cfe-commits, sstefan1.
Herald added projects: clang, OpenMP.

Multiple offloading targets can now be specified in the command
line. An instance of toolchain is created for each unique
combination of Target Triple and Target GPU. Device runtime has
been modified to support binaries containing multiple images,
each for a different target.
Data structure "__tgt_image_info" defined in
"llvm-project/openmp/libomptarget/include/omptarget.h" is used
to pass requirements of each image. E.g. GPU name like gfx906,
sm35, etc are the requirements of the image, which is produced
by clang-offload-wrapper and read by device RTL.

Example:

  clang  -O2  -target x86_64-pc-linux-gnu -fopenmp \
    -fopenmp-targets=amdgcn-amd-amdhsa,amdgcn-amd-amdhsa \
    -Xopenmp-target=amdgcn-amd-amdhsa -march=gfx906 \
    -Xopenmp-target=amdgcn-amd-amdhsa -march=gfx908 \
   helloworld.c -o helloworld


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D106870

Files:
  clang/include/clang/Basic/DiagnosticDriverKinds.td
  clang/include/clang/Driver/ToolChain.h
  clang/lib/Driver/Action.cpp
  clang/lib/Driver/Driver.cpp
  clang/lib/Driver/ToolChains/AMDGPUOpenMP.cpp
  clang/lib/Driver/ToolChains/AMDGPUOpenMP.h
  clang/lib/Driver/ToolChains/Clang.cpp
  clang/lib/Driver/ToolChains/Cuda.cpp
  clang/lib/Driver/ToolChains/Cuda.h
  clang/test/Driver/amdgpu-openmp-system-arch-fail.c
  clang/test/Driver/amdgpu-openmp-toolchain.c
  clang/test/Driver/hip-rdc-device-only.hip
  clang/test/Driver/hip-toolchain-rdc-separate.hip
  clang/test/Driver/openmp-offload-multi.c
  clang/tools/clang-offload-wrapper/ClangOffloadWrapper.cpp
  openmp/libomptarget/include/omptarget.h
  openmp/libomptarget/src/exports
  openmp/libomptarget/src/interface.cpp
  openmp/libomptarget/src/rtl.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D106870.362002.patch
Type: text/x-patch
Size: 66278 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20210727/58fd0f18/attachment-0001.bin>


More information about the Openmp-commits mailing list