2 ms·
But I don't think you actually need to do that. You can compile individual functions with different target specific optimizations using (e.g.) LLVM's target_fea
by burntsushi 10y ago
But I don't think you actually need to do that. You can compile individual functions with different target specific optimizations using (e.g.) LLVM's target_feature attribute. Both gcc and clang expose this type of functionality.
As DannyBee mentions in the sibling, this issue is compounded in AVX512. You really need to support runtime detection, and doing that means including multiple versions of the same function in the same binary. It looks like one is at the mercy of your compiler for how well this works, but it seems like gcc/clang do this just fine?
- Arnavion 10y ago>Both gcc and clang expose this type of functionality. Sure, I didn't say that it was impossible in general. The context of my comments was that MSVC doesn't appear to support automatic target-architecture-based dispatch and thus requires such workarounds.
- burntsushi 10y agoAh! Gotya. Understood. Sorry for the mixup!