Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop Static.jl as a dependency #100

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "Polyester"
uuid = "f517fe37-dbe3-4b94-8317-1923a5111588"
authors = ["Chris Elrod <[email protected]> and contributors"]
version = "0.7.2"
version = "0.7.3"

[deps]
ArrayInterface = "4fba245c-0d91-5ea0-9b3e-6abc04ee57a9"
Expand All @@ -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"

Expand All @@ -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"
Expand Down
1 change: 0 additions & 1 deletion src/Polyester.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
15 changes: 8 additions & 7 deletions src/batch.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -283,17 +283,18 @@ 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

@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
Expand Down Expand Up @@ -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}
Expand Down
6 changes: 3 additions & 3 deletions src/closure.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)))
Expand Down