Skip to content

Commit b07310b

Browse files
committed
Add pow_fast now that it's in VectorizationBase's cost table
1 parent ff8cacd commit b07310b

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/modeling/costs.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,7 @@ const COST = Dict{Symbol,InstructionCost}(
238238
:exp10 => InstructionCost(-3.0,13.0,26.0,14),
239239
:expm1 => InstructionCost(-3.0,30.0,60.0,19),
240240
:(^) => InstructionCost(-3.0,200.0,400.0,26), # FIXME
241+
:pow_fast => InstructionCost(-3.0,200.0,400.0,26), # FIXME
241242
:sin => InstructionCost(-3,30.0,60.0,23),
242243
:cos => InstructionCost(-3,27.0,60.0,26),
243244
:sincos => InstructionCost(-3,37.0,85.0,26),

src/parse/add_compute.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ function add_compute!(
256256
# instr = instruction(first(ex.args))::Symbol
257257
instr = instruction!(ls, first(ex.args))::Instruction
258258
args = @view(ex.args[2:end])
259-
if instr.instr === :(^) && length(args) == 2
259+
if (instr.instr === :pow_fast || instr.instr === :(^)) && length(args) == 2
260260
arg2 = args[2]
261261
arg2 isa Number && return add_pow!(ls, var, args[1], arg2, elementbytes, position)
262262
end

0 commit comments

Comments
 (0)