Skip to content

Commit c00dcb4

Browse files
authored
Merge pull request #11 from IntelPython/one-shot
Use one-shot-bufferize pass
2 parents 361dc2b + 903865d commit c00dcb4

File tree

3 files changed

+10
-12
lines changed

3 files changed

+10
-12
lines changed

imex_version.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
a02f09350a8eba081c92a7d0117334eb56c9fb5a
1+
5a7bb80ede5fe4fa8d56ee0dd77c4e5c1327fe09

src/jit/mlir.cpp

+2-11
Original file line numberDiff line numberDiff line change
@@ -687,20 +687,11 @@ static const std::string cpu_pipeline =
687687
// "convert-shape-to-std,"
688688
"arith-expand,"
689689
"memref-expand,"
690-
"arith-bufferize,"
691-
// "func-bufferize,"
692690
"func.func(empty-tensor-to-alloc-tensor),"
693-
"func.func(scf-bufferize),"
694-
"func.func(tensor-bufferize),"
695-
"func.func(bufferization-bufferize),"
696-
"func.func(linalg-bufferize),"
697-
"func.func(linalg-detensorize),"
698-
"func.func(tensor-bufferize),"
699-
"region-bufferize,"
691+
"one-shot-bufferize,"
700692
"canonicalize,"
701-
"func.func(finalizing-bufferize),"
702-
"func.func(buffer-deallocation),"
703693
"imex-remove-temporaries,"
694+
"func.func(buffer-deallocation),"
704695
"func.func(convert-linalg-to-parallel-loops),"
705696
"func.func(scf-parallel-loop-fusion),"
706697
"drop-regions,"

test/test_manip.py

+7
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,13 @@ def doit(aapi, **kwargs):
2626

2727
assert runAndCompare(doit)
2828

29+
def test_reshape_copy(self):
30+
a = sp.arange(0, 8, 1, sp.int32)
31+
b = sp.reshape(a, [4, 2])
32+
a[0] = 20
33+
assert numpy.allclose(sp.to_numpy(a), [20, 1, 2, 3, 4, 5, 6, 7])
34+
assert numpy.allclose(sp.to_numpy(b), [[0, 1], [2, 3], [4, 5], [6, 7]])
35+
2936
@pytest.mark.skipif(len(device), reason="FIXME 64bit on GPU")
3037
def test_astype_f64i32(self):
3138
def doit(aapi, **kwargs):

0 commit comments

Comments
 (0)