Skip to content

Commit 959b5d3

Browse files
committed
adds test_oppool
1 parent a814fd4 commit 959b5d3

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

test/test_oppool.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import islpy as isl
2+
from islpy import oppool as oppool
3+
4+
5+
def test_pooled_basic_set_intersect():
6+
ctx = isl.DEFAULT_CONTEXT
7+
pool = oppool.ISLOpMemoizer()
8+
set1 = oppool.NormalizedISLBasicSet.read_from_str(ctx, "{[i]: 0<=i<10}")
9+
set2 = oppool.NormalizedISLBasicSet.read_from_str(ctx, "{[i]: 0<=i<5}")
10+
11+
set3 = oppool.NormalizedISLBasicSet.read_from_str(ctx, "{[j]: 0<=j<10}")
12+
set4 = oppool.NormalizedISLBasicSet.read_from_str(ctx, "{[j]: 0<=j<5}")
13+
14+
set1_and_set2 = set1.intersect(pool, set2)
15+
set3_and_set4 = set3.intersect(pool, set4)
16+
17+
assert set1_and_set2.ground_obj is set3_and_set4.ground_obj
18+
19+
20+
if __name__ == "__main__":
21+
import sys
22+
if len(sys.argv) > 1:
23+
exec(sys.argv[1])
24+
else:
25+
from pytest import main
26+
main([__file__])

0 commit comments

Comments
 (0)