Skip to content

Commit db00c52

Browse files
kshyattKatharine Hyatt
authored andcommitted
Add explanatory comment
1 parent 270d495 commit db00c52

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎test/testsuite/ad_utils.jl‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ In-place variant of [`eig_vals_wrapper`](@ref), which zeros `A` after calling `f
7676
"""
7777
eig_vals!_wrapper(f!, A, alg) = sort_eigvals(call_and_zero!(f!, A, alg))
7878

79+
# sortperm is used here because Mooncake CAN differentiate that on CUDA,
80+
# but CANNOT differentiate sort
7981
sort_eigvals(D) = D[sortperm(collect(D); by = λ -> (abs(λ), imag(λ)))]
8082

8183
"""

0 commit comments

Comments
 (0)