blob: 5763938d3c63e5584eb899ad876ce5f765ab8dff [file] [log] [blame]
David Svantessone0c42ef2022-12-15 16:25:57 +00001# Copyright (c) 2023 Arm Limited.
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
23#---------------------------------------------------------------------
24# Validation Framework Library
25
26cc_library(
27 name = "validation_framework",
28 srcs = glob([
29 "validation/reference/*.cpp",
30 "validation/*.cpp",
31 "*.h",
32 ]),
33 hdrs = glob([
34 "validation/reference/*.h",
35 "validation/**/*.h",
36 ]),
David Svantesson90d15b92023-06-08 10:05:59 +000037 copts = [] + select({
38 "//:arch_armv8-a": ["-march=armv8-a"],
39 "//:arch_armv8.2-a+fp16": ["-march=armv8.2-a+fp16"],
40 "//conditions:default": ["-march=armv8-a"],
41 }) + select({
David Svantesson45370892023-02-22 11:08:57 +000042 "//:debug_flag": [
43 "-O0",
44 "-g",
45 "-gdwarf-2",
46 ],
47 "//conditions:default": ["-O3"],
48 }) +
49 select({
50 "//:openmp_flag": ["-fopenmp"],
51 "//conditions:default": [],
52 }) +
53 select({
54 "//:Werror_flag": ["-Werror"],
55 "//conditions:default": [],
56 }),
David Svantessone0c42ef2022-12-15 16:25:57 +000057 linkstatic = True,
58 deps = [
David Svantesson90d15b92023-06-08 10:05:59 +000059 "//:arm_compute",
David Svantessone0c42ef2022-12-15 16:25:57 +000060 "//:common_defines",
61 "//tests/framework",
62 ],
63)
64
65#---------------------------------------------------------------------
66# Validation Binary
67cc_binary(
68 name = "arm_compute_validation",
69 srcs = glob([
70 "validation/UNIT/**/*.cpp",
71 "validation/CPP/**/*.cpp",
72 "NEON/*.h",
73 "validation/NEON/**/*.cpp",
74 "validation/NEON/**/*.h",
75 "*.cpp",
76 "datasets/*.h",
77 "instruments/*.h",
78 ]),
David Svantesson90d15b92023-06-08 10:05:59 +000079 copts = [] + select({
80 "//:arch_armv8-a": ["-march=armv8-a"],
81 "//:arch_armv8.2-a+fp16": ["-march=armv8.2-a+fp16"],
82 "//conditions:default": ["-march=armv8-a"],
83 }) + select({
David Svantesson45370892023-02-22 11:08:57 +000084 "//:debug_flag": [
85 "-O0",
86 "-g",
87 "-gdwarf-2",
88 ],
89 "//conditions:default": ["-O3"],
90 }) +
91 select({
92 "//:openmp_flag": ["-fopenmp"],
93 "//conditions:default": [],
94 }) +
95 select({
96 "//:Werror_flag": ["-Werror"],
97 "//conditions:default": [],
98 }),
David Svantessone0c42ef2022-12-15 16:25:57 +000099 linkstatic = True,
100 deps = [
101 ":validation_framework",
David Svantesson90d15b92023-06-08 10:05:59 +0000102 "//:arm_compute",
David Svantessone0c42ef2022-12-15 16:25:57 +0000103 "//:arm_compute_graph",
104 "//:common_defines",
105 "//tests/framework",
106 ],
David Svantesson90d15b92023-06-08 10:05:59 +0000107 local_defines = [] +
David Svantesson45370892023-02-22 11:08:57 +0000108 select({
109 "//:bf16_validation_flag": [
110 "ARM_COMPUTE_ENABLE_BF16",
111 ],
112 "//conditions:default": [],
David Svantesson3b162e52023-03-28 14:13:32 +0000113 }) +
114 select({
115 "//:sve_validation_flag": [
116 "ENABLE_SVE",
117 "ARM_COMPUTE_ENABLE_SVE",
118 ],
119 "//conditions:default": [],
David Svantesson45370892023-02-22 11:08:57 +0000120 })
David Svantessone0c42ef2022-12-15 16:25:57 +0000121)
122
123#---------------------------------------------------------------------
124# Benchmark Binary
125cc_binary(
126 name = "arm_benchmark",
127 srcs = glob([
128 "benchmark/fixtures/*.h",
129 "benchmark/NEON/*.cpp",
130 "*.cpp",
131 ]),
David Svantesson90d15b92023-06-08 10:05:59 +0000132 copts = [] + select({
133 "//:arch_armv8-a": ["-march=armv8-a"],
134 "//:arch_armv8.2-a+fp16": ["-march=armv8.2-a+fp16"],
135 "//conditions:default": ["-march=armv8-a"],
136 }) + select({
David Svantesson45370892023-02-22 11:08:57 +0000137 "//:debug_flag": [
138 "-O0",
139 "-g",
140 "-gdwarf-2",
141 ],
142 "//conditions:default": ["-O3"],
143 }) +
144 select({
145 "//:openmp_flag": ["-fopenmp"],
146 "//conditions:default": [],
147 }) +
148 select({
149 "//:Werror_flag": ["-Werror"],
150 "//conditions:default": [],
151 }),
David Svantessone0c42ef2022-12-15 16:25:57 +0000152 linkstatic = True,
153 deps = [
154 ":arm_compute_validation",
155 ":validation_framework",
David Svantesson90d15b92023-06-08 10:05:59 +0000156 "//:arm_compute",
David Svantessone0c42ef2022-12-15 16:25:57 +0000157 ],
158)