brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.8 KiB · 0ad5ab6 Raw
58 lines · c
1//===- TestTypes.h - MLIR Test Dialect Types --------------------*- C++ -*-===//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-exception6//7//===----------------------------------------------------------------------===//8//9// This file contains types defined by the TestDialect for testing various10// features of MLIR.11//12//===----------------------------------------------------------------------===//13 14#ifndef MLIR_TESTATTRIBUTES_H15#define MLIR_TESTATTRIBUTES_H16 17#include <tuple>18 19#include "TestTraits.h"20#include "mlir/Dialect/Ptr/IR/MemorySpaceInterfaces.h"21#include "mlir/Dialect/Utils/StructuredOpsUtils.h"22#include "mlir/IR/Attributes.h"23#include "mlir/IR/Diagnostics.h"24#include "mlir/IR/Dialect.h"25#include "mlir/IR/DialectImplementation.h"26#include "mlir/IR/DialectResourceBlobManager.h"27#include "mlir/IR/TensorEncoding.h"28 29// generated files require above includes to come first30#include "TestAttrInterfaces.h.inc"31#include "TestOpEnums.h.inc"32 33namespace test {34class TestDialect;35// Payload class for the CopyCountAttr.36class CopyCount {37public:38  CopyCount(std::string value) : value(value) {}39  CopyCount(const CopyCount &rhs);40  CopyCount &operator=(const CopyCount &rhs);41  CopyCount(CopyCount &&rhs) = default;42  CopyCount &operator=(CopyCount &&rhs) = default;43  static int counter;44  std::string value;45};46llvm::raw_ostream &operator<<(llvm::raw_ostream &os,47                              const test::CopyCount &value);48 49/// A handle used to reference external elements instances.50using TestDialectResourceBlobHandle =51    mlir::DialectResourceBlobHandle<TestDialect>;52} // namespace test53 54#define GET_ATTRDEF_CLASSES55#include "TestAttrDefs.h.inc"56 57#endif // MLIR_TESTATTRIBUTES_H58