| 234 | } |
| 235 | |
| 236 | std::vector<int64_t> GetSupportedHardwareFlags( |
| 237 | const std::vector<int64_t>& candidate_flags) { |
| 238 | std::vector<int64_t> hardware_flags; |
| 239 | // Always test fallback codepaths |
| 240 | hardware_flags.push_back(0); |
| 241 | for (const int64_t candidate_flag : candidate_flags) { |
| 242 | if (candidate_flag != 0 && |
| 243 | internal::CpuInfo::GetInstance()->IsSupported(candidate_flag)) { |
| 244 | hardware_flags.push_back(candidate_flag); |
| 245 | } |
| 246 | } |
| 247 | return hardware_flags; |
| 248 | } |
| 249 | |
| 250 | } // namespace arrow |