<p dir="auto">Similar to <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="400995157" data-permission-text="Title is private" data-url="https://github.com/JuliaLang/julia/issues/30765" data-hovercard-type="issue" data-hovercard-url="/JuliaLang/julia/issues/30765/hovercard" href="https://github.com/JuliaLang/julia/issues/30765">#30765</a>.<br>
An eazy example:</p>
<div class="highlight highlight-source-julia notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="julia&gt; a = collect(1.0:5.0)
5-element Vector{Float64}:
 1.0
 2.0
 3.0
 4.0
 5.0

julia&gt; v = view(a, 3:-1:1)
3-element view(::Vector{Float64}, 3:-1:1) with eltype Float64:
 3.0
 2.0
 1.0

julia&gt; BLAS.nrm2(v)
7.0710678118654755

julia&gt; BLAS.nrm2(collect(v))
3.7416573867739413"><pre class="notranslate">julia<span class="pl-k">&gt;</span> a <span class="pl-k">=</span> <span class="pl-c1">collect</span>(<span class="pl-c1">1.0</span><span class="pl-k">:</span><span class="pl-c1">5.0</span>)
<span class="pl-c1">5</span><span class="pl-k">-</span>element Vector{Float64}<span class="pl-k">:</span>
 <span class="pl-c1">1.0</span>
 <span class="pl-c1">2.0</span>
 <span class="pl-c1">3.0</span>
 <span class="pl-c1">4.0</span>
 <span class="pl-c1">5.0</span>

julia<span class="pl-k">&gt;</span> v <span class="pl-k">=</span> <span class="pl-c1">view</span>(a, <span class="pl-c1">3</span><span class="pl-k">:</span><span class="pl-k">-</span><span class="pl-c1">1</span><span class="pl-k">:</span><span class="pl-c1">1</span>)
<span class="pl-c1">3</span><span class="pl-k">-</span>element <span class="pl-c1">view</span>(<span class="pl-k">::</span><span class="pl-c1">Vector{Float64}</span>, <span class="pl-c1">3</span><span class="pl-k">:</span><span class="pl-k">-</span><span class="pl-c1">1</span><span class="pl-k">:</span><span class="pl-c1">1</span>) with eltype Float64<span class="pl-k">:</span>
 <span class="pl-c1">3.0</span>
 <span class="pl-c1">2.0</span>
 <span class="pl-c1">1.0</span>

julia<span class="pl-k">&gt;</span> BLAS<span class="pl-k">.</span><span class="pl-c1">nrm2</span>(v)
<span class="pl-c1">7.0710678118654755</span>

julia<span class="pl-k">&gt;</span> BLAS<span class="pl-k">.</span><span class="pl-c1">nrm2</span>(<span class="pl-c1">collect</span>(v))
<span class="pl-c1">3.7416573867739413</span></pre></div>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="M = [2. 3.; 0. 0.] 
a = [1.,2.,3.]

v = view(a,3:-1:2)
@test M * v ≈ M * Vector(v)"><pre lang="using" class="notranslate"><code class="notranslate">M = [2. 3.; 0. 0.] 
a = [1.,2.,3.]

v = view(a,3:-1:2)
@test M * v ≈ M * Vector(v)
</code></pre></div>
<p dir="auto">should pass but fails<br>
<code class="notranslate">Evaluated: [9.0, 0.0] ≈ [12.0, 0.0]</code></p>
<p dir="auto">Found while looking at <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="709529202" data-permission-text="Title is private" data-url="https://github.com/JuliaLang/julia/issues/37767" data-hovercard-type="issue" data-hovercard-url="/JuliaLang/julia/issues/37767/hovercard" href="https://github.com/JuliaLang/julia/issues/37767">#37767</a>, present on a recent 1.7.0-DEV, and 1.4.1.</p>
<p dir="auto">Looking at LinearAlgebra/blas.jl, it seems there might be more functions which do not correctly handle negative stride yet, that is, the case of a StridedVector being a SubArray.</p>
<p dir="auto">For the above example, there should be a fix similar to PR <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="812277941" data-permission-text="Title is private" data-url="https://github.com/JuliaLang/julia/issues/39751" data-hovercard-type="pull_request" data-hovercard-url="/JuliaLang/julia/pull/39751/hovercard" href="https://github.com/JuliaLang/julia/pull/39751">#39751</a>. If so, one should probably add an inline function computing the pointer to the first element (in the sense of having the lowest address in memory) of a StridedVector, and use this function  when BLAS.dgemv is called for StridedVectors (and make the change from <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="812277941" data-permission-text="Title is private" data-url="https://github.com/JuliaLang/julia/issues/39751" data-hovercard-type="pull_request" data-hovercard-url="/JuliaLang/julia/pull/39751/hovercard" href="https://github.com/JuliaLang/julia/pull/39751">#39751</a> use this function, too/take the code from there).</p>
<p dir="auto">Warning: This is based on the assumption that the step size can be negative in the BLAS function.<br>
Reading <a href="https://github.com/xianyi/OpenBLAS/blob/f6e4cf2f9dac6f90b36f49659d883767d63791f5/lapack-netlib/BLAS/SRC/dgemv.f">dgemv.f</a>, I got the impression that negative strides are supported for dgemv in OpenBLAS StridedVector's.<br>
Also page 40 of <a href="http://netlib.org/blas/blast-forum/blas-report.pdf" rel="nofollow">blas-report.pdf</a> sounds like other BLAS functions should support negative stride for vectors.</p>