diff options
| author | Alex Zinenko <zinenko@google.com> | 2019-12-10 13:54:50 -0800 |
|---|---|---|
| committer | A. Unique TensorFlower <gardener@tensorflow.org> | 2019-12-10 13:55:21 -0800 |
| commit | d1213ae51d2e321680a4c62c32358e3e07ff3f66 (patch) | |
| tree | b83980b6c211384c35efd9d8b2b7b3c5c2b4e7b5 /mlir/lib/Dialect/GPU/IR/GPUDialect.cpp | |
| parent | 995048d7b7197956bb956dc165aa96d395b7e102 (diff) | |
| download | bcm5719-llvm-d1213ae51d2e321680a4c62c32358e3e07ff3f66.tar.gz bcm5719-llvm-d1213ae51d2e321680a4c62c32358e3e07ff3f66.zip | |
Move gpu.launch_func to ODS. NFC
Move the definition of gpu.launch_func operation from hand-rolled C++
implementation to the ODS framework. Also move the documentation. This only
performs the move and remains a non-functional change, a follow-up will clean
up the custom functions that can be auto-generated using ODS.
PiperOrigin-RevId: 284842252
Diffstat (limited to 'mlir/lib/Dialect/GPU/IR/GPUDialect.cpp')
| -rw-r--r-- | mlir/lib/Dialect/GPU/IR/GPUDialect.cpp | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/mlir/lib/Dialect/GPU/IR/GPUDialect.cpp b/mlir/lib/Dialect/GPU/IR/GPUDialect.cpp index 05dcd90ea45..b8970650806 100644 --- a/mlir/lib/Dialect/GPU/IR/GPUDialect.cpp +++ b/mlir/lib/Dialect/GPU/IR/GPUDialect.cpp @@ -46,10 +46,10 @@ bool GPUDialect::isKernel(Operation *op) { GPUDialect::GPUDialect(MLIRContext *context) : Dialect(getDialectName(), context) { - addOperations<LaunchFuncOp, + addOperations< #define GET_OP_LIST #include "mlir/Dialect/GPU/GPUOps.cpp.inc" - >(); + >(); } LogicalResult GPUDialect::verifyOperationAttribute(Operation *op, @@ -545,26 +545,26 @@ KernelDim3 LaunchFuncOp::getBlockSizeOperandValues() { return KernelDim3{getOperand(3), getOperand(4), getOperand(5)}; } -LogicalResult LaunchFuncOp::verify() { - auto module = getParentOfType<ModuleOp>(); +LogicalResult verify(LaunchFuncOp op) { + auto module = op.getParentOfType<ModuleOp>(); if (!module) - return emitOpError("expected to belong to a module"); + return op.emitOpError("expected to belong to a module"); if (!module.getAttrOfType<UnitAttr>(GPUDialect::getContainerModuleAttrName())) - return emitOpError("expected the closest surrounding module to have the '" + - GPUDialect::getContainerModuleAttrName() + - "' attribute"); + return op.emitOpError( + "expected the closest surrounding module to have the '" + + GPUDialect::getContainerModuleAttrName() + "' attribute"); - auto kernelAttr = getAttrOfType<StringAttr>(getKernelAttrName()); + auto kernelAttr = op.getAttrOfType<StringAttr>(op.getKernelAttrName()); if (!kernelAttr) - return emitOpError("string attribute '" + getKernelAttrName() + - "' must be specified"); + return op.emitOpError("string attribute '" + op.getKernelAttrName() + + "' must be specified"); auto kernelModuleAttr = - getAttrOfType<SymbolRefAttr>(getKernelModuleAttrName()); + op.getAttrOfType<SymbolRefAttr>(op.getKernelModuleAttrName()); if (!kernelModuleAttr) - return emitOpError("symbol reference attribute '" + - getKernelModuleAttrName() + "' must be specified"); + return op.emitOpError("symbol reference attribute '" + + op.getKernelModuleAttrName() + "' must be specified"); return success(); } |

