CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
97 lines
2.9 KiB
TableGen
97 lines
2.9 KiB
TableGen
// RUN: mlir-tblgen -gen-dialect-interface-decls -I %S/../../include %s | FileCheck %s --check-prefix=DECL
|
|
|
|
include "mlir/IR/Interfaces.td"
|
|
|
|
def NoDefaultMethod : DialectInterface<"NoDefaultMethod"> {
|
|
let description = [{
|
|
This is an example dialect interface without default method body.
|
|
}];
|
|
|
|
let cppNamespace = "::mlir::example";
|
|
|
|
let methods = [
|
|
InterfaceMethod<
|
|
"Check if it's an example dialect", "bool", "isExampleDialect", (ins)
|
|
>,
|
|
InterfaceMethod<
|
|
"second method to check if multiple methods supported",
|
|
"unsigned", "supportSecondMethod", (ins "::mlir::Type":$type)
|
|
>
|
|
];
|
|
}
|
|
|
|
// DECL: class NoDefaultMethod : public {{.*}}DialectInterface::Base<NoDefaultMethod>
|
|
// DECL: public:
|
|
// DECL: virtual bool isExampleDialect() const {}
|
|
// DECL: virtual unsigned supportSecondMethod(::mlir::Type type) const {}
|
|
// DECL: NoDefaultMethod(::mlir::Dialect *dialect) : Base(dialect) {}
|
|
|
|
def WithDefaultMethodInterface : DialectInterface<"WithDefaultMethodInterface"> {
|
|
let description = [{
|
|
This is an example dialect interface with default method bodies.
|
|
}];
|
|
|
|
let cppNamespace = "::mlir::example";
|
|
|
|
let methods = [
|
|
InterfaceMethod<
|
|
"Check if it's an example dialect", "bool", "isExampleDialect", (ins),
|
|
[{
|
|
return true;
|
|
}]
|
|
>,
|
|
InterfaceMethod<
|
|
"second method to check if multiple methods supported",
|
|
"unsigned", "supportSecondMethod", (ins "::mlir::Type":$type)
|
|
>
|
|
];
|
|
}
|
|
|
|
// DECL: virtual bool isExampleDialect() const {
|
|
// DECL-NEXT: return true;
|
|
// DECL-NEXT: }
|
|
|
|
def OnlyDeclarationInterfaceWithExtraDecls : DialectInterface<"OnlyDeclarationInterfaceWithExtraDecls"> {
|
|
let description = [{
|
|
This is an example dialect interface with only declarations.
|
|
}];
|
|
|
|
let cppNamespace = "::mlir::example";
|
|
|
|
let methods = [
|
|
InterfaceMethodDeclaration<
|
|
"a method declaration", "void", "exampleMethodDeclaration",
|
|
(ins "::mlir::Type":$type)
|
|
>
|
|
];
|
|
|
|
let extraClassDeclaration = [{
|
|
using DeclType = int;
|
|
}];
|
|
}
|
|
|
|
// DECL: class OnlyDeclarationInterfaceWithExtraDecls : public {{.*}}DialectInterface::Base<OnlyDeclarationInterfaceWithExtraDecls>
|
|
// DECL: virtual void exampleMethodDeclaration(::mlir::Type type) const;
|
|
// DECL: using DeclType = int;
|
|
|
|
def PureVirtualInterface : DialectInterface<"PureVirtualInterface"> {
|
|
let description = [{
|
|
This is an example dialect interface with pure virtual methods.
|
|
}];
|
|
|
|
let cppNamespace = "::mlir::example";
|
|
|
|
let methods = [
|
|
PureVirtualInterfaceMethod<
|
|
"Check if it's an example dialect", "bool", "isExampleDialect",
|
|
(ins)
|
|
>
|
|
];
|
|
}
|
|
|
|
// DECL: class PureVirtualInterface : public {{.*}}DialectInterface::Base<PureVirtualInterface>
|
|
// DECL: public:
|
|
// DECL: virtual bool isExampleDialect() const = 0;
|
|
// DECL: protected:
|
|
// DECL-NEXT: PureVirtualInterface(::mlir::Dialect *dialect) : Base(dialect) {}
|