[Mlir-commits] [mlir] [MLIR][NVVM] Add Op for TMA Prefetch (PR #116232)

Guray Ozen llvmlistbot at llvm.org
Thu Nov 14 10:26:34 PST 2024


================
@@ -108,6 +108,22 @@ LogicalResult CpAsyncOp::verify() {
   return success();
 }
 
+LogicalResult CpAsyncBulkTensorPrefetchOp::verify() {
+  if (getCoordinates().empty() || getCoordinates().size() > 5)
+    return emitError("expects coordinates between 1 to 5 dimension");
+
+  // Check for im2col mode
+  if (!getIm2colOffsets().empty()) {
+    if (getCoordinates().size() < 3)
+      return emitError(
+          "to use im2col mode, the tensor has to be at least 3-dimensional");
+    if (getCoordinates().size() != (getIm2colOffsets().size() + 2))
+      return emitError(
+          "im2col offsets must be 2 less than number of coordinates");
----------------
grypp wrote:

Verification is similar with tma load. Can we outline this part into a function and use it from the both ops?

https://github.com/llvm/llvm-project/pull/116232


More information about the Mlir-commits mailing list