MLIR 23.0.0git
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
13
14using namespace mlir;
15
16/// Variadic helper function.
17template <typename... OpTypes>
18static void registerAll(MLIRContext *ctx) {
19 (OpTypes::template attachInterface<
21 *ctx),
22 ...);
23}
24
26 DialectRegistry &registry) {
27
28 registry.addExtension(+[](MLIRContext *ctx,
29 bufferization::BufferizationDialect *dialect) {
30 registerAll<bufferization::AllocTensorOp, bufferization::DeallocTensorOp,
31 bufferization::MaterializeInDestinationOp>(ctx);
32 });
33}
static void registerAll(MLIRContext *ctx)
Variadic helper function.
The DialectRegistry maps a dialect namespace to a constructor for the matching dialect.
bool addExtension(TypeID extensionID, std::unique_ptr< DialectExtensionBase > extension)
Add the given extension to the registry.
MLIRContext is the top-level object for a collection of MLIR operations.
Definition MLIRContext.h:63
void registerShardingInterfaceExternalModels(DialectRegistry &registry)
Include the generated interface declarations.