[Mlir-commits] [mlir] 9ba3b74 - [MLIR] Fix typo and expand gpu.host_register description.

Christian Sigg llvmlistbot at llvm.org
Mon Sep 21 04:44:50 PDT 2020


Author: Christian Sigg
Date: 2020-09-21T13:44:39+02:00
New Revision: 9ba3b7449d30c7a7b9be77ef3ac4016ba263b619

URL: https://github.com/llvm/llvm-project/commit/9ba3b7449d30c7a7b9be77ef3ac4016ba263b619
DIFF: https://github.com/llvm/llvm-project/commit/9ba3b7449d30c7a7b9be77ef3ac4016ba263b619.diff

LOG: [MLIR] Fix typo and expand gpu.host_register description.

See comments in https://reviews.llvm.org/D85631.

Reviewed By: herhut

Differential Revision: https://reviews.llvm.org/D86214

Added: 
    

Modified: 
    mlir/include/mlir/Dialect/GPU/GPUOps.td
    mlir/lib/Conversion/GPUCommon/ConvertLaunchFuncToRuntimeCalls.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/include/mlir/Dialect/GPU/GPUOps.td b/mlir/include/mlir/Dialect/GPU/GPUOps.td
index 0ae6267cb67c..39c091ac4d1c 100644
--- a/mlir/include/mlir/Dialect/GPU/GPUOps.td
+++ b/mlir/include/mlir/Dialect/GPU/GPUOps.td
@@ -746,8 +746,14 @@ def GPU_HostRegisterOp : GPU_Op<"host_register">,
     Arguments<(ins AnyUnrankedMemRef:$value)> {
   let summary = "Registers a memref for access from device.";
   let description = [{
-    This op registers the host memory pointed to by a memref to be accessed from
-    a device.
+    This op maps the provided host buffer into the device address space.
+
+    This operation may not be supported in every environment, there is not yet a
+    way to check at runtime whether this feature is supported.
+
+    Writes from the host are guaranteed to be visible to device kernels that are
+    launched afterwards. Writes from the device are guaranteed to be visible on
+    the host after synchronizing with the device kernel completion.
   }];
 
   let assemblyFormat = "$value attr-dict `:` type($value)";

diff  --git a/mlir/lib/Conversion/GPUCommon/ConvertLaunchFuncToRuntimeCalls.cpp b/mlir/lib/Conversion/GPUCommon/ConvertLaunchFuncToRuntimeCalls.cpp
index 8aa843308cff..56dc7d3f7c62 100644
--- a/mlir/lib/Conversion/GPUCommon/ConvertLaunchFuncToRuntimeCalls.cpp
+++ b/mlir/lib/Conversion/GPUCommon/ConvertLaunchFuncToRuntimeCalls.cpp
@@ -125,7 +125,7 @@ class ConvertOpToGpuRuntimeCallPattern : public ConvertOpToLLVMPattern<OpTy> {
        llvmIntPtrType /* intptr_t elementSizeBytes */}};
 };
 
-/// A rewrite patter to convert gpu.host_register operations into a GPU runtime
+/// A rewrite pattern to convert gpu.host_register operations into a GPU runtime
 /// call. Currently it supports CUDA and ROCm (HIP).
 class ConvertHostRegisterOpToGpuRuntimeCallPattern
     : public ConvertOpToGpuRuntimeCallPattern<gpu::HostRegisterOp> {


        


More information about the Mlir-commits mailing list