| 241 | } |
| 242 | |
| 243 | std::vector<int64_t> GetSupportedHardwareFlags( |
| 244 | const std::vector<int64_t>& candidate_flags) { |
| 245 | std::vector<int64_t> hardware_flags; |
| 246 | // Always test fallback codepaths |
| 247 | hardware_flags.push_back(0); |
| 248 | for (const int64_t candidate_flag : candidate_flags) { |
| 249 | if (candidate_flag != 0 && |
| 250 | internal::CpuInfo::GetInstance()->IsSupported(candidate_flag)) { |
| 251 | hardware_flags.push_back(candidate_flag); |
| 252 | } |
| 253 | } |
| 254 | return hardware_flags; |
| 255 | } |
| 256 | |
| 257 | } // namespace arrow |