1# Description:
2#   XLA client libraries.
3
4licenses(["notice"])  # Apache 2.0
5
6package(default_visibility = [":friends"])
7
8package_group(
9    name = "friends",
10    includes = [
11        "//tensorflow/compiler/xla:friends",
12    ],
13)
14
15# Filegroup used to collect source files for dependency checking.
16filegroup(
17    name = "c_srcs",
18    data = glob([
19        "**/*.cc",
20        "**/*.h",
21    ]),
22)
23
24load("//tensorflow:tensorflow.bzl", "tf_cc_test")
25
26cc_library(
27    name = "global_data",
28    srcs = ["global_data.cc"],
29    hdrs = ["global_data.h"],
30    deps = [
31        "//tensorflow/compiler/xla:service_interface",
32        "//tensorflow/compiler/xla:types",
33        "//tensorflow/compiler/xla:xla_data_proto",
34        "//tensorflow/compiler/xla:xla_proto",
35        "//tensorflow/core:lib",
36    ],
37)
38
39cc_library(
40    name = "padding",
41    srcs = ["padding.cc"],
42    hdrs = ["padding.h"],
43    deps = [
44        "//tensorflow/compiler/xla:statusor",
45        "//tensorflow/compiler/xla:types",
46        "//tensorflow/compiler/xla:util",
47        "//tensorflow/core:lib",
48    ],
49)
50
51tf_cc_test(
52    name = "padding_test",
53    srcs = ["padding_test.cc"],
54    deps = [
55        ":padding",
56        "//tensorflow/core:test",
57        "//tensorflow/core:test_main",
58    ],
59)
60
61cc_library(
62    name = "client",
63    srcs = ["client.cc"],
64    hdrs = ["client.h"],
65    deps = [
66        ":computation",
67        ":global_data",
68        "//tensorflow/compiler/xla:execution_options_util",
69        "//tensorflow/compiler/xla:literal_util",
70        "//tensorflow/compiler/xla:service_interface",
71        "//tensorflow/compiler/xla:status_macros",
72        "//tensorflow/compiler/xla:statusor",
73        "//tensorflow/compiler/xla:types",
74        "//tensorflow/compiler/xla:util",
75        "//tensorflow/compiler/xla:xla_data_proto",
76        "//tensorflow/compiler/xla:xla_proto",
77        "//tensorflow/compiler/xla/legacy_flags:debug_options_flags",
78        "//tensorflow/compiler/xla/service:session_proto",
79        "//tensorflow/core:lib",
80    ],
81)
82
83cc_library(
84    name = "executable_build_options",
85    srcs = ["executable_build_options.cc"],
86    hdrs = ["executable_build_options.h"],
87    deps = [
88        "//tensorflow/compiler/xla:shape_util",
89        "//tensorflow/compiler/xla:xla_data_proto",
90        "//tensorflow/compiler/xla/service:device_memory_allocator",
91        "//tensorflow/core:lib",
92    ],
93)
94
95cc_library(
96    name = "local_client",
97    srcs = ["local_client.cc"],
98    hdrs = ["local_client.h"],
99    deps = [
100        ":client",
101        ":computation",
102        ":executable_build_options",
103        "//tensorflow/compiler/xla:executable_run_options",
104        "//tensorflow/compiler/xla:status_macros",
105        "//tensorflow/compiler/xla:statusor",
106        "//tensorflow/compiler/xla:util",
107        "//tensorflow/compiler/xla:xla_data_proto",
108        "//tensorflow/compiler/xla/service:backend",
109        "//tensorflow/compiler/xla/service:compiler",
110        "//tensorflow/compiler/xla/service:device_memory_allocator",
111        "//tensorflow/compiler/xla/service:executable",
112        "//tensorflow/compiler/xla/service:local_service",
113        "//tensorflow/compiler/xla/service:shaped_buffer",
114        "//tensorflow/compiler/xla/service:source_map_util",
115        "//tensorflow/core:lib",
116        "//tensorflow/core:stream_executor_no_cuda",
117        "@llvm//:support",
118    ],
119)
120
121cc_library(
122    name = "compile_only_client",
123    srcs = ["compile_only_client.cc"],
124    hdrs = ["compile_only_client.h"],
125    deps = [
126        ":client",
127        ":computation",
128        "//tensorflow/compiler/xla:status_macros",
129        "//tensorflow/compiler/xla:statusor",
130        "//tensorflow/compiler/xla:util",
131        "//tensorflow/compiler/xla:xla_data_proto",
132        "//tensorflow/compiler/xla/service:compile_only_service",
133        "//tensorflow/compiler/xla/service:compiler",
134        "//tensorflow/core:stream_executor_no_cuda",
135        "@llvm//:support",
136    ],
137)
138
139# This target is used to instantiate the XLA service in-process and create
140# a client for it.
141cc_library(
142    name = "client_library",
143    srcs = ["client_library.cc"],
144    hdrs = ["client_library.h"],
145    deps = [
146        ":compile_only_client",
147        ":local_client",
148        "//tensorflow/compiler/xla:status_macros",
149        "//tensorflow/compiler/xla:statusor",
150        "//tensorflow/compiler/xla:types",
151        "//tensorflow/compiler/xla:util",
152        "//tensorflow/compiler/xla/service:backend",
153        "//tensorflow/compiler/xla/service:compile_only_service",
154        "//tensorflow/compiler/xla/service:device_memory_allocator",
155        "//tensorflow/compiler/xla/service:local_service",
156        "//tensorflow/compiler/xla/service:platform_util",
157        "//tensorflow/core:lib",
158        "//tensorflow/core:stream_executor_no_cuda",
159    ],
160)
161
162cc_library(
163    name = "computation",
164    srcs = ["computation.cc"],
165    hdrs = ["computation.h"],
166    deps = [
167        "//tensorflow/compiler/xla:service_interface",
168        "//tensorflow/compiler/xla:status_macros",
169        "//tensorflow/compiler/xla:statusor",
170        "//tensorflow/compiler/xla:util",
171        "//tensorflow/compiler/xla:xla_data_proto",
172        "//tensorflow/compiler/xla:xla_proto",
173        "//tensorflow/compiler/xla/service:session_proto",
174        "//tensorflow/core:lib",
175    ],
176)
177
178cc_library(
179    name = "computation_builder",
180    srcs = ["computation_builder.cc"],
181    hdrs = ["computation_builder.h"],
182    deps = [
183        ":client",
184        ":computation",
185        ":global_data",
186        ":padding",
187        "//tensorflow/compiler/xla:array",
188        "//tensorflow/compiler/xla:array2d",
189        "//tensorflow/compiler/xla:array3d",
190        "//tensorflow/compiler/xla:array4d",
191        "//tensorflow/compiler/xla:literal_util",
192        "//tensorflow/compiler/xla:shape_util",
193        "//tensorflow/compiler/xla:status_macros",
194        "//tensorflow/compiler/xla:statusor",
195        "//tensorflow/compiler/xla:types",
196        "//tensorflow/compiler/xla:util",
197        "//tensorflow/compiler/xla:xla_data_proto",
198        "//tensorflow/compiler/xla:xla_proto",
199        "//tensorflow/core:lib",
200    ],
201)
202
203cc_library(
204    name = "sharding_builder",
205    srcs = ["sharding_builder.cc"],
206    hdrs = ["sharding_builder.h"],
207    deps = [
208        "//tensorflow/compiler/xla:array",
209        "//tensorflow/compiler/xla:shape_tree",
210        "//tensorflow/compiler/xla:shape_util",
211        "//tensorflow/compiler/xla:types",
212        "//tensorflow/compiler/xla:util",
213        "//tensorflow/compiler/xla:xla_data_proto",
214    ],
215)
216
217# -----------------------------------------------------------------------------
218
219filegroup(
220    name = "all_files",
221    srcs = glob(
222        ["**/*"],
223        exclude = [
224            "**/METADATA",
225            "**/OWNERS",
226        ],
227    ),
228    visibility = ["//tensorflow:__subpackages__"],
229)
230