Skip to content

Commit c48c2c2

Browse files
committed
Use faster isfinite check in Bumper extension
1 parent 297aa5e commit c48c2c2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

ext/DynamicExpressionsBumperExt.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ module DynamicExpressionsBumperExt
22

33
using Bumper: @no_escape, @alloc
44
using DynamicExpressions: OperatorEnum, AbstractExpressionNode, tree_mapreduce
5-
using DynamicExpressions.UtilsModule: ResultOk, counttuple
5+
using DynamicExpressions.UtilsModule: ResultOk, counttuple, is_bad_array
66

77
import DynamicExpressions.ExtensionInterfaceModule: bumper_eval_tree_array
88

@@ -35,7 +35,7 @@ function bumper_eval_tree_array(
3535
if M == 1
3636
if cumulators[1].ok
3737
out = dispatch_kern1!(operators.unaops, branch.op, cumulators[1].x)
38-
ResultOk(out, isfinite(sum(yi -> yi * zero(yi), out)))
38+
ResultOk(out, !is_bad_array(out))
3939
else
4040
cumulators[1]
4141
end
@@ -47,7 +47,7 @@ function bumper_eval_tree_array(
4747
cumulators[1].x,
4848
cumulators[2].x,
4949
)
50-
ResultOk(out, isfinite(sum(yi -> yi * zero(yi), out)))
50+
ResultOk(out, !is_bad_array(out))
5151
elseif cumulators[1].ok
5252
cumulators[2]
5353
else

0 commit comments

Comments
 (0)