Scope of Restrict Keyword in Inline Function - 2024.2 English - UG1603

AI Engine-ML Kernel and Graph Programming Guide (UG1603)

Document ID
UG1603
Release Date
2024-11-28
Version
2024.2 English

When there are no other accesses within the scope, declaring the restrict pointer has no performance benefits.

Figure 1. Working Example with No Performance Benefits

In a special case, you can have non-aliasing accesses, as in the following example. Here the parent pointer, p, is used but points to a different location and therefore this is acceptable.

Figure 2. Special Caseā€”Non-aliasing Accesses