Benefits of Using Restrict for Read/Modify/Write Loops - 2020.2 English

Versal ACAP AI Engine Programming Environment User Guide (UG1076)

Document ID
UG1076
Release Date
2020-11-24
Version
2020.2 English

The following example works without the restrict keyword, but has poor performance.

Figure 1. Example Without restrict Keyword

Adding the restrict keyword allows every iteration to access a different location where there is no aliasing between iterations (restrict) and aliasing within iterations preserved by data dependency. The increased parallelization results in improved performance.

Figure 2. Add restrict Keyword