Skip to content

Bug in strides of reinterpreted array with non-unit first stride #163

@ranocha

Description

@ranocha
julia> using Revise, ArrayInterface, StaticArrays, BenchmarkHistograms; using ArrayInterface: StaticInt

julia> begin
           u_base = randn(1, 4, 4, 5)
           u_vectors = reshape(reinterpret(SVector{1, eltype(u_base)}, u_base),
                               Base.tail(size(u_base))...)
           u_view = view(u_vectors, 2, :, 3)
           u_view_reinterpreted = reinterpret(eltype(u_base), u_view)
           u_view_reshaped = reshape(u_view_reinterpreted, 1, length(u_view));
       end

julia> ArrayInterface.strides(u_view_reinterpreted)
(static(1),)

julia> ArrayInterface.strides(u_view)
(4,)

ArrayInterface.strides(u_view_reinterpreted) is wrong, it should have the same strides as u_view.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions