File tree Expand file tree Collapse file tree 2 files changed +14
-7
lines changed Expand file tree Collapse file tree 2 files changed +14
-7
lines changed Original file line number Diff line number Diff line change @@ -119,12 +119,16 @@ function split(stmts)
119
119
120
120
loops = WorkgroupLoop[]
121
121
for stmt in stmts. args
122
- if isexpr (stmt, :macrocall ) && stmt. args[1 ] === Symbol (" @synchronize" )
123
- loop = WorkgroupLoop (deepcopy (indicies), current, allocations)
124
- push! (loops, loop)
125
- allocations = Any[]
126
- current = Any[]
127
- continue
122
+ if isexpr (stmt, :macrocall )
123
+ if stmt. args[1 ] === Symbol (" @synchronize" )
124
+ loop = WorkgroupLoop (deepcopy (indicies), current, allocations)
125
+ push! (loops, loop)
126
+ allocations = Any[]
127
+ current = Any[]
128
+ continue
129
+ elseif stmt. args[1 ] === Symbol (" @uniform" )
130
+ push! (allocations, stmt)
131
+ end
128
132
elseif isexpr (stmt, :(= ))
129
133
rhs = stmt. args[2 ]
130
134
if isexpr (rhs, :macrocall )
Original file line number Diff line number Diff line change 8
8
9
9
@kernel function localmem (A)
10
10
N = @uniform prod (groupsize ())
11
+ @uniform begin
12
+ N2 = prod (groupsize ())
13
+ end
11
14
I = @index (Global, Linear)
12
15
i = @index (Local, Linear)
13
16
lmem = @localmem Int (N,) # Ok iff groupsize is static
14
17
lmem[i] = i
15
18
@synchronize
16
- A[I] = lmem[N - i + 1 ]
19
+ A[I] = lmem[N2 - i + 1 ]
17
20
end
18
21
19
22
function harness (backend, ArrayT)
You can’t perform that action at this time.
0 commit comments