mapleFU commented on issue #43687:
URL: https://github.com/apache/arrow/issues/43687#issuecomment-2289531460

   ```
     /// \brief Indicates the level of SIMD instruction support in the host CPU 
is
     /// required to use the function. The intention is for functions to be 
able to
     /// contain multiple kernels with the same signature but different levels 
of SIMD,
     /// so that the most optimized kernel supported on a host's processor can 
be chosen.
     SimdLevel::type simd_level = SimdLevel::NONE;
   ```
   
   I think this is the "exact" simd-level it's using. Since a AVX2 machine 
execute a code with higher level is not wise
   
   besides, from `DispatchExactImpl`, this would cause override of avx2 in the 
`kernel_matches`. I don't think this is expected?
   
   ```C++
   template <typename KernelType>
   const KernelType* DispatchExactImpl(const std::vector<KernelType*>& kernels,
                                       const std::vector<TypeHolder>& values) {
     const KernelType* kernel_matches[SimdLevel::MAX] = {nullptr};
   
     // Validate arity
     for (const auto& kernel : kernels) {
       if (kernel->signature->MatchesInputs(values)) {
         kernel_matches[kernel->simd_level] = kernel;
       }
     }
   
   #if defined(ARROW_HAVE_RUNTIME_AVX512) || defined(ARROW_HAVE_RUNTIME_AVX2)
     auto cpu_info = arrow::internal::CpuInfo::GetInstance();
   #endif
   #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
   ```
   
   


-- 
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]

Reply via email to