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

Allow compression of Base.FastContiguousSubArray #80

Open
mkitti opened this issue Mar 20, 2021 · 1 comment
Open

Allow compression of Base.FastContiguousSubArray #80

mkitti opened this issue Mar 20, 2021 · 1 comment

Comments

@mkitti
Copy link
Member

mkitti commented Mar 20, 2021

Currently Blosc.jl allows for compression of DenseArrays that are contiguous. Besides being contiguous, the main requirement for an AbstractArray is the applicability of pointer.

  1. Base.FastContiguousSubArray satisfies contiguity and has method pointer.
julia> Base.FastContiguousSubArray
SubArray{T,N,P,I,true} where I<:Union{Tuple{Vararg{Real,N} where N}, Tuple{AbstractUnitRange,Vararg{Any,N} where N}} where P where N where T

julia> hasmethod(pointer, (Base.FastContiguousSubArray,))
true
  1. SIMD.FastContiguousArray also satisfies contiguity and has method pointer
julia> using SIMD

julia> SIMD.FastContiguousArray
Union{DenseArray{T,N}, Base.ReinterpretArray{T,N,T2,A} where A<:Union{DenseArray{T2,N}, SubArray{T2,N,P,I,true} where I<:Union{Tuple{Vararg{Real,N} where N}, Tuple{AbstractUnitRange,Vararg{Any,N} where N}} where P} where T2, SubArray{T,N,P,I,true} where I<:Union{Tuple{Vararg{Real,N} where N}, Tuple{AbstractUnitRange,Vararg{Any,N} where N}} where P} where N where T

julia> hasmethod(pointer, (SIMD.FastContiguousArray,))
true

https://github.com/eschnett/SIMD.jl/blob/master/src/arrayops.jl#L40-L42

Could we widen the compress, compress!, decompress, and decompress! methods to include these types, perhaps in place of DenseArray?

@musm
Copy link
Member

musm commented Feb 3, 2022

Are there requirements on the array stride (= 1)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants