File tree Expand file tree Collapse file tree 2 files changed +14
-3
lines changed Expand file tree Collapse file tree 2 files changed +14
-3
lines changed Original file line number Diff line number Diff line change 4
4
5
5
6
6
def get_sum_of_pw_qpolynomial (pw_qp ):
7
+ """Get the sum of pw_qp over all points in the domain."""
7
8
if isinstance (pw_qp , Number ):
8
9
return pw_qp
9
10
Original file line number Diff line number Diff line change
1
+ import pprint
2
+
1
3
import islpy as isl
2
4
3
5
from bindings .looptree import PipelineSpatialTag
4
6
from pytimeloop .isl .sum import sum_until_idx , make_reduction_map
5
7
from pytimeloop .isl .qpolynomial import from_pw_qpolynomial_fold
6
8
7
9
def process_sequential_latency (top_idx : int , latencies ):
8
- dim_tags = latencies [0 ][0 ]
9
- summed_latency = sum (map (lambda pair : pair [1 ], latencies ))
10
- return dim_tags [:top_idx ], sum_until_idx (top_idx , summed_latency )
10
+ common_dim_tags = latencies [0 ][0 ][:top_idx ]
11
+ try :
12
+ total_sequential_latency = sum (
13
+ sum_until_idx (top_idx , latency )
14
+ for dim_tags , latency in latencies
15
+ )
16
+ except :
17
+ print ('Bad input:' )
18
+ pprint .pp (latencies )
19
+ raise
20
+ return common_dim_tags , total_sequential_latency
11
21
12
22
13
23
def process_pipeline_latency (top_idx : int , latencies ):
You can’t perform that action at this time.
0 commit comments