Skip to content

Support mul!(Diagonal, A, B)#2977

Merged
maleadt merged 1 commit into
masterfrom
ksh/diagmul
Nov 19, 2025
Merged

Support mul!(Diagonal, A, B)#2977
maleadt merged 1 commit into
masterfrom
ksh/diagmul

Conversation

@kshyatt

@kshyatt kshyatt commented Nov 18, 2025

Copy link
Copy Markdown
Member

No description provided.

@kshyatt kshyatt added the cuda array Stuff about CuArray. label Nov 18, 2025
@github-actions

github-actions Bot commented Nov 18, 2025

Copy link
Copy Markdown
Contributor

Your PR requires formatting changes to meet the project's style guidelines.
Please consider running Runic (git runic master) to apply these changes.

Click here to view the suggested changes.
diff --git a/lib/cublas/linalg.jl b/lib/cublas/linalg.jl
index ea027edab..613d3329b 100644
--- a/lib/cublas/linalg.jl
+++ b/lib/cublas/linalg.jl
@@ -537,8 +537,8 @@ function LinearAlgebra.mul!(C::CuMatrix{T}, A::Diagonal{T,<:CuVector}, B::Adjoin
     return C
 end
 
-function LinearAlgebra.mul!(C::Diagonal{T, <:CuVector}, A::Union{<:CuMatrix{T}, Adjoint{T, <:CuMatrix}, Transpose{T, <:CuMatrix}}, B::Union{<:CuMatrix{T}, Adjoint{T, <:CuMatrix}, Transpose{T, <:CuMatrix}}) where {T<:CublasFloat}
-    Cfull   = A*B
+function LinearAlgebra.mul!(C::Diagonal{T, <:CuVector}, A::Union{<:CuMatrix{T}, Adjoint{T, <:CuMatrix}, Transpose{T, <:CuMatrix}}, B::Union{<:CuMatrix{T}, Adjoint{T, <:CuMatrix}, Transpose{T, <:CuMatrix}}) where {T <: CublasFloat}
+    Cfull = A * B
     C.diag .= diag(Cfull)
     return C
 end
diff --git a/test/libraries/cublas/extensions.jl b/test/libraries/cublas/extensions.jl
index f181b7f29..9e08ba7e0 100644
--- a/test/libraries/cublas/extensions.jl
+++ b/test/libraries/cublas/extensions.jl
@@ -585,13 +585,13 @@ k = 13
             @test Array(d_AX) ≈ A' * Diagonal(x)
 
             @test Array(d_X) == Diagonal(Array(d_x))
-            
+
             d_X = Diagonal(copy(d_x))
             diagA = diagm(rand(elty, m))
             d_diagA = CuArray(diagA)
             diagB = diagm(rand(elty, m))
             d_diagB = CuArray(diagB)
-            diagAdiagB  = diagA * diagB'
+            diagAdiagB = diagA * diagB'
             mul!(d_X, d_diagA, d_diagB')
             @test Diagonal(collect(d_X.diag)) ≈ Diagonal(diagAdiagB)
         end

@codecov

codecov Bot commented Nov 19, 2025

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.34%. Comparing base (1d1be49) to head (43a6241).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2977      +/-   ##
==========================================
- Coverage   89.36%   89.34%   -0.02%     
==========================================
  Files         150      150              
  Lines       13115    13119       +4     
==========================================
+ Hits        11720    11721       +1     
- Misses       1395     1398       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@maleadt maleadt merged commit 11bed80 into master Nov 19, 2025
3 checks passed
@maleadt maleadt deleted the ksh/diagmul branch November 19, 2025 07:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cuda array Stuff about CuArray.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants