MCPcopy Create free account
hub / github.com/ARM-software/ComputeLibrary / get_operator_backend_files

Function get_operator_backend_files

scripts/generate_build_files.py:40–66  ·  view source on GitHub ↗
(filelist, operators, backend='', techs=[], attrs=[], include_common=True)

Source from the content-addressed store, hash-verified

38
39
40def get_operator_backend_files(filelist, operators, backend='', techs=[], attrs=[], include_common=True):
41 files = {"common": []}
42
43 # Early return if filelist is empty
44 if backend not in filelist:
45 return files
46
47 # Iterate over operators and create the file lists to compiler
48 for operator in operators:
49 if operator in filelist[backend]['operators']:
50 if include_common:
51 files['common'] += filelist[backend]['operators'][operator]["files"]["common"]
52 for tech in techs:
53 if tech in filelist[backend]['operators'][operator]["files"]:
54 # Add tech as a key to dictionary if not there
55 if tech not in files:
56 files[tech] = []
57
58 # Add tech files to the tech file list
59 tech_files = filelist[backend]['operators'][operator]["files"][tech]
60 if include_common:
61 files[tech] += tech_files.get('common', [])
62 for attr in attrs:
63 files[tech] += tech_files.get(attr, [])
64
65 # Remove duplicates if they exist
66 return {k: list(set(v)) for k, v in files.items()}
67
68
69def collect_operators(filelist, operators, backend=''):

Callers 1

gather_sourcesFunction · 0.85

Calls 1

getMethod · 0.45

Tested by

no test coverage detected