Skip to content

Align Pairwise with vectorised{} doesn't speed the execution time #3134

Answered by eseiler
lantoine16 asked this question in Q&A
Discussion options

You must be logged in to vote

Hey there!

You indeed need some compiler flags to enable vectorization.
The easiest is to use -march=native

set (CMAKE_CXX_FLAGS "-O3 -march=native")

This will auto-detect all supported CPU flags and add them.
You can check supported instructions via

$ lscpu | grep Flags

sse4_1 sse4_2 avx avx2 are some of the interesting ones. There's a list of flags for GCC, but just using -march=native is enough.

I have not yet looked at your code in detail, but it seems good 👍.

Don't hesitate to ask more questions, we are happy to help and to check whether we would do something differently.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@lantoine16
Comment options

Answer selected by lantoine16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants