29 armcv_path =
"arm_compute" 32 Target = collections.namedtuple(
'Target',
'name prefix basepath')
35 Target(
"NEON",
"NE", src_path),
36 Target(
"CL",
"CL", src_path),
37 Target(
"CPP",
"CPP", armcv_path)
42 Target(
"NEON",
"NE", armcv_path),
43 Target(
"CL",
"CL", armcv_path),
44 Target(
"CPP",
"CPP", armcv_path)
48 runtime_path =
"/runtime/" 49 include_str =
"#include \"" 52 with open(file,
"r") as f: 58 with open(file,
"w")
as f:
64 first_pos = next(i
for i, line
in enumerate(lines)
if include_str
in line)
65 return [x
for x
in lines
if not x.startswith(include_str)], first_pos
69 lines[pos:pos] = includes
74 files_path = folder +
"/*.h" 75 files = glob.glob(files_path)
76 updated_files = [include_str + folder +
"/" + x.rsplit(
'/',1)[1] +
"\"\n" for x
in files]
83 target_path = t.basepath + path + t.name +
"/" 84 components_file = target_path + t.prefix + header_prefix
85 if os.path.exists(components_file):
87 for s
in subfolders
or []:
96 if __name__ ==
"__main__":
98 include_components(core_targets, core_path,
"Kernels.h",
"kernels", [
"arm32",
"arm64"])
def create_include_list(folder)
def remove_existing_includes(lines)
def include_components(target, path, header_prefix, folder, subfolders=None)
def add_updated_includes(lines, pos, includes)
def write_file(file, lines)