Skip to content

Commit

Permalink
Fix macos fname
Browse files Browse the repository at this point in the history
  • Loading branch information
wsmoses committed Dec 3, 2023
1 parent 36fa523 commit 0085517
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion enzyme_jax/enzyme_call.cc
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,14 @@ class CpuKernel {
if (lang == Language::MHLO) {
auto *cpu_executable = static_cast<xla::cpu::CpuExecutable *>(
local_executable->executable());
auto F = linkMod->getFunction(cpu_executable->module_name());
StringRef fname = cpu_executable->module_name();
if (fname.size() && fname[0] == '_')
fname = fname.substr(1);
auto F = linkMod->getFunction(fname);
if (!F) {
llvm::errs() << *linkMod << "\n";
llvm::errs() << "fname: " << fname << "\n";
}
assert(F);
fn = "mhlo_main";
F->setName(fn);
Expand Down

0 comments on commit 0085517

Please sign in to comment.