flopscope.

flopscope.accounting.polymul_cost

flopscope.accounting.polymul_cost(n1, n2)[flopscope source]

Cost for polymul: 2*n1*n2 - n1 - n2 FLOPs (convolution, FMA=2).

Parameters

n1:int

Argument forwarded to the analytical polymul cost formula.

n2:int

Argument forwarded to the analytical polymul cost formula.

Returns

:int

Weighted public cost estimate, floored to match runtime accounting.

Notes

This helper multiplies the analytical FLOP count by the active weight from flopscope._weights and then applies int(...) so public estimates match budget deductions.