@@ -121,6 +121,8 @@ function groupsize end
121
121
122
122
"""
123
123
@localmem T dims
124
+
125
+ Declare storage that is local to a workgroup.
124
126
"""
125
127
macro localmem (T, dims)
126
128
# Stay in sync with CUDAnative
133
135
134
136
"""
135
137
@private T dims
138
+
139
+ Declare storage that is local to each item in the workgroup. This can be safely used
140
+ across [`@synchronize`](@ref) statements. On a CPU, this will allocate additional implicit
141
+ dimensions to ensure correct localization.
142
+
143
+ For storage that only persists between `@synchronize` statements, an `MArray` can be used
144
+ instead.
145
+
146
+ See also [`@uniform`](@ref).
136
147
"""
137
148
macro private (T, dims)
138
149
quote
@@ -141,14 +152,17 @@ macro private(T, dims)
141
152
end
142
153
143
154
"""
144
- @uniform value
155
+ @uniform expr
156
+
157
+ `expr` is evaluated outside the workitem scope. This is useful for variable declarations
158
+ that span workitems, or are reused across `@synchronize` statements.
145
159
"""
146
160
macro uniform (value)
147
161
esc (value)
148
162
end
149
163
150
164
"""
151
- @synchronize()
165
+ @synchronize()
152
166
153
167
After a `@synchronize` statement all read and writes to global and local memory
154
168
from each thread in the workgroup are visible in from all other threads in the
@@ -161,7 +175,7 @@ macro synchronize()
161
175
end
162
176
163
177
"""
164
- @synchronize(cond)
178
+ @synchronize(cond)
165
179
166
180
After a `@synchronize` statement all read and writes to global and local memory
167
181
from each thread in the workgroup are visible in from all other threads in the
@@ -178,7 +192,7 @@ macro synchronize(cond)
178
192
end
179
193
180
194
"""
181
- @print(items...)
195
+ @print(items...)
182
196
183
197
This is a unified print statement.
184
198
@@ -220,7 +234,7 @@ macro print(items...)
220
234
end
221
235
222
236
"""
223
- @index
237
+ @index
224
238
225
239
The `@index` macro can be used to give you the index of a workitem within a kernel
226
240
function. It supports both the production of a linear index or a cartesian index.
0 commit comments