[Openmp-commits] [PATCH] D155621: [OpenMP][libomptarget] Improve plugin resource managers

Kevin Sala via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Tue Jul 25 09:12:13 PDT 2023


kevinsala added inline comments.


================
Comment at: openmp/libomptarget/plugins-nextgen/amdgpu/src/rtl.cpp:173
+  /// The handle to the actual resource.
+  HandleTy Resource;
 };
----------------
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.


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

https://reviews.llvm.org/D155621



More information about the Openmp-commits mailing list