Michele Di Giorgio | d02d5ed | 2021-01-22 09:47:04 +0000 | [diff] [blame] | 1 | # Copyright (c) 2016-2021 Arm Limited. |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 2 | # |
| 3 | # SPDX-License-Identifier: MIT |
| 4 | # |
| 5 | # Permission is hereby granted, free of charge, to any person obtaining a copy |
| 6 | # of this software and associated documentation files (the "Software"), to |
| 7 | # deal in the Software without restriction, including without limitation the |
| 8 | # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or |
| 9 | # sell copies of the Software, and to permit persons to whom the Software is |
| 10 | # furnished to do so, subject to the following conditions: |
| 11 | # |
| 12 | # The above copyright notice and this permission notice shall be included in all |
| 13 | # copies or substantial portions of the Software. |
| 14 | # |
| 15 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 16 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 17 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 18 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 19 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 20 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
| 21 | # SOFTWARE. |
| 22 | import collections |
| 23 | import os.path |
| 24 | import re |
| 25 | import subprocess |
Georgios Pinitas | ea85727 | 2021-01-22 05:47:37 +0000 | [diff] [blame] | 26 | import zlib |
Georgios Pinitas | bdcdc39 | 2021-04-22 16:42:03 +0100 | [diff] [blame] | 27 | import json |
Adnan AlSinan | 39aebd1 | 2021-08-06 12:44:51 +0100 | [diff] [blame] | 28 | import codecs |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 29 | |
| 30 | VERSION = "v0.0-unreleased" |
Freddie Liardet | 1562af3 | 2021-08-04 12:22:51 +0100 | [diff] [blame] | 31 | LIBRARY_VERSION_MAJOR = 24 |
Sang-Hoon Park | 6d0b384 | 2020-08-14 14:48:08 +0100 | [diff] [blame] | 32 | LIBRARY_VERSION_MINOR = 0 |
Georgios Pinitas | 35fcc43 | 2020-03-26 18:47:46 +0000 | [diff] [blame] | 33 | LIBRARY_VERSION_PATCH = 0 |
| 34 | SONAME_VERSION = str(LIBRARY_VERSION_MAJOR) + "." + str(LIBRARY_VERSION_MINOR) + "." + str(LIBRARY_VERSION_PATCH) |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 35 | |
| 36 | Import('env') |
| 37 | Import('vars') |
Anthony Barbier | 01bbd5f | 2018-11-01 15:10:51 +0000 | [diff] [blame] | 38 | Import('install_lib') |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 39 | |
Michalis Spyrou | 748a7c8 | 2019-10-07 13:00:44 +0100 | [diff] [blame] | 40 | def build_bootcode_objs(sources): |
Michalis Spyrou | 20fca52 | 2021-06-07 14:23:57 +0100 | [diff] [blame] | 41 | |
Michalis Spyrou | 748a7c8 | 2019-10-07 13:00:44 +0100 | [diff] [blame] | 42 | arm_compute_env.Append(ASFLAGS = "-I bootcode/") |
| 43 | obj = arm_compute_env.Object(sources) |
| 44 | obj = install_lib(obj) |
| 45 | Default(obj) |
| 46 | return obj |
| 47 | |
Georgios Pinitas | bdcdc39 | 2021-04-22 16:42:03 +0100 | [diff] [blame] | 48 | def build_sve_objs(sources): |
Michalis Spyrou | 20fca52 | 2021-06-07 14:23:57 +0100 | [diff] [blame] | 49 | |
Georgios Pinitas | bdcdc39 | 2021-04-22 16:42:03 +0100 | [diff] [blame] | 50 | tmp_env = arm_compute_env.Clone() |
| 51 | tmp_env.Append(CXXFLAGS = "-march=armv8.2-a+sve+fp16") |
| 52 | obj = tmp_env.SharedObject(sources) |
Georgios Pinitas | bdcdc39 | 2021-04-22 16:42:03 +0100 | [diff] [blame] | 53 | Default(obj) |
| 54 | return obj |
| 55 | |
Michalis Spyrou | 20fca52 | 2021-06-07 14:23:57 +0100 | [diff] [blame] | 56 | def build_objs(sources): |
| 57 | |
| 58 | obj = arm_compute_env.SharedObject(sources) |
Michalis Spyrou | 20fca52 | 2021-06-07 14:23:57 +0100 | [diff] [blame] | 59 | Default(obj) |
| 60 | return obj |
| 61 | |
Georgios Pinitas | 4d9687e | 2020-10-21 18:33:36 +0100 | [diff] [blame] | 62 | def build_library(name, build_env, sources, static=False, libs=[]): |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 63 | if static: |
Georgios Pinitas | 4d9687e | 2020-10-21 18:33:36 +0100 | [diff] [blame] | 64 | obj = build_env.StaticLibrary(name, source=sources, LIBS = arm_compute_env["LIBS"] + libs) |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 65 | else: |
| 66 | if env['set_soname']: |
Georgios Pinitas | 4d9687e | 2020-10-21 18:33:36 +0100 | [diff] [blame] | 67 | obj = build_env.SharedLibrary(name, source=sources, SHLIBVERSION = SONAME_VERSION, LIBS = arm_compute_env["LIBS"] + libs) |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 68 | else: |
Georgios Pinitas | 4d9687e | 2020-10-21 18:33:36 +0100 | [diff] [blame] | 69 | obj = build_env.SharedLibrary(name, source=sources, LIBS = arm_compute_env["LIBS"] + libs) |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 70 | |
Anthony Barbier | 01bbd5f | 2018-11-01 15:10:51 +0000 | [diff] [blame] | 71 | obj = install_lib(obj) |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 72 | Default(obj) |
| 73 | return obj |
| 74 | |
Georgios Pinitas | f605bd2 | 2020-11-26 11:55:09 +0000 | [diff] [blame] | 75 | def remove_incode_comments(code): |
| 76 | def replace_with_empty(match): |
| 77 | s = match.group(0) |
| 78 | if s.startswith('/'): |
| 79 | return " " |
| 80 | else: |
| 81 | return s |
| 82 | |
| 83 | comment_regex = re.compile(r'//.*?$|/\*.*?\*/|\'(?:\\.|[^\\\'])*\'|"(?:\\.|[^\\"])*"', re.DOTALL | re.MULTILINE) |
| 84 | return re.sub(comment_regex, replace_with_empty, code) |
| 85 | |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 86 | def resolve_includes(target, source, env): |
| 87 | # File collection |
| 88 | FileEntry = collections.namedtuple('FileEntry', 'target_name file_contents') |
| 89 | |
| 90 | # Include pattern |
| 91 | pattern = re.compile("#include \"(.*)\"") |
| 92 | |
| 93 | # Get file contents |
| 94 | files = [] |
| 95 | for i in range(len(source)): |
| 96 | src = source[i] |
| 97 | dst = target[i] |
Georgios Pinitas | f605bd2 | 2020-11-26 11:55:09 +0000 | [diff] [blame] | 98 | contents = src.get_contents().decode('utf-8') |
| 99 | contents = remove_incode_comments(contents).splitlines() |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 100 | entry = FileEntry(target_name=dst, file_contents=contents) |
| 101 | files.append((os.path.basename(src.get_path()),entry)) |
| 102 | |
| 103 | # Create dictionary of tupled list |
| 104 | files_dict = dict(files) |
| 105 | |
| 106 | # Check for includes (can only be files in the same folder) |
| 107 | final_files = [] |
| 108 | for file in files: |
| 109 | done = False |
| 110 | tmp_file = file[1].file_contents |
| 111 | while not done: |
| 112 | file_count = 0 |
| 113 | updated_file = [] |
| 114 | for line in tmp_file: |
| 115 | found = pattern.search(line) |
| 116 | if found: |
| 117 | include_file = found.group(1) |
| 118 | data = files_dict[include_file].file_contents |
| 119 | updated_file.extend(data) |
| 120 | else: |
| 121 | updated_file.append(line) |
| 122 | file_count += 1 |
| 123 | |
| 124 | # Check if all include are replaced. |
| 125 | if file_count == len(tmp_file): |
| 126 | done = True |
| 127 | |
| 128 | # Update temp file |
| 129 | tmp_file = updated_file |
| 130 | |
| 131 | # Append and prepend string literal identifiers and add expanded file to final list |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 132 | entry = FileEntry(target_name=file[1].target_name, file_contents=tmp_file) |
| 133 | final_files.append((file[0], entry)) |
| 134 | |
| 135 | # Write output files |
| 136 | for file in final_files: |
| 137 | with open(file[1].target_name.get_path(), 'w+') as out_file: |
Georgios Pinitas | ea85727 | 2021-01-22 05:47:37 +0000 | [diff] [blame] | 138 | file_to_write = "\n".join( file[1].file_contents ) |
| 139 | if env['compress_kernels']: |
Adnan AlSinan | 39aebd1 | 2021-08-06 12:44:51 +0100 | [diff] [blame] | 140 | file_to_write = zlib.compress(file_to_write.encode('utf-8'), 9) |
| 141 | file_to_write = codecs.encode(file_to_write, "base64").decode('utf-8').replace("\n", "") |
Georgios Pinitas | ea85727 | 2021-01-22 05:47:37 +0000 | [diff] [blame] | 142 | file_to_write = "R\"(" + file_to_write + ")\"" |
| 143 | out_file.write(file_to_write) |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 144 | |
| 145 | def create_version_file(target, source, env): |
| 146 | # Generate string with build options library version to embed in the library: |
| 147 | try: |
| 148 | git_hash = subprocess.check_output(["git", "rev-parse", "HEAD"]) |
| 149 | except (OSError, subprocess.CalledProcessError): |
| 150 | git_hash="unknown" |
| 151 | |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 152 | build_info = "\"arm_compute_version=%s Build options: %s Git hash=%s\"" % (VERSION, vars.args, git_hash.strip()) |
| 153 | with open(target[0].get_path(), "w") as fd: |
| 154 | fd.write(build_info) |
| 155 | |
Michalis Spyrou | 20fca52 | 2021-06-07 14:23:57 +0100 | [diff] [blame] | 156 | def get_cpu_runtime_files(operator): |
| 157 | file_list = [] |
| 158 | operators = filelist['cpu']['operators'] |
| 159 | |
| 160 | if "operator" in operators[operator]["files"]: |
| 161 | file_list += operators[operator]["files"]["operator"] |
| 162 | return file_list |
| 163 | |
| 164 | def get_gpu_runtime_files(operator): |
| 165 | file_list = [] |
| 166 | operators = filelist['gpu']['operators'] |
| 167 | |
| 168 | if "operator" in operators[operator]["files"]: |
| 169 | file_list += operators[operator]["files"]["operator"] |
| 170 | return file_list |
| 171 | |
| 172 | def get_cpu_kernel_files(operator): |
| 173 | |
| 174 | file_list = [] |
| 175 | file_list_sve = [] |
| 176 | operators = filelist['cpu']['operators'] |
| 177 | |
| 178 | if env['estate'] == '64' and "neon" in operators[operator]['files'] and "estate64" in operators[operator]['files']['neon']: |
| 179 | file_list += operators[operator]['files']['neon']['estate64'] |
| 180 | if env['estate'] == '32' and "neon" in operators[operator]['files'] and "estate32" in operators[operator]['files']['neon']: |
| 181 | file_list += operators[operator]['files']['neon']['estate32'] |
| 182 | |
| 183 | if "kernel" in operators[operator]["files"]: |
| 184 | file_list += operators[operator]["files"]["kernel"] |
| 185 | |
| 186 | if ("neon" in operators[operator]["files"]): |
| 187 | if any(i in env['data_type_support'] for i in ['all', 'qasymm8']) and ("qasymm8" in operators[operator]["files"]["neon"]): |
| 188 | file_list += operators[operator]["files"]["neon"]["qasymm8"] |
| 189 | if any(i in env['data_type_support'] for i in ['all', 'qasymm8_signed']) and ("qasymm8_signed" in operators[operator]["files"]["neon"]): |
| 190 | file_list += operators[operator]["files"]["neon"]["qasymm8_signed"] |
| 191 | if any(i in env['data_type_support'] for i in ['all', 'qsymm16']) and ("qsymm16" in operators[operator]["files"]["neon"]): |
| 192 | file_list += operators[operator]["files"]["neon"]["qsymm16"] |
| 193 | if any(i in env['data_type_support'] for i in ['all', 'integer']) and ("integer" in operators[operator]["files"]["neon"]): |
| 194 | file_list += operators[operator]["files"]["neon"]["integer"] |
| 195 | |
| 196 | if (not "sve" in env['arch'] or env['fat_binary']) and ("neon" in operators[operator]["files"]): |
| 197 | if any(i in env['data_type_support'] for i in ['all', 'fp16']) and ("fp16" in operators[operator]["files"]["neon"]): |
| 198 | file_list += operators[operator]["files"]["neon"]["fp16"] |
| 199 | if any(i in env['data_type_support'] for i in ['all', 'fp32']) and ("fp32" in operators[operator]["files"]["neon"]): |
| 200 | file_list += operators[operator]["files"]["neon"]["fp32"] |
| 201 | if any(i in env['data_layout_support'] for i in ['all', 'nchw']) and ("nchw" in operators[operator]["files"]["neon"]): |
| 202 | file_list += operators[operator]['files']['neon']['nchw'] |
| 203 | if ("all" in operators[operator]["files"]["neon"]): |
| 204 | file_list += operators[operator]["files"]["neon"]["all"] |
| 205 | if ("sve" in env['arch'] or env['fat_binary']) and ("sve" in operators[operator]["files"]): |
| 206 | if any(i in env['data_type_support'] for i in ['all', 'fp16']) and ("fp16" in operators[operator]["files"]["sve"]): |
| 207 | file_list_sve += operators[operator]["files"]["sve"]["fp16"] |
| 208 | if any(i in env['data_type_support'] for i in ['all', 'fp32']) and ("fp32" in operators[operator]["files"]["sve"]): |
| 209 | file_list_sve += operators[operator]["files"]["sve"]["fp32"] |
| 210 | if any(i in env['data_type_support'] for i in ['all', 'qasymm8']) and ("qasymm8" in operators[operator]["files"]["sve"]): |
| 211 | file_list_sve += operators[operator]["files"]["sve"]["qasymm8"] |
| 212 | if any(i in env['data_type_support'] for i in ['all', 'qasymm8_signed']) and ("qasymm8_signed" in operators[operator]["files"]["sve"]): |
| 213 | file_list_sve += operators[operator]["files"]["sve"]["qasymm8_signed"] |
| 214 | if any(i in env['data_type_support'] for i in ['all', 'qsymm16']) and ("qsymm16" in operators[operator]["files"]["sve"]): |
| 215 | file_list_sve += operators[operator]["files"]["sve"]["qsymm16"] |
| 216 | if any(i in env['data_type_support'] for i in ['all', 'integer']) and ("integer" in operators[operator]["files"]["sve"]): |
| 217 | file_list_sve += operators[operator]["files"]["sve"]["integer"] |
| 218 | if ("all" in operators[operator]["files"]["sve"]): |
| 219 | file_list_sve += operators[operator]["files"]["sve"]["all"] |
| 220 | |
| 221 | return file_list, file_list_sve |
| 222 | |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 223 | arm_compute_env = env.Clone() |
Anthony Barbier | 0e72c69 | 2018-08-24 11:22:08 +0100 | [diff] [blame] | 224 | version_file = arm_compute_env.Command("src/core/arm_compute_version.embed", "", action=create_version_file) |
| 225 | arm_compute_env.AlwaysBuild(version_file) |
Anthony Barbier | 6a3daf1 | 2018-02-19 17:24:27 +0000 | [diff] [blame] | 226 | |
Georgios Pinitas | 4551403 | 2020-12-30 00:03:09 +0000 | [diff] [blame] | 227 | default_cpp_compiler = 'g++' if env['os'] not in ['android', 'macos'] else 'clang++' |
Georgios Pinitas | 4d9687e | 2020-10-21 18:33:36 +0100 | [diff] [blame] | 228 | cpp_compiler = os.environ.get('CXX', default_cpp_compiler) |
| 229 | |
Anthony Barbier | 6a3daf1 | 2018-02-19 17:24:27 +0000 | [diff] [blame] | 230 | # Generate embed files |
Anthony Barbier | 0e72c69 | 2018-08-24 11:22:08 +0100 | [diff] [blame] | 231 | generate_embed = [ version_file ] |
Anthony Barbier | 6a3daf1 | 2018-02-19 17:24:27 +0000 | [diff] [blame] | 232 | if env['opencl'] and env['embed_kernels']: |
Adnan AlSinan | 7075fe2 | 2021-07-05 13:12:52 +0100 | [diff] [blame] | 233 | |
| 234 | # Header files |
| 235 | cl_helper_files = [ 'src/core/CL/cl_kernels/activation_float_helpers.h', |
| 236 | 'src/core/CL/cl_kernels/activation_quant_helpers.h', |
| 237 | 'src/core/CL/cl_kernels/gemm_helpers.h', |
| 238 | 'src/core/CL/cl_kernels/helpers_asymm.h', |
| 239 | 'src/core/CL/cl_kernels/helpers.h', |
| 240 | 'src/core/CL/cl_kernels/load_store_utility.h', |
| 241 | 'src/core/CL/cl_kernels/repeat.h', |
| 242 | 'src/core/CL/cl_kernels/tile_helpers.h', |
| 243 | 'src/core/CL/cl_kernels/types.h', |
Adnan AlSinan | 7075fe2 | 2021-07-05 13:12:52 +0100 | [diff] [blame] | 244 | 'src/core/CL/cl_kernels/warp_helpers.h' |
| 245 | ] |
Anthony Barbier | 6a3daf1 | 2018-02-19 17:24:27 +0000 | [diff] [blame] | 246 | |
Adnan AlSinan | 7075fe2 | 2021-07-05 13:12:52 +0100 | [diff] [blame] | 247 | # Common kernels |
| 248 | cl_files_common = ['src/core/CL/cl_kernels/common/activation_layer.cl', |
| 249 | 'src/core/CL/cl_kernels/common/activation_layer_quant.cl', |
| 250 | 'src/core/CL/cl_kernels/common/arg_min_max.cl', |
| 251 | 'src/core/CL/cl_kernels/common/batchnormalization_layer.cl', |
| 252 | 'src/core/CL/cl_kernels/common/bounding_box_transform.cl', |
| 253 | 'src/core/CL/cl_kernels/common/bounding_box_transform_quantized.cl', |
| 254 | 'src/core/CL/cl_kernels/common/bitwise_op.cl', |
| 255 | 'src/core/CL/cl_kernels/common/cast.cl', |
| 256 | 'src/core/CL/cl_kernels/common/comparisons.cl', |
| 257 | 'src/core/CL/cl_kernels/common/concatenate.cl', |
| 258 | 'src/core/CL/cl_kernels/common/col2im.cl', |
| 259 | 'src/core/CL/cl_kernels/common/convert_fc_weights.cl', |
| 260 | 'src/core/CL/cl_kernels/common/copy_tensor.cl', |
| 261 | 'src/core/CL/cl_kernels/common/crop_tensor.cl', |
| 262 | 'src/core/CL/cl_kernels/common/deconvolution_layer.cl', |
| 263 | 'src/core/CL/cl_kernels/common/dequantization_layer.cl', |
| 264 | 'src/core/CL/cl_kernels/common/elementwise_operation.cl', |
| 265 | 'src/core/CL/cl_kernels/common/elementwise_operation_quantized.cl', |
| 266 | 'src/core/CL/cl_kernels/common/elementwise_unary.cl', |
| 267 | 'src/core/CL/cl_kernels/common/fft_digit_reverse.cl', |
| 268 | 'src/core/CL/cl_kernels/common/fft.cl', |
| 269 | 'src/core/CL/cl_kernels/common/fft_scale.cl', |
| 270 | 'src/core/CL/cl_kernels/common/fill_border.cl', |
| 271 | 'src/core/CL/cl_kernels/common/floor.cl', |
| 272 | 'src/core/CL/cl_kernels/common/gather.cl', |
| 273 | 'src/core/CL/cl_kernels/common/gemm.cl', |
| 274 | 'src/core/CL/cl_kernels/common/gemv.cl', |
| 275 | 'src/core/CL/cl_kernels/common/gemm_v1.cl', |
| 276 | 'src/core/CL/cl_kernels/common/gemmlowp.cl', |
| 277 | 'src/core/CL/cl_kernels/common/generate_proposals.cl', |
| 278 | 'src/core/CL/cl_kernels/common/generate_proposals_quantized.cl', |
| 279 | 'src/core/CL/cl_kernels/common/instance_normalization.cl', |
| 280 | 'src/core/CL/cl_kernels/common/l2_normalize.cl', |
| 281 | 'src/core/CL/cl_kernels/common/mean_stddev_normalization.cl', |
| 282 | 'src/core/CL/cl_kernels/common/unpooling_layer.cl', |
| 283 | 'src/core/CL/cl_kernels/common/memset.cl', |
| 284 | 'src/core/CL/cl_kernels/common/nonmax.cl', |
| 285 | 'src/core/CL/cl_kernels/common/minmax_layer.cl', |
| 286 | 'src/core/CL/cl_kernels/common/pad_layer.cl', |
| 287 | 'src/core/CL/cl_kernels/common/permute.cl', |
| 288 | 'src/core/CL/cl_kernels/common/pixelwise_mul_float.cl', |
| 289 | 'src/core/CL/cl_kernels/common/pixelwise_mul_int.cl', |
| 290 | 'src/core/CL/cl_kernels/common/qlstm_layer_normalization.cl', |
| 291 | 'src/core/CL/cl_kernels/common/quantization_layer.cl', |
| 292 | 'src/core/CL/cl_kernels/common/range.cl', |
| 293 | 'src/core/CL/cl_kernels/common/reduction_operation.cl', |
Adnan AlSinan | 7075fe2 | 2021-07-05 13:12:52 +0100 | [diff] [blame] | 294 | 'src/core/CL/cl_kernels/common/reshape_layer.cl', |
| 295 | 'src/core/CL/cl_kernels/common/convolution_layer.cl', |
| 296 | 'src/core/CL/cl_kernels/common/reverse.cl', |
| 297 | 'src/core/CL/cl_kernels/common/roi_align_layer.cl', |
| 298 | 'src/core/CL/cl_kernels/common/roi_align_layer_quantized.cl', |
| 299 | 'src/core/CL/cl_kernels/common/roi_pooling_layer.cl', |
| 300 | 'src/core/CL/cl_kernels/common/select.cl', |
| 301 | 'src/core/CL/cl_kernels/common/softmax_layer.cl', |
| 302 | 'src/core/CL/cl_kernels/common/softmax_layer_quantized.cl', |
| 303 | 'src/core/CL/cl_kernels/common/stack_layer.cl', |
| 304 | 'src/core/CL/cl_kernels/common/slice_ops.cl', |
| 305 | 'src/core/CL/cl_kernels/common/tile.cl', |
| 306 | 'src/core/CL/cl_kernels/common/transpose.cl' |
| 307 | ] |
| 308 | |
| 309 | # NCHW kernels |
| 310 | cl_files_nchw = ['src/core/CL/cl_kernels/nchw/batch_to_space.cl', |
| 311 | 'src/core/CL/cl_kernels/nchw/batchnormalization_layer.cl', |
| 312 | 'src/core/CL/cl_kernels/nchw/channel_shuffle.cl', |
| 313 | 'src/core/CL/cl_kernels/nchw/depth_to_space.cl', |
| 314 | 'src/core/CL/cl_kernels/nchw/direct_convolution_quantized.cl', |
| 315 | 'src/core/CL/cl_kernels/nchw/direct_convolution1x1.cl', |
| 316 | 'src/core/CL/cl_kernels/nchw/direct_convolution3x3.cl', |
| 317 | 'src/core/CL/cl_kernels/nchw/direct_convolution5x5.cl', |
| 318 | 'src/core/CL/cl_kernels/nchw/dequantization_layer.cl', |
| 319 | 'src/core/CL/cl_kernels/nchw/im2col.cl', |
| 320 | 'src/core/CL/cl_kernels/nchw/normalization_layer.cl', |
| 321 | 'src/core/CL/cl_kernels/nchw/normalize_planar_yuv_layer.cl', |
| 322 | 'src/core/CL/cl_kernels/nchw/normalize_planar_yuv_layer_quantized.cl', |
| 323 | 'src/core/CL/cl_kernels/nchw/pooling_layer.cl', |
Adnan AlSinan | 7075fe2 | 2021-07-05 13:12:52 +0100 | [diff] [blame] | 324 | 'src/core/CL/cl_kernels/nchw/prior_box_layer.cl', |
| 325 | 'src/core/CL/cl_kernels/nchw/remap.cl', |
| 326 | 'src/core/CL/cl_kernels/nchw/reorg_layer.cl', |
| 327 | 'src/core/CL/cl_kernels/nchw/scale.cl', |
Adnan AlSinan | 7075fe2 | 2021-07-05 13:12:52 +0100 | [diff] [blame] | 328 | 'src/core/CL/cl_kernels/nchw/space_to_batch.cl', |
| 329 | 'src/core/CL/cl_kernels/nchw/space_to_depth.cl', |
| 330 | 'src/core/CL/cl_kernels/nchw/upsample_layer.cl', |
| 331 | 'src/core/CL/cl_kernels/nchw/winograd_filter_transform.cl', |
| 332 | 'src/core/CL/cl_kernels/nchw/winograd_input_transform.cl', |
| 333 | 'src/core/CL/cl_kernels/nchw/winograd_output_transform.cl' |
| 334 | ] |
| 335 | |
| 336 | # NHWC kernels |
| 337 | cl_files_nhwc = ['src/core/CL/cl_kernels/nhwc/batch_to_space.cl', |
| 338 | 'src/core/CL/cl_kernels/nhwc/batchnormalization_layer.cl', |
| 339 | 'src/core/CL/cl_kernels/nhwc/channel_shuffle.cl', |
| 340 | 'src/core/CL/cl_kernels/nhwc/direct_convolution.cl', |
| 341 | 'src/core/CL/cl_kernels/nhwc/depth_to_space.cl', |
| 342 | 'src/core/CL/cl_kernels/nhwc/dequantization_layer.cl', |
| 343 | 'src/core/CL/cl_kernels/nhwc/dwc_native_fp_nhwc.cl', |
| 344 | 'src/core/CL/cl_kernels/nhwc/dwc_native_quantized_nhwc.cl', |
| 345 | 'src/core/CL/cl_kernels/nhwc/im2col.cl', |
| 346 | 'src/core/CL/cl_kernels/nhwc/normalization_layer.cl', |
| 347 | 'src/core/CL/cl_kernels/nhwc/normalize_planar_yuv_layer.cl', |
| 348 | 'src/core/CL/cl_kernels/nhwc/normalize_planar_yuv_layer_quantized.cl', |
| 349 | 'src/core/CL/cl_kernels/nhwc/pooling_layer.cl', |
| 350 | 'src/core/CL/cl_kernels/nhwc/pooling_layer_quantized.cl', |
| 351 | 'src/core/CL/cl_kernels/nhwc/remap.cl', |
| 352 | 'src/core/CL/cl_kernels/nhwc/reorg_layer.cl', |
| 353 | 'src/core/CL/cl_kernels/nhwc/scale.cl', |
Adnan AlSinan | 7075fe2 | 2021-07-05 13:12:52 +0100 | [diff] [blame] | 354 | 'src/core/CL/cl_kernels/nhwc/space_to_batch.cl', |
| 355 | 'src/core/CL/cl_kernels/nhwc/space_to_depth.cl', |
| 356 | 'src/core/CL/cl_kernels/nhwc/upsample_layer.cl', |
| 357 | 'src/core/CL/cl_kernels/nhwc/winograd_filter_transform.cl', |
| 358 | 'src/core/CL/cl_kernels/nhwc/winograd_input_transform.cl', |
| 359 | 'src/core/CL/cl_kernels/nhwc/winograd_output_transform.cl' |
| 360 | ] |
| 361 | |
| 362 | cl_files = cl_helper_files + cl_files_common + cl_files_nchw + cl_files_nhwc |
| 363 | |
| 364 | embed_files = [ f+"embed" for f in cl_files ] |
Anthony Barbier | 6a3daf1 | 2018-02-19 17:24:27 +0000 | [diff] [blame] | 365 | arm_compute_env.Append(CPPPATH =[Dir("./src/core/CL/").path] ) |
| 366 | |
| 367 | generate_embed.append(arm_compute_env.Command(embed_files, cl_files, action=resolve_includes)) |
| 368 | |
Anthony Barbier | 6a3daf1 | 2018-02-19 17:24:27 +0000 | [diff] [blame] | 369 | Default(generate_embed) |
| 370 | if env["build"] == "embed_only": |
| 371 | Return() |
| 372 | |
Georgios Pinitas | 35fcc43 | 2020-03-26 18:47:46 +0000 | [diff] [blame] | 373 | # Append version defines for semantic versioning |
| 374 | arm_compute_env.Append(CPPDEFINES = [('ARM_COMPUTE_VERSION_MAJOR', LIBRARY_VERSION_MAJOR), |
| 375 | ('ARM_COMPUTE_VERSION_MINOR', LIBRARY_VERSION_MINOR), |
| 376 | ('ARM_COMPUTE_VERSION_PATCH', LIBRARY_VERSION_PATCH)]) |
| 377 | |
Isabella Gottardi | b28f29d | 2017-11-09 17:05:07 +0000 | [diff] [blame] | 378 | # Don't allow undefined references in the libraries: |
Georgios Pinitas | 4551403 | 2020-12-30 00:03:09 +0000 | [diff] [blame] | 379 | undefined_flag = '-Wl,-undefined,error' if 'macos' in arm_compute_env["os"] else '-Wl,--no-undefined' |
| 380 | arm_compute_env.Append(LINKFLAGS=[undefined_flag]) |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 381 | arm_compute_env.Append(CPPPATH =[Dir("./src/core/").path] ) |
| 382 | |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 383 | arm_compute_env.Append(LIBS = ['dl']) |
| 384 | |
Georgios Pinitas | bdcdc39 | 2021-04-22 16:42:03 +0100 | [diff] [blame] | 385 | with (open(Dir('#').path + '/filelist.json')) as fp: |
| 386 | filelist = json.load(fp) |
| 387 | |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 388 | core_files = Glob('src/core/*.cpp') |
| 389 | core_files += Glob('src/core/CPP/*.cpp') |
| 390 | core_files += Glob('src/core/CPP/kernels/*.cpp') |
Sang-Hoon Park | 68dd25f | 2020-10-19 16:00:11 +0100 | [diff] [blame] | 391 | core_files += Glob('src/core/helpers/*.cpp') |
Sang-Hoon Park | 3687ee1 | 2020-06-24 13:34:04 +0100 | [diff] [blame] | 392 | core_files += Glob('src/core/utils/*.cpp') |
Michalis Spyrou | 7043d36 | 2018-12-03 13:58:32 +0000 | [diff] [blame] | 393 | core_files += Glob('src/core/utils/helpers/*.cpp') |
| 394 | core_files += Glob('src/core/utils/io/*.cpp') |
| 395 | core_files += Glob('src/core/utils/quantization/*.cpp') |
Georgios Pinitas | b8d5b95 | 2019-05-16 14:13:03 +0100 | [diff] [blame] | 396 | core_files += Glob('src/core/utils/misc/*.cpp') |
Michalis Spyrou | 7043d36 | 2018-12-03 13:58:32 +0000 | [diff] [blame] | 397 | if env["logging"]: |
| 398 | core_files += Glob('src/core/utils/logging/*.cpp') |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 399 | |
Michalis Spyrou | 62c2ad6 | 2021-06-21 17:40:09 +0100 | [diff] [blame] | 400 | runtime_files_hp = Glob('src/runtime/*.cpp') |
| 401 | runtime_files_hp += Glob('src/runtime/CPP/ICPPSimpleFunction.cpp') |
| 402 | runtime_files = Glob('src/runtime/CPP/functions/*.cpp') |
Georgios Pinitas | 8795ffb | 2017-12-01 16:13:40 +0000 | [diff] [blame] | 403 | |
Georgios Pinitas | c3c352e | 2021-03-18 10:59:40 +0000 | [diff] [blame] | 404 | # C API files |
Georgios Pinitas | 13ef176 | 2021-07-14 17:14:43 +0100 | [diff] [blame] | 405 | runtime_files_hp += filelist['c_api']['common'] |
Georgios Pinitas | 4164814 | 2021-08-03 08:24:00 +0100 | [diff] [blame] | 406 | runtime_files_hp += filelist['c_api']['operators'] |
Georgios Pinitas | bdcdc39 | 2021-04-22 16:42:03 +0100 | [diff] [blame] | 407 | |
Georgios Pinitas | c3c352e | 2021-03-18 10:59:40 +0000 | [diff] [blame] | 408 | if env['opencl']: |
Michalis Spyrou | 62c2ad6 | 2021-06-21 17:40:09 +0100 | [diff] [blame] | 409 | runtime_files_hp += filelist['c_api']['gpu'] |
Georgios Pinitas | 8a5146f | 2021-01-12 15:51:07 +0000 | [diff] [blame] | 410 | |
Georgios Pinitas | c3c352e | 2021-03-18 10:59:40 +0000 | [diff] [blame] | 411 | # Common backend files |
Georgios Pinitas | bdcdc39 | 2021-04-22 16:42:03 +0100 | [diff] [blame] | 412 | core_files += filelist['common'] |
Georgios Pinitas | c3c352e | 2021-03-18 10:59:40 +0000 | [diff] [blame] | 413 | |
Michalis Spyrou | 20fca52 | 2021-06-07 14:23:57 +0100 | [diff] [blame] | 414 | # Initialize high priority core files |
| 415 | core_files_hp = core_files |
| 416 | core_files_sve_hp = [] |
| 417 | core_files = [] |
| 418 | |
Michalis Spyrou | 62c2ad6 | 2021-06-21 17:40:09 +0100 | [diff] [blame] | 419 | runtime_files_hp += Glob('src/runtime/CPP/SingleThreadScheduler.cpp') |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 420 | |
Georgios Pinitas | d9eb275 | 2018-04-03 13:44:29 +0100 | [diff] [blame] | 421 | graph_files = Glob('src/graph/*.cpp') |
| 422 | graph_files += Glob('src/graph/*/*.cpp') |
Georgios Pinitas | d8734b5 | 2017-12-22 15:27:52 +0000 | [diff] [blame] | 423 | |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 424 | if env['cppthreads']: |
Michalis Spyrou | 62c2ad6 | 2021-06-21 17:40:09 +0100 | [diff] [blame] | 425 | runtime_files_hp += Glob('src/runtime/CPP/CPPScheduler.cpp') |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 426 | |
| 427 | if env['openmp']: |
Michalis Spyrou | 62c2ad6 | 2021-06-21 17:40:09 +0100 | [diff] [blame] | 428 | runtime_files_hp += Glob('src/runtime/OMP/OMPScheduler.cpp') |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 429 | |
| 430 | if env['opencl']: |
Michalis Spyrou | 20fca52 | 2021-06-07 14:23:57 +0100 | [diff] [blame] | 431 | operators = filelist['gpu']['operators'] |
| 432 | for operator in operators: |
Michele Di Giorgio | 760c783 | 2021-08-05 10:54:13 +0100 | [diff] [blame] | 433 | if operator in filelist['gpu']['high_priority']: |
| 434 | runtime_files_hp += get_gpu_runtime_files(operator) |
| 435 | if "kernel" in operators[operator]["files"]: |
| 436 | core_files_hp += operators[operator]["files"]["kernel"] |
| 437 | else: |
| 438 | runtime_files += get_gpu_runtime_files(operator) |
| 439 | if "kernel" in operators[operator]["files"]: |
| 440 | core_files += operators[operator]["files"]["kernel"] |
| 441 | |
| 442 | runtime_files_hp += filelist['gpu']['common'] |
| 443 | runtime_files += Glob('src/runtime/CL/functions/*.cpp') |
Georgios Pinitas | d8734b5 | 2017-12-22 15:27:52 +0000 | [diff] [blame] | 444 | |
Georgios Pinitas | 13ef176 | 2021-07-14 17:14:43 +0100 | [diff] [blame] | 445 | graph_files += Glob('src/graph/backends/CL/*.cpp') |
| 446 | |
Georgios Pinitas | bdcdc39 | 2021-04-22 16:42:03 +0100 | [diff] [blame] | 447 | sve_o = [] |
| 448 | core_files_sve = [] |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 449 | if env['neon']: |
| 450 | core_files += Glob('src/core/NEON/*.cpp') |
Pablo Tello | eb82fd2 | 2018-02-23 13:43:50 +0000 | [diff] [blame] | 451 | |
Georgios Pinitas | 30271c7 | 2019-06-24 14:56:34 +0100 | [diff] [blame] | 452 | # build winograd/depthwise sources for either v7a / v8a |
Sang-Hoon Park | 68dd25f | 2020-10-19 16:00:11 +0100 | [diff] [blame] | 453 | arm_compute_env.Append(CPPPATH = ["src/core/NEON/kernels/convolution/common/", |
Michele Di Giorgio | 6ad60af | 2020-06-09 14:52:15 +0100 | [diff] [blame] | 454 | "src/core/NEON/kernels/convolution/winograd/", |
Sang-Hoon Park | 68dd25f | 2020-10-19 16:00:11 +0100 | [diff] [blame] | 455 | "src/core/NEON/kernels/convolution/depthwise/", |
| 456 | "src/core/NEON/kernels/assembly/", |
Sang-Hoon Park | 4f7693d | 2021-05-12 13:59:10 +0100 | [diff] [blame] | 457 | "arm_compute/core/NEON/kernels/assembly/", |
Georgios Pinitas | 7891a73 | 2021-08-20 21:39:25 +0100 | [diff] [blame] | 458 | "src/cpu/kernels/assembly/",]) |
Pablo Tello | 9ceebbe | 2018-01-10 16:44:13 +0000 | [diff] [blame] | 459 | |
Michalis Spyrou | 20fca52 | 2021-06-07 14:23:57 +0100 | [diff] [blame] | 460 | # Load files based on user's options |
| 461 | operators = filelist['cpu']['operators'] |
| 462 | for operator in operators: |
Michalis Spyrou | 20fca52 | 2021-06-07 14:23:57 +0100 | [diff] [blame] | 463 | if operator in filelist['cpu']['high_priority']: |
Michalis Spyrou | 62c2ad6 | 2021-06-21 17:40:09 +0100 | [diff] [blame] | 464 | runtime_files_hp += get_cpu_runtime_files(operator) |
Michalis Spyrou | 20fca52 | 2021-06-07 14:23:57 +0100 | [diff] [blame] | 465 | file_list, file_list_sve = get_cpu_kernel_files(operator) |
| 466 | core_files_hp += file_list |
| 467 | core_files_sve_hp += file_list_sve |
| 468 | else: |
Michalis Spyrou | 62c2ad6 | 2021-06-21 17:40:09 +0100 | [diff] [blame] | 469 | runtime_files += get_cpu_runtime_files(operator) |
Michalis Spyrou | 20fca52 | 2021-06-07 14:23:57 +0100 | [diff] [blame] | 470 | file_list, file_list_sve = get_cpu_kernel_files(operator) |
| 471 | core_files += file_list |
| 472 | core_files_sve += file_list_sve |
Georgios Pinitas | ff4fca0 | 2020-10-02 21:00:00 +0100 | [diff] [blame] | 473 | |
Georgios Pinitas | 13ef176 | 2021-07-14 17:14:43 +0100 | [diff] [blame] | 474 | runtime_files_hp += filelist['cpu']['common'] |
Michalis Spyrou | 62c2ad6 | 2021-06-21 17:40:09 +0100 | [diff] [blame] | 475 | runtime_files_hp += Glob('src/runtime/NEON/*.cpp') |
Anthony Barbier | 8e6faf1 | 2017-08-01 17:03:19 +0100 | [diff] [blame] | 476 | runtime_files += Glob('src/runtime/NEON/functions/*.cpp') |
Georgios Pinitas | 13ef176 | 2021-07-14 17:14:43 +0100 | [diff] [blame] | 477 | |
| 478 | graph_files += Glob('src/graph/backends/NEON/*.cpp') |
Georgios Pinitas | 70eb53b | 2021-01-06 19:42:21 +0000 | [diff] [blame] | 479 | |
Michalis Spyrou | 748a7c8 | 2019-10-07 13:00:44 +0100 | [diff] [blame] | 480 | bootcode_o = [] |
| 481 | if env['os'] == 'bare_metal': |
| 482 | bootcode_files = Glob('bootcode/*.s') |
| 483 | bootcode_o = build_bootcode_objs(bootcode_files) |
| 484 | Export('bootcode_o') |
| 485 | |
Michalis Spyrou | 62c2ad6 | 2021-06-21 17:40:09 +0100 | [diff] [blame] | 486 | high_priority_o = build_objs(core_files_hp + runtime_files_hp) |
Michalis Spyrou | 20fca52 | 2021-06-07 14:23:57 +0100 | [diff] [blame] | 487 | high_priority_sve_o = [] |
Georgios Pinitas | bdcdc39 | 2021-04-22 16:42:03 +0100 | [diff] [blame] | 488 | if (env['fat_binary']): |
| 489 | sve_o = build_sve_objs(core_files_sve) |
Michalis Spyrou | 20fca52 | 2021-06-07 14:23:57 +0100 | [diff] [blame] | 490 | high_priority_sve_o = build_sve_objs(core_files_sve_hp) |
Michalis Spyrou | 680705c | 2021-06-25 10:44:08 +0100 | [diff] [blame] | 491 | arm_compute_a = build_library('arm_compute-static', arm_compute_env, core_files + sve_o + high_priority_o + high_priority_sve_o + runtime_files, static=True) |
Georgios Pinitas | bdcdc39 | 2021-04-22 16:42:03 +0100 | [diff] [blame] | 492 | else: |
Michalis Spyrou | 20fca52 | 2021-06-07 14:23:57 +0100 | [diff] [blame] | 493 | high_priority_o += build_objs(core_files_sve_hp) |
Michalis Spyrou | 62c2ad6 | 2021-06-21 17:40:09 +0100 | [diff] [blame] | 494 | arm_compute_a = build_library('arm_compute-static', arm_compute_env, core_files + core_files_sve + high_priority_o + runtime_files, static=True) |
| 495 | Export('arm_compute_a') |
| 496 | if env['high_priority']: |
| 497 | arm_compute_hp_a = build_library('arm_compute_hp-static', arm_compute_env, high_priority_o + high_priority_sve_o, static=True) |
| 498 | Export('arm_compute_hp_a') |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 499 | |
Pablo Tello | c6cb35a | 2017-06-21 15:39:47 +0100 | [diff] [blame] | 500 | if env['os'] != 'bare_metal' and not env['standalone']: |
Georgios Pinitas | bdcdc39 | 2021-04-22 16:42:03 +0100 | [diff] [blame] | 501 | if (env['fat_binary']): |
Michalis Spyrou | 62c2ad6 | 2021-06-21 17:40:09 +0100 | [diff] [blame] | 502 | arm_compute_so = build_library('arm_compute', arm_compute_env, core_files + sve_o + high_priority_sve_o + high_priority_o + runtime_files, static=False) |
Georgios Pinitas | bdcdc39 | 2021-04-22 16:42:03 +0100 | [diff] [blame] | 503 | else: |
Michalis Spyrou | 62c2ad6 | 2021-06-21 17:40:09 +0100 | [diff] [blame] | 504 | arm_compute_so = build_library('arm_compute', arm_compute_env, core_files + core_files_sve + high_priority_o + runtime_files , static=False) |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 505 | |
Michalis Spyrou | 62c2ad6 | 2021-06-21 17:40:09 +0100 | [diff] [blame] | 506 | Export('arm_compute_so') |
| 507 | |
| 508 | if env['high_priority']: |
| 509 | arm_compute_hp_so = build_library('arm_compute_hp', arm_compute_env, high_priority_sve_o + high_priority_o, static=False) |
| 510 | Export('arm_compute_hp_so') |
| 511 | |
| 512 | # Generate dummy core lib for backwards compatibility |
| 513 | arm_compute_core_a = build_library('arm_compute_core-static', arm_compute_env, [], static=True) |
| 514 | Export('arm_compute_core_a') |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 515 | |
Pablo Tello | c6cb35a | 2017-06-21 15:39:47 +0100 | [diff] [blame] | 516 | if env['os'] != 'bare_metal' and not env['standalone']: |
Michalis Spyrou | 62c2ad6 | 2021-06-21 17:40:09 +0100 | [diff] [blame] | 517 | arm_compute_core_a_so = build_library('arm_compute_core', arm_compute_env, [], static=False) |
| 518 | Export('arm_compute_core_a_so') |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 519 | |
Sang-Hoon Park | 18fbb92 | 2021-01-14 14:50:25 +0000 | [diff] [blame] | 520 | arm_compute_graph_env = arm_compute_env.Clone() |
| 521 | |
| 522 | arm_compute_graph_env.Append(CXXFLAGS = ['-Wno-redundant-move', '-Wno-pessimizing-move']) |
| 523 | |
Georgios Pinitas | 4d9687e | 2020-10-21 18:33:36 +0100 | [diff] [blame] | 524 | arm_compute_graph_a = build_library('arm_compute_graph-static', arm_compute_graph_env, graph_files, static=True, libs = [ arm_compute_a]) |
Georgios Pinitas | d9eb275 | 2018-04-03 13:44:29 +0100 | [diff] [blame] | 525 | Export('arm_compute_graph_a') |
Georgios Pinitas | d8734b5 | 2017-12-22 15:27:52 +0000 | [diff] [blame] | 526 | |
| 527 | if env['os'] != 'bare_metal' and not env['standalone']: |
Michalis Spyrou | 62c2ad6 | 2021-06-21 17:40:09 +0100 | [diff] [blame] | 528 | arm_compute_graph_so = build_library('arm_compute_graph', arm_compute_graph_env, graph_files, static=False, libs = [ "arm_compute" ]) |
Georgios Pinitas | 9873ea3 | 2017-12-05 15:28:55 +0000 | [diff] [blame] | 529 | Depends(arm_compute_graph_so, arm_compute_so) |
Anthony Barbier | 2a07e18 | 2017-08-04 18:20:27 +0100 | [diff] [blame] | 530 | Export('arm_compute_graph_so') |
| 531 | |
Pablo Tello | c6cb35a | 2017-06-21 15:39:47 +0100 | [diff] [blame] | 532 | if env['standalone']: |
| 533 | alias = arm_compute_env.Alias("arm_compute", [arm_compute_a]) |
| 534 | else: |
| 535 | alias = arm_compute_env.Alias("arm_compute", [arm_compute_a, arm_compute_so]) |
| 536 | |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 537 | Default(alias) |
| 538 | |
Pablo Tello | c6cb35a | 2017-06-21 15:39:47 +0100 | [diff] [blame] | 539 | if env['standalone']: |
Michalis Spyrou | 62c2ad6 | 2021-06-21 17:40:09 +0100 | [diff] [blame] | 540 | Depends([alias], generate_embed) |
Pablo Tello | c6cb35a | 2017-06-21 15:39:47 +0100 | [diff] [blame] | 541 | else: |
Michalis Spyrou | 62c2ad6 | 2021-06-21 17:40:09 +0100 | [diff] [blame] | 542 | Depends([alias], generate_embed) |