`hwy::DispatchedTarget` always returns HWY_EMU128 on WASM/Emscripten
- Dominant language
- C++
- Stars
- 5.8k
- Forks
- 471
- Avg merge
- 1d 6h
- Merged PRs (30d)
- 81
Description
The reason is the highway library isn't compiled with `-msimd128`.
My project is compiled with Emscripten with `-msimd128` flag.
I'm using CMake and `FetchContent` to download source of highway, and `FetchContent` used `add_subdirectory` to integrate highway in to my build.
And the `HWY_DYNAMIC_DISPATCH` macro is doing great by selecting `HWY_WASM` target.
Current viable solution is using `include` instead of `add_subdirectory` in cmake, and add `-msimd128` flag to highway manually.
Or, I'd like to discuss:
1. Is it possible for WASM to auto detect and enable WASM SIMD by pragma like avx targets? (without manually adding compiler flags).
2. Maybe landing https://github.com/google/highway/issues/2114 is also a great idea. (I'd like to try that, but it may produce a big change list)
Contributor guide
Assessment
This issue has not been assessed yet.