Skip to content

Commit e64fbb9

Browse files
author
Michael Gilbert
committed
[looptree] Successfully test inputting numpy array into reuse analysis
1 parent 2f7acf8 commit e64fbb9

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

tests/looptree/reuse_analysis/test_symbolic.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import unittest
22
from sympy import ceiling
33
from math import ceil
4-
from pprint import pp
4+
import numpy as np
55

66
from bindings.looptree import LooptreeWorkload, LooptreeWorkloadDependencyAnalyzer
77

@@ -73,4 +73,13 @@ def test_model_with_two_level_mm(self):
7373
compiled_result.fills[key][1](1, 1, M1_tile_shape_val),
7474
ref_value,
7575
f'fills for {key} do not match'
76-
)
76+
)
77+
78+
# Test using a numpy array to call the compiled results
79+
M1_tile_shape_vals = np.array([1, 2, 4])
80+
all_fills = compiled_result.fills[('GlobalBuffer', 0, 0)][1](
81+
1,
82+
1,
83+
M1_tile_shape_vals
84+
)
85+
np.testing.assert_equal(all_fills, np.array([72, 36, 18]))

0 commit comments

Comments
 (0)