blob: 7085f1facccbd61c94f6520b27d64000b2de986b [file] [log] [blame]
Ryo Suzuki232c9ad2024-06-19 09:37:24 +00001# Copyright (c) 2024 Arm Limited.
David Svantessone0c42ef2022-12-15 16:25:57 +00002#
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",
Ryo Suzuki232c9ad2024-06-19 09:37:24 +000075 "validation/runtime/experimental/**/*.cpp",
David Svantessone0c42ef2022-12-15 16:25:57 +000076 "*.cpp",
77 "datasets/*.h",
78 "instruments/*.h",
79 ]),
David Svantesson90d15b92023-06-08 10:05:59 +000080 copts = [] + select({
81 "//:arch_armv8-a": ["-march=armv8-a"],
82 "//:arch_armv8.2-a+fp16": ["-march=armv8.2-a+fp16"],
83 "//conditions:default": ["-march=armv8-a"],
84 }) + select({
David Svantesson45370892023-02-22 11:08:57 +000085 "//:debug_flag": [
86 "-O0",
87 "-g",
88 "-gdwarf-2",
89 ],
90 "//conditions:default": ["-O3"],
91 }) +
92 select({
93 "//:openmp_flag": ["-fopenmp"],
94 "//conditions:default": [],
95 }) +
96 select({
97 "//:Werror_flag": ["-Werror"],
98 "//conditions:default": [],
99 }),
David Svantessone0c42ef2022-12-15 16:25:57 +0000100 linkstatic = True,
101 deps = [
102 ":validation_framework",
David Svantesson90d15b92023-06-08 10:05:59 +0000103 "//:arm_compute",
David Svantessone0c42ef2022-12-15 16:25:57 +0000104 "//:arm_compute_graph",
105 "//:common_defines",
106 "//tests/framework",
107 ],
David Svantesson90d15b92023-06-08 10:05:59 +0000108 local_defines = [] +
David Svantesson45370892023-02-22 11:08:57 +0000109 select({
110 "//:bf16_validation_flag": [
111 "ARM_COMPUTE_ENABLE_BF16",
112 ],
113 "//conditions:default": [],
David Svantesson3b162e52023-03-28 14:13:32 +0000114 }) +
115 select({
116 "//:sve_validation_flag": [
117 "ENABLE_SVE",
118 "ARM_COMPUTE_ENABLE_SVE",
119 ],
120 "//conditions:default": [],
David Svantesson45370892023-02-22 11:08:57 +0000121 })
David Svantessone0c42ef2022-12-15 16:25:57 +0000122)
123
124#---------------------------------------------------------------------
125# Benchmark Binary
126cc_binary(
127 name = "arm_benchmark",
128 srcs = glob([
129 "benchmark/fixtures/*.h",
130 "benchmark/NEON/*.cpp",
131 "*.cpp",
132 ]),
David Svantesson90d15b92023-06-08 10:05:59 +0000133 copts = [] + select({
134 "//:arch_armv8-a": ["-march=armv8-a"],
135 "//:arch_armv8.2-a+fp16": ["-march=armv8.2-a+fp16"],
136 "//conditions:default": ["-march=armv8-a"],
137 }) + select({
David Svantesson45370892023-02-22 11:08:57 +0000138 "//:debug_flag": [
139 "-O0",
140 "-g",
141 "-gdwarf-2",
142 ],
143 "//conditions:default": ["-O3"],
144 }) +
145 select({
146 "//:openmp_flag": ["-fopenmp"],
147 "//conditions:default": [],
148 }) +
149 select({
150 "//:Werror_flag": ["-Werror"],
151 "//conditions:default": [],
152 }),
David Svantessone0c42ef2022-12-15 16:25:57 +0000153 linkstatic = True,
154 deps = [
155 ":arm_compute_validation",
156 ":validation_framework",
David Svantesson90d15b92023-06-08 10:05:59 +0000157 "//:arm_compute",
David Svantessone0c42ef2022-12-15 16:25:57 +0000158 ],
159)