aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/core/kernels/aggregate_ops.cc
diff options
context:
space:
mode:
Diffstat (limited to 'tensorflow/core/kernels/aggregate_ops.cc')
-rw-r--r--tensorflow/core/kernels/aggregate_ops.cc18
1 files changed, 18 insertions, 0 deletions
diff --git a/tensorflow/core/kernels/aggregate_ops.cc b/tensorflow/core/kernels/aggregate_ops.cc
index b41e438b2b..50d0cc1727 100644
--- a/tensorflow/core/kernels/aggregate_ops.cc
+++ b/tensorflow/core/kernels/aggregate_ops.cc
@@ -28,6 +28,9 @@ namespace tensorflow {
typedef Eigen::ThreadPoolDevice CPUDevice;
typedef Eigen::GpuDevice GPUDevice;
+#ifdef TENSORFLOW_USE_SYCL
+typedef Eigen::SyclDevice SYCLDevice;
+#endif // TENSORFLOW_USE_SYCL
template <typename Device, typename T>
class AddNOp : public OpKernel {
@@ -152,6 +155,21 @@ REGISTER_KERNEL_BUILDER(Name("AddN")
AddNOp<CPUDevice, int32>);
#endif // GOOGLE_CUDA
+#ifdef TENSORFLOW_USE_SYCL
+REGISTER_ADDN(float, SYCL);
+REGISTER_ADDN(double, SYCL);
+
+// A special GPU kernel for int32.
+// TODO(b/25387198): Also enable int32 in device memory. This kernel
+// registration requires all int32 inputs and outputs to be in host memory.
+REGISTER_KERNEL_BUILDER(Name("AddN")
+ .Device(DEVICE_SYCL)
+ .TypeConstraint<int32>("T")
+ .HostMemory("inputs")
+ .HostMemory("sum"),
+ AddNOp<CPUDevice, int32>);
+#endif // TENSORFLOW_USE_SYCL
+
#undef REGISTER_ADDN
} // namespace tensorflow