At any point in a program, an OpenMP context exists that defines traits that describe the active OpenMP constructs, the execution devices, functionality supported by the implementation and available dynamic values. The traits are grouped into trait sets. The following trait sets exist: construct, device, target_device, implementation and dynamic. Traits are categorized as name-list traits, clause-list traits, non-property traits and extension traits. This categorization determines the syntax that is used to match the trait, as defined in Section 7.2.
The construct set is composed of the directive names, each being a trait, of all enclosing constructs at that point in the program up to a target construct. Combined and composite constructs are added to the set as distinct constructs in the same nesting order specified by the original construct. Whether the dispatch construct is added to the construct set is implementation defined. If it is added, it will only be added for the target-call of the associated code. The set is ordered by nesting level in ascending order. Specifically, the ordering of the set of constructs is c1, …, cN, where c1 is the construct at the outermost nesting level and cN is the construct at the innermost nesting level. In addition, if the point in the program is not enclosed by a target construct, the following rules are applied in order:
The simd trait is a clause-list trait that is defined with properties that match the clauses accepted by the declare simd directive with the same name and semantics. The simd trait defines at least the simdlen property and one of the inbranch or notinbranch properties. Traits in the construct set other than simd are non-property traits.
The device set includes traits that define the characteristics of the device being targeted by the compiler at that point in the program. For each target device that the implementation supports, a target_device set exists that defines the characteristics of that device. At least the following traits must be defined for the device and all target_device sets:
The kind(kind-name-list) trait specifies the general kind of the device. The following kind-name values are defined:
The kind, isa and arch traits in the device and target_device sets are name-list traits.
Additionally, the target_device set defines the following trait:
The implementation set includes traits that describe the functionality supported by the OpenMP implementation at that point in the program. At least the following traits can be defined:
The vendor and extension traits in the implementation set are name-list traits.
Implementations can define additional traits in the device, target_device and implementation sets; these traits are extension traits.
The dynamic trait set includes traits that define the dynamic properties of a program at a point in its execution. The data state trait in the dynamic trait set refers to the complete data state of the program that may be accessed at runtime.