Skip to content

Commit 386fc8d

Browse files
committed
Make sure batched_eigh is marked as supporting ragged batches
1 parent b5aad00 commit 386fc8d

3 files changed

Lines changed: 8 additions & 1 deletion

File tree

‎ext/MatrixAlgebraKitAMDGPUExt/MatrixAlgebraKitAMDGPUExt.jl‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,11 @@ for alg in (:Bisection, :Jacobi, :QRIteration, :DivideAndConquer)
5353
@eval MatrixAlgebraKit.supports_ragged_batch(::typeof(svd_compact!), ::$alg, ::ROCSOLVER, ::Type{<:AnyROCArray}) = true
5454
@eval MatrixAlgebraKit.supports_ragged_batch(::typeof(svd_vals!), ::$alg, ::ROCSOLVER, ::Type{<:AnyROCArray}) = true
5555
end
56+
for alg in (:Bisection, :Jacobi, :QRIteration, :DivideAndConquer)
57+
@eval MatrixAlgebraKit.supports_pointer_batch(::$alg, ::ROCSOLVER, ::Type{<:StridedROCMatrix{<:BlasFloat}}) = true
58+
@eval MatrixAlgebraKit.supports_ragged_batch(::typeof(eigh_full!), ::$alg, ::ROCSOLVER, ::Type{<:AnyROCArray}) = true
59+
@eval MatrixAlgebraKit.supports_ragged_batch(::typeof(eigh_vals!), ::$alg, ::ROCSOLVER, ::Type{<:AnyROCArray}) = true
60+
end
5661

5762
function gesvd!(::ROCSOLVER, A::StridedROCMatrix, S::StridedROCVector, U::StridedROCMatrix, Vᴴ::StridedROCMatrix; kwargs...)
5863
m, n = size(A)

‎ext/MatrixAlgebraKitCUDAExt/MatrixAlgebraKitCUDAExt.jl‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ MatrixAlgebraKit.max_batched_blocksize(::AbstractAlgorithm, ::CUSOLVER, ::Type{<
5656
MatrixAlgebraKit.supports_ragged_batch(::typeof(svd_full!), ::Jacobi, ::CUSOLVER, ::Type{<:AnyCuArray}) = true
5757
MatrixAlgebraKit.supports_ragged_batch(::typeof(svd_compact!), ::Jacobi, ::CUSOLVER, ::Type{<:AnyCuArray}) = true
5858
MatrixAlgebraKit.supports_ragged_batch(::typeof(svd_vals!), ::Jacobi, ::CUSOLVER, ::Type{<:AnyCuArray}) = true
59+
MatrixAlgebraKit.supports_ragged_batch(::typeof(eigh_full!), ::AbstractAlgorithm, ::CUSOLVER, ::Type{<:AnyCuArray}) = true
60+
MatrixAlgebraKit.supports_ragged_batch(::typeof(eigh_vals!), ::AbstractAlgorithm, ::CUSOLVER, ::Type{<:AnyCuArray}) = true
5961

6062
function gesvd!(::CUSOLVER, A::StridedCuMatrix, S::StridedCuVector, U::StridedCuMatrix, Vᴴ::StridedCuMatrix; kwargs...)
6163
m, n = size(A)

‎test/testsuite/decompositions/eigh.jl‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ function test_eigh_full_batched(
6969
Ad = device_batch(As)
7070
Ac = deepcopy(Ad)
7171
m, n = size(first(As))
72-
72+
7373
D, V = @testinferred batched_eigh_full(As)
7474
@test D isa Vector{<:AbstractMatrix{real(eltype(T))}} && length(D) == batch_size
7575
@test length(V) == batch_size

0 commit comments

Comments
 (0)