[all-commits] [llvm/llvm-project] db1cf3: [mlir][gpu] Add `gpu.wait` op.

Christian Sigg via All-commits all-commits at lists.llvm.org
Tue Oct 13 08:31:30 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: db1cf3d9ab33f56fcaea616baa71c6e4036beffa
      https://github.com/llvm/llvm-project/commit/db1cf3d9ab33f56fcaea616baa71c6e4036beffa
  Author: Christian Sigg <csigg at google.com>
  Date:   2020-10-13 (Tue, 13 Oct 2020)

  Changed paths:
    M mlir/include/mlir/Dialect/GPU/GPUOps.td
    M mlir/lib/Dialect/GPU/IR/GPUDialect.cpp
    M mlir/test/Dialect/GPU/invalid.mlir
    M mlir/test/Dialect/GPU/ops.mlir

  Log Message:
  -----------
  [mlir][gpu] Add `gpu.wait` op.

This combines two separate ops (D88972: `gpu.create_token`, D89043: `gpu.host_wait`) into one.

I do after all like the idea of combining the two ops, because it matches exactly the pattern we are
going to have in the other gpu ops that will implement the AsyncOpInterface (launch_func, copies, alloc):

If the op is async, we return a !gpu.async.token. Otherwise, we synchronize with the host and don't return a token.

The use cases for `gpu.wait async` and `gpu.wait` are further apart than those of e.g. `gpu.h2d async` and `gpu.h2d`,
but I like the consistent meaning of the `async` keyword in GPU ops.

Reviewed By: herhut

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




More information about the All-commits mailing list