Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
  • Loading branch information
Ngalstyan4 committed May 13, 2024
commit cf0fff3e3fc8e2f8a63cd08eaf9dc6ab63de1d42
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,8 @@ function (setup_target TARGET_NAME)
-fPIC
-pedantic
-Wfatal-errors
-march=native
-ftree-vectorize
# Don't complain if the for-loops were not vectorzied
-Wpass-failed=transform-warning
-fcolor-diagnostics
Expand Down