This is an archive of the discontinued LLVM Phabricator instance.

[mlir][gpu] Add `gpu.wait` op.
ClosedPublic

Authored by csigg on Oct 9 2020, 1:17 PM.

Details

Summary

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.

Diff Detail

Event Timeline

csigg created this revision.Oct 9 2020, 1:17 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 9 2020, 1:17 PM
csigg requested review of this revision.Oct 9 2020, 1:17 PM
csigg updated this revision to Diff 297321.Oct 9 2020, 1:21 PM

Fix base.

csigg updated this revision to Diff 297326.Oct 9 2020, 1:36 PM

Fix base, again.

herhut accepted this revision.Oct 13 2020, 1:24 AM
This revision is now accepted and ready to land.Oct 13 2020, 1:24 AM
csigg updated this revision to Diff 297856.Oct 13 2020, 7:29 AM

Parse 'async' keyword together with async dependencies.

This revision was automatically updated to reflect the committed changes.