Skip to content

Commit 5e999c7

Browse files
committed
muladd in combine_products
1 parent 094ea90 commit 5e999c7

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/matrix_multiply.jl

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,13 @@ function combine_products(expr_list)
384384
if isempty(filtered)
385385
return :(zero(T))
386386
else
387-
return reduce((ex1,ex2) -> :(+($ex1,$ex2)), filtered)
387+
return reduce(filtered) do ex1, ex2
388+
if ex2.head != :call || ex2.args[1] != :*
389+
error("expected call to *")
390+
end
391+
392+
return :(muladd($(ex2.args[2]), $(ex2.args[3]), $ex1))
393+
end
388394
end
389395
end
390396

0 commit comments

Comments
 (0)