21
21
22
22
namespace clang {
23
23
24
- // / Defines synch scope values used internally by clang.
24
+ // / Defines sync scope values used internally by clang.
25
25
// /
26
26
// / The enum values start from 0 and are contiguous. They are mainly used for
27
- // / enumerating all supported synch scope values and mapping them to LLVM
28
- // / synch scopes. Their numerical values may be different from the corresponding
29
- // / synch scope enums used in source languages.
27
+ // / enumerating all supported sync scope values and mapping them to LLVM
28
+ // / sync scopes. Their numerical values may be different from the corresponding
29
+ // / sync scope enums used in source languages.
30
30
// /
31
- // / In atomic builtin and expressions, language-specific synch scope enums are
31
+ // / In atomic builtin and expressions, language-specific sync scope enums are
32
32
// / used. Currently only OpenCL memory scope enums are supported and assumed
33
33
// / to be used by all languages. However, in the future, other languages may
34
- // / define their own set of synch scope enums. The language-specific synch scope
34
+ // / define their own set of sync scope enums. The language-specific sync scope
35
35
// / values are represented by class AtomicScopeModel and its derived classes.
36
36
// /
37
37
// / To add a new enum value:
@@ -88,39 +88,39 @@ inline llvm::StringRef getAsString(SyncScope S) {
88
88
case SyncScope::OpenCLSubGroup:
89
89
return " opencl_subgroup" ;
90
90
}
91
- llvm_unreachable (" Invalid synch scope" );
91
+ llvm_unreachable (" Invalid sync scope" );
92
92
}
93
93
94
94
// / Defines the kind of atomic scope models.
95
95
enum class AtomicScopeModelKind { None, OpenCL, HIP, Generic };
96
96
97
- // / Defines the interface for synch scope model.
97
+ // / Defines the interface for sync scope model.
98
98
class AtomicScopeModel {
99
99
public:
100
100
virtual ~AtomicScopeModel () {}
101
- // / Maps language specific synch scope values to internal
101
+ // / Maps language specific sync scope values to internal
102
102
// / SyncScope enum.
103
103
virtual SyncScope map (unsigned S) const = 0;
104
104
105
- // / Check if the compile-time constant synch scope value
105
+ // / Check if the compile-time constant sync scope value
106
106
// / is valid.
107
107
virtual bool isValid (unsigned S) const = 0;
108
108
109
- // / Get all possible synch scope values that might be
109
+ // / Get all possible sync scope values that might be
110
110
// / encountered at runtime for the current language.
111
111
virtual ArrayRef<unsigned > getRuntimeValues () const = 0;
112
112
113
113
// / If atomic builtin function is called with invalid
114
- // / synch scope value at runtime, it will fall back to a valid
115
- // / synch scope value returned by this function.
114
+ // / sync scope value at runtime, it will fall back to a valid
115
+ // / sync scope value returned by this function.
116
116
virtual unsigned getFallBackValue () const = 0;
117
117
118
118
// / Create an atomic scope model by AtomicScopeModelKind.
119
119
// / \return an empty std::unique_ptr for AtomicScopeModelKind::None.
120
120
static std::unique_ptr<AtomicScopeModel> create (AtomicScopeModelKind K);
121
121
};
122
122
123
- // / Defines the synch scope model for OpenCL.
123
+ // / Defines the sync scope model for OpenCL.
124
124
class AtomicScopeOpenCLModel : public AtomicScopeModel {
125
125
public:
126
126
// / The enum values match the pre-defined macros
@@ -147,7 +147,7 @@ class AtomicScopeOpenCLModel : public AtomicScopeModel {
147
147
case SubGroup:
148
148
return SyncScope::OpenCLSubGroup;
149
149
}
150
- llvm_unreachable (" Invalid language synch scope value" );
150
+ llvm_unreachable (" Invalid language sync scope value" );
151
151
}
152
152
153
153
bool isValid (unsigned S) const override {
@@ -156,7 +156,7 @@ class AtomicScopeOpenCLModel : public AtomicScopeModel {
156
156
}
157
157
158
158
ArrayRef<unsigned > getRuntimeValues () const override {
159
- static_assert (Last == SubGroup, " Does not include all synch scopes" );
159
+ static_assert (Last == SubGroup, " Does not include all sync scopes" );
160
160
static const unsigned Scopes[] = {
161
161
static_cast <unsigned >(WorkGroup), static_cast <unsigned >(Device),
162
162
static_cast <unsigned >(AllSVMDevices), static_cast <unsigned >(SubGroup)};
@@ -168,7 +168,7 @@ class AtomicScopeOpenCLModel : public AtomicScopeModel {
168
168
}
169
169
};
170
170
171
- // / Defines the synch scope model for HIP.
171
+ // / Defines the sync scope model for HIP.
172
172
class AtomicScopeHIPModel : public AtomicScopeModel {
173
173
public:
174
174
// / The enum values match the pre-defined macros
@@ -198,7 +198,7 @@ class AtomicScopeHIPModel : public AtomicScopeModel {
198
198
case System:
199
199
return SyncScope::HIPSystem;
200
200
}
201
- llvm_unreachable (" Invalid language synch scope value" );
201
+ llvm_unreachable (" Invalid language sync scope value" );
202
202
}
203
203
204
204
bool isValid (unsigned S) const override {
@@ -207,7 +207,7 @@ class AtomicScopeHIPModel : public AtomicScopeModel {
207
207
}
208
208
209
209
ArrayRef<unsigned > getRuntimeValues () const override {
210
- static_assert (Last == System, " Does not include all synch scopes" );
210
+ static_assert (Last == System, " Does not include all sync scopes" );
211
211
static const unsigned Scopes[] = {
212
212
static_cast <unsigned >(SingleThread), static_cast <unsigned >(Wavefront),
213
213
static_cast <unsigned >(Workgroup), static_cast <unsigned >(Agent),
0 commit comments