diff options
author | Jonathan Hseu <jhseu@google.com> | 2016-12-22 15:38:30 -0800 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2016-12-22 15:48:41 -0800 |
commit | bed8383c27a0a7225e6fc7ff59a2cd6388fb4d09 (patch) | |
tree | b70cfc88f95f318195f8610ffb960e98604348d1 /tensorflow/core/kernels/shape_ops.cc | |
parent | 1e5bd8cdd62033d1f7ea928fcbec521bb48bb1f5 (diff) |
Merge changes from github.
Change: 142805270
Diffstat (limited to 'tensorflow/core/kernels/shape_ops.cc')
-rw-r--r-- | tensorflow/core/kernels/shape_ops.cc | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/tensorflow/core/kernels/shape_ops.cc b/tensorflow/core/kernels/shape_ops.cc index 7ff812cf27..496865de02 100644 --- a/tensorflow/core/kernels/shape_ops.cc +++ b/tensorflow/core/kernels/shape_ops.cc @@ -210,6 +210,43 @@ REGISTER_KERNEL_BUILDER(Name("ShapeN") ShapeNOp<int64>); #endif +#if TENSORFLOW_USE_SYCL +#define REGISTER_SYCL_KERNEL(type) \ + REGISTER_KERNEL_BUILDER(Name("ShapeN") \ + .Device(DEVICE_SYCL) \ + .HostMemory("output") \ + .TypeConstraint<int32>("out_type") \ + .TypeConstraint<type>("T"), \ + ShapeNOp<int32>); \ + REGISTER_KERNEL_BUILDER(Name("ShapeN") \ + .Device(DEVICE_SYCL) \ + .HostMemory("output") \ + .TypeConstraint<int64>("out_type") \ + .TypeConstraint<type>("T"), \ + ShapeNOp<int64>) + +TF_CALL_NUMBER_TYPES_NO_INT32(REGISTER_SYCL_KERNEL); +#undef REGISTER_SYCL_KERNEL + +// 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("ShapeN") + .Device(DEVICE_SYCL) + .HostMemory("input") + .HostMemory("output") + .TypeConstraint<int32>("T") + .TypeConstraint<int32>("out_type"), + ShapeNOp<int32>); +REGISTER_KERNEL_BUILDER(Name("ShapeN") + .Device(DEVICE_SYCL) + .HostMemory("input") + .HostMemory("output") + .TypeConstraint<int32>("T") + .TypeConstraint<int64>("out_type"), + ShapeNOp<int64>); +#endif // TENSORFLOW_USE_SYCL + class RankOp : public OpKernel { public: explicit RankOp(OpKernelConstruction* ctx) : OpKernel(ctx) {} |