@@ -110,14 +110,14 @@ function add_var!(q, argtup, gcpres, ::Type{T}, argtupname, gcpresname, k) where
110
110
end
111
111
@generated function _batch_no_reserve (
112
112
f!:: F ,
113
+ threadlocal:: Val{thread_local} ,
113
114
threadmask_tuple:: NTuple{N} ,
114
115
nthread_tuple,
115
116
torelease_tuple,
116
117
Nr,
117
118
Nd,
118
119
ulen,
119
- args:: Vararg{Any,K} ;
120
- threadlocal:: Val{thread_local} = Val (false ),
120
+ args:: Vararg{Any,K} ,
121
121
) where {F,K,N,thread_local}
122
122
q = quote
123
123
$ (Expr (:meta , :inline ))
@@ -282,12 +282,19 @@ end
282
282
# q
283
283
# end
284
284
285
+ @inline function batch (
286
+ f!:: F ,
287
+ (len, nbatches):: Tuple{Vararg{Integer,2}} ,
288
+ args:: Vararg{Any,K} ) where {F,K}
289
+
290
+ batch (f!, Val {false} (), (len, nbatches), args... )
291
+ end
285
292
286
293
@inline function batch (
287
294
f!:: F ,
295
+ threadlocal:: Val{thread_local} ,
288
296
(len, nbatches):: Tuple{Vararg{Integer,2}} ,
289
- args:: Vararg{Any,K} ;
290
- threadlocal:: Val{thread_local} = Val {false} (),
297
+ args:: Vararg{Any,K}
291
298
) where {F,K,thread_local}
292
299
# threads, torelease = request_threads(Base.Threads.threadid(), nbatches - one(nbatches))
293
300
len > 0 || return
@@ -310,14 +317,14 @@ end
310
317
Nr = ulen - Nd * nbatch
311
318
_batch_no_reserve (
312
319
f!,
320
+ threadlocal,
313
321
map (mask, threads),
314
322
nthreads,
315
323
torelease,
316
324
Nr,
317
325
Nd,
318
326
ulen,
319
- args... ;
320
- threadlocal,
327
+ args...
321
328
)
322
329
end
323
330
function batch (
0 commit comments