Skip to content

Commit

Permalink
[mlir][openacc][NFC] Add information about getters for operands with …
Browse files Browse the repository at this point in the history
…device_type (llvm#80389)

Add information in the operation's description about which operands must
be accessed with special getters for device_type support.
  • Loading branch information
clementval authored Feb 3, 2024
1 parent 820f244 commit 31350c2
Showing 1 changed file with 34 additions and 1 deletion.
35 changes: 34 additions & 1 deletion mlir/include/mlir/Dialect/OpenACC/OpenACCOps.td
Original file line number Diff line number Diff line change
Expand Up @@ -900,6 +900,11 @@ def OpenACC_ParallelOp : OpenACC_Op<"parallel",
// parallel region
}
```

`async`, `wait`, `num_gangs`, `num_workers` and `vector_length` operands are
supported with `device_type` information. They should only be accessed by
the extra provided getters. If modified, the corresponding `device_type`
attributes must be modified as well.
}];

let arguments = (ins
Expand Down Expand Up @@ -1038,6 +1043,10 @@ def OpenACC_SerialOp : OpenACC_Op<"serial",
// serial region
}
```

`async` and `wait` operands are supported with `device_type` information.
They should only be accessed by the extra provided getters. If modified,
the corresponding `device_type` attributes must be modified as well.
}];

let arguments = (ins
Expand Down Expand Up @@ -1146,6 +1155,11 @@ def OpenACC_KernelsOp : OpenACC_Op<"kernels",
// kernels region
}
```

`collapse`, `gang`, `worker`, `vector`, `seq`, `independent`, `auto` and
`tile` operands are supported with `device_type` information. They should
only be accessed by the extra provided getters. If modified, the
corresponding `device_type` attributes must be modified as well.
}];

let arguments = (ins
Expand Down Expand Up @@ -1274,6 +1288,10 @@ def OpenACC_DataOp : OpenACC_Op<"data",
// data region
}
```

`async` and `wait` operands are supported with `device_type` information.
They should only be accessed by the extra provided getters. If modified,
the corresponding `device_type` attributes must be modified as well.
}];


Expand Down Expand Up @@ -1520,6 +1538,11 @@ def OpenACC_LoopOp : OpenACC_Op<"loop",
acc.yield
} attributes { collapse = [3] }
```

`collapse`, `gang`, `worker`, `vector`, `seq`, `independent`, `auto` and
`tile` operands are supported with `device_type` information. They should
only be accessed by the extra provided getters. If modified, the
corresponding `device_type` attributes must be modified as well.
}];

let arguments = (ins
Expand Down Expand Up @@ -2018,11 +2041,17 @@ def OpenACC_RoutineOp : OpenACC_Op<"routine", [IsolatedFromAbove]> {
Example:

```mlir
func.func @acc_func(%a : i64) -> () attributes {acc.routine_info = #acc.routine_info<[@acc_func_rout1]>} {
func.func @acc_func(%a : i64) -> () attributes
{acc.routine_info = #acc.routine_info<[@acc_func_rout1]>} {
return
}
acc.routine @acc_func_rout1 func(@acc_func) gang
```

`bind`, `gang`, `worker`, `vector` and `seq` operands are supported with
`device_type` information. They should only be accessed by the extra
provided getters. If modified, the corresponding `device_type` attributes
must be modified as well.
}];

let arguments = (ins SymbolNameAttr:$sym_name,
Expand Down Expand Up @@ -2217,6 +2246,10 @@ def OpenACC_UpdateOp : OpenACC_Op<"update",
```mlir
acc.update device(%d1 : memref<10xf32>) attributes {async}
```

`async` and `wait` operands are supported with `device_type` information.
They should only be accessed by the extra provided getters. If modified,
the corresponding `device_type` attributes must be modified as well.
}];

let arguments = (ins Optional<I1>:$ifCond,
Expand Down

0 comments on commit 31350c2

Please sign in to comment.