Skip to content

Commit 2479c64

Browse files
committed
Add herk! and syrk!
1 parent 16a5b76 commit 2479c64

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

lib/mkl/linalg.jl

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,3 +172,23 @@ LinearAlgebra.generic_trimatdiv!(C::oneStridedMatrix{T}, uploc, isunitc, tfun::F
172172
trsm!('L', uploc, tfun === identity ? 'N' : tfun === transpose ? 'T' : 'C', isunitc, one(T), A, C === B ? C : copyto!(C, B))
173173
LinearAlgebra.generic_mattridiv!(C::oneStridedMatrix{T}, uploc, isunitc, tfun::Function, A::oneStridedMatrix{T}, B::oneStridedMatrix{T}) where {T<:onemklFloat} =
174174
trsm!('R', uploc, tfun === identity ? 'N' : tfun === transpose ? 'T' : 'C', isunitc, one(T), B, C === A ? C : copyto!(C, A))
175+
176+
#
177+
# BLAS extensions
178+
#
179+
180+
# Extend LinearAlgebra.BLAS.herk! to dispatch to oneAPI implementation
181+
for (elty) in ([Float32, ComplexF32], [Float64, ComplexF64])
182+
@eval begin
183+
LinearAlgebra.BLAS.herk!(uplo::Char, trans::Char, alpha::$elty[1], A::oneStridedVecOrMat{$elty[2]}, beta::$elty[1], C::oneStridedMatrix{$elty[2]}) =
184+
herk!(uplo, trans, alpha, A, beta, C)
185+
end
186+
end
187+
188+
# Extend LinearAlgebra.BLAS.syrk! to dispatch to oneAPI implementation
189+
for (elty) in (Float32, Float64, ComplexF32, ComplexF64)
190+
@eval begin
191+
LinearAlgebra.BLAS.syrk!(uplo::Char, trans::Char, alpha::$elty, A::oneStridedVecOrMat{$elty}, beta::$elty, C::oneStridedMatrix{$elty}) =
192+
syrk!(uplo, trans, alpha, A, beta, C)
193+
end
194+
end

0 commit comments

Comments
 (0)