Skip to content

Commit cf0fff3

Browse files
committed
Add -march=native in clang compile flags to enable auto-vectorization
Tested on Macbook Pro with 2.4 GHz Intel Core i9, Clang 15 Output of objdump on bench_cpp when these flags are present: postgres@4832feb5168c:/lantern_shared/third_party/usearch/build_release$ objdump -d ./bench_cpp | grep vzero | head 1cad3: c5 f8 77 vzeroupper 1cb1e: c5 f8 77 vzeroupper ... grep output is empty when the flags are not present
1 parent 37b47b0 commit cf0fff3

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

CMakeLists.txt

+2
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,8 @@ function (setup_target TARGET_NAME)
201201
-fPIC
202202
-pedantic
203203
-Wfatal-errors
204+
-march=native
205+
-ftree-vectorize
204206
# Don't complain if the for-loops were not vectorzied
205207
-Wpass-failed=transform-warning
206208
-fcolor-diagnostics

0 commit comments

Comments
 (0)