You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: ext/MatrixAlgebraKitAMDGPUExt/MatrixAlgebraKitAMDGPUExt.jl
+21-21Lines changed: 21 additions & 21 deletions
Original file line number
Diff line number
Diff line change
@@ -21,31 +21,31 @@ function MatrixAlgebraKit.default_lq_algorithm(::Type{T}; kwargs...) where {T <:
21
21
qr_alg =ROCSOLVER_HouseholderQR(; kwargs...)
22
22
returnLQViaTransposedQR(qr_alg)
23
23
end
24
-
function MatrixAlgebraKit.default_svd_algorithm(::Type{T}; kwargs...) where {T<:StridedROCMatrix}
24
+
function MatrixAlgebraKit.default_svd_algorithm(::Type{T}; kwargs...) where {T<:StridedROCMatrix}
25
25
returnROCSOLVER_QRIteration(; kwargs...)
26
26
end
27
-
function MatrixAlgebraKit.default_eig_algorithm(::Type{T}; kwargs...) where {T<:StridedROCMatrix}
28
-
throw(ErrorException("AMDGPU has no support for general eigensolving"))
27
+
function MatrixAlgebraKit.default_eig_algorithm(::Type{T}; kwargs...) where {T<:StridedROCMatrix}
28
+
throw(ErrorException("AMDGPU has no support for general eigensolving"))
29
29
end
30
30
function MatrixAlgebraKit.default_eigh_algorithm(::Type{T}; kwargs...) where {T <:StridedROCMatrix}
31
31
returnROCSOLVER_DivideAndConquer(; kwargs...)
32
32
end
33
33
34
34
# include for block sector support
35
-
function MatrixAlgebraKit.default_qr_algorithm(::Type{Base.ReshapedArray{T,2,SubArray{T,1,A,Tuple{UnitRange{Int}},true},Tuple{}}}; kwargs...) where {T<:BlasFloat, A<:ROCVecOrMat{T}}
35
+
function MatrixAlgebraKit.default_qr_algorithm(::Type{Base.ReshapedArray{T,2, SubArray{T,1, A, Tuple{UnitRange{Int}},true},Tuple{}}}; kwargs...) where {T<:BlasFloat, A<:ROCVecOrMat{T}}
36
36
returnROCSOLVER_HouseholderQR(; kwargs...)
37
37
end
38
-
function MatrixAlgebraKit.default_lq_algorithm(::Type{Base.ReshapedArray{T,2,SubArray{T,1,A,Tuple{UnitRange{Int}},true},Tuple{}}}; kwargs...) where {T<:BlasFloat, A<:ROCVecOrMat{T}}
38
+
function MatrixAlgebraKit.default_lq_algorithm(::Type{Base.ReshapedArray{T,2, SubArray{T,1, A, Tuple{UnitRange{Int}},true},Tuple{}}}; kwargs...) where {T<:BlasFloat, A<:ROCVecOrMat{T}}
39
39
qr_alg =ROCSOLVER_HouseholderQR(; kwargs...)
40
40
returnLQViaTransposedQR(qr_alg)
41
41
end
42
-
function MatrixAlgebraKit.default_svd_algorithm(::Type{Base.ReshapedArray{T,2,SubArray{T,1,A,Tuple{UnitRange{Int}},true},Tuple{}}}; kwargs...) where {T<:BlasFloat, A<:ROCVecOrMat{T}}
42
+
function MatrixAlgebraKit.default_svd_algorithm(::Type{Base.ReshapedArray{T,2, SubArray{T,1, A, Tuple{UnitRange{Int}},true},Tuple{}}}; kwargs...) where {T<:BlasFloat, A<:ROCVecOrMat{T}}
43
43
returnROCSOLVER_Jacobi(; kwargs...)
44
44
end
45
-
function MatrixAlgebraKit.default_eig_algorithm(::Type{Base.ReshapedArray{T,2,SubArray{T,1,A,Tuple{UnitRange{Int}},true},Tuple{}}}; kwargs...) where {T<:BlasFloat, A<:ROCVecOrMat{T}}
46
-
throw(ErrorException("AMDGPU has no support for general eigensolving"))
45
+
function MatrixAlgebraKit.default_eig_algorithm(::Type{Base.ReshapedArray{T,2, SubArray{T,1, A, Tuple{UnitRange{Int}},true},Tuple{}}}; kwargs...) where {T<:BlasFloat, A<:ROCVecOrMat{T}}
46
+
throw(ErrorException("AMDGPU has no support for general eigensolving"))
47
47
end
48
-
function MatrixAlgebraKit.default_eigh_algorithm(::Type{Base.ReshapedArray{T,2,SubArray{T,1,A,Tuple{UnitRange{Int}},true},Tuple{}}}; kwargs...) where {T<:BlasFloat, A<:ROCVecOrMat{T}}
48
+
function MatrixAlgebraKit.default_eigh_algorithm(::Type{Base.ReshapedArray{T,2, SubArray{T,1, A, Tuple{UnitRange{Int}},true},Tuple{}}}; kwargs...) where {T<:BlasFloat, A<:ROCVecOrMat{T}}
49
49
returnROCSOLVER_DivideAndConquer(; kwargs...)
50
50
end
51
51
@@ -107,7 +107,7 @@ function _project_hermitian_diag_kernel(A, B, ::Val{true})
107
107
j > n &&return
108
108
@inboundsbegin
109
109
for i in1:(j -1)
110
-
val = (A[i, j] -adjoint(A[j, i])) /2
110
+
val = (A[i, j] -adjoint(A[j, i])) /2
111
111
B[i, j] = val
112
112
B[j, i] =-adjoint(val)
113
113
end
@@ -135,22 +135,22 @@ function MatrixAlgebraKit._project_hermitian_offdiag!(
Copy file name to clipboardExpand all lines: ext/MatrixAlgebraKitCUDAExt/MatrixAlgebraKitCUDAExt.jl
+22-22Lines changed: 22 additions & 22 deletions
Original file line number
Diff line number
Diff line change
@@ -16,38 +16,38 @@ using CUDA: i32
16
16
17
17
include("yacusolver.jl")
18
18
19
-
function MatrixAlgebraKit.default_qr_algorithm(::Type{T}; kwargs...) where {TT<:BlasFloat, T<:StridedCuMatrix{TT}}
19
+
function MatrixAlgebraKit.default_qr_algorithm(::Type{T}; kwargs...) where {TT<:BlasFloat, T<:StridedCuMatrix{TT}}
20
20
returnCUSOLVER_HouseholderQR(; kwargs...)
21
21
end
22
-
function MatrixAlgebraKit.default_lq_algorithm(::Type{T}; kwargs...) where {TT<:BlasFloat, T<:StridedCuMatrix{TT}}
22
+
function MatrixAlgebraKit.default_lq_algorithm(::Type{T}; kwargs...) where {TT<:BlasFloat, T<:StridedCuMatrix{TT}}
23
23
qr_alg =CUSOLVER_HouseholderQR(; kwargs...)
24
24
returnLQViaTransposedQR(qr_alg)
25
25
end
26
-
function MatrixAlgebraKit.default_svd_algorithm(::Type{T}; kwargs...) where {TT<:BlasFloat, T<:StridedCuMatrix{TT}}
26
+
function MatrixAlgebraKit.default_svd_algorithm(::Type{T}; kwargs...) where {TT<:BlasFloat, T<:StridedCuMatrix{TT}}
27
27
returnCUSOLVER_QRIteration(; kwargs...)
28
28
end
29
-
function MatrixAlgebraKit.default_eig_algorithm(::Type{T}; kwargs...) where {TT<:BlasFloat, T<:StridedCuMatrix{TT}}
29
+
function MatrixAlgebraKit.default_eig_algorithm(::Type{T}; kwargs...) where {TT<:BlasFloat, T<:StridedCuMatrix{TT}}
30
30
returnCUSOLVER_Simple(; kwargs...)
31
31
end
32
-
function MatrixAlgebraKit.default_eigh_algorithm(::Type{T}; kwargs...) where {TT<:BlasFloat, T<:StridedCuMatrix{TT}}
32
+
function MatrixAlgebraKit.default_eigh_algorithm(::Type{T}; kwargs...) where {TT<:BlasFloat, T<:StridedCuMatrix{TT}}
33
33
returnCUSOLVER_DivideAndConquer(; kwargs...)
34
34
end
35
35
36
36
# include for block sector support
37
-
function MatrixAlgebraKit.default_qr_algorithm(::Type{Base.ReshapedArray{T,2,SubArray{T,1,A,Tuple{UnitRange{Int}},true},Tuple{}}}; kwargs...) where {T<:BlasFloat, A<:CuVecOrMat{T}}
37
+
function MatrixAlgebraKit.default_qr_algorithm(::Type{Base.ReshapedArray{T,2, SubArray{T,1, A, Tuple{UnitRange{Int}},true},Tuple{}}}; kwargs...) where {T<:BlasFloat, A<:CuVecOrMat{T}}
38
38
returnCUSOLVER_HouseholderQR(; kwargs...)
39
39
end
40
-
function MatrixAlgebraKit.default_lq_algorithm(::Type{Base.ReshapedArray{T,2,SubArray{T,1,A,Tuple{UnitRange{Int}},true},Tuple{}}}; kwargs...) where {T<:BlasFloat, A<:CuVecOrMat{T}}
40
+
function MatrixAlgebraKit.default_lq_algorithm(::Type{Base.ReshapedArray{T,2, SubArray{T,1, A, Tuple{UnitRange{Int}},true},Tuple{}}}; kwargs...) where {T<:BlasFloat, A<:CuVecOrMat{T}}
41
41
qr_alg =CUSOLVER_HouseholderQR(; kwargs...)
42
42
returnLQViaTransposedQR(qr_alg)
43
43
end
44
-
function MatrixAlgebraKit.default_svd_algorithm(::Type{Base.ReshapedArray{T,2,SubArray{T,1,A,Tuple{UnitRange{Int}},true},Tuple{}}}; kwargs...) where {T<:BlasFloat, A<:CuVecOrMat{T}}
44
+
function MatrixAlgebraKit.default_svd_algorithm(::Type{Base.ReshapedArray{T,2, SubArray{T,1, A, Tuple{UnitRange{Int}},true},Tuple{}}}; kwargs...) where {T<:BlasFloat, A<:CuVecOrMat{T}}
45
45
returnCUSOLVER_Jacobi(; kwargs...)
46
46
end
47
-
function MatrixAlgebraKit.default_eig_algorithm(::Type{Base.ReshapedArray{T,2,SubArray{T,1,A,Tuple{UnitRange{Int}},true},Tuple{}}}; kwargs...) where {T<:BlasFloat, A<:CuVecOrMat{T}}
47
+
function MatrixAlgebraKit.default_eig_algorithm(::Type{Base.ReshapedArray{T,2, SubArray{T,1, A, Tuple{UnitRange{Int}},true},Tuple{}}}; kwargs...) where {T<:BlasFloat, A<:CuVecOrMat{T}}
48
48
returnCUSOLVER_Simple(; kwargs...)
49
49
end
50
-
function MatrixAlgebraKit.default_eigh_algorithm(::Type{Base.ReshapedArray{T,2,SubArray{T,1,A,Tuple{UnitRange{Int}},true},Tuple{}}}; kwargs...) where {T<:BlasFloat, A<:CuVecOrMat{T}}
50
+
function MatrixAlgebraKit.default_eigh_algorithm(::Type{Base.ReshapedArray{T,2, SubArray{T,1, A, Tuple{UnitRange{Int}},true},Tuple{}}}; kwargs...) where {T<:BlasFloat, A<:CuVecOrMat{T}}
51
51
returnCUSOLVER_DivideAndConquer(; kwargs...)
52
52
end
53
53
@@ -112,7 +112,7 @@ function _project_hermitian_diag_kernel(A, B, ::Val{true})
112
112
j > n &&return
113
113
@inboundsbegin
114
114
for i in1i32:(j -1i32)
115
-
val = (A[i, j] -adjoint(A[j, i])) /2
115
+
val = (A[i, j] -adjoint(A[j, i])) /2
116
116
B[i, j] = val
117
117
B[j, i] =-adjoint(val)
118
118
end
@@ -140,22 +140,22 @@ function MatrixAlgebraKit._project_hermitian_offdiag!(
0 commit comments