Skip to content

Commit d90d159

Browse files
Fix DebugOnly docs to work for reduction kernels (#2230)
1 parent 1dbb784 commit d90d159

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/src/debugging.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ import ClimaCore
7878
import Infiltrator # must be in your default environment
7979
ClimaCore.DebugOnly.call_post_op_callback() = true
8080
function ClimaCore.DebugOnly.post_op_callback(result, args...; kwargs...)
81-
has_nans = any(isnan, parent(result))
82-
has_inf = any(isinf, parent(result))
81+
has_nans = result isa Number ? isnan(result) : any(isnan, parent(result))
82+
has_inf = result isa Number ? isinf(result) : any(isinf, parent(result))
8383
if has_nans || has_inf
8484
has_nans && println("NaNs found!")
8585
has_inf && println("Infs found!")

0 commit comments

Comments
 (0)