[mlir][Transform] Add support for mapping to GPU warps and to linear ids
authorNicolas Vasilache <nicolas.vasilache@gmail.com>
Mon, 20 Mar 2023 06:46:11 +0000 (23:46 -0700)
committerNicolas Vasilache <nicolas.vasilache@gmail.com>
Mon, 20 Mar 2023 08:05:32 +0000 (01:05 -0700)
commitc59465e1203dd78d06e15f7ddf62141807dbd5a7
tree154594e2bae42613d2744560f300b23bba725fa1
parentc1888a370ada6e76d51cdb9c6eeefa2588a475eb
[mlir][Transform] Add support for mapping to GPU warps and to linear ids

This revisions refactors the implementation of mapping to threads to additionally allow warps and linear ids to be specified.

`warp_dims` is currently specified along with `block_dims` as a transform attribute.

Linear ids on th other hand use the flattened block_dims to predicate on the first (linearized) k threads.
An additional GPULinearIdMappingAttr is added to the GPU dialect to allow specifying loops mapped to this new scheme.

Various implementation and transform op semantics cleanups are also applied.

Reviewed By: ThomasRaoux

Differential Revision: https://reviews.llvm.org/D146130
mlir/include/mlir/Dialect/GPU/TransformOps/GPUDeviceMappingAttr.td
mlir/include/mlir/Dialect/GPU/TransformOps/GPUTransformOps.h
mlir/include/mlir/Dialect/GPU/TransformOps/GPUTransformOps.td
mlir/lib/Dialect/GPU/IR/GPUDialect.cpp
mlir/lib/Dialect/GPU/TransformOps/GPUTransformOps.cpp
mlir/test/Dialect/GPU/transform-gpu-failing.mlir
mlir/test/Dialect/GPU/transform-gpu.mlir