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

Not always a DenseArray!!! #45

Open
chriselrod opened this issue Nov 26, 2023 · 1 comment
Open

Not always a DenseArray!!! #45

chriselrod opened this issue Nov 26, 2023 · 1 comment

Comments

@chriselrod
Copy link
Member

Unfortunately, Julia Base has only limited use of traits.

DenseArray for opting into/out of BLAS/LAPACK is instead part of a type tree.

The fix (other than switching Base to a trait-based approach) is to define two separate type trees within StrideArraysCore, one for dense instances, and the other for non.

Currently, all subtype dense.
There is already a precendent for libraries doing this even when not valid for BLAS https://github.com/JuliaGPU/GPUArrays.jl/blob/6becb4fdfe213d327acab47225595ad9df785dfd/src/device/abstractarray.jl#L15
so probably not the end of the world to lie for now.

On the other hand, not lying has serious consequences JuliaSIMD/Polyester.jl#127

@chriselrod
Copy link
Member Author

Related, StridedMatrix implies columns are contiguous.

julia> A isa StridedMatrix
true

julia> A' isa StridedMatrix
false

julia> transpose(A') isa StridedMatrix
true

julia> PtrArray(A) isa StridedMatrix
true

julia> PtrArray(A') isa StridedMatrix
true

julia> PtrArray(A)' isa StridedMatrix
true

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

1 participant