BrainDynamicsUSYD / nftsim

C++ library for simulation of multiscale neural field dynamics
Apache License 2.0
30 stars 24 forks source link

Review and remove/replace the __restrict__ keyword from stencil. #154

Open stuart-knock opened 6 years ago

stuart-knock commented 6 years ago

The underscore form of keywords such as __restrict__ are compiler extensions and so not in general portable, so we don't really want to be using them.

In practice, the instance in question here seems to be widely supported and so not causing us any problem. However, it should be reviewed and if possible replaced with something that is standard to C++11 that achieves the same purpose. C99 introduced a restrict keyword, and so it may be a simple substitution, but that needs to be verified.

As a starting point see: http://cellperformance.beyond3d.com/articles/2006/05/demystifying-the-restrict-keyword.html http://assemblyrequired.crashworks.org/load-hit-stores-and-the-__restrict-keyword/ http://en.cppreference.com/w/c/language/restrict