@@ -14,7 +14,7 @@ function LinearAlgebra.transpose!(B::AbstractGPUMatrix, A::AbstractGPUVector)
1414end
1515function LinearAlgebra. adjoint! (B:: AbstractGPUVector , A:: AbstractGPUMatrix )
1616 axes (B,1 ) == axes (A,2 ) && axes (A,1 ) == 1 : 1 || throw (DimensionMismatch (" adjoint" ))
17- length (A) == 0 && return B
17+ isempty (A) && return B
1818 @kernel function adjoint_kernel! (B, A)
1919 idx = @index (Global, Linear)
2020 @inbounds B[idx] = adjoint (A[1 , idx])
@@ -24,7 +24,7 @@ function LinearAlgebra.adjoint!(B::AbstractGPUVector, A::AbstractGPUMatrix)
2424end
2525function LinearAlgebra. adjoint! (B:: AbstractGPUMatrix , A:: AbstractGPUVector )
2626 axes (B,2 ) == axes (A,1 ) && axes (B,1 ) == 1 : 1 || throw (DimensionMismatch (" adjoint" ))
27- length (A) == 0 && return B
27+ isempty (A) && return B
2828 @kernel function adjoint_kernel! (B, A)
2929 idx = @index (Global, Linear)
3030 @inbounds B[1 , idx] = adjoint (A[idx])
@@ -38,7 +38,7 @@ LinearAlgebra.adjoint!(B::AnyGPUArray, A::AnyGPUArray) = transpose_f!(adjoint, B
3838function transpose_f! (f, B:: AnyGPUMatrix{T} , A:: AnyGPUMatrix{T} ) where T
3939 axes (B,1 ) == axes (A,2 ) && axes (B,2 ) == axes (A,1 ) || throw (DimensionMismatch (string (f)))
4040 # array with size zero dimension
41- length (A) == 0 && return B
41+ isempty (A) && return B
4242 @kernel function transpose_kernel! (B, A)
4343 idx = @index (Global, Cartesian)
4444 @inbounds B[idx[2 ], idx[1 ]] = f (A[idx[1 ], idx[2 ]])
0 commit comments