Skip to content
  1. Oct 21, 2020
    • Jon Chesterfield's avatar
      [libomptarget] Require LLVM source tree to build libomptarget · 26790ed2
      Jon Chesterfield authored
      [libomptarget] Require LLVM source tree to build libomptarget
      
      This is to permit reliably #including files from the LLVM tree in libomptarget,
      as an improvement on the copy and paste that is currently in use. See D87841
      for the first example of removing duplication given this new requirement.
      
      The weekly openmp dev call reached consensus on this approach. See also D87841
      for some alternatives that were considered. In the future, we may want to
      introduce a new top level repo for shared constants, or start using the ADT
      library within openmp.
      
      This will break sufficiently exotic build systems, trivial fixes as below.
      
      Building libomptarget as part of the monorepo will continue to work.
      If openmp is built separately, it now requires a cmake macro indicating
      where to find the LLVM source tree.
      
      If openmp is built separately, without the llvm source tree already on disk,
      the build machine will need a copy of a subset of the llvm source tree and
      the cmake macro indicating where it is.
      
      Reviewed By: protze.joachim
      
      Differential Revision: https://reviews.llvm.org/D89426
      26790ed2
  2. Oct 15, 2020
    • JonChesterfield's avatar
      [openmp][libomptarget] Include header from LLVM source tree · 7d2ecef5
      JonChesterfield authored
      [openmp][libomptarget] Include header from LLVM source tree
      
      The change is to the amdgpu plugin so is unlikely to break anything.
      
      The point of contention is whether libomptarget can depend on LLVM.
      A community discussion was cautiously not opposed yesterday.
      
      This introduces a compile time dependency on the LLVM source tree, in this case
      expressed as skipping the building of the plugin if LLVM_MAIN_INCLUDE_DIR is not
      set. One the source files will #include llvm/Frontend/OpenMP/OMPGridValues.h,
      instead of copy&pasting the numbers across.
      
      For users that download the monorepo, the llvm tree is already on disk. This will
      inconvenience users who download only the openmp source as a tar, as they would
      now also have to download (at least a file or two) from the llvm source, if they want
      to build the parts of the openmp project that (post this patch) depend on llvm.
      
      There was interest expressed in going further - using llvm tools as part of
      building libomp, or linking against llvm libraries. That seems less clear cut
      an improvement and worthy of further discussion. This patch seeks only to change
      policy to support openmp depending on the llvm source tree. Including in the
      other direction, or using libraries / tools etc, are purposefully out of scope.
      
      Reviewers are a best guess at interested parties, please feel free to add others
      
      Reviewed By: jdoerfert
      
      Differential Revision: https://reviews.llvm.org/D87841
      7d2ecef5
  3. Aug 26, 2020
  4. Aug 19, 2020
  5. Aug 16, 2020
    • Jon Chesterfield's avatar
      [libomptarget] Implement host plugin for amdgpu · d0b31295
      Jon Chesterfield authored
      [libomptarget] Implement host plugin for amdgpu
      
      Replacement for D71384. Primary difference is inlining the dependency on atmi
      followed by extensive simplification and bugfixes. This is the latest version
      from https://github.com/ROCm-Developer-Tools/amd-llvm-project/tree/aomp12 with
      minor patches and a rename from hsa to amdgpu, on the basis that this can't be
      used by other implementations of hsa without additional work.
      
      This will not build unless the ROCM_DIR variable is passed so won't break other
      builds. That variable is used to locate two amdgpu specific libraries that ship
      as part of rocm:
      libhsakmt at https://github.com/RadeonOpenCompute/ROCT-Thunk-Interface
      libhsa-runtime64 at https://github.com/RadeonOpenCompute/ROCR-Runtime
      These libraries build from source. The build scripts in those repos are for
      shared libraries, but can be adapted to statically link both into this plugin.
      
      There are caveats.
      - This works well enough to run various tests and benchmarks, and will be used
        to support the current clang bring up
      - It is adequately thread safe for the above but there will be races remaining
      - It is not stylistically correct for llvm, though has had clang-format run
      - It has suboptimal memory management and locking strategies
      - The debug printing / error handling is inconsistent
      
      I would like to contribute this pretty much as-is and then improve it in-tree.
      This would be advantagous because the aomp12 branch that was in use for fixing
      this codebase has just been joined with the amd internal rocm dev process.
      
      Reviewed By: jdoerfert
      
      Differential Revision: https://reviews.llvm.org/D85742
      d0b31295
Loading