-
Notifications
You must be signed in to change notification settings - Fork 4.1k
[C++] Add support to GetRuntimeInfo for reporting ASIMD/NEON #40806
Copy link
Copy link
Closed
Description
Describe the enhancement requested
PyArrow and R arrow have user-facing functions that call into Arrow C++'s arrow::GetRuntimeInfo() to report on build and runtime SIMD support:
Lines 74 to 80 in 4a4d580
| RuntimeInfo GetRuntimeInfo() { | |
| RuntimeInfo info; | |
| auto cpu_info = CpuInfo::GetInstance(); | |
| info.simd_level = | |
| MakeSimdLevelString([&](int64_t flags) { return cpu_info->IsSupported(flags); }); | |
| info.detected_simd_level = | |
| MakeSimdLevelString([&](int64_t flags) { return cpu_info->IsDetected(flags); }); |
GetRuntimeInfo calls into MakeSimdLevelString to populate a RuntimeInfo object.
On ARM-based systems, "none" is reported for both SIMD levels which I think is caused by a there being no branch for CpuInfo::ASIMD:
Lines 52 to 64 in f710ac5
| std::string MakeSimdLevelString(QueryFlagFunction&& query_flag) { | |
| if (query_flag(CpuInfo::AVX512)) { | |
| return "avx512"; | |
| } else if (query_flag(CpuInfo::AVX2)) { | |
| return "avx2"; | |
| } else if (query_flag(CpuInfo::AVX)) { | |
| return "avx"; | |
| } else if (query_flag(CpuInfo::SSE4_2)) { | |
| return "sse4_2"; | |
| } else { | |
| return "none"; | |
| } | |
| } |
- Should we add a branch for
CpuInfo::ASIMD? - If so, would it make more sense to call it ASIMD or NEON? They're related but slightly different concepts and I'm not sure what language users will be most familiar with and which makes more sense alongside other values.
Component(s)
C++
Reactions are currently unavailable