[Parallel_libs-commits] [PATCH] D23577: [StreamExecutor] Executor add synchronous methods

James Price via Parallel_libs-commits parallel_libs-commits at lists.llvm.org
Tue Aug 16 13:31:05 PDT 2016


jprice added a comment.

General question: if we have variants of these `memcpy` methods that take `ElementCount` parameters to allow for partial copies to/from the device allocations, should we also have variants with an `Offset` parameter as well to allow for partial copies that don't start at the origin?


================
Comment at: streamexecutor/include/streamexecutor/Executor.h:71
@@ +70,3 @@
+  /// Stream::thenMemcpyH2D.
+  template <typename T> Error registerHostMemory(T *Memory) {
+    return PExecutor->registerHostMemory(Memory);
----------------
If this is going to be backing onto something like `cuMemHostRegister`, don't we need the size of the allocation as well?

================
Comment at: streamexecutor/include/streamexecutor/Executor.h:144
@@ +143,3 @@
+  /// Host-synchronously copies a slice of an array of elements of type T from
+  /// one place in device memroy to another.
+  template <typename T>
----------------
memory

================
Comment at: streamexecutor/include/streamexecutor/PlatformInterfaces.h:142
@@ +141,3 @@
+  virtual Error registerHostMemory(void *Memory) {
+    return make_error("unregisterHostMemory not implemented for platform " +
+                      getName());
----------------
registerHostMemory


https://reviews.llvm.org/D23577





More information about the Parallel_libs-commits mailing list