AVX2 feature detection #8838
Unanswered
gregory-rizzo
asked this question in
Q&A
Replies: 1 comment
-
|
As far as I can tell it's not needed, it's just one of the flags you expect. We don't use it directly. However, when we're compiling avx2 code we tell LLVM to assume haswell, which has rdrand. So in theory llvm might feel free to use those instructions. We would welcome a PR that deletes that part of the check, but it should probably also add "-rdrnd" to attrs in CodeGen_X86.cpp:1055 |
Beta Was this translation helpful? Give feedback.
0 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.
-
Hello,
We faced an issue where AVX2 wasn't getting detected on some VMs. It turned out these machines had the avx2 feature but not the rdrand one. We don't think this situation happens much with actual hardware (or maybe one or two old CPUs) but we still wanted to understand why the AVX2 detection involves detecting for rdrand.
This is the commit where rdrand was introduced:
fc478fb
and this the line of code with the AVX2 detection test:
Halide/src/runtime/x86_cpu_features.cpp
Line 109 in 9b0589b
Can someone explain why it's needed? and if it's not needed, should it be removed?
Thank you so much!
Gregory
Beta Was this translation helpful? Give feedback.
All reactions