1 # Copyright (c) 2017 ARM Limited.
3 # SPDX-License-Identifier: MIT
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:
12 # The above copyright notice and this permission notice shall be included in all
13 # copies or substantial portions of the Software.
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
26 Import('arm_compute_a')
27 Import('arm_compute_so')
32 examples_env = env.Clone()
34 examples_env.Append(CPPPATH = ["#"])
35 examples_env.Append(LIBPATH = ["#build/%s" % env['build_dir']])
36 examples_env.Append(LIBPATH = ["#build/%s/opencl-1.2-stubs" % env['build_dir']])
39 utils = examples_env.Object("../utils/Utils.cpp")
41 if env['os'] in ['android', 'bare_metal']:
42 arm_compute_lib = arm_compute_a
43 arm_compute_dependency = arm_compute_a
45 arm_compute_lib = "arm_compute"
46 arm_compute_dependency = arm_compute_so
48 if env['opencl'] and env['neon']:
49 for file in Glob("./neoncl_*.cpp"):
50 example = os.path.basename(os.path.splitext(str(file))[0])
51 prog = examples_env.Program(example, ["{}.cpp".format(example), utils], LIBS = [arm_compute_lib, "OpenCL"])
52 Depends(prog, [arm_compute_dependency, opencl])
53 alias = examples_env.Alias(example, prog)
57 for file in Glob("./cl_*.cpp"):
58 example = os.path.basename(os.path.splitext(str(file))[0])
59 prog = examples_env.Program(example, ["{}.cpp".format(example), utils], LIBS = [arm_compute_lib, "OpenCL"])
60 Depends(prog, [arm_compute_dependency, opencl])
61 alias = examples_env.Alias(example, prog)
65 for file in Glob("./neon_*.cpp"):
66 example = os.path.basename(os.path.splitext(str(file))[0])
67 prog = examples_env.Program(example, ["{}.cpp".format(example), utils], LIBS = [arm_compute_lib])
68 Depends(prog, arm_compute_dependency)
69 alias = examples_env.Alias(example, prog)