Corrected the benchmarks to properly set the SIMD operations

This commit is contained in:
Paul Ferrand 2020-05-30 22:53:41 +02:00 committed by Jean Pierre Cimalando
parent 1b68331f38
commit 7b6914f91d
2 changed files with 10 additions and 0 deletions

View file

@ -46,6 +46,7 @@ BENCHMARK_DEFINE_F(Divide, Straight)(benchmark::State& state) {
BENCHMARK_DEFINE_F(Divide, Scalar)(benchmark::State& state) {
for (auto _ : state)
{
sfz::setSIMDOpStatus(sfz::SIMDOps::divide, false);
sfz::divide<float>(input, divisor, absl::MakeSpan(output));
}
}
@ -53,6 +54,7 @@ BENCHMARK_DEFINE_F(Divide, Scalar)(benchmark::State& state) {
BENCHMARK_DEFINE_F(Divide, SIMD)(benchmark::State& state) {
for (auto _ : state)
{
sfz::setSIMDOpStatus(sfz::SIMDOps::divide, true);
sfz::divide<float>(input, divisor, absl::MakeSpan(output));
}
}
@ -60,6 +62,7 @@ BENCHMARK_DEFINE_F(Divide, SIMD)(benchmark::State& state) {
BENCHMARK_DEFINE_F(Divide, Scalar_Unaligned)(benchmark::State& state) {
for (auto _ : state)
{
sfz::setSIMDOpStatus(sfz::SIMDOps::divide, false);
sfz::divide<float>(absl::MakeSpan(input).subspan(1), absl::MakeSpan(divisor).subspan(1), absl::MakeSpan(output).subspan(1));
}
}
@ -67,6 +70,7 @@ BENCHMARK_DEFINE_F(Divide, Scalar_Unaligned)(benchmark::State& state) {
BENCHMARK_DEFINE_F(Divide, SIMD_Unaligned)(benchmark::State& state) {
for (auto _ : state)
{
sfz::setSIMDOpStatus(sfz::SIMDOps::divide, true);
sfz::divide<float>(absl::MakeSpan(input).subspan(1), absl::MakeSpan(divisor).subspan(1), absl::MakeSpan(output).subspan(1));
}
}

View file

@ -66,6 +66,7 @@ BENCHMARK_DEFINE_F(GainSingle, Straight)(benchmark::State& state) {
BENCHMARK_DEFINE_F(GainSingle, Scalar)(benchmark::State& state) {
for (auto _ : state)
{
sfz::setSIMDOpStatus(sfz::SIMDOps::gain, false);
sfz::applyGain<float>(gain, input, absl::MakeSpan(output));
}
}
@ -73,6 +74,7 @@ BENCHMARK_DEFINE_F(GainSingle, Scalar)(benchmark::State& state) {
BENCHMARK_DEFINE_F(GainSingle, SIMD)(benchmark::State& state) {
for (auto _ : state)
{
sfz::setSIMDOpStatus(sfz::SIMDOps::gain, true);
sfz::applyGain<float>(gain, input, absl::MakeSpan(output));
}
}
@ -88,6 +90,7 @@ BENCHMARK_DEFINE_F(GainArray, Straight)(benchmark::State& state) {
BENCHMARK_DEFINE_F(GainArray, Scalar)(benchmark::State& state) {
for (auto _ : state)
{
sfz::setSIMDOpStatus(sfz::SIMDOps::gain, false);
sfz::applyGain<float>(gain, input, absl::MakeSpan(output));
}
}
@ -95,6 +98,7 @@ BENCHMARK_DEFINE_F(GainArray, Scalar)(benchmark::State& state) {
BENCHMARK_DEFINE_F(GainArray, SIMD)(benchmark::State& state) {
for (auto _ : state)
{
sfz::setSIMDOpStatus(sfz::SIMDOps::gain, true);
sfz::applyGain<float>(gain, input, absl::MakeSpan(output));
}
}
@ -102,6 +106,7 @@ BENCHMARK_DEFINE_F(GainArray, SIMD)(benchmark::State& state) {
BENCHMARK_DEFINE_F(GainArray, Scalar_Unaligned)(benchmark::State& state) {
for (auto _ : state)
{
sfz::setSIMDOpStatus(sfz::SIMDOps::gain, false);
sfz::applyGain<float>(absl::MakeSpan(gain).subspan(1), absl::MakeSpan(input).subspan(1), absl::MakeSpan(output).subspan(1));
}
}
@ -109,6 +114,7 @@ BENCHMARK_DEFINE_F(GainArray, Scalar_Unaligned)(benchmark::State& state) {
BENCHMARK_DEFINE_F(GainArray, SIMD_Unaligned)(benchmark::State& state) {
for (auto _ : state)
{
sfz::setSIMDOpStatus(sfz::SIMDOps::gain, true);
sfz::applyGain<float>(absl::MakeSpan(gain).subspan(1), absl::MakeSpan(input).subspan(1), absl::MakeSpan(output).subspan(1));
}
}