[all-commits] [llvm/llvm-project] 369216: [OpenMP][Offloading] Refined return value of `Devi...

Shilei Tian via All-commits all-commits at lists.llvm.org
Thu Jul 1 09:32:16 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 369216ab3132623e98c8c974ded915803f080dcf
      https://github.com/llvm/llvm-project/commit/369216ab3132623e98c8c974ded915803f080dcf
  Author: Shilei Tian <tianshilei1992 at gmail.com>
  Date:   2021-07-01 (Thu, 01 Jul 2021)

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

  Log Message:
  -----------
  [OpenMP][Offloading] Refined return value of `DeviceTy::getOrAllocTgtPtr`

`DeviceTy::getOrAllocTgtPtr` just returns a target pointer. In addition,
two bool values (`IsNew` and `IsHostPtr`) are passed by reference to make the
change in the function available in callee.

In this patch, a struct, which contains the target pointer, two flags, and an
iterator to the map table entry corresponding to the queried host pointer, will
be returned. In addition to make the logic clearer regarding the two bool values,
this paves the way for the next patch to fix the data race in `bug49334.cpp` by
attaching an event to the map table entry (and that's why we need the iterator).

Reviewed By: grokos

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




More information about the All-commits mailing list