Skip to content

Commit e5e1b33

Browse files
committed
Fix for CUDA
1 parent b939fdf commit e5e1b33

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/host/linalg.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ function LinearAlgebra.transpose!(B::AbstractGPUMatrix, A::AbstractGPUVector)
1414
end
1515
function LinearAlgebra.adjoint!(B::AbstractGPUVector, A::AbstractGPUMatrix)
1616
axes(B,1) == axes(A,2) && axes(A,1) == 1:1 || throw(DimensionMismatch("adjoint"))
17+
axes(A,1) == 1:0 || axes(A, 2) == 1:0 && return B
1718
@kernel function adjoint_kernel!(B, A)
1819
idx = @index(Global, Linear)
1920
@inbounds B[idx] = adjoint(A[1, idx])
@@ -23,6 +24,7 @@ function LinearAlgebra.adjoint!(B::AbstractGPUVector, A::AbstractGPUMatrix)
2324
end
2425
function LinearAlgebra.adjoint!(B::AbstractGPUMatrix, A::AbstractGPUVector)
2526
axes(B,2) == axes(A,1) && axes(B,1) == 1:1 || throw(DimensionMismatch("adjoint"))
27+
axes(A,1) == 1:0 || axes(A, 2) == 1:0 && return B
2628
@kernel function adjoint_kernel!(B, A)
2729
idx = @index(Global, Linear)
2830
@inbounds B[1, idx] = adjoint(A[idx])

0 commit comments

Comments
 (0)