@@ -11,9 +11,7 @@ import ..ExtensionInterfaceModule: bumper_eval_tree_array, _is_loopvectorization
11
11
import .. ValueInterfaceModule: is_valid, is_valid_array
12
12
13
13
# Overloaded by SpecialOperators.jl:
14
- function any_special_operators (_)
15
- return false
16
- end
14
+ function any_special_operators end
17
15
function special_operator end
18
16
function deg2_eval_special end
19
17
function deg1_eval_special end
@@ -226,7 +224,7 @@ function eval_tree_array(
226
224
" Bumper and LoopVectorization features are only compatible with numeric element types" ,
227
225
)
228
226
end
229
- if any_special_operators (typeof ( operators) )
227
+ if any_special_operators (operators)
230
228
cX = copy (cX)
231
229
# TODO : This is dangerous if the element type is mutable
232
230
end
338
336
eval_options:: EvalOptions ,
339
337
) where {T}
340
338
nbin = get_nbin (operators)
341
- special_operators = any_special_operators (operators)
342
339
long_compilation_time = nbin > OPERATOR_LIMIT_BEFORE_SLOWDOWN
343
340
if long_compilation_time
344
341
return quote
370
367
@return_on_nonfinite_array (eval_options, result_l. x)
371
368
# op(x, y), where y is a constant or variable but x is not.
372
369
deg2_r0_eval (tree, result_l. x, cX, op, eval_options)
373
- elseif ! $ (special_operators ) && tree. l. degree == 0
370
+ elseif ! any_special_operators (operators ) && tree. l. degree == 0
374
371
# This branch changes the execution order, so we cannot
375
372
# use this branch when special operators are present.
376
373
result_r = _eval_tree_array (tree. r, cX, operators, eval_options)
400
397
eval_options:: EvalOptions ,
401
398
) where {T}
402
399
nuna = get_nuna (operators)
403
- special_operators = any_special_operators (operators)
404
400
long_compilation_time = nuna > OPERATOR_LIMIT_BEFORE_SLOWDOWN
405
401
if long_compilation_time
406
402
return quote
422
418
i -> let op = operators. unaops[i]
423
419
if special_operator (op)
424
420
deg1_eval_special (tree, cX, operators, op, eval_options)
425
- elseif ! $ (special_operators ) &&
421
+ elseif ! any_special_operators (operators ) &&
426
422
tree. l. degree == 2 &&
427
423
tree. l. l. degree == 0 &&
428
424
tree. l. r. degree == 0
431
427
dispatch_deg1_l2_ll0_lr0_eval (
432
428
tree, cX, op, l_op_idx, operators. binops, eval_options
433
429
)
434
- elseif ! $ (special_operators) && tree. l. degree == 1 && tree. l. l. degree == 0
430
+ elseif ! any_special_operators (operators) &&
431
+ tree. l. degree == 1 &&
432
+ tree. l. l. degree == 0
435
433
# op(op2(x)), where x is a constant or variable.
436
434
l_op_idx = tree. l. op
437
435
dispatch_deg1_l1_ll0_eval (
0 commit comments