travisdowns / uarch-bench

A benchmark for low-level CPU micro-architectural features
MIT License
678 stars 59 forks source link

Add the ability to restrict some benchmarks to CPUs with certain ISA extensions #56

Closed travisdowns closed 6 years ago

travisdowns commented 6 years ago

For example, a benchmark could be tagged with AVX2 if it needs AVX2 to run. This is a lot better than simply crashing when the user runs such a benchmark on an incompatible machine.

Among other things this prevents us from running with --test-name=* on the CI server since it doesn't always have AVX2 and crashes on some test that needs it.

nemequ commented 6 years ago

It's not as well tested as I'd like, but https://github.com/nemequ/portable-snippets/tree/master/cpu may help.

travisdowns commented 6 years ago

@nemequ - huh, I swear I checked portable snippets first, but I missed it (which makes no sense because it's right there at the top level) and I decided to use https://github.com/google/cpu_features instead. However, that's a lot more heavyweight and a difference license which means I need to keep it as a submodule, so maybe I should just use this.

travisdowns commented 6 years ago

Cool, @nemequ , cpu.h seems like what I want, I added some basic support for it in this change.

Now I'll just let you tag benchmarks with the feature enum and have the runner filter out ones that don't apply for the current hardware.