[Mlir-commits] [mlir] [MLIR][OpenMP] Add OMP Declare Mapper MLIR Op definition (PR #117045)

Sergio Afonso llvmlistbot at llvm.org
Fri Feb 7 05:04:31 PST 2025


================
@@ -1689,6 +1689,49 @@ def CancellationPointOp : OpenMP_Op<"cancellation_point", clauses = [
   let hasVerifier = 1;
 }
 
+//===----------------------------------------------------------------------===//
+// 2.19.7.3 Declare Mapper Directive
+//===----------------------------------------------------------------------===//
+def DeclareMapperOp : OpenMP_Op<"declare_mapper", [
+    AffineScope,
+    AutomaticAllocationScope,
+    IsolatedFromAbove,
+    OutlineableOpenMPOpInterface,
+    RecipeInterface,
+    Symbol
+  ]> {
+  let summary = "declare mapper directive";
+  let description = [{
+    The declare mapper directive declares a user-defined mapper for a given
+    type, and defines a mapper-identifier that can be used in a map clause.
+  }] # clausesDescription;
+
+  let arguments = (ins  SymbolNameAttr:$sym_name,
+                        TypeAttr:$var_type);
+
+  let regions = (region AnyRegion:$body);
+
+  let assemblyFormat = "$sym_name `:` $var_type $body attr-dict";
+}
+
+def DeclareMapperInfoOp : OpenMP_Op<"declare_mapper_info", [
+    Terminator
+  ], clauses = [
+    OpenMP_MapClause
+  ]> {
+  let summary = "declare mapper info";
+  let description = [{
+    This Op is used to capture the map information related to it's
+    parent DeclareMapperOp.]>
----------------
skatrak wrote:

```suggestion
    This Op is used to capture the map information related to its
    parent DeclareMapperOp.
```

https://github.com/llvm/llvm-project/pull/117045


More information about the Mlir-commits mailing list