[all-commits] [llvm/llvm-project] 7318fe: [OpenMP][FIX] Ensure device reduction geps work fo...

Johannes Doerfert via All-commits all-commits at lists.llvm.org
Fri Nov 10 14:35:10 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 7318fe633487f9b9187e18c7ebd4c6516ded9a22
      https://github.com/llvm/llvm-project/commit/7318fe633487f9b9187e18c7ebd4c6516ded9a22
  Author: Johannes Doerfert <johannes at jdoerfert.de>
  Date:   2023-11-10 (Fri, 10 Nov 2023)

  Changed paths:
    M clang/lib/CodeGen/CGOpenMPRuntimeGPU.cpp
    M clang/test/OpenMP/nvptx_teams_reduction_codegen.cpp
    M clang/test/OpenMP/target_teams_generic_loop_codegen.cpp
    M openmp/libomptarget/DeviceRTL/src/Reduction.cpp
    A openmp/libomptarget/test/offloading/multiple_reductions_simple.c

  Log Message:
  -----------
  [OpenMP][FIX] Ensure device reduction geps work for multi-var reductions

If we have more than one reduction variable we need to be consistent
wrt. indexing. In 3de645efe30b83ba1b6d7e500486c4f441a17a61 we broke this
as the buffer type was reduced to a singleton but the index computation
was not adjusted to account for that offset. This fixes it by
interleaving the reduction variables properly in a array-of-struct
style. We can revert it back to struct-of-array in a follow up if turns
out to be a problem. I doubt it since half the accesses should benefit
from the locallity this layout offers and only the other half were
consecutive before.




More information about the All-commits mailing list