@@ -180,32 +180,25 @@ function precomputeOneNodeBlocking(winLin, winTensor::Nothing, winPoly::Nothing,
180
180
return (y, tmpWin)
181
181
end
182
182
183
- @generated function shiftedWindowEntries (winLin:: Vector , idx:: T , scale, d, L:: Val{Z} ) where {T, Z}
183
+ @generated function shiftedWindowEntries (winLin:: Vector , idx, scale, d, L:: Val{Z} ) where {Z}
184
184
quote
185
185
idxInt = floor (Int,idx)
186
186
α = ( idx- idxInt )
187
187
188
- if α != zero (T)
189
- tmpWin = @ntuple $ (Z) l -> begin
190
- # Uncommented code: This is the version where we pull in l into the abs.
191
- # We pulled this out of the iteration.
192
- # idx = abs((kscale - (l-1) - off)*LUTSize)/(m)
193
-
194
- # The second +1 is because Julia has 1-based indexing
195
- # The first +1 is part of the index calculation and needs(!)
196
- # to be part of the abs. The abs is shifting to the positive interval
197
- # and this +1 matches the `floor` above, which rounds down. In turn
198
- # for positive and negative indices a different neighbour is calculated
199
- idxInt1 = abs ( idxInt - (l- 1 )* scale ) + 1
200
- idxInt2 = abs ( idxInt - (l- 1 )* scale + 1 ) + 1
201
-
202
- (winLin[idxInt1] + α * (winLin[idxInt2] - winLin[idxInt1]))
203
- end
204
- else
205
- tmpWin = @ntuple $ (Z) l -> begin
206
- idxInt1 = abs ( idxInt - (l- 1 )* scale ) + 1
207
- winLin[idxInt1]
208
- end
188
+ tmpWin = @ntuple $ (Z) l -> begin
189
+ # Uncommented code: This is the version where we pull in l into the abs.
190
+ # We pulled this out of the iteration.
191
+ # idx = abs((kscale - (l-1) - off)*LUTSize)/(m)
192
+
193
+ # The second +1 is because Julia has 1-based indexing
194
+ # The first +1 is part of the index calculation and needs(!)
195
+ # to be part of the abs. The abs is shifting to the positive interval
196
+ # and this +1 matches the `floor` above, which rounds down. In turn
197
+ # for positive and negative indices a different neighbour is calculated
198
+ idxInt1 = abs ( idxInt - (l- 1 )* scale ) + 1
199
+ idxInt2 = abs ( idxInt - (l- 1 )* scale + 1 ) + 1
200
+
201
+ (winLin[idxInt1] + α * (winLin[idxInt2] - winLin[idxInt1]))
209
202
end
210
203
return tmpWin
211
204
end
@@ -300,10 +293,10 @@ Remarks:
300
293
an error while the later variant would silently error.
301
294
"""
302
295
function precomputeLinInterp (win, m, σ, K, T)
303
- windowLinInterp = Vector {T} (undef, K+ 1 )
296
+ windowLinInterp = Vector {T} (undef, K+ 2 )
304
297
305
298
step = (m) / (K)
306
- @cthreads for l = 1 : (K+ 1 )
299
+ @cthreads for l = 1 : (K+ 2 )
307
300
y = ( (l- 1 ) * step )
308
301
windowLinInterp[l] = win (y, 1 , m, σ)
309
302
end
0 commit comments