If I use fma(a, b, c) in cuda, it means that the formula ab+c is calculated in a single ternary operation. But if I want to calculate -ab+c, does the invoking fma(-a, b, c) take one more multiply operation ?
What is the instruction number per cycle in fma with minus?
337 views Asked by Jannus YU At
1
Unfortunately shader assembly language is undocumented at that level.
However we can try it out:
gives
So the FFMA instruction can indeed take an additional sign to apply to the product (note that it is applied to b in the shader assembly instruction, however this gives the same result). You can try the same with double precision operands and other compute capabilities instead of
sm_60
as well, which will give you similar results.