[all-commits] [llvm/llvm-project] 52a0b6: [openacc] Add acc routine support to acc dialect

Razvan Lupusoru via All-commits all-commits at lists.llvm.org
Wed Jul 26 15:07:08 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 52a0b6a662686815887eab2b573ddfdcfa3cc8f7
      https://github.com/llvm/llvm-project/commit/52a0b6a662686815887eab2b573ddfdcfa3cc8f7
  Author: Razvan Lupusoru <rlupusoru at nvidia.com>
  Date:   2023-07-26 (Wed, 26 Jul 2023)

  Changed paths:
    M mlir/include/mlir/Dialect/OpenACC/OpenACCOps.td
    M mlir/lib/Dialect/OpenACC/IR/OpenACC.cpp
    M mlir/test/Dialect/OpenACC/ops.mlir

  Log Message:
  -----------
  [openacc] Add acc routine support to acc dialect

Adds representation for `acc routine` under new operation named
`acc.routine`. This operation is associated with a function symbol.
It also gets its own compiler generated synthetic symbol name so
that it can be referenced from the associated function. The clauses
associated with the `acc routine` directive are captured in the
`acc.routine` op.

The linking between the `func.func` and its `acc.routine` declaration
is done through the `acc.routine_info` attribute. In practice, a
single `acc routine` is associated with a function. But the spec does
not specifically restrict this - thus the 1:N relationship between
`func.func` and `acc.routine` allowed in the dialect. Additionally, it
makes sense that multiple acc routines could be used for a single
function depending on loop context - to allow flexible parallelization.

Most acc routine clauses are supported including `gang`, `gang(dim:)`,
`vector`, `worker`, `seq`, `nohost`, and `bind`. The only one not
supported is `device_type`. This is because most other clauses also
miss this and the effort to add support for it needs to be coordinated
and consistent.

Reviewed By: clementval, vzakhari

Differential Revision: https://reviews.llvm.org/D156281




More information about the All-commits mailing list