aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/MemlessPoly.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/MemlessPoly.cpp b/src/MemlessPoly.cpp
index 0cc04f2..6686c41 100644
--- a/src/MemlessPoly.cpp
+++ b/src/MemlessPoly.cpp
@@ -118,10 +118,14 @@ void MemlessPoly::load_coefficients(const std::string &coefFile)
}
}
+/* The restrict keyword is C99, g++ and clang++ however support __restrict
+ * instead, and this allows the compiler to auto-vectorize the loop.
+ */
+
static void apply_coeff(
const vector<complexf> &coefs,
- const complexf* in, size_t start, size_t stop,
- complexf* out)
+ const complexf *__restrict in, size_t start, size_t stop,
+ complexf *__restrict out)
{
for (size_t i = start; i < stop; i++) {