[mlir] Add gpu.allocate, gpu.deallocate ops with LLVM lowering to runtime function...
authorChristian Sigg <csigg@google.com>
Tue, 24 Nov 2020 21:07:34 +0000 (22:07 +0100)
committerChristian Sigg <csigg@google.com>
Fri, 27 Nov 2020 08:40:59 +0000 (09:40 +0100)
commit5535696c386ba89b66c1b5a72a2aa98783571cc9
treea3db457776416d614b1ff64ede9924402704fe6b
parent8dcf8d1da5630d1beecafe6cb1247df3f6a47022
[mlir] Add gpu.allocate, gpu.deallocate ops with LLVM lowering to runtime function calls.

The ops are very similar to the std variants, but support async GPU execution.

gpu.alloc does not currently support an alignment attribute, and the new ops do not have
canonicalizers/folders like their std siblings do.

Reviewed By: herhut

Differential Revision: https://reviews.llvm.org/D91698
mlir/include/mlir/Dialect/GPU/GPUDialect.h
mlir/include/mlir/Dialect/GPU/GPUOps.td
mlir/lib/Conversion/GPUCommon/ConvertLaunchFuncToRuntimeCalls.cpp
mlir/test/Conversion/GPUCommon/lower-alloc-to-gpu-runtime-calls.mlir [new file with mode: 0644]
mlir/test/Dialect/GPU/ops.mlir
mlir/tools/mlir-cuda-runner/cuda-runtime-wrappers.cpp
mlir/tools/mlir-rocm-runner/rocm-runtime-wrappers.cpp