multiversion icon indicating copy to clipboard operation
multiversion copied to clipboard

Add method for overriding dispatcher

Open calebzulawski opened this issue 6 years ago • 2 comments

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).

calebzulawski avatar Sep 07 '19 04:09 calebzulawski

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_clones to build with the current feature set, and turns multiversion into 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.

calebzulawski avatar Nov 12 '19 04:11 calebzulawski

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.

calebzulawski avatar Feb 11 '20 04:02 calebzulawski