Skip to content

Use indices instead of stride in default_blasmul #259

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

Merged
merged 1 commit into from
Mar 16, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions src/muladd.jl
Original file line number Diff line number Diff line change
Expand Up @@ -221,13 +221,10 @@ function _default_blasmul!(::IndexLinear, α, A::AbstractMatrix, B::AbstractVect
rmul!(C, β)
(nA == 0 || mB == 0) && return C

Astride = size(A, 1) # use size, not stride, since its not pointer arithmetic

@inbounds for k in colsupport(B,1)
aoffs = (k-1)*Astride
b = B[k]
for i = 1:mA
C[i] += A[aoffs + i] * b * α
b = B[k] * α
for i in colsupport(A,k)
C[i] += A[i,k] * b
end
end

Expand All @@ -245,7 +242,7 @@ function _default_blasmul!(::IndexCartesian, α, A::AbstractMatrix, B::AbstractV

@inbounds for k in colsupport(B,1)
b = B[k] * α
for i = colsupport(A,k)
for i in colsupport(A,k)
C[i] += A[i,k] * b
end
end
Expand Down
Loading