[all-commits] [llvm/llvm-project] 6e127c: [OpenMP] libomptarget: Don't map alignment padding...

Joel E. Denny via All-commits all-commits at lists.llvm.org
Mon Jul 3 07:25:34 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 6e127c6f29470012361811902829cf9798166f27
      https://github.com/llvm/llvm-project/commit/6e127c6f29470012361811902829cf9798166f27
  Author: Joel E. Denny <jdenny.ornl at gmail.com>
  Date:   2023-07-03 (Mon, 03 Jul 2023)

  Changed paths:
    M openmp/libomptarget/include/device.h
    M openmp/libomptarget/src/device.cpp
    M openmp/libomptarget/src/omptarget.cpp
    A openmp/libomptarget/test/mapping/padding_not_mapped.c
    M openmp/libomptarget/test/mapping/power_of_two_alignment.c

  Log Message:
  -----------
  [OpenMP] libomptarget: Don't map alignment padding to host

In the case of partially mapped structs, libomptarget sometimes adds
padding to device allocations to ensure they are aligned properly.
However, without this patch, it considers that padding to be mapped to
the host, which can cause presence checks (e.g.,
`omp_target_is_present` or a `present` modifier) to misbehave for
unmapped parts of the struct.  This patch keeps the padding but treats
it as unmapped.  See the new test case for examples.

Reviewed By: grokos, jdoerfert

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




More information about the All-commits mailing list