What's the difference between LinearAlgebra.axpy! and BLAS.axpy!, and which one should packages extend?

BLAS sounds too low level, so intuitively I would think it’s LinearAlgebra.axpy! that packages should extend. However, what is the intended difference between the two? And when should one use one over the other?

julia> VERSION
v"1.9.0-alpha1"

julia> LinearAlgebra.axpy! === BLAS.axpy!
false

makes it sound like BLAS.axpy! is meant for strided arrays. Is this the distinction?

Edit: After reading some more, it seems BLAS.axpy! will necessarily call BLAS, whereas LinearAlgebra.axpy! is more liberal in what it does. It may choose to call BLAS.axpy! if a suitable BLAS call exists.

2 Likes