[Openmp-commits] [PATCH] D80649: [OpenMP] Improve D2D memcpy to use more efficient driver API

Shilei Tian via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Wed May 27 16:23:13 PDT 2020


tianshilei1992 added inline comments.


================
Comment at: openmp/libomptarget/src/device.cpp:400
+  return RTL->RTLName == OtherDevice.RTL->RTLName;
+}
+
----------------
grokos wrote:
> jdoerfert wrote:
> > We use the name? I somehow feel uneasy about this. Don't we have some form of ID?
> I agree. Be careful because `RTLInfoTy::RTLName` is only available in debug builds, so this piece of code will break if we compile the library in release mode.
> 
> You can use a direct pointer comparison `RTL == OtherDevice.RTL` (devices managed by the same RTL will point to the same `RTLInfoTy` object).
Yes, that's why I removed the macro.
The pointer comparison may not work considering that there is in fact one case can violate it: OpenCL ICD, although it is not part of OpenMP. Maybe adding a new plugin interface here is more appropriate.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D80649





More information about the Openmp-commits mailing list