News for hackers. Stuff that matters.
Re:CUDA Pro Tip: Optimize for Pointer Aliasing by Shugyousha on Friday August 22, 2014 @11:46AM (#8212600)
If I remember correctly, the C99 standard forbids pointer aliasing. That means if you use a C99-standard-conform compiler, it will automatically assume that you do not alias any pointers (and produce more efficient code). Making sure that you actually do NOT alias any pointers is up to the programmer of course (there exist compiler warning options that can detect such aliasing though)...
Re:CUDA Pro Tip: Optimize for Pointer Aliasing by DannyBee on Friday August 22, 2014 @02:44PM (#8213372)
"If I remember correctly, the C99 standard forbids pointer aliasing. "

No, it doesn't :) It forbids some forms of type casting if they are later dereferenced, but that's not really the same.

Re:CUDA Pro Tip: Optimize for Pointer Aliasing by readerrrr on Friday August 22, 2014 @01:37PM (#8213078)
You may not alias incompatible types. In the example every type passed in the function is the same. Float. Those types are compatible( every type is to itself ) and may alias. Therefore the need to use restrict.