[mlir:Async] Add the size parameter to the async.group
authorEugene Zhulenev <ezhulenev@google.com>
Wed, 23 Jun 2021 13:24:09 +0000 (06:24 -0700)
committerEugene Zhulenev <ezhulenev@google.com>
Fri, 25 Jun 2021 17:26:50 +0000 (10:26 -0700)
commitd43b23608ad664f02f56e965ca78916bde220950
treed3a30956bee9bdabc3befbcc975f50bccd1898bb
parent2cd23eb2438238b1297ff7b4368d673c449ff24f
[mlir:Async] Add the size parameter to the async.group

Specify the `!async.group` size (the number of tokens that will be added to it) at construction time. `async.await_all` operation can potentially race with `async.execute` operations that keep updating the group, for this reason it is required to know upfront how many tokens will be added to the group.

Reviewed By: ftynse, herhut

Differential Revision: https://reviews.llvm.org/D104780
13 files changed:
mlir/include/mlir/Dialect/Async/IR/AsyncOps.td
mlir/include/mlir/ExecutionEngine/AsyncRuntime.h
mlir/lib/Conversion/AsyncToLLVM/AsyncToLLVM.cpp
mlir/lib/Dialect/Async/Transforms/AsyncParallelFor.cpp
mlir/lib/Dialect/Async/Transforms/AsyncToAsyncRuntime.cpp
mlir/lib/ExecutionEngine/AsyncRuntime.cpp
mlir/test/Conversion/AsyncToLLVM/convert-runtime-to-llvm.mlir
mlir/test/Conversion/AsyncToLLVM/convert-to-llvm.mlir
mlir/test/Dialect/Async/async-to-async-runtime.mlir
mlir/test/Dialect/Async/ops.mlir
mlir/test/Dialect/Async/runtime.mlir
mlir/test/mlir-cpu-runner/async-error.mlir
mlir/test/mlir-cpu-runner/async-group.mlir