blob: 319183f11fc892512793f7d6c5d3a3f2bcafd18e [file] [log] [blame]
Peter Hawkins1e67c902017-01-09 12:04:37 -08001licenses(["notice"]) # Apache 2.0
2
3package(
4 default_visibility = [
5 "//tensorflow/compiler/tf2xla:internal",
6 ],
7 features = ["no_layering_check"],
8)
9
10load("//tensorflow:tensorflow.bzl", "tf_kernel_library")
11load("//tensorflow/compiler/xla:xla.bzl", "export_dynamic_linkopts")
12
13tf_kernel_library(
14 name = "xla_ops",
15 srcs = [
16 "aggregate_ops.cc",
Peter Hawkins2e307b42017-04-19 09:35:12 -080017 "arg_op.cc",
Peter Hawkins1e67c902017-01-09 12:04:37 -080018 "batch_matmul_op.cc",
A. Unique TensorFlower88fff5a2017-08-02 15:40:43 -070019 "batch_norm_op.cc",
Peter Hawkins96bc32e2017-04-06 12:02:29 -080020 "batchtospace_op.cc",
Peter Hawkins1e67c902017-01-09 12:04:37 -080021 "bcast_ops.cc",
22 "bias_ops.cc",
23 "binary_ops.cc",
24 "cast_op.cc",
25 "concat_op.cc",
Peter Hawkins2e307b42017-04-19 09:35:12 -080026 "const_op.cc",
Peter Hawkins1e67c902017-01-09 12:04:37 -080027 "conv_ops.cc",
Chris Leary32e198f2017-07-26 18:39:34 -070028 "cross_op.cc",
Peter Hawkins1e67c902017-01-09 12:04:37 -080029 "cwise_ops.cc",
Peter Hawkins1e67c902017-01-09 12:04:37 -080030 "diag_op.cc",
31 "dynamic_stitch_op.cc",
A. Unique TensorFlowera291c8a2017-04-06 07:14:08 -080032 "elu_op.cc",
Peter Hawkins1e67c902017-01-09 12:04:37 -080033 "fill_op.cc",
34 "function_ops.cc",
35 "identity_op.cc",
36 "l2loss_op.cc",
37 "lrn_ops.cc",
38 "matmul_op.cc",
Chris Leary3cc5fc02017-08-01 07:59:31 -070039 "mirror_pad_op.cc",
Peter Hawkins1e67c902017-01-09 12:04:37 -080040 "no_op.cc",
Peter Hawkinsf424ca32017-03-01 06:15:30 -080041 "one_hot_op.cc",
Peter Hawkins1e67c902017-01-09 12:04:37 -080042 "pack_op.cc",
43 "pad_op.cc",
44 "pooling_ops.cc",
45 "random_ops.cc",
46 "reduction_ops.cc",
47 "reduction_ops_common.cc",
48 "relu_op.cc",
49 "reshape_op.cc",
50 "retval_op.cc",
A. Unique TensorFlower8633b222017-03-07 17:30:49 -080051 "reverse_op.cc",
A. Unique TensorFlowerb4c97bf2017-07-25 12:53:50 -070052 "segment_reduction_ops.cc",
Peter Hawkins1e67c902017-01-09 12:04:37 -080053 "select_op.cc",
54 "sequence_ops.cc",
55 "shape_op.cc",
56 "slice_op.cc",
57 "softmax_op.cc",
Peter Hawkins96bc32e2017-04-06 12:02:29 -080058 "spacetobatch_op.cc",
Peter Hawkins1e67c902017-01-09 12:04:37 -080059 "split_op.cc",
Peter Hawkinseb1fe502017-07-12 06:58:36 -070060 "stack_ops.cc",
Peter Hawkins1e67c902017-01-09 12:04:37 -080061 "strided_slice_op.cc",
Peter Hawkinsc19e6ca2017-06-07 14:55:31 -070062 "tensor_array_ops.cc",
Peter Hawkins1e67c902017-01-09 12:04:37 -080063 "tile_ops.cc",
Peter Hawkins09adaff2017-03-14 14:49:09 -080064 "training_ops.cc",
Peter Hawkins1e67c902017-01-09 12:04:37 -080065 "transpose_op.cc",
66 "unary_ops.cc",
67 "unpack_op.cc",
Peter Hawkins542c3cb2017-02-21 19:41:11 -080068 "variable_ops.cc",
Peter Hawkins1e67c902017-01-09 12:04:37 -080069 ],
70 hdrs = [
71 "cwise_ops.h",
72 "reduction_ops.h",
73 ],
74 deps = [
Peter Hawkins3e9cd2e2017-06-15 15:23:51 -070075 ":while_op",
Peter Hawkins1e67c902017-01-09 12:04:37 -080076 "//tensorflow/compiler/tf2xla:common",
77 "//tensorflow/compiler/tf2xla:xla_compiler",
78 "//tensorflow/compiler/xla:literal_util",
79 "//tensorflow/compiler/xla/client:client_library",
80 "//tensorflow/compiler/xla/client:computation_builder",
81 "//tensorflow/compiler/xla/client/lib:arithmetic",
82 "//tensorflow/core:framework",
83 "//tensorflow/core:lib",
84 "//tensorflow/core:tensorflow_opensource",
85 "//tensorflow/core/kernels:concat_lib",
Peter Hawkins1e67c902017-01-09 12:04:37 -080086 "//tensorflow/core/kernels:conv_ops",
87 "//tensorflow/core/kernels:cwise_op",
Peter Hawkins1e67c902017-01-09 12:04:37 -080088 "//tensorflow/core/kernels:no_op",
89 "//tensorflow/core/kernels:ops_util",
90 "//tensorflow/core/kernels:pooling_ops",
91 "//tensorflow/core/kernels:sendrecv_ops",
92 "//tensorflow/core/kernels:transpose_op",
93 ],
94)
95
Peter Hawkins3e9cd2e2017-06-15 15:23:51 -070096tf_kernel_library(
97 name = "while_op",
98 srcs = ["while_op.cc"],
99 hdrs = ["while_op.h"],
100 deps = [
101 "//tensorflow/compiler/tf2xla:common",
102 "//tensorflow/compiler/tf2xla:xla_compiler",
103 "//tensorflow/compiler/tf2xla/ops:functional_ops",
104 "//tensorflow/compiler/xla/client:computation_builder",
105 "//tensorflow/core:framework",
106 "//tensorflow/core:lib",
107 "//tensorflow/core:tensorflow_opensource",
108 ],
109)
110
Peter Hawkins1e67c902017-01-09 12:04:37 -0800111# Kernels that only work on CPU, because they use XLA custom calls.
112# Only link this when using the CPU backend for XLA.
113#
114# TODO(cwhipkey): move into xla_ops when ops can be registered for
115# CPU compilation only (b/31363654).
116tf_kernel_library(
117 name = "xla_cpu_only_ops",
118 srcs = [
119 "gather_op.cc",
120 "index_ops.cc",
121 ],
122 deps = [
123 ":gather_op_kernel_float_int32",
124 ":gather_op_kernel_float_int64",
125 ":index_ops_kernel_argmax_float_1d",
126 ":index_ops_kernel_argmax_float_2d",
127 "//tensorflow/compiler/tf2xla:common",
128 "//tensorflow/compiler/tf2xla:xla_compiler",
129 "//tensorflow/compiler/xla:literal_util",
130 "//tensorflow/compiler/xla/client:client_library",
131 "//tensorflow/compiler/xla/client:computation_builder",
132 "//tensorflow/compiler/xla/client/lib:arithmetic",
133 "//tensorflow/core:framework",
134 "//tensorflow/core:lib",
135 "//tensorflow/core:tensorflow_opensource",
136 ],
137)
138
139tf_kernel_library(
140 name = "gather_op_kernel_float_int32",
141 srcs = ["gather_op_kernel_float_int32.cc"],
142 # Makes the custom-call function visible to LLVM during JIT.
143 linkopts = export_dynamic_linkopts,
144 visibility = ["//visibility:public"],
145 deps = [
146 "//tensorflow/compiler/tf2xla:xla_local_runtime_context",
147 "//tensorflow/core:framework_lite",
148 "//tensorflow/core/kernels:gather_functor",
149 "//third_party/eigen3",
150 ],
151)
152
153tf_kernel_library(
154 name = "gather_op_kernel_float_int64",
155 srcs = ["gather_op_kernel_float_int64.cc"],
156 # Makes the custom-call function visible to LLVM during JIT.
157 linkopts = export_dynamic_linkopts,
158 visibility = ["//visibility:public"],
159 deps = [
160 "//tensorflow/compiler/tf2xla:xla_local_runtime_context",
161 "//tensorflow/core:framework_lite",
162 "//tensorflow/core/kernels:gather_functor",
163 "//third_party/eigen3",
164 ],
165)
166
167tf_kernel_library(
168 name = "index_ops_kernel_argmax_float_1d",
169 srcs = ["index_ops_kernel_argmax_float_1d.cc"],
170 # Makes the custom-call function visible to LLVM during JIT.
171 linkopts = export_dynamic_linkopts,
172 visibility = ["//visibility:public"],
173 deps = [
174 "//tensorflow/core:framework_lite",
175 "//third_party/eigen3",
176 ],
177)
178
179tf_kernel_library(
180 name = "index_ops_kernel_argmax_float_2d",
181 srcs = ["index_ops_kernel_argmax_float_2d.cc"],
182 # Makes the custom-call function visible to LLVM during JIT.
183 linkopts = export_dynamic_linkopts,
184 visibility = ["//visibility:public"],
185 deps = [
186 "//tensorflow/core:framework_lite",
187 "//third_party/eigen3",
188 ],
189)
190
191# -----------------------------------------------------------------------------
192
193filegroup(
194 name = "all_files",
195 srcs = glob(
196 ["**/*"],
197 exclude = [
198 "**/METADATA",
199 "**/OWNERS",
200 ],
201 ),
202 visibility = ["//tensorflow:__subpackages__"],
203)