HOME
| OPENMP API Specification: Version 5.0 November 2018

2.3.3  Matching and Scoring Context Selectors

A given context selector is compatible with a given OpenMP context if the following conditions are satisfied:

Some properties of the simd selector have special rules to match the properties of the simd trait:

Among compatible context selectors, a score is computed using the following algorithm:

1.
Each trait that appears in the construct trait set in the OpenMP context is given the value 2p-1 where p is the position of the construct trait, cp, in the set;
2.
The kind, arch, and isa selectors are given the values 2l, 2l+1 and 2l+2, respectively, where l is the number of traits in the construct set;
3.
Traits for which a trait-score is specified are given the value specified by the trait-score score-expression;
4.
The values given to any additional selectors allowed by the implementation are implemented defined;
5.
Other selectors are given a value of zero; and
6.
A context selector that is a strict subset of another context selector has a score of zero. For other context selectors, the final score is the sum of the values of all specified selectors plus 1. If the traits that correspond to the construct selectors appear multiple times in the OpenMP context, the highest valued subset of traits that contains all selectors in the same order are used.