This is an archive of the discontinued LLVM Phabricator instance.

[mlir][GPUToSPIRV] Add a test pass to set workgroup size for kernel functions.
ClosedPublic

Authored by mravishankar on Jul 26 2020, 11:26 PM.

Details

Summary

This allows using command line flags to lowere from GPU to SPIR-V. The
pass added is only for testing/example purposes. Most uses cases will
need more fine-grained control on setting workgroup sizes for kernel
functions.

Depends On D84590

Diff Detail

Event Timeline

mravishankar created this revision.Jul 26 2020, 11:26 PM
rriddle requested changes to this revision.Jul 26 2020, 11:29 PM
rriddle added inline comments.
mlir/lib/Conversion/GPUToSPIRV/ConvertGPUToSPIRVPass.cpp
42 ↗(On Diff #280793)

Please do not add test passes to the main tree, they should only be in the test/ directory.

This revision now requires changes to proceed.Jul 26 2020, 11:29 PM

Addressing comments

mravishankar marked an inline comment as done.Jul 27 2020, 12:17 PM
mravishankar added inline comments.
mlir/lib/Conversion/GPUToSPIRV/ConvertGPUToSPIRVPass.cpp
42 ↗(On Diff #280793)

Moved the pass to test directory

(Leaving approval to Lei or Stephan)

mlir/test/lib/Dialect/SPIRV/TestEntryPointAbi.cpp
29

This doesn't look used?

34

Why is this option int64_t if you only use it as int32_t?

Addressing comments

mravishankar marked 4 inline comments as done.Jul 27 2020, 2:25 PM
mravishankar added inline comments.
mlir/test/lib/Dialect/SPIRV/TestEntryPointAbi.cpp
29

Right. Removed it.

34

Changed to int32_t.

herhut accepted this revision.Jul 28 2020, 1:51 AM
herhut added inline comments.
mlir/test/lib/Dialect/SPIRV/TestEntryPointAbi.cpp
29

Left-over comment?

mravishankar marked 2 inline comments as done.

Remove commented out code.

Adding missing new line at end of file.

mravishankar marked an inline comment as done.Jul 28 2020, 11:48 AM
This revision was not accepted when it landed; it landed in state Needs Review.Jul 28 2020, 12:11 PM
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.