Skip to content

Commit

Permalink
nothing special here
Browse files Browse the repository at this point in the history
  • Loading branch information
sannysanoff committed May 18, 2024
1 parent e9f8cb3 commit 354d114
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions core/src/utils/arrays.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -636,17 +636,17 @@ namespace dsp {

// add scalar to all items
FloatArray add(const FloatArray& v, float e) {
auto retval = std::make_shared<std::vector<float>>();
if (false) {
retval->reserve(v->size());
for (auto d : *v) {
retval->emplace_back(d + e);
}
}
else {
retval->resize(v->size());
volk_32f_s32f_add_32f(retval->data(), v->data(), e, v->size());
auto retval = std::make_shared<std::vector<float>>(v->size(), 0);
#ifndef VOLK_VERSION
int limit = (int)v->size();
auto* src = v->data();
auto* dst = retval->data();
for (int i=0; i<limit; i++) {
dst[i] = src[i] + e;
}
#else
volk_32f_s32f_add_32f(retval->data(), v->data(), e, v->size());
#endif
return retval;
}

Expand Down

0 comments on commit 354d114

Please sign in to comment.