From e9a84050dec5f941fadd8c53b4f672609885f463 Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Fri, 18 Aug 2017 14:23:01 +0200 Subject: Add restrict keyword for DPD apply_coeff --- src/MemlessPoly.cpp | 8 ++++++-- 1 file 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 &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++) { -- cgit v1.2.3