llvm-project/mlir/lib
Krzysztof Drewniak e1da62910e [MLIR][GPU] Define gpu.printf op and its lowerings
- Define a gpu.printf op, which can be lowered to any GPU printf() support (which is present in CUDA, HIP, and OpenCL). This op only supports constant format strings and scalar arguments
- Define the lowering of gpu.pirntf to a call to printf() (which is what is required for AMD GPUs when using OpenCL) as well as to the hostcall interface present in the AMD Open Compute device library, which is the interface present when kernels are running under HIP.
- Add a "runtime" enum that allows specifying which of the possible runtimes a ROCDL kernel will be executed under or that the runtime is unknown. This enum controls how gpu.printf is lowered

This change does not enable lowering for Nvidia GPUs, but such a lowering should be possible in principle.

And:
[MLIR][AMDGPU] Always set amdgpu-implicitarg-num-bytes=56 on kernels

This is something that Clang always sets on both OpenCL and HIP kernels, and failing to include it causes mysterious crashes with printf() support.

In addition, revert the max-flat-work-group-size to (1, 256) to avoid triggering bugs in the AMDGPU backend.

Reviewed By: mehdi_amini

Differential Revision: https://reviews.llvm.org/D110448
2021-12-09 15:54:31 +00:00
..
Analysis [MLIR] Move Presburger Math from FlatAffineConstraints to Presburger/IntegerPolyhedron 2021-12-09 16:42:06 +05:30
Bindings/Python Adjust "end namespace" comment in MLIR to match new agree'd coding style 2021-12-08 06:05:26 +00:00
CAPI [mlir][python] Implement more SymbolTable methods. 2021-11-29 20:31:13 -08:00
Conversion [MLIR][GPU] Define gpu.printf op and its lowerings 2021-12-09 15:54:31 +00:00
Dialect [MLIR][GPU] Define gpu.printf op and its lowerings 2021-12-09 15:54:31 +00:00
ExecutionEngine Adjust "end namespace" comment in MLIR to match new agree'd coding style 2021-12-08 06:05:26 +00:00
IR Adjust "end namespace" comment in MLIR to match new agree'd coding style 2021-12-08 06:05:26 +00:00
Interfaces [mlir][Vector] Thread 0-d vectors through vector.transfer ops 2021-12-01 16:49:43 +00:00
Parser Adjust "end namespace" comment in MLIR to match new agree'd coding style 2021-12-08 06:05:26 +00:00
Pass Adjust "end namespace" comment in MLIR to match new agree'd coding style 2021-12-08 06:05:26 +00:00
Reducer Adjust "end namespace" comment in MLIR to match new agree'd coding style 2021-12-08 06:05:26 +00:00
Rewrite Adjust "end namespace" comment in MLIR to match new agree'd coding style 2021-12-08 06:05:26 +00:00
Support Adjust "end namespace" comment in MLIR to match new agree'd coding style 2021-12-08 06:05:26 +00:00
TableGen Adjust "end namespace" comment in MLIR to match new agree'd coding style 2021-12-08 06:05:26 +00:00
Target [MLIR][GPU] Define gpu.printf op and its lowerings 2021-12-09 15:54:31 +00:00
Tools [mlir][lsp] Use ResultGroupDefinition struct 2021-11-17 00:40:57 +00:00
Transforms Adjust "end namespace" comment in MLIR to match new agree'd coding style 2021-12-08 06:05:26 +00:00
Translation [mlir] run the verifier before translating a module 2021-07-28 18:15:58 +02:00
CMakeLists.txt Re-engineer MLIR python build support. 2021-07-27 15:54:58 +00:00