[Mlir-commits] [mlir] [mlir][mesh] Add collective communication operations (PR #71960)

Chengji Yao llvmlistbot at llvm.org
Tue Nov 14 14:22:06 PST 2023


================
@@ -280,10 +244,36 @@ LogicalResult verifyMeshSymbolUses(Op op, SymbolTableCollection &symbolTable) {
   return success();
 }
 
+template <typename It>
+bool isUnique(It begin, It end) {
+  if (begin == end) {
+    return true;
+  }
+  It next = std::next(begin);
+  if (next == end) {
+    return true;
+  }
+  for (; next != end; ++next, ++begin) {
+    if (*begin == *next) {
+      return false;
+    }
+  }
+  return true;
+}
+
+LogicalResult verifyMeshAxes(Location loc, ArrayRef<MeshAxis> axes) {
+  SmallVector<MeshAxis> sorted = llvm::to_vector(axes);
+  std::sort(sorted.begin(), sorted.end());
----------------
yaochengji wrote:

OK, this is fine to me.

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


More information about the Mlir-commits mailing list