Skip to content

Commit

Permalink
implement
Browse files Browse the repository at this point in the history
Signed-off-by: chentong319 <[email protected]>
  • Loading branch information
chentong319 committed Oct 2, 2024
1 parent f8e2466 commit a7c39a4
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/Compiler/CompilerOptions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1246,6 +1246,13 @@ void initCompilerConfig() {
addCompilerConfig(CCM_SHARED_LIB_DEPS, extraLibs);
addCompilerConfig(CCM_SHARED_LIB_PATH_DEPS, extraLibPaths);
}

// Enable aggressive optimization for NNPA with -O3
if (OptimizationLevel == OptLevel::O3 &&
getTargetAccel().find("NNPA") != std::string::npos &&
getLLVMOption().find("enable-unsafe-fp-math") == std::string::npos) {
setLLVMOption(getLLVMOption() + " --enable-unsafe-fp-math");
}
}

} // namespace onnx_mlir

0 comments on commit a7c39a4

Please sign in to comment.