| 1 | //===- Transforms.h - Shard Transforms --------------------------*- C++ -*-===// |
| 2 | // |
| 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
| 4 | // See https://llvm.org/LICENSE.txt for license information. |
| 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 6 | // |
| 7 | //===----------------------------------------------------------------------===// |
| 8 | |
| 9 | #ifndef MLIR_DIALECT_SHARD_TRANSFORMS_TRANSFORMS_H |
| 10 | #define MLIR_DIALECT_SHARD_TRANSFORMS_TRANSFORMS_H |
| 11 | |
| 12 | #include "mlir/Dialect/Shard/IR/ShardOps.h" |
| 13 | #include "mlir/IR/BuiltinTypes.h" |
| 14 | #include "mlir/IR/Value.h" |
| 15 | #include "mlir/Support/LLVM.h" |
| 16 | #include "llvm/ADT/ArrayRef.h" |
| 17 | |
| 18 | namespace mlir { |
| 19 | class RewritePatternSet; |
| 20 | class SymbolTableCollection; |
| 21 | class DialectRegistry; |
| 22 | class ImplicitLocOpBuilder; |
| 23 | namespace shard { |
| 24 | |
| 25 | void populateProcessMultiIndexOpLoweringPatterns( |
| 26 | RewritePatternSet &patterns, SymbolTableCollection &symbolTableCollection); |
| 27 | void registerProcessMultiIndexOpLoweringDialects(DialectRegistry ®istry); |
| 28 | |
| 29 | void populateAllSliceOpLoweringPatterns( |
| 30 | RewritePatternSet &patterns, SymbolTableCollection &symbolTableCollection); |
| 31 | void registerAllSliceOpLoweringDialects(DialectRegistry ®istry); |
| 32 | |
| 33 | void populateAllOpLoweringPatterns( |
| 34 | RewritePatternSet &patterns, SymbolTableCollection &symbolTableCollection); |
| 35 | void registerAllOpLoweringDialects(DialectRegistry ®istry); |
| 36 | |
| 37 | TypedValue<IndexType> |
| 38 | createCollectiveProcessGroupSize(GridOp grid, ArrayRef<GridAxis> axes, |
| 39 | ImplicitLocOpBuilder &builder); |
| 40 | |
| 41 | // Get process linear index along the given grid axes. |
| 42 | TypedValue<IndexType> |
| 43 | createProcessLinearIndex(ImplicitLocOpBuilder &builder, StringRef grid, |
| 44 | ArrayRef<GridAxis> gridAxes = {}); |
| 45 | // Get process linear index from a multi-index along the given grid axes . |
| 46 | TypedValue<IndexType> |
| 47 | createProcessLinearIndex(ImplicitLocOpBuilder &builder, StringRef grid, |
| 48 | ValueRange processInGroupMultiIndex, |
| 49 | ArrayRef<GridAxis> gridAxes = {}); |
| 50 | |
| 51 | } // namespace shard |
| 52 | } // namespace mlir |
| 53 | |
| 54 | #endif // MLIR_DIALECT_SHARD_TRANSFORMS_TRANSFORMS_H |
| 55 | |