felipecrv commented on issue #43687:
URL: https://github.com/apache/arrow/issues/43687#issuecomment-2289596669
> I think this is the "exact" simd-level it's using. Since a AVX2 machine
execute a code with higher level is not wise
No, the comment says "the required level" :D Are there CPUs that support
AVX512 and don't support AVX2?
The code checks for CPU support for AVX512 instructions. Then it checks if a
kernel exists. If an AVX512 kernel doesn't exist... no problem, it will look
for the AVX2 kernel.
```cpp
#if defined(ARROW_HAVE_RUNTIME_AVX512)
if (cpu_info->IsSupported(arrow::internal::CpuInfo::AVX512)) {
if (kernel_matches[SimdLevel::AVX512]) {
return kernel_matches[SimdLevel::AVX512];
}
}
#endif
#if defined(ARROW_HAVE_RUNTIME_AVX2)
if (cpu_info->IsSupported(arrow::internal::CpuInfo::AVX2)) {
if (kernel_matches[SimdLevel::AVX2]) {
return kernel_matches[SimdLevel::AVX2];
}
}
#endif
```
We should never allow a compilation config that has
`ARROW_HAVE_RUNTIME_AVX512` enabled and `ARROW_HAVE_RUNTIME_AVX2` disabled
though.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]