@@ -3686,21 +3686,51 @@ struct OmpAllocateClause {
3686
3686
std::tuple<MODIFIERS(), OmpObjectList> t;
3687
3687
};
3688
3688
3689
- // OMP 5.0 2.4 atomic-default-mem-order-clause ->
3690
- // ATOMIC_DEFAULT_MEM_ORDER (SEQ_CST | ACQ_REL |
3691
- // RELAXED)
3689
+ // Ref: [5.0:60-63], [5.1:83-86], [5.2:210-213]
3690
+ //
3691
+ // atomic-default-mem-order-clause ->
3692
+ // ATOMIC_DEFAULT_MEM_ORDER(memory-order) // since 5.0
3693
+ // memory-order ->
3694
+ // SEQ_CST | ACQ_REL | RELAXED | // since 5.0
3695
+ // ACQUIRE | RELEASE // since 5.2
3692
3696
struct OmpAtomicDefaultMemOrderClause {
3693
- WRAPPER_CLASS_BOILERPLATE (
3694
- OmpAtomicDefaultMemOrderClause, common::OmpAtomicDefaultMemOrderType);
3697
+ using MemoryOrder = common::OmpAtomicDefaultMemOrderType;
3698
+ WRAPPER_CLASS_BOILERPLATE (OmpAtomicDefaultMemOrderClause, MemoryOrder);
3699
+ };
3700
+
3701
+ // Ref: [5.0:128-131], [5.1:151-154], [5.2:258-259]
3702
+ //
3703
+ // bind-clause ->
3704
+ // BIND(binding) // since 5.0
3705
+ // binding ->
3706
+ // TEAMS | PARALLEL | THREAD // since 5.0
3707
+ struct OmpBindClause {
3708
+ ENUM_CLASS (Binding, Parallel, Teams, Thread)
3709
+ WRAPPER_CLASS_BOILERPLATE (OmpBindClause, Binding);
3695
3710
};
3696
3711
3697
- // 2.15.3.1 default-clause -> DEFAULT (PRIVATE | FIRSTPRIVATE | SHARED | NONE)
3712
+ // Ref: [4.5:46-50], [5.0:74-78], [5.1:92-96], [5.2:109]
3713
+ //
3714
+ // default-clause ->
3715
+ // DEFAULT(data-sharing-attribute) // since 4.5
3716
+ // data-sharing-attribute ->
3717
+ // SHARED | NONE | // since 4.5
3718
+ // PRIVATE | FIRSTPRIVATE // since 5.0
3698
3719
struct OmpDefaultClause {
3699
- ENUM_CLASS (Type , Private, Firstprivate, Shared, None)
3700
- WRAPPER_CLASS_BOILERPLATE (OmpDefaultClause, Type );
3720
+ ENUM_CLASS (DataSharingAttribute , Private, Firstprivate, Shared, None)
3721
+ WRAPPER_CLASS_BOILERPLATE (OmpDefaultClause, DataSharingAttribute );
3701
3722
};
3702
3723
3703
- // 2.15.5.2 defaultmap -> DEFAULTMAP (implicit-behavior[:variable-category])
3724
+ // Ref: [4.5:103-107], [5.0:324-325], [5.1:357-358], [5.2:161-162]
3725
+ //
3726
+ // defaultmap-clause ->
3727
+ // DEFAULTMAP(implicit-behavior
3728
+ // [: variable-category]) // since 5.0
3729
+ // implicit-behavior ->
3730
+ // TOFROM | // since 4.5
3731
+ // ALLOC | TO | FROM | FIRSTPRIVATE | NONE |
3732
+ // DEFAULT | // since 5.0
3733
+ // PRESENT // since 5.1
3704
3734
struct OmpDefaultmapClause {
3705
3735
TUPLE_CLASS_BOILERPLATE (OmpDefaultmapClause);
3706
3736
ENUM_CLASS (
@@ -3709,23 +3739,35 @@ struct OmpDefaultmapClause {
3709
3739
std::tuple<ImplicitBehavior, MODIFIERS()> t;
3710
3740
};
3711
3741
3712
- // 2.13.9 iteration-offset -> +/- non-negative-constant
3742
+ // Ref: [4.5:169-172], [5.0:255-259], [5.1:288-292], [5.2:91-93]
3743
+ //
3744
+ // iteration-offset ->
3745
+ // +|- non-negative-constant // since 4.5
3713
3746
struct OmpIterationOffset {
3714
3747
TUPLE_CLASS_BOILERPLATE (OmpIterationOffset);
3715
3748
std::tuple<DefinedOperator, ScalarIntConstantExpr> t;
3716
3749
};
3717
3750
3718
- // 2.13.9 iteration -> induction-variable [iteration-offset]
3751
+ // Ref: [4.5:169-172], [5.0:255-259], [5.1:288-292], [5.2:91-93]
3752
+ //
3753
+ // iteration ->
3754
+ // induction-variable [iteration-offset] // since 4.5
3719
3755
struct OmpIteration {
3720
3756
TUPLE_CLASS_BOILERPLATE (OmpIteration);
3721
3757
std::tuple<Name, std::optional<OmpIterationOffset>> t;
3722
3758
};
3723
3759
3760
+ // Ref: [4.5:169-172], [5.0:255-259], [5.1:288-292], [5.2:91-93]
3761
+ //
3762
+ // iteration-vector ->
3763
+ // [iteration...] // since 4.5
3724
3764
WRAPPER_CLASS (OmpIterationVector, std::list<OmpIteration>);
3725
3765
3726
3766
// Extract this into a separate structure (instead of having it directly in
3727
3767
// OmpDoacrossClause), so that the context in TYPE_CONTEXT_PARSER can be set
3728
3768
// separately for OmpDependClause and OmpDoacrossClause.
3769
+ //
3770
+ // See: depend-clause, doacross-clause
3729
3771
struct OmpDoacross {
3730
3772
OmpDependenceType::Value GetDepType () const ;
3731
3773
@@ -3735,15 +3777,15 @@ struct OmpDoacross {
3735
3777
std::variant<Sink, Source> u;
3736
3778
};
3737
3779
3738
- // Ref: [4.5:169-170 ], [5.0:255-256 ], [5.1:288-289 ], [5.2:323-324 ]
3780
+ // Ref: [4.5:169-172 ], [5.0:255-259 ], [5.1:288-292 ], [5.2:323-326 ]
3739
3781
//
3740
3782
// depend-clause ->
3741
- // DEPEND(SOURCE) | // since 4.5, until 5.1
3742
- // DEPEND(SINK: iteration-vector) | // since 4.5, until 5.1
3783
+ // DEPEND(SOURCE) | // since 4.5, until 5.1
3784
+ // DEPEND(SINK: iteration-vector) | // since 4.5, until 5.1
3743
3785
// DEPEND([depend-modifier,]
3744
- // task-dependence-type: locator-list) // since 4.5
3786
+ // task-dependence-type: locator-list) // since 4.5
3745
3787
//
3746
- // depend-modifier -> iterator-modifier // since 5.0
3788
+ // depend-modifier -> iterator-modifier // since 5.0
3747
3789
struct OmpDependClause {
3748
3790
UNION_CLASS_BOILERPLATE (OmpDependClause);
3749
3791
struct TaskDep {
@@ -3755,6 +3797,10 @@ struct OmpDependClause {
3755
3797
std::variant<TaskDep, OmpDoacross> u;
3756
3798
};
3757
3799
3800
+ // Ref: [5.2:326-328]
3801
+ //
3802
+ // doacross-clause ->
3803
+ // DOACROSS(dependence-type: iteration-vector) // since 5.2
3758
3804
WRAPPER_CLASS (OmpDoacrossClause, OmpDoacross);
3759
3805
3760
3806
// Ref: [5.0:254-255], [5.1:287-288], [5.2:73]
@@ -3764,25 +3810,41 @@ WRAPPER_CLASS(OmpDoacrossClause, OmpDoacross);
3764
3810
// DESTROY(variable) // since 5.2
3765
3811
WRAPPER_CLASS (OmpDestroyClause, OmpObject);
3766
3812
3767
- // device([ device-modifier :] scalar-integer-expression)
3813
+ // Ref: [5.0:135-140], [5.1:161-166], [5.2:265-266]
3814
+ //
3815
+ // detach-clause ->
3816
+ // DETACH(event-handle) // since 5.0
3817
+ struct OmpDetachClause {
3818
+ WRAPPER_CLASS_BOILERPLATE (OmpDetachClause, OmpObject);
3819
+ };
3820
+
3821
+ // Ref: [4.5:103-107], [5.0:170-176], [5.1:197-205], [5.2:276-277]
3822
+ //
3823
+ // device-clause ->
3824
+ // DEVICE(scalar-integer-expression) | // since 4.5
3825
+ // DEVICE([device-modifier:]
3826
+ // scalar-integer-expression) // since 5.0
3768
3827
struct OmpDeviceClause {
3769
3828
TUPLE_CLASS_BOILERPLATE (OmpDeviceClause);
3770
3829
ENUM_CLASS (DeviceModifier, Ancestor, Device_Num)
3771
3830
std::tuple<std::optional<DeviceModifier>, ScalarIntExpr> t;
3772
3831
};
3773
3832
3774
- // device_type(any | host | nohost)
3833
+ // Ref: [5.0:180-185], [5.1:210-216], [5.2:275]
3834
+ //
3835
+ // device-type-clause ->
3836
+ // DEVICE_TYPE(ANY | HOST | NOHOST) // since 5.0
3775
3837
struct OmpDeviceTypeClause {
3776
- ENUM_CLASS (Type , Any, Host, Nohost)
3777
- WRAPPER_CLASS_BOILERPLATE (OmpDeviceTypeClause, Type );
3838
+ ENUM_CLASS (DeviceTypeDescription , Any, Host, Nohost)
3839
+ WRAPPER_CLASS_BOILERPLATE (OmpDeviceTypeClause, DeviceTypeDescription );
3778
3840
};
3779
3841
3780
3842
// Ref: [4.5:107-109], [5.0:176-180], [5.1:205-210], [5.2:167-168]
3781
3843
//
3782
3844
// from-clause ->
3783
3845
// FROM(locator-list) |
3784
- // FROM(mapper-modifier: locator-list) | // since 5.0
3785
- // FROM(motion-modifier[,] ...: locator-list) // since 5.1
3846
+ // FROM(mapper-modifier: locator-list) | // since 5.0
3847
+ // FROM(motion-modifier[,] ...: locator-list) // since 5.1
3786
3848
// motion-modifier ->
3787
3849
// PRESENT | mapper-modifier | iterator-modifier
3788
3850
struct OmpFromClause {
@@ -3806,11 +3868,6 @@ struct OmpIfClause {
3806
3868
std::tuple<std::optional<DirectiveNameModifier>, ScalarLogicalExpr> t;
3807
3869
};
3808
3870
3809
- // OpenMPv5.2 12.5.2 detach-clause -> DETACH (event-handle)
3810
- struct OmpDetachClause {
3811
- WRAPPER_CLASS_BOILERPLATE (OmpDetachClause, OmpObject);
3812
- };
3813
-
3814
3871
// OMP 5.0 2.19.5.6 in_reduction-clause -> IN_REDUCTION (reduction-identifier:
3815
3872
// variable-name-list)
3816
3873
struct OmpInReductionClause {
@@ -3878,10 +3935,16 @@ struct OmpOrderClause {
3878
3935
std::tuple<MODIFIERS(), Ordering> t;
3879
3936
};
3880
3937
3881
- // 2.5 proc-bind-clause -> PROC_BIND (MASTER | CLOSE | SPREAD)
3938
+ // Ref: [4.5:46-50], [5.0:74-78], [5.1:92-96], [5.2:229-230]
3939
+ //
3940
+ // proc-bind-clause ->
3941
+ // PROC_BIND(affinity-policy) // since 4.5
3942
+ // affinity-policy ->
3943
+ // CLOSE | PRIMARY | SPREAD | // since 4.5
3944
+ // MASTER // since 4.5, until 5.2
3882
3945
struct OmpProcBindClause {
3883
- ENUM_CLASS (Type , Close, Master, Spread, Primary)
3884
- WRAPPER_CLASS_BOILERPLATE (OmpProcBindClause, Type );
3946
+ ENUM_CLASS (AffinityPolicy , Close, Master, Spread, Primary)
3947
+ WRAPPER_CLASS_BOILERPLATE (OmpProcBindClause, AffinityPolicy );
3885
3948
};
3886
3949
3887
3950
// Ref: [4.5:201-207], [5.0:300-302], [5.1:332-334], [5.2:134-137]
@@ -3945,13 +4008,6 @@ struct OmpUpdateClause {
3945
4008
std::variant<OmpDependenceType, OmpTaskDependenceType> u;
3946
4009
};
3947
4010
3948
- // OMP 5.2 11.7.1 bind-clause ->
3949
- // BIND( PARALLEL | TEAMS | THREAD )
3950
- struct OmpBindClause {
3951
- ENUM_CLASS (Type, Parallel, Teams, Thread)
3952
- WRAPPER_CLASS_BOILERPLATE (OmpBindClause, Type);
3953
- };
3954
-
3955
4011
// OpenMP Clauses
3956
4012
struct OmpClause {
3957
4013
UNION_CLASS_BOILERPLATE (OmpClause);
0 commit comments