4 ms·
Is it? You just add "restrict" where needed? https://godbolt.org/z/jva4shbjs https://godbolt.org/z/jva4shbjs
by uecker 10mo ago
Is it? You just add "restrict" where needed?
https://godbolt.org/z/jva4shbjs https://godbolt.org/z/jva4shbjs
- adev_ 10mo ago> Is it? You just add "restrict" where needed? Yes. That is the main solution and it is not a good one. 1- `restrict` need to be used carefully. Putting it everywhere in large codebase can lead to pretty tricky bugs if aliasing does occurs under the hood. 1- Restrict is not an official keyword in C++. C++ always has refused to standardize it because it plays terribly with almost any object model.
- uecker 10mo agoRegarding "restrict", I don't think one puts it everywhere, just for certain numerical loops which otherwise are not vectorized should be sufficient. FORTRAN seems even more dangerous to me. IMHO a better solution would be to have explicit notation for vectorized operations. Hopefully we will get this in C. Otherwise, I am very happy with C for numerics, especially with variably modified typs. For C++, yes, I agree.