-
Notifications
You must be signed in to change notification settings - Fork 1
/
BUILD
147 lines (138 loc) · 3.67 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
package(
default_visibility = ["//visibility:public"],
features = ["-parse_headers"],
)
cc_library(
name = "nbg_parser",
includes = [
"include"
],
hdrs =
glob(["include/tim/utils/nbg_parser/*.h"])
,
srcs =
glob(["src/tim/utils/nbg_parser/*.c"])
,
linkstatic = True,
strip_include_prefix = "include"
)
genrule(
name = "gen_vsi_feat_ops_def",
srcs = ["//src/tim/vx/internal:include/interface/ops.def"],
outs = ["vsi_feat_ops_def.h"],
cmd = "./$(location gen_vsi_feat_ops_def.sh) $(SRCS) > \"$(OUTS)\"",
tools = ["gen_vsi_feat_ops_def.sh"]
)
cc_library(
name = "vsi_feat_ops_def",
hdrs = [":gen_vsi_feat_ops_def"]
)
cc_library(
name = "tim-vx_interface",
defines = ["BUILD_WITH_BAZEL"],
copts = ["-std=c++14", "-Werror", "-fvisibility=default", "-pthread"],
includes = [
"include",
"src/tim/vx",
"src/tim/transform",
],
hdrs = [
"include/tim/vx/context.h",
"include/tim/vx/builtin_op.h",
"include/tim/vx/graph.h",
"include/tim/vx/operation.h",
"include/tim/vx/ops.h",
"include/tim/vx/tensor.h",
"include/tim/vx/types.h",
"include/tim/vx/compile_option.h",
"include/tim/transform/layout_inference.h",
] + glob([
"include/tim/vx/ops/*.h"
]),
srcs = [
"src/tim/vx/context_private.h",
"src/tim/vx/context.cc",
"src/tim/vx/compile_option.cc",
"src/tim/vx/graph_private.h",
"src/tim/vx/graph.cc",
"src/tim/vx/builtin_op_impl.cc",
"src/tim/vx/builtin_op.cc",
"src/tim/vx/builtin_op_impl.h",
"src/tim/vx/op_impl.cc",
"src/tim/vx/op_impl.h",
"src/tim/vx/operation.cc",
"src/tim/vx/tensor.cc",
"src/tim/vx/tensor_private.h",
"src/tim/vx/type_utils.h",
"src/tim/vx/type_utils.cc",
"src/tim/transform/layout_inference.cc",
"src/tim/transform/permute_vector.h",
"src/tim/transform/layout_infer_context.h",
] + glob([
"src/tim/vx/ops/*.cc",
"src/tim/vx/ops/*.h"
], exclude = ["src/tim/vx/ops/*_test.cc"]
) + glob(["src/tim/transform/ops/*.*"]),
deps = [
":vsi_feat_ops_def",
"//src/tim/vx/internal:ovxlibimpl",
],
linkstatic = True,
strip_include_prefix = "include",
)
cc_binary(
name = "libtim-vx.so",
linkshared = True,
linkstatic = False,
deps = [
"tim-vx_interface",
],
)
cc_library(
name = "tim-lite_interface",
copts = ["-std=c++14", "-Werror", "-fvisibility=default"],
includes = [
"include",
"src/tim/lite",
],
hdrs = [
"include/tim/lite/execution.h",
"include/tim/lite/handle.h",
],
srcs = [
"src/tim/lite/execution_private.h",
"src/tim/lite/execution.cc",
"src/tim/lite/handle_private.h",
"src/tim/lite/handle.cc",
],
deps = [
"//prebuilt-sdk:VIP_LITE_LIB",
],
linkstatic = True,
strip_include_prefix = "include",
)
cc_binary(
name = "libtim-lite.so",
linkshared = True,
linkstatic = False,
deps = [
"tim-lite_interface",
],
)
##############################################################################
# unit test
##############################################################################
cc_test (
name = "unit_test",
copts = ["-std=c++14", "-Werror"],
includes = ["third_party/half"],
srcs = [
"src/tim/vx/test_utils.h",
"third_party/half/half.hpp"
] + glob(["src/tim/**/*_test.cc"]),
deps = [
"@gtest//:gtest",
"@gtest//:gtest_main",
":tim-vx_interface",
]
)