xref: /llvm-project/mlir/include/mlir/Dialect/MPI/IR/MPITypes.td (revision b334664f9f3a098b6f3fd9cfd17b856a9edfe446)
1//===- MPITypes.td - Message Passing Interface types -------*- tablegen -*-===//
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// This file declares the Message Passing Interface dialect types.
10//
11//===----------------------------------------------------------------------===//
12
13#ifndef MLIR_DIALECT_MPI_IR_MPITYPES_TD
14#define MLIR_DIALECT_MPI_IR_MPITYPES_TD
15
16include "mlir/IR/AttrTypeBase.td"
17include "mlir/Dialect/MPI/IR/MPI.td"
18
19//===----------------------------------------------------------------------===//
20// MPI Types
21//===----------------------------------------------------------------------===//
22
23class MPI_Type<string name, string typeMnemonic, list<Trait> traits = []>
24    : TypeDef<MPI_Dialect, name, traits> {
25  let mnemonic = typeMnemonic;
26}
27
28//===----------------------------------------------------------------------===//
29// mpi::RetvalType
30//===----------------------------------------------------------------------===//
31
32def MPI_Retval : MPI_Type<"Retval", "retval"> {
33  let summary = "MPI function call return value";
34  let description = [{
35    This type represents a return value from an MPI function call.
36    This value can be MPI_SUCCESS, MPI_ERR_IN_STATUS, or any error code.
37
38    This return value can be compared agains the known MPI error classes
39    represented by `#mpi.errclass` using the `mpi.retval_check` operation.
40  }];
41}
42
43#endif // MLIR_DIALECT_MPI_IR_MPITYPES_TD
44