Skip to content

Commit a764800

Browse files
Bug fix for multi-ops with mod/rescale (#70)
* added current_rns into immediate naming to enable non-fresh multi-ops * Fixed qiLastHalf to use current_rns in naming to avoid collisions in multi-ops
1 parent 7040965 commit a764800

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

kerngen/pisa_generators/rescale.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,17 @@ def to_pisa(self) -> list[PIsaOp]:
3939

4040
# Immediates
4141
last_q = self.input0.rns - 1
42-
one, r2, iq = common_immediates(r2_rns=last_q, iq_rns=last_q)
4342

4443
one, r2, iq = common_immediates(
45-
r2_rns=last_q, iq_rns=last_q, iq_suffix=self.var_suffix + f"_{self.context.current_rns}"
44+
r2_rns=last_q,
45+
iq_rns=last_q,
46+
iq_suffix=self.var_suffix + f"_{self.context.current_rns}"
4647
)
4748

4849
q_last_half = Polys("qLastHalf", 1, self.input0.rns)
49-
q_i_last_half = Polys("qiLastHalf", 1, rns=last_q)
50+
q_i_last_half = Polys(
51+
"qiLastHalf" + f"_{self.context.current_rns}", 1, rns=last_q
52+
)
5053

5154
# split input
5255
input_last_rns, input_remaining_rns = split_last_rns_polys(

0 commit comments

Comments
 (0)