@@ -109,10 +109,10 @@ function _vmap_singlethread!(
109
109
nothing
110
110
end
111
111
112
- abstract type AbstractVmapClosure{NonTemporal,F,D,N,A<: Tuple{Vararg{StridedPointer ,N}} } <: Function end
112
+ abstract type AbstractVmapClosure{NonTemporal,F,D,N,A<: Tuple{Vararg{Any ,N}} } <: Function end
113
113
struct VmapClosure{NonTemporal,F,D,N,A} <: AbstractVmapClosure{NonTemporal,F,D,N,A}
114
114
f:: F
115
- function VmapClosure {NonTemporal} (f:: F , :: D , :: A ) where {NonTemporal,F,D,N,A<: Tuple{Vararg{StridedPointer ,N}} }
115
+ function VmapClosure {NonTemporal} (f:: F , :: D , :: A ) where {NonTemporal,F,D,N,A<: Tuple{Vararg{Any ,N}} }
116
116
new {NonTemporal,F,D,N,A} (f)
117
117
end
118
118
end
160
160
end
161
161
end
162
162
163
- @inline function vmap_closure (f:: F , ptry:: D , ptrargs:: A , :: Val{NonTemporal} ) where {F,D<: StridedPointer ,N,A<: Tuple{Vararg{StridedPointer ,N}} ,NonTemporal}
163
+ @inline function vmap_closure (f:: F , ptry:: D , ptrargs:: A , :: Val{NonTemporal} ) where {F,D<: StridedPointer ,N,A<: Tuple{Vararg{Any ,N}} ,NonTemporal}
164
164
vmc = VmapClosure {NonTemporal} (f, ptry, ptrargs)
165
165
@cfunction ($ vmc, Cvoid, (Ptr{UInt},))
166
166
end
@@ -354,25 +354,25 @@ BenchmarkTools.Trial:
354
354
function vmapnt! (
355
355
f:: F , y:: AbstractArray , args:: Vararg{AbstractArray,A}
356
356
) where {F,A}
357
- if check_args (y, args... ) && all_dense (y, args... )
358
- gc_preserve_vmap! (f, y, Val {true} (), Val {false} (), args... )
359
- else
360
- map! (f, y, args... )
361
- end
357
+ if check_args (y, args... ) && all_dense (y, args... )
358
+ gc_preserve_vmap! (f, y, Val {true} (), Val {false} (), args... )
359
+ else
360
+ map! (f, y, args... )
361
+ end
362
362
end
363
363
364
364
"""
365
365
vmapntt!(::Function, dest, args...)
366
366
A threaded variant of [`vmapnt!`](@ref).
367
367
"""
368
368
function vmapntt! (
369
- f:: F , y:: AbstractArray , args:: Vararg{AbstractArray,A}
369
+ f:: F , y:: AbstractArray , args:: Vararg{AbstractArray,A}
370
370
) where {F,A}
371
- if check_args (y, args... ) && all_dense (y, args... )
372
- gc_preserve_vmap! (f, y, Val {true} (), Val {true} (), args... )
373
- else
374
- map! (f, y, args... )
375
- end
371
+ if check_args (y, args... ) && all_dense (y, args... )
372
+ gc_preserve_vmap! (f, y, Val {true} (), Val {true} (), args... )
373
+ else
374
+ map! (f, y, args... )
375
+ end
376
376
end
377
377
378
378
# generic fallbacks
382
382
@inline vmapntt! (f, args... ) = map! (f, args... )
383
383
384
384
function vmap_call (f:: F , vm!:: V , args:: Vararg{Any,N} ) where {V,F,N}
385
- T = Base. _return_type (f, Base. Broadcast. eltypes (args))
386
- dest = similar (first (args), T)
387
- vm! (f, dest, args... )
385
+ T = Base. _return_type (f, Base. Broadcast. eltypes (args))
386
+ dest = similar (first (args), T)
387
+ vm! (f, dest, args... )
388
388
end
389
389
390
390
"""
0 commit comments