MLIR
23.0.0git
lib
Dialect
Bufferization
Extensions
ShardingExtensions.cpp
Go to the documentation of this file.
1
//===- ShardingExtensions.cpp ---------------------------------------------===//
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/Bufferization/Extensions/ShardingExtensions.h
"
10
#include "
mlir/Dialect/Bufferization/IR/Bufferization.h
"
11
#include "
mlir/Dialect/Shard/Interfaces/ShardingInterfaceImpl.h
"
12
#include "
mlir/IR/DialectRegistry.h
"
13
14
using namespace
mlir
;
15
16
/// Variadic helper function.
17
template
<
typename
... OpTypes>
18
static
void
registerAll
(
MLIRContext
*ctx) {
19
(OpTypes::template attachInterface<
20
shard::IndependentParallelIteratorDomainShardingInterface<OpTypes>
>(
21
*ctx),
22
...);
23
}
24
25
void
mlir::bufferization::shard_ext::registerShardingInterfaceExternalModels
(
26
DialectRegistry
®istry) {
27
28
registry.
addExtension
(+[](
MLIRContext
*ctx,
29
bufferization::BufferizationDialect *dialect) {
30
registerAll
<bufferization::AllocTensorOp, bufferization::DeallocTensorOp,
31
bufferization::MaterializeInDestinationOp>(ctx);
32
});
33
}
registerAll
static void registerAll(MLIRContext *ctx)
Variadic helper function.
Definition
ShardingExtensions.cpp:18
ShardingExtensions.h
DialectRegistry.h
ShardingInterfaceImpl.h
mlir::DialectRegistry
The DialectRegistry maps a dialect namespace to a constructor for the matching dialect.
Definition
DialectRegistry.h:139
mlir::DialectRegistry::addExtension
bool addExtension(TypeID extensionID, std::unique_ptr< DialectExtensionBase > extension)
Add the given extension to the registry.
Definition
DialectRegistry.h:215
mlir::MLIRContext
MLIRContext is the top-level object for a collection of MLIR operations.
Definition
MLIRContext.h:63
Bufferization.h
mlir::bufferization::shard_ext::registerShardingInterfaceExternalModels
void registerShardingInterfaceExternalModels(DialectRegistry ®istry)
Definition
ShardingExtensions.cpp:25
mlir
Include the generated interface declarations.
Definition
AliasAnalysis.h:19
mlir::shard::IndependentParallelIteratorDomainShardingInterface
Definition
ShardingInterfaceImpl.h:57
Generated on
for MLIR by
1.14.0