Skip to content

Commit fa1b30e

Browse files
add support to enable simd for mac under the native march
Signed-off-by: Alexandre Eichenberger <[email protected]>
1 parent f68db6e commit fa1b30e

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

src/Compiler/CompilerOptions.cpp

-5
Original file line numberDiff line numberDiff line change
@@ -1417,11 +1417,6 @@ void initCompilerConfig() {
14171417
setLLVMOption(getLLVMOption() + " --enable-unsafe-fp-math");
14181418
}
14191419

1420-
#if 0
1421-
if (march == "z17")
1422-
march = "arch15";
1423-
#endif
1424-
14251420
if (march == "native") {
14261421
march = std::string(llvm::sys::getHostCPUName());
14271422
if (VerboseOutput)

src/Dialect/Mlir/VectorMachineSupport.cpp

+4-2
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,10 @@ namespace onnx_mlir {
4848
else
4949
// Default seems to be SSE
5050
globalVectorMachineSupport = new SSE42x86VectorMachineSupport();
51-
// Arm uses arch
52-
} else if (arch.compare("aarch64") == 0 || arch.compare("arm64") == 0) {
51+
// Arm uses arch, and arch=native returns apple-mXXX.
52+
} else if (arch.compare("aarch64") == 0 || arch.compare("arm64") == 0 ||
53+
arch.compare("apple-m1") == 0 || arch.compare("apple-m2") == 0 ||
54+
arch.compare("apple-m3") == 0 || arch.compare("apple-m4") == 0) {
5355
// Arm arch
5456
globalVectorMachineSupport = new NeonVectorMachineSupport();
5557
} else {

0 commit comments

Comments
 (0)