Skip to content

[NFC][mlir][gpu] Fully-qualify all namespaces in the GPU compilation interfaces #94908

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 9, 2024

Conversation

fabianmcg
Copy link
Contributor

Fully qualify all namespaces appearing in GPUTargetAttrInterface and OffloadingLLVMTranslationAttrInterface. If they're not fully qualified then out-of-tree dialects might encounter name resolution errors.

…n interfaces

Fully qualify all namespaces appearing in `GPUTargetAttrInterface` and
`OffloadingLLVMTranslationAttrInterface`. If they're not fully qualified then
out-of-tree dialects might encounter name resolution errors.
@fabianmcg fabianmcg changed the title [NFC][mlir][gpu] Add fully-qualified namespaces to the GPU compilation interfaces [NFC][mlir][gpu] Fully-qualify all namespaces to the GPU compilation interfaces Jun 9, 2024
@fabianmcg fabianmcg changed the title [NFC][mlir][gpu] Fully-qualify all namespaces to the GPU compilation interfaces [NFC][mlir][gpu] Fully-qualify all namespaces in the GPU compilation interfaces Jun 9, 2024
@fabianmcg fabianmcg marked this pull request as ready for review June 9, 2024 20:17
@llvmbot
Copy link
Member

llvmbot commented Jun 9, 2024

@llvm/pr-subscribers-mlir

@llvm/pr-subscribers-mlir-gpu

Author: Fabian Mora (fabianmcg)

Changes

Fully qualify all namespaces appearing in GPUTargetAttrInterface and OffloadingLLVMTranslationAttrInterface. If they're not fully qualified then out-of-tree dialects might encounter name resolution errors.


Full diff: https://github.com/llvm/llvm-project/pull/94908.diff

1 Files Affected:

  • (modified) mlir/include/mlir/Dialect/GPU/IR/CompilationAttrInterfaces.td (+14-12)
diff --git a/mlir/include/mlir/Dialect/GPU/IR/CompilationAttrInterfaces.td b/mlir/include/mlir/Dialect/GPU/IR/CompilationAttrInterfaces.td
index 1607304803942..582ab91311974 100644
--- a/mlir/include/mlir/Dialect/GPU/IR/CompilationAttrInterfaces.td
+++ b/mlir/include/mlir/Dialect/GPU/IR/CompilationAttrInterfaces.td
@@ -37,17 +37,18 @@ def GPUTargetAttrInterface : AttrInterface<"TargetAttrInterface"> {
         is meant to be used for passing additional options that are not in the
         attribute.
       }],
-      "std::optional<SmallVector<char, 0>>", "serializeToObject",
-      (ins "Operation*":$module, "const gpu::TargetOptions&":$options)>,
+      "std::optional<::mlir::SmallVector<char, 0>>", "serializeToObject",
+      (ins "::mlir::Operation*":$module,
+           "const ::mlir::gpu::TargetOptions&":$options)>,
     InterfaceMethod<[{
         Creates a GPU object attribute from a binary string.
 
         The `object` parameter is a binary string. The `options` parameter is
         meant to be used for passing additional options that are not in the
         attribute.
-      }], "Attribute", "createObject",
-        (ins "const SmallVector<char, 0>&":$object,
-             "const gpu::TargetOptions&":$options)>
+      }], "::mlir::Attribute", "createObject",
+        (ins "const ::llvm::SmallVector<char, 0>&":$object,
+             "const ::mlir::gpu::TargetOptions&":$options)>
   ];
 }
 
@@ -112,9 +113,10 @@ def OffloadingLLVMTranslationAttrInterface :
         The first argument has to be a GPU binary operation.
         If the function fails at any point, it must return `failure`.
       }],
-      "LogicalResult", "embedBinary",
-      (ins "Operation*":$binaryOp, "llvm::IRBuilderBase&":$hostBuilder,
-           "LLVM::ModuleTranslation&":$hostModuleTranslation)
+      "::mlir::LogicalResult", "embedBinary",
+      (ins "::mlir::Operation*":$binaryOp,
+           "::llvm::IRBuilderBase&":$hostBuilder,
+           "::mlir::LLVM::ModuleTranslation&":$hostModuleTranslation)
     >,
     InterfaceMethod<[{
         Translates a `gpu.launch_func` op into a sequence of LLVM IR
@@ -128,10 +130,10 @@ def OffloadingLLVMTranslationAttrInterface :
         respectively. If the function fails at any point, it must return
         `failure`.
       }],
-      "LogicalResult", "launchKernel",
-      (ins "Operation*":$launchFunc, "Operation*":$binaryOp,
-           "llvm::IRBuilderBase&":$hostBuilder,
-           "LLVM::ModuleTranslation&":$hostModuleTranslation)
+      "::mlir::LogicalResult", "launchKernel",
+      (ins "::mlir::Operation*":$launchFunc, "::mlir::Operation*":$binaryOp,
+           "::llvm::IRBuilderBase&":$hostBuilder,
+           "::mlir::LLVM::ModuleTranslation&":$hostModuleTranslation)
     >
   ];
 }

@fabianmcg fabianmcg requested review from joker-eph and grypp June 9, 2024 20:18
@fabianmcg fabianmcg merged commit d639b91 into llvm:main Jun 9, 2024
12 checks passed
@fabianmcg fabianmcg deleted the pr-gpu-add-namespaces branch June 10, 2024 14:00
@HerrCai0907 HerrCai0907 mentioned this pull request Jun 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants