1load("//tensorflow/lite:special_rules.bzl", "tflite_portable_test_suite")
2
3package(
4    default_visibility = ["//visibility:public"],
5    licenses = ["notice"],  # Apache 2.0
6)
7
8cc_library(
9    name = "preprocessor",
10    srcs = ["preprocessor.cc"],
11    hdrs = ["preprocessor.h"],
12    deps = [
13        "//tensorflow/lite/delegates/gpu/common:status",
14        "@com_google_absl//absl/strings",
15    ],
16)
17
18cc_test(
19    name = "preprocessor_test",
20    srcs = ["preprocessor_test.cc"],
21    tags = [
22        "local",
23        "tflite_not_portable_ios",
24    ],
25    deps = [
26        ":preprocessor",
27        "@com_google_googletest//:gtest_main",
28    ],
29)
30
31cc_library(
32    name = "object_accessor",
33    srcs = ["object_accessor.cc"],
34    hdrs = ["object_accessor.h"],
35    deps = [
36        ":preprocessor",
37        ":variable_accessor",
38        "//tensorflow/lite/delegates/gpu/common:data_type",
39        "//tensorflow/lite/delegates/gpu/common:types",
40        "//tensorflow/lite/delegates/gpu/gl:object",
41        "@com_google_absl//absl/strings",
42        "@com_google_absl//absl/strings:str_format",
43        "@com_google_absl//absl/types:variant",
44    ],
45)
46
47cc_test(
48    name = "object_accessor_test",
49    srcs = ["object_accessor_test.cc"],
50    tags = [
51        "local",
52    ],
53    deps = [
54        ":object_accessor",
55        ":variable_accessor",
56        "//tensorflow/lite/delegates/gpu/common:types",
57        "//tensorflow/lite/delegates/gpu/gl:variable",
58        "@com_google_absl//absl/types:variant",
59        "@com_google_googletest//:gtest_main",
60    ],
61)
62
63cc_library(
64    name = "shader_code",
65    hdrs = ["shader_code.h"],
66    deps = [
67        "//tensorflow/lite/delegates/gpu/common:model",
68        "//tensorflow/lite/delegates/gpu/common:types",
69        "//tensorflow/lite/delegates/gpu/gl:object",
70        "//tensorflow/lite/delegates/gpu/gl:variable",
71    ],
72)
73
74cc_library(
75    name = "shader_codegen",
76    srcs = ["shader_codegen.cc"],
77    hdrs = ["shader_codegen.h"],
78    deps = [
79        ":compiled_node",
80        ":object_accessor",
81        ":preprocessor",
82        ":shader_code",
83        ":variable_accessor",
84        "//tensorflow/lite/delegates/gpu/common:gpu_info",
85        "//tensorflow/lite/delegates/gpu/common:model",
86        "//tensorflow/lite/delegates/gpu/common:status",
87        "//tensorflow/lite/delegates/gpu/gl:compiler_options",
88        "//tensorflow/lite/delegates/gpu/gl:object",
89        "//tensorflow/lite/delegates/gpu/gl:variable",
90        "@com_google_absl//absl/status",
91        "@com_google_absl//absl/strings",
92    ],
93)
94
95cc_library(
96    name = "compiled_node",
97    srcs = ["compiled_node.cc"],
98    hdrs = ["compiled_node.h"],
99    deps = [
100        ":rename",
101        "//tensorflow/lite/delegates/gpu/common:model",
102        "//tensorflow/lite/delegates/gpu/common:status",
103        "//tensorflow/lite/delegates/gpu/gl:node_shader",
104        "//tensorflow/lite/delegates/gpu/gl:object",
105        "@com_google_absl//absl/container:flat_hash_set",
106        "@com_google_absl//absl/strings",
107    ],
108)
109
110cc_library(
111    name = "fuse_inplace",
112    srcs = ["fuse_inplace.cc"],
113    hdrs = ["fuse_inplace.h"],
114    deps = [
115        ":compiled_node",
116        ":preprocessor",
117        "//tensorflow/lite/delegates/gpu/common:model",
118        "//tensorflow/lite/delegates/gpu/common:model_transformer",
119        "//tensorflow/lite/delegates/gpu/common:types",
120        "//tensorflow/lite/delegates/gpu/gl:node_shader",
121        "@com_google_absl//absl/strings",
122        "@com_google_absl//absl/types:any",
123    ],
124)
125
126cc_library(
127    name = "fuse_inline",
128    srcs = ["fuse_inline.cc"],
129    hdrs = ["fuse_inline.h"],
130    deps = [
131        ":compiled_node",
132        ":shader_code",
133        "//tensorflow/lite/delegates/gpu/common:model",
134        "//tensorflow/lite/delegates/gpu/common:model_transformer",
135        "//tensorflow/lite/delegates/gpu/common:status",
136        "//tensorflow/lite/delegates/gpu/common:types",
137        "//tensorflow/lite/delegates/gpu/gl:node_shader",
138        "@com_google_absl//absl/strings",
139        "@com_google_absl//absl/types:any",
140    ],
141)
142
143cc_library(
144    name = "rename",
145    srcs = ["rename.cc"],
146    hdrs = ["rename.h"],
147    deps = [
148        ":object_accessor",
149        ":preprocessor",
150        ":variable_accessor",
151        "//tensorflow/lite/delegates/gpu/common:status",
152        "//tensorflow/lite/delegates/gpu/gl:node_shader",
153        "//tensorflow/lite/delegates/gpu/gl:object",
154        "//tensorflow/lite/delegates/gpu/gl:variable",
155        "@com_google_absl//absl/container:flat_hash_map",
156        "@com_google_absl//absl/strings",
157    ],
158)
159
160cc_library(
161    name = "fuse_auto_input",
162    srcs = ["fuse_auto_input.cc"],
163    hdrs = ["fuse_auto_input.h"],
164    deps = [
165        ":compiled_node",
166        "//tensorflow/lite/delegates/gpu/common:model",
167        "//tensorflow/lite/delegates/gpu/common:model_transformer",
168        "//tensorflow/lite/delegates/gpu/common:operations",
169        "//tensorflow/lite/delegates/gpu/common:types",
170        "@com_google_absl//absl/container:flat_hash_set",
171        "@com_google_absl//absl/strings",
172        "@com_google_absl//absl/types:any",
173        "@com_google_absl//absl/types:variant",
174    ],
175)
176
177cc_test(
178    name = "fuse_auto_input_test",
179    srcs = ["fuse_auto_input_test.cc"],
180    tags = [
181        "local",
182        "no_mac",  # TODO(b/171881489)
183    ],
184    deps = [
185        ":compiled_node",
186        ":fuse_auto_input",
187        "@com_google_absl//absl/types:any",
188        "@com_google_googletest//:gtest",
189        "@com_google_googletest//:gtest_main",
190    ],
191)
192
193cc_library(
194    name = "variable_accessor",
195    srcs = ["variable_accessor.cc"],
196    hdrs = ["variable_accessor.h"],
197    deps = [
198        ":preprocessor",
199        "//tensorflow/lite/delegates/gpu/common:types",
200        "//tensorflow/lite/delegates/gpu/gl:variable",
201        "@com_google_absl//absl/container:flat_hash_map",
202        "@com_google_absl//absl/strings",
203        "@com_google_absl//absl/strings:str_format",
204        "@com_google_absl//absl/types:variant",
205    ],
206)
207
208cc_test(
209    name = "variable_accessor_test",
210    srcs = ["variable_accessor_test.cc"],
211    tags = [
212        "local",
213        "tflite_not_portable_ios",
214    ],
215    deps = [
216        ":variable_accessor",
217        "//tensorflow/lite/delegates/gpu/common:types",
218        "@com_google_googletest//:gtest_main",
219    ],
220)
221
222tflite_portable_test_suite()
223