Error out when kernel function is not found while translating GPU calls.

PiperOrigin-RevId: 269327909
This commit is contained in:
MLIR Team 2019-09-16 07:18:40 -07:00 committed by A. Unique TensorFlower
parent 6755dfdec9
commit 1da0290c4b

View file

@ -310,6 +310,10 @@ void GpuLaunchFuncToCudaCallsPass::translateGpuLaunchCalls(
// represents the cubin at runtime.
// TODO(herhut): This should rather be a static global once supported.
auto kernelFunction = getModule().lookupSymbol<FuncOp>(launchOp.kernel());
if (!kernelFunction) {
launchOp.emitError("missing kernel function ") << launchOp.kernel();
return signalPassFailure();
}
auto cubinGetter =
kernelFunction.getAttrOfType<SymbolRefAttr>(kCubinGetterAnnotation);
if (!cubinGetter) {