Skip to content

Commit 499039f

Browse files
committed
formatting recommendations
Signed-off-by: Steven Hahn <[email protected]>
1 parent ed17800 commit 499039f

File tree

2 files changed

+22
-18
lines changed

2 files changed

+22
-18
lines changed

lib/cusolver/dense_generic.jl

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -505,13 +505,13 @@ function Xgeev!(jobvl::Char, jobvr::Char, A::StridedCuMatrix{T}) where {T <: Bla
505505
end
506506

507507
# XsyevBatched
508-
function XsyevBatched!(jobz::Char, uplo::Char, A::StridedCuArray{T,3}) where {T <: BlasFloat}
508+
function XsyevBatched!(jobz::Char, uplo::Char, A::StridedCuArray{T, 3}) where {T <: BlasFloat}
509509
CUSOLVER.version() < v"11.7.1" && throw(ErrorException("This operation is not supported by the current CUDA version."))
510510
chkuplo(uplo)
511511
n = checksquare(A)
512-
batch_size = size(A,3)
512+
batch_size = size(A, 3)
513513
R = real(T)
514-
lda = max(1, stride(A,2))
514+
lda = max(1, stride(A, 2))
515515
W = CuMatrix{R}(undef, n, batch_size)
516516
params = CuSolverParameters()
517517
dh = dense_handle()
@@ -520,18 +520,22 @@ function XsyevBatched!(jobz::Char, uplo::Char, A::StridedCuArray{T,3}) where {T
520520
function bufferSize()
521521
out_cpu = Ref{Csize_t}(0)
522522
out_gpu = Ref{Csize_t}(0)
523-
cusolverDnXsyevBatched_bufferSize(dh, params, jobz, uplo, n,
524-
T, A, lda, R, W, T, out_gpu, out_cpu, batch_size)
525-
out_gpu[], out_cpu[]
523+
cusolverDnXsyevBatched_bufferSize(
524+
dh, params, jobz, uplo, n,
525+
T, A, lda, R, W, T, out_gpu, out_cpu, batch_size
526+
)
527+
return out_gpu[], out_cpu[]
526528
end
527529
with_workspaces(dh.workspace_gpu, dh.workspace_cpu, bufferSize()...) do buffer_gpu, buffer_cpu
528-
cusolverDnXsyevBatched(dh, params, jobz, uplo, n, T, A,
529-
lda, R, W, T, buffer_gpu, sizeof(buffer_gpu),
530-
buffer_cpu, sizeof(buffer_cpu), dh.info, batch_size)
530+
cusolverDnXsyevBatched(
531+
dh, params, jobz, uplo, n, T, A,
532+
lda, R, W, T, buffer_gpu, sizeof(buffer_gpu),
533+
buffer_cpu, sizeof(buffer_cpu), dh.info, batch_size
534+
)
531535
end
532536

533537
info = @allowscalar collect(dh.info)
534-
for i = 1:batch_size
538+
for i in 1:batch_size
535539
chkargsok(info[i] |> BlasInt)
536540
end
537541

test/libraries/cusolver/dense_generic.jl

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,21 +39,21 @@ p = 5
3939

4040
A = rand(elty, n, n, batch_size)
4141
B = rand(elty, n, n, batch_size)
42-
for i = 1:batch_size
43-
S = rand(elty,n,n)
42+
for i in 1:batch_size
43+
S = rand(elty, n, n)
4444
S = S * S' + I
45-
B[:,:,i] .= S
45+
B[:, :, i] .= S
4646
S = uplo == 'L' ? tril(S) : triu(S)
47-
A[:,:,i] .= S
47+
A[:, :, i] .= S
4848
end
4949
d_A = CuArray(A)
5050
d_W, d_V = CUSOLVER.XsyevBatched!('V', uplo, d_A)
5151
W = collect(d_W)
5252
V = collect(d_V)
53-
for i = 1:batch_size
54-
Bᵢ = B[:,:,i]
55-
Wᵢ = Diagonal(W[:,i])
56-
Vᵢ = V[:,:,i]
53+
for i in 1:batch_size
54+
Bᵢ = B[:, :, i]
55+
Wᵢ = Diagonal(W[:, i])
56+
Vᵢ = V[:, :, i]
5757
@test Bᵢ * Vᵢ Vᵢ * Diagonal(Wᵢ)
5858
end
5959

0 commit comments

Comments
 (0)