| 1 | //===- ShardingInterfaceImpl.cpp - Func sharding models -------------------===// |
|---|---|
| 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 | #include "mlir/Dialect/Func/Extensions/ShardingInterfaceImpl.h" |
| 10 | #include "mlir/Dialect/Func/IR/FuncOps.h" |
| 11 | #include "mlir/Dialect/Shard/Interfaces/ShardingInterfaceImpl.h" |
| 12 | #include "mlir/IR/MLIRContext.h" |
| 13 | |
| 14 | namespace mlir::func { |
| 15 | void registerShardingInterfaceExternalModels(DialectRegistry ®istry) { |
| 16 | registry.addExtension(extensionFn: +[](MLIRContext *ctx, FuncDialect *dialect) { |
| 17 | ReturnOp::attachInterface< |
| 18 | shard::IndependentParallelIteratorDomainShardingInterface<ReturnOp>>( |
| 19 | context&: *ctx); |
| 20 | }); |
| 21 | } |
| 22 | } // namespace mlir::func |
| 23 |