Skip to content

Commit b0e2b3b

Browse files
committed
fix func bytecode
1 parent 068268f commit b0e2b3b

File tree

4 files changed

+7
-6
lines changed

4 files changed

+7
-6
lines changed

mlir/extras/dialects/ext/func.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,9 @@ def __init__(
201201

202202
def _is_decl(self):
203203
# magic constant found from looking at the code for an empty fn
204-
if sys.version_info.minor == 13:
204+
if sys.version_info.minor == 14:
205+
return self.body_builder.__code__.co_code == b'\x80\x00R\x00#\x00'
206+
elif sys.version_info.minor == 13:
205207
return self.body_builder.__code__.co_code == b"\x95\x00g\x00"
206208
elif sys.version_info.minor == 12:
207209
return self.body_builder.__code__.co_code == b"\x97\x00y\x00"

requirements-dev.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
black
22
inflection
3+
pytest

tests/test_async.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,6 @@ def test_simple_parfor(ctx: MLIRContext, backend: LLVMJITBackend):
3434
%initial = arith.constant 0 : index
3535
%step = arith.constant 1: index
3636
scf.parallel (%iv1, %iv2, %iv3, %iv4) = (%initial, %initial, %initial, %initial) to (%bound1, %bound2, %bound1, %bound2) step (%step, %step, %step, %step) {
37-
vector.print %iv1 :index
38-
vector.print %iv2 :index
39-
vector.print %iv3 :index
40-
vector.print %iv4 :index
4137
%e = arith.addi %iv3, %iv4 : index
4238
%d = arith.addi %e, %iv1 : index
4339
%b = arith.index_cast %d : index to i32

tests/test_func.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,9 @@ def demo_fun1():
4646
def test_declare_byte_rep(ctx: MLIRContext):
4747
def demo_fun1(): ...
4848

49-
if sys.version_info.minor == 13:
49+
if sys.version_info.minor == 14:
50+
assert demo_fun1.__code__.co_code == b'\x80\x00R\x00#\x00'
51+
elif sys.version_info.minor == 13:
5052
assert demo_fun1.__code__.co_code == b"\x95\x00g\x00"
5153
elif sys.version_info.minor == 12:
5254
assert demo_fun1.__code__.co_code == b"\x97\x00y\x00"

0 commit comments

Comments
 (0)