Replies: 1 comment 3 replies
-
|
On my local hardware I don't see any benefit from "-fno-slp-vectorize", it actually makes things run slower (maybe because -O3 is also disabled). Could be related to the fact that I use lang 19 instead of 17. I've just tried to commit change that removes -fno-slp-vectorize and re-enables -O3 but it appears that official benchmarks are currently broken. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Thanks for the book!
When I'm reading chapter9 "Optimizing Computations", I found the cmake disable slp via "-fno-slp-vectorize", since it disable breaking a dependency chain. I've run the benchmark in my machine, and find slp makes the code with two RNGs becoming slower.
I also tried the godbolt ( https://godbolt.org/z/5oGrcvKec ), and it shows that the slp has few uOps and can execute faster, but I cannot fully understand the reason, why it would make it slower? Is it due to stress on vectorize unit?
The referenced code I used is listed below, I'm running on my MacOS M1Pro with clang-18
With slp-vectorize enabled:
STRIDE = 2, therandomParticleMotionruns 2200ns per loop, andrandomParticleMotionOriginspend 1900nsSTRIDE = 16, therandomParticleMotionruns 600ns per loopWith slp-vectorize disabled:
STRIDE = 2, therandomParticleMotionruns 1020ns per loop, andrandomParticleMotionOriginspend 1900nsSTRIDE = 16, therandomParticleMotionruns 600ns per loopSo I guess this is another kind of dependency problem in SIMD?
Beta Was this translation helpful? Give feedback.
All reactions