diff --git a/Project.toml b/Project.toml index 9c55dd8..166e3d3 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "Polyester" uuid = "f517fe37-dbe3-4b94-8317-1923a5111588" authors = ["Chris Elrod and contributors"] -version = "0.7.2" +version = "0.7.3" [deps] ArrayInterface = "4fba245c-0d91-5ea0-9b3e-6abc04ee57a9" @@ -11,7 +11,6 @@ IfElse = "615f187c-cbe4-4ef1-ba3b-2fcf58d6d173" ManualMemory = "d125e4d3-2237-4719-b19c-fa641b8a4667" PolyesterWeave = "1d0040c9-8b98-4ee7-8388-3f51789ca0ad" Requires = "ae029012-a4dd-5104-9daa-d747884805df" -Static = "aedffcd0-7271-4cad-89d0-dc628f76c6d3" StrideArraysCore = "7792a7ef-975c-4747-a70f-980b88e8d1da" ThreadingUtilities = "8290d209-cae3-49c0-8002-c8c24d57dab5" @@ -23,7 +22,6 @@ IfElse = "0.1" ManualMemory = "0.1.3" PolyesterWeave = "0.1.8, 0.2" Requires = "1" -Static = "0.7, 0.8" StrideArraysCore = "0.3.11, 0.4" ThreadingUtilities = "0.5" julia = "1.6" diff --git a/src/Polyester.jl b/src/Polyester.jl index 2d94745..b5b90e3 100644 --- a/src/Polyester.jl +++ b/src/Polyester.jl @@ -9,7 +9,6 @@ import ArrayInterface using ArrayInterface: static_length, static_step, static_first, size using StrideArraysCore: object_and_preserve using ManualMemory: Reference -using Static using Requires using PolyesterWeave: request_threads, diff --git a/src/batch.jl b/src/batch.jl index 8ac93c4..5f79b1a 100644 --- a/src/batch.jl +++ b/src/batch.jl @@ -25,7 +25,7 @@ end @cfunction($(Expr(:$, :bc)), Cvoid, (Ptr{UInt},)) end end - return Expr(:block, Expr(:meta,:inline), q) + return Expr(:block, Expr(:meta, :inline), q) end # @inline function batch_closure(f::F, args::A, ::Val{C}) where {F,A,C} # bc = BatchClosure{F,A,C}(f) @@ -283,8 +283,9 @@ end @inline function batch( f!::F, - (len, nbatches)::Tuple{Vararg{Union{StaticInt,Integer},2}}, - args::Vararg{Any,K}) where {F,K} + (len, nbatches)::Tuple{Vararg{Any,2}}, + args::Vararg{Any,K}, +) where {F,K} batch(f!, Val{false}(), (len, nbatches), args...) end @@ -292,8 +293,8 @@ end @inline function batch( f!::F, threadlocal::Val{thread_local}, - (len, nbatches)::Tuple{Vararg{Union{StaticInt,Integer},2}}, - args::Vararg{Any,K} + (len, nbatches)::Tuple{Vararg{Any,2}}, + args::Vararg{Any,K}, ) where {F,K,thread_local} # threads, torelease = request_threads(Base.Threads.threadid(), nbatches - one(nbatches)) len > 0 || return @@ -323,12 +324,12 @@ end Nr, Nd, ulen, - args... + args..., ) end function batch( f!::F, - (len, nbatches, reserve_per_worker)::Tuple{Vararg{Union{StaticInt,Integer},3}}, + (len, nbatches, reserve_per_worker)::Tuple{Vararg{Any,3}}, args::Vararg{Any,K}; threadlocal::Val{thread_local} = Val(false), ) where {F,K,thread_local} diff --git a/src/closure.jl b/src/closure.jl index 7a811eb..31cdd24 100644 --- a/src/closure.jl +++ b/src/closure.jl @@ -329,9 +329,9 @@ function enclose( # push!(threadtup.args, :(min($iter_leng, cld($num_thread_expr, $reserve_per))), reserve_per) # end else - il = :(div( - $iter_leng, - $(minbatchsize isa Int ? StaticInt(minbatchsize) : esc(minbatchsize)), + il = :(Base.sdiv_int( + Int($iter_leng)::Int, + $(minbatchsize isa Int ? minbatchsize : :(Int($(esc(minbatchsize)))::Int)), )) # if reserve_per ≤ 0 push!(threadtup.args, :(min($il, $num_thread_expr)))