Skip to content

Commit

Permalink
Merge pull request #20 from mike919192/fix_bench
Browse files Browse the repository at this point in the history
Reset values for benchmarks
  • Loading branch information
mike919192 authored May 13, 2024
2 parents 22f0025 + 9a5ed4f commit 7a8246b
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 16 deletions.
10 changes: 6 additions & 4 deletions test/testFFT.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -240,14 +240,16 @@ TEST_CASE("FFT benchmark", "[single-file]")

BENCHMARK("Radix2 FFT")
{
sdsp::fft_radix2(complexValues);
return complexValues;
sdsp::complex_array<1024> complexValues2 = complexValues;
sdsp::fft_radix2(complexValues2);
return complexValues2;
};

BENCHMARK("Radix4 FFT")
{
sdsp::fft_radix4(complexValues);
return complexValues;
sdsp::complex_array<1024> complexValues2 = complexValues;
sdsp::fft_radix4(complexValues2);
return complexValues2;
};

SUCCEED("Benchmark placeholder assertion");
Expand Down
30 changes: 18 additions & 12 deletions test/testIIR.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -387,14 +387,16 @@ TEST_CASE("Filter benchmarks")

BENCHMARK("Runtime configurable LP filter benchmark")
{
df.Process(data.begin(), data.end());
return data;
std::array<double, 4096> data2 = data;
df.Process(data2.begin(), data2.end());
return data2;
};

BENCHMARK("Specialized LP filter benchmark")
{
df2.process(data.begin(), data.end());
return data;
std::array<double, 4096> data2 = data;
df2.process(data2.begin(), data2.end());
return data2;
};
SUCCEED();
}
Expand All @@ -416,14 +418,16 @@ TEST_CASE("Filter benchmarks")

BENCHMARK("Runtime configurable HP filter benchmark")
{
df.Process(data.begin(), data.end());
return data;
std::array<double, 4096> data2 = data;
df.Process(data2.begin(), data2.end());
return data2;
};

BENCHMARK("Specialized HP filter benchmark")
{
df2.process(data.begin(), data.end());
return data;
std::array<double, 4096> data2 = data;
df2.process(data2.begin(), data2.end());
return data2;
};
SUCCEED();
}
Expand All @@ -445,14 +449,16 @@ TEST_CASE("Filter benchmarks")

BENCHMARK("Runtime configurable BP filter benchmark")
{
df.Process(data.begin(), data.end());
return data;
std::array<double, 4096> data2 = data;
df.Process(data2.begin(), data2.end());
return data2;
};

BENCHMARK("Specialized BP filter benchmark")
{
df2.process(data.begin(), data.end());
return data;
std::array<double, 4096> data2 = data;
df2.process(data2.begin(), data2.end());
return data2;
};
SUCCEED();
}
Expand Down

0 comments on commit 7a8246b

Please sign in to comment.