Skip to content

Commit

Permalink
no static_expr, fixes #48
Browse files Browse the repository at this point in the history
  • Loading branch information
chriselrod committed Mar 28, 2022
1 parent 10a2c67 commit 61500ed
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/StrideArrays.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ using VectorizationBase, ArrayInterface,

using VectorizationBase: align, AbstractStridedPointer, AbstractSIMDVector, StridedPointer, gesp, pause, zstridedpointer, val_dense_dims, preserve_buffer
using LoopVectorization: CloseOpen
using Static: StaticInt, Zero, One, StaticBool, True, False
using Static: StaticInt, Zero, One, StaticBool, True, False, known
using ArrayInterface: size, strides, offsets, indices,
static_length, axes, dense_dims, stride_rank, StrideIndex
using StrideArraysCore: AbstractStrideArray, AbstractStrideMatrix, AbstractStrideVector,
AbstractPtrStrideArray, PtrArray, static_expr, rank_to_sortperm,
AbstractPtrStrideArray, PtrArray, rank_to_sortperm,
StrideArray, StrideVector, StrideMatrix, similar_layout,
@gc_preserve

Expand Down
9 changes: 2 additions & 7 deletions src/broadcast.jl
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ end
if l === nothing
push!(t.args, Expr(:ref, :s, i))
else
push!(t.args, static_expr(l))
push!(t.args, StaticInt(l))
end
end
t
Expand All @@ -114,12 +114,7 @@ function Base.similar(
StrideArray{T}(undef, to_tuple(S,size(bc)))
end
@generated function to_tuple(::Type{S}) where {N,S<:Tuple{Vararg{StaticInt,N}}}
t = Expr(:tuple)
Sp = S.parameters
for i in 1:N
push!(t.args, static_expr(_extract(Sp[i])))
end
t
map(StaticInt, known(S))
end
function Base.similar(
bc::Base.Broadcast.Broadcasted{FS}, ::Type{T}
Expand Down
2 changes: 1 addition & 1 deletion src/rand.jl
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ function rand_expr(expr, args...)
for i in 2:length(expr.args)
aᵢ = expr.args[i]
if aᵢ isa Integer
push!(array.args, static_expr(Int(aᵢ)))
push!(array.args, StaticInt(Int(aᵢ)))
elseif Meta.isexpr(aᵢ, :$, 1)
push!(array.args, Expr(:call, GlobalRef(StrideArrays, :StaticInt), (only(aᵢ.args))))
else
Expand Down

2 comments on commit 61500ed

@chriselrod
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be good to know why Windows threw a ReadonlyMemoryError(), which does look like a real problem.
But does not seem deterministic, and unlikely to have been introduced by the changes since the last release.
Meanwhile, the current release is now broken because of a dep, therefore:

@JuliaRegistrator register

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/57483

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.1.16 -m "<description of version>" 61500ed5f4eaf7219dfac3bd471a3b9a68d3efe9
git push origin v0.1.16

Please sign in to comment.