From fc7361081f88321fdaf4ab58e1939e71faf44ddf Mon Sep 17 00:00:00 2001 From: Luke Iwanski Date: Thu, 22 Jun 2017 01:00:43 +0100 Subject: [PATCH] [OpenCL] Registers RGBToHSV and HSVToRGB (#91) (#10848) * [OpenCL] Added RGBToHSV and HSVToRGB * Aligning '\' --- tensorflow/core/kernels/colorspace_op.cc | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tensorflow/core/kernels/colorspace_op.cc b/tensorflow/core/kernels/colorspace_op.cc index d65a34fd735..ba100b32e7d 100644 --- a/tensorflow/core/kernels/colorspace_op.cc +++ b/tensorflow/core/kernels/colorspace_op.cc @@ -35,6 +35,9 @@ namespace tensorflow { typedef Eigen::ThreadPoolDevice CPUDevice; typedef Eigen::GpuDevice GPUDevice; +#ifdef TENSORFLOW_USE_SYCL +typedef Eigen::SyclDevice SYCLDevice; +#endif template class RGBToHSVOp : public OpKernel { @@ -146,4 +149,16 @@ TF_CALL_float(REGISTER_GPU); TF_CALL_double(REGISTER_GPU); #endif +#ifdef TENSORFLOW_USE_SYCL +#define REGISTER_SYCL(T) \ + REGISTER_KERNEL_BUILDER(Name("RGBToHSV").Device(DEVICE_SYCL) \ + .TypeConstraint("T"), \ + RGBToHSVOp); \ + REGISTER_KERNEL_BUILDER(Name("HSVToRGB").Device(DEVICE_SYCL) \ + .TypeConstraint("T"), \ + HSVToRGBOp); +TF_CALL_float(REGISTER_SYCL); +TF_CALL_double(REGISTER_SYCL); +#endif + } // namespace tensorflow