[all-commits] [llvm/llvm-project] c3aecf: [OpenMP][libomptarget] Change device vector elemen...

Ye Luo via All-commits all-commits at lists.llvm.org
Mon Sep 6 20:31:19 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c3aecf87d5b97c3d3580457164e7fe4a19c4221a
      https://github.com/llvm/llvm-project/commit/c3aecf87d5b97c3d3580457164e7fe4a19c4221a
  Author: Ye Luo <yeluo at anl.gov>
  Date:   2021-09-06 (Mon, 06 Sep 2021)

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

  Log Message:
  -----------
  [OpenMP][libomptarget] Change device vector elements to unique_ptr type

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.

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




More information about the All-commits mailing list