Skip to content

Commit

Permalink
legalize name for kern lowering
Browse files Browse the repository at this point in the history
  • Loading branch information
wsmoses committed Jan 18, 2025
1 parent 03de92c commit 07a8928
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/enzyme_ad/jax/Passes/LowerKernel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,9 @@ CallInfo CompileKernel(SymbolTableCollection &symbolTable, mlir::Location loc,
auto gpumod = builder.create<gpu::GPUModuleOp>(loc, "gpumodname");
builder.setInsertionPointToStart(&gpumod.getBodyRegion().front());

auto gpufunc = builder.create<gpu::GPUFuncOp>(loc, op.getName(), gpuTy);
std::string legalName = op.getName().str();
std::replace(legalName.begin(), legalName.end(), '#', '_');
auto gpufunc = builder.create<gpu::GPUFuncOp>(loc, legalName, gpuTy);
{
auto entry = &gpufunc.getBody().front();
builder.setInsertionPointToEnd(entry);
Expand Down

0 comments on commit 07a8928

Please sign in to comment.