[Parallel_libs-commits] [PATCH] D24114: [StreamExecutor] Dev handles in platform interface

Justin Lebar via Parallel_libs-commits parallel_libs-commits at lists.llvm.org
Thu Sep 1 11:05:54 PDT 2016


jlebar accepted this revision.
jlebar added a comment.
This revision is now accepted and ready to land.

I like factoring out this test platform.


================
Comment at: streamexecutor/include/streamexecutor/PlatformInterfaces.h:108
@@ -108,3 +107,3 @@
   virtual Error copyH2D(PlatformStreamHandle *S, const void *HostSrc,
-                        size_t SrcByteOffset, GlobalDeviceMemoryBase DeviceDst,
+                        size_t SrcByteOffset, const void *DeviceDstHandle,
                         size_t DstByteOffset, size_t ByteCount) {
----------------
Do we want the dst handles to be non-const void*s?  Or is the idea that the handle is always a const thing because you never write to it from host code?

================
Comment at: streamexecutor/include/streamexecutor/PlatformInterfaces.h:134
@@ -136,3 +133,3 @@
   /// Frees device memory previously allocated by allocateDeviceMemory.
-  virtual Error freeDeviceMemory(GlobalDeviceMemoryBase Memory) {
+  virtual Error freeDeviceMemory(const void *Handle) {
     return make_error("freeDeviceMemory not implemented for platform " +
----------------
Same for the handle we're freeing here.  (Although, as was pointed out to me recently, it's perfectly OK to call delete on a C++ const pointer.)


https://reviews.llvm.org/D24114





More information about the Parallel_libs-commits mailing list