@@ -6,7 +6,7 @@ import ..NodeModule:
66 AbstractExpressionNode, constructorof, get_children, get_child, with_type_parameters
77import .. StringsModule: string_tree
88import .. OperatorEnumModule: AbstractOperatorEnum, OperatorEnum, GenericOperatorEnum
9- import .. UtilsModule: fill_similar, counttuple, ResultOk
9+ import .. UtilsModule: fill_similar, counttuple, ResultOk, @finite
1010import .. NodeUtilsModule: is_constant
1111import .. ExtensionInterfaceModule: bumper_eval_tree_array, _is_loopvectorization_loaded
1212import .. ValueInterfaceModule: is_valid, is_valid_array
295295 # Fast general implementation of `cumulators[1] .= op.(cumulators[1], cumulators[2], ...)`
296296 quote
297297 Base. Cartesian. @nexprs ($ N, i -> cumulator_i = cumulators[i])
298- @inbounds @simd for j in eachindex (cumulator_1)
298+ @finite @ inbounds @simd for j in eachindex (cumulator_1)
299299 cumulator_1[j] = Base. Cartesian. @ncall ($ N, op, i -> cumulator_i[j]):: T
300300 end # COV_EXCL_LINE
301301 return ResultOk (cumulator_1, true )
@@ -581,7 +581,7 @@ function deg1_l2_ll0_lr0_eval(
581581 @return_on_nonfinite_val (eval_options, val_ll, cX)
582582 feature_lr = get_child (get_child (tree, 1 ), 2 ). feature
583583 cumulator = get_array (eval_options. buffer, cX, axes (cX, 2 ))
584- @inbounds @simd for j in axes (cX, 2 )
584+ @finite @ inbounds @simd for j in axes (cX, 2 )
585585 x_l = op_l (val_ll, cX[feature_lr, j]):: T
586586 x = is_valid (x_l) ? op (x_l):: T : T (Inf )
587587 cumulator[j] = x
@@ -592,7 +592,7 @@ function deg1_l2_ll0_lr0_eval(
592592 val_lr = get_child (get_child (tree, 1 ), 2 ). val
593593 @return_on_nonfinite_val (eval_options, val_lr, cX)
594594 cumulator = get_array (eval_options. buffer, cX, axes (cX, 2 ))
595- @inbounds @simd for j in axes (cX, 2 )
595+ @finite @ inbounds @simd for j in axes (cX, 2 )
596596 x_l = op_l (cX[feature_ll, j], val_lr):: T
597597 x = is_valid (x_l) ? op (x_l):: T : T (Inf )
598598 cumulator[j] = x
@@ -602,7 +602,7 @@ function deg1_l2_ll0_lr0_eval(
602602 feature_ll = get_child (get_child (tree, 1 ), 1 ). feature
603603 feature_lr = get_child (get_child (tree, 1 ), 2 ). feature
604604 cumulator = get_array (eval_options. buffer, cX, axes (cX, 2 ))
605- @inbounds @simd for j in axes (cX, 2 )
605+ @finite @ inbounds @simd for j in axes (cX, 2 )
606606 x_l = op_l (cX[feature_ll, j], cX[feature_lr, j]):: T
607607 x = is_valid (x_l) ? op (x_l):: T : T (Inf )
608608 cumulator[j] = x
@@ -630,7 +630,7 @@ function deg1_l1_ll0_eval(
630630 else
631631 feature_ll = get_child (get_child (tree, 1 ), 1 ). feature
632632 cumulator = get_array (eval_options. buffer, cX, axes (cX, 2 ))
633- @inbounds @simd for j in axes (cX, 2 )
633+ @finite @ inbounds @simd for j in axes (cX, 2 )
634634 x_l = op_l (cX[feature_ll, j]):: T
635635 x = is_valid (x_l) ? op (x_l):: T : T (Inf )
636636 cumulator[j] = x
@@ -659,7 +659,7 @@ function deg2_l0_r0_eval(
659659 val_l = get_child (tree, 1 ). val
660660 @return_on_nonfinite_val (eval_options, val_l, cX)
661661 feature_r = get_child (tree, 2 ). feature
662- @inbounds @simd for j in axes (cX, 2 )
662+ @finite @ inbounds @simd for j in axes (cX, 2 )
663663 x = op (val_l, cX[feature_r, j]):: T
664664 cumulator[j] = x
665665 end # COV_EXCL_LINE
@@ -669,7 +669,7 @@ function deg2_l0_r0_eval(
669669 feature_l = get_child (tree, 1 ). feature
670670 val_r = get_child (tree, 2 ). val
671671 @return_on_nonfinite_val (eval_options, val_r, cX)
672- @inbounds @simd for j in axes (cX, 2 )
672+ @finite @ inbounds @simd for j in axes (cX, 2 )
673673 x = op (cX[feature_l, j], val_r):: T
674674 cumulator[j] = x
675675 end # COV_EXCL_LINE
@@ -678,7 +678,7 @@ function deg2_l0_r0_eval(
678678 cumulator = get_array (eval_options. buffer, cX, axes (cX, 2 ))
679679 feature_l = get_child (tree, 1 ). feature
680680 feature_r = get_child (tree, 2 ). feature
681- @inbounds @simd for j in axes (cX, 2 )
681+ @finite @ inbounds @simd for j in axes (cX, 2 )
682682 x = op (cX[feature_l, j], cX[feature_r, j]):: T
683683 cumulator[j] = x
684684 end # COV_EXCL_LINE
@@ -697,14 +697,14 @@ function deg2_l0_eval(
697697 if get_child (tree, 1 ). constant
698698 val = get_child (tree, 1 ). val
699699 @return_on_nonfinite_val (eval_options, val, cX)
700- @inbounds @simd for j in eachindex (cumulator)
700+ @finite @ inbounds @simd for j in eachindex (cumulator)
701701 x = op (val, cumulator[j]):: T
702702 cumulator[j] = x
703703 end # COV_EXCL_LINE
704704 return ResultOk (cumulator, true )
705705 else
706706 feature = get_child (tree, 1 ). feature
707- @inbounds @simd for j in eachindex (cumulator)
707+ @finite @ inbounds @simd for j in eachindex (cumulator)
708708 x = op (cX[feature, j], cumulator[j]):: T
709709 cumulator[j] = x
710710 end # COV_EXCL_LINE
@@ -723,14 +723,14 @@ function deg2_r0_eval(
723723 if get_child (tree, 2 ). constant
724724 val = get_child (tree, 2 ). val
725725 @return_on_nonfinite_val (eval_options, val, cX)
726- @inbounds @simd for j in eachindex (cumulator)
726+ @finite @ inbounds @simd for j in eachindex (cumulator)
727727 x = op (cumulator[j], val):: T
728728 cumulator[j] = x
729729 end # COV_EXCL_LINE
730730 return ResultOk (cumulator, true )
731731 else
732732 feature = get_child (tree, 2 ). feature
733- @inbounds @simd for j in eachindex (cumulator)
733+ @finite @ inbounds @simd for j in eachindex (cumulator)
734734 x = op (cumulator[j], cX[feature, j]):: T
735735 cumulator[j] = x
736736 end # COV_EXCL_LINE
0 commit comments