summaryrefslogtreecommitdiffstats
path: root/mlir/lib/Conversion/GPUToCUDA/ConvertLaunchFuncToCudaCalls.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'mlir/lib/Conversion/GPUToCUDA/ConvertLaunchFuncToCudaCalls.cpp')
-rw-r--r--mlir/lib/Conversion/GPUToCUDA/ConvertLaunchFuncToCudaCalls.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/mlir/lib/Conversion/GPUToCUDA/ConvertLaunchFuncToCudaCalls.cpp b/mlir/lib/Conversion/GPUToCUDA/ConvertLaunchFuncToCudaCalls.cpp
index 41f69d6e21d..31024d2881b 100644
--- a/mlir/lib/Conversion/GPUToCUDA/ConvertLaunchFuncToCudaCalls.cpp
+++ b/mlir/lib/Conversion/GPUToCUDA/ConvertLaunchFuncToCudaCalls.cpp
@@ -132,9 +132,9 @@ public:
// GPU kernel modules are no longer necessary since we have a global
// constant with the CUBIN data.
- for (auto m : llvm::make_early_inc_range(getModule().getOps<ModuleOp>()))
- if (m.getAttrOfType<UnitAttr>(gpu::GPUDialect::getKernelModuleAttrName()))
- m.erase();
+ for (auto m :
+ llvm::make_early_inc_range(getModule().getOps<gpu::GPUModuleOp>()))
+ m.erase();
}
private:
@@ -343,8 +343,8 @@ void GpuLaunchFuncToCudaCallsPass::translateGpuLaunchCalls(
builder.getI32IntegerAttr(0));
// Create an LLVM global with CUBIN extracted from the kernel annotation and
// obtain a pointer to the first byte in it.
- auto kernelModule =
- getModule().lookupSymbol<ModuleOp>(launchOp.getKernelModuleName());
+ auto kernelModule = getModule().lookupSymbol<gpu::GPUModuleOp>(
+ launchOp.getKernelModuleName());
assert(kernelModule && "expected a kernel module");
auto cubinAttr = kernelModule.getAttrOfType<StringAttr>(kCubinAnnotation);
@@ -354,8 +354,7 @@ void GpuLaunchFuncToCudaCallsPass::translateGpuLaunchCalls(
return signalPassFailure();
}
- assert(kernelModule.getName() && "expected a named module");
- SmallString<128> nameBuffer(*kernelModule.getName());
+ SmallString<128> nameBuffer(kernelModule.getName());
nameBuffer.append(kCubinStorageSuffix);
Value data = LLVM::createGlobalString(
loc, builder, nameBuffer.str(), cubinAttr.getValue(),
OpenPOWER on IntegriCloud