#ifndef MLIR_TESTDIALECT_H
#define MLIR_TESTDIALECT_H
#include "TestAttributes.h"
#include "TestInterfaces.h"
#include "mlir/Dialect/DLTI/DLTI.h"
#include "mlir/Dialect/DLTI/Traits.h"
#include "mlir/Dialect/Func/IR/FuncOps.h"
#include "mlir/Dialect/Linalg/IR/Linalg.h"
#include "mlir/Dialect/Traits.h"
#include "mlir/IR/AsmState.h"
#include "mlir/IR/BuiltinOps.h"
#include "mlir/IR/BuiltinTypes.h"
#include "mlir/IR/Dialect.h"
#include "mlir/IR/ExtensibleDialect.h"
#include "mlir/IR/OpDefinition.h"
#include "mlir/IR/OpImplementation.h"
#include "mlir/IR/RegionKindInterface.h"
#include "mlir/IR/SymbolTable.h"
#include "mlir/Interfaces/CallInterfaces.h"
#include "mlir/Interfaces/ControlFlowInterfaces.h"
#include "mlir/Interfaces/CopyOpInterface.h"
#include "mlir/Interfaces/DerivedAttributeOpInterface.h"
#include "mlir/Interfaces/InferIntRangeInterface.h"
#include "mlir/Interfaces/InferTypeOpInterface.h"
#include "mlir/Interfaces/LoopLikeInterface.h"
#include "mlir/Interfaces/SideEffectInterfaces.h"
#include "mlir/Interfaces/ViewLikeInterface.h"
namespace mlir {
class DLTIDialect;
class RewritePatternSet;
}
namespace test {
class TestDialect;
class TestExternalElementsData : public mlir::AsmResourceBlob {
public:
using mlir::AsmResourceBlob::AsmResourceBlob;
TestExternalElementsData(mlir::AsmResourceBlob &&blob)
: mlir::AsmResourceBlob(std::move(blob)) {}
llvm::ArrayRef<uint64_t> getData() const;
static TestExternalElementsData allocate(size_t numElements);
};
struct TestExternalElementsDataHandle
: public mlir::AsmDialectResourceHandleBase<
TestExternalElementsDataHandle,
llvm::StringMapEntry<std::unique_ptr<TestExternalElementsData>>,
TestDialect> {
using AsmDialectResourceHandleBase::AsmDialectResourceHandleBase;
llvm::StringRef getKey() const { return getResource()->getKey(); }
TestExternalElementsData *getData() const {
return getResource()->getValue().get();
}
};
class TestExternalElementsDataManager {
using DataMap = llvm::StringMap<std::unique_ptr<TestExternalElementsData>>;
public:
const TestExternalElementsData *getData(llvm::StringRef name) const;
std::pair<DataMap::iterator, bool> insert(llvm::StringRef name);
void setData(llvm::StringRef name, TestExternalElementsData &&data);
private:
llvm::StringMap<std::unique_ptr<TestExternalElementsData>> dataMap;
};
}
#include "TestOpInterfaces.h.inc"
#include "TestOpsDialect.h.inc"
#define GET_OP_CLASSES
#include "TestOps.h.inc"
namespace test {
void registerTestDialect(::mlir::DialectRegistry ®istry);
void populateTestReductionPatterns(::mlir::RewritePatternSet &patterns);
}
#endif