diff options
| author | Alex Zinenko <zinenko@google.com> | 2019-12-18 03:38:18 -0800 |
|---|---|---|
| committer | A. Unique TensorFlower <gardener@tensorflow.org> | 2019-12-18 03:38:55 -0800 |
| commit | 40ef46fba4a072065c04fa16ac9309b551fd7004 (patch) | |
| tree | 414609c0a381ff6247b937435e0ca2ae95558d36 /mlir/include | |
| parent | c6c6a74d5557d1f373c3bb10fd8a383b0ae18182 (diff) | |
| download | bcm5719-llvm-40ef46fba4a072065c04fa16ac9309b551fd7004.tar.gz bcm5719-llvm-40ef46fba4a072065c04fa16ac9309b551fd7004.zip | |
Harden the requirements to memory attribution types in gpu.func
When memory attributions are present in `gpu.func`, require that they are of
memref type and live in memoryspaces 3 and 5 for workgroup and private memory
attributions, respectively. Adapt the conversion from the GPU dialect to the
NVVM dialect to drop the private memory space from attributions as NVVM is able
to model them as local `llvm.alloca`s in the default memory space.
PiperOrigin-RevId: 286161763
Diffstat (limited to 'mlir/include')
| -rw-r--r-- | mlir/include/mlir/Dialect/GPU/GPUDialect.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/mlir/include/mlir/Dialect/GPU/GPUDialect.h b/mlir/include/mlir/Dialect/GPU/GPUDialect.h index 8b62c70178b..495238ffea6 100644 --- a/mlir/include/mlir/Dialect/GPU/GPUDialect.h +++ b/mlir/include/mlir/Dialect/GPU/GPUDialect.h @@ -63,7 +63,11 @@ public: /// Returns the numeric value used to identify the workgroup memory address /// space. - static int getWorkgroupAddressSpace() { return 3; } + static unsigned getWorkgroupAddressSpace() { return 3; } + + /// Returns the numeric value used to identify the private memory address + /// space. + static unsigned getPrivateAddressSpace() { return 5; } LogicalResult verifyOperationAttribute(Operation *op, NamedAttribute attr) override; |

