@@ -653,7 +653,7 @@ def DistributeOp : OpenMP_Op<"distribute", traits = [
653653 will be executed in parallel by threads in the current context. These
654654 iterations are spread across threads that already exist in the enclosing
655655 region.
656-
656+
657657 The body region can only contain a single block which must contain a single
658658 operation. This operation must be another compatible loop wrapper or an
659659 `omp.loop_nest`.
@@ -1749,6 +1749,62 @@ def ScanOp : OpenMP_Op<"scan", [
17491749 let hasVerifier = 1;
17501750}
17511751
1752+ //===----------------------------------------------------------------------===//
1753+ // 2.19.7.3 Declare Mapper Directive
1754+ //===----------------------------------------------------------------------===//
1755+ def DeclareMapperOp : OpenMP_Op<"declare_mapper", [
1756+ IsolatedFromAbove,
1757+ RecipeInterface,
1758+ SingleBlock,
1759+ Symbol
1760+ ]> {
1761+ let summary = "declare mapper directive";
1762+ let description = [{
1763+ The declare mapper directive declares a user-defined mapper for a given
1764+ type, and defines a mapper-identifier that can be used in a map clause.
1765+ }] # clausesDescription;
1766+
1767+ let arguments = (ins SymbolNameAttr:$sym_name,
1768+ TypeAttr:$type);
1769+
1770+ let regions = (region AnyRegion:$body);
1771+
1772+ let assemblyFormat = "$sym_name `:` $type $body attr-dict";
1773+
1774+ let extraClassDeclaration = [{
1775+ /// Get DeclareMapperInfoOp.
1776+ DeclareMapperInfoOp getDeclareMapperInfo(){
1777+ return cast<DeclareMapperInfoOp>(getRegion().getBlocks().front().getTerminator());
1778+ }
1779+
1780+ /// Get SymVal block argument
1781+ BlockArgument getSymVal(){
1782+ return getRegion().getArgument(0);
1783+ }
1784+ }];
1785+
1786+ let hasRegionVerifier = 1;
1787+ }
1788+
1789+ def DeclareMapperInfoOp : OpenMP_Op<"declare_mapper.info", [
1790+ HasParent<"DeclareMapperOp">,
1791+ Terminator
1792+ ], clauses = [
1793+ OpenMP_MapClause
1794+ ]> {
1795+ let summary = "declare mapper info";
1796+ let description = [{
1797+ This Op is used to capture the map information related to it's
1798+ parent DeclareMapperOp.
1799+ }] # clausesDescription;
1800+
1801+ let builders = [
1802+ OpBuilder<(ins CArg<"const DeclareMapperInfoOperands &">:$clauses)>
1803+ ];
1804+
1805+ let hasVerifier = 1;
1806+ }
1807+
17521808//===----------------------------------------------------------------------===//
17531809// 2.19.5.7 declare reduction Directive
17541810//===----------------------------------------------------------------------===//
@@ -1861,7 +1917,7 @@ def MaskedOp : OpenMP_Op<"masked", clauses = [
18611917 ], singleRegion = 1> {
18621918 let summary = "masked construct";
18631919 let description = [{
1864- Masked construct allows to specify a structured block to be executed by a subset of
1920+ Masked construct allows to specify a structured block to be executed by a subset of
18651921 threads of the current team.
18661922 }] # clausesDescription;
18671923
0 commit comments