You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In our original design, the UPIR DATA field includes a list of data items and each data item represents a variable and its attributes, such as sharing, mapping, write/read, and so on. To find all the variables that are shared between threads, we have to iterate all data items and check corresponding attributes.
Normally there are not too many data items, so the brute force search won't bring much overhead. If we still want to improve the implementation, we can add serval new attributes like shared and private to SgUpirDataField. Then for example, the shared attribute will holds a list of data items that are shared.
When the SgUpirDataField is constructed, a new data item will be attached as usual, but also added to the corresponding list described above. Then it is easy to find certain types of data items and avoids the brute force search.
Example
e.g. Given #pragma omp parallel shared(a) private(b)
Variables a and b will attached as data items to a data field node named x. x->get_data() returns a list including both a and b. x->get_shared() returns a list only including a. x->get_private() returns a list only including b.
Implementation
For implementation, we need to add these new attributes to the ROSETTA where the UPIR DATA field is defined. In OpenMP/OpenACC to UPIR AST constructor, we need to add a new data item to multiple lists. Then in the transformation, the helpers for querying certain types of data items should be updated based on the new attributes.
The text was updated successfully, but these errors were encountered:
Description
In our original design, the UPIR DATA field includes a list of data items and each data item represents a variable and its attributes, such as sharing, mapping, write/read, and so on. To find all the variables that are shared between threads, we have to iterate all data items and check corresponding attributes.
Normally there are not too many data items, so the brute force search won't bring much overhead. If we still want to improve the implementation, we can add serval new attributes like
shared
andprivate
toSgUpirDataField
. Then for example, theshared
attribute will holds a list of data items that are shared.When the
SgUpirDataField
is constructed, a new data item will be attached as usual, but also added to the corresponding list described above. Then it is easy to find certain types of data items and avoids the brute force search.Example
e.g. Given
#pragma omp parallel shared(a) private(b)
Variables
a
andb
will attached as data items to a data field node namedx
.x->get_data()
returns a list including botha
andb
.x->get_shared()
returns a list only includinga
.x->get_private()
returns a list only includingb
.Implementation
For implementation, we need to add these new attributes to the ROSETTA where the UPIR DATA field is defined. In OpenMP/OpenACC to UPIR AST constructor, we need to add a new data item to multiple lists. Then in the transformation, the helpers for querying certain types of data items should be updated based on the new attributes.
The text was updated successfully, but these errors were encountered: