[Openmp-commits] [PATCH] D155621: [OpenMP][libomptarget] Improve plugin resource managers
Ye Luo via Phabricator via Openmp-commits
openmp-commits at lists.llvm.org
Tue Jul 25 09:23:07 PDT 2023
ye-luo accepted this revision.
ye-luo added inline comments.
This revision is now accepted and ready to land.
================
Comment at: openmp/libomptarget/plugins-nextgen/amdgpu/src/rtl.cpp:173
+ /// The handle to the actual resource.
+ HandleTy Resource;
};
----------------
kevinsala wrote:
> ye-luo wrote:
> > Can we use `ResourceTy&` to express a true reference? Why do we need to use pointer to emulate reference which C++ already has.
> `AMDGPUResourceRef` objects (and any object derived from `GenericDeviceResourceRef`) are constructed as empty references. The resource is not created in the constructor, but later in the `create()` function (if actually called). So, initially, the handle is `nullptr`.
>
> I believe class data members that are references must be initialized in the class constructor //referencing// a valid object. They cannot be re-assigned either.
Got it.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D155621/new/
https://reviews.llvm.org/D155621
More information about the Openmp-commits
mailing list