2121
2222namespace clang {
2323
24- // / Defines synch scope values used internally by clang.
24+ // / Defines sync scope values used internally by clang.
2525// /
2626// / 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.
3030// /
31- // / In atomic builtin and expressions, language-specific synch scope enums are
31+ // / In atomic builtin and expressions, language-specific sync scope enums are
3232// / used. Currently only OpenCL memory scope enums are supported and assumed
3333// / 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
3535// / values are represented by class AtomicScopeModel and its derived classes.
3636// /
3737// / To add a new enum value:
@@ -88,39 +88,39 @@ inline llvm::StringRef getAsString(SyncScope S) {
8888 case SyncScope::OpenCLSubGroup:
8989 return " opencl_subgroup" ;
9090 }
91- llvm_unreachable (" Invalid synch scope" );
91+ llvm_unreachable (" Invalid sync scope" );
9292}
9393
9494// / Defines the kind of atomic scope models.
9595enum class AtomicScopeModelKind { None, OpenCL, HIP, Generic };
9696
97- // / Defines the interface for synch scope model.
97+ // / Defines the interface for sync scope model.
9898class AtomicScopeModel {
9999public:
100100 virtual ~AtomicScopeModel () {}
101- // / Maps language specific synch scope values to internal
101+ // / Maps language specific sync scope values to internal
102102 // / SyncScope enum.
103103 virtual SyncScope map (unsigned S) const = 0;
104104
105- // / Check if the compile-time constant synch scope value
105+ // / Check if the compile-time constant sync scope value
106106 // / is valid.
107107 virtual bool isValid (unsigned S) const = 0;
108108
109- // / Get all possible synch scope values that might be
109+ // / Get all possible sync scope values that might be
110110 // / encountered at runtime for the current language.
111111 virtual ArrayRef<unsigned > getRuntimeValues () const = 0;
112112
113113 // / 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.
116116 virtual unsigned getFallBackValue () const = 0;
117117
118118 // / Create an atomic scope model by AtomicScopeModelKind.
119119 // / \return an empty std::unique_ptr for AtomicScopeModelKind::None.
120120 static std::unique_ptr<AtomicScopeModel> create (AtomicScopeModelKind K);
121121};
122122
123- // / Defines the synch scope model for OpenCL.
123+ // / Defines the sync scope model for OpenCL.
124124class AtomicScopeOpenCLModel : public AtomicScopeModel {
125125public:
126126 // / The enum values match the pre-defined macros
@@ -147,7 +147,7 @@ class AtomicScopeOpenCLModel : public AtomicScopeModel {
147147 case SubGroup:
148148 return SyncScope::OpenCLSubGroup;
149149 }
150- llvm_unreachable (" Invalid language synch scope value" );
150+ llvm_unreachable (" Invalid language sync scope value" );
151151 }
152152
153153 bool isValid (unsigned S) const override {
@@ -156,7 +156,7 @@ class AtomicScopeOpenCLModel : public AtomicScopeModel {
156156 }
157157
158158 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" );
160160 static const unsigned Scopes[] = {
161161 static_cast <unsigned >(WorkGroup), static_cast <unsigned >(Device),
162162 static_cast <unsigned >(AllSVMDevices), static_cast <unsigned >(SubGroup)};
@@ -168,7 +168,7 @@ class AtomicScopeOpenCLModel : public AtomicScopeModel {
168168 }
169169};
170170
171- // / Defines the synch scope model for HIP.
171+ // / Defines the sync scope model for HIP.
172172class AtomicScopeHIPModel : public AtomicScopeModel {
173173public:
174174 // / The enum values match the pre-defined macros
@@ -198,7 +198,7 @@ class AtomicScopeHIPModel : public AtomicScopeModel {
198198 case System:
199199 return SyncScope::HIPSystem;
200200 }
201- llvm_unreachable (" Invalid language synch scope value" );
201+ llvm_unreachable (" Invalid language sync scope value" );
202202 }
203203
204204 bool isValid (unsigned S) const override {
@@ -207,7 +207,7 @@ class AtomicScopeHIPModel : public AtomicScopeModel {
207207 }
208208
209209 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" );
211211 static const unsigned Scopes[] = {
212212 static_cast <unsigned >(SingleThread), static_cast <unsigned >(Wavefront),
213213 static_cast <unsigned >(Workgroup), static_cast <unsigned >(Agent),
0 commit comments