[Openmp-commits] [PATCH] D71404: [libomptarget][nfc] Introduce atomic wrapper function

Johannes Doerfert via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Thu Dec 12 17:10:35 PST 2019


jdoerfert added a comment.

In D71404#1782813 <https://reviews.llvm.org/D71404#1782813>, @JonChesterfield wrote:

> `__kmpc_atomic_foo` works for me, as does running sed once.
>
> Templates I can't see in this instance. Could you sketch the implementation for one of the functions, e.g. the add example from here?


See D64217 <https://reviews.llvm.org/D64217>

  /// Atomically exchange the pointee of \p Ptr with \p Val and return the
  /// original value of the pointee.
  template <typename T> T __kmpc_impl_atomic_exchange(T *Ptr, T Val) {
    return atomicExch(Ptr, Val);
  }

also no need for `stdint.h`.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D71404/new/

https://reviews.llvm.org/D71404





More information about the Openmp-commits mailing list