[Openmp-commits] [PATCH] D109276: [OpenMP][libomptarget] Change device vector elements to unique_ptr type

Ye Luo via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Sat Sep 4 11:41:16 PDT 2021


ye-luo created this revision.
Herald added subscribers: guansong, yaxunl.
ye-luo requested review of this revision.
Herald added a reviewer: jdoerfert.
Herald added subscribers: openmp-commits, sstefan1.
Herald added a project: OpenMP.

Using std::vector<DeviceTy> requires implementing copy constructor and copied assign operator for DeviceTy.
Indeed DeviceTy should never be copied. After changing to std::vector<std::unique_ptr<DeviceTy>>,
All the unsafe copy constructor and copy assign operator implementations can be removed.
Compilers mark them deleted due to mutex or underlying objects and this is the desired behavior.

Formatting


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D109276

Files:
  openmp/libomptarget/src/api.cpp
  openmp/libomptarget/src/device.cpp
  openmp/libomptarget/src/device.h
  openmp/libomptarget/src/interface.cpp
  openmp/libomptarget/src/omptarget.cpp
  openmp/libomptarget/src/rtl.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D109276.370752.patch
Type: text/x-patch
Size: 13259 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20210904/9577443f/attachment-0001.bin>


More information about the Openmp-commits mailing list