diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2017-08-18 14:23:01 +0200 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2017-08-18 14:23:01 +0200 |
commit | e9a84050dec5f941fadd8c53b4f672609885f463 (patch) | |
tree | a8ad26b77d6c8e06f51e79d0c23fef3d85311fd2 | |
parent | 20f50f4cbf225f014466963abf576a2a65976063 (diff) | |
download | dabmod-e9a84050dec5f941fadd8c53b4f672609885f463.tar.gz dabmod-e9a84050dec5f941fadd8c53b4f672609885f463.tar.bz2 dabmod-e9a84050dec5f941fadd8c53b4f672609885f463.zip |
Add restrict keyword for DPD apply_coeff
-rw-r--r-- | src/MemlessPoly.cpp | 8 |
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++) { |