From 030762611478edfb3c371da6b2249b415178ccc1 Mon Sep 17 00:00:00 2001 From: Sang-Hoon Park Date: Wed, 4 Nov 2020 17:32:38 +0000 Subject: COMPMID-3639: Fix script to generate *Kernels.h Change-Id: Ie44fc807fe8d7ad04a97f0ea4f611b60cb8e0716 Signed-off-by: Sang-Hoon Park Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/4325 Tested-by: Arm Jenkins Comments-Addressed: Arm Jenkins Reviewed-by: Georgios Pinitas --- scripts/include_functions_kernels.py | 38 ++++++++++++++++++++++++------------ src/core/NEON/NEKernels.h | 1 + 2 files changed, 27 insertions(+), 12 deletions(-) diff --git a/scripts/include_functions_kernels.py b/scripts/include_functions_kernels.py index 074f7949b8..4db47ea754 100755 --- a/scripts/include_functions_kernels.py +++ b/scripts/include_functions_kernels.py @@ -3,16 +3,30 @@ import glob import collections import os -Target = collections.namedtuple('Target', 'name prefix') - -targets = [Target("NEON", "NE"), Target("CL", "CL"), Target("CPP", "CPP"), Target("GLES_COMPUTE", "GC")] - armcv_path = "arm_compute" -core_path = armcv_path + "/core/" -runtime_path = armcv_path + "/runtime/" +src_path ="src" + +Target = collections.namedtuple('Target', 'name prefix basepath') + +core_targets = [ + Target("NEON", "NE", src_path), # NEON kernels are under src + Target("CL", "CL", src_path), # CL kernels are under src + Target("CPP", "CPP", armcv_path), # CPP kernels are under arm_compute + Target("GLES_COMPUTE", "GC", armcv_path) # GLES kernels are under arm_compute + ] + +# All functions are under arm_compute +runtime_targets = [ + Target("NEON", "NE", armcv_path), + Target("CL", "CL", armcv_path), + Target("CPP", "CPP", armcv_path), + Target("GLES_COMPUTE", "GC", armcv_path) + ] + +core_path = "/core/" +runtime_path = "/runtime/" include_str = "#include \"" - def read_file(file): with open(file, "r") as f: lines = f.readlines() @@ -43,9 +57,9 @@ def create_include_list(folder): return updated_files -def include_components(path, header_prefix, folder, subfolders=None): - for t in targets: - target_path = path + t.name + "/" +def include_components(target, path, header_prefix, folder, subfolders=None): + for t in target: + target_path = t.basepath + path + t.name + "/" components_file = target_path + t.prefix + header_prefix if os.path.exists(components_file): include_list = create_include_list(target_path + folder) @@ -60,7 +74,7 @@ def include_components(path, header_prefix, folder, subfolders=None): if __name__ == "__main__": # Include kernels - include_components(core_path, "Kernels.h", "kernels", ["arm32", "arm64"]) + include_components(core_targets, core_path, "Kernels.h", "kernels", ["arm32", "arm64"]) # Include functions - include_components(runtime_path, "Functions.h", "functions") + include_components(runtime_targets, runtime_path, "Functions.h", "functions") diff --git a/src/core/NEON/NEKernels.h b/src/core/NEON/NEKernels.h index c1924d6739..67562933d4 100644 --- a/src/core/NEON/NEKernels.h +++ b/src/core/NEON/NEKernels.h @@ -146,6 +146,7 @@ #include "src/core/NEON/kernels/NEWarpKernel.h" #include "src/core/NEON/kernels/NEWeightsReshapeKernel.h" #include "src/core/NEON/kernels/NEWidthConcatenateLayerKernel.h" +#include "src/core/NEON/kernels/NEWinogradConvolutionLayerKernel.h" #include "src/core/NEON/kernels/NEYOLOLayerKernel.h" #endif /* ARM_COMPUTE_NEKERNELS_H */ -- cgit v1.2.1