[all-commits] [llvm/llvm-project] 307bbd: [OpenMP][NFCI] Use RAII lock guards in libomptarge...

Johannes Doerfert via All-commits all-commits at lists.llvm.org
Mon Mar 7 21:43:41 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 307bbd3c82643139c8407a20b07b06f892764c4c
      https://github.com/llvm/llvm-project/commit/307bbd3c82643139c8407a20b07b06f892764c4c
  Author: Johannes Doerfert <johannes at jdoerfert.de>
  Date:   2022-03-07 (Mon, 07 Mar 2022)

  Changed paths:
    M openmp/libomptarget/include/device.h
    M openmp/libomptarget/src/device.cpp
    M openmp/libomptarget/src/omptarget.cpp

  Log Message:
  -----------
  [OpenMP][NFCI] Use RAII lock guards in libomptarget where possible

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


  Commit: 10aa83ff74b48d441aa2141047cf8674e069d4f6
      https://github.com/llvm/llvm-project/commit/10aa83ff74b48d441aa2141047cf8674e069d4f6
  Author: Johannes Doerfert <johannes at jdoerfert.de>
  Date:   2022-03-07 (Mon, 07 Mar 2022)

  Changed paths:
    M openmp/libomptarget/include/device.h
    M openmp/libomptarget/include/omptargetplugin.h
    M openmp/libomptarget/include/rtl.h
    M openmp/libomptarget/plugins/cuda/src/rtl.cpp
    M openmp/libomptarget/plugins/exports
    M openmp/libomptarget/src/device.cpp
    M openmp/libomptarget/src/rtl.cpp

  Log Message:
  -----------
  [OpenMP] Allow to explicitly deinitialize device resources

There are two problems this patch tries to address:
1) We currently free resources in a random order wrt. plugin and
   libomptarget destruction. This patch should ensure the CUDA plugin
   is less fragile if something during the deinitialization goes wrong.
2) We need to support (hard) pause runtime calls eventually. This patch
   allows us to free all associated resources, though we cannot
   reinitialize the device yet.

Follow up patch will associate one event pool per device/context.

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


  Commit: 1660288b281789c7621cdbe9f5695f3589106ff4
      https://github.com/llvm/llvm-project/commit/1660288b281789c7621cdbe9f5695f3589106ff4
  Author: Johannes Doerfert <johannes at jdoerfert.de>
  Date:   2022-03-07 (Mon, 07 Mar 2022)

  Changed paths:
    M openmp/libomptarget/plugins/cuda/src/rtl.cpp

  Log Message:
  -----------
  [OpenMP][CUDA] Use one event pool per device

An event pool, similar to the stream pool, needs to be kept per device.
For one, events are associated with cuda contexts which means we cannot
destroy the former after the latter. Also, CUDA documentation states
streams and events need to be associated with the same context, which
we did not ensure at all.

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


  Commit: 5b4acb20ff31564842fa52c0d76e27e65cd2a841
      https://github.com/llvm/llvm-project/commit/5b4acb20ff31564842fa52c0d76e27e65cd2a841
  Author: Johannes Doerfert <johannes at jdoerfert.de>
  Date:   2022-03-07 (Mon, 07 Mar 2022)

  Changed paths:
    M llvm/lib/Transforms/IPO/OpenMPOpt.cpp

  Log Message:
  -----------
  [OpenMP][FIX] Ensure flag to disable de-globalization works properly

If the user disables de-globalization we did not seed the AAHeapToShared
and AAHeapToStack but we still could end up with them through in-flight
lookups. With this patch we disable AAHeapToShared completely if the
user disabled de-globalization. Heap-2-stack is still run though.

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


Compare: https://github.com/llvm/llvm-project/compare/da93537bf843...5b4acb20ff31


More information about the All-commits mailing list