Corrected formatting
This commit is contained in:
parent
dcc8a58377
commit
2e6402bae0
6 changed files with 61 additions and 58 deletions
|
|
@ -14,7 +14,8 @@
|
|||
|
||||
class MultiplyAddFixedGain : public benchmark::Fixture {
|
||||
public:
|
||||
void SetUp(const ::benchmark::State& state) {
|
||||
void SetUp(const ::benchmark::State& state)
|
||||
{
|
||||
std::random_device rd {};
|
||||
std::mt19937 gen { rd() };
|
||||
std::uniform_real_distribution<float> dist { 0, 1 };
|
||||
|
|
@ -25,8 +26,8 @@ public:
|
|||
std::generate(input.begin(), input.end(), [&]() { return dist(gen); });
|
||||
}
|
||||
|
||||
void TearDown(const ::benchmark::State& state [[maybe_unused]]) {
|
||||
|
||||
void TearDown(const ::benchmark::State& state [[maybe_unused]])
|
||||
{
|
||||
}
|
||||
|
||||
float gain = {};
|
||||
|
|
@ -34,38 +35,43 @@ public:
|
|||
std::vector<float> output;
|
||||
};
|
||||
|
||||
BENCHMARK_DEFINE_F(MultiplyAddFixedGain, Straight)(benchmark::State& state) {
|
||||
for (auto _ : state)
|
||||
BENCHMARK_DEFINE_F(MultiplyAddFixedGain, Straight)
|
||||
(benchmark::State& state)
|
||||
{
|
||||
for (auto _ : state) {
|
||||
for (int i = 0; i < state.range(0); ++i)
|
||||
output[i] += gain * input[i];
|
||||
}
|
||||
}
|
||||
|
||||
BENCHMARK_DEFINE_F(MultiplyAddFixedGain, Scalar)(benchmark::State& state) {
|
||||
for (auto _ : state)
|
||||
BENCHMARK_DEFINE_F(MultiplyAddFixedGain, Scalar)
|
||||
(benchmark::State& state)
|
||||
{
|
||||
for (auto _ : state) {
|
||||
sfz::multiplyAdd<float, false>(gain, input, absl::MakeSpan(output));
|
||||
}
|
||||
}
|
||||
|
||||
BENCHMARK_DEFINE_F(MultiplyAddFixedGain, SIMD)(benchmark::State& state) {
|
||||
for (auto _ : state)
|
||||
BENCHMARK_DEFINE_F(MultiplyAddFixedGain, SIMD)
|
||||
(benchmark::State& state)
|
||||
{
|
||||
for (auto _ : state) {
|
||||
sfz::multiplyAdd<float, true>(gain, input, absl::MakeSpan(output));
|
||||
}
|
||||
}
|
||||
|
||||
BENCHMARK_DEFINE_F(MultiplyAddFixedGain, Scalar_Unaligned)(benchmark::State& state) {
|
||||
for (auto _ : state)
|
||||
BENCHMARK_DEFINE_F(MultiplyAddFixedGain, Scalar_Unaligned)
|
||||
(benchmark::State& state)
|
||||
{
|
||||
for (auto _ : state) {
|
||||
sfz::multiplyAdd<float, false>(gain, absl::MakeSpan(input).subspan(1), absl::MakeSpan(output).subspan(1));
|
||||
}
|
||||
}
|
||||
|
||||
BENCHMARK_DEFINE_F(MultiplyAddFixedGain, SIMD_Unaligned)(benchmark::State& state) {
|
||||
for (auto _ : state)
|
||||
BENCHMARK_DEFINE_F(MultiplyAddFixedGain, SIMD_Unaligned)
|
||||
(benchmark::State& state)
|
||||
{
|
||||
for (auto _ : state) {
|
||||
sfz::multiplyAdd<float, true>(gain, absl::MakeSpan(input).subspan(1), absl::MakeSpan(output).subspan(1));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -245,12 +245,9 @@ void sfz::Synth::handleEffectOpcodes(const std::vector<Opcode>& members)
|
|||
unsigned busIndex;
|
||||
if (busName.empty() || busName == "main")
|
||||
busIndex = 0;
|
||||
else if (busName.size() > 2 && busName.substr(0, 2) == "fx" &&
|
||||
absl::SimpleAtoi(busName.substr(2), &busIndex) &&
|
||||
busIndex >= 1 && busIndex <= config::maxEffectBuses) {
|
||||
else if (busName.size() > 2 && busName.substr(0, 2) == "fx" && absl::SimpleAtoi(busName.substr(2), &busIndex) && busIndex >= 1 && busIndex <= config::maxEffectBuses) {
|
||||
// an effect bus fxN, with N usually in [1,4]
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
DBG("Unsupported effect bus: " << busName);
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue