MLIR  22.0.0git
InferStridedMetadataInterface.cpp
Go to the documentation of this file.
1 //===- InferStridedMetadataInterface.cpp - Strided md inference interface -===//
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 
10 #include "mlir/IR/BuiltinTypes.h"
11 #include "mlir/IR/TypeUtilities.h"
12 #include <optional>
13 
14 using namespace mlir;
15 
16 #include "mlir/Interfaces/InferStridedMetadataInterface.cpp.inc"
17 
18 void StridedMetadataRange::print(raw_ostream &os) const {
19  if (isUninitialized()) {
20  os << "strided_metadata<None>";
21  return;
22  }
23  os << "strided_metadata<offset = [";
24  llvm::interleaveComma(*offsets, os, [&](const ConstantIntRanges &range) {
25  os << "{" << range << "}";
26  });
27  os << "], sizes = [";
28  llvm::interleaveComma(sizes, os, [&](const ConstantIntRanges &range) {
29  os << "{" << range << "}";
30  });
31  os << "], strides = [";
32  llvm::interleaveComma(strides, os, [&](const ConstantIntRanges &range) {
33  os << "{" << range << "}";
34  });
35  os << "]>";
36 }
A set of arbitrary-precision integers representing bounds on a given integer value.
bool isUninitialized() const
Returns whether the metadata is uninitialized.
void print(raw_ostream &os) const
Print the strided metadata range.
Include the generated interface declarations.