forked from google/gemmlowp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
BUILD
164 lines (144 loc) · 3.02 KB
/
BUILD
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
#
# Description:
# gemmlowp is a small self-contained low-precision GEMM library.
# https://github.com/google/gemmlowp
licenses(["notice"]) # Apache 2.0
exports_files(["LICENSE"])
gemmlowp_public_headers = glob([
"public/*.h",
"profiling/*.h",
])
filegroup(
name = "gemmlowp_public_headers",
srcs = gemmlowp_public_headers,
visibility = ["//visibility:public"],
)
gemmlowp_headers = glob([
"internal/*.h",
]) + gemmlowp_public_headers
filegroup(
name = "gemmlowp_headers",
srcs = gemmlowp_headers,
visibility = ["//visibility:private"],
)
eight_bit_int_gemm_public_headers = glob([
"eight_bit_int_gemm/*.h",
]) + gemmlowp_public_headers
filegroup(
name = "eight_bit_int_gemm_public_headers",
srcs = eight_bit_int_gemm_public_headers,
visibility = ["//visibility:public"],
)
eight_bit_int_gemm_sources = glob([
"eight_bit_int_gemm/*.cc",
"eight_bit_int_gemm/*.h",
]) + gemmlowp_headers
filegroup(
name = "eight_bit_int_gemm_sources",
srcs = eight_bit_int_gemm_sources,
visibility = ["//visibility:public"],
)
gemmlowp_test_headers = glob([
"test/*.h",
]) + gemmlowp_headers
filegroup(
name = "gemmlowp_test_headers",
srcs = gemmlowp_test_headers,
visibility = ["//visibility:private"],
)
cc_library(
name = "gemmlowp",
srcs = [
":gemmlowp_headers",
],
hdrs = [
":gemmlowp_public_headers",
],
# Blaze warning:
# "setting 'linkstatic=1' is recommended if there are no object files."
linkstatic = 1,
visibility = ["//visibility:public"],
)
cc_library(
name = "eight_bit_int_gemm",
srcs = [
":eight_bit_int_gemm_sources",
],
hdrs = [
":eight_bit_int_gemm_public_headers",
],
visibility = [
"//visibility:public",
],
deps = [
":gemmlowp",
],
)
# The main gemmlowp unit test
cc_test(
name = "test",
size = "medium",
srcs = [
"test/test.cc",
"test/test_data.cc",
":gemmlowp_test_headers",
],
copts = [
"-O3",
],
deps = [
":eight_bit_int_gemm",
],
)
# Math helpers test
cc_test(
name = "test_math_helpers",
size = "small",
srcs = [
"test/test_math_helpers.cc",
":gemmlowp_test_headers",
],
)
# BlockingCounter test
cc_test(
name = "test_blocking_counter",
size = "medium",
srcs = [
"test/test_blocking_counter.cc",
":gemmlowp_test_headers",
],
)
# Allocator test
cc_test(
name = "test_allocator",
size = "small",
srcs = [
"test/test_allocator.cc",
":gemmlowp_test_headers",
],
)
# Benchmark
cc_binary(
name = "benchmark",
srcs = [
"test/benchmark.cc",
":gemmlowp_test_headers",
],
copts = [
"-O3",
"-DNDEBUG",
],
)
# Benchmark
cc_binary(
name = "benchmark_profile",
srcs = [
"test/benchmark.cc",
":gemmlowp_test_headers",
],
copts = [
"-O3",
"-DNDEBUG",
"-DGEMMLOWP_TEST_PROFILE",
],
)