[Openmp-commits] [PATCH] D81054: [OpenMP] Introduce target memory manager
Ye Luo via Phabricator via Openmp-commits
openmp-commits at lists.llvm.org
Wed Aug 12 10:22:21 PDT 2020
ye-luo added inline comments.
================
Comment at: openmp/libomptarget/src/MemoryManager.h:26
+class MemoryManagerTy {
+ std::unique_ptr<impl::MemoryManagerImplTy> Impl;
+
----------------
tianshilei1992 wrote:
> ye-luo wrote:
> > Why is the pointer needed?
> > What is the design logic behind MemoryManagerTy and MemoryManagerImplTy layers? Can we just have one?
> Pimpl. Like my previous comments mentioned before, this header will be included by others, I don't want unnecessary headers/declarations/definitions to be included to pollute others.
That is the job of header and cpp files.
================
Comment at: openmp/libomptarget/src/device.h:150
+ /// Memory manager
+ std::shared_ptr<memory::MemoryManagerTy> MemoryManager;
+
----------------
tianshilei1992 wrote:
> ye-luo wrote:
> > Could you explain why shared_ptr is needed?
> Such that I don't need to include `MemoryManager.h` in the header, and it doesn't hurt anything.
This is obviously a wrong way. Move the constructor and destructor to cpp.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D81054/new/
https://reviews.llvm.org/D81054
More information about the Openmp-commits
mailing list