multiversion
multiversion copied to clipboard
Add method for overriding dispatcher
A good option would be to use environment variables (this should be an optional feature). The environment variables could limit which architectures are available (for example, disabling AVX to allow testing of SSE or fallback versions).
A few options/thoughts:
- Runtime control over the dispatcher. Just a function that limits/enables specific instruction sets?
- Compile time control over the dispatcher. Disables
target_clonesto build with the current feature set, and turnsmultiversioninto a bunch of#[cfg(target_feature = foo)]that selects the first one that works with the current configuration.
It could be useful to have a macro for testing that selects specific implementations, and maybe creates copies of tests for each implementation.
Half of this task is complete with the addition of the std option--when disabled, runtime CPU feature detection is replaced with compile-time conditional compilation.