MLIR-AIE
Dialects.cpp
Go to the documentation of this file.
1//===- Dialects.cpp ---------------------------------------------*- C++ -*-===//
2//
3// This file is licensed 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// (c) Copyright 2022-2024 Advanced Micro Devices, Inc. or its affiliates
8//
9//===----------------------------------------------------------------------===//
10
11#include "aie-c/Dialects.h"
12
17
18#include "mlir/CAPI/Registration.h"
19
20MLIR_DEFINE_CAPI_DIALECT_REGISTRATION(AIE, aie, xilinx::AIE::AIEDialect)
21MLIR_DEFINE_CAPI_DIALECT_REGISTRATION(AIEX, aiex, xilinx::AIEX::AIEXDialect)
23 xilinx::aievec::AIEVecDialect)
24MLIR_DEFINE_CAPI_DIALECT_REGISTRATION(XLLVM, xllvm, xilinx::xllvm::XLLVMDialect)
25
26//===---------------------------------------------------------------------===//
27// ObjectFifoType
28//===---------------------------------------------------------------------===//
29
30bool aieTypeIsObjectFifoType(MlirType type) {
31 return llvm::isa<xilinx::AIE::AIEObjectFifoType>(unwrap(type));
32}
33
34MlirType aieObjectFifoTypeGet(MlirType type) {
35 return wrap(xilinx::AIE::AIEObjectFifoType::get(
36 llvm::cast<mlir::MemRefType>(unwrap(type))));
37}
38
39//===---------------------------------------------------------------------===//
40// ObjectFifoSubviewType
41//===---------------------------------------------------------------------===//
42
43bool aieTypeIsObjectFifoSubviewType(MlirType type) {
44 return llvm::isa<xilinx::AIE::AIEObjectFifoSubviewType>(unwrap(type));
45}
46
47MlirType aieObjectFifoSubviewTypeGet(MlirType type) {
48 return wrap(xilinx::AIE::AIEObjectFifoSubviewType::get(
49 llvm::cast<mlir::MemRefType>(unwrap(type))));
50}
MlirType aieObjectFifoSubviewTypeGet(MlirType type)
Definition Dialects.cpp:47
bool aieTypeIsObjectFifoSubviewType(MlirType type)
Definition Dialects.cpp:43
MlirType aieObjectFifoTypeGet(MlirType type)
Definition Dialects.cpp:34
MLIR_DEFINE_CAPI_DIALECT_REGISTRATION(AIEVec, aievec, xilinx::aievec::AIEVecDialect) bool aieTypeIsObjectFifoType(MlirType type)
Definition Dialects.cpp:22
MLIR_CAPI_EXPORTED bool aieTypeIsObjectFifoType(MlirType type)