Skip to content
Snippets Groups Projects
Unverified Commit d1a2595a authored by Yaman Umuroglu's avatar Yaman Umuroglu Committed by GitHub
Browse files

Merge pull request #208 from HenniOVP/feature/issue_205

Fixes Xilinx/finn#205
parents 9c625fe8 da92c043
No related branches found
No related tags found
No related merge requests found
......@@ -162,16 +162,23 @@ def _get_stats(x):
return (x[0], get_stream_if_stats(x[1], x[0]))
def get_all_stream_if_stats(vcd_file, stream_ifs=None, sort_by="{'V': 1, 'R': 0}"):
def get_all_stream_if_stats(vcd_file, stream_ifs=None, sort_by="{'V': 1, 'R': 0}", num_workers=None):
"""Return a list of streaming interface stats, sorted by the percentage
for the given sort_by key. If stream_ifs is None, all streamin interface
for the given sort_by key. If stream_ifs is None, all streaming interface
stats will be returned, otherwise treated as a list of interface names to
return the stats for."""
return the stats for.
By default the number of parallel workers from the environment variable
NUM_DEFAULT_WORKERS will be used. This behavior can be changed on a per
call basis by supplying the optional parameter: num_workers
"""
if stream_ifs is None:
stream_ifs = list_stream_if(vcd_file)
with mp.Pool(get_num_default_workers()) as p:
if num_workers is None:
num_workers = get_num_default_workers()
with mp.Pool(num_workers) as p:
stream_ifs = map(lambda x: (x, vcd_file), stream_ifs)
all_stats = p.map(_get_stats, stream_ifs)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment