Skip to content

Commit

Permalink
Error out when kernel function is not found while translating GPU calls.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 269327909
  • Loading branch information
MLIR Team authored and tensorflower-gardener committed Sep 16, 2019
1 parent 6755dfd commit 1da0290
Showing 1 changed file with 4 additions and 0 deletions.
Expand Up @@ -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) {
Expand Down

0 comments on commit 1da0290

Please sign in to comment.